aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-json.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-03JSON: add "Display JSON in raw form"Huang Qiangxiong1-2/+200
2023-01-03JSON: fix a displaying two dimensional array bug in compact formHuang Qiangxiong1-0/+17
2022-12-03wmem: Remove strbuf max size parameterJoão Valverde1-1/+1
This parameter was introduced as a safeguard for bugs that generate an unbounded string but its utility for that purpose is doubtful and the way it is being used creates problems with invalid truncation of UTF-8 strings. Rename wmem_strbuf_sized_new() with a better name.
2022-10-31packet-json: move away from `wmem_packet_scope()`David Perry1-23/+23
2022-10-19json: Add media type application/3gppHal+jsonAndersBroman1-0/+1
2022-10-15Use wmem_strbuf_append_unichar_repl() to append a REPLACEMENT CHARACTER.Guy Harris1-1/+1
Replace several instances in which a REPLACEMENT CHARACTER was being appended to a wmem_strbuf with a call to wmem_strbuf_append_unichar_repl(). This reduces the number of explicit 0x00fffd or 0xfffd or... in the code.
2022-10-15JSON: Clean up stripping of double quotes in membersJoão Valverde1-43/+37
2022-10-15JSON: Fix validation of UTF-8João Valverde1-70/+25
Instead of trying to rewrite the validation of UTF-8 for the nth time first extract a validated string from the parser with tvb_get_string_enc() and then do the post-processing on that (unescape, etc.).
2022-10-15JSON: Add preference to enable "unescaping" stringsJoão Valverde1-5/+22
2022-10-04JSON: add seperate 3GPP fileJoakim Karlsson1-953/+4
Moving specific 3GPP keys handle to its own file This will also enable custom JSON string dissector
2022-09-30JSON: Add New SupportFeature Negotiation Bits 3GPP TS 29.512 V17.7.0Anders Broman1-2/+79
2022-08-19Use `register_dissector()` for more protocolsDavid Perry1-2/+2
2022-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-1/+1
Do not require a useless ENC_NA parameter for string encodings. FT_STRING and FT_STRINGZ types don't have any ndianness. Follow-up to 6ec429622c9258eefd388caf21ce92ab5b9f54b4.
2022-02-07json: Handle application/senml+jsonStig Bjørlykke1-0/+2
Add handling of application/senml+json and application/sensml+json.
2022-01-13JSON: add 3GPP Supported Features handlingJoakim Karlsson1-7/+693
Format defined in TS29.571, ch5.2.2. First API (NPCF) filled from TS29.512, ch5.8
2021-12-15JSON: Remove unnecessary hfindex lookupJoão Valverde1-6/+3
2021-12-15JSON: add handling of 3GPP NAS-5G IEsJoakim Karlsson1-8/+62
2021-12-09JSON: Convert to old proto tree APIJoão Valverde1-115/+142
Related with #17774.
2021-12-03epan: Remove STR_ASCII and STR_UNICODEJoão Valverde1-7/+7
These display bases work to replace unprintable characters so the name is a misnomer. In addition they are the same option and this display behaviour is not something that is configurable. This does not affect encodings because all our internal text strings need to be valid UTF-8 and the source encoding is specified using ENC_*. Remove the assertion for valid UTF-8 in proto.c because tvb_get_*_string() must return a valid UTF-8 string, always, and we don't need to assert that, it is expensive.
2021-09-29JSON: enable Binary data lookup on ArrayJoakim Karlsson1-0/+3
2021-09-28JSON: enable Binary data also for non-compactJoakim Karlsson1-13/+24
2021-09-16tvbparse: explicitly memory-scope parserEvan Huus1-1/+1
Avoids the use of the global memory pool in favour of one the compiler actually knows must be in scope. Also delete a few-hundred lines of if-0ed code that hadn't been active in 15+ years.
2021-09-06json: Fix Dead Store found by Clang AnalyzerAlexis La Goutte1-4/+0
packet-json.c:365:7: warning: Value stored to 'is_valid_unicode_character' is never read [deadcode.DeadStores] packet-json.c:371:7: warning: Value stored to 'is_valid_unicode_character' is never read [deadcode.DeadStores] packet-json.c:383:8: warning: Value stored to 'is_valid_unicode_character' is never read [deadcode.DeadStores] packet-json.c:389:8: warning: Value stored to 'is_valid_unicode_character' is never read [deadcode.DeadStores]
2021-08-24JSON: adding more 3GPP EPS IEsJoakim Karlsson1-11/+82
2021-07-21JSON: correction of 3gpp ueEpsPdnConnectionJoakim Karlsson1-2/+2
2021-07-18json: fix buffer overflow in string_unescape()Developer Alexander1-151/+287
Fixes a potential buffer overflow issue in string_unescape() with a redesign to be more robust against invalid input. It makes use of wmem_strbuf API now. Closes #17475
2021-07-07Fix compiler warning in packet-json.cDavid Perry1-5/+0
Clang gives a fatal warning about "explicitly assigning value of variable of type 'int' to itself". The statement (and the `if` around it) are redundant, so this removes both.
2021-07-06json: improved path based filteringDeveloper Alexander1-220/+390
It is the intention to enable more precise filtering for json. 6 changes were made for this: - 'json.member' becomes filterable as a string field with the key of the member. Before the key was only appended as text but was not filterable. - Every item gets a field 'path' which allows to filter for elments which are at a specific position within the json. To make anonymous arrays visible (no member key) they appear as '[]' in the path. (For example arrays in arrays) - Every string, number, true, false, true or null item gets a field 'path_with_value' which combines the path of this element with its value. This allows a filtering for values of elements at a specific position within the json. - Every string, number, true, false, true or null item gets a field 'member_with_value' which combines the key of this element with its value. This allows a filtering for specific key-values-pairs independently of the position within the json. -It is possible to hide 'path', 'path_with_value', 'member_with_value' by a preference called 'Hide extended path based filtering'. - If the provided buffer does not start with the json object but has some leading bytes which does not belong to the json object there is a new option to ignore these bytes. This behaviour can be enabled by the newly introduced preference 'Ignore leading non JSON bytes'.
2021-05-03JSON NaN value supportedTomas Kukosa1-0/+10
Change-Id: I0096d047fb6eab882ad943090f5c4a6c1864671a
2021-03-20json: add application/x-ndjson to the media types handled.Roman-Koshelev1-0/+1
2021-02-06Added support for application/json-patch+json (RFC 6902)Josip Medved1-0/+1
2020-11-26JSON: fix a typo introduced in g2baaab6cPascal Quantin1-18/+18
2020-11-26json: Make it possible to filter and sub dissect json keys and data.Anders Broman1-5/+122
2020-04-13Standardise IETF RFC and Draft URLs in dissectors.Martin Mathieson1-1/+1
Prefer: - html (rather than txt) - https Also includes the script check_dissector_urls.py, that can be used to find links in code and test them. Change-Id: Iafd8bb8948674a38ad5232bf5b5432ffb2b1251b Reviewed-on: https://code.wireshark.org/review/36821 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2020-02-13Introduce AudioCodes Debug Recording (ACDR) dissectorOrgad Shaneh1-2/+20
ACDR is a protocol over UDP that is used by AudioCodes devices for recording traffic to and from the device. It adds a header to each packet that contains extra data about the packet. For some packet types (like SIP), it also appends the IP and UDP/TCP headers of the sent/received packet. The dissector unwraps the ACDR header, and displays the packets with the original type (and when available, with the original addresses). Bug: 16275 Change-Id: I19ad90053a2ef73da80881dc5e94aa362de23ea3 Reviewed-on: https://code.wireshark.org/review/35417 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2020-01-14json: append in Protocol column when call by another dissectorJoakim Karlsson1-3/+5
ex HTTP2/JSON Change-Id: I1947a0d4739e41e03096a5b032656ebe858d2768 Reviewed-on: https://code.wireshark.org/review/35749 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-04json: add application/merge-patch+json to the media types handled.Joakim Karlsson1-0/+1
Change-Id: I09db950c4da59aa24da50715194be59f385b7032 Reviewed-on: https://code.wireshark.org/review/34952 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-13json: add application/problem+json to the media types handled.Anders Broman1-0/+1
Change-Id: I33a7d92f92dde154a567c92b69748fe9c556cebf Reviewed-on: https://code.wireshark.org/review/34270 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-06-12NGAP: Dissect N2 SM InformationAnders Broman1-0/+3
Change-Id: I05c334a7ba69986e9dee63e9b71839c6ae0d994f Reviewed-on: https://code.wireshark.org/review/33568 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-20wsutil: rename some wsjson functionsPeter Wu1-1/+1
Rename wsjson_unescape_json_string to json_decode_string_inplace (inspired by the g_base64_decode_inplace name). Rename wsjson_is_valid_json to json_validate (inspired by g_unichar_validate). Ideally json_parse is inlined with its user (sharkd_session.c), but that requires exporting the jsmn_init and jsmn_parse functions... Hence the dependency on jsmn.h remains in wsjson.h. Change-Id: I7ecfe3565f15516e9115cbd7e025362df2da5416 Reviewed-on: https://code.wireshark.org/review/30731 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-04When using the NEW_PROTO_TREE_API, the proto_tree_add... functions areJoerg Mayer1-3/+3
"redefined" to handle the same way as before. In dissectors using the new API, add all currently used proto_tree_add_xxx functions to the list of functions that take care of NEW_PROTO_TREE_API changes. Modify the dissectors that worked around the missing change. Change-Id: Ib6d6ec2c225d96c98c2a8f507648d7ad4bfb6c68 Reviewed-on: https://code.wireshark.org/review/28002 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2018-04-21wsutil: convert one leftover function in wsjson.Dario Lombardo1-2/+2
Change-Id: I8d65389dfd6bf373e751e3373d9f22d733d9b5e9 Reviewed-on: https://code.wireshark.org/review/27069 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-21wsutil: rename wsjsmn to wsjson.Dario Lombardo1-1/+1
This puts more distance between the caller and the underlying library. At the moment we're using libjsmn, but other libraries (like json-glib) could be used. Change-Id: I1431424a998fc8188ad47b71d6d95afdc92a3f9e Reviewed-on: https://code.wireshark.org/review/27055 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-04Dissect JSON-RPC over TCP or UDPMichail Koreshkov1-0/+2
Dissect protocols like OVSDB which transfer JSON over TCP or UDP Change-Id: I7c918b6a5fbef9568fc4258fd57bad39ff2d9203 Reviewed-on: https://code.wireshark.org/review/26726 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08json: Add for decode-as udp.portStig Bjørlykke1-0/+2
Change-Id: Ibd03cd64aa8de7fee8ad3cc7b7cc61e0370399ff Reviewed-on: https://code.wireshark.org/review/25681 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-02-01json: Adjust whitespaceStig Bjørlykke1-11/+9
Change-Id: Ifa10ca415d291ab6b0cb06c475ac8697b5fc96da Reviewed-on: https://code.wireshark.org/review/25548 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-29Display JSON in compact formMichail Koreshkov1-2/+178
JSON will be display like in browswer developer tool (Firefox or Chrome). Change-Id: Ib504f4828d9fd8d25d9564b93717007ac021713c Reviewed-on: https://code.wireshark.org/review/25474 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-26coap: Added dissection for LWM2M JSON inside CoAP protocolAnton Butenko1-0/+1
Change-Id: I29429f731b7e2f25568d44de455816ac70e079b6 Reviewed-on: https://code.wireshark.org/review/23740 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>