aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ptp.c
AgeCommit message (Collapse)AuthorFilesLines
2023-02-24PTP: Fix wrap around issue in PTP analysis codeDr. Lars Völker1-19/+34
The PTP analysis code did not support very long traces, in which the PTP seqid wrapped around (~2.27 hours with 125ms intervals). This is fixed by ensuring that PTP messages are only matched, if less than 60s apart. Fixes: #18872
2022-11-18Fix some cppcheck issuesMartin Mathieson1-20/+19
2022-11-16ptp: prevent divide by zero.Dario Lombardo1-12/+36
Check for valid values before use. Fix: #18635.
2022-10-31PTP: Enable analysis by defaultDylan Ulis1-1/+1
2022-06-27PTP: Improved robustness on wrong 2-step flag and 1-stepDr. Lars Völker1-8/+49
This code adds more robust handling of smaller issues with PTP messages, like a missing 2-step flag of a not quite correct implementation of 802.1AS and improves 1-step support. Changes: - Handle 1-step syncs in analysis. - Handle missing 2-step flag on pDelay more robust and warn in analysis. - Handle missing F'up TLV in 802.1AS Sync more robust and warn.
2022-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-6/+6
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-01-28Fix some filters strings.Martin Mathieson1-1/+1
2022-01-18PTP: Clean up code to reduce warningsDr. Lars Völker1-14/+14
2022-01-18PTP: Analysis of Message Intervals (Sync and PDelay_Req)Dr. Lars Völker1-16/+64
This patch adds analysis of the Sync intervals and Pdelay-Req intervals.
2022-01-16PTP: Adding Analysis FeaturesDr. Lars Völker1-9/+549
This patch links PTPv2 messages to each other and starts analysis based on the messages: - Link Sync to FollowUp - Link PDelay Req to PDelay Res - Link PDelay Res to PDelay F'Up - Add timestamp to a sync based on the Follow Up (2-step only). - Calculate the mean propagation delay and add it to PDelay Resp F'Up. - Calculate the neighborRateRatio of PDelay and show it - Calculate the syncRateRatio and show it This feature is off by default but only slows down dissection of PTP frames by about 10%.
2022-01-10PTP: ITU-T OUI as define instead of constant (cleanup)Dr. Lars Völker1-1/+1
2022-01-10PTP: Adding 802.1AS-2020 1-step Sync supportDr. Lars Völker1-69/+66
This patch adds support for 802.1AS-2020 Sync with 1-step as they carry the originTimestamp and the Follow_UP TLV. This patch also corrects that 802.1AS Sync with 2-step DO NOT have the originTimestamp but "reserved" data. Based on MR 2638.
2022-01-05PTP: Source Code Cleanup (formatting)Dr. Lars Völker1-54/+53
2021-12-19Replace g_snprintf() with snprintf() (dissectors)João Valverde1-1/+1
Use macros from inttypes.h with format strings.
2021-06-08PTP: Make PTP dissector accessible for lua scriptsDeveloper Alexander1-2/+2
Use register_dissector to dissector handle for PTP dissector to make it accessible by name for lua scripts via Dissector.get().
2021-04-27PTP: Fix a couple of spelling errorsMartin Mathieson1-5/+5
2021-04-26PTP: Check for enough bytesUli Heilmeier1-3/+1
Make sure we have enough bytes for Length and Type fields before we read from tvb. Using existing msg_len for the checks. Closes: wireshark/wireshark#17355
2021-04-08Added dissector changes in ptp for G.8275.2 ProfileSandip Mukherjee1-9/+101
2021-03-12PTP: PTPv2 dissection updatesVahap Emin Ağaoğulları1-168/+276
PTPv2 dissection dissected according to IEE Std 802.1AS-2011 This dissection updated according to IEE Std 802.1AS-2020.
2021-02-25The latest power profile C37.237-2017 has IEEE_C37_238 TLV differentPrashant Tripathi1-6/+83
from the earlier version C37.237-2011. The previous version of this standard, IEEE Std C37.238-2011, separated grandmaster time inaccuracy and what was then called NetworkTimeInaccuracy into two fields. The first, grandmasterTimeInaccuracy, was located immediately before totalTimeInaccuracy in this version (now a reserved field). The second, networkTimeInaccuracy, was located where totalTimeInaccuracy is now found.
2021-01-21PTP: Adding support for 32bit timestampDr. Lars Völker1-5/+19
IEEE 1733 uses a 32bit 802.1AS (gPTP) timestamp in RTCP. In order to correlate these timestamps to the timestamps in 802.1AS the following translation is needed: ts_32 = (ts_s * 10^9 + ts_ns ) mod 2^32 This patch adds suport for this 32bit timestamp in order to allow analysis of AVB with IEEE 1733 (RTP/RTCP).
2020-09-24More dissector spelling fixes.Martin Mathieson1-2/+2
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-02-20packet-ptp.c: Decode VendorID in the clockidentity field.Joerg Mayer1-4/+24
Change-Id: Ia09f6b025a1de77b665a13b801b3537f41330277 Reviewed-on: https://code.wireshark.org/review/32021 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2019-02-14packet-ptp.c: Add some reserved fields instead of skipping themJoerg Mayer1-0/+29
Change-Id: If8da7027d7eae1284123465bc992a94e10c37757 Reviewed-on: https://code.wireshark.org/review/32020 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2018-08-03PTP: fix typo path_delay -> peer_delayAlexis La Goutte1-9/+9
reported by Donn Lee Bug: 15026 Change-Id: I54bb65338a22c3d9cb691618baeb011a869182d3 Reviewed-on: https://code.wireshark.org/review/28939 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-19PTP: Don't interpret UDP packets as 802.1asDylan Ulis1-4/+7
Some fields were excluded/included when 802.1as is enabled. But, this transportSpecific flag only applies over Ethernet, and not UDP. Bug: 14990 Change-Id: I9d914ae3ee3ac15e81e79e9ea81b9449210ea01a Reviewed-on: https://code.wireshark.org/review/28762 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-04-20PTP: found typo adress => addressAlexis La Goutte1-7/+7
Change-Id: I79badcbca5b622961e7def403be4bc87ebfa776c Reviewed-on: https://code.wireshark.org/review/27041 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-06dissector/ptp: use BASE_OUI for organizationIdAdam Wujek1-20/+9
Bug: 14578 Change-Id: I5633a4c210da3201bb25684f276504efae9f8317 Signed-off-by: Adam Wujek <adam.wujek@cern.ch> Reviewed-on: https://code.wireshark.org/review/26749 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-06dissector/ptp: Add dissection of White Rabbit TLVAdam Wujek1-1/+383
Based on White Rabbit Specification - latest version https://www.ohwr.org/documents/160 For more information about The White Rabbit Project: http://cern.ch/white-rabbit Bug: 14578 Change-Id: Ie63a1f4ad501e0fc13fbd2205e2fcf94e175a7e4 Signed-off-by: Adam Wujek <adam.wujek@cern.ch> Reviewed-on: https://code.wireshark.org/review/23962 Petri-Dish: Alexis La Goutte <alexis.lagoutte@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>
2017-10-17dissector/ptp: fix typo - should be ptp.as.sig.tlv.flagsAdam Wujek1-1/+1
Change-Id: I31be23516d7fb169daa827b505bcde04426e84dc Signed-off-by: Adam Wujek <adam.wujek@cern.ch> Reviewed-on: https://code.wireshark.org/review/23961 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-13Adjust proto_tree_add_uint_format_value calls to use unit stringMichael Mann1-10/+5
Several calls to proto_tree_add_uint_format_value could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. There also a few cases where proto_tree_add_uint_format_value could just be proto_tree_add_uint. Added a few more "common" unit string values to unit_strings.[ch] Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d Reviewed-on: https://code.wireshark.org/review/19242 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-13Adjust proto_tree_add_[float|double]_format_value calls to use unit stringMichael Mann1-7/+6
Several calls to proto_tree_add_[float|double]_xxx could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. Added a few more "common" unit string values to unit_strings.[ch] Change-Id: Id0da7b579403898d20c2667d6c4abcd59d5a48d4 Reviewed-on: https://code.wireshark.org/review/19241 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-4/+2
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-07-30PTP: Expose ptp_v2 value strings for use by other dissectorsAnthony Coddington1-39/+45
Also rename ptp_v2 value strings in packet-ptp for better consistency. TODO: could also be used and combined with definitions in packet-cip. Change-Id: I84a9ae566ae6abdd95910cb5709bb63c2b7c26b8 Reviewed-on: https://code.wireshark.org/review/16781 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-26PTP: Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+0
Change-Id: I277c0e6f0f257dfb84bfb778c221c519204907d4 Reviewed-on: https://code.wireshark.org/review/14643 Reviewed-by: Uli Heilmeier <openid@heilmeier.eu> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-24PTP: Add mm TLV according to SMPTE ST 2059-2Uli Heilmeier1-0/+267
Add organization extension management message TLV according to SMPTE (Society of Motion Picture and Television Engineers) ST 2059-2 to Precision Time Protocol (PTP). Bug: 12264 Change-Id: I487ef2bacbccdb61c813d923830242f9526fd2cf Reviewed-on: https://code.wireshark.org/review/14559 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-21Fix typo in PTP / Follow_Up Message / Follow Up information TLV.Michael Mann1-4/+4
scaledLastGMPhaseChange -> scaledLastGmFreqChange Bug: 12150 Change-Id: I7b3d58c7d59364acb029e87f42da464c8840b95a Reviewed-on: https://code.wireshark.org/review/14050 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-2/+2
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-18create_dissector_handle -> new_create_dissector_handleMichael Mann1-9/+9
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I9c7d1c092bbae896ec0c2832617891346927f2e1 Reviewed-on: https://code.wireshark.org/review/11932 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-10-08Replace or rename "duplicate" UDP protocols shown in Decode AsMichael Mann1-6/+4
Change-Id: I8cfd1c223c70c7e03728af8b2f7cbf9354d7ad86 Ping-Bug: 3949 Reviewed-on: https://code.wireshark.org/review/10865 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-26PTP: just return, don't throw an exceptionMartin Kaiser1-1/+1
Change-Id: Icaca74f7d5038b4e2e232fb499933219b322e02d Reviewed-on: https://code.wireshark.org/review/9159 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-23Remove more deprecated tvb_length callsEvan Huus1-1/+1
Change-Id: Ie137e6f4e20fe26b1a4d9510e267896219c1c631 Reviewed-on: https://code.wireshark.org/review/9075 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-12-22PTP: Fix ptp_tree may be used uninitialized in this function ↵Alexis La Goutte1-1/+1
[-Werror=maybe-uninitialized] Change-Id: I0b82782deb568256dafd4c1bf163fd3e74f95545 Reviewed-on: https://code.wireshark.org/review/5974 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-12-22Squelch a compiler warning.Guy Harris1-1/+1
("Can't happen", but that requires more dataflow analysis than some compilers do.) Change-Id: I5c6acbff64ea88f9b43d5580522bc144465dc9ac Reviewed-on: https://code.wireshark.org/review/5972 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-22Use the messageLength field to indicate the message length.Guy Harris1-4/+42
Check it for sanity (and report errors), and use it to set the length of the PTP packet tvbuff and the PTP top-level protocol item. Bug: 10611 Change-Id: I9af6aad5f07d405ebb14885dc986a73e430d7bdb Reviewed-on: https://code.wireshark.org/review/5967 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-22Removing ptp.v2.an.fcs as this erroneously refers to the Ethernet FCS which ↵sfd1-14/+0
is properly handled by the Ethernet dissector. Bug: 10611 Change-Id: I735085edf5c0d2a66c30c940c4b780a2ce8db6d4 Reviewed-on: https://code.wireshark.org/review/5964 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+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-11-01Announce messages should only have a TLV if the message length is > 64.Michael Mann1-177/+192
Also, cleaned up a unnecessary global variable. Bug: 10611 Change-Id: I8ef5658eeb1f7a240b508833baac64719af144d8 Reviewed-on: https://code.wireshark.org/review/5029 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>