aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
AgeCommit message (Collapse)AuthorFilesLines
2021-09-29proto: Delay deleting heur_dtbl_entry_t in heur_dissector_deleteStig Bjørlykke1-0/+6
Add the heur_dtbl_entry_t entry as deregistered when deleting a heuristics dissector. The UDP dissector is storing a pointer to this in proto_data and may access the entry during reload Lua plugins until all packets are redissected.
2021-09-26USB HID: Parse bit fields with correct bit orderTomasz Moń1-14/+28
Implement little endian support for tvb_get_bits family of functions. The big/little endian refers to bit numbering within an octet. In big endian, the most significant bit is considered bit 0, while in little endian the least significant bit is considered bit 0. Add encoding parameters to proto tree bits format family functions. Specify ENC_BIG_ENDIAN in all dissectors using these functions except in USB HID that requires ENC_LITTLE_ENDIAN to work correctly. When formatting bits values, always display most significant bit on the leftmost position regardless of the encoding. This results in no gaps between octets and makes the displayed value comprehensible. Close #4478 Fix #17014
2021-08-27Thrift: Complete handling of Binary & Compact protocolsTriton Circonflexe1-1/+9
- Make sure reassembly requests & errors are properly propagated from any point in the PDU, no matter how many sub-structure levels. - Handle the sub-dissection methods as well: - Ensure the sub-dissection methods handle errors from previous calls. - Reduce the error handling needed in sub-dissector implementations. - Add missing sub-dissection methods for list, set, and map. - Add the handling of sub-structure. - Handle Compact protocol in addition to the existing binary protocol. - Include and improve MR !3171 - Handle reassembly the same way as for binary protocol. - Handle sub-dissection with the same functions. => Sub-dissectors only depend on .thrift files. Additional changes: - Use of constants instead of hard-coded values. - Removed U64 support (never supported by thrift code generator, only referenced in the C++ thrift library header but not supported in reality. - Removed references to UTF-8 and UTF-16 string for the same reason. - Replaced references to UTF-7 string with just string (same reason). - Replaced references to byte with i8 as the documentation explicitly states that byte is a compatibility name. Documentation reference: - https://thrift.apache.org/developers - https://thrift.apache.org/docs/idl.html - https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md - https://erikvanoosten.github.io/thrift-missing-specification/ - https://diwakergupta.github.io/thrift-missing-guide/ Closes #16244 Additional changes: - Add authors and improve consistency - Fix typo and clarify documentation
2021-07-26Move epan/wmem/wmem_scopes.h to epan/João Valverde1-1/+1
This header was installed incorrectly to epan/wmem_scopes.h. Instead of creating additional installation rules for a single header in a subfolder (kept for backward compatibility) just rename the standard "epan/wmem/wmem.h" include to "epan/wmem_scopes.h" and fix the documentation. Now the header is installed *correctly* to epan/wmem_scopes.h.
2021-05-20Add ENC_APN_STR to handle APN stringsAndersBroman1-0/+1
2021-02-10Add ENC_TIME_NSECS timestamp encodingNicolás Alvarez1-0/+4
Add a new timestamp encoding format ENC_TIME_NSECS, like ENC_TIME_SEC but for nanosecond values. Needed for my work-in-progress dissector for Apple push notifications.
2021-02-06Avoid exposing HAVE_PLUGINS in the public APIJoão Valverde1-5/+0
Instead *_register_plugin() is turned into a noop (with a warning). The test suit is failing with ENABLE_PLUGINS=Off (it was already failing before and this patch didn't affect that). Closes #17202.
2021-02-04Minor changes to ENC_TIME documentationNicolás Alvarez1-5/+5
- Fix duplicate "are are". - Fix NTP epoch year in ENC_TIME_NTP docs (572b80d2 fixed it in the README but not in proto.h). - Remove completely redundant "(ie. )" clauses.
2021-02-03Update documentation for ENC_TIME_* constantsNicolás Alvarez1-0/+7
ENC_TIME_MIP6 and ENC_TIME_CLASSIC_MAC_OS_SECS were added recently by factoring them out of specific dissectors, but they weren't documented. I added documentation, based on comments in the dissector code they came from.
2021-01-27UDP: Clean up handling of zero-valued UDP checksumsJoão Valverde1-1/+2
Replace the somewhat weird field format "[Checksum: [missing]]" with "Checksum: 0x0000 [ignored or illegal value]" Improve code redability and fix XXX comment.
2021-01-17Correct comment on expert valuesJaap Keuter1-1/+1
2020-12-10Introduce ENC_BCD_ODD_NUM_DIG in order to handle odd number of digitsAnders Broman1-1/+7
2020-11-23proto(.h): fix -WdocumentationAlexis La Goutte1-1/+1
proto.h:2373:9: warning: parameter 'fi' not found in the function declaration [-Wdocumentation]
2020-11-13Qt+epan: Print better-looking values in the packet diagram.Gerald Combs1-3/+13
Pull the value-formatting code in proto_custom_set into proto_item_fill_display_label. Use that in FieldInformation::toString instead of fvalue_to_string_repr. Fixes #16911.
2020-10-23QT/CLI: Move max tree items and depth to prefsJohn Thacker1-1/+1
Move the maximum number of tree items and maximum tree depth to preferences instead of hardcoded values. Refer to issue #12584 for an example VNC capture where real data exceeds the current limit.
2020-10-21Use iconv to support GB 18030 and EUC-KR, allow future encodingsJohn Thacker1-3/+16
Add support internally to using iconv (always present with glib) to convert strings from various encodings to UTF-8 (using REPLACEMENT CHARACTER as recommended), and use that to support GB 18030 and EUC-KR. Replace call directly to iconv in ANSI 637 for EUC-KR to new API. Update comments and documentation around character encodings. It is possible to replace the calls to iconv with an internal decoder later. Tested on Linux and on Windows (including with illegal characters). Closes #16630.
2020-10-11Add proto_tree_add_item_ret_ipv4().Guy Harris1-3/+7
Change some guint32's to ws_in4_addr while we're at it.
2020-10-02Clean up URLs.Guy Harris1-1/+4
Add ui/urls.h to define some URLs on various of our websites. Use the GitLab URL for the wiki. Add a macro to generate wiki URLs. Update wiki URLs in comments etc. Use the #defined URL for the docs page in WelcomePage::on_helpLabel_clicked; that removes the last user of topic_online_url(), so get rid of it and swallow it up into topic_action_url().
2020-09-28Add some more string encodings.Guy Harris1-42/+46
Add an encoding for "unpacked" 3GPP TS 23.038 7-bit strings, in which each code position is in a byte of its own, rather than with the code positions packed into 7 bits. Rename the packed encoding to explicitly indicate that it's packed. Add an encoding for ETSI TS 102 221 Annex A strings. Use the new encodings.
2020-09-12Add FT_STRINGZTRUNC.Guy Harris1-13/+11
FT_STRINGZPAD is for null-*padded* strings, where the field is in an area of specified length, and, if the string is shorter than that length, all bytes past the end of the string are NULs. FT_STRINGZTRUNC is for null-*truncated* strings, where the field is in an area of specified length and, if the string is shorter than that length, there's a null character (which might be more than one byte, for UCS-2, UTF-16, or UTF-32), and anything after that is not guaranteed to have any particular value. Use IS_FT_STRING() in some places rather than enumerating all the string types, so that those places get automatically changed if the set of string types changes.
2020-08-11epan: Fixup proto_item_set_bits_offset_len.Gerald Combs1-2/+2
Export proto_item_set_bits_offset_len and fix In file included from ../epan/dfilter/dfilter.h:18: ../epan/proto.h:1113:11: warning: parameter 'bits_offset' is already documented [-Wdocumentation] * @param bits_offset The new length in bits. ^~~~~~~~~~~ ../epan/proto.h:1112:5: note: previous documentation * @param bits_offset The number of bits from the beginning of the field. ^ ~~~~~~~~~~~ Change-Id: Ib171ce38607b9656baea5eb7a3e6aee3b99ddbac Reviewed-on: https://code.wireshark.org/review/38115 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-10Qt: Add a packet diagram view.Gerald Combs1-1/+8
Add a new top-level view that shows each packet as a series of diagrams similar to what you'd find in a networking textook or an RFC. Add proto_item_set_bits_offset_len so that we can display some diagram fields correctly. Bugs / to do: - Make this a separate dialog instead of a main window view? - Handle bitfields / flags Change-Id: Iba4897a5bf1dcd73929dde6210d5483cf07f54df Reviewed-on: https://code.wireshark.org/review/37497 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-02libwireshark: define ENC_ANTI_HOST_ENDIAN in epan/proto.h.Guy Harris1-2/+4
We have two places where we want to dissect some fields as being in the opposite byte ordere from the host on which we're running; move the definition of ENC_ANTI_HOST_ENDIAN from packet-socketcan.c to proto.h, and use it in packet-enc.c. Change-Id: I1d0f9b037fe3b8ca6ed774a11063ba518a3922bf Reviewed-on: https://code.wireshark.org/review/38023 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
2020-06-19Fix the type of arrays of pointers to hf_ values for bitfield routines.Guy Harris1-11/+11
The static arrays are supposed to be arrays of const pointers to int, not arrays of non-const pointers to const int. Fixing that means some bugs (scribbling on what's *supposed* to be a const array) will be caught (see packet-ieee80211-radiotap.c for examples, the first of which inspired this change and the second of which was discovered while testing compiles with this change), and removes the need for some annoying casts. Also make some of those arrays static while we're at it. Update documentation and dissector-generator tools. Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc Reviewed-on: https://code.wireshark.org/review/37517 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-28Clean up the encoding value definitions.Guy Harris1-113/+150
Group them by the data types for which they're used, starting with the byte-order definitions which (with the inclusion of ENC_NA) are used with all types. Put all the ones used for strings together, starting with the character encodings, with the Zigbee flag and the flags for "this is a string but we're going to interpret it as a byte array or time stamp". Make ENC_CHARENCODING_MASK equal to ENC_STR_MASK; no, there's no reason for ENC_STR_MASK to replace ENC_CHARENCODING_MASK - the opposite should happen, as ENC_CHARENCODING_MASK at least specifies what the bits set in it are used for, namely character encodings. If all #defines for strings should have _STR_ in them, start with the character encoings. Change-Id: I072420f313086153b4ea4034911fc293453dea00 Reviewed-on: https://code.wireshark.org/review/36962 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
2020-04-28proto(.h): fix parameter (it is pi not it) like on proto.cAlexis La Goutte1-20/+20
Change-Id: I3cc02538e3a9293e2fd3af7feaee59ef360ca8da Reviewed-on: https://code.wireshark.org/review/36956 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-27proto(.h): fix -WdocumentationAlexis La Goutte1-1/+1
parameter 'ti' not found in the function declaration [-Wdocumentation] Change-Id: I4080cf118c3a81fd47fd4c32e8809d83256893dd Reviewed-on: https://code.wireshark.org/review/36955 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-27Add string encoding values for various BCD encodings, and use them.Guy Harris1-0/+3
Add some ENC_ values for various flavors of packed BCD, and use that instead of explicitly calling tvb_bcd_dig_to_wmem_packet_str() and adding the result. Change-Id: I07511d9d09c9231b610c121cd6ffb3b16fb017a9 Reviewed-on: https://code.wireshark.org/review/36952 Reviewed-by: Guy Harris <gharris@sonic.net>
2020-04-25Add a routine to get the representation of a protocol tree item and use it.Guy Harris1-1/+7
Add proto_item_get_display_repr(), which returns a string, allocated with a specified wmem scope, containing the display representation of the value of a proto_item. Use it in the LLDP dissector, to append that string to the parent protocol tree item; use packet scope, so it doesn't hang around forever (the previous code used the NULL scope, meaning explicit freeing was required, but it wasn't explicitly freeing the value, so it was leaking). Change-Id: I146380118833b1daef9dea8bd9463001e5b9325f Reviewed-on: https://code.wireshark.org/review/36931 Petri-Dish: Guy Harris <gharris@sonic.net> Reviewed-by: Guy Harris <gharris@sonic.net>
2020-01-21Add support for "classic Mac OS" timestamps and use them in file-mp4.c.Guy Harris1-14/+15
Those times are in seconds since January 1, 1904, 00:00:00 (proleptic?) UTC. MPEG-4 Part 14 (MP4) is based on QuickTime, so it uses classic Mac OS time stamps, in seconds. Change-Id: Ibcd7faf1b119d8acbb294c95b66ca0d1fb70cbb3 Reviewed-on: https://code.wireshark.org/review/35886 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-01-11Implement all mapping macros for the new proto tree APIJaap Keuter1-29/+221
The new proto tree API uses mapping macros to map calls to the proto_tree_add_* functions. These were defined for the up til then in use functions. In the mean time functions have been added and workarounds for non mapped functions were used. This change adds the missing mapping macros so that now all proto_tree_add_* functions taking a hfi address are mapped properly. Also fix two dissectors that failed the mapping. Change-Id: I91d800439fe2c4487ca53c00c44d7aa46ce70e1d Reviewed-on: https://code.wireshark.org/review/35743 Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Jörg Mayer <jmayer@loplof.de> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2019-11-07epan: Make proto_tree_add_oid* usable from DLLs.Gerald Combs1-3/+3
Prefix proto_tree_add_oid, proto_tree_add_oid_format_value, and proto_tree_add_oid_format with WS_DLL_PUBLIC. Change-Id: Ia3fa8fb762869bb1afa1c1f57a3a5f02aa126a3f Reviewed-on: https://code.wireshark.org/review/35018 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2019-10-28wslua: Fix memleak of unregistered ProtoField stringsStig Bjørlykke1-0/+7
If a ProtoField object was created, but not linked to a Proto, then the strings field and all elements (depending on type) would leak. This is a follow-up to g79fef2ae and fixes the real issue in g44870fb1. Change-Id: I01880a92bb20fae45f68c754b07daeb07630deec Reviewed-on: https://code.wireshark.org/review/34872 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Vasil Velichkov <vvvelichkov@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2019-09-05kafka: Cleanup to use "native" APIs.Michael Mann1-0/+11
Add "native" support for the "zig-zag" version of a varint in proto.[ch] and tvbuff.[ch]. Convert the use of varint in the KAFKA dissector to use the (new) "native" API. Ping-Bug: 15988 Change-Id: Ia83569203877df8c780f4f182916ed6327d0ec6c Reviewed-on: https://code.wireshark.org/review/34386 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-29Add proto_tree_add_item_ret_time_stringMichael Mann1-1/+23
A few dissectors need the functionality of adding a time field to a proto_tree while also needing the "time to string" value (typically to show on a tree above). The functionality to do "get value from tvb and convert to string" was being done in packet-ntp.c. Instead proto_tree_add_item_ret_time_string can be used with various encoding to get the necessary functionality with less code duplication. ENC_TIME_MIP6 was added as a result of the refactoring. ABSOLUTE_TIME_NTP_UTC was added as another potential "base" type for time fields. Change-Id: Ie460c33370b0af59ef60bdab893ce9d6eb23b94f Reviewed-on: https://code.wireshark.org/review/34390 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-15Add support for the ISO 646 "Basic code table" encoding.Guy Harris1-0/+2
The "Basic code table" in ISO 646 is mostly ASCII, but some code points either 1) have more than one glyph that can be assigned to them or 2) have no glyph assigned to them. National versions choose one of the two glyphs for the code points in group 1) and assign specific glyphs to the code points in group 2); the International Reference Version assigns the same glyphs to those code points as does ASCII. For the "Basic code table" encoding, we map the code points in groups 1) and 2) to a REPLACEMENT CHARACTER; additional encodings can be added for the national versions. Add ENC_ISO_646_IRV (International Reference Version) as an alias for ENC_ASCII. Expand some comments, and add some comments, while we're at it. Change-Id: I4f1b5e426ec193775e919731c5cae1224dc65115 Reviewed-on: https://code.wireshark.org/review/33941 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-11Doxygen: Fix some warnings.Anders Broman1-1/+1
Change-Id: I0344d44d08d2e159c895d693500403c067039a44 Reviewed-on: https://code.wireshark.org/review/33894 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-10Doxygen: Try to fix reported warnings.Anders Broman1-1/+1
Change-Id: Ia2e08265681c6700328a5782a70c3108eeb443bf Reviewed-on: https://code.wireshark.org/review/33887 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-08Have routines to add a protocol tree item and return a display string.Guy Harris1-21/+49
That way, even if we're not building a protocol tree, so that you don't get protocol tree items, you can get the display string, e.g. to use in a column. Replace the use of the "get display string" routines with calls to those routines. Change-Id: I23e3e88838bdf837d8660c271f78c79b7d1c5620 Reviewed-on: https://code.wireshark.org/review/33519 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-06-07Improve handling of binary data that *might* be text.Guy Harris1-9/+37
Add a BASE_SHOW_ASCII_PRINTABLE flag for the "display" field, to use with FT_BYTES and FT_UINT_BYTES fields; it specifies that, if the field consists solely of printable ASCII characters, its value be displayed as a string, in quotes. Have a routine hfinfo_format_bytes() to do that formatting, depending on the display field value. Add routines to fetch the display value of string and FT_BYTES/FT_UINT_BYTES fields; for strings, it's the result of hfinfo_format_text(), and for byte arrays, it's the result of hfinfo_format_bytes(). Use BASE_SHOW_ASCII_PRINTABLE for extended attribute data in SMB and SMB2. Use the routines in question for extended attribute names (string) and data (bytes). That keeps us from displaying non-text extended attribute data as if it were text. Document BASE_SHOW_ASCII_PRINTABLE. Change-Id: I24dcf459c14f00985e4daaf9b58f5933964eabd8 Reviewed-on: https://code.wireshark.org/review/33517 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-25Add Windows code page 1252.Guy Harris1-1/+1
While we're at it, add the Euro to code page 1251, expand the comments for 1250 and 1251 and some DOS code pages, and add support for code page 1251 to tvb_get_stringz_enc(). Change-Id: I053d58f87cac26ad7c109e2f1cd8807ffec0622d Reviewed-on: https://code.wireshark.org/review/33342 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-24"Zigbee" encoding is not a character encoding or an integer encoding.Guy Harris1-2/+14
It's a rule for interpretation of the length field of counted-string and counted-octet-string fields. This means it's 1) not a general rule for interpreting integers and 2) not a character encoding, as it also applies to octet strings and, even for character strings, it's *orthogonal* to the character encoding. Therefore, it should *not* be one of the character encoding values; it should be a bit flag. Make it so. This means that 1) a character encoding can be specified for Zigbee Cluster Library strings (they appear to have multiple character encodings possible); 2) the test of it that tested it as if it were a flag will no longer get confused by character encodings that set one or more of the bits in the old encoding value; 3) you don't have to special-case the encoding value passed to get_uint_value(). Put in a comment emphasizing that values that aren't character encodings should *not* be placed in the set of character encodings. Change-Id: I8f50aaee8ca60b0781044287e9b38111de38c81f Reviewed-on: https://code.wireshark.org/review/33341 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-04-26proto.h: avoid warning about not really deprecated (Clang) (v2)Alexis La Goutte1-2/+2
proto.h:853:5: warning: declaration is marked with '\deprecated' command but does not have a deprecation attribute [-Wdocumentation-deprecated-sync] proto.h:866:5: warning: declaration is marked with '\deprecated' command but does not have a deprecation attribute [-Wdocumentation-deprecated-sync] Change-Id: I50a462c7a05f36ba60484980fd8ae9026effc047 Reviewed-on: https://code.wireshark.org/review/32922 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-07proto.h: avoid warning about not really deprecated (Clang)Alexis La Goutte1-2/+2
proto.h:853:5: warning: declaration is marked with '\deprecated' command but does not have a deprecation attribute [-Wdocumentation-deprecated-sync] proto.h:866:5: warning: declaration is marked with '\deprecated' command but does not have a deprecation attribute [-Wdocumentation-deprecated-sync] Change-Id: I6da6048b2c4e2860f655ae595f4f800587c63217 Reviewed-on: https://code.wireshark.org/review/32770 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-47/+88
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-13proto.h: fix indentation and add modeline.Dario Lombardo1-347/+353
Change-Id: I1d1adb6456c4a80f2a157cb29dc19c63755ee3fd Reviewed-on: https://code.wireshark.org/review/31485 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-04add encoding windows 1251, cp855, cp866kanidef1-2/+3
Change-Id: I0e8507cf63d89942167ca579ef304bc3d679346e Reviewed-on: https://code.wireshark.org/review/31316 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-20Replace JSON-GLib by custom JSON dumper libraryPeter Wu1-2/+0
The (optional) JSON-GLib library adds dependencies on GObject, GIO. For statically linked oss-fuzz builds it also adds libffi and more. To avoid these dependencies, replace JSON-GLib by some custom code. This allows `tshark -G elastic-mapping` to be enabled by default without extra deps. API design goals of the new JSON dumper library: - Small interface without a lot of abstraction. - Avoid memory allocations if possible (currently none, but maybe json_puts_string will be replaced to improve UTF-8 support). - Do not implement parsing, this is currently handled by jsmn. Methods to open/close array/objects and to set members are inspired by the JsonGlib interface. The interfaces to write values is inspired by the sharkd code (json_puts_string is also borrowed from that). The only observed differences in the tshark output: - JSON-GLib ignores duplicates, json_dumper does not and may produce duplicates and currently print two "ip.opt.sec_prot_auth_unassigned". - JSON-GLib adds a space before a colon (unimportant formatting detail). - (Not observed, but UTF-8 strings will be wrong like bug 14948.) A test was added to catch changes in the tshark output. I also fuzzed json_dumper with libFuzzer + UBSAN/ASAN and fixed an off-by-one error. Change-Id: I0c85b18777b04d1e0f613a3d59935ec59be87ff4 Link: https://www.wireshark.org/lists/wireshark-dev/201811/msg00052.html Reviewed-on: https://code.wireshark.org/review/30732 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-01Fix "Follow TLS Stream" after ssl -> tls renamePascal Quantin1-2/+2
Change-Id: I53be2ae6fae135b2da98ae95deac535bcd37af74 Reviewed-on: https://code.wireshark.org/review/30473 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-11-01Revert "FT_BYTES: fix dissection of FT_BYTES when using SEP_SPACE and "NONE" ↵Pascal Quantin1-7/+6
options" This reverts commit 0457e6041942776ecff9d4377fc0ce5a340dbb7a. Change-Id: Id39722872efbe98648754d7543da7ae5b08f8b67 Reviewed-on: https://code.wireshark.org/review/30451 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>