aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ntp.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-05dissectors: fix this statement may fall through ↵Alexis La Goutte1-0/+1
[-Werror=implicit-fallthrough=] found by gcc7 Change-Id: Iba6238988ded675cba328ab512232d1919d93b4a Reviewed-on: https://code.wireshark.org/review/20415 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-24Make MIPv6 options into a dissector table.Michael Mann1-5/+1
This provides external access for dissectors and plugins to provide their own implementation of MIPv6 options. Also cleaned up some of the "offset defines" and just went with relative increments for the option functions. Change-Id: I40db0b316eec37ee2045e6d663829ce69e3dac37 Reviewed-on: https://code.wireshark.org/review/20257 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-13Add support for adding unit names to hf_ fields.Michael Mann1-12/+6
This was inspired by the https://www.wireshark.org/lists/wireshark-dev/201505/msg00029.html thread. Used TCP and NTP dissectors as the guinea pig with sample use. Documentation updates includes some unrelated cleanup just because it was noticed. Change-Id: I59b26e1ca3b95e3473e4757f1759d7ad82976965 Reviewed-on: https://code.wireshark.org/review/19211 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-1/+1
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67, convert dissectors that use "udp.port". More cleanup done on dissectors that use both TCP and UDP dissector tables, so that less preference callbacks exist. Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3 Reviewed-on: https://code.wireshark.org/review/18120 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-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-1/+1
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-08Fix a lot of typos and misspellingsmoshekaplan1-2/+2
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3 Reviewed-on: https://code.wireshark.org/review/13069 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-1/+1
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now. Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f Reviewed-on: https://code.wireshark.org/review/12484 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-16create_dissector_handle -> new_create_dissector_handleMichael Mann1-3/+4
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I96aa9cf53533cbb07105aa400d42922baf3016b3 Reviewed-on: https://code.wireshark.org/review/11860 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-12NTP: fix dissection of SHA1 based message authentication codePascal Quantin1-3/+3
The maximum MAC length is 160 bits, not 128. MAX_MAC_LEN can be safely increased as an extension should be > 4 bytes. Bug: 11580 Change-Id: I0ea5a1f85d644e57315f033f09241d7a79dd3a45 Reviewed-on: https://code.wireshark.org/review/10934 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-10-04Add NTP authentication dissection.Michael Mann1-341/+350
It just dissects the fields, it doesn't do any decryption. Also general cleanup while in the neighborhood. Bug: 11022 Change-Id: I9acc787473c04730eab6016dce988dd194287894 Reviewed-on: https://code.wireshark.org/review/10759 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-23NTP: fix DISSECTOR_ASSERT when decoding v6_flagsAlexis La Goutte1-2/+2
Issue include in g8d6324f75 Change-Id: I49267b90a4a196409df76cb369d2dfacf42ba8d3 Ping-Bug:11361 Reviewed-on: https://code.wireshark.org/review/9754 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-22Convert proto_tree_add_boolean to ↵Michael Mann1-3/+1
proto_tree_add_bitmask_[value|value_with_flags|list] Part 2 of a few Change-Id: Ic1f1aafe2ed02dce95b15c03a91cbd68807a5cf4 Reviewed-on: https://code.wireshark.org/review/8165 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-03-10[GTPv2] Dissect ULI Timestamp.AndersBroman1-0/+40
Change-Id: If257831315423e5654cbbc3f6af99703cfad7f90 Reviewed-on: https://code.wireshark.org/review/7614 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-4/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-28NTP: fix parsing of control assignments with empty valuePascal Quantin1-3/+6
Consider that ',' is a separator between assignments and make value presence optional Bug: 10417 Change-Id: I23f2b4029548a1263d65ee11c6356270e7a89bd7 Reviewed-on: https://code.wireshark.org/review/3884 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-08-18Eliminate proto_tree_add_text from some dissectors.Michael Mann1-32/+39
Other minor cleanup while in the neighborhood. Change-Id: I77cac916d617f56f92f686e9cd9f15fba058facf Reviewed-on: https://code.wireshark.org/review/3675 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-2/+2
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-2/+2
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18Fixup: tvb_get_string(z) -> tvb_get_string(z)_encDario Lombardo1-1/+1
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe Reviewed-on: https://code.wireshark.org/review/2376 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-14Added monlist supportDario Lombardo1-3/+142
Change-Id: Ia96bfb71449624ff75c694080fef30d57300b30d Bug: 10174 Reviewed-on: https://code.wireshark.org/review/2131 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-30Don't use 'l' as a constant modifier:Bill Meier1-35/+49
Define NTP_BASETIME as an unsigned [int] constant; Also: Add editor modelines; Create/use an extended value-string; Use casts to time_t consistently; 'offset++' --> 'offset += 1' Adjust some whitespace. svn path=/trunk/; revision=54493
2013-12-14Fix [-Wmissing-prototypes]Jakub Zawadzki1-0/+3
svn path=/trunk/; revision=54095
2013-09-30Convert proto_tree_add_int_format calls to proto_tree_add_int_format_value ↵Michael Mann1-2/+2
where appropriate. svn path=/trunk/; revision=52301
2013-09-30Convert proto_tree_add_double_format calls to ↵Michael Mann1-4/+4
proto_tree_add_double_format_value where appropriate. svn path=/trunk/; revision=52298
2013-09-29Convert several proto_tree_add_bytes_format calls to ↵Michael Mann1-2/+2
proto_tree_add_bytes_format_value. svn path=/trunk/; revision=52272
2013-09-22emem -> wmem conversion:Pascal Quantin1-1/+1
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
2013-09-16Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-6/+6
hf_ field name is the first part of the formatted string. This was all manual inspection and most cases were either: 1. Case sensitivity differences between hf_ field name and formatted string. 2. Unnecessary whitespace between hf_ field name and colon in formatted string There are cases where the hf_ field name doesn't quite match the proto_tree_add_uint_format, but it's close enough that one of them should be "right", I'm just not sure which is, I just know the string in proto_tree_add_uint_format is the one displayed. svn path=/trunk/; revision=52098
2013-09-15Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-4/+4
hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly. The script didn't catch as many as I would have liked, but it's a start. The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum. svn path=/trunk/; revision=52045
2013-09-13Dario Lombardo <lomato@gmail.com> viaJörg Mayer1-4/+4
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9147 Migration from emem to wmem for trivial cases (ep_alloc only). svn path=/trunk/; revision=52002
2013-03-19From beroset:Anders Broman1-3/+3
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48425
2012-12-26And another 64-bit-to-32-bit conversion on 32-bit platforms.Guy Harris1-1/+1
svn path=/trunk/; revision=46768
2012-10-25Fix problem where NTP times with the high-bit set to 0 (which RFC 2030Jeff Morriss1-3/+16
chapter 3 has redefined to mean years *after* 2036) were being represented as times prior to 1968. This has been broken since r35840 (apparently not many people see NTP timestamps beyond 2036 :-)): apparently I over-optimized packet-ntp's code while copying it into proto.c: that temporary variable is necessary for the unsigned math to happen correctly before assigning the result to the (signed) time_t. Leave a comment in the code indicating why the temporary variable is needed. Copy that comment to packet-ntp.c. Fix the same problem in ntp_to_nstime(): it also did not use the temporary variable. svn path=/trunk/; revision=45790
2012-10-25- Dissect more options.Anders Broman1-0/+50
- Correct a Timestamp bug. - Try to pretify the options dissection. svn path=/trunk/; revision=45783
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-6/+6
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438
2012-07-22Update display filter names per Bug 2794. Part 1 of many.Michael Mann1-7/+7
svn path=/trunk/; revision=43907
2012-05-17General cleanup including as appropriate:Bill Meier1-36/+35
- Remove unneeded #include files (string.h, addr_resolv.h); - Remove unneeded 'if(!initialized){...}' in proto_reg_handoff(); - Reformat hf[] entries; - Remove unneeded variable initializations; - "localize" some variables; - Whitespace/indentation/long lines/formatting (in one case: re-order code slightly to not do col_set_str() & etc until after initial "frame acceptance testing" by dissector. svn path=/trunk/; revision=42683
2012-05-12Fix display filter prefix from "ntpctrl." to "ntp.ctrl." Part of a patch ↵Chris Maynard1-28/+28
submitted by Michael Mann in bug 2794, but for some reason the patch specified the filter prefix as "nap.ctrl.", which I don't think is right. svn path=/trunk/; revision=42603
2012-02-17Fix part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6703 :Jeff Morriss1-1/+1
r35887 added ntp_to_nstime() to packet-ntp since a couple of dissectors had their own versions. The version used was from packet-netflow; switch to the version from packet-zep because that one's math works better: the fractional time is actually shown. svn path=/trunk/; revision=41045
2011-11-27Fix a typo.Chris Maynard1-1/+1
svn path=/trunk/; revision=40018
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-1/+1
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-10-15Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, ↵Bill Meier1-1/+1
FT_STRINGZ, FT_UINT_STRING as follows: 1. If there's no character encoding (ENC_ASCII, ...) specified then use ENC_ASCII. 2. For all but FT_UINT_STRING, always use ENC_NA (replacing any existing True/1/FALSE/0 /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN). svn path=/trunk/; revision=39426
2011-08-02Show version and mode in protocol root. Now dissects details whether tree ↵Martin Mathieson1-8/+13
is NULL or not. svn path=/trunk/; revision=38309
2011-03-04Change descriptions of NTP Reference Identifier Codes for stratum 1Stephen Fisher1-16/+22
servers to match IANA assignment / RFC 5905. A number of codes already in Wireshark that aren't assigned were left intact. svn path=/trunk/; revision=36136
2011-03-04Correct the usage of tvb_memeql() after r35558: it doesn't return trueStephen Fisher1-1/+1
if the values are the same; we have to check for "== 0" to see if they are the same. svn path=/trunk/; revision=36135
2011-03-03Change "Reference Clock ID" to "Reference ID" to match RFC5905 (alsoStephen Fisher1-3/+3
mention this RFC in the comments). svn path=/trunk/; revision=36134
2011-03-03Clarify / add explanations for the fieldsStephen Fisher1-24/+26
svn path=/trunk/; revision=36133
2011-02-28Display the NTP version in COL_INFO so tshark output (without -V) looksStephen Fisher1-9/+11
more like tcpdump. svn path=/trunk/; revision=36097
2011-02-10Modify proto_tree_add_bytes_format() and proto_tree_add_bytes_format_value()Jeff Morriss1-2/+1
so that if the start_ptr is NULL the bytes are extracted from the given TVB using the given offset and length. Replace a bunch of: proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, tvb_get_ptr(tvb, offset, length), [...]) with: proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, NULL, [...]) svn path=/trunk/; revision=35896