aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
AgeCommit message (Collapse)AuthorFilesLines
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>
2018-11-01FT_BYTES: fix dissection of FT_BYTES when using SEP_SPACE and "NONE" optionsJeremy Martin1-6/+7
SEP_SPACE and BASE_NONE both default to colon (:). Fix SEP_SPACE and add SEP_NONE Bug: 15253 Change-Id: Ib5db997714414370b08ffb9458c73d4aeef6aacf Reviewed-on: https://code.wireshark.org/review/30447 Reviewed-by: Jeremy Martin <boardermartin@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-17wslua: Add support for base.RANGE_STRING handling.Richard Sharpe1-1/+1
A range string is passed as a table of tables, eg: range_string = { { 0, 24, "Some string for values 0 to 24" }, { 25, 25, "The string for value 25" }, { 26, 255, "The string for the remainder" } } Included is a minimal Lua test for range strings and value strings (which did not have one previously.) It will take more time than I currently have to figure out how to do a more exhaustive test. Also fixed some grammar issues in error messages along the way. Change-Id: Ia9d1efc8adabb6528c4bdcf1624c9ede49e2fdc6 Reviewed-on: https://code.wireshark.org/review/30211 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2018-09-20proto.h: add type checks for VALS/VALS64/VALS_EXT_PTR/TFS/RVALSPeter Wu1-5/+8
These macros were evil as they silently ignored bad casts. Together with an updated checkAPIs.pl, this should reduce the likelihood of errors. Change-Id: I40ecc48a57b2061b4c65db4f4f7fffff21f159a8 Reviewed-on: https://code.wireshark.org/review/29757 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-08-31Add support for protocol aliases. Switch BOOTP to DHCP.Gerald Combs1-0/+12
Add support for aliasing one protocol name to another and for filtering using aliased fields. Mark aliased fields as deprecated. Rename the BOOTP dissector to DHCP and alias "bootp" to "dhcp". This lets you use both "dhcp.type" and "bootp.type" as display filter fields without having to duplicate all 500+ DHCP/BOOTP fields. To do: - Add checks to proto.c:check_valid_filter_name_or_fail? - Transition SSL to TLS. - Rename packet-bootp.c to packet-dhcp.c? Change-Id: I29977859995e8347d80b8e83f1618db441b10279 Ping-Bug: 14922 Reviewed-on: https://code.wireshark.org/review/29327 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>
2018-08-29epan: Remove unnecessary all protocols registration callbackJoão Valverde1-2/+3
We are exporting a registration function from libwireshark just to have it passed back as a callback. Seems unnecessary. Change-Id: I7621005c9be11691d319102326824c5e3520a6f3 Reviewed-on: https://code.wireshark.org/review/29328 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2018-07-02Get rid of trailing space.Guy Harris1-1/+1
Change-Id: Id68b01264ada02274b63d26141df8d99419de0f5 Reviewed-on: https://code.wireshark.org/review/28565 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-02Add new encoding names for seconds/{micro,nano}second time stamps.Guy Harris1-8/+14
Add ENC_TIME_SECS_NSECS and ENC_TIME_SECS_USECS; they make it more explicit (especially to those not familiar with UN*X data types) what the representation is, allow for ENC_TIME_SECS_MSECS etc. if they're needed, and match names such as ENC_TIME_SECS and ENC_TIME_MSECS. Change-Id: I6ab36fb4da70563587141cd65ffff8523477b0c4 Reviewed-on: https://code.wireshark.org/review/28564 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-02Update a comment.Guy Harris1-4/+8
Change-Id: I867e344b75281e4faa0998f71d8d99b364d5a1f8 Reviewed-on: https://code.wireshark.org/review/28562 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-26Remove code specific to older versions of Visual Studio.Gerald Combs1-1/+1
Remove -DBUILD_WINDOWS and sections of code that we no longer use. Bug: 14715 Change-Id: Iae1a950e2f52f4ce45fcf0ae5dea06c1172c3a28 Reviewed-on: https://code.wireshark.org/review/28466 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-04When using the NEW_PROTO_TREE_API, the proto_tree_add... functions areJoerg Mayer1-4/+53
"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-19tshark: improve -G elastic-mapping command by adding filters.Dario Lombardo1-1/+1
The generated elastic mapping file is huge and it can hassle softwares like Kibana. This change adds the ability to append desired filters that will appear in the mapping file. This change adds the option --elastic-mapping-filter <protocols> to tshark. Example: tshark -G elastic-mapping --elastic-mapping-filter ip,udp,dns make only those 3 protocols to appear in the mapping file. Change-Id: Ie2dcd6e44be2d084e8e50cd6554bd90178da4e38 Reviewed-on: https://code.wireshark.org/review/27001 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-04-18tshark: add -G elastic-mapping report.Dario Lombardo1-0/+5
This option generates an ElasticSearch mapping file as described here: https://www.elastic.co/blog/analyzing-network-packets-with-wireshark-elasticsearch-and-kibana It leverages the Glib-json library. Change-Id: Iff25f991e87d3da07bf06654e353fb785799dde9 Reviewed-on: https://code.wireshark.org/review/26848 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-03-25Clean up REPORT_DISSECTOR_BUG().Guy Harris1-42/+25
Have it take a format and argument list as arguments, and have the formatting done inside the reporting code. That way, we're not relying on any particular wmem scope working. If WIRESHARK_ABORT_ON_DISSECTOR_BUG is set, try to add the message to the crash information (currently only supported in macOS), and print it to the standard error, before crashing. We won't necessarily have a usable crash dump to analyze, so we can't rely on that to find the cause of the crash. Ping-Bug: 14490 Change-Id: I2b39169c45c84f2ada31efa1d413bd28c140f8f4 Reviewed-on: https://code.wireshark.org/review/26643 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-08epan: use SPDX indentifiers.Dario Lombardo1-13/+1
Skipping dissectors dir for now. Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa Reviewed-on: https://code.wireshark.org/review/25694 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-02Add ENC_VARINT_QUICAlexis La Goutte1-0/+5
Used to support variable length in QUIC protocol Bug: 13881 Change-Id: Ia274b1530152376c5fb4e364fc4cf5ab246be1b3 Reviewed-on: https://code.wireshark.org/review/24990 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Craig Jackson <cejackson51@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-29proto(.h): fix indent (align...)Alexis La Goutte1-1/+1
Change-Id: Ie3f41b76719a5e91c27b5ae2805f23cd26f1fa11 Reviewed-on: https://code.wireshark.org/review/25059 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-14Add new plugin type for libwiresharkJoão Valverde1-2/+1
Allow epan itself to be extended by plugins. Adds the following new plugin interfaces: void plugin_epan_init() void plugin_epan_dissect_init(epan_dissect_t *) void plugin_epan_dissect_cleanup(epan_dissect_t *) void plugin_epan_cleanup() void plugin_epan_register_all_protocols(register_cb, gointer) [OPTIONAL] void plugin_epan_register_all_handoffs(register_cb, gointer) [OPTIONAL] Any one of these can be an empty function but the first four must be present. The motivation for the change is a better way to implement a language binding other than registering a fake protocol and stuffing everything into a single dissector call (and maybe require an extra packet_info field) but I expect there would be other interesting use cases. Change-Id: I215d50750ac7561fe25fdcdcfbc6a3f351984785 Reviewed-on: https://code.wireshark.org/review/24813 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-12-14Refactor plugin registration and loadingJoão Valverde1-3/+10
Put different types of plugins (libwiretap, libwireshark) in different subdirectories, give libwiretap and libwireshark init routines that load the plugins, and have them scan the appropriate subdirectories so that we don't even *try* to, for example, load libwireshark plugins in programs that only use libwiretap. Compiled plugins are stored in subfolders of the plugin folders, with the subfolder name being the Wireshark minor version number (X.Y). There is another hierarchical level for each Wireshark library (libwireshark, libwscodecs and libwiretap). The folder names are respectively plugins/X.Y/{epan,codecs,wiretap}. Currently we only distribute "epan" (libwireshark) plugins. Change-Id: I3438787a6f45820d64ba4ca91cbe3c8864708acb Reviewed-on: https://code.wireshark.org/review/23983 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-11-22Add Zigbee encoding, ENC_ZIGBEEMichael Mann1-0/+2
Add the "special handling" of length = 0xFF for single byte or 0xFFFF for uint16 value means size of field to follow is 0. Ping-Bug: 14138 Change-Id: I0baa40f63152b9420a6569ca6cc5eba638fbc790 Reviewed-on: https://code.wireshark.org/review/24428 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Craig Jackson <cejackson51@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-19dissect_uleb128 -> tvb_get_varint/proto_tree_add_item_ret_lengthMichael Mann1-0/+3
Also update ENC_VARINT_PROTOBUF documentation while we're at it Change-Id: I72e1f9175adc0c6a8bb03ceddba04ffd4844a12e Reviewed-on: https://code.wireshark.org/review/24485 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-26Add a ws_in6_addr typedef for struct e_in6_addr.Guy Harris1-3/+3
That allows a parallel typedef of ws_in4_addr for guint32. Change-Id: I03b230247065e0e3840eb87635315a8e523ef562 Reviewed-on: https://code.wireshark.org/review/24073 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-15Add support for BASE_OUIMichael Mann1-1/+5
Modeled after BASE_PT_XXX, this will format a FT_UINT24 to look a OUI, in the form of: XX:XX:XX (Manufacturer Name) for display. For display filtering, it will treat the value as hexadecimal. It requires that FT_UINT24 be the field type. Change-Id: I8716ae4dfcd4e854764a2425e2ff13c50f571d52 Reviewed-on: https://code.wireshark.org/review/23869 Reviewed-by: Richard Sharpe Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-10Change FI_VARINT to account for FI_BITS_XXX flagsMichael Mann1-2/+2
FI_BITS_XXX were using bits 5-15 of the field_info->flags bitmask. Move FI_VARINT to be outside of that range. Change-Id: I92efcb5644cdbb562537d2813b611e583315874b Reviewed-on: https://code.wireshark.org/review/23871 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-09Add ENC_VARINT_PROTOBUFMichael Mann1-0/+8
Encoding of integer datatypes of Protocol buffers https://developers.google.cn/protocol-buffers/docs/encoding Change-Id: I9f6d65ddca099c15c0634984e9394131f98d35a9 Reviewed-on: https://code.wireshark.org/review/23813 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-08proto(.h): fix indent (use spaces)Alexis La Goutte1-2/+2
Change-Id: I029a9db40c8ca5a67bb1db69c50d8f08b7f59ab2 Reviewed-on: https://code.wireshark.org/review/23864 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-24Move DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME after ↵Guy Harris1-7/+7
__DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME(). That's consistent with the other DISSECTOR_ASSERT_FIELD_TYPE... macros. Change-Id: I1f5711b29ae8a440b0529373eb7903ff122ea18e Reviewed-on: https://code.wireshark.org/review/23681 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-06plugins: config.h must not be included by public headersJoão Valverde1-0/+1
For a sane plugin build environment. Include config.h as the first header in the .c file instead. Fix by moving required compiler attribute macros to a new "ws_attributes.h" API header. Change-Id: I34f58a927f68c1a0e59686c14d214825149749e1 Reviewed-on: https://code.wireshark.org/review/23400 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-06-26Parse enterprise-numbers at run timeJoão Valverde1-0/+2
"enterprise-numbers" is converted to tab-separated values and renamed "enterprises". Unused fields are stripped. PENs are stored in a hash table loaded at run-time. User "enterprises" file is loaded from the personal config dir. Misc make-sminmpec.pl improvements and fixes. Note: names of type "Entity (formerly ...)" have the formerly part commented out for a cleaner output. Change-Id: I60c533afbe3e399077fbf432088064471ad3e1e2 Reviewed-on: https://code.wireshark.org/review/22246 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt>
2017-04-28Add proto_tree_add_item_ret_boolean().Guy Harris1-1/+8
It does what it says on the label. You get back TRUE or FALSE in a gboolean. While we're at it, remove a copied-and-pasted comment that doesn't apply, and update another comment. Change-Id: I117391d2ffe44124a614a7f64dad1b389c1ebc6a Reviewed-on: https://code.wireshark.org/review/21394 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-26Add proto_tree_add_item_ret_uint64Michael Mann1-0/+4
Just like proto_tree_add_item_ret_uint, but with 64-bit support Change-Id: Ie0cbfda9e63bf21e85df2d674e391a6c0abe92f7 Reviewed-on: https://code.wireshark.org/review/21355 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-18Rename BASE_VALS_NO_UNKNOWN to BASE_SPECIAL_VALS.Guy Harris1-1/+1
It makes it a bit clearer what its purpose is - to allow a value_string to be used for numeric rather than enumerated fields, giving certain values of the field a special meaning. Change the explanation in the documentation to match as well. Change-Id: Id07b22eee996b79ea5f3473928d29adcabe09bf3 Reviewed-on: https://code.wireshark.org/review/21209 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12No need to include <epan/packet.h> in <epan/ftypes/ftypes-int.h>.Guy Harris1-1/+1
It's sufficient to include <epan/proto.h>... ...as long as <epan/proto.h> includes <epan/tfs.h>, just as it includes <epan/value_string.h>. And, since it's already including <epan/value_string.h>, it doesn't need to have a definition of struct _value_string as an incomplete type, given that <epan/value_string.h> gives a definition of it as a complete type. Change-Id: Ic296bc0b0d68277ba7e0569412b780fd847ecca2 Reviewed-on: https://code.wireshark.org/review/21033 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-12Rename routines to clarify what they do.Guy Harris1-1/+1
XXX_prime_with_YYY makes it a bit clearer than does XXX_prime_YYY that we're not priming YYY, we're priming XXX *using* YYY. Change-Id: I1686b8b5469bc0f0bd6db8551fb6301776a1b133 Reviewed-on: https://code.wireshark.org/review/21031 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-10Add support for BASE_VALS_NO_UNKNOWNAlexis La Goutte1-0/+1
BASE_VALS_NO_UNKNOWN is a special value_string value for only a single (maybe 2) numerical value(s). If a field has the numerical value that doesn't match anything in the value_string, just the number is supplied for the field (no "Unknown") Dissectors that had this use case have been converted in the patch. Change-Id: Ie63a36cceec2fe4436938ec7e3d7f9e690d2b8d9 Reviewed-on: https://code.wireshark.org/review/20736 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-08Clean up handling of enabled/disabled protocols/heuristic dissectors.Guy Harris1-4/+5
Add a "report a warning message" routine to the "report_err" code in libwsutil, and rename files and routines appropriately, as they don't only handle errors any more. Have a routine read_enabled_and_disabled_protos() that reads all the files that enable or disable protocols or heuristic dissectors, enables and disables them based on the contents of those files, and reports errors itself (as warnings) using the new "report a warning message" routine. Fix that error reporting to report separately on the disabled protocols, enabled protocols, and heuristic dissectors files. Have a routine to set up the enabled and disabled protocols and heuristic dissectors from the command-line arguments, so it's done the same way in all programs. If we try to enable or disable an unknown heuristic dissector via a command-line argument, report an error. Update a bunch of comments. Update the name of disabled_protos_cleanup(), as it cleans up information for disabled *and* enabled protocols and for heuristic dissectors. Support the command-line flags to enable and disable protocols and heuristic dissectors in tfshark. Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df Reviewed-on: https://code.wireshark.org/review/20966 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-01FT_CHAR is an integral type, so list it in the diagnostic message.Guy Harris1-1/+1
Change-Id: I8d095a2424033bee5b3569c906327ac15de33890 Reviewed-on: https://code.wireshark.org/review/20823 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-31Fix typo.Guy Harris1-1/+1
Change-Id: I55137590280024dd383c0d005a2d9d79f9b7d38a Reviewed-on: https://code.wireshark.org/review/20804 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-29Add ENC_TIME_MSEC_NTP and use it in packet-gtpv2.cAndersBroman1-0/+4
While at it fix expert info a typo and an calculation. Change-Id: I071a36edb7eed5f58708b98aebcb24bc6c34f2a8 Reviewed-on: https://code.wireshark.org/review/20766 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-28Fix up time encodings.Guy Harris1-20/+35
Add some new encodings for absolute time stamps, and use them as appropriate; this fixes some cases where the time stamps in question were being dissected incorrectly. For the encodings with seconds and 1/2^32s of a second, don't arbitrarily give only microsecond resolution; 2^32 is greater than 1 million, and, in fact, at least some NTP RFCs explicitly talk about time resolution greater than 1 microsecond. Update references in the RELOAD dissector to reflect the documents in question having been updated and published as RFCs. Change-Id: Icbe0b696d65eb622978eb71e99ddf699b84e4fca Reviewed-on: https://code.wireshark.org/review/20759 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-26Don't speak of RTPS time_t as an "NTP" time.Guy Harris1-9/+12
It's some weird hybrid of UN*X time and NTP time stamps, using UN*X's epoch and NTP's seconds/fractions split. I'm sure they had their reasons for not using something like struct timespec or regular NTP time, and instead inventing something that's halfway in between them. Change-Id: I1f39ec1368af52b82adfa2a22677dfa6e9341309 Reviewed-on: https://code.wireshark.org/review/20711 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-26Add ENC_TIME_TIMEVAL and use it for gsmtap.Guy Harris1-5/+33
From a look at the libosmocom code, time stamps in GSMTAP_TYPE_OSMOCORE_LOG messages appear to be UN*X struct timevals with a 4-byte tv_sec, not anything NTP-like with the fraction-of-a-second part in units of 1/2^32s of a second. Add ENC_TIME_TIMEVAL to handle time stamps like that, and use it rather than ENC_TIME_NTP_BASE_ZERO. Change-Id: Ia1511527ee292fb7725b2a64c0af16d23ff10a6d Reviewed-on: https://code.wireshark.org/review/20710 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-17[proto.h] Make proto_tree_add_split_bits_item_ret_val() usable fromAndersBroman1-3/+3
plugins. Change-Id: Ibcfdb9a3a33b0f12bf1f4752654bde279776768a Reviewed-on: https://code.wireshark.org/review/20579 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-15Lua: Merge sep and str tables into baseStig Bjørlykke1-1/+0
Also add documentation strings to the base values. Change-Id: I00ac8f154fdd0382106ed27d740e16956520be97 Reviewed-on: https://code.wireshark.org/review/20554 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-12-31Add interface for "pinos" (Protocols in name only)Michael Mann1-1/+23
This is for dissectors that need distinguishing names either for registering multiple dissection functions in a single dissector table or for "internal" dissectors whose just need a name associated with the dissection function. Features like enable/disable are handled by the "parent" protocol. This avoids clutter in the "official" protocol list. Change-Id: I69e7d27d332ae85286f254e95e8d79920da7a9e2 Reviewed-on: https://code.wireshark.org/review/19464 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-30Add BASE_NO_DISPLAY_VALUE to allow field value to not be shown.Michael Mann1-5/+7
There are times when byte arrays don't want to show their value in the packet tree or there is a field that is the "header" of a subtree where showing the field value distracts from the tree display. For these cases, BASE_NO_DISPLAY_VALUE can be used to not display the value. Change-Id: I8c9f1f57cd2e663dbee07e2289e7f5e1f22d1e32 Reviewed-on: https://code.wireshark.org/review/19479 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-24Add enabled protocol list for dissectors who are disabled by defaultMichael Mann1-0/+4
We save a list of dissectors that are disabled through the Enabled Protocols dialog. This is because we assume dissectors are enabled by default. For dissectors that are disabled by default, we have no way to keep them enabled through the Enabled Protocols dialog. A dissector that defaults to being disabled has to be reset to enabled each time Wireshark is launched. Add a list similar to the disabled list for enabling dissectors that are disabled by default. This mostly applies to post-dissectors. Change-Id: I31a8d97a9fdbc472fe2a8666384e0f8786bb8e9f Reviewed-on: https://code.wireshark.org/review/19405 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-20Lua: Add string types and byte seperators support.Stig Bjørlykke1-2/+3
Add handling of STR_ASCII and STR_UNICODE as base types for string and stringz. Add handling of SEP_DOT, SEP_DASH, SEP_COLON and SEP_SPACE for bytes and uint_bytes. Add SEP_NONE for completeness. Change-Id: Ida46c215fee7ec7132ec91ab5dd6cb3de4628920 Reviewed-on: https://code.wireshark.org/review/19337 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>