2 * Routines for PTP (Precision Time Protocol) dissection
3 * Copyright 2004, Auges Tchouante <tchouante2001@yahoo.fr>
4 * Copyright 2004, Dominic Bechaz <bdo@zhwin.ch> , ZHW/InES
5 * Copyright 2004, Markus Seehofer <mseehofe@nt.hirschmann.de>
6 * Copyright 2006, Christian Schaer <scc@zhwin.ch>
7 * Copyright 2007, Markus Renz <Markus.Renz@hirschmann.de>
8 * Copyright 2010, Torrey Atcitty <torrey.atcitty@harman.com>
9 * Dave Olsen <dave.olsen@harman.com>
10 * Copyright 2013, Andreas Bachmann <bacr@zhaw.ch>, ZHAW/InES
11 * Copyright 2016, Uli Heilmeier <uh@heilmeier.eu>
12 * Copyright 2017, Adam Wujek <adam.wujek@cern.ch>
13 * Copyright 2022, Dr. Lars Völker <lars.voelker@technica-engineering.de>
14 * Copyright 2023, Adam Wujek <dev_public@wujek.eu> for CERN
15 * Copyright 2024, Patrik Thunström <patrik.thunstroem@technica-engineering.de>
16 * Copyright 2024, Dr. Lars Völker <lars.voelker@technica-engineering.de>
17 * Copyright 2024, Martin Ostertag <martin.ostertag@zhaw.ch>
18 * Aurel Hess <hesu@zhaw.ch>
21 * - Markus Seehofer 09.08.2005 <mseehofe@nt.hirschmann.de>
22 * - Included the "startingBoundaryHops" field in
23 * ptp_management messages.
24 * - Christian Schaer 07.07.2006 <scc@zhwin.ch>
25 * - Added support for PTP version 2
26 * - Markus Renz 2007-06-01
27 * - updated support for PTPv2
28 * - Markus Renz added Management for PTPv2, update to Draft 2.2
29 * - Torrey Atcitty & Dave Olsen 05.14.2010
30 * - Added support for 802.1AS D7.0
31 * - Andreas Bachmann 08.07.2013 <bacr@zhaw.ch>
32 * - allow multiple TLVs
33 * - bugfix in logInterMessagePeriod uint8_t -> int8_t
34 * - Uli Heilmeier 21.03.2016 <uh@heilmeier.eu>
35 * - Added support for SMPTE TLV
36 * - Adam Wujek 17.10.2017 <adam.wujek@cern.ch>
37 * - Added support for White Rabbit TLV
38 * - Prashant Tripathi 19-02-2021 <prashant_tripathi@selinc.com>
39 * - Added support for C37.238-2017
40 * - Dr. Lars Völker 05-01-2022 <lars.voelker@technica-engineering.de>
41 * - Added analysis support
42 * - Adam Wujek 28.08.2023 <dev_public@wujek.eu>
43 * - Added support for L1Sync
44 * - Patrik Thunström 27.01.2024 <patrik.thunstroem@technica-engineering.de>
45 * - Improvements/corrections for cumulativeScaledRateOffset
46 * - Prashant Tripathi 31-07-2024 <prashant_tripathi@selinc.com>
47 * - Corrections to timeOfNextJump field in ATOI TLV
48 * - Patrik Thunström 24.09.2024 <patrik.thunstroem@technica-engineering.de>
49 * - Fix analysis association (Sync to Follow_Up etc.) in case of sequenceId resets
50 * - Dr. Lars Völker 28.11.2024 <lars.voelker@technica-engineering.de>
52 * - Martin Ostertag & Aurel Hess 09-12-2024 <martin.ostertag@zhaw.ch> & <hesu@zhaw.ch>
53 * - Added support for drift_tracking TLV (802.1ASdm)
56 * Wireshark - Network traffic analyzer
57 * By Gerald Combs <gerald@wireshark.org>
58 * Copyright 1998 Gerald Combs
60 * SPDX-License-Identifier: GPL-2.0-or-later
68 #include <epan/packet.h>
70 #include <epan/unit_strings.h>
71 #include <epan/etypes.h>
72 #include <epan/expert.h>
73 #include <epan/proto_data.h>
75 #include <epan/addr_resolv.h>
76 #include "packet-ptp.h"
78 #define NS_PER_S 1000000000
80 /**********************************************************/
81 /* Port definition's for PTP */
82 /**********************************************************/
83 #define PTP_PORT_RANGE "319-320"
85 /* END Port definition's for PTP */
86 void proto_register_ptp(void);
87 void proto_reg_handoff_ptp(void);
90 /* To keep the decimal point based on locale */
91 static char * decimal_point
;
93 /***********************************************************************************/
94 /* Definitions and fields for PTPv1 dissection. */
95 /***********************************************************************************/
98 /**********************************************************/
99 /* Offsets of fields within a PTPv1 packet. */
100 /**********************************************************/
102 /* Common offsets for all Messages (Synch, Delay_Req, Follow_Up, Delay_Resp ....) */
103 #define PTP_VERSIONPTP_OFFSET 0
104 #define PTP_VERSIONNETWORK_OFFSET 2
105 #define PTP_SUBDOMAIN_OFFSET 4
106 #define PTP_MESSAGETYPE_OFFSET 20
107 #define PTP_SOURCECOMMUNICATIONTECHNOLOGY_OFFSET 21
108 #define PTP_SOURCEUUID_OFFSET 22
109 #define PTP_SOURCEPORTID_OFFSET 28
110 #define PTP_SEQUENCEID_OFFSET 30
111 #define PTP_CONTROLFIELD_OFFSET 32
112 #define PTP_FLAGS_OFFSET 34
113 #define PTP_FLAGS_LI61_OFFSET 34
114 #define PTP_FLAGS_LI59_OFFSET 34
115 #define PTP_FLAGS_BOUNDARY_CLOCK_OFFSET 34
116 #define PTP_FLAGS_ASSIST_OFFSET 34
117 #define PTP_FLAGS_EXT_SYNC_OFFSET 34
118 #define PTP_FLAGS_PARENT_STATS_OFFSET 34
119 #define PTP_FLAGS_SYNC_BURST_OFFSET 34
121 /* Offsets for PTP_Sync and Delay_Req (=SDR) messages */
122 #define PTP_SDR_ORIGINTIMESTAMP_OFFSET 40
123 #define PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET 40
124 #define PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET 44
125 #define PTP_SDR_EPOCHNUMBER_OFFSET 48
126 #define PTP_SDR_CURRENTUTCOFFSET_OFFSET 50
127 #define PTP_SDR_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 53
128 #define PTP_SDR_GRANDMASTERCLOCKUUID_OFFSET 54
129 #define PTP_SDR_GRANDMASTERPORTID_OFFSET 60
130 #define PTP_SDR_GRANDMASTERSEQUENCEID_OFFSET 62
131 #define PTP_SDR_GRANDMASTERCLOCKSTRATUM_OFFSET 67
132 #define PTP_SDR_GRANDMASTERCLOCKIDENTIFIER_OFFSET 68
133 #define PTP_SDR_GRANDMASTERCLOCKVARIANCE_OFFSET 74
134 #define PTP_SDR_GRANDMASTERPREFERRED_OFFSET 77
135 #define PTP_SDR_GRANDMASTERISBOUNDARYCLOCK_OFFSET 79
136 #define PTP_SDR_SYNCINTERVAL_OFFSET 83
137 #define PTP_SDR_LOCALCLOCKVARIANCE_OFFSET 86
138 #define PTP_SDR_LOCALSTEPSREMOVED_OFFSET 90
139 #define PTP_SDR_LOCALCLOCKSTRATUM_OFFSET 95
140 #define PTP_SDR_LOCALCLOCKIDENTIFIER_OFFSET 96
141 #define PTP_SDR_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET 101
142 #define PTP_SDR_PARENTUUID_OFFSET 102
143 #define PTP_SDR_PARENTPORTFIELD_OFFSET 110
144 #define PTP_SDR_ESTIMATEDMASTERVARIANCE_OFFSET 114
145 #define PTP_SDR_ESTIMATEDMASTERDRIFT_OFFSET 116
146 #define PTP_SDR_UTCREASONABLE_OFFSET 123
148 /* Offsets for Follow_Up (=FU) messages */
149 #define PTP_FU_ASSOCIATEDSEQUENCEID_OFFSET 42
150 #define PTP_FU_PRECISEORIGINTIMESTAMP_OFFSET 44
151 #define PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET 44
152 #define PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET 48
154 /* Offsets for Delay_Resp (=DR) messages */
155 #define PTP_DR_DELAYRECEIPTTIMESTAMP_OFFSET 40
156 #define PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET 40
157 #define PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET 44
158 #define PTP_DR_REQUESTINGSOURCECOMMUNICATIONTECHNOLOGY_OFFSET 49
159 #define PTP_DR_REQUESTINGSOURCEUUID_OFFSET 50
160 #define PTP_DR_REQUESTINGSOURCEPORTID_OFFSET 56
161 #define PTP_DR_REQUESTINGSOURCESEQUENCEID_OFFSET 58
163 /* Offsets for Management (=MM) messages */
164 #define PTP_MM_TARGETCOMMUNICATIONTECHNOLOGY_OFFSET 41
165 #define PTP_MM_TARGETUUID_OFFSET 42
166 #define PTP_MM_TARGETPORTID_OFFSET 48
167 #define PTP_MM_STARTINGBOUNDARYHOPS_OFFSET 50
168 #define PTP_MM_BOUNDARYHOPS_OFFSET 52
169 #define PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET 55
170 #define PTP_MM_PARAMETERLENGTH_OFFSET 58
172 /* PARAMETERLENGTH > 0 */
173 #define PTP_MM_MESSAGEPARAMETERS_OFFSET 60
175 /* PTP_MM_CLOCK_IDENTITY (PARAMETERLENGTH = 64) */
176 #define PTP_MM_CLOCK_IDENTITY_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET 63
177 #define PTP_MM_CLOCK_IDENTITY_CLOCKUUIDFIELD_OFFSET 64
178 #define PTP_MM_CLOCK_IDENTITY_CLOCKPORTFIELD_OFFSET 74
179 #define PTP_MM_CLOCK_IDENTITY_MANUFACTURERIDENTITY_OFFSET 76
181 /* PTP_MM_INITIALIZE_CLOCK (PARAMETERLENGTH = 4) */
182 #define PTP_MM_INITIALIZE_CLOCK_INITIALISATIONKEY_OFFSET 62
184 /* PTP_MM_SET_SUBDOMAIN (PARAMETERLENGTH = 16) */
185 #define PTP_MM_SET_SUBDOMAIN_SUBDOMAINNAME_OFFSET 60
187 /* PTP_MM_DEFAULT_DATA_SET (PARAMETERLENGTH = 76) */
188 #define PTP_MM_DEFAULT_DATA_SET_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET 63
189 #define PTP_MM_DEFAULT_DATA_SET_CLOCKUUIDFIELD_OFFSET 64
190 #define PTP_MM_DEFAULT_DATA_SET_CLOCKPORTFIELD_OFFSET 74
191 #define PTP_MM_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET 79
192 #define PTP_MM_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET 80
193 #define PTP_MM_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET 86
194 #define PTP_MM_DEFAULT_DATA_SET_CLOCKFOLLOWUPCAPABLE_OFFSET 89
195 #define PTP_MM_DEFAULT_DATA_SET_PREFERRED_OFFSET 95
196 #define PTP_MM_DEFAULT_DATA_SET_INITIALIZABLE_OFFSET 99
197 #define PTP_MM_DEFAULT_DATA_SET_EXTERNALTIMING_OFFSET 103
198 #define PTP_MM_DEFAULT_DATA_SET_ISBOUNDARYCLOCK_OFFSET 107
199 #define PTP_MM_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET 111
200 #define PTP_MM_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET 112
201 #define PTP_MM_DEFAULT_DATA_SET_NUMBERPORTS_OFFSET 130
202 #define PTP_MM_DEFAULT_DATA_SET_NUMBERFOREIGNRECORDS_OFFSET 134
204 /* PTP_MM_UPDATE_DEFAULT_DATA_SET (PARAMETERLENGTH = 36) */
205 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET 63
206 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET 64
207 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET 70
208 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_PREFERRED_OFFSET 75
209 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET 79
210 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET 80
212 /* PTP_MM_CURRENT_DATA_SET (PARAMETERLENGTH = 20) */
213 #define PTP_MM_CURRENT_DATA_SET_STEPSREMOVED_OFFSET 62
214 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTER_OFFSET 64
215 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET 64
216 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET 68
217 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAY_OFFSET 72
218 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET 72
219 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET 76
221 /* PTP_MM_PARENT_DATA_SET (PARAMETERLENGTH = 90) */
222 #define PTP_MM_PARENT_DATA_SET_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET 63
223 #define PTP_MM_PARENT_DATA_SET_PARENTUUID_OFFSET 64
224 #define PTP_MM_PARENT_DATA_SET_PARENTPORTID_OFFSET 74
225 #define PTP_MM_PARENT_DATA_SET_PARENTLASTSYNCSEQUENCENUMBER_OFFSET 78
226 #define PTP_MM_PARENT_DATA_SET_PARENTFOLLOWUPCAPABLE_OFFSET 83
227 #define PTP_MM_PARENT_DATA_SET_PARENTEXTERNALTIMING_OFFSET 87
228 #define PTP_MM_PARENT_DATA_SET_PARENTVARIANCE_OFFSET 90
229 #define PTP_MM_PARENT_DATA_SET_PARENTSTATS_OFFSET 95
230 #define PTP_MM_PARENT_DATA_SET_OBSERVEDVARIANCE_OFFSET 98
231 #define PTP_MM_PARENT_DATA_SET_OBSERVEDDRIFT_OFFSET 100
232 #define PTP_MM_PARENT_DATA_SET_UTCREASONABLE_OFFSET 107
233 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 111
234 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERUUIDFIELD_OFFSET 112
235 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERPORTIDFIELD_OFFSET 122
236 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERSTRATUM_OFFSET 127
237 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERIDENTIFIER_OFFSET 128
238 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERVARIANCE_OFFSET 134
239 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERPREFERRED_OFFSET 139
240 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERISBOUNDARYCLOCK_OFFSET 143
241 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERSEQUENCENUMBER_OFFSET 146
243 /* PTP_MM_PORT_DATA_SET (PARAMETERLENGTH = 52) */
244 #define PTP_MM_PORT_DATA_SET_RETURNEDPORTNUMBER_OFFSET 62
245 #define PTP_MM_PORT_DATA_SET_PORTSTATE_OFFSET 67
246 #define PTP_MM_PORT_DATA_SET_LASTSYNCEVENTSEQUENCENUMBER_OFFSET 70
247 #define PTP_MM_PORT_DATA_SET_LASTGENERALEVENTSEQUENCENUMBER_OFFSET 74
248 #define PTP_MM_PORT_DATA_SET_PORTCOMMUNICATIONTECHNOLOGY_OFFSET 79
249 #define PTP_MM_PORT_DATA_SET_PORTUUIDFIELD_OFFSET 80
250 #define PTP_MM_PORT_DATA_SET_PORTIDFIELD_OFFSET 90
251 #define PTP_MM_PORT_DATA_SET_BURSTENABLED_OFFSET 95
252 #define PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESSOCTETS_OFFSET 97
253 #define PTP_MM_PORT_DATA_SET_EVENTPORTADDRESSOCTETS_OFFSET 98
254 #define PTP_MM_PORT_DATA_SET_GENERALPORTADDRESSOCTETS_OFFSET 99
255 #define PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESS_OFFSET 100
256 #define PTP_MM_PORT_DATA_SET_EVENTPORTADDRESS_OFFSET 106
257 #define PTP_MM_PORT_DATA_SET_GENERALPORTADDRESS_OFFSET 110
259 /* PTP_MM_GLOBAL_TIME_DATA_SET (PARAMETERLENGTH = 24) */
260 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIME_OFFSET 60
261 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET 60
262 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET 64
263 #define PTP_MM_GLOBAL_TIME_DATA_SET_CURRENTUTCOFFSET_OFFSET 70
264 #define PTP_MM_GLOBAL_TIME_DATA_SET_LEAP59_OFFSET 75
265 #define PTP_MM_GLOBAL_TIME_DATA_SET_LEAP61_OFFSET 79
266 #define PTP_MM_GLOBAL_TIME_DATA_SET_EPOCHNUMBER_OFFSET 82
268 /* PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES (PARAMETERLENGTH = 16) */
269 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_CURRENTUTCOFFSET_OFFSET 62
270 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP59_OFFSET 67
271 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP61_OFFSET 71
272 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_EPOCHNUMBER_OFFSET 74
274 /* PTP_MM_GET_FOREIGN_DATA_SET (PARAMETERLENGTH = 4) */
275 #define PTP_MM_GET_FOREIGN_DATA_SET_RECORDKEY_OFFSET 62
277 /* PTP_MM_FOREIGN_DATA_SET (PARAMETERLENGTH = 28) */
278 #define PTP_MM_FOREIGN_DATA_SET_RETURNEDPORTNUMBER_OFFSET 62
279 #define PTP_MM_FOREIGN_DATA_SET_RETURNEDRECORDNUMBER_OFFSET 66
280 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 71
281 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERUUIDFIELD_OFFSET 72
282 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERPORTIDFIELD_OFFSET 82
283 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERSYNCS_OFFSET 86
285 /* PTP_MM_SET_SYNC_INTERVAL (PARAMETERLENGTH = 4) */
286 #define PTP_MM_SET_SYNC_INTERVAL_SYNCINTERVAL_OFFSET 62
288 /* PTP_MM_SET_TIME (PARAMETERLENGTH = 8) */
289 #define PTP_MM_SET_TIME_LOCALTIME_OFFSET 60
290 #define PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET 60
291 #define PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET 64
293 /* END Offsets of fields within a PTP packet. */
295 /**********************************************************/
296 /* flag-field-mask-definitions */
297 /**********************************************************/
298 #define PTP_FLAGS_LI61_BITMASK 0x0001
299 #define PTP_FLAGS_LI59_BITMASK 0x0002
300 #define PTP_FLAGS_BOUNDARY_CLOCK_BITMASK 0x0004
301 #define PTP_FLAGS_ASSIST_BITMASK 0x0008
302 #define PTP_FLAGS_EXT_SYNC_BITMASK 0x0010
303 #define PTP_FLAGS_PARENT_STATS_BITMASK 0x0020
304 #define PTP_FLAGS_SYNC_BURST_BITMASK 0x0040
306 /* END flag-field-mask-definitions */
308 /**********************************************************/
309 /* managementMessage definitions */
310 /**********************************************************/
311 #define PTP_MM_NULL 0
312 #define PTP_MM_OBTAIN_IDENTITY 1
313 #define PTP_MM_CLOCK_IDENTITY 2
314 #define PTP_MM_INITIALIZE_CLOCK 3
315 #define PTP_MM_SET_SUBDOMAIN 4
316 #define PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER 5
317 #define PTP_MM_SET_DESIGNATED_PREFERRED_MASTER 6
318 #define PTP_MM_GET_DEFAULT_DATA_SET 7
319 #define PTP_MM_DEFAULT_DATA_SET 8
320 #define PTP_MM_UPDATE_DEFAULT_DATA_SET 9
321 #define PTP_MM_GET_CURRENT_DATA_SET 10
322 #define PTP_MM_CURRENT_DATA_SET 11
323 #define PTP_MM_GET_PARENT_DATA_SET 12
324 #define PTP_MM_PARENT_DATA_SET 13
325 #define PTP_MM_GET_PORT_DATA_SET 14
326 #define PTP_MM_PORT_DATA_SET 15
327 #define PTP_MM_GET_GLOBAL_TIME_DATA_SET 16
328 #define PTP_MM_GLOBAL_TIME_DATA_SET 17
329 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES 18
330 #define PTP_MM_GOTO_FAULTY_STATE 19
331 #define PTP_MM_GET_FOREIGN_DATA_SET 20
332 #define PTP_MM_FOREIGN_DATA_SET 21
333 #define PTP_MM_SET_SYNC_INTERVAL 22
334 #define PTP_MM_DISABLE_PORT 23
335 #define PTP_MM_ENABLE_PORT 24
336 #define PTP_MM_DISABLE_BURST 25
337 #define PTP_MM_ENABLE_BURST 26
338 #define PTP_MM_SET_TIME 27
340 static const value_string ptp_managementMessageKey_vals
[] = {
341 {PTP_MM_NULL
, "PTP_MM_NULL"},
342 {PTP_MM_OBTAIN_IDENTITY
, "PTP_MM_OBTAIN_IDENTITY"},
343 {PTP_MM_CLOCK_IDENTITY
, "PTP_MM_CLOCK_IDENTITY"},
344 {PTP_MM_INITIALIZE_CLOCK
, "PTP_MM_INITIALIZE_CLOCK"},
345 {PTP_MM_SET_SUBDOMAIN
, "PTP_MM_SET_SUBDOMAIN"},
346 {PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER
, "PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER"},
347 {PTP_MM_SET_DESIGNATED_PREFERRED_MASTER
, "PTP_MM_SET_DESIGNATED_PREFERRED_MASTER"},
348 {PTP_MM_GET_DEFAULT_DATA_SET
, "PTP_MM_GET_DEFAULT_DATA_SET"},
349 {PTP_MM_DEFAULT_DATA_SET
, "PTP_MM_DEFAULT_DATA_SET"},
350 {PTP_MM_UPDATE_DEFAULT_DATA_SET
, "PTP_MM_UPDATE_DEFAULT_DATA_SET"},
351 {PTP_MM_GET_CURRENT_DATA_SET
, "PTP_MM_GET_CURRENT_DATA_SET"},
352 {PTP_MM_CURRENT_DATA_SET
, "PTP_MM_CURRENT_DATA_SET"},
353 {PTP_MM_GET_PARENT_DATA_SET
, "PTP_MM_GET_PARENT_DATA_SET"},
354 {PTP_MM_PARENT_DATA_SET
, "PTP_MM_PARENT_DATA_SET"},
355 {PTP_MM_GET_PORT_DATA_SET
, "PTP_MM_GET_PORT_DATA_SET"},
356 {PTP_MM_PORT_DATA_SET
, "PTP_MM_PORT_DATA_SET"},
357 {PTP_MM_GET_GLOBAL_TIME_DATA_SET
, "PTP_MM_GET_GLOBAL_TIME_DATA_SET"},
358 {PTP_MM_GLOBAL_TIME_DATA_SET
, "PTP_MM_GLOBAL_TIME_DATA_SET"},
359 {PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES
, "PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES"},
360 {PTP_MM_GOTO_FAULTY_STATE
, "PTP_MM_GOTO_FAULTY_STATE"},
361 {PTP_MM_GET_FOREIGN_DATA_SET
, "PTP_MM_GET_FOREIGN_DATA_SET"},
362 {PTP_MM_FOREIGN_DATA_SET
, "PTP_MM_FOREIGN_DATA_SET"},
363 {PTP_MM_SET_SYNC_INTERVAL
, "PTP_MM_SET_SYNC_INTERVAL"},
364 {PTP_MM_DISABLE_PORT
, "PTP_MM_DISABLE_PORT"},
365 {PTP_MM_ENABLE_PORT
, "PTP_MM_ENABLE_PORT"},
366 {PTP_MM_DISABLE_BURST
, "PTP_MM_DISABLE_BURST"},
367 {PTP_MM_ENABLE_BURST
, "PTP_MM_ENABLE_BURST"},
368 {PTP_MM_SET_TIME
, "PTP_MM_SET_TIME"},
371 static value_string_ext ptp_managementMessageKey_vals_ext
=
372 VALUE_STRING_EXT_INIT(ptp_managementMessageKey_vals
);
374 /* same again but better readable text for info column */
375 static const value_string ptp_managementMessageKey_infocolumn_vals
[] = {
376 {PTP_MM_NULL
, "Null"},
377 {PTP_MM_OBTAIN_IDENTITY
, "Obtain Identity"},
378 {PTP_MM_CLOCK_IDENTITY
, "Clock Identity"},
379 {PTP_MM_INITIALIZE_CLOCK
, "Initialize Clock"},
380 {PTP_MM_SET_SUBDOMAIN
, "Set Subdomain"},
381 {PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER
, "Clear Designated Preferred Master"},
382 {PTP_MM_SET_DESIGNATED_PREFERRED_MASTER
, "Set Designated Preferred Master"},
383 {PTP_MM_GET_DEFAULT_DATA_SET
, "Get Default Data Set"},
384 {PTP_MM_DEFAULT_DATA_SET
, "Default Data Set"},
385 {PTP_MM_UPDATE_DEFAULT_DATA_SET
, "Update Default Data Set"},
386 {PTP_MM_GET_CURRENT_DATA_SET
, "Get Current Data Set"},
387 {PTP_MM_CURRENT_DATA_SET
, "Current Data Set"},
388 {PTP_MM_GET_PARENT_DATA_SET
, "Get Parent Data Set"},
389 {PTP_MM_PARENT_DATA_SET
, "Parent Data Set"},
390 {PTP_MM_GET_PORT_DATA_SET
, "Get Port Data Set"},
391 {PTP_MM_PORT_DATA_SET
, "Port Data Set"},
392 {PTP_MM_GET_GLOBAL_TIME_DATA_SET
, "Get Global Time Data Set"},
393 {PTP_MM_GLOBAL_TIME_DATA_SET
, "Global Time Data Set"},
394 {PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES
, "Update Global Time Properties"},
395 {PTP_MM_GOTO_FAULTY_STATE
, "Goto Faulty State"},
396 {PTP_MM_GET_FOREIGN_DATA_SET
, "Get Foreign Data Set"},
397 {PTP_MM_FOREIGN_DATA_SET
, "Foreign Data Set"},
398 {PTP_MM_SET_SYNC_INTERVAL
, "Set Sync Interval"},
399 {PTP_MM_DISABLE_PORT
, "Disable Port"},
400 {PTP_MM_ENABLE_PORT
, "Enable Port"},
401 {PTP_MM_DISABLE_BURST
, "Disable Burst"},
402 {PTP_MM_ENABLE_BURST
, "Enable Burst"},
403 {PTP_MM_SET_TIME
, "Set Time"},
406 static value_string_ext ptp_managementMessageKey_infocolumn_vals_ext
=
407 VALUE_STRING_EXT_INIT(ptp_managementMessageKey_infocolumn_vals
);
409 /* END managementMessage definitions */
411 /**********************************************************/
412 /* CommunicationId definitions */
413 /**********************************************************/
417 #define PTP_PROFIBUS 5
421 #define PTP_CONTROLNET 9
422 #define PTP_CANOPEN 10
423 #define PTP_IEEE1394 243
424 #define PTP_IEEE802_11A 244
425 #define PTP_IEEE_WIRELESS 245
426 #define PTP_INFINIBAND 246
427 #define PTP_BLUETOOTH 247
428 #define PTP_IEEE802_15_1 248
429 #define PTP_IEEE1451_3 249
430 #define PTP_IEEE1451_5 250
435 #define PTP_DEFAULT 255
437 static const value_string ptp_communicationid_vals
[] = {
438 {PTP_CLOSED
, "Closed system outside the scope of this standard."},
439 {PTP_ETHER
, "IEEE 802.3 (Ethernet)"},
440 {PTP_FFBUS
, "FOUNDATION Fieldbus"},
441 {PTP_PROFIBUS
, "PROFIBUS"},
442 {PTP_LON
, "LonTalk"},
443 {PTP_DNET
, "DeviceNet"},
444 {PTP_SDS
, "SmartDistributedSystem"},
445 {PTP_CONTROLNET
, "ControlNet"},
446 {PTP_CANOPEN
, "CANopen"},
447 {PTP_IEEE1394
, "IEEE 1394"},
448 {PTP_IEEE802_11A
, "IEEE 802.11a"},
449 {PTP_IEEE_WIRELESS
, "IEEE 802.11b"},
450 {PTP_INFINIBAND
, "InfiniBand"},
451 {PTP_BLUETOOTH
, "Bluetooth wireless"},
452 {PTP_IEEE802_15_1
, "IEEE 802.15.1"},
453 {PTP_IEEE1451_3
, "IEEE 1451.3"},
454 {PTP_IEEE1451_5
, "IEEE 1451.5"},
455 {PTP_USB
, "USB bus"},
456 {PTP_ISA
, "ISA bus"},
457 {PTP_PCI
, "PCI bus"},
458 {PTP_VXI
, "VXI bus"},
459 {PTP_DEFAULT
, "Default value"},
462 static value_string_ext ptp_communicationid_vals_ext
=
463 VALUE_STRING_EXT_INIT(ptp_communicationid_vals
);
465 /* END CommunicationId definitions */
467 /**********************************************************/
468 /* PTP message types (PTP_CONTROL field) */
469 /**********************************************************/
470 #define PTP_SYNC_MESSAGE 0x00
471 #define PTP_DELAY_REQ_MESSAGE 0x01
472 #define PTP_FOLLOWUP_MESSAGE 0x02
473 #define PTP_DELAY_RESP_MESSAGE 0x03
474 #define PTP_MANAGEMENT_MESSAGE 0x04
475 #define PTP_OTHER_MESSAGE 0x05
477 static const value_string ptp_controlfield_vals
[] = {
478 {PTP_SYNC_MESSAGE
, "Sync Message"},
479 {PTP_DELAY_REQ_MESSAGE
, "Delay_Req Message"},
480 {PTP_FOLLOWUP_MESSAGE
, "Follow_Up Message"},
481 {PTP_DELAY_RESP_MESSAGE
, "Delay_Resp Message"},
482 {PTP_MANAGEMENT_MESSAGE
, "Management Message"},
483 {PTP_OTHER_MESSAGE
, "Other Message"},
487 /* END PTP message types */
489 /**********************************************************/
490 /* Channel values for the PTP_MESSAGETYPE field */
491 /**********************************************************/
492 #define PTP_MESSAGETYPE_EVENT 0x01
493 #define PTP_MESSAGETYPE_GENERAL 0x02
495 static const value_string ptp_messagetype_vals
[] = {
496 {PTP_MESSAGETYPE_EVENT
, "Event Message"},
497 {PTP_MESSAGETYPE_GENERAL
, "General Message"},
501 /* END channel values for the PTP_MESSAGETYPE field */
503 /**********************************************************/
504 /* Initialize the protocol and registered fields */
505 /**********************************************************/
507 static int hf_ptp_versionptp
;
508 static int hf_ptp_versionnetwork
;
509 static int hf_ptp_subdomain
;
510 static int hf_ptp_messagetype
;
511 static int hf_ptp_sourcecommunicationtechnology
;
512 static int hf_ptp_sourceuuid
;
513 static int hf_ptp_sourceportid
;
514 static int hf_ptp_sequenceid
;
515 static int hf_ptp_controlfield
;
516 static int hf_ptp_flags
;
517 static int hf_ptp_flags_li61
;
518 static int hf_ptp_flags_li59
;
519 static int hf_ptp_flags_boundary_clock
;
520 static int hf_ptp_flags_assist
;
521 static int hf_ptp_flags_ext_sync
;
522 static int hf_ptp_flags_parent
;
523 static int hf_ptp_flags_sync_burst
;
525 /* Fields for ptp_sync and delay_req (=sdr) messages */
526 static int hf_ptp_sdr_origintimestamp
; /* Field for seconds & nanoseconds */
527 static int hf_ptp_sdr_origintimestamp_seconds
;
528 static int hf_ptp_sdr_origintimestamp_nanoseconds
;
529 static int hf_ptp_sdr_epochnumber
;
530 static int hf_ptp_sdr_currentutcoffset
;
531 static int hf_ptp_sdr_grandmastercommunicationtechnology
;
532 static int hf_ptp_sdr_grandmasterclockuuid
;
533 static int hf_ptp_sdr_grandmasterportid
;
534 static int hf_ptp_sdr_grandmastersequenceid
;
535 static int hf_ptp_sdr_grandmasterclockstratum
;
536 static int hf_ptp_sdr_grandmasterclockidentifier
;
537 static int hf_ptp_sdr_grandmasterclockvariance
;
538 static int hf_ptp_sdr_grandmasterpreferred
;
539 static int hf_ptp_sdr_grandmasterisboundaryclock
;
540 static int hf_ptp_sdr_syncinterval
;
541 static int hf_ptp_sdr_localclockvariance
;
542 static int hf_ptp_sdr_localstepsremoved
;
543 static int hf_ptp_sdr_localclockstratum
;
544 static int hf_ptp_sdr_localclockidentifier
;
545 static int hf_ptp_sdr_parentcommunicationtechnology
;
546 static int hf_ptp_sdr_parentuuid
;
547 static int hf_ptp_sdr_parentportfield
;
548 static int hf_ptp_sdr_estimatedmastervariance
;
549 static int hf_ptp_sdr_estimatedmasterdrift
;
550 static int hf_ptp_sdr_utcreasonable
;
552 /* Fields for follow_up (=fu) messages */
553 static int hf_ptp_fu_associatedsequenceid
;
554 static int hf_ptp_fu_preciseorigintimestamp
;
555 static int hf_ptp_fu_preciseorigintimestamp_seconds
;
556 static int hf_ptp_fu_preciseorigintimestamp_nanoseconds
;
558 /* Fields for delay_resp (=dr) messages */
559 static int hf_ptp_dr_delayreceipttimestamp
;
560 static int hf_ptp_dr_delayreceipttimestamp_seconds
;
561 static int hf_ptp_dr_delayreceipttimestamp_nanoseconds
;
562 static int hf_ptp_dr_requestingsourcecommunicationtechnology
;
563 static int hf_ptp_dr_requestingsourceuuid
;
564 static int hf_ptp_dr_requestingsourceportid
;
565 static int hf_ptp_dr_requestingsourcesequenceid
;
567 /* Fields for management (=mm) messages */
568 static int hf_ptp_mm_targetcommunicationtechnology
;
569 static int hf_ptp_mm_targetuuid
;
570 static int hf_ptp_mm_targetportid
;
571 static int hf_ptp_mm_startingboundaryhops
;
572 static int hf_ptp_mm_boundaryhops
;
573 static int hf_ptp_mm_managementmessagekey
;
574 static int hf_ptp_mm_parameterlength
;
575 /* parameterlength > 0 */
576 /* static int hf_ptp_mm_messageparameters; */
577 /* ptp_mm_clock_identity (parameterlength = 64) */
578 static int hf_ptp_mm_clock_identity_clockcommunicationtechnology
;
579 static int hf_ptp_mm_clock_identity_clockuuidfield
;
580 static int hf_ptp_mm_clock_identity_clockportfield
;
581 static int hf_ptp_mm_clock_identity_manufactureridentity
;
583 /* ptp_mm_initialize_clock (parameterlength = 4) */
584 static int hf_ptp_mm_initialize_clock_initialisationkey
;
586 /* ptp_mm_set_subdomain (parameterlength = 16) */
587 static int hf_ptp_mm_set_subdomain_subdomainname
;
589 /* ptp_mm_default_data_set (parameterlength = 76) */
590 static int hf_ptp_mm_default_data_set_clockcommunicationtechnology
;
591 static int hf_ptp_mm_default_data_set_clockuuidfield
;
592 static int hf_ptp_mm_default_data_set_clockportfield
;
593 static int hf_ptp_mm_default_data_set_clockstratum
;
594 static int hf_ptp_mm_default_data_set_clockidentifier
;
595 static int hf_ptp_mm_default_data_set_clockvariance
;
596 static int hf_ptp_mm_default_data_set_clockfollowupcapable
;
597 static int hf_ptp_mm_default_data_set_preferred
;
598 static int hf_ptp_mm_default_data_set_initializable
;
599 static int hf_ptp_mm_default_data_set_externaltiming
;
600 static int hf_ptp_mm_default_data_set_isboundaryclock
;
601 static int hf_ptp_mm_default_data_set_syncinterval
;
602 static int hf_ptp_mm_default_data_set_subdomainname
;
603 static int hf_ptp_mm_default_data_set_numberports
;
604 static int hf_ptp_mm_default_data_set_numberforeignrecords
;
606 /* ptp_mm_update_default_data_set (parameterlength = 36) */
607 static int hf_ptp_mm_update_default_data_set_clockstratum
;
608 static int hf_ptp_mm_update_default_data_set_clockidentifier
;
609 static int hf_ptp_mm_update_default_data_set_clockvariance
;
610 static int hf_ptp_mm_update_default_data_set_preferred
;
611 static int hf_ptp_mm_update_default_data_set_syncinterval
;
612 static int hf_ptp_mm_update_default_data_set_subdomainname
;
614 /* ptp_mm_current_data_set (parameterlength = 20) */
615 static int hf_ptp_mm_current_data_set_stepsremoved
;
616 static int hf_ptp_mm_current_data_set_offsetfrommaster
;
617 static int hf_ptp_mm_current_data_set_offsetfrommasterseconds
;
618 static int hf_ptp_mm_current_data_set_offsetfrommasternanoseconds
;
619 static int hf_ptp_mm_current_data_set_onewaydelay
;
620 static int hf_ptp_mm_current_data_set_onewaydelayseconds
;
621 static int hf_ptp_mm_current_data_set_onewaydelaynanoseconds
;
623 /* ptp_mm_parent_data_set (parameterlength = 90) */
624 static int hf_ptp_mm_parent_data_set_parentcommunicationtechnology
;
625 static int hf_ptp_mm_parent_data_set_parentuuid
;
626 static int hf_ptp_mm_parent_data_set_parentportid
;
627 static int hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber
;
628 static int hf_ptp_mm_parent_data_set_parentfollowupcapable
;
629 static int hf_ptp_mm_parent_data_set_parentexternaltiming
;
630 static int hf_ptp_mm_parent_data_set_parentvariance
;
631 static int hf_ptp_mm_parent_data_set_parentstats
;
632 static int hf_ptp_mm_parent_data_set_observedvariance
;
633 static int hf_ptp_mm_parent_data_set_observeddrift
;
634 static int hf_ptp_mm_parent_data_set_utcreasonable
;
635 static int hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology
;
636 static int hf_ptp_mm_parent_data_set_grandmasteruuidfield
;
637 static int hf_ptp_mm_parent_data_set_grandmasterportidfield
;
638 static int hf_ptp_mm_parent_data_set_grandmasterstratum
;
639 static int hf_ptp_mm_parent_data_set_grandmasteridentifier
;
640 static int hf_ptp_mm_parent_data_set_grandmastervariance
;
641 static int hf_ptp_mm_parent_data_set_grandmasterpreferred
;
642 static int hf_ptp_mm_parent_data_set_grandmasterisboundaryclock
;
643 static int hf_ptp_mm_parent_data_set_grandmastersequencenumber
;
645 /* ptp_mm_port_data_set (parameterlength = 52) */
646 static int hf_ptp_mm_port_data_set_returnedportnumber
;
647 static int hf_ptp_mm_port_data_set_portstate
;
648 static int hf_ptp_mm_port_data_set_lastsynceventsequencenumber
;
649 static int hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber
;
650 static int hf_ptp_mm_port_data_set_portcommunicationtechnology
;
651 static int hf_ptp_mm_port_data_set_portuuidfield
;
652 static int hf_ptp_mm_port_data_set_portidfield
;
653 static int hf_ptp_mm_port_data_set_burstenabled
;
654 static int hf_ptp_mm_port_data_set_subdomainaddressoctets
;
655 static int hf_ptp_mm_port_data_set_eventportaddressoctets
;
656 static int hf_ptp_mm_port_data_set_generalportaddressoctets
;
657 static int hf_ptp_mm_port_data_set_subdomainaddress
;
658 static int hf_ptp_mm_port_data_set_eventportaddress
;
659 static int hf_ptp_mm_port_data_set_generalportaddress
;
661 /* ptp_mm_global_time_data_set (parameterlength = 24) */
662 static int hf_ptp_mm_global_time_data_set_localtime
;
663 static int hf_ptp_mm_global_time_data_set_localtimeseconds
;
664 static int hf_ptp_mm_global_time_data_set_localtimenanoseconds
;
665 static int hf_ptp_mm_global_time_data_set_currentutcoffset
;
666 static int hf_ptp_mm_global_time_data_set_leap59
;
667 static int hf_ptp_mm_global_time_data_set_leap61
;
668 static int hf_ptp_mm_global_time_data_set_epochnumber
;
670 /* ptp_mm_update_global_time_properties (parameterlength = 16) */
671 static int hf_ptp_mm_update_global_time_properties_currentutcoffset
;
672 static int hf_ptp_mm_update_global_time_properties_leap59
;
673 static int hf_ptp_mm_update_global_time_properties_leap61
;
674 /* static int hf_ptp_mm_update_global_time_properties_epochnumber; */
676 /* ptp_mm_get_foreign_data_set (parameterlength = 4) */
677 static int hf_ptp_mm_get_foreign_data_set_recordkey
;
679 /* ptp_mm_foreign_data_set (parameterlength = 28) */
680 static int hf_ptp_mm_foreign_data_set_returnedportnumber
;
681 static int hf_ptp_mm_foreign_data_set_returnedrecordnumber
;
682 static int hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology
;
683 static int hf_ptp_mm_foreign_data_set_foreignmasteruuidfield
;
684 static int hf_ptp_mm_foreign_data_set_foreignmasterportidfield
;
685 static int hf_ptp_mm_foreign_data_set_foreignmastersyncs
;
687 /* ptp_mm_set_sync_interval (parameterlength = 4) */
688 static int hf_ptp_mm_set_sync_interval_syncinterval
;
690 /* ptp_mm_set_time (parameterlength = 8) */
691 static int hf_ptp_mm_set_time_localtime
;
692 static int hf_ptp_mm_set_time_localtimeseconds
;
693 static int hf_ptp_mm_set_time_localtimenanoseconds
;
695 /* END Initialize the protocol and registered fields */
697 /* Initialize the subtree pointers */
699 static int ett_ptp_flags
;
700 static int ett_ptp_time
;
701 static int ett_ptp_time2
;
703 /* END Definitions and fields for PTPv1 dissection. */
709 /***********************************************************************************/
710 /* Definitions and fields for PTPv2 dissection. */
711 /***********************************************************************************/
714 /**********************************************************/
715 /* Offsets of fields within a PTPv2 packet. */
716 /**********************************************************/
718 /* Common offsets for all Messages (Sync, Delay_Req, Follow_Up, Delay_Resp ....) */
719 #define PTP_V2_MAJORSDOID_MESSAGE_TYPE_OFFSET 0
720 #define PTP_V2_VERSIONPTP_OFFSET 1
721 #define PTP_V2_MINORVERSIONPTP_OFFSET PTP_V2_VERSIONPTP_OFFSET
722 #define PTP_V2_MESSAGE_LENGTH_OFFSET 2
723 #define PTP_V2_DOMAIN_NUMBER_OFFSET 4
724 #define PTP_V2_MINORSDOID_OFFSET 5
725 #define PTP_V2_FLAGS_OFFSET 6
726 #define PTP_V2_CORRECTION_OFFSET 8
727 #define PTP_V2_CLOCKIDENTITY_OFFSET 20
728 #define PTP_V2_SOURCEPORTID_OFFSET 28
729 #define PTP_V2_SEQUENCEID_OFFSET 30
731 /* Common Offset for TLVs (relative from start of TLV) */
732 #define PTP_V2_TLV_TYPE_OFFSET 0
733 #define PTP_V2_TLV_LENGTH_OFFSET 2
734 #define PTP_V2_TLV_HEADER_LENGTH 4
735 #define PTP_V2_TLV_ORGANIZATIONSUBTYPE_OFFSET 7
737 /* Offsets for PTP_Follow_Up (=FU) messages */
738 #define PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET 34
739 #define PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET 40
741 /* Offsets for PTP_PDelayResponse (=PDRS) messages */
742 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET 34
743 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPNANOSECONDS_OFFSET 40
744 #define PTP_V2_PDRS_REQUESTINGPORTIDENTITY_OFFSET 44
745 #define PTP_V2_PDRS_REQUESTINGSOURCEPORTID_OFFSET 52
747 /* Offsets for PTP_PDelayResponseFollowUp (=PDFU) messages */
748 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET 34
749 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPNANOSECONDS_OFFSET 40
750 #define PTP_V2_PDFU_REQUESTINGPORTIDENTITY_OFFSET 44
751 #define PTP_V2_PDFU_REQUESTINGSOURCEPORTID_OFFSET 52
753 /* PTPv2.1 L1 SYNC flags field length */
754 #define PTP_V2_SIG_TLV_L1SYNC_FLAGS_BASIC_FORMAT 2
755 #define PTP_V2_SIG_TLV_L1SYNC_FLAGS_EXT_FORMAT 3
757 /* Defined in 10.6.4.4.5 */
758 #define PTP_AS_SIG_TLV_TYPE_GPTPCAPABLE_ORG_SUB_TYPE 4
759 /* Defined in 10.6.4.5.5 */
760 #define PTP_AS_SIG_TLV_TYPE_GPTPCAPABLE_MESSSAGEINTERVAL_ORG_SUB_TYPE 5
762 /**********************************************************/
763 /* Message Interval Request flag-field-mask-definitions */
764 /**********************************************************/
765 #define PTP_AS_FLAGS_COMP_NEIGHBOR_RATE_RATIO_BITMASK 0x02
766 #define PTP_AS_FLAGS_COMP_MEAN_LINK_DELAY_BITMASK 0x04
767 #define PTP_AS_FLAGS_ONE_STEP_RECEIVE_CAPABLE 0x08
769 /* Offsets for PTP_V2_Management (=MM) messages */
770 #define PTP_V2_MM_ACTION_OFFSET 46
771 #define PTP_V2_MM_RESERVED_OFFSET 47
774 #define PTP_V2_MM_TLV_TYPE_OFFSET 48
775 #define PTP_V2_MM_TLV_MANAGEMENTID_OFFSET 52
776 #define PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET 52
779 #define PTP_V2_TLV_TYPE_RESERVED 0x0000
780 #define PTP_V2_TLV_TYPE_MANAGEMENT 0x0001
781 #define PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS 0x0002
782 #define PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION 0x0003
783 #define PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION 0x0004
784 #define PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION 0x0005
785 #define PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION 0x0006
786 #define PTP_V2_TLV_TYPE_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION 0x0007
787 #define PTP_V2_TLV_TYPE_PATH_TRACE 0x0008
788 #define PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR 0x0009
789 #define PTP_V2_TLV_TYPE_AUTHENTICATION 0x2000
790 #define PTP_V2_TLV_TYPE_AUTHENTICATION_CHALLENGE 0x2001
791 #define PTP_V2_TLV_TYPE_SECURITY_ASSOCIATION_UPDATE 0x2002
792 #define PTP_V2_TLV_TYPE_CUM_FREQ_SCALE_FACTOR_OFFSET 0x2003
793 #define PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION_PROPAGATE 0x4000
794 #define PTP_V2_TLV_TYPE_ENHANCED_ACCURACY_METRICS 0x4001
795 #define PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION_DO_NOT_PROPAGATE 0x8000
796 #define PTP_V2_TLV_TYPE_L1_SYNC 0x8001
797 #define PTP_V2_TLV_TYPE_PORT_COMMUNICATION_AVAILABILITY 0x8002
798 #define PTP_V2_TLV_TYPE_PROTOCOL_ADDRESS 0x8003
799 #define PTP_V2_TLV_TYPE_SLAVE_RX_SYNC_TIMING_DATA 0x8004
800 #define PTP_V2_TLV_TYPE_SLAVE_RX_SYNC_COMPUTED_DATA 0x8005
801 #define PTP_V2_TLV_TYPE_SLAVE_TX_EVENT_TIMESTAMPS 0x8006
802 #define PTP_V2_TLV_TYPE_CUMULATIVE_RATE_RATIO 0x8007
803 #define PTP_V2_TLV_TYPE_PAD 0x8008
804 #define PTP_V2_TLV_TYPE_AUTHENTICATION2 0x8009
806 /* Signaling TLV Object IDs */
807 #define PTP_AS_TLV_OID_TYPE_802 0x0080C2
809 /* PTPv2 Management clockType Boolean[16] Bits mask */
810 #define CLOCKTYPE_ORDINARY_CLOCK 0x8000
811 #define CLOCKTYPE_BOUNDARY_CLOCK 0x4000
812 #define CLOCKTYPE_P2P_TC 0x2000
813 #define CLOCKTYPE_E2E_TC 0x1000
814 #define CLOCKTYPE_MANAGEMENT_NODE 0x0800
815 #define CLOCKTYPE_RESERVED 0x07FF
817 /* PTPv2 Management IDs */
818 #define PTP_V2_MM_ID_NULL_MANAGEMENT 0x0000
819 #define PTP_V2_MM_ID_CLOCK_DESCRIPTION 0x0001
820 #define PTP_V2_MM_ID_USER_DESCRIPTION 0x0002
821 #define PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE 0x0003
822 #define PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE 0x0004
823 #define PTP_V2_MM_ID_INITIALIZE 0x0005
824 #define PTP_V2_MM_ID_FAULT_LOG 0x0006
825 #define PTP_V2_MM_ID_FAULT_LOG_RESET 0x0007
826 #define PTP_V2_MM_ID_DEFAULT_DATA_SET 0x2000
827 #define PTP_V2_MM_ID_CURRENT_DATA_SET 0x2001
828 #define PTP_V2_MM_ID_PARENT_DATA_SET 0x2002
829 #define PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET 0x2003
830 #define PTP_V2_MM_ID_PORT_DATA_SET 0x2004
831 #define PTP_V2_MM_ID_PRIORITY1 0x2005
832 #define PTP_V2_MM_ID_PRIORITY2 0x2006
833 #define PTP_V2_MM_ID_DOMAIN 0x2007
834 #define PTP_V2_MM_ID_SLAVE_ONLY 0x2008
835 #define PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL 0x2009
836 #define PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT 0x200A
837 #define PTP_V2_MM_ID_LOG_SYNC_INTERVAL 0x200B
838 #define PTP_V2_MM_ID_VERSION_NUMBER 0x200C
839 #define PTP_V2_MM_ID_ENABLE_PORT 0x200D
840 #define PTP_V2_MM_ID_DISABLE_PORT 0x200E
841 #define PTP_V2_MM_ID_TIME 0x200F
842 #define PTP_V2_MM_ID_CLOCK_ACCURACY 0x2010
843 #define PTP_V2_MM_ID_UTC_PROPERTIES 0x2011
844 #define PTP_V2_MM_ID_TRACEABILITY_PROPERTIES 0x2012
845 #define PTP_V2_MM_ID_TIMESCALE_PROPERTIES 0x2013
846 #define PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE 0x2014
847 #define PTP_V2_MM_ID_PATH_TRACE_LIST 0x2015
848 #define PTP_V2_MM_ID_PATH_TRACE_ENABLE 0x2016
849 #define PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE 0x2017
850 #define PTP_V2_MM_ID_UNICAST_MASTER_TABLE 0x2018
851 #define PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE 0x2019
852 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE 0x201A
853 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED 0x201B
854 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE 0x201C
855 #define PTP_V2_MM_ID_ALTERNATE_MASTER 0x201D
856 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE 0x201E
857 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME 0x201F
858 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY 0x2020
859 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES 0x2021
860 #define PTP_V2_MM_ID_EXTERNAL_PORT_CONFIGURATION_ENABLED 0x3001
861 #define PTP_V2_MM_ID_MASTER_ONLY 0x3002
862 #define PTP_V2_MM_ID_HOLDOVER_UPGRADE_ENABLE 0x3003
863 #define PTP_V2_MM_ID_EXT_PORT_CONFIG_PORT_DATA_SET 0x3004
864 #define PTP_V2_MM_ID_TC_DEFAULT_DATA_SET 0x4000
865 #define PTP_V2_MM_ID_TC_PORT_DATA_SET 0x4001
866 #define PTP_V2_MM_ID_PRIMARY_DOMAIN 0x4002
867 #define PTP_V2_MM_ID_DELAY_MECHANISM 0x6000
868 #define PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL 0x6001
870 /* Bitmasks for PTP_V2_SIG_TLV_L1SYNC_FLAGS1_OFFSET */
871 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_TCR_BITMASK 0x1 << 8
872 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_RCR_BITMASK 0x2 << 8
873 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_CR_BITMASK 0x4 << 8
874 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_OPE_BITMASK 0x8 << 8
875 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_RESERVED_BITMASK 0xF0 << 8
877 /* Bitmasks for PTP_V2_SIG_TLV_L1SYNC_FLAGS2_OFFSET */
878 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_ITC_BITMASK 0x1
879 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_IRC_BITMASK 0x2
880 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_IC_BITMASK 0x4
881 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_RESERVED_BITMASK 0xF8
883 /* Bitmasks for PTP_V2_SIG_TLV_L1SYNCEXT_FLAGS3_OFFSET */
884 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS3_TCT_BITMASK 0x1
885 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS3_POV_BITMASK 0x2
886 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS3_FOV_BITMASK 0x4
887 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS3_RESERVED_BITMASK 0xF8
889 /* Bitmasks for reserved values for standard and extended versions of L1_SYNC frames */
890 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_RESERVED_ALL_BITMASK \
891 (PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_RESERVED_BITMASK \
892 | PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_RESERVED_BITMASK)
893 #define PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS3_RESERVED_ALL_BITMASK \
894 (PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_RESERVED_ALL_BITMASK << 8 \
895 | PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS3_RESERVED_BITMASK)
897 /* Subtypes for the OUI_IEEE_802_1 organization ID (802.1AS) */
898 #define PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_FOLLOWUP_INFORMATION_TLV 1
899 #define PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_MSG_INTERVAL_REQ_TLV 2
900 #define PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_CSN_TLV 3
901 #define PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_FOLLOWUP_DRIFT_TRACKING_TLV 6
903 /* Subtypes for the OUI_IEEE_C37_238 organization ID */
904 #define PTP_V2_OE_ORG_IEEE_C37_238_SUBTYPE_C37238TLV 1 /* Defined in IEEE Std C37.238-2011 */
905 #define PTP_V2_OE_ORG_IEEE_C37_238_SUBTYPE_C372382017TLV 2 /* Defined in IEEE Std C37.238-2017 */
907 /* Subtypes for the PTP_V2_OE_ORG_ID_SMPTE organization ID */
908 #define PTP_V2_OE_ORG_SMPTE_SUBTYPE_VERSION_TLV 1
910 /* Subtypes for the OUI_CERN organization ID */
911 #define PTP_V2_OE_ORG_CERN_SUBTYPE_WR_TLV 0xdead01
913 /* Subtypes for ITU-T organization ID */
914 #define PTP_V2_INTERFACE_RATE_TLV 0x000002
916 /* MESSAGE ID for the PTP_V2_OE_ORG_CERN_SUBTYPE_WR_TLV */
917 #define PTP_V2_OE_ORG_CERN_WRMESSAGEID_NULL_WR_TLV 0x0000
918 #define PTP_V2_OE_ORG_CERN_WRMESSAGEID_SLAVE_PRESENT 0x1000
919 #define PTP_V2_OE_ORG_CERN_WRMESSAGEID_LOCK 0x1001
920 #define PTP_V2_OE_ORG_CERN_WRMESSAGEID_LOCKED 0x1002
921 #define PTP_V2_OE_ORG_CERN_WRMESSAGEID_CALIBRATE 0x1003
922 #define PTP_V2_OE_ORG_CERN_WRMESSAGEID_CALIBRATED 0x1004
923 #define PTP_V2_OE_ORG_CERN_WRMESSAGEID_WR_MODE_ON 0x1005
924 #define PTP_V2_OE_ORG_CERN_WRMESSAGEID_ANN_SUFIX 0x2000
926 /* Bitmasks for WRTLV_FLAGS */
927 #define PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_BITMASK 0x3
928 #define PTP_V2_TLV_OE_CERN_WRFLAGS_CALIBRATED_BITMASK 0x4
929 #define PTP_V2_TLV_OE_CERN_WRFLAGS_WRMODEON_BITMASK 0x8
931 /* Values for PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_BITMASK */
932 #define PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_NON_WR 0
933 #define PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_WR_M_ONLY 1
934 #define PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_WR_S_ONLY 2
935 #define PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_WR_M_AND_S 3
937 #define PTP_V2_MAJORSDOID_ASPACKET_BITMASK 0x10
940 /**********************************************************/
941 /* flag-field-mask-definitions */
942 /**********************************************************/
943 #define PTP_V2_FLAGS_LI61_BITMASK 0x0001
944 #define PTP_V2_FLAGS_LI59_BITMASK 0x0002
945 #define PTP_V2_FLAGS_UTC_OFFSET_VALID_BITMASK 0x0004
946 #define PTP_V2_FLAGS_PTP_TIMESCALE_BITMASK 0x0008
947 #define PTP_V2_FLAGS_TIME_TRACEABLE_BITMASK 0x0010
948 #define PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK 0x0020
949 #define PTP_V2_FLAGS_SYNCHRONIZATION_UNCERTAIN_BITMASK 0x0040
950 #define PTP_V2_FLAGS_ALTERNATE_BITMASK 0x0100
951 #define PTP_V2_FLAGS_TWO_STEP_BITMASK 0x0200
952 #define PTP_V2_FLAGS_UNICAST_BITMASK 0x0400
953 #define PTP_V2_FLAGS_SPECIFIC1_BITMASK 0x2000
954 #define PTP_V2_FLAGS_SPECIFIC2_BITMASK 0x4000
955 #define PTP_V2_FLAGS_SECURITY_BITMASK 0x8000
957 #define PTP_V2_FLAGS_OE_SMPTE_TIME_ADDRESS_FIELD_DROP 0x01
958 #define PTP_V2_FLAGS_OE_SMPTE_TIME_ADDRESS_FIELD_COLOR 0x02
960 #define PTP_V2_FLAGS_OE_SMPTE_DAYLIGHT_SAVING_CURRENT 0x01
961 #define PTP_V2_FLAGS_OE_SMPTE_DAYLIGHT_SAVING_NEXT 0x02
962 #define PTP_V2_FLAGS_OE_SMPTE_DAYLIGHT_SAVING_PREVIOUS 0x04
964 #define PTP_V2_FLAGS_OE_SMPTE_LEAP_SECOND_JUMP_CHANGE 0x01
966 /**********************************************************/
967 /* PTP v2 message ids (ptp messageid field) */
968 /**********************************************************/
969 #define PTP_V2_SYNC_MESSAGE 0x00
970 #define PTP_V2_DELAY_REQ_MESSAGE 0x01
971 #define PTP_V2_PEER_DELAY_REQ_MESSAGE 0x02
972 #define PTP_V2_PEER_DELAY_RESP_MESSAGE 0x03
973 #define PTP_V2_FOLLOWUP_MESSAGE 0x08
974 #define PTP_V2_DELAY_RESP_MESSAGE 0x09
975 #define PTP_V2_PEER_DELAY_FOLLOWUP_MESSAGE 0x0A
976 #define PTP_V2_ANNOUNCE_MESSAGE 0x0B
977 #define PTP_V2_SIGNALING_MESSAGE 0x0C
978 #define PTP_V2_MANAGEMENT_MESSAGE 0x0D
981 static const value_string ptp_v2_managementID_vals
[] = {
982 {PTP_V2_MM_ID_NULL_MANAGEMENT
, "NULL_MANAGEMENT"},
983 {PTP_V2_MM_ID_CLOCK_DESCRIPTION
, "CLOCK_DESCRIPTION"},
984 {PTP_V2_MM_ID_USER_DESCRIPTION
, "USER_DESCRIPTION"},
985 {PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE
, "SAVE_IN_NON_VOLATILE_STORAGE"},
986 {PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE
, "RESET_NON_VOLATILE_STORAGE"},
987 {PTP_V2_MM_ID_INITIALIZE
, "INITIALIZE"},
988 {PTP_V2_MM_ID_FAULT_LOG
, "FAULT_LOG"},
989 {PTP_V2_MM_ID_FAULT_LOG_RESET
, "FAULT_LOG_RESET"},
990 {PTP_V2_MM_ID_DEFAULT_DATA_SET
, "DEFAULT_DATA_SET"},
991 {PTP_V2_MM_ID_CURRENT_DATA_SET
, "CURRENT_DATA_SET"},
992 {PTP_V2_MM_ID_PARENT_DATA_SET
, "PARENT_DATA_SET"},
993 {PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET
, "TIME_PROPERTIES_DATA_SET"},
994 {PTP_V2_MM_ID_PORT_DATA_SET
, "PORT_DATA_SET"},
995 {PTP_V2_MM_ID_PRIORITY1
, "PRIORITY1"},
996 {PTP_V2_MM_ID_PRIORITY2
, "PRIORITY2"},
997 {PTP_V2_MM_ID_DOMAIN
, "DOMAIN"},
998 {PTP_V2_MM_ID_SLAVE_ONLY
, "SLAVE_ONLY"},
999 {PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL
, "LOG_ANNOUNCE_INTERVAL"},
1000 {PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT
, "ANNOUNCE_RECEIPT_TIMEOUT"},
1001 {PTP_V2_MM_ID_LOG_SYNC_INTERVAL
, "LOG_SYNC_INTERVAL"},
1002 {PTP_V2_MM_ID_VERSION_NUMBER
, "VERSION_NUMBER"},
1003 {PTP_V2_MM_ID_ENABLE_PORT
, "ENABLE_PORT"},
1004 {PTP_V2_MM_ID_DISABLE_PORT
, "DISABLE_PORT"},
1005 {PTP_V2_MM_ID_TIME
, "TIME"},
1006 {PTP_V2_MM_ID_CLOCK_ACCURACY
, "CLOCK_ACCURACY"},
1007 {PTP_V2_MM_ID_UTC_PROPERTIES
, "UTC_PROPERTIES"},
1008 {PTP_V2_MM_ID_TRACEABILITY_PROPERTIES
, "TRACEABILITY_PROPERTIES"},
1009 {PTP_V2_MM_ID_TIMESCALE_PROPERTIES
, "TIMESCALE_PROPERTIES"},
1010 {PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE
, "UNICAST_NEGOTIATION_ENABLE"},
1011 {PTP_V2_MM_ID_PATH_TRACE_LIST
, "PATH_TRACE_LIST"},
1012 {PTP_V2_MM_ID_PATH_TRACE_ENABLE
, "PATH_TRACE_ENABLE"},
1013 {PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE
, "GRANDMASTER_CLUSTER_TABLE"},
1014 {PTP_V2_MM_ID_UNICAST_MASTER_TABLE
, "UNICAST_MASTER_TABLE"},
1015 {PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE
, "UNICAST_MASTER_MAX_TABLE_SIZE"},
1016 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE
, "ACCEPTABLE_MASTER_TABLE"},
1017 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED
, "ACCEPTABLE_MASTER_TABLE_ENABLED"},
1018 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE
, "ACCEPTABLE_MASTER_MAX_TABLE_SIZE"},
1019 {PTP_V2_MM_ID_ALTERNATE_MASTER
, "ALTERNATE_MASTER"},
1020 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE
, "ALTERNATE_TIME_OFFSET_ENABLE"},
1021 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME
, "ALTERNATE_TIME_OFFSET_NAME"},
1022 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY
, "ALTERNATE_TIME_OFFSET_MAX_KEY"},
1023 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES
, "ALTERNATE_TIME_OFFSET_PROPERTIES"},
1024 {PTP_V2_MM_ID_EXTERNAL_PORT_CONFIGURATION_ENABLED
, "EXTERNAL_PORT_CONFIGURATION_ENABLED"},
1025 {PTP_V2_MM_ID_MASTER_ONLY
, "MASTER_ONLY"},
1026 {PTP_V2_MM_ID_HOLDOVER_UPGRADE_ENABLE
, "HOLDOVER_UPGRADE_ENABLE"},
1027 {PTP_V2_MM_ID_EXT_PORT_CONFIG_PORT_DATA_SET
, "EXT_PORT_CONFIG_PORT_DATA_SET"},
1028 {PTP_V2_MM_ID_TC_DEFAULT_DATA_SET
, "TC_DEFAULT_DATA_SET"},
1029 {PTP_V2_MM_ID_TC_PORT_DATA_SET
, "TC_PORT_DATA_SET"},
1030 {PTP_V2_MM_ID_PRIMARY_DOMAIN
, "PRIMARY_DOMAIN"},
1031 {PTP_V2_MM_ID_DELAY_MECHANISM
, "DELAY_MECHANISM"},
1032 {PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL
, "LOG_MIN_PDELAY_REQ_INTERVAL"},
1035 static value_string_ext ptp_v2_managementID_vals_ext
= VALUE_STRING_EXT_INIT(ptp_v2_managementID_vals
);
1037 /* same again but better readable text for info column */
1038 static const value_string ptp_v2_managementID_infocolumn_vals
[] = {
1039 {PTP_V2_MM_ID_NULL_MANAGEMENT
, "Null management"},
1040 {PTP_V2_MM_ID_CLOCK_DESCRIPTION
, "Clock description"},
1041 {PTP_V2_MM_ID_USER_DESCRIPTION
, "User description"},
1042 {PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE
, "Save in non volatile storage"},
1043 {PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE
, "Reset non volatile storage"},
1044 {PTP_V2_MM_ID_INITIALIZE
, "Initialize"},
1045 {PTP_V2_MM_ID_FAULT_LOG
, "Fault log"},
1046 {PTP_V2_MM_ID_FAULT_LOG_RESET
, "Fault log reset"},
1047 {PTP_V2_MM_ID_DEFAULT_DATA_SET
, "Default dataset"},
1048 {PTP_V2_MM_ID_CURRENT_DATA_SET
, "Current dataset"},
1049 {PTP_V2_MM_ID_PARENT_DATA_SET
, "Parent dataset"},
1050 {PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET
, "Time properties dataset"},
1051 {PTP_V2_MM_ID_PORT_DATA_SET
, "Port dataset"},
1052 {PTP_V2_MM_ID_PRIORITY1
, "Priority 1"},
1053 {PTP_V2_MM_ID_PRIORITY2
, "Priority 2"},
1054 {PTP_V2_MM_ID_DOMAIN
, "Domain"},
1055 {PTP_V2_MM_ID_SLAVE_ONLY
, "Slave only"},
1056 {PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL
, "Log announce interval"},
1057 {PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT
, "Announce receipt timeout"},
1058 {PTP_V2_MM_ID_LOG_SYNC_INTERVAL
, "Log sync interval"},
1059 {PTP_V2_MM_ID_VERSION_NUMBER
, "Version number"},
1060 {PTP_V2_MM_ID_ENABLE_PORT
, "Enable port"},
1061 {PTP_V2_MM_ID_DISABLE_PORT
, "Disable port"},
1062 {PTP_V2_MM_ID_TIME
, "Time"},
1063 {PTP_V2_MM_ID_CLOCK_ACCURACY
, "Clock accuracy"},
1064 {PTP_V2_MM_ID_UTC_PROPERTIES
, "UTC properties"},
1065 {PTP_V2_MM_ID_TRACEABILITY_PROPERTIES
, "Traceability properties"},
1066 {PTP_V2_MM_ID_TIMESCALE_PROPERTIES
, "Timescale properties"},
1067 {PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE
, "Unicast negotiation enable"},
1068 {PTP_V2_MM_ID_PATH_TRACE_LIST
, "Path trace list"},
1069 {PTP_V2_MM_ID_PATH_TRACE_ENABLE
, "Path trace enable"},
1070 {PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE
, "Grandmaster cluster table"},
1071 {PTP_V2_MM_ID_UNICAST_MASTER_TABLE
, "Unicast master table"},
1072 {PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE
, "Unicast master max table size"},
1073 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE
, "Acceptable master table"},
1074 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED
, "Acceptable master table enabled"},
1075 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE
, "Acceptable master max table size"},
1076 {PTP_V2_MM_ID_ALTERNATE_MASTER
, "Alternate master"},
1077 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE
, "Alternate time offset enable"},
1078 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME
, "Alternate time offset name"},
1079 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY
, "Alternate time offset max key"},
1080 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES
, "Alternate time offset properties"},
1081 {PTP_V2_MM_ID_EXTERNAL_PORT_CONFIGURATION_ENABLED
, "External port configuration enabled"},
1082 {PTP_V2_MM_ID_MASTER_ONLY
, "Master only"},
1083 {PTP_V2_MM_ID_HOLDOVER_UPGRADE_ENABLE
, "Holdover upgrade enable"},
1084 {PTP_V2_MM_ID_EXT_PORT_CONFIG_PORT_DATA_SET
, "External port config port data set"},
1085 {PTP_V2_MM_ID_TC_DEFAULT_DATA_SET
, "Transparent clock default dataset"},
1086 {PTP_V2_MM_ID_TC_PORT_DATA_SET
, "Transparent clock port dataset"},
1087 {PTP_V2_MM_ID_PRIMARY_DOMAIN
, "Primary domain"},
1088 {PTP_V2_MM_ID_DELAY_MECHANISM
, "Delay mechanism"},
1089 {PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL
, "Log min pdelay req. interval"},
1092 static value_string_ext ptp_v2_managementID_infocolumn_vals_ext
= VALUE_STRING_EXT_INIT(ptp_v2_managementID_infocolumn_vals
);
1094 static const value_string ptp_v2_TLV_type_vals
[] = {
1095 {PTP_V2_TLV_TYPE_RESERVED
, "Reserved"},
1096 {PTP_V2_TLV_TYPE_MANAGEMENT
, "Management"},
1097 {PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS
, "Management error status"},
1098 {PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION
, "Organization extension"},
1099 {PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION
, "Request unicast transmission"},
1100 {PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION
, "Grant unicast transmission"},
1101 {PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION
, "Cancel unicast transmission"},
1102 {PTP_V2_TLV_TYPE_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION
, "Acknowledge cancel unicast transmission"},
1103 {PTP_V2_TLV_TYPE_PATH_TRACE
, "Path trace"},
1104 {PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR
, "Alternate time offset indicator"},
1105 {PTP_V2_TLV_TYPE_AUTHENTICATION
, "Authentication"},
1106 {PTP_V2_TLV_TYPE_AUTHENTICATION_CHALLENGE
, "Authentication challenge"},
1107 {PTP_V2_TLV_TYPE_SECURITY_ASSOCIATION_UPDATE
, "Security association update"},
1108 {PTP_V2_TLV_TYPE_CUM_FREQ_SCALE_FACTOR_OFFSET
, "Cum. freq. scale factor offset"},
1109 {PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION_PROPAGATE
, "Organization extension propagate"},
1110 {PTP_V2_TLV_TYPE_ENHANCED_ACCURACY_METRICS
, "Enhanced accuracy metrics"},
1111 {PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION_DO_NOT_PROPAGATE
, "Organization extension do not propagate"},
1112 {PTP_V2_TLV_TYPE_L1_SYNC
, "L1 sync"},
1113 {PTP_V2_TLV_TYPE_PORT_COMMUNICATION_AVAILABILITY
, "Port communication availability"},
1114 {PTP_V2_TLV_TYPE_PROTOCOL_ADDRESS
, "Protocol address"},
1115 {PTP_V2_TLV_TYPE_SLAVE_RX_SYNC_TIMING_DATA
, "Slave rx sync timing data"},
1116 {PTP_V2_TLV_TYPE_SLAVE_RX_SYNC_COMPUTED_DATA
, "Slave rx sync computed data"},
1117 {PTP_V2_TLV_TYPE_SLAVE_TX_EVENT_TIMESTAMPS
, "Slave tx event timestamps"},
1118 {PTP_V2_TLV_TYPE_CUMULATIVE_RATE_RATIO
, "Cumulative rate ratio"},
1119 {PTP_V2_TLV_TYPE_PAD
, "Pad"},
1120 {PTP_V2_TLV_TYPE_AUTHENTICATION2
, "Authentication"},
1123 static value_string_ext ptp_v2_TLV_type_vals_ext
= VALUE_STRING_EXT_INIT(ptp_v2_TLV_type_vals
);
1126 static const value_string ptp_v2_networkProtocol_vals
[] = {
1127 {0x0000, "Reserved"},
1128 {0x0001, "UDP/IPv4"},
1129 {0x0002, "UDP/IPv6"},
1130 {0x0003, "IEEE 802.3"},
1131 {0x0004, "DeviceNet"},
1132 {0x0005, "ControlNet"},
1133 {0x0006, "PROFINET"},
1134 {0x0007, "Reserved"},
1135 {0xFFFE, "Unknown Protocol"},
1136 {0xFFFF, "Reserved"},
1139 static value_string_ext ptp_v2_networkProtocol_vals_ext
= VALUE_STRING_EXT_INIT(ptp_v2_networkProtocol_vals
);
1142 static const value_string ptp_v2_messagetype_vals
[] = {
1143 {PTP_V2_SYNC_MESSAGE
, "Sync Message"},
1144 {PTP_V2_DELAY_REQ_MESSAGE
, "Delay_Req Message"},
1145 {PTP_V2_PEER_DELAY_REQ_MESSAGE
, "Peer_Delay_Req Message"},
1146 {PTP_V2_PEER_DELAY_RESP_MESSAGE
, "Peer_Delay_Resp Message"},
1147 {PTP_V2_FOLLOWUP_MESSAGE
, "Follow_Up Message"},
1148 {PTP_V2_DELAY_RESP_MESSAGE
, "Delay_Resp Message"},
1149 {PTP_V2_PEER_DELAY_FOLLOWUP_MESSAGE
, "Peer_Delay_Resp_Follow_Up Message"},
1150 {PTP_V2_ANNOUNCE_MESSAGE
, "Announce Message"},
1151 {PTP_V2_SIGNALING_MESSAGE
, "Signaling Message"},
1152 {PTP_V2_MANAGEMENT_MESSAGE
, "Management Message"},
1155 static value_string_ext ptp_v2_messagetype_vals_ext
= VALUE_STRING_EXT_INIT(ptp_v2_messagetype_vals
);
1157 static const value_string ptp_v2_clockAccuracy_vals
[] = {
1158 {0x17, "The time is accurate to within 1 ps"},
1159 {0x18, "The time is accurate to within 2,5 ps"},
1160 {0x19, "The time is accurate to within 10 ps"},
1161 {0x1A, "The time is accurate to within 25 ps"},
1162 {0x1B, "The time is accurate to within 100 ps"},
1163 {0x1C, "The time is accurate to within 250 ps"},
1164 {0x1D, "The time is accurate to within 1 ns"},
1165 {0x1E, "The time is accurate to within 2,5 ns"},
1166 {0x1F, "The time is accurate to within 10 ns"},
1167 {0x20, "The time is accurate to within 25 ns"},
1168 {0x21, "The time is accurate to within 100 ns"},
1169 {0x22, "The time is accurate to within 250 ns"},
1170 {0x23, "The time is accurate to within 1 us"},
1171 {0x24, "The time is accurate to within 2,5 us"},
1172 {0x25, "The time is accurate to within 10 us"},
1173 {0x26, "The time is accurate to within 25 us"},
1174 {0x27, "The time is accurate to within 100 us"},
1175 {0x28, "The time is accurate to within 250 us"},
1176 {0x29, "The time is accurate to within 1 ms"},
1177 {0x2A, "The time is accurate to within 2,5 ms"},
1178 {0x2B, "The time is accurate to within 10 ms"},
1179 {0x2C, "The time is accurate to within 25 ms"},
1180 {0x2D, "The time is accurate to within 100 ms"},
1181 {0x2E, "The time is accurate to within 250 ms"},
1182 {0x2F, "The time is accurate to within 1 s"},
1183 {0x30, "The time is accurate to within 10 s"},
1184 {0x31, "The time is accurate to >10 s"},
1186 {0x80, "For use by alternate PTP profiles"},
1187 {0xFE, "Accuracy Unknown"},
1191 /* Exposed in packet-ptp.h */
1192 value_string_ext ptp_v2_clockAccuracy_vals_ext
=
1193 VALUE_STRING_EXT_INIT(ptp_v2_clockAccuracy_vals
);
1195 static const value_string ptp_v2_timeSource_vals
[] = {
1196 {0x10, "ATOMIC_CLOCK"},
1198 {0x30, "TERRESTRIAL_RADIO"},
1199 {0x39, "SERIAL_TIME_CODE"},
1204 {0xA0, "INTERNAL_OSCILLATOR"},
1208 /* Exposed in packet-ptp.h */
1209 value_string_ext ptp_v2_timeSource_vals_ext
=
1210 VALUE_STRING_EXT_INIT(ptp_v2_timeSource_vals
);
1212 static const value_string ptp_v2_mm_action_vals
[] = {
1217 {0x4, "ACKNOWLEDGE"},
1221 static const value_string ptp_v2_severityCode_vals
[] = {
1222 {0x00, "Emergency: system is unusable"},
1223 {0x01, "Alert: immediate action needed"},
1224 {0x02, "Critical: critical conditions"},
1225 {0x03, "Error: error conditions"},
1226 {0x04, "Warning: warning conditions"},
1227 {0x05, "Notice: normal but significant condition"},
1228 {0x06, "Informational: informational messages"},
1229 {0x07, "Debug: debug-level messages"},
1234 static value_string_ext ptp_v2_severityCode_vals_ext
=
1235 VALUE_STRING_EXT_INIT(ptp_v2_severityCode_vals
);
1237 static const value_string ptp_v2_portState_vals
[] = {
1238 {0x01, "INITIALIZING"},
1241 {0x04, "LISTENING"},
1242 {0x05, "PRE_MASTER"},
1245 {0x08, "UNCALIBRATED"},
1249 /* Exposed in packet-ptp.h */
1250 value_string_ext ptp_v2_portState_vals_ext
=
1251 VALUE_STRING_EXT_INIT(ptp_v2_portState_vals
);
1253 /* Exposed in packet-ptp.h */
1254 const value_string ptp_v2_delayMechanism_vals
[] = {
1257 {0x03, "COMMON_P2P"},
1259 {0xFE, "NO_MECHANISM"},
1263 static const value_string ptp_v2_managementErrorId_vals
[] = {
1264 {0x0000, "Reserved"},
1265 {0x0001, "RESPONSE_TOO_BIG"},
1266 {0x0002, "NO_SUCH_ID"},
1267 {0x0003, "WRONG_LENGTH"},
1268 {0x0004, "WRONG_VALUE"},
1269 {0x0005, "NOT_SETABLE"},
1270 {0x0006, "NOT_SUPPORTED"},
1271 {0x0007, "Reserved"},
1272 {0xFFFE, "GENERAL_ERROR"},
1273 {0xFFFF, "Reserved"},
1276 static value_string_ext ptp_v2_managementErrorId_vals_ext
=
1277 VALUE_STRING_EXT_INIT(ptp_v2_managementErrorId_vals
);
1279 static const value_string ptp_v2_org_802_1_subtype_vals
[] = {
1280 {PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_FOLLOWUP_INFORMATION_TLV
, "Follow_Up information TLV"},
1281 {PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_MSG_INTERVAL_REQ_TLV
, "Message interval request TLV"},
1282 {PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_CSN_TLV
, "CSN TLV"},
1283 {PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_FOLLOWUP_DRIFT_TRACKING_TLV
, "Follow_Up drift tracking TLV"},
1287 static const value_string ptp_v2_org_802_1_no_propagate_subtype_vals
[] = {
1288 {PTP_AS_SIG_TLV_TYPE_GPTPCAPABLE_ORG_SUB_TYPE
, "gPTP-capable TLV"},
1289 {PTP_AS_SIG_TLV_TYPE_GPTPCAPABLE_MESSSAGEINTERVAL_ORG_SUB_TYPE
, "gPTP-capable message interval request TLV"},
1293 static const value_string ptp_v2_org_ieee_c37_238_2017_subtype_vals
[] = {
1294 {PTP_V2_OE_ORG_IEEE_C37_238_SUBTYPE_C372382017TLV
, "IEEE_C37_238_2017 TLV"},
1298 static const value_string ptp_v2_org_smpte_subtype_vals
[] = {
1299 {PTP_V2_OE_ORG_SMPTE_SUBTYPE_VERSION_TLV
, "Version"},
1303 static const value_string ptp_v2_org_cern_subtype_vals
[] = {
1304 {PTP_V2_OE_ORG_CERN_SUBTYPE_WR_TLV
, "White Rabbit"},
1308 static const value_string ptp_v2_org_itut_subtype_vals
[] = {
1309 {PTP_V2_INTERFACE_RATE_TLV
, "Interface Rate TLV"},
1313 static const value_string ptp_v2_org_cern_wrMessageID_vals
[] = {
1314 {PTP_V2_OE_ORG_CERN_WRMESSAGEID_NULL_WR_TLV
, "NULL_WR_TLV"},
1315 {PTP_V2_OE_ORG_CERN_WRMESSAGEID_SLAVE_PRESENT
,"SLAVE_PRESENT"},
1316 {PTP_V2_OE_ORG_CERN_WRMESSAGEID_LOCK
, "LOCK"},
1317 {PTP_V2_OE_ORG_CERN_WRMESSAGEID_LOCKED
, "LOCKED"},
1318 {PTP_V2_OE_ORG_CERN_WRMESSAGEID_CALIBRATE
, "CALIBRATE"},
1319 {PTP_V2_OE_ORG_CERN_WRMESSAGEID_CALIBRATED
, "CALIBRATED"},
1320 {PTP_V2_OE_ORG_CERN_WRMESSAGEID_WR_MODE_ON
, "WR_MODE_ON"},
1321 {PTP_V2_OE_ORG_CERN_WRMESSAGEID_ANN_SUFIX
, "ANN_SUFIX"},
1325 static const value_string ptp_v2_tlv_oe_cern_wrFlags_wrConfig_vals
[] = {
1326 {PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_NON_WR
, "NON WR"},
1327 {PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_WR_M_ONLY
, "WR_M_ONLY"},
1328 {PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_WR_S_ONLY
, "WR_S_ONLY"},
1329 {PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_WR_M_AND_S
, "WR_M_AND_S"},
1333 static const value_string ptp_v2_org_smpte_subtype_masterlockingstatus_vals
[] = {
1336 {2, "Cold Locking"},
1337 {3, "Warm Locking"},
1342 /**********************************************************/
1343 /* MajorSdoId values for the PTPv2 */
1344 /**********************************************************/
1345 // 802.1AS 10.6.2.2.1 majorSdoId
1346 static const value_string ptpv2_majorsdoid_vals
[] = {
1347 {0x1, "gPTP Domain"},
1352 /* END PTPv2 MajorSdoId values */
1354 /**********************************************************/
1355 /* Initialize the protocol and registered fields */
1356 /**********************************************************/
1358 static int hf_ptp_v2_majorsdoid
;
1359 static int hf_ptp_v2_messagetype
;
1360 static int hf_ptp_v2_minorversionptp
;
1361 static int hf_ptp_v2_versionptp
;
1362 static int hf_ptp_v2_messagelength
;
1363 static int hf_ptp_v2_minorsdoid
;
1364 static int hf_ptp_v2_domainnumber
;
1365 static int hf_ptp_v2_flags
;
1366 static int hf_ptp_v2_flags_alternatemaster
;
1367 static int hf_ptp_v2_flags_twostep
;
1368 static int hf_ptp_v2_flags_unicast
;
1369 static int hf_ptp_v2_flags_specific1
;
1370 static int hf_ptp_v2_flags_specific2
;
1371 static int hf_ptp_v2_flags_security
;
1372 static int hf_ptp_v2_flags_li61
;
1373 static int hf_ptp_v2_flags_li59
;
1374 static int hf_ptp_v2_flags_utcoffsetvalid
;
1375 static int hf_ptp_v2_flags_ptptimescale
;
1376 static int hf_ptp_v2_flags_timetraceable
;
1377 static int hf_ptp_v2_flags_frequencytraceable
;
1378 static int hf_ptp_v2_correction
;
1379 static int hf_ptp_v2_correctionsubns
;
1380 static int hf_ptp_v2_messagetypespecific
;
1381 static int hf_ptp_v2_clockidentity
;
1382 static int hf_ptp_v2_clockidentity_manuf
;
1383 static int hf_ptp_v2_sourceportid
;
1384 static int hf_ptp_v2_sequenceid
;
1385 static int hf_ptp_v2_controlfield
;
1386 static int hf_ptp_v2_controlfield_default
;
1387 static int hf_ptp_v2_logmessageperiod
;
1388 static int hf_ptp_v2_flags_synchronizationUncertain
;
1391 /* Fields for PTP_Announce (=an) messages */
1392 /* static int hf_ptp_v2_an_origintimestamp; */ /* Field for seconds & nanoseconds */
1393 static int hf_ptp_v2_an_reserved1
;
1394 static int hf_ptp_v2_an_reserved2
;
1395 static int hf_ptp_v2_an_origintimestamp_seconds
;
1396 static int hf_ptp_v2_an_origintimestamp_nanoseconds
;
1397 static int hf_ptp_v2_an_origincurrentutcoffset
;
1398 static int hf_ptp_v2_an_timesource
;
1399 static int hf_ptp_v2_an_localstepsremoved
;
1400 static int hf_ptp_v2_an_grandmasterclockidentity
;
1401 static int hf_ptp_v2_an_grandmasterclockclass
;
1402 static int hf_ptp_v2_an_grandmasterclockaccuracy
;
1403 static int hf_ptp_v2_an_grandmasterclockvariance
;
1404 static int hf_ptp_v2_an_priority1
;
1405 static int hf_ptp_v2_an_priority2
;
1408 /* Fields for general TLVs handling */
1409 static int hf_ptp_tlv_tlvtype
;
1410 static int hf_ptp_tlv_lengthfield
;
1411 static int hf_ptp_tlv_unparsed_payload
;
1412 /* Fields for the ORGANIZATION_EXTENSION TLV */
1413 static int hf_ptp_tlv_oe_organizationid
;
1414 static int hf_ptp_tlv_oe_organizationsubtype
;
1415 static int hf_ptp_tlv_oe_organizationsubtype_802_1
;
1416 static int hf_ptp_tlv_oe_organizationsubtype_802_1_no_propagate
;
1418 /* Fields for PTP_Announce TLVs */
1419 static int hf_ptp_v2_oe_tlv_ieee_c37_238_2017_organizationsubtype
;
1420 static int hf_ptp_v2_oe_tlv_datafield
;
1422 /* Fields for CERN White Rabbit TLV (OE TLV subtype) */
1423 static int hf_ptp_v2_an_tlv_oe_cern_subtype
;
1424 static int hf_ptp_v2_an_tlv_oe_cern_wrMessageID
;
1425 static int hf_ptp_v2_an_tlv_oe_cern_wrFlags
;
1426 static int hf_ptp_v2_an_tlv_oe_cern_wrFlags_wrConfig
;
1427 static int hf_ptp_v2_an_tlv_oe_cern_wrFlags_calibrated
;
1428 static int hf_ptp_v2_an_tlv_oe_cern_wrFlags_wrModeOn
;
1430 /* Fields for IEEE_C37_238 TLV (OE TLV subtype) */
1431 static int hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmasterid
;
1432 static int hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmastertimeinaccuracy
;
1433 static int hf_ptp_v2_oe_tlv_subtype_c37238tlv_networktimeinaccuracy
;
1434 static int hf_ptp_v2_oe_tlv_subtype_c37238tlv_reserved
;
1436 /* Additional Fields for IEEE_C37_238-2017 TLV (OE TLV subtype) */
1437 static int hf_ptp_v2_oe_tlv_subtype_c372382017tlv_reserved
;
1438 static int hf_ptp_v2_oe_tlv_subtype_c37238tlv_totaltimeinaccuracy
;
1440 /* Fields for SMPTE TLV (OE TLV subtype) */
1441 static int hf_ptp_v2_oe_tlv_smpte_subtype
;
1442 static int hf_ptp_v2_oe_tlv_subtype_smpte_data
;
1443 static int hf_ptp_v2_oe_tlv_subtype_smpte_defaultsystemframerate
;
1444 static int hf_ptp_v2_oe_tlv_subtype_smpte_defaultsystemframerate_numerator
;
1445 static int hf_ptp_v2_oe_tlv_subtype_smpte_defaultsystemframerate_denominator
;
1446 static int hf_ptp_v2_oe_tlv_subtype_smpte_masterlockingstatus
;
1447 static int hf_ptp_v2_oe_tlv_subtype_smpte_timeaddressflags
;
1448 static int hf_ptp_v2_oe_tlv_subtype_smpte_timeaddressflags_drop
;
1449 static int hf_ptp_v2_oe_tlv_subtype_smpte_timeaddressflags_color
;
1450 static int hf_ptp_v2_oe_tlv_subtype_smpte_currentlocaloffset
;
1451 static int hf_ptp_v2_oe_tlv_subtype_smpte_jumpseconds
;
1452 static int hf_ptp_v2_oe_tlv_subtype_smpte_timeofnextjump
;
1453 static int hf_ptp_v2_oe_tlv_subtype_smpte_timeofnextjam
;
1454 static int hf_ptp_v2_oe_tlv_subtype_smpte_timeofpreviousjam
;
1455 static int hf_ptp_v2_oe_tlv_subtype_smpte_previousjamlocaloffset
;
1456 static int hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving
;
1457 static int hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving_current
;
1458 static int hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving_next
;
1459 static int hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving_previous
;
1460 static int hf_ptp_v2_oe_tlv_subtype_smpte_leapsecondjump
;
1461 static int hf_ptp_v2_oe_tlv_subtype_smpte_leapsecondjump_change
;
1462 /* Fields for the ALTERNATE_TIME_OFFSET_INDICATOR TLV */
1463 static int hf_ptp_v2_atoi_tlv_keyfield
;
1464 static int hf_ptp_v2_atoi_tlv_currentoffset
;
1465 static int hf_ptp_v2_atoi_tlv_jumpseconds
;
1466 static int hf_ptp_v2_atoi_tlv_timeofnextjump
;
1467 static int hf_ptp_v2_atoi_tlv_displayname
;
1468 static int hf_ptp_v2_atoi_tlv_displayname_length
;
1469 /* Field for the PATH TRACE TLV */
1470 static int hf_ptp_v2_an_tlv_pathsequence
;
1472 /* Fields for an undissected TLV */
1473 static int hf_ptp_v2_an_tlv_data
;
1475 /* Fields for PTP_Sync AND PTP_DelayRequest (=sdr) messages */
1476 /* static int hf_ptp_v2_sdr_origintimestamp; */ /* Field for seconds & nanoseconds */
1477 static int hf_ptp_v2_sdr_origintimestamp_seconds
;
1478 static int hf_ptp_v2_sdr_origintimestamp_nanoseconds
;
1479 static int hf_ptp_v2_sync_reserved
;
1482 /* Fields for PTP_Follow_Up (=fu) messages */
1483 /* static int hf_ptp_v2_fu_preciseorigintimestamp; */ /* Field for seconds & nanoseconds */
1484 static int hf_ptp_v2_fu_preciseorigintimestamp_seconds
;
1485 static int hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds
;
1486 static int hf_ptp_v2_fu_preciseorigintimestamp_32bit
;
1487 /* Fields for the Follow_Up Information TLV */
1488 static int hf_ptp_as_fu_tlv_cumulative_scaled_rate_offset
;
1489 static int hf_ptp_as_fu_tlv_cumulative_rate_ratio
; /* Remove scale and offset from above */
1490 static int hf_ptp_as_fu_tlv_gm_base_indicator
;
1491 static int hf_ptp_as_fu_tlv_last_gm_phase_change
;
1492 static int hf_ptp_as_fu_tlv_scaled_last_gm_freq_change
;
1493 /* Fields for the Drift_Tracking TLV */
1494 static int hf_ptp_as_dt_tlv_sync_egress_timestamp_seconds
;
1495 static int hf_ptp_as_dt_tlv_sync_egress_timestamp_fractional_nanoseconds
;
1496 static int hf_ptp_as_dt_tlv_sync_grandmaster_identity
;
1497 static int hf_ptp_as_dt_tlv_sync_steps_removed
;
1498 static int hf_ptp_as_dt_tlv_rate_ratio_drift
;
1499 static int hf_ptp_as_dt_tlv_rate_ratio_drift_ppm
;
1501 /* Fields for PTP_DelayResponse (=dr) messages */
1502 /* static int hf_ptp_v2_dr_receivetimestamp; */ /* Field for seconds & nanoseconds */
1503 static int hf_ptp_v2_dr_receivetimestamp_seconds
;
1504 static int hf_ptp_v2_dr_receivetimestamp_nanoseconds
;
1505 static int hf_ptp_v2_dr_requestingportidentity
;
1506 static int hf_ptp_v2_dr_requestingsourceportid
;
1509 /* Fields for PTP_PDelayRequest (=pdrq) messages */
1510 /* static int hf_ptp_v2_pdrq_origintimestamp; */ /* Field for seconds & nanoseconds */
1511 static int hf_ptp_v2_pdrq_origintimestamp_seconds
;
1512 static int hf_ptp_v2_pdrq_origintimestamp_nanoseconds
;
1513 static int hf_ptp_v2_pdrq_reserved
;
1516 /* Fields for PTP_PDelayResponse (=pdrs) messages */
1517 /* static int hf_ptp_v2_pdrs_requestreceipttimestamp; */ /* Field for seconds & nanoseconds */
1518 static int hf_ptp_v2_pdrs_requestreceipttimestamp_seconds
;
1519 static int hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds
;
1520 static int hf_ptp_v2_pdrs_requestingportidentity
;
1521 static int hf_ptp_v2_pdrs_requestingsourceportid
;
1524 /* Fields for PTP_PDelayResponseFollowUp (=pdfu) messages */
1525 /* static int hf_ptp_v2_pdfu_responseorigintimestamp; */ /* Field for seconds & nanoseconds */
1526 static int hf_ptp_v2_pdfu_responseorigintimestamp_seconds
;
1527 static int hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds
;
1528 static int hf_ptp_v2_pdfu_requestingportidentity
;
1529 static int hf_ptp_v2_pdfu_requestingsourceportid
;
1532 /* Fields for PTP_Signaling (=sig) messages */
1533 static int hf_ptp_v2_sig_targetportidentity
;
1534 static int hf_ptp_v2_sig_targetportid
;
1535 static int hf_ptp_v2_sig_tlv_data
;
1536 static int hf_ptp_v2_sig_tlv_messageType
;
1537 static int hf_ptp_v2_sig_tlv_logInterMessagePeriod
;
1538 static int hf_ptp_v2_sig_tlv_logInterMessagePeriod_period
;
1539 static int hf_ptp_v2_sig_tlv_logInterMessagePeriod_rate
;
1540 static int hf_ptp_v2_sig_tlv_durationField
;
1541 static int hf_ptp_v2_sig_tlv_renewalInvited
;
1542 static int hf_ptp_v2_sig_tlv_maintainRequest
;
1543 static int hf_ptp_v2_sig_tlv_maintainGrant
;
1544 static int hf_ptp_v2_sig_tlv_reserved
;
1546 /* Fields for the Message Interval Request TLV */
1547 static int hf_ptp_as_sig_tlv_link_delay_interval
;
1548 static int hf_ptp_as_sig_tlv_time_sync_interval
;
1549 static int hf_ptp_as_sig_tlv_announce_interval
;
1550 static int hf_ptp_as_sig_tlv_flags
;
1551 static int hf_ptp_as_sig_tlv_flags_comp_rate_ratio
;
1552 static int hf_ptp_as_sig_tlv_flags_comp_mean_link_delay
;
1553 static int hf_ptp_as_sig_tlv_flags_one_step_receive_capable
;
1554 static int hf_ptp_as_sig_tlv_gptp_capable_message_interval
;
1555 static int hf_ptp_as_sig_tlv_gptp_capable_reserved
;
1556 static int hf_ptp_as_sig_tlv_reserved
;
1558 /* Fields for 802.1AS CSN TLV */
1559 static int hf_ptp_as_csn_upstream_tx_time
;
1560 static int hf_ptp_as_csn_neighbor_rate_ratio
;
1561 static int hf_ptp_as_csn_mean_link_delay
;
1562 static int hf_ptp_as_csn_delay_asymmetry
;
1563 static int hf_ptp_as_csn_domain_number
;
1565 /* Fields for L1SYNC TLV */
1566 static int hf_ptp_v2_sig_tlv_flags2
;
1567 static int hf_ptp_v2_sig_tlv_flags3
;
1568 static int hf_ptp_v2_sig_tlv_l1sync_flags2_reserved
;
1569 static int hf_ptp_v2_sig_tlv_l1sync_flags3_reserved
;
1570 static int hf_ptp_v2_sig_tlv_l1sync_flags2_tcr
;
1571 static int hf_ptp_v2_sig_tlv_l1sync_flags3_tcr
;
1572 static int hf_ptp_v2_sig_tlv_l1sync_flags2_rcr
;
1573 static int hf_ptp_v2_sig_tlv_l1sync_flags3_rcr
;
1574 static int hf_ptp_v2_sig_tlv_l1sync_flags2_cr
;
1575 static int hf_ptp_v2_sig_tlv_l1sync_flags3_cr
;
1576 static int hf_ptp_v2_sig_tlv_l1sync_flags2_ope
;
1577 static int hf_ptp_v2_sig_tlv_l1sync_flags3_ope
;
1578 static int hf_ptp_v2_sig_tlv_l1sync_flags2_itc
;
1579 static int hf_ptp_v2_sig_tlv_l1sync_flags3_itc
;
1580 static int hf_ptp_v2_sig_tlv_l1sync_flags2_irc
;
1581 static int hf_ptp_v2_sig_tlv_l1sync_flags3_irc
;
1582 static int hf_ptp_v2_sig_tlv_l1sync_flags2_ic
;
1583 static int hf_ptp_v2_sig_tlv_l1sync_flags3_ic
;
1584 static int hf_ptp_v2_sig_tlv_l1sync_flags3_tct
;
1585 static int hf_ptp_v2_sig_tlv_l1sync_flags3_pov
;
1586 static int hf_ptp_v2_sig_tlv_l1sync_flags3_fov
;
1587 static int hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTx_ns
;
1588 static int hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTx_subns
;
1589 static int hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTxTimestamp_s
;
1590 static int hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTxTimestamp_ns
;
1591 static int hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTx_ns
;
1592 static int hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTx_subns
;
1593 static int hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTxTimestamp_s
;
1594 static int hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTxTimestamp_ns
;
1596 /* Fields for CERN White Rabbit TLV (OE TLV subtype) */
1597 static int hf_ptp_v2_sig_oe_tlv_cern_subtype
;
1598 static int hf_ptp_v2_sig_oe_tlv_cern_wrMessageID
;
1600 static int hf_ptp_v2_sig_oe_tlv_cern_calSendPattern
;
1601 static int hf_ptp_v2_sig_oe_tlv_cern_calRety
;
1602 static int hf_ptp_v2_sig_oe_tlv_cern_calPeriod
;
1603 static int hf_ptp_v2_sig_oe_tlv_cern_deltaTx
;
1604 static int hf_ptp_v2_sig_oe_tlv_cern_deltaRx
;
1606 static int hf_ptp_v2_sig_oe_tlv_itut_subtype
;
1607 static int hf_ptp_v2_sig_tlv_interface_bit_period
;
1608 static int hf_ptp_v2_sig_tlv_numberbits_before_timestamp
;
1609 static int hf_ptp_v2_sig_tlv_numberbits_after_timestamp
;
1611 /* Fields for PTP_Management (=mm) messages */
1612 static int hf_ptp_v2_mm_targetportidentity
;
1613 static int hf_ptp_v2_mm_targetportid
;
1614 static int hf_ptp_v2_mm_startingboundaryhops
;
1615 static int hf_ptp_v2_mm_boundaryhops
;
1616 static int hf_ptp_v2_mm_action
;
1617 static int hf_ptp_v2_mm_reserved1
;
1618 static int hf_ptp_v2_mm_reserved2
;
1620 /* management TLV */
1621 static int hf_ptp_v2_mm_tlvType
;
1622 static int hf_ptp_v2_mm_lengthField
;
1623 static int hf_ptp_v2_mm_managementId
;
1624 static int hf_ptp_v2_mm_data
;
1625 /* Management dataField */
1627 static int hf_ptp_v2_mm_clockType
;
1628 static int hf_ptp_v2_mm_clockType_ordinaryClock
;
1629 static int hf_ptp_v2_mm_clockType_boundaryClock
;
1630 static int hf_ptp_v2_mm_clockType_p2p_transparentClock
;
1631 static int hf_ptp_v2_mm_clockType_e2e_transparentClock
;
1632 static int hf_ptp_v2_mm_clockType_managementNode
;
1633 static int hf_ptp_v2_mm_clockType_reserved
;
1634 static int hf_ptp_v2_mm_physicalLayerProtocol
;
1635 static int hf_ptp_v2_mm_physicalLayerProtocol_length
;
1636 static int hf_ptp_v2_mm_physicalAddressLength
;
1637 static int hf_ptp_v2_mm_physicalAddress
;
1638 static int hf_ptp_v2_mm_protocolAddress
;
1639 static int hf_ptp_v2_mm_protocolAddress_networkProtocol
;
1640 static int hf_ptp_v2_mm_protocolAddress_length
;
1641 static int hf_ptp_v2_mm_manufacturerIdentity
;
1643 static int hf_ptp_v2_mm_reserved
;
1644 static int hf_ptp_v2_mm_productDescription
;
1645 static int hf_ptp_v2_mm_productDescription_length
;
1646 static int hf_ptp_v2_mm_revisionData
;
1647 static int hf_ptp_v2_mm_revisionData_length
;
1648 static int hf_ptp_v2_mm_userDescription
;
1649 static int hf_ptp_v2_mm_userDescription_length
;
1650 static int hf_ptp_v2_mm_profileIdentity
;
1651 static int hf_ptp_v2_mm_pad
;
1653 static int hf_ptp_v2_mm_numberOfFaultRecords
;
1654 /* static int hf_ptp_v2_mm_faultRecord; */
1656 static int hf_ptp_v2_mm_initializationKey
;
1657 static int hf_ptp_v2_mm_severityCode
;
1658 static int hf_ptp_v2_mm_faultRecordLength
;
1659 /* static int hf_ptp_v2_mm_faultTime; */
1660 static int hf_ptp_v2_mm_faultTime_s
;
1661 static int hf_ptp_v2_mm_faultTime_ns
;
1662 static int hf_ptp_v2_mm_faultValue
;
1663 static int hf_ptp_v2_mm_faultName
;
1664 static int hf_ptp_v2_mm_faultName_length
;
1665 static int hf_ptp_v2_mm_faultValue_length
;
1666 static int hf_ptp_v2_mm_faultDescription
;
1667 static int hf_ptp_v2_mm_faultDescription_length
;
1668 static int hf_ptp_v2_mm_currentTime_s
;
1669 static int hf_ptp_v2_mm_currentTime_ns
;
1670 static int hf_ptp_v2_mm_clockAccuracy
;
1671 static int hf_ptp_v2_mm_priority1
;
1672 static int hf_ptp_v2_mm_priority2
;
1673 static int hf_ptp_v2_mm_dds_SO
;
1674 static int hf_ptp_v2_mm_TSC
;
1675 static int hf_ptp_v2_mm_numberPorts
;
1676 static int hf_ptp_v2_mm_clockclass
;
1677 static int hf_ptp_v2_mm_clockaccuracy
;
1678 static int hf_ptp_v2_mm_clockvariance
;
1679 static int hf_ptp_v2_mm_clockidentity
;
1680 static int hf_ptp_v2_mm_domainNumber
;
1681 static int hf_ptp_v2_mm_SO
;
1682 static int hf_ptp_v2_mm_stepsRemoved
;
1683 static int hf_ptp_v2_mm_parentIdentity
;
1684 static int hf_ptp_v2_mm_parentPort
;
1685 static int hf_ptp_v2_mm_parentStats
;
1686 static int hf_ptp_v2_mm_observedParentOffsetScaledLogVariance
;
1687 static int hf_ptp_v2_mm_observedParentClockPhaseChangeRate
;
1688 static int hf_ptp_v2_mm_grandmasterPriority1
;
1689 static int hf_ptp_v2_mm_grandmasterPriority2
;
1690 static int hf_ptp_v2_mm_grandmasterclockclass
;
1691 static int hf_ptp_v2_mm_grandmasterclockaccuracy
;
1692 static int hf_ptp_v2_mm_grandmasterclockvariance
;
1693 static int hf_ptp_v2_mm_grandmasterIdentity
;
1694 static int hf_ptp_v2_mm_currentUtcOffset
;
1695 static int hf_ptp_v2_mm_LI_61
;
1696 static int hf_ptp_v2_mm_LI_59
;
1697 static int hf_ptp_v2_mm_UTCV
;
1698 static int hf_ptp_v2_mm_PTP
;
1699 static int hf_ptp_v2_mm_TTRA
;
1700 static int hf_ptp_v2_mm_FTRA
;
1701 static int hf_ptp_v2_mm_timesource
;
1702 static int hf_ptp_v2_mm_offset_ns
;
1703 static int hf_ptp_v2_mm_pathDelay_ns
;
1704 static int hf_ptp_v2_mm_offset_subns
;
1705 static int hf_ptp_v2_mm_pathDelay_subns
;
1706 static int hf_ptp_v2_mm_PortNumber
;
1707 static int hf_ptp_v2_mm_portState
;
1708 static int hf_ptp_v2_mm_logMinDelayReqInterval
;
1709 static int hf_ptp_v2_mm_peerMeanPathDelay_ns
;
1710 static int hf_ptp_v2_mm_peerMeanPathDelay_subns
;
1711 static int hf_ptp_v2_mm_logAnnounceInterval
;
1712 static int hf_ptp_v2_mm_announceReceiptTimeout
;
1713 static int hf_ptp_v2_mm_logSyncInterval
;
1714 static int hf_ptp_v2_mm_delayMechanism
;
1715 static int hf_ptp_v2_mm_logMinPdelayReqInterval
;
1716 static int hf_ptp_v2_mm_versionNumber
;
1717 static int hf_ptp_v2_mm_primaryDomain
;
1718 static int hf_ptp_v2_mm_faultyFlag
;
1719 static int hf_ptp_v2_mm_managementErrorId
;
1720 static int hf_ptp_v2_mm_displayData
;
1721 static int hf_ptp_v2_mm_displayData_length
;
1722 static int hf_ptp_v2_mm_ucEN
;
1723 static int hf_ptp_v2_mm_ptEN
;
1724 static int hf_ptp_v2_mm_atEN
;
1725 static int hf_ptp_v2_mm_keyField
;
1726 static int hf_ptp_v2_mm_displayName
;
1727 static int hf_ptp_v2_mm_displayName_length
;
1728 static int hf_ptp_v2_mm_maxKey
;
1729 static int hf_ptp_v2_mm_currentOffset
;
1730 static int hf_ptp_v2_mm_jumpSeconds
;
1731 static int hf_ptp_v2_mm_nextjumpSeconds
;
1732 static int hf_ptp_v2_mm_logAlternateMulticastSyncInterval
;
1733 static int hf_ptp_v2_mm_numberOfAlternateMasters
;
1734 static int hf_ptp_v2_mm_transmitAlternateMulticastSync
;
1736 /* Fields for analysis code*/
1737 static int hf_ptp_v2_analysis_sync_to_followup
;
1738 static int hf_ptp_v2_analysis_followup_to_sync
;
1739 static int hf_ptp_v2_analysis_pdelayreq_to_pdelayres
;
1740 static int hf_ptp_v2_analysis_pdelayres_to_pdelayreq
;
1741 static int hf_ptp_v2_analysis_pdelayres_to_pdelayfup
;
1742 static int hf_ptp_v2_analysis_pdelayfup_to_pdelayres
;
1743 static int hf_ptp_v2_analysis_sync_timestamp
;
1744 static int hf_ptp_v2_analysis_sync_timestamp_seconds
;
1745 static int hf_ptp_v2_analysis_sync_timestamp_nanoseconds
;
1746 static int hf_ptp_v2_analysis_sync_period
;
1747 static int hf_ptp_v2_analysis_sync_rateRatio
;
1748 static int hf_ptp_v2_analysis_sync_rateRatio_ppm
;
1749 static int hf_ptp_v2_analysis_pdelay_mpd_unscaled
;
1750 static int hf_ptp_v2_analysis_pdelay_mpd_unscaled_seconds
;
1751 static int hf_ptp_v2_analysis_pdelay_mpd_unscaled_nanoseconds
;
1752 static int hf_ptp_v2_analysis_pdelay_mpd_scaled
;
1753 static int hf_ptp_v2_analysis_pdelay_period
;
1754 static int hf_ptp_v2_analysis_pdelay_neighRateRatio
;
1755 static int hf_ptp_v2_analysis_pdelay_neighRateRatio_ppm
;
1757 /* Initialize the subtree pointers */
1758 static int ett_ptp_v2
;
1759 static int ett_ptp_v2_flags
;
1760 static int ett_ptp_v2_clockidentity
;
1761 static int ett_ptp_v2_correction
;
1762 static int ett_ptp_v2_time
;
1763 static int ett_ptp_v2_time2
;
1764 static int ett_ptp_v2_managementData
;
1765 static int ett_ptp_v2_clockType
;
1766 static int ett_ptp_v2_physicalLayerProtocol
;
1767 static int ett_ptp_v2_protocolAddress
;
1768 static int ett_ptp_v2_faultRecord
;
1769 static int ett_ptp_v2_ptptext
;
1770 static int ett_ptp_v2_timeInterval
;
1771 static int ett_ptp_v2_tlv
;
1772 static int ett_ptp_v2_tlv_log_period
;
1773 static int ett_ptp_v2_sig_l1sync_flags
;
1774 static int ett_ptp_as_sig_tlv_flags
;
1775 static int ett_ptp_oe_wr_flags
;
1776 static int ett_ptp_oe_smpte_data
;
1777 static int ett_ptp_oe_smpte_framerate
;
1778 static int ett_ptp_oe_smpte_timeaddress
;
1779 static int ett_ptp_oe_smpte_daylightsaving
;
1780 static int ett_ptp_oe_smpte_leapsecondjump
;
1781 static int ett_ptp_analysis_timestamp
;
1782 static int ett_ptp_analysis_mean_propagation_delay
;
1784 /* static int ett_ptp_v2_timesource;
1785 static int ett_ptp_v2_priority; */
1786 static int ett_ptp_v2_majorsdoid
;
1788 static expert_field ei_ptp_v2_msg_len_too_large
;
1789 static expert_field ei_ptp_v2_msg_len_too_small
;
1790 static expert_field ei_ptp_v2_sync_no_followup
;
1791 static expert_field ei_ptp_v2_sync_no_fup_tlv
;
1792 static expert_field ei_ptp_v2_sync_with_fup_tlv
;
1793 static expert_field ei_ptp_v2_followup_no_sync
;
1794 static expert_field ei_ptp_v2_followup_no_tlv
;
1795 static expert_field ei_ptp_v2_pdreq_no_pdresp
;
1796 static expert_field ei_ptp_v2_pdresp_no_pdreq
;
1797 static expert_field ei_ptp_v2_pdresp_no_pdfup
;
1798 static expert_field ei_ptp_v2_pdresp_twostep
;
1799 static expert_field ei_ptp_v2_pdfup_no_pdresp
;
1800 static expert_field ei_ptp_v2_period_invalid
;
1801 static expert_field ei_ptp_v2_as_tlv_in_non_as
;
1803 /* END Definitions and fields for PTPv2 dissection. */
1808 * The analysis code cannot access the internal data of the PTP participants and
1809 * therefore the values calculated are based on the capture timestamps.
1813 /* Config for Analysis features */
1814 static bool ptp_analyze_messages
= true;
1815 static bool ptp_analyze_messages_with_minor_version
= false;
1816 static unsigned ptp_analysis_max_consecutive_delta
= 10;
1818 /* Definitions for Analysis features */
1820 /* 1588 defines related messages (with matching seqIds) should be sent "as soon as possible".
1821 * 802.1AS formalizes a requirement of max 10ms for the same in "Annex B - Performance requirements".
1822 * A 1 second threshold gives good margin, while not causing analysis issues in case of resets.
1823 * In case of rapid sequence number resets <1s apart, incorrect message associations can still happen.
1825 #define PTP_ANALYSIS_MAX_ALLOWED_DELTA_SECS 1.0
1827 /* Allow to register TLV subdissectors */
1828 static dissector_table_t ptpv2_tlv_org_id_subdissector_table
;
1830 typedef struct ptp_frame_info_sync
{
1831 uint32_t sync_frame_num
;
1832 uint32_t fup_frame_num
;
1837 uint64_t timestamp_s
;
1838 uint32_t timestamp_ns
;
1839 int64_t correction_ns
;
1840 uint16_t correction_subns
;
1842 bool calculated_timestamp_valid
;
1843 nstime_t calculated_timestamp
;
1845 bool syncInterval_valid
;
1846 double syncInterval
;
1848 bool syncRateRatio_valid
;
1849 double syncRateRatio
;
1850 int32_t syncRateRatio_ppm
;
1851 } ptp_frame_info_sync_t
;
1853 typedef struct ptp_frame_info_pdelay
{
1854 uint32_t pdelay_req_frame_num
;
1855 uint32_t pdelay_res_frame_num
;
1856 uint32_t pdelay_fup_frame_num
;
1857 bool pdelay_res_two_step
;
1859 nstime_t pdelay_req_ts
;
1861 uint64_t pdelay_req_recv_ts_s
;
1862 uint32_t pdelay_req_recv_ts_ns
;
1864 uint64_t pdelay_res_send_ts_s
;
1865 uint32_t pdelay_res_send_ts_ns
;
1867 nstime_t pdelay_res_ts
;
1869 nstime_t mean_propagation_delay_unscaled
;
1870 double mean_propagation_delay_scaled
;
1872 bool pdelayInterval_valid
;
1873 double pdelayInterval
;
1875 bool neighborRateRatio_valid
;
1876 double neighborRateRatio
;
1877 int32_t neighborRateRatio_ppm
;
1878 } ptp_frame_info_pdelay_t
;
1880 typedef struct ptp_frame_info
{
1881 uint8_t messagetype
;
1883 ptp_frame_info_sync_t sync
;
1884 ptp_frame_info_pdelay_t pdelay
;
1887 struct ptp_frame_info
*prev
;
1891 #define PTP_FRAME_INFO_SYNC_SEEN(fi) ((fi) != NULL && (fi)->messagetype == PTP_V2_SYNC_MESSAGE && (fi)->sync.sync_frame_num != 0)
1892 #define PTP_FRAME_INFO_SYNC_COMPLETE(fi) ((fi) != NULL && (fi)->messagetype == PTP_V2_SYNC_MESSAGE && (fi)->sync.sync_frame_num != 0 && (fi)->sync.fup_frame_num != 0)
1893 #define PTP_FRAME_INFO_PDELAY_REQ_SEEN(fi) ((fi) != NULL && (fi)->messagetype == PTP_V2_PEER_DELAY_REQ_MESSAGE && (fi)->pdelay.pdelay_req_frame_num != 0)
1894 #define PTP_FRAME_INFO_PDELAY_COMPLETE(fi) ((fi) != NULL && (fi)->messagetype == PTP_V2_PEER_DELAY_REQ_MESSAGE && (fi)->pdelay.pdelay_req_frame_num != 0 && (fi)->pdelay.pdelay_res_frame_num != 0 && (fi)->pdelay.pdelay_fup_frame_num != 0)
1896 typedef struct ptp_clock_info
{
1900 static wmem_map_t
*ptp_clocks
;
1903 * PTP major ver 4 bit
1904 * PTP min ver 4 bit (shift!)
1906 * MessageType 4 bit (shift!)
1913 calculate_frame_key(uint8_t ptp_major
, uint8_t ptp_minor
, uint8_t majorsdoid
, uint8_t minorsdoid
, uint8_t messagetype
, uint8_t domain
, uint16_t portid
, uint16_t seqid
) {
1914 if (!ptp_analyze_messages_with_minor_version
) {
1918 DISSECTOR_ASSERT(ptp_minor
% 16 == 0);
1919 DISSECTOR_ASSERT(ptp_major
<= 15);
1920 DISSECTOR_ASSERT(majorsdoid
% 16 == 0);
1921 DISSECTOR_ASSERT(messagetype
<= 15);
1923 uint64_t ret
= (uint64_t)ptp_minor
<< 56 | (uint64_t)ptp_major
<< 56 | (uint64_t)majorsdoid
<< 48 | (uint64_t)messagetype
<< 48 | (uint64_t)minorsdoid
<< 40 | (uint64_t)domain
<< 32 |
1924 (uint64_t)portid
<< 16 | (uint64_t)seqid
;
1928 static ptp_frame_info_t
*
1929 get_frame_info_and_opt_create(packet_info
*pinfo
, uint8_t ptp_major
, uint8_t ptp_minor
, uint8_t majorsdoid
, uint8_t minorsdoid
, uint8_t messagetype
, uint8_t domain
, uint64_t clockidentity
, uint16_t portid
, uint16_t seqid
, bool create_missing
, double delta_cutoff
) {
1930 DISSECTOR_ASSERT(ptp_clocks
!= NULL
);
1932 ptp_clock_info_t
*clock_info
= (ptp_clock_info_t
*)wmem_map_lookup(ptp_clocks
, &clockidentity
);
1934 if (clock_info
== NULL
)
1936 uint64_t* new_clockid
= wmem_new(wmem_file_scope(), uint64_t);
1937 *new_clockid
= clockidentity
;
1938 clock_info
= wmem_new0(wmem_file_scope(), ptp_clock_info_t
);
1939 clock_info
->frames
= NULL
;
1940 wmem_map_insert(ptp_clocks
, new_clockid
, clock_info
);
1943 if (clock_info
->frames
== NULL
)
1945 clock_info
->frames
= wmem_map_new(wmem_file_scope(), g_int64_hash
, g_int64_equal
);
1948 uint64_t key2
= calculate_frame_key(ptp_major
, ptp_minor
, majorsdoid
, minorsdoid
, messagetype
, domain
, portid
, seqid
);
1949 ptp_frame_info_t
*tmp
= (ptp_frame_info_t
*)wmem_map_lookup(clock_info
->frames
, &key2
);
1953 /* Is this a real match or did have wrapped the ptp seqid? */
1954 /* This check also handles sequenceIds resets due to restarts. */
1955 nstime_t delta_time
;
1956 nstime_delta(&delta_time
, &(pinfo
->abs_ts
), &(tmp
->ref_time
));
1957 double delta_secs
= nstime_to_sec(&delta_time
);
1959 if (fabs(delta_secs
) > delta_cutoff
)
1961 /* Not our match! */
1966 if (tmp
== NULL
&& create_missing
)
1968 uint64_t* new_key2
= wmem_new(wmem_file_scope(), uint64_t);
1970 tmp
= wmem_new0(wmem_file_scope(), ptp_frame_info_t
);
1972 if (messagetype
== PTP_V2_PEER_DELAY_REQ_MESSAGE
) {
1973 tmp
->pdelay
.neighborRateRatio_valid
= false;
1975 wmem_map_insert(clock_info
->frames
, new_key2
, tmp
);
1977 nstime_copy(&(tmp
->ref_time
), &(pinfo
->abs_ts
));
1983 static ptp_frame_info_t
*
1984 create_frame_info(packet_info
*pinfo
, uint8_t ptp_major
, uint8_t ptp_minor
, uint8_t majorsdoid
, uint8_t minorsdoid
, uint8_t messagetype
, uint8_t domain
, uint64_t clockidentity
, uint16_t portid
, uint16_t seqid
) {
1985 ptp_frame_info_t
*ret
= get_frame_info_and_opt_create(pinfo
, ptp_major
, ptp_minor
, majorsdoid
, minorsdoid
, messagetype
, domain
, clockidentity
, portid
, seqid
, true, PTP_ANALYSIS_MAX_ALLOWED_DELTA_SECS
);
1987 uint16_t seqid_prev
= seqid
== 0 ? UINT16_MAX
: seqid
- 1;
1988 ret
->prev
= get_frame_info_and_opt_create(pinfo
, ptp_major
, ptp_minor
, majorsdoid
, minorsdoid
, messagetype
, domain
, clockidentity
, portid
, seqid_prev
, false, (double)ptp_analysis_max_consecutive_delta
);
1994 /* forward declaration of local functions for v1 and v2 */
1997 is_ptp_v1(tvbuff_t
*tvb
);
2000 dissect_ptp_v1(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
);
2003 is_ptp_v2(tvbuff_t
*tvb
);
2006 dissect_ptp_v2(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, bool ptpv2_oE
);
2008 /**********************************************************/
2009 /* Implementation of the functions */
2010 /**********************************************************/
2013 /* Code to dissect the packet */
2016 dissect_ptp_oE(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
) {
2017 /* PTP over Ethernet only available with PTPv2 */
2018 dissect_ptp_v2(tvb
, pinfo
, tree
, true);
2019 return tvb_captured_length(tvb
);
2023 dissect_ptp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
) {
2025 dissect_ptp_v1(tvb
, pinfo
, tree
);
2026 else if(is_ptp_v2(tvb
))
2027 dissect_ptp_v2(tvb
, pinfo
, tree
, false);
2029 return tvb_captured_length(tvb
);
2033 /* Code to check if packet is PTPv1 */
2036 is_ptp_v1(tvbuff_t
*tvb
) {
2037 uint16_t version_ptp
;
2039 version_ptp
= tvb_get_ntohs(tvb
, PTP_VERSIONPTP_OFFSET
);
2041 if( version_ptp
== 1) return true;
2046 /* Code to check if packet is PTPv2 */
2049 is_ptp_v2(tvbuff_t
*tvb
) {
2050 uint8_t version_ptp
;
2052 version_ptp
= 0x0F & tvb_get_uint8(tvb
, PTP_V2_VERSIONPTP_OFFSET
);
2054 if( version_ptp
== 2) return true;
2059 /* Code to actually dissect the PTPv1 packets */
2062 dissect_ptp_v1(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
) {
2063 uint8_t ptp_control_field
, ptp_mm_messagekey
= 0;
2064 nstime_t ts
; /* time structure with seconds and nanoseconds */
2066 /* Set up structures needed to add the protocol subtree and manage it */
2067 proto_item
*ti
, *flags_ti
, *time_ti
, *time2_ti
;
2068 proto_tree
*ptp_tree
= NULL
, *ptp_flags_tree
, *ptp_time_tree
, *ptp_time2_tree
;
2070 /* Make entries in Protocol column and Info column on summary display */
2071 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PTPv1");
2074 /* Get control field (what kind of message is this? (Sync, DelayReq, ...) */
2076 ptp_control_field
= tvb_get_uint8 (tvb
, PTP_CONTROLFIELD_OFFSET
);
2078 if (ptp_control_field
== PTP_MANAGEMENT_MESSAGE
){
2079 /* Get the managementMessageKey */
2080 ptp_mm_messagekey
= tvb_get_uint8(tvb
, PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET
);
2083 /* Create and set the string for "Info" column */
2084 switch(ptp_control_field
){
2085 case PTP_SYNC_MESSAGE
:{
2086 col_set_str(pinfo
->cinfo
, COL_INFO
, "Sync Message");
2089 case PTP_DELAY_REQ_MESSAGE
:{
2090 col_set_str(pinfo
->cinfo
, COL_INFO
, "Delay_Request Message");
2093 case PTP_FOLLOWUP_MESSAGE
:{
2094 col_set_str(pinfo
->cinfo
, COL_INFO
, "Follow_Up Message");
2097 case PTP_DELAY_RESP_MESSAGE
:{
2098 col_set_str(pinfo
->cinfo
, COL_INFO
, "Delay_Response Message");
2101 case PTP_MANAGEMENT_MESSAGE
:{
2102 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Management Message (%s)",
2103 val_to_str_ext(ptp_mm_messagekey
,
2104 &ptp_managementMessageKey_infocolumn_vals_ext
,
2105 "Unknown message key %u"));
2109 col_set_str(pinfo
->cinfo
, COL_INFO
, "Unknown Message");
2116 /* create display subtree for the protocol */
2117 ti
= proto_tree_add_item(tree
, proto_ptp
, tvb
, 0, -1, ENC_NA
);
2119 ptp_tree
= proto_item_add_subtree(ti
, ett_ptp
);
2121 proto_tree_add_item(ptp_tree
,
2122 hf_ptp_versionptp
, tvb
, PTP_VERSIONPTP_OFFSET
, 2, ENC_BIG_ENDIAN
);
2124 proto_tree_add_item(ptp_tree
,
2125 hf_ptp_versionnetwork
, tvb
, PTP_VERSIONNETWORK_OFFSET
, 2, ENC_BIG_ENDIAN
);
2127 proto_tree_add_item(ptp_tree
,
2128 hf_ptp_subdomain
, tvb
, PTP_SUBDOMAIN_OFFSET
, 16, ENC_ASCII
);
2130 proto_tree_add_item(ptp_tree
,
2131 hf_ptp_messagetype
, tvb
, PTP_MESSAGETYPE_OFFSET
, 1, ENC_BIG_ENDIAN
);
2133 proto_tree_add_item(ptp_tree
,
2134 hf_ptp_sourcecommunicationtechnology
, tvb
, PTP_SOURCECOMMUNICATIONTECHNOLOGY_OFFSET
, 1, ENC_BIG_ENDIAN
);
2136 proto_tree_add_item(ptp_tree
,
2137 hf_ptp_sourceuuid
, tvb
, PTP_SOURCEUUID_OFFSET
, 6, ENC_NA
);
2139 proto_tree_add_item(ptp_tree
,
2140 hf_ptp_sourceportid
, tvb
, PTP_SOURCEPORTID_OFFSET
, 2, ENC_BIG_ENDIAN
);
2142 proto_tree_add_item(ptp_tree
,
2143 hf_ptp_sequenceid
, tvb
, PTP_SEQUENCEID_OFFSET
, 2, ENC_BIG_ENDIAN
);
2145 proto_tree_add_item(ptp_tree
,
2146 hf_ptp_controlfield
, tvb
, PTP_CONTROLFIELD_OFFSET
, 1, ENC_BIG_ENDIAN
);
2148 /* Subtree for the flag-field */
2149 /* TODO: use proto_tree_add_bitmask_list() ? */
2150 flags_ti
= proto_tree_add_item(ptp_tree
,
2151 hf_ptp_flags
, tvb
, PTP_FLAGS_OFFSET
, 2, ENC_BIG_ENDIAN
);
2153 ptp_flags_tree
= proto_item_add_subtree(flags_ti
, ett_ptp_flags
);
2155 proto_tree_add_item(ptp_flags_tree
,
2156 hf_ptp_flags_li61
, tvb
, PTP_FLAGS_LI61_OFFSET
, 2, ENC_BIG_ENDIAN
);
2158 proto_tree_add_item(ptp_flags_tree
,
2159 hf_ptp_flags_li59
, tvb
, PTP_FLAGS_LI59_OFFSET
, 2, ENC_BIG_ENDIAN
);
2161 proto_tree_add_item(ptp_flags_tree
,
2162 hf_ptp_flags_boundary_clock
, tvb
, PTP_FLAGS_BOUNDARY_CLOCK_OFFSET
, 2, ENC_BIG_ENDIAN
);
2164 proto_tree_add_item(ptp_flags_tree
,
2165 hf_ptp_flags_assist
, tvb
, PTP_FLAGS_ASSIST_OFFSET
, 2, ENC_BIG_ENDIAN
);
2167 proto_tree_add_item(ptp_flags_tree
,
2168 hf_ptp_flags_ext_sync
, tvb
, PTP_FLAGS_EXT_SYNC_OFFSET
, 2, ENC_BIG_ENDIAN
);
2170 proto_tree_add_item(ptp_flags_tree
,
2171 hf_ptp_flags_parent
, tvb
, PTP_FLAGS_PARENT_STATS_OFFSET
, 2, ENC_BIG_ENDIAN
);
2173 proto_tree_add_item(ptp_flags_tree
,
2174 hf_ptp_flags_sync_burst
, tvb
, PTP_FLAGS_SYNC_BURST_OFFSET
, 2, ENC_BIG_ENDIAN
);
2176 /* The rest of the ptp-dissector depends on the control-field */
2178 switch(ptp_control_field
){
2179 case PTP_SYNC_MESSAGE
:
2180 case PTP_DELAY_REQ_MESSAGE
:{
2182 /* Subtree for the timestamp-field */
2183 ts
.secs
= tvb_get_ntohl(tvb
, PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET
);
2184 ts
.nsecs
= tvb_get_ntohl(tvb
, PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET
);
2186 time_ti
= proto_tree_add_time(ptp_tree
,
2187 hf_ptp_sdr_origintimestamp
, tvb
, PTP_SDR_ORIGINTIMESTAMP_OFFSET
, 8, &ts
);
2189 ptp_time_tree
= proto_item_add_subtree(time_ti
, ett_ptp_time
);
2191 proto_tree_add_item(ptp_time_tree
,
2192 hf_ptp_sdr_origintimestamp_seconds
, tvb
,
2193 PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2195 proto_tree_add_item(ptp_time_tree
, hf_ptp_sdr_origintimestamp_nanoseconds
, tvb
,
2196 PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2199 proto_tree_add_item(ptp_tree
,
2200 hf_ptp_sdr_epochnumber
, tvb
, PTP_SDR_EPOCHNUMBER_OFFSET
, 2, ENC_BIG_ENDIAN
);
2202 proto_tree_add_item(ptp_tree
,
2203 hf_ptp_sdr_currentutcoffset
, tvb
, PTP_SDR_CURRENTUTCOFFSET_OFFSET
, 2, ENC_BIG_ENDIAN
);
2205 proto_tree_add_item(ptp_tree
, hf_ptp_sdr_grandmastercommunicationtechnology
, tvb
,
2206 PTP_SDR_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET
, 1, ENC_BIG_ENDIAN
);
2208 proto_tree_add_item(ptp_tree
,
2209 hf_ptp_sdr_grandmasterclockuuid
, tvb
, PTP_SDR_GRANDMASTERCLOCKUUID_OFFSET
, 6, ENC_NA
);
2211 proto_tree_add_item(ptp_tree
,
2212 hf_ptp_sdr_grandmasterportid
, tvb
, PTP_SDR_GRANDMASTERPORTID_OFFSET
, 2, ENC_BIG_ENDIAN
);
2214 proto_tree_add_item(ptp_tree
,
2215 hf_ptp_sdr_grandmastersequenceid
, tvb
, PTP_SDR_GRANDMASTERSEQUENCEID_OFFSET
, 2, ENC_BIG_ENDIAN
);
2217 proto_tree_add_item(ptp_tree
,
2218 hf_ptp_sdr_grandmasterclockstratum
, tvb
,
2219 PTP_SDR_GRANDMASTERCLOCKSTRATUM_OFFSET
, 1, ENC_BIG_ENDIAN
);
2221 proto_tree_add_item(ptp_tree
, hf_ptp_sdr_grandmasterclockidentifier
, tvb
,
2222 PTP_SDR_GRANDMASTERCLOCKIDENTIFIER_OFFSET
, 4, ENC_ASCII
);
2224 proto_tree_add_item(ptp_tree
,
2225 hf_ptp_sdr_grandmasterclockvariance
, tvb
,
2226 PTP_SDR_GRANDMASTERCLOCKVARIANCE_OFFSET
, 2, ENC_BIG_ENDIAN
);
2228 proto_tree_add_item(ptp_tree
,
2229 hf_ptp_sdr_grandmasterpreferred
, tvb
, PTP_SDR_GRANDMASTERPREFERRED_OFFSET
, 1, ENC_BIG_ENDIAN
);
2231 proto_tree_add_item(ptp_tree
, hf_ptp_sdr_grandmasterisboundaryclock
, tvb
,
2232 PTP_SDR_GRANDMASTERISBOUNDARYCLOCK_OFFSET
, 1, ENC_BIG_ENDIAN
);
2234 proto_tree_add_item(ptp_tree
,
2235 hf_ptp_sdr_syncinterval
, tvb
, PTP_SDR_SYNCINTERVAL_OFFSET
, 1, ENC_BIG_ENDIAN
);
2237 proto_tree_add_item(ptp_tree
,
2238 hf_ptp_sdr_localclockvariance
, tvb
, PTP_SDR_LOCALCLOCKVARIANCE_OFFSET
, 2, ENC_BIG_ENDIAN
);
2240 proto_tree_add_item(ptp_tree
,
2241 hf_ptp_sdr_localstepsremoved
, tvb
, PTP_SDR_LOCALSTEPSREMOVED_OFFSET
, 2, ENC_BIG_ENDIAN
);
2243 proto_tree_add_item(ptp_tree
,
2244 hf_ptp_sdr_localclockstratum
, tvb
, PTP_SDR_LOCALCLOCKSTRATUM_OFFSET
, 1, ENC_BIG_ENDIAN
);
2246 proto_tree_add_item(ptp_tree
,
2247 hf_ptp_sdr_localclockidentifier
, tvb
, PTP_SDR_LOCALCLOCKIDENTIFIER_OFFSET
, 4, ENC_ASCII
);
2249 proto_tree_add_item(ptp_tree
, hf_ptp_sdr_parentcommunicationtechnology
, tvb
,
2250 PTP_SDR_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET
, 1, ENC_BIG_ENDIAN
);
2252 proto_tree_add_item(ptp_tree
,
2253 hf_ptp_sdr_parentuuid
, tvb
, PTP_SDR_PARENTUUID_OFFSET
, 6, ENC_NA
);
2255 proto_tree_add_item(ptp_tree
,
2256 hf_ptp_sdr_parentportfield
, tvb
, PTP_SDR_PARENTPORTFIELD_OFFSET
, 2, ENC_BIG_ENDIAN
);
2258 proto_tree_add_item(ptp_tree
,
2259 hf_ptp_sdr_estimatedmastervariance
, tvb
,
2260 PTP_SDR_ESTIMATEDMASTERVARIANCE_OFFSET
, 2, ENC_BIG_ENDIAN
);
2262 proto_tree_add_item(ptp_tree
,
2263 hf_ptp_sdr_estimatedmasterdrift
, tvb
, PTP_SDR_ESTIMATEDMASTERDRIFT_OFFSET
, 4, ENC_BIG_ENDIAN
);
2265 proto_tree_add_item(ptp_tree
,
2266 hf_ptp_sdr_utcreasonable
, tvb
, PTP_SDR_UTCREASONABLE_OFFSET
, 1, ENC_BIG_ENDIAN
);
2269 case PTP_FOLLOWUP_MESSAGE
:{
2270 proto_tree_add_item(ptp_tree
,
2271 hf_ptp_fu_associatedsequenceid
, tvb
, PTP_FU_ASSOCIATEDSEQUENCEID_OFFSET
, 2, ENC_BIG_ENDIAN
);
2273 /* Subtree for the timestamp-field */
2274 ts
.secs
= tvb_get_ntohl(tvb
, PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET
);
2275 ts
.nsecs
= tvb_get_ntohl(tvb
, PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET
);
2277 time_ti
= proto_tree_add_time(ptp_tree
,
2278 hf_ptp_fu_preciseorigintimestamp
, tvb
,
2279 PTP_FU_PRECISEORIGINTIMESTAMP_OFFSET
, 8, &ts
);
2281 ptp_time_tree
= proto_item_add_subtree(time_ti
, ett_ptp_time
);
2283 proto_tree_add_item(ptp_time_tree
, hf_ptp_fu_preciseorigintimestamp_seconds
, tvb
,
2284 PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2286 proto_tree_add_item(ptp_time_tree
, hf_ptp_fu_preciseorigintimestamp_nanoseconds
, tvb
,
2287 PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2291 case PTP_DELAY_RESP_MESSAGE
:{
2292 /* Subtree for the timestamp-field */
2293 ts
.secs
= tvb_get_ntohl(tvb
, PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET
);
2294 ts
.nsecs
= tvb_get_ntohl(tvb
, PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET
);
2296 time_ti
= proto_tree_add_time(ptp_tree
,
2297 hf_ptp_dr_delayreceipttimestamp
, tvb
,
2298 PTP_DR_DELAYRECEIPTTIMESTAMP_OFFSET
, 8, &ts
);
2300 ptp_time_tree
= proto_item_add_subtree(time_ti
, ett_ptp_time
);
2302 proto_tree_add_item(ptp_time_tree
, hf_ptp_dr_delayreceipttimestamp_seconds
, tvb
,
2303 PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2305 proto_tree_add_item(ptp_time_tree
, hf_ptp_dr_delayreceipttimestamp_nanoseconds
, tvb
,
2306 PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2309 proto_tree_add_item(ptp_tree
, hf_ptp_dr_requestingsourcecommunicationtechnology
, tvb
,
2310 PTP_DR_REQUESTINGSOURCECOMMUNICATIONTECHNOLOGY_OFFSET
, 1, ENC_BIG_ENDIAN
);
2312 proto_tree_add_item(ptp_tree
,
2313 hf_ptp_dr_requestingsourceuuid
, tvb
, PTP_DR_REQUESTINGSOURCEUUID_OFFSET
, 6, ENC_NA
);
2315 proto_tree_add_item(ptp_tree
,
2316 hf_ptp_dr_requestingsourceportid
, tvb
, PTP_DR_REQUESTINGSOURCEPORTID_OFFSET
, 2, ENC_BIG_ENDIAN
);
2318 proto_tree_add_item(ptp_tree
,
2319 hf_ptp_dr_requestingsourcesequenceid
, tvb
,
2320 PTP_DR_REQUESTINGSOURCESEQUENCEID_OFFSET
, 2, ENC_BIG_ENDIAN
);
2323 case PTP_MANAGEMENT_MESSAGE
:{
2324 proto_tree_add_item(ptp_tree
, hf_ptp_mm_targetcommunicationtechnology
, tvb
,
2325 PTP_MM_TARGETCOMMUNICATIONTECHNOLOGY_OFFSET
, 1, ENC_BIG_ENDIAN
);
2327 proto_tree_add_item(ptp_tree
,
2328 hf_ptp_mm_targetuuid
, tvb
, PTP_MM_TARGETUUID_OFFSET
, 6, ENC_NA
);
2330 proto_tree_add_item(ptp_tree
,
2331 hf_ptp_mm_targetportid
, tvb
, PTP_MM_TARGETPORTID_OFFSET
, 2, ENC_BIG_ENDIAN
);
2333 proto_tree_add_item(ptp_tree
,
2334 hf_ptp_mm_startingboundaryhops
, tvb
, PTP_MM_STARTINGBOUNDARYHOPS_OFFSET
, 2, ENC_BIG_ENDIAN
);
2336 proto_tree_add_item(ptp_tree
,
2337 hf_ptp_mm_boundaryhops
, tvb
, PTP_MM_BOUNDARYHOPS_OFFSET
, 2, ENC_BIG_ENDIAN
);
2340 proto_tree_add_item(ptp_tree
,
2341 hf_ptp_mm_managementmessagekey
, tvb
, PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET
, 1, ENC_BIG_ENDIAN
);
2343 proto_tree_add_item(ptp_tree
,
2344 hf_ptp_mm_parameterlength
, tvb
, PTP_MM_PARAMETERLENGTH_OFFSET
, 2, ENC_BIG_ENDIAN
);
2346 switch(ptp_mm_messagekey
){
2347 case PTP_MM_CLOCK_IDENTITY
:{
2348 proto_tree_add_item(ptp_tree
,
2349 hf_ptp_mm_clock_identity_clockcommunicationtechnology
, tvb
,
2350 PTP_MM_CLOCK_IDENTITY_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET
, 1, ENC_BIG_ENDIAN
);
2352 proto_tree_add_item(ptp_tree
, hf_ptp_mm_clock_identity_clockuuidfield
, tvb
,
2353 PTP_MM_CLOCK_IDENTITY_CLOCKUUIDFIELD_OFFSET
, 6, ENC_NA
);
2355 proto_tree_add_item(ptp_tree
, hf_ptp_mm_clock_identity_clockportfield
, tvb
,
2356 PTP_MM_CLOCK_IDENTITY_CLOCKPORTFIELD_OFFSET
, 2, ENC_BIG_ENDIAN
);
2358 proto_tree_add_item(ptp_tree
, hf_ptp_mm_clock_identity_manufactureridentity
, tvb
,
2359 PTP_MM_CLOCK_IDENTITY_MANUFACTURERIDENTITY_OFFSET
, 48, ENC_NA
);
2362 case PTP_MM_INITIALIZE_CLOCK
:{
2363 proto_tree_add_item(ptp_tree
, hf_ptp_mm_initialize_clock_initialisationkey
, tvb
,
2364 PTP_MM_INITIALIZE_CLOCK_INITIALISATIONKEY_OFFSET
, 2, ENC_BIG_ENDIAN
);
2367 case PTP_MM_SET_SUBDOMAIN
:{
2368 proto_tree_add_item(ptp_tree
, hf_ptp_mm_set_subdomain_subdomainname
, tvb
,
2369 PTP_MM_SET_SUBDOMAIN_SUBDOMAINNAME_OFFSET
, 16, ENC_ASCII
);
2372 case PTP_MM_DEFAULT_DATA_SET
:{
2373 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_clockcommunicationtechnology
,
2374 tvb
, PTP_MM_DEFAULT_DATA_SET_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET
,
2377 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_clockuuidfield
, tvb
,
2378 PTP_MM_DEFAULT_DATA_SET_CLOCKUUIDFIELD_OFFSET
, 6, ENC_NA
);
2380 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_clockportfield
, tvb
,
2381 PTP_MM_DEFAULT_DATA_SET_CLOCKPORTFIELD_OFFSET
, 2, ENC_BIG_ENDIAN
);
2383 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_clockstratum
, tvb
,
2384 PTP_MM_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET
, 1, ENC_BIG_ENDIAN
);
2386 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_clockidentifier
, tvb
,
2387 PTP_MM_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET
, 4, ENC_NA
);
2389 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_clockvariance
, tvb
,
2390 PTP_MM_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET
, 2, ENC_BIG_ENDIAN
);
2392 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_clockfollowupcapable
, tvb
,
2393 PTP_MM_DEFAULT_DATA_SET_CLOCKFOLLOWUPCAPABLE_OFFSET
, 1, ENC_BIG_ENDIAN
);
2395 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_preferred
, tvb
,
2396 PTP_MM_DEFAULT_DATA_SET_PREFERRED_OFFSET
, 1, ENC_BIG_ENDIAN
);
2398 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_initializable
, tvb
,
2399 PTP_MM_DEFAULT_DATA_SET_INITIALIZABLE_OFFSET
, 1, ENC_BIG_ENDIAN
);
2401 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_externaltiming
, tvb
,
2402 PTP_MM_DEFAULT_DATA_SET_EXTERNALTIMING_OFFSET
, 1, ENC_BIG_ENDIAN
);
2404 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_isboundaryclock
, tvb
,
2405 PTP_MM_DEFAULT_DATA_SET_ISBOUNDARYCLOCK_OFFSET
, 1, ENC_BIG_ENDIAN
);
2407 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_syncinterval
, tvb
,
2408 PTP_MM_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET
, 1, ENC_BIG_ENDIAN
);
2410 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_subdomainname
, tvb
,
2411 PTP_MM_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET
, 16, ENC_ASCII
);
2413 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_numberports
, tvb
,
2414 PTP_MM_DEFAULT_DATA_SET_NUMBERPORTS_OFFSET
, 2, ENC_BIG_ENDIAN
);
2416 proto_tree_add_item(ptp_tree
, hf_ptp_mm_default_data_set_numberforeignrecords
, tvb
,
2417 PTP_MM_DEFAULT_DATA_SET_NUMBERFOREIGNRECORDS_OFFSET
, 2, ENC_BIG_ENDIAN
);
2420 case PTP_MM_UPDATE_DEFAULT_DATA_SET
:{
2421 proto_tree_add_item(ptp_tree
, hf_ptp_mm_update_default_data_set_clockstratum
, tvb
,
2422 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET
, 1, ENC_BIG_ENDIAN
);
2424 proto_tree_add_item(ptp_tree
, hf_ptp_mm_update_default_data_set_clockidentifier
, tvb
,
2425 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET
, 4, ENC_NA
);
2427 proto_tree_add_item(ptp_tree
, hf_ptp_mm_update_default_data_set_clockvariance
, tvb
,
2428 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET
, 2, ENC_BIG_ENDIAN
);
2430 proto_tree_add_item(ptp_tree
, hf_ptp_mm_update_default_data_set_preferred
, tvb
,
2431 PTP_MM_UPDATE_DEFAULT_DATA_SET_PREFERRED_OFFSET
, 1, ENC_BIG_ENDIAN
);
2433 proto_tree_add_item(ptp_tree
, hf_ptp_mm_update_default_data_set_syncinterval
, tvb
,
2434 PTP_MM_UPDATE_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET
, 1, ENC_BIG_ENDIAN
);
2436 proto_tree_add_item(ptp_tree
, hf_ptp_mm_update_default_data_set_subdomainname
, tvb
,
2437 PTP_MM_UPDATE_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET
, 16, ENC_ASCII
);
2440 case PTP_MM_CURRENT_DATA_SET
:{
2441 proto_tree_add_item(ptp_tree
, hf_ptp_mm_current_data_set_stepsremoved
, tvb
,
2442 PTP_MM_CURRENT_DATA_SET_STEPSREMOVED_OFFSET
, 2, ENC_BIG_ENDIAN
);
2444 /* Subtree for offset from master */
2445 ts
.secs
= tvb_get_ntohl(tvb
, PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET
);
2447 ts
.nsecs
= tvb_get_ntohl(tvb
,
2448 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET
);
2450 if (ts
.nsecs
& 0x80000000) ts
.nsecs
= ts
.nsecs
& 0x7FFFFFFF;
2453 time_ti
= proto_tree_add_time(ptp_tree
,
2454 hf_ptp_mm_current_data_set_offsetfrommaster
, tvb
,
2455 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTER_OFFSET
, 8, &ts
);
2457 ptp_time_tree
= proto_item_add_subtree(time_ti
, ett_ptp_time
);
2459 proto_tree_add_item(ptp_time_tree
,
2460 hf_ptp_mm_current_data_set_offsetfrommasterseconds
, tvb
,
2461 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2463 proto_tree_add_item(ptp_time_tree
,
2464 hf_ptp_mm_current_data_set_offsetfrommasternanoseconds
, tvb
,
2465 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2468 /* Subtree for offset from master */
2469 ts
.secs
= tvb_get_ntohl(tvb
, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET
);
2471 ts
.nsecs
= tvb_get_ntohl(tvb
, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET
);
2474 time2_ti
= proto_tree_add_time(ptp_tree
,
2475 hf_ptp_mm_current_data_set_onewaydelay
, tvb
,
2476 PTP_MM_CURRENT_DATA_SET_ONEWAYDELAY_OFFSET
, 8, &ts
);
2478 ptp_time2_tree
= proto_item_add_subtree(time2_ti
, ett_ptp_time2
);
2480 proto_tree_add_item(ptp_time2_tree
, hf_ptp_mm_current_data_set_onewaydelayseconds
,
2481 tvb
, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2483 proto_tree_add_item(ptp_time2_tree
,
2484 hf_ptp_mm_current_data_set_onewaydelaynanoseconds
,
2485 tvb
, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2489 case PTP_MM_PARENT_DATA_SET
:{
2490 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_parentcommunicationtechnology
,
2491 tvb
, PTP_MM_PARENT_DATA_SET_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET
,
2494 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_parentuuid
, tvb
,
2495 PTP_MM_PARENT_DATA_SET_PARENTUUID_OFFSET
, 6, ENC_NA
);
2497 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_parentportid
, tvb
,
2498 PTP_MM_PARENT_DATA_SET_PARENTPORTID_OFFSET
, 2, ENC_BIG_ENDIAN
);
2500 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber
,
2501 tvb
, PTP_MM_PARENT_DATA_SET_PARENTLASTSYNCSEQUENCENUMBER_OFFSET
,
2504 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_parentfollowupcapable
, tvb
,
2505 PTP_MM_PARENT_DATA_SET_PARENTFOLLOWUPCAPABLE_OFFSET
, 1, ENC_BIG_ENDIAN
);
2507 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_parentexternaltiming
, tvb
,
2508 PTP_MM_PARENT_DATA_SET_PARENTEXTERNALTIMING_OFFSET
, 1, ENC_BIG_ENDIAN
);
2510 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_parentvariance
, tvb
,
2511 PTP_MM_PARENT_DATA_SET_PARENTVARIANCE_OFFSET
, 2, ENC_BIG_ENDIAN
);
2513 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_parentstats
, tvb
,
2514 PTP_MM_PARENT_DATA_SET_PARENTSTATS_OFFSET
, 1, ENC_BIG_ENDIAN
);
2516 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_observedvariance
, tvb
,
2517 PTP_MM_PARENT_DATA_SET_OBSERVEDVARIANCE_OFFSET
, 2, ENC_BIG_ENDIAN
);
2519 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_observeddrift
, tvb
,
2520 PTP_MM_PARENT_DATA_SET_OBSERVEDDRIFT_OFFSET
, 4, ENC_BIG_ENDIAN
);
2522 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_utcreasonable
, tvb
,
2523 PTP_MM_PARENT_DATA_SET_UTCREASONABLE_OFFSET
, 1, ENC_BIG_ENDIAN
);
2525 proto_tree_add_item(ptp_tree
,
2526 hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology
,
2527 tvb
, PTP_MM_PARENT_DATA_SET_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET
, 1,
2530 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_grandmasteruuidfield
, tvb
,
2531 PTP_MM_PARENT_DATA_SET_GRANDMASTERUUIDFIELD_OFFSET
, 6, ENC_NA
);
2533 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_grandmasterportidfield
, tvb
,
2534 PTP_MM_PARENT_DATA_SET_GRANDMASTERPORTIDFIELD_OFFSET
, 2, ENC_BIG_ENDIAN
);
2536 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_grandmasterstratum
, tvb
,
2537 PTP_MM_PARENT_DATA_SET_GRANDMASTERSTRATUM_OFFSET
, 1, ENC_BIG_ENDIAN
);
2539 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_grandmasteridentifier
, tvb
,
2540 PTP_MM_PARENT_DATA_SET_GRANDMASTERIDENTIFIER_OFFSET
, 4, ENC_NA
);
2542 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_grandmastervariance
, tvb
,
2543 PTP_MM_PARENT_DATA_SET_GRANDMASTERVARIANCE_OFFSET
, 2, ENC_BIG_ENDIAN
);
2545 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_grandmasterpreferred
, tvb
,
2546 PTP_MM_PARENT_DATA_SET_GRANDMASTERPREFERRED_OFFSET
, 1, ENC_BIG_ENDIAN
);
2548 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_grandmasterisboundaryclock
, tvb
,
2549 PTP_MM_PARENT_DATA_SET_GRANDMASTERISBOUNDARYCLOCK_OFFSET
, 1, ENC_BIG_ENDIAN
);
2551 proto_tree_add_item(ptp_tree
, hf_ptp_mm_parent_data_set_grandmastersequencenumber
, tvb
,
2552 PTP_MM_PARENT_DATA_SET_GRANDMASTERSEQUENCENUMBER_OFFSET
, 2, ENC_BIG_ENDIAN
);
2555 case PTP_MM_PORT_DATA_SET
:{
2556 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_returnedportnumber
, tvb
,
2557 PTP_MM_PORT_DATA_SET_RETURNEDPORTNUMBER_OFFSET
, 2, ENC_BIG_ENDIAN
);
2559 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_portstate
, tvb
,
2560 PTP_MM_PORT_DATA_SET_PORTSTATE_OFFSET
, 1, ENC_BIG_ENDIAN
);
2562 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_lastsynceventsequencenumber
, tvb
,
2563 PTP_MM_PORT_DATA_SET_LASTSYNCEVENTSEQUENCENUMBER_OFFSET
, 2, ENC_BIG_ENDIAN
);
2565 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber
,
2566 tvb
, PTP_MM_PORT_DATA_SET_LASTGENERALEVENTSEQUENCENUMBER_OFFSET
,
2569 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_portcommunicationtechnology
, tvb
,
2570 PTP_MM_PORT_DATA_SET_PORTCOMMUNICATIONTECHNOLOGY_OFFSET
, 1, ENC_BIG_ENDIAN
);
2572 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_portuuidfield
, tvb
,
2573 PTP_MM_PORT_DATA_SET_PORTUUIDFIELD_OFFSET
, 6, ENC_NA
);
2575 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_portidfield
, tvb
,
2576 PTP_MM_PORT_DATA_SET_PORTIDFIELD_OFFSET
, 2, ENC_BIG_ENDIAN
);
2578 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_burstenabled
, tvb
,
2579 PTP_MM_PORT_DATA_SET_BURSTENABLED_OFFSET
, 1, ENC_BIG_ENDIAN
);
2581 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_subdomainaddressoctets
, tvb
,
2582 PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESSOCTETS_OFFSET
, 1, ENC_BIG_ENDIAN
);
2584 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_eventportaddressoctets
, tvb
,
2585 PTP_MM_PORT_DATA_SET_EVENTPORTADDRESSOCTETS_OFFSET
, 1, ENC_BIG_ENDIAN
);
2587 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_generalportaddressoctets
, tvb
,
2588 PTP_MM_PORT_DATA_SET_GENERALPORTADDRESSOCTETS_OFFSET
, 1, ENC_BIG_ENDIAN
);
2590 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_subdomainaddress
, tvb
,
2591 PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESS_OFFSET
, 4, ENC_NA
);
2593 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_eventportaddress
, tvb
,
2594 PTP_MM_PORT_DATA_SET_EVENTPORTADDRESS_OFFSET
, 2, ENC_NA
);
2596 proto_tree_add_item(ptp_tree
, hf_ptp_mm_port_data_set_generalportaddress
, tvb
,
2597 PTP_MM_PORT_DATA_SET_GENERALPORTADDRESS_OFFSET
, 2, ENC_NA
);
2600 case PTP_MM_GLOBAL_TIME_DATA_SET
:{
2601 /* Subtree for local time */
2602 ts
.secs
= tvb_get_ntohl(tvb
, PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET
);
2604 ts
.nsecs
= tvb_get_ntohl(tvb
,
2605 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET
);
2608 time_ti
= proto_tree_add_time(ptp_tree
,
2609 hf_ptp_mm_global_time_data_set_localtime
, tvb
,
2610 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIME_OFFSET
, 8, &ts
);
2612 ptp_time_tree
= proto_item_add_subtree(time_ti
, ett_ptp_time
);
2614 proto_tree_add_item(ptp_time_tree
,
2615 hf_ptp_mm_global_time_data_set_localtimeseconds
, tvb
,
2616 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2618 proto_tree_add_item(ptp_time_tree
,
2619 hf_ptp_mm_global_time_data_set_localtimenanoseconds
,
2620 tvb
, PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2623 proto_tree_add_item(ptp_tree
, hf_ptp_mm_global_time_data_set_currentutcoffset
, tvb
,
2624 PTP_MM_GLOBAL_TIME_DATA_SET_CURRENTUTCOFFSET_OFFSET
, 2, ENC_BIG_ENDIAN
);
2626 proto_tree_add_item(ptp_tree
, hf_ptp_mm_global_time_data_set_leap59
, tvb
,
2627 PTP_MM_GLOBAL_TIME_DATA_SET_LEAP59_OFFSET
, 1, ENC_BIG_ENDIAN
);
2629 proto_tree_add_item(ptp_tree
, hf_ptp_mm_global_time_data_set_leap61
, tvb
,
2630 PTP_MM_GLOBAL_TIME_DATA_SET_LEAP61_OFFSET
, 1, ENC_BIG_ENDIAN
);
2632 proto_tree_add_item(ptp_tree
, hf_ptp_mm_global_time_data_set_epochnumber
, tvb
,
2633 PTP_MM_GLOBAL_TIME_DATA_SET_EPOCHNUMBER_OFFSET
, 2, ENC_BIG_ENDIAN
);
2636 case PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES
:{
2637 proto_tree_add_item(ptp_tree
, hf_ptp_mm_update_global_time_properties_currentutcoffset
,
2638 tvb
, PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_CURRENTUTCOFFSET_OFFSET
,
2641 proto_tree_add_item(ptp_tree
, hf_ptp_mm_update_global_time_properties_leap59
, tvb
,
2642 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP59_OFFSET
, 1, ENC_BIG_ENDIAN
);
2644 proto_tree_add_item(ptp_tree
, hf_ptp_mm_update_global_time_properties_leap61
, tvb
,
2645 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP61_OFFSET
, 1, ENC_BIG_ENDIAN
);
2647 proto_tree_add_item(ptp_tree
, hf_ptp_mm_get_foreign_data_set_recordkey
, tvb
,
2648 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_EPOCHNUMBER_OFFSET
, 2, ENC_BIG_ENDIAN
);
2651 case PTP_MM_GET_FOREIGN_DATA_SET
:{
2652 proto_tree_add_item(ptp_tree
, hf_ptp_mm_get_foreign_data_set_recordkey
, tvb
,
2653 PTP_MM_GET_FOREIGN_DATA_SET_RECORDKEY_OFFSET
, 2, ENC_BIG_ENDIAN
);
2656 case PTP_MM_FOREIGN_DATA_SET
:{
2657 proto_tree_add_item(ptp_tree
, hf_ptp_mm_foreign_data_set_returnedportnumber
, tvb
,
2658 PTP_MM_FOREIGN_DATA_SET_RETURNEDPORTNUMBER_OFFSET
, 2, ENC_BIG_ENDIAN
);
2660 proto_tree_add_item(ptp_tree
, hf_ptp_mm_foreign_data_set_returnedrecordnumber
, tvb
,
2661 PTP_MM_FOREIGN_DATA_SET_RETURNEDRECORDNUMBER_OFFSET
, 2, ENC_BIG_ENDIAN
);
2663 proto_tree_add_item(ptp_tree
,
2664 hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology
,
2665 tvb
, PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERCOMMUNICATIONTECHNOLOGY_OFFSET
, 1,
2668 proto_tree_add_item(ptp_tree
, hf_ptp_mm_foreign_data_set_foreignmasteruuidfield
, tvb
,
2669 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERUUIDFIELD_OFFSET
, 6, ENC_NA
);
2671 proto_tree_add_item(ptp_tree
, hf_ptp_mm_foreign_data_set_foreignmasterportidfield
, tvb
,
2672 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERPORTIDFIELD_OFFSET
, 2, ENC_BIG_ENDIAN
);
2674 proto_tree_add_item(ptp_tree
, hf_ptp_mm_foreign_data_set_foreignmastersyncs
, tvb
,
2675 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERSYNCS_OFFSET
, 2, ENC_BIG_ENDIAN
);
2678 case PTP_MM_SET_SYNC_INTERVAL
:{
2679 proto_tree_add_item(ptp_tree
, hf_ptp_mm_set_sync_interval_syncinterval
, tvb
,
2680 PTP_MM_SET_SYNC_INTERVAL_SYNCINTERVAL_OFFSET
, 2, ENC_BIG_ENDIAN
);
2683 case PTP_MM_SET_TIME
:{
2684 /* Subtree for local time */
2685 ts
.secs
= tvb_get_ntohl(tvb
, PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET
);
2687 ts
.nsecs
= tvb_get_ntohl(tvb
, PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET
);
2690 time_ti
= proto_tree_add_time(ptp_tree
, hf_ptp_mm_set_time_localtime
, tvb
,
2691 PTP_MM_SET_TIME_LOCALTIME_OFFSET
, 8, &ts
);
2693 ptp_time_tree
= proto_item_add_subtree(time_ti
, ett_ptp_time
);
2695 proto_tree_add_item(ptp_time_tree
, hf_ptp_mm_set_time_localtimeseconds
, tvb
,
2696 PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2698 proto_tree_add_item(ptp_time_tree
, hf_ptp_mm_set_time_localtimenanoseconds
,
2699 tvb
, PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET
, 4, ENC_BIG_ENDIAN
);
2704 /* - don't dissect any further. */
2711 /* Not a valid MessageType - can't dissect. */
2719 /* Code to dissect PTPText */
2721 dissect_ptp_v2_text(tvbuff_t
*tvb
, int *cur_offset
, proto_tree
*tree
, int hf_ptp_v2_mm_ptptext
, int hf_ptp_v2_mm_ptptext_length
) {
2723 proto_item
*ptptext_ti
;
2724 proto_tree
*ptptext_subtree
;
2726 length
= tvb_get_uint8 (tvb
, *cur_offset
);
2730 ptptext_ti
= proto_tree_add_item(tree
, hf_ptp_v2_mm_ptptext
, tvb
,
2731 *cur_offset
+1, length
, ENC_BIG_ENDIAN
);
2733 ptptext_subtree
= proto_item_add_subtree(ptptext_ti
, ett_ptp_v2_ptptext
);
2735 proto_tree_add_item(ptptext_subtree
, hf_ptp_v2_mm_ptptext_length
, tvb
,
2736 *cur_offset
, 1, ENC_BIG_ENDIAN
);
2737 proto_tree_add_item(ptptext_subtree
, hf_ptp_v2_mm_ptptext
, tvb
,
2738 *cur_offset
+1, length
, ENC_ASCII
|ENC_NA
);
2740 *cur_offset
= *cur_offset
+ length
+ 1;
2745 dissect_ptp_v2_timeInterval(tvbuff_t
*tvb
, int *cur_offset
, proto_tree
*tree
, const char* name
, int hf_ptp_v2_timeInterval_ns
, int hf_ptp_v2_timeInterval_subns
, proto_tree
**tree_out
, int64_t *ns_out
) {
2748 uint16_t time_subns
;
2749 proto_tree
*ptptimeInterval_subtree
;
2751 time_ns
= tvb_get_ntoh64(tvb
, *cur_offset
);
2752 /* TODO: should flag 'too big' if see distinguished value of 0x7FFFFFFFFFFFFFFF?
2753 * https://standards.ieee.org/wp-content/uploads/import/documents/interpretations/1588-2008_interp.pdf
2754 * notes that this field can cope with about 40 hours.. */
2755 time_double
= (1.0*time_ns
) / 65536.0;
2756 time_ns
= time_ns
>> 16;
2757 time_subns
= tvb_get_ntohs(tvb
, *cur_offset
+6);
2759 ptptimeInterval_subtree
= proto_tree_add_subtree_format(tree
, tvb
, *cur_offset
, 8,
2760 ett_ptp_v2_timeInterval
, NULL
, "%s: %f nanoseconds", name
, time_double
);
2762 proto_tree_add_int64(ptptimeInterval_subtree
,
2763 hf_ptp_v2_timeInterval_ns
, tvb
, *cur_offset
, 6, time_ns
);
2765 proto_tree_add_double(ptptimeInterval_subtree
,
2766 hf_ptp_v2_timeInterval_subns
, tvb
, *cur_offset
+6, 2, (time_subns
/65536.0));
2768 /* Set output args */
2769 *cur_offset
= *cur_offset
+ 8;
2770 if (tree_out
) *tree_out
= ptptimeInterval_subtree
;
2771 if (ns_out
) *ns_out
= time_ns
;
2775 dissect_ptp_v2_timetstamp(tvbuff_t
*tvb
, int *cur_offset
, proto_tree
*tree
, const char* name
, int hf_ptp_v2_timestamp_s
, int hf_ptp_v2_timestamp_ns
) {
2778 proto_tree
*ptptimestamp_subtree
;
2780 time_s
= tvb_get_ntoh48(tvb
, *cur_offset
);
2781 time_ns
= tvb_get_ntohl(tvb
, *cur_offset
+ 6);
2783 ptptimestamp_subtree
= proto_tree_add_subtree_format(tree
,
2787 ett_ptp_v2_timeInterval
,
2789 "%s: %" PRIu64
"%s%09" PRId32
" nanoseconds",
2790 name
, time_s
, decimal_point
, time_ns
);
2792 proto_tree_add_uint64(ptptimestamp_subtree
,
2793 hf_ptp_v2_timestamp_s
,
2799 proto_tree_add_int(ptptimestamp_subtree
,
2800 hf_ptp_v2_timestamp_ns
,
2806 *cur_offset
= *cur_offset
+ 10;
2809 /* Code to actually dissect the PTPv2 packets */
2812 dissect_ptp_v2_tlv_tlvtype_length(tvbuff_t
*tvb
, int offset_orig
, proto_tree
*ptp_tlv_tree
) {
2813 int offset
= offset_orig
;
2815 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_tlv_tlvtype
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2818 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_tlv_lengthfield
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2821 return offset
- offset_orig
;
2825 dissect_ptp_v2_tlv_org_fields(tvbuff_t
*tvb
, int offset_orig
, proto_tree
*ptp_tlv_tree
, int hf_orgsubtype
) {
2826 int offset
= offset_orig
+ dissect_ptp_v2_tlv_tlvtype_length(tvb
, offset_orig
, ptp_tlv_tree
);
2828 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_tlv_oe_organizationid
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
2831 proto_tree_add_item(ptp_tlv_tree
, hf_orgsubtype
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
2834 return offset
- offset_orig
;
2838 disect_ptp_v2_tlvs(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_item
*ti_root
, proto_tree
*ptp_tree
, uint8_t ptp_v2_messageid
, uint16_t ptp_v2_flags
, bool is_802_1as
) {
2839 int offset_orig
= offset
;
2841 proto_item
*ti_tlv
= ti_root
;
2843 bool as_followup_tlv_present
= false;
2846 int offset_loopstart
= offset
;
2848 if (tvb_reported_length_remaining(tvb
, offset
) < PTP_V2_TLV_HEADER_LENGTH
) {
2849 /* broken TLV or maybe just a few bytes at end left */
2853 uint16_t tlv_type
= tvb_get_ntohs(tvb
, offset
+ PTP_V2_TLV_TYPE_OFFSET
);
2854 uint16_t tlv_length
= tvb_get_ntohs(tvb
, offset
+ PTP_V2_TLV_LENGTH_OFFSET
);
2857 case PTP_V2_TLV_TYPE_MANAGEMENT
: {
2858 proto_item
*managementData_ti
, *clockType_ti
, *protocolAddress_ti
;
2859 proto_tree
*ptp_managementData_tree
, *ptp_clockType_tree
, *ptp_protocolAddress_tree
;
2861 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Management TLV");
2862 offset
+= dissect_ptp_v2_tlv_tlvtype_length(tvb
, offset
, ptp_tlv_tree
);
2864 uint32_t ptp_v2_managementId
;
2865 proto_tree_add_item_ret_uint(ptp_tlv_tree
, hf_ptp_v2_mm_managementId
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &ptp_v2_managementId
);
2868 if (tlv_length
<= 2) {
2873 managementData_ti
= proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_mm_data
, tvb
, offset
, tlv_length
- 2, ENC_NA
);
2874 ptp_managementData_tree
= proto_item_add_subtree(managementData_ti
, ett_ptp_v2_managementData
);
2876 switch (ptp_v2_managementId
) {
2877 case PTP_V2_MM_ID_NULL_MANAGEMENT
: {
2878 /* no data in NULL management */
2881 case PTP_V2_MM_ID_CLOCK_DESCRIPTION
: {
2882 uint32_t N
= 0, S
= 0;
2883 clockType_ti
= proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_clockType
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2885 ptp_clockType_tree
= proto_item_add_subtree(clockType_ti
, ett_ptp_v2_clockType
);
2886 /* ClockType Subtree */
2887 proto_tree_add_item(ptp_clockType_tree
, hf_ptp_v2_mm_clockType_ordinaryClock
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2888 proto_tree_add_item(ptp_clockType_tree
, hf_ptp_v2_mm_clockType_boundaryClock
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2889 proto_tree_add_item(ptp_clockType_tree
, hf_ptp_v2_mm_clockType_p2p_transparentClock
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2890 proto_tree_add_item(ptp_clockType_tree
, hf_ptp_v2_mm_clockType_e2e_transparentClock
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2891 proto_tree_add_item(ptp_clockType_tree
, hf_ptp_v2_mm_clockType_managementNode
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2892 proto_tree_add_item(ptp_clockType_tree
, hf_ptp_v2_mm_clockType_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2895 dissect_ptp_v2_text(tvb
, &offset
, ptp_managementData_tree
, hf_ptp_v2_mm_physicalLayerProtocol
, hf_ptp_v2_mm_physicalLayerProtocol_length
);
2897 proto_tree_add_item_ret_uint(ptp_managementData_tree
, hf_ptp_v2_mm_physicalAddressLength
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &S
);
2900 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_physicalAddress
, tvb
, offset
, S
, ENC_NA
);
2903 N
= tvb_get_ntohs(tvb
, offset
+ 2);
2905 protocolAddress_ti
= proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_protocolAddress
, tvb
, offset
+ 4, N
, ENC_NA
);
2906 ptp_protocolAddress_tree
= proto_item_add_subtree(protocolAddress_ti
, ett_ptp_v2_protocolAddress
);
2907 /* physicalLayerProtocol subtree */
2908 proto_tree_add_item(ptp_protocolAddress_tree
, hf_ptp_v2_mm_protocolAddress_networkProtocol
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2909 proto_tree_add_item(ptp_protocolAddress_tree
, hf_ptp_v2_mm_protocolAddress_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
2910 proto_tree_add_item(ptp_protocolAddress_tree
, hf_ptp_v2_mm_protocolAddress
, tvb
, offset
+ 4, N
, ENC_NA
);
2914 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_manufacturerIdentity
, tvb
, offset
, 3, ENC_NA
);
2917 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
2920 dissect_ptp_v2_text(tvb
, &offset
, ptp_managementData_tree
, hf_ptp_v2_mm_productDescription
, hf_ptp_v2_mm_productDescription_length
);
2921 dissect_ptp_v2_text(tvb
, &offset
, ptp_managementData_tree
, hf_ptp_v2_mm_revisionData
, hf_ptp_v2_mm_revisionData_length
);
2922 dissect_ptp_v2_text(tvb
, &offset
, ptp_managementData_tree
, hf_ptp_v2_mm_userDescription
, hf_ptp_v2_mm_userDescription_length
);
2924 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_profileIdentity
, tvb
, offset
, 6, ENC_NA
);
2927 /* Pad to even length */
2928 if ((offset
- offset_loopstart
) % 2) {
2929 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_pad
, tvb
, offset
, 1, ENC_NA
);
2934 case PTP_V2_MM_ID_USER_DESCRIPTION
: {
2936 dissect_ptp_v2_text(tvb
, &offset
, ptp_managementData_tree
, hf_ptp_v2_mm_userDescription
, hf_ptp_v2_mm_userDescription_length
);
2938 /* Pad to even length */
2939 if ((offset
- offset_loopstart
) % 2) {
2940 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_pad
, tvb
, offset
, 1, ENC_NA
);
2945 case PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE
: {
2949 case PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE
: {
2953 case PTP_V2_MM_ID_INITIALIZE
: {
2954 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_initializationKey
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2958 case PTP_V2_MM_ID_FAULT_LOG
: {
2959 uint16_t ii
, num
= 0;
2960 proto_tree
*ptpError_subtree
;
2962 num
= tvb_get_ntohs(tvb
, offset
);
2964 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_numberOfFaultRecords
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2967 for (ii
= 0; ii
< num
; ii
++) {
2968 ptpError_subtree
= proto_tree_add_subtree(ptp_managementData_tree
, tvb
, offset
, tvb_get_ntohs(tvb
, offset
),
2969 ett_ptp_v2_faultRecord
, NULL
, "Fault record");
2971 proto_tree_add_item(ptpError_subtree
, hf_ptp_v2_mm_faultRecordLength
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2974 proto_tree_add_item(ptpError_subtree
, hf_ptp_v2_mm_faultTime_s
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
2977 proto_tree_add_item(ptpError_subtree
, hf_ptp_v2_mm_faultTime_ns
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2980 proto_tree_add_item(ptpError_subtree
, hf_ptp_v2_mm_severityCode
, tvb
, offset
, 1, ENC_NA
);
2983 dissect_ptp_v2_text(tvb
, &offset
, ptpError_subtree
, hf_ptp_v2_mm_faultName
, hf_ptp_v2_mm_faultName_length
);
2985 dissect_ptp_v2_text(tvb
, &offset
, ptpError_subtree
, hf_ptp_v2_mm_faultValue
, hf_ptp_v2_mm_faultValue_length
);
2987 dissect_ptp_v2_text(tvb
, &offset
, ptpError_subtree
, hf_ptp_v2_mm_faultDescription
, hf_ptp_v2_mm_faultDescription_length
);
2990 /* Pad to even length */
2991 if ((offset
- offset_loopstart
) % 2) {
2992 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_pad
, tvb
, offset
, 1, ENC_NA
);
2997 case PTP_V2_MM_ID_FAULT_LOG_RESET
: {
3001 case PTP_V2_MM_ID_DEFAULT_DATA_SET
: {
3002 // XXX: change to relative offset!
3003 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_TSC
, tvb
, offset
, 1, ENC_NA
);
3004 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_dds_SO
, tvb
, offset
, 1, ENC_NA
);
3007 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3010 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_numberPorts
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3013 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_priority1
, tvb
, offset
, 1, ENC_NA
);
3016 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_clockclass
, tvb
, offset
, 1, ENC_NA
);
3019 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_clockaccuracy
, tvb
, offset
, 1, ENC_NA
);
3022 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_clockvariance
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3025 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_priority2
, tvb
, offset
, 1, ENC_NA
);
3028 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_clockidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3031 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_domainNumber
, tvb
, offset
, 1, ENC_NA
);
3034 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3039 case PTP_V2_MM_ID_CURRENT_DATA_SET
: {
3040 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_stepsRemoved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3043 dissect_ptp_v2_timeInterval(tvb
, &offset
, ptp_managementData_tree
, "Offset from Master",
3044 hf_ptp_v2_mm_offset_ns
, hf_ptp_v2_mm_offset_subns
, NULL
, NULL
);
3045 dissect_ptp_v2_timeInterval(tvb
, &offset
, ptp_managementData_tree
, "Mean path delay",
3046 hf_ptp_v2_mm_pathDelay_ns
, hf_ptp_v2_mm_pathDelay_subns
, NULL
, NULL
);
3049 case PTP_V2_MM_ID_PARENT_DATA_SET
: {
3050 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_parentIdentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3053 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_parentPort
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3056 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_parentStats
, tvb
, offset
, 1, ENC_NA
);
3059 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3062 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_observedParentOffsetScaledLogVariance
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3065 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_observedParentClockPhaseChangeRate
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3068 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_grandmasterPriority1
, tvb
, offset
, 1, ENC_NA
);
3071 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_grandmasterclockclass
, tvb
, offset
, 1, ENC_NA
);
3074 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_grandmasterclockaccuracy
, tvb
, offset
, 1, ENC_NA
);
3077 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_grandmasterclockvariance
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3080 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_grandmasterPriority2
, tvb
, offset
, 1, ENC_NA
);
3083 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_grandmasterIdentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3088 case PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET
: {
3089 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_currentUtcOffset
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3092 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_LI_61
, tvb
, offset
, 1, ENC_NA
);
3093 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_LI_59
, tvb
, offset
, 1, ENC_NA
);
3094 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_UTCV
, tvb
, offset
, 1, ENC_NA
);
3095 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_PTP
, tvb
, offset
, 1, ENC_NA
);
3096 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_TTRA
, tvb
, offset
, 1, ENC_NA
);
3097 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_FTRA
, tvb
, offset
, 1, ENC_NA
);
3100 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_timesource
, tvb
, offset
, 1, ENC_NA
);
3105 case PTP_V2_MM_ID_PORT_DATA_SET
: {
3106 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_clockidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3109 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_PortNumber
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3112 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_portState
, tvb
, offset
, 1, ENC_NA
);
3115 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_logMinDelayReqInterval
, tvb
, offset
, 1, ENC_NA
);
3118 dissect_ptp_v2_timeInterval(tvb
, &offset
, ptp_managementData_tree
, "Peer mean path delay",
3119 hf_ptp_v2_mm_peerMeanPathDelay_ns
, hf_ptp_v2_mm_peerMeanPathDelay_subns
, NULL
, NULL
);
3121 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_logAnnounceInterval
, tvb
, offset
, 1, ENC_NA
);
3124 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_announceReceiptTimeout
, tvb
, offset
, 1, ENC_NA
);
3127 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_logSyncInterval
, tvb
, offset
, 1, ENC_NA
);
3130 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_delayMechanism
, tvb
, offset
, 1, ENC_NA
);
3133 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_logMinPdelayReqInterval
, tvb
, offset
, 1, ENC_NA
);
3136 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_versionNumber
, tvb
, offset
, 1, ENC_NA
);
3141 case PTP_V2_MM_ID_PRIORITY1
: {
3142 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_priority1
, tvb
, offset
, 1, ENC_NA
);
3145 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3150 case PTP_V2_MM_ID_PRIORITY2
: {
3151 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_priority2
, tvb
, offset
, 1, ENC_NA
);
3154 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3159 case PTP_V2_MM_ID_DOMAIN
: {
3160 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_domainNumber
, tvb
, offset
, 1, ENC_NA
);
3163 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3168 case PTP_V2_MM_ID_SLAVE_ONLY
: {
3169 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_SO
, tvb
, offset
, 1, ENC_NA
);
3172 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3177 case PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL
: {
3178 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_logAnnounceInterval
, tvb
, offset
, 1, ENC_NA
);
3181 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3186 case PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT
: {
3187 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_announceReceiptTimeout
, tvb
, offset
, 1, ENC_NA
);
3190 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3195 case PTP_V2_MM_ID_LOG_SYNC_INTERVAL
: {
3196 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_logSyncInterval
, tvb
, offset
, 1, ENC_NA
);
3199 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3204 case PTP_V2_MM_ID_VERSION_NUMBER
: {
3205 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_versionNumber
, tvb
, offset
, 1, ENC_NA
);
3208 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3213 case PTP_V2_MM_ID_ENABLE_PORT
: {
3217 case PTP_V2_MM_ID_DISABLE_PORT
: {
3221 case PTP_V2_MM_ID_TIME
: {
3222 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_currentTime_s
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
3225 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_currentTime_ns
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3230 case PTP_V2_MM_ID_CLOCK_ACCURACY
: {
3231 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_clockAccuracy
, tvb
, offset
, 1, ENC_NA
);
3234 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3239 case PTP_V2_MM_ID_UTC_PROPERTIES
: {
3240 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_currentUtcOffset
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3243 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_LI_61
, tvb
, offset
, 1, ENC_NA
);
3244 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_LI_59
, tvb
, offset
, 1, ENC_NA
);
3245 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_UTCV
, tvb
, offset
, 1, ENC_NA
);
3248 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3253 case PTP_V2_MM_ID_TRACEABILITY_PROPERTIES
: {
3254 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_TTRA
, tvb
, offset
, 1, ENC_NA
);
3255 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_FTRA
, tvb
, offset
, 1, ENC_NA
);
3258 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3263 case PTP_V2_MM_ID_TIMESCALE_PROPERTIES
: {
3264 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_PTP
, tvb
, offset
, 1, ENC_NA
);
3267 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_timesource
, tvb
, offset
, 1, ENC_NA
);
3272 case PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE
: {
3273 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_ucEN
, tvb
, offset
, 1, ENC_NA
);
3276 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3281 case PTP_V2_MM_ID_PATH_TRACE_LIST
: {
3283 /* one or more ClockIdentity */
3284 for (i
= 0; i
< (tlv_length
/ 8); i
++)
3286 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_clockidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3292 case PTP_V2_MM_ID_PATH_TRACE_ENABLE
: {
3293 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_ptEN
, tvb
, offset
, 1, ENC_NA
);
3296 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3301 case PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE
: {
3305 case PTP_V2_MM_ID_UNICAST_MASTER_TABLE
: {
3309 case PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE
: {
3313 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE
: {
3317 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED
: {
3321 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE
: {
3325 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE
: {
3326 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_keyField
, tvb
, offset
, 1, ENC_NA
);
3329 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_atEN
, tvb
, offset
, 1, ENC_NA
);
3334 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME
:
3336 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_keyField
, tvb
, offset
, 1, ENC_NA
);
3339 dissect_ptp_v2_text(tvb
, &offset
, ptp_managementData_tree
, hf_ptp_v2_mm_displayName
, hf_ptp_v2_mm_displayName_length
);
3341 /* Pad to even length */
3342 if ((offset
- offset_loopstart
) % 2) {
3343 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_pad
, tvb
, offset
, 1, ENC_NA
);
3348 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY
: {
3349 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_maxKey
, tvb
, offset
, 1, ENC_NA
);
3352 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3357 case PTP_V2_MM_ID_ALTERNATE_MASTER
: {
3358 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_transmitAlternateMulticastSync
, tvb
, offset
, 1, ENC_NA
);
3361 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_numberOfAlternateMasters
, tvb
, offset
, 1, ENC_NA
);
3364 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_logAlternateMulticastSyncInterval
, tvb
, offset
, 1, ENC_NA
);
3367 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3372 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES
: {
3373 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_keyField
, tvb
, offset
, 1, ENC_NA
);
3376 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_currentOffset
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3379 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_jumpSeconds
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3382 uint64_t timeStamp
= tvb_get_ntohl(tvb
, offset
);
3383 timeStamp
= timeStamp
<< 16;
3384 timeStamp
= timeStamp
| tvb_get_ntohs(tvb
, offset
+ 4);
3386 proto_tree_add_uint64(ptp_managementData_tree
, hf_ptp_v2_mm_nextjumpSeconds
, tvb
, offset
, 6, timeStamp
);
3389 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3394 case PTP_V2_MM_ID_TC_DEFAULT_DATA_SET
: {
3395 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_clockidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3398 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_numberPorts
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3401 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_delayMechanism
, tvb
, offset
, 1, ENC_NA
);
3404 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_primaryDomain
, tvb
, offset
, 1, ENC_NA
);
3409 case PTP_V2_MM_ID_TC_PORT_DATA_SET
: {
3410 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_clockidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3413 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_PortNumber
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3416 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_faultyFlag
, tvb
, offset
, 1, ENC_NA
);
3419 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_logMinPdelayReqInterval
, tvb
, offset
, 1, ENC_NA
);
3422 dissect_ptp_v2_timeInterval(tvb
, &offset
, ptp_managementData_tree
, "Peer mean path delay",
3423 hf_ptp_v2_mm_peerMeanPathDelay_ns
, hf_ptp_v2_mm_peerMeanPathDelay_subns
, NULL
, NULL
);
3426 case PTP_V2_MM_ID_PRIMARY_DOMAIN
: {
3427 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_primaryDomain
, tvb
, offset
, 1, ENC_NA
);
3430 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3435 case PTP_V2_MM_ID_DELAY_MECHANISM
: {
3436 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_delayMechanism
, tvb
, offset
, 1, ENC_NA
);
3439 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3444 case PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL
: {
3445 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_logMinPdelayReqInterval
, tvb
, offset
, 1, ENC_NA
);
3448 proto_tree_add_item(ptp_managementData_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 1, ENC_NA
);
3458 } /* switch(ptp_v2_managementId) */
3462 case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS
: {
3463 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Management Error Status TLV");
3464 offset
+= dissect_ptp_v2_tlv_tlvtype_length(tvb
, offset
, ptp_tlv_tree
);
3466 int offset_tmp
= offset
;
3467 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_managementErrorId
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3470 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_managementId
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3473 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_reserved
, tvb
, offset
, 4, ENC_NA
);
3476 /* optional Field! */
3477 if (tlv_length
- (offset
- offset_tmp
) > 0) {
3478 dissect_ptp_v2_text(tvb
, &offset
, ptp_tree
, hf_ptp_v2_mm_displayData
, hf_ptp_v2_mm_displayData_length
);
3480 /* Pad to even length */
3481 if ((offset
- offset_tmp
) % 2) {
3482 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_pad
, tvb
, offset
, 1, ENC_NA
);
3489 case PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION
: {
3490 uint32_t org_id
= tvb_get_ntoh24(tvb
, offset
+ PTP_V2_TLV_HEADER_LENGTH
);
3491 uint32_t subtype
= tvb_get_ntoh24(tvb
, offset
+ PTP_V2_TLV_ORGANIZATIONSUBTYPE_OFFSET
);
3494 case OUI_IEEE_802_1
: {
3496 case PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_FOLLOWUP_INFORMATION_TLV
: {
3497 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Follow_Up information TLV");
3498 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_tlv_oe_organizationsubtype_802_1
);
3500 int32_t scaled_rate
;
3501 proto_tree_add_item_ret_int(ptp_tlv_tree
, hf_ptp_as_fu_tlv_cumulative_scaled_rate_offset
, tvb
, offset
, 4, ENC_BIG_ENDIAN
, &scaled_rate
);
3502 /* The cumulative scaled rate offset is(rateRatio - 1.0) * 2 ^ 41 */
3503 ti
= proto_tree_add_double(ptp_tlv_tree
, hf_ptp_as_fu_tlv_cumulative_rate_ratio
, tvb
, offset
, 4, 1.0 + ((double)scaled_rate
/ (UINT64_C(1) << 41)));
3504 proto_item_set_generated(ti
);
3507 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_fu_tlv_gm_base_indicator
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3510 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_fu_tlv_last_gm_phase_change
, tvb
, offset
, 12, ENC_NA
);
3513 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_fu_tlv_scaled_last_gm_freq_change
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3516 as_followup_tlv_present
= true;
3520 case PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_MSG_INTERVAL_REQ_TLV
: {
3521 static int * const msg_interval_req_flags
[] = {
3522 &hf_ptp_as_sig_tlv_flags_one_step_receive_capable
,
3523 &hf_ptp_as_sig_tlv_flags_comp_mean_link_delay
,
3524 &hf_ptp_as_sig_tlv_flags_comp_rate_ratio
,
3528 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Message interval request TLV");
3529 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_tlv_oe_organizationsubtype_802_1
);
3531 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_sig_tlv_link_delay_interval
, tvb
, offset
, 1, ENC_NA
);
3534 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_sig_tlv_time_sync_interval
, tvb
, offset
, 1, ENC_NA
);
3537 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_sig_tlv_announce_interval
, tvb
, offset
, 1, ENC_NA
);
3540 proto_tree_add_bitmask(ptp_tlv_tree
, tvb
, offset
, hf_ptp_as_sig_tlv_flags
, ett_ptp_as_sig_tlv_flags
, msg_interval_req_flags
, ENC_BIG_ENDIAN
);
3543 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_sig_tlv_reserved
, tvb
, offset
, 2, ENC_NA
);
3549 case PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_CSN_TLV
: {
3550 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "CSN TLV");
3551 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_tlv_oe_organizationsubtype_802_1
);
3553 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_csn_upstream_tx_time
, tvb
, offset
, 12, ENC_NA
);
3556 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_csn_neighbor_rate_ratio
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3559 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_csn_mean_link_delay
, tvb
, offset
, 12, ENC_NA
);
3562 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_csn_delay_asymmetry
, tvb
, offset
, 12, ENC_NA
);
3565 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_csn_domain_number
, tvb
, offset
, 1, ENC_NA
);
3570 case PTP_V2_OE_ORG_IEEE_802_1_SUBTYPE_FOLLOWUP_DRIFT_TRACKING_TLV
: {
3571 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Drift Tracking TLV");
3572 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_tlv_oe_organizationsubtype_802_1
);
3574 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_dt_tlv_sync_egress_timestamp_seconds
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
3577 /* Converting the fractionalNanoseconds to a double */
3578 guint32 nanoseconds
= tvb_get_ntohl(tvb
, offset
);
3579 guint16 fractional_nanoseconds
= tvb_get_ntohs(tvb
, offset
+ 4);
3580 double combined_timestamp
= nanoseconds
+ (fractional_nanoseconds
/ (double)(1 << 16));
3581 proto_tree_add_double(ptp_tlv_tree
, hf_ptp_as_dt_tlv_sync_egress_timestamp_fractional_nanoseconds
, tvb
, offset
, 6, combined_timestamp
);
3584 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_dt_tlv_sync_grandmaster_identity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3587 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_dt_tlv_sync_steps_removed
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3590 int32_t rate_ratio_drift
;
3591 proto_tree_add_item_ret_int(ptp_tlv_tree
, hf_ptp_as_dt_tlv_rate_ratio_drift
, tvb
, offset
, 4, ENC_BIG_ENDIAN
, &rate_ratio_drift
);
3592 ti
= proto_tree_add_double(ptp_tlv_tree
, hf_ptp_as_dt_tlv_rate_ratio_drift_ppm
, tvb
, offset
, 4, ((double)rate_ratio_drift
/ (UINT64_C(1) << 41)) * 1e6
);
3593 proto_item_set_generated(ti
);
3598 } /* end of switch (subtype) */
3602 expert_add_info(pinfo
, ti_tlv
, &ei_ptp_v2_as_tlv_in_non_as
);
3608 case OUI_IEEE_C37_238
: {
3610 case PTP_V2_OE_ORG_IEEE_C37_238_SUBTYPE_C37238TLV
: {
3611 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "IEEE_C37_238 TLV");
3612 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_tlv_oe_organizationsubtype
);
3614 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmasterid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3617 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmastertimeinaccuracy
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3620 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_oe_tlv_subtype_c37238tlv_networktimeinaccuracy
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3623 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_oe_tlv_subtype_c37238tlv_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3628 case PTP_V2_OE_ORG_IEEE_C37_238_SUBTYPE_C372382017TLV
: {
3629 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "IEEE_C37_238 2017 TLV");
3630 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_tlv_oe_organizationsubtype
);
3632 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_oe_tlv_ieee_c37_238_2017_organizationsubtype
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
3635 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmasterid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3638 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_oe_tlv_subtype_c372382017tlv_reserved
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3641 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_oe_tlv_subtype_c37238tlv_totaltimeinaccuracy
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3644 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_oe_tlv_subtype_c37238tlv_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3650 } /* end of switch (subtype) */
3652 } /* end of OUI_IEEE_C37_238 */
3656 case PTP_V2_OE_ORG_SMPTE_SUBTYPE_VERSION_TLV
: {
3657 proto_item
*smptedata_ti
, *systemframerate_ti
, *timeaddressflags_ti
, *daylightsavingflags_ti
, *leapsecondjumpflags_ti
;
3658 proto_tree
*ptp_smptedata_tree
, *ptp_framerate_tree
, *ptp_timeaddress_tree
, *ptp_daylightsaving_tree
, *ptp_leapsecondjump_tree
;
3660 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Version TLV");
3661 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_v2_oe_tlv_smpte_subtype
);
3663 smptedata_ti
= proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_data
, tvb
, offset
, 42, ENC_NA
);
3664 ptp_smptedata_tree
= proto_item_add_subtree(smptedata_ti
, ett_ptp_oe_smpte_data
);
3665 systemframerate_ti
= proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_defaultsystemframerate
, tvb
, offset
, 8, ENC_NA
);
3666 ptp_framerate_tree
= proto_item_add_subtree(systemframerate_ti
, ett_ptp_oe_smpte_framerate
);
3667 proto_tree_add_item(ptp_framerate_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_defaultsystemframerate_numerator
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3668 proto_tree_add_item(ptp_framerate_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_defaultsystemframerate_denominator
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
3671 proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_masterlockingstatus
, tvb
, offset
, 1, ENC_NA
);
3674 timeaddressflags_ti
= proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_timeaddressflags
, tvb
, offset
, 1, ENC_NA
);
3675 ptp_timeaddress_tree
= proto_item_add_subtree(timeaddressflags_ti
, ett_ptp_oe_smpte_timeaddress
);
3676 proto_tree_add_item(ptp_timeaddress_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_timeaddressflags_drop
, tvb
, offset
, 1, ENC_NA
);
3677 proto_tree_add_item(ptp_timeaddress_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_timeaddressflags_color
, tvb
, offset
, 1, ENC_NA
);
3680 proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_currentlocaloffset
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3683 proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_jumpseconds
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3686 proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_timeofnextjump
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
3689 proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_timeofnextjam
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
3692 proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_timeofpreviousjam
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
3695 proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_previousjamlocaloffset
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3698 daylightsavingflags_ti
= proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving
, tvb
, offset
, 1, ENC_NA
);
3699 ptp_daylightsaving_tree
= proto_item_add_subtree(daylightsavingflags_ti
, ett_ptp_oe_smpte_daylightsaving
);
3700 proto_tree_add_item(ptp_daylightsaving_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving_current
, tvb
, offset
, 1, ENC_NA
);
3701 proto_tree_add_item(ptp_daylightsaving_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving_next
, tvb
, offset
, 1, ENC_NA
);
3702 proto_tree_add_item(ptp_daylightsaving_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving_previous
, tvb
, offset
, 1, ENC_NA
);
3705 leapsecondjumpflags_ti
= proto_tree_add_item(ptp_smptedata_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_leapsecondjump
, tvb
, offset
, 1, ENC_NA
);
3706 ptp_leapsecondjump_tree
= proto_item_add_subtree(leapsecondjumpflags_ti
, ett_ptp_oe_smpte_leapsecondjump
);
3707 proto_tree_add_item(ptp_leapsecondjump_tree
, hf_ptp_v2_oe_tlv_subtype_smpte_leapsecondjump_change
, tvb
, offset
, 1, ENC_NA
);
3717 case PTP_V2_OE_ORG_CERN_SUBTYPE_WR_TLV
: {
3718 static int * const wr_flags
[] = {
3719 &hf_ptp_v2_an_tlv_oe_cern_wrFlags_wrModeOn
,
3720 &hf_ptp_v2_an_tlv_oe_cern_wrFlags_calibrated
,
3721 &hf_ptp_v2_an_tlv_oe_cern_wrFlags_wrConfig
,
3725 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "CERN White Rabbit TLV");
3726 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_v2_an_tlv_oe_cern_subtype
);
3728 uint32_t wr_message_id
;
3729 proto_tree_add_item_ret_uint(ptp_tlv_tree
, hf_ptp_v2_an_tlv_oe_cern_wrMessageID
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &wr_message_id
);
3732 col_append_str(pinfo
->cinfo
, COL_INFO
, " WR ");
3733 col_append_str(pinfo
->cinfo
, COL_INFO
, val_to_str(wr_message_id
, ptp_v2_org_cern_wrMessageID_vals
, "Unknown PTP WR Message (%u)"));
3735 switch (wr_message_id
) {
3736 case PTP_V2_OE_ORG_CERN_WRMESSAGEID_ANN_SUFIX
:
3737 /* TODO: This should only happen for Announce messages! */
3738 proto_tree_add_bitmask(ptp_tlv_tree
, tvb
, offset
, hf_ptp_v2_an_tlv_oe_cern_wrFlags
, ett_ptp_oe_wr_flags
, wr_flags
, ENC_BIG_ENDIAN
);
3742 case PTP_V2_OE_ORG_CERN_WRMESSAGEID_CALIBRATE
:
3743 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_oe_tlv_cern_calSendPattern
, tvb
, offset
, 1, ENC_NA
);
3746 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_oe_tlv_cern_calRety
, tvb
, offset
, 1, ENC_NA
);
3749 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_oe_tlv_cern_calPeriod
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3753 case PTP_V2_OE_ORG_CERN_WRMESSAGEID_CALIBRATED
:
3754 proto_tree_add_double(ptp_tlv_tree
, hf_ptp_v2_sig_oe_tlv_cern_deltaTx
, tvb
, offset
, 8, (double)(tvb_get_ntoh64(tvb
, offset
)) / (1 << 16));
3757 proto_tree_add_double(ptp_tlv_tree
, hf_ptp_v2_sig_oe_tlv_cern_deltaRx
, tvb
, offset
, 8, (double)(tvb_get_ntoh64(tvb
, offset
)) / (1 << 16));
3765 } /* end of switch (subtype) */
3770 case PTP_V2_INTERFACE_RATE_TLV
: {
3771 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Interface Rate TLV");
3772 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_v2_sig_oe_tlv_itut_subtype
);
3774 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_interface_bit_period
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3777 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_numberbits_before_timestamp
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3780 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_numberbits_after_timestamp
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3785 } /* end of switch (subtype) */
3791 } /* end of switch (org_id) */
3794 } /* end of case PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION */
3796 case PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION
:
3797 /* yes we fall through as the message is basically the same */
3798 case PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION
: {
3799 proto_tree
*ptp_tlv_tree
;
3800 if (tlv_type
== PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION
) {
3801 ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Request unicast transmission TLV");
3803 ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Grant unicast transmission TLV");
3805 offset
+= dissect_ptp_v2_tlv_tlvtype_length(tvb
, offset
, ptp_tlv_tree
);
3807 /* 16.1.4.1.3 messageType / 16.1.4.2.3 messageType*/
3808 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_messageType
, tvb
, offset
, 1, ENC_NA
);
3811 /* 16.1.4.1.4 logInterMessagePeriod / 16.1.4.2.4 logInterMessagePeriod*/
3812 uint8_t log_inter_message_period
= tvb_get_uint8(tvb
, offset
);
3813 double period
= pow(2, log_inter_message_period
);
3815 proto_item
*ptp_tlv_period
= proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_logInterMessagePeriod
, tvb
, offset
, 1, ENC_NA
);
3816 proto_tree
*ptp_tlv_period_tree
= proto_item_add_subtree(ptp_tlv_period
, ett_ptp_v2_tlv_log_period
);
3818 proto_tree_add_int_format_value(ptp_tlv_period_tree
, hf_ptp_v2_sig_tlv_logInterMessagePeriod_period
, tvb
, offset
, 1, log_inter_message_period
, "every %lg seconds", period
);
3821 double rate
= 1 / period
;
3822 proto_tree_add_int_format_value(ptp_tlv_period_tree
, hf_ptp_v2_sig_tlv_logInterMessagePeriod_rate
, tvb
, offset
, 1, log_inter_message_period
, "%lg packets/sec", rate
);
3824 proto_tree_add_expert_format(ptp_tlv_period_tree
, pinfo
, &ei_ptp_v2_period_invalid
, tvb
, offset
, 1, "Invalid InterMessagePeriod: %lg", period
);
3828 /* 16.1.4.1.5 durationField / 16.1.4.2.5 durationField */
3829 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_durationField
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3832 if (tlv_type
== PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION
) {
3833 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_reserved
, tvb
, offset
, 1, ENC_NA
);
3836 /* 16.1.4.2.6 renewalInvited */
3837 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_renewalInvited
, tvb
, offset
, 1, ENC_NA
);
3844 case PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION
:
3845 /* yes we fall through as the message is basically the same */
3846 case PTP_V2_TLV_TYPE_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION
: {
3847 proto_tree
*ptp_tlv_tree
;
3848 if (tlv_type
== PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION
) {
3849 ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Cancel unicast transmission TLV");
3851 ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Acknowledge cancel unicast transmission TLV");
3853 offset
+= dissect_ptp_v2_tlv_tlvtype_length(tvb
, offset
, ptp_tlv_tree
);
3855 /* 16.1.4.3.3 messageType / 16.1.4.4.3 messageType */
3856 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_messageType
, tvb
, offset
, 1, ENC_NA
);
3857 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_maintainRequest
, tvb
, offset
, 1, ENC_NA
);
3858 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_maintainGrant
, tvb
, offset
, 1, ENC_NA
);
3861 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_sig_tlv_reserved
, tvb
, offset
, 1, ENC_NA
);
3867 case PTP_V2_TLV_TYPE_PATH_TRACE
: {
3868 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Path trace TLV");
3869 offset
+= dissect_ptp_v2_tlv_tlvtype_length(tvb
, offset
, ptp_tlv_tree
);
3871 int tlv_end
= offset
+ tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
;
3873 while (offset
+ 8 <= tlv_end
) {
3874 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_an_tlv_pathsequence
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3881 case PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR
: {
3882 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "Alternate time offset indicator TLV");
3883 offset
+= dissect_ptp_v2_tlv_tlvtype_length(tvb
, offset
, ptp_tlv_tree
);
3885 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_atoi_tlv_keyfield
, tvb
, offset
, 1, ENC_NA
);
3888 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_atoi_tlv_currentoffset
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3891 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_atoi_tlv_jumpseconds
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3894 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_v2_atoi_tlv_timeofnextjump
, tvb
, offset
, 6, ENC_NA
);
3897 dissect_ptp_v2_text(tvb
, &offset
, ptp_tlv_tree
, hf_ptp_v2_atoi_tlv_displayname
, hf_ptp_v2_atoi_tlv_displayname_length
);
3898 /* offset was updated */
3902 case PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION_DO_NOT_PROPAGATE
: {
3903 uint32_t org_id
= tvb_get_ntoh24(tvb
, offset
+ PTP_V2_TLV_HEADER_LENGTH
);
3904 uint32_t subtype
= tvb_get_ntoh24(tvb
, offset
+ PTP_V2_TLV_ORGANIZATIONSUBTYPE_OFFSET
);
3907 case OUI_IEEE_802_1
:
3909 case PTP_AS_SIG_TLV_TYPE_GPTPCAPABLE_ORG_SUB_TYPE
: {
3910 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "gPTP-capable TLV");
3911 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_tlv_oe_organizationsubtype_802_1_no_propagate
);
3913 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_sig_tlv_gptp_capable_message_interval
, tvb
, offset
, 1, ENC_NA
);
3916 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_sig_tlv_flags
, tvb
, offset
, 1, ENC_NA
);
3919 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_sig_tlv_gptp_capable_reserved
, tvb
, offset
, 4, ENC_NA
);
3925 case PTP_AS_SIG_TLV_TYPE_GPTPCAPABLE_MESSSAGEINTERVAL_ORG_SUB_TYPE
: {
3926 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "gPTP-capable message interval request TLV");
3927 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_tlv_oe_organizationsubtype_802_1_no_propagate
);
3929 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_sig_tlv_gptp_capable_message_interval
, tvb
, offset
, 1, ENC_NA
);
3932 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_as_sig_tlv_gptp_capable_reserved
, tvb
, offset
, 3, ENC_NA
);
3938 } /* end of switch (subtype)*/
3941 } /* end of switch (org_id) */
3945 case PTP_V2_TLV_TYPE_L1_SYNC
: {
3946 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, &ti_tlv
, "L1 sync TLV");
3947 offset
+= dissect_ptp_v2_tlv_tlvtype_length(tvb
, offset
, ptp_tlv_tree
);
3949 /* Version with 2 bytes flags field */
3950 static int * const data_mode_flags2
[] = {
3951 &hf_ptp_v2_sig_tlv_l1sync_flags2_ope
,
3952 &hf_ptp_v2_sig_tlv_l1sync_flags2_cr
,
3953 &hf_ptp_v2_sig_tlv_l1sync_flags2_rcr
,
3954 &hf_ptp_v2_sig_tlv_l1sync_flags2_tcr
,
3955 &hf_ptp_v2_sig_tlv_l1sync_flags2_ic
,
3956 &hf_ptp_v2_sig_tlv_l1sync_flags2_irc
,
3957 &hf_ptp_v2_sig_tlv_l1sync_flags2_itc
,
3958 &hf_ptp_v2_sig_tlv_l1sync_flags2_reserved
,
3962 /* Version with 3 bytes flags field */
3963 static int * const data_mode_flags3
[] = {
3964 &hf_ptp_v2_sig_tlv_l1sync_flags3_ope
,
3965 &hf_ptp_v2_sig_tlv_l1sync_flags3_cr
,
3966 &hf_ptp_v2_sig_tlv_l1sync_flags3_rcr
,
3967 &hf_ptp_v2_sig_tlv_l1sync_flags3_tcr
,
3968 &hf_ptp_v2_sig_tlv_l1sync_flags3_ic
,
3969 &hf_ptp_v2_sig_tlv_l1sync_flags3_irc
,
3970 &hf_ptp_v2_sig_tlv_l1sync_flags3_itc
,
3971 &hf_ptp_v2_sig_tlv_l1sync_flags3_fov
,
3972 &hf_ptp_v2_sig_tlv_l1sync_flags3_pov
,
3973 &hf_ptp_v2_sig_tlv_l1sync_flags3_tct
,
3974 &hf_ptp_v2_sig_tlv_l1sync_flags3_reserved
,
3978 /* Get the value of flags */
3979 uint16_t l1sync_flags
= tvb_get_ntohs(tvb
, offset
);
3981 /* Check if the frame has extended format of L1_SYNC flags field */
3982 bool is_ext_format
= (l1sync_flags
& PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_OPE_BITMASK
) == PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_OPE_BITMASK
;
3983 uint8_t flags_len
= is_ext_format
? PTP_V2_SIG_TLV_L1SYNC_FLAGS_EXT_FORMAT
: PTP_V2_SIG_TLV_L1SYNC_FLAGS_BASIC_FORMAT
;
3985 if (!is_ext_format
) {
3986 proto_tree_add_bitmask(ptp_tlv_tree
, tvb
, offset
, hf_ptp_v2_sig_tlv_flags2
, ett_ptp_v2_sig_l1sync_flags
, data_mode_flags2
, ENC_BIG_ENDIAN
);
3987 offset
+= flags_len
;
3989 proto_tree_add_bitmask(ptp_tlv_tree
, tvb
, offset
, hf_ptp_v2_sig_tlv_flags3
, ett_ptp_v2_sig_l1sync_flags
, data_mode_flags3
, ENC_BIG_ENDIAN
);
3990 offset
+= flags_len
;
3992 dissect_ptp_v2_timeInterval(tvb
, &offset
, ptp_tlv_tree
, "phaseOffsetTx",
3993 hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTx_ns
, hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTx_subns
, NULL
, NULL
);
3994 /* offset was updated */
3996 dissect_ptp_v2_timetstamp(tvb
, &offset
, ptp_tlv_tree
, "phaseOffsetTxTimestamp",
3997 hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTxTimestamp_s
, hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTxTimestamp_ns
);
3998 /* offset was updated */
4000 dissect_ptp_v2_timeInterval(tvb
, &offset
, ptp_tlv_tree
, "freqOffsetTx",
4001 hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTx_ns
, hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTx_subns
, NULL
, NULL
);
4002 /* offset was updated */
4004 dissect_ptp_v2_timetstamp(tvb
, &offset
, ptp_tlv_tree
, "freqOffsetTxTimestamp",
4005 hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTxTimestamp_s
, hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTxTimestamp_ns
);
4006 /* offset was updated */
4012 } /* end of switch (tlv_type) */
4014 /* check first we have a registered subdissector for the organizationId */
4015 if (offset
== offset_loopstart
&& tlv_type
== PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION
) {
4016 uint32_t org_id
= tvb_get_uint24(tvb
, offset
+ PTP_V2_TLV_HEADER_LENGTH
, ENC_BIG_ENDIAN
);
4017 dissector_handle_t handle
= dissector_get_uint_handle(ptpv2_tlv_org_id_subdissector_table
, org_id
);
4018 if (handle
!= NULL
) {
4019 tvbuff_t
*sub_tvb
= tvb_new_subset_length(tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
);
4020 ptp_v2_tlv_org_ext_info_t ptp_v2_info
;
4021 ptp_v2_info
.is_802_1as
= is_802_1as
;
4022 ptp_v2_info
.ptp_v2_flags
= ptp_v2_flags
;
4023 ptp_v2_info
.ptp_v2_messageid
= ptp_v2_messageid
;
4024 offset
+= call_dissector_only(handle
, sub_tvb
, pinfo
, ptp_tree
, &ptp_v2_info
);
4028 if (offset
== offset_loopstart
) {
4030 proto_tree
*ptp_tlv_tree
= proto_tree_add_subtree(ptp_tree
, tvb
, offset
, tlv_length
+ PTP_V2_TLV_HEADER_LENGTH
, ett_ptp_v2_tlv
, NULL
, "Unknown TLV");
4032 if (tlv_type
== PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION
) {
4033 offset
+= dissect_ptp_v2_tlv_org_fields(tvb
, offset
, ptp_tlv_tree
, hf_ptp_tlv_oe_organizationsubtype
);
4035 offset
+= dissect_ptp_v2_tlv_tlvtype_length(tvb
, offset
, ptp_tlv_tree
);
4038 /* unparsed bytes */
4039 proto_tree_add_item(ptp_tlv_tree
, hf_ptp_tlv_unparsed_payload
, tvb
, offset
, tlv_length
+ 4 - (offset
- offset_loopstart
), ENC_NA
);
4040 offset
+= tlv_length
+ 4 - (offset
- offset_loopstart
);
4043 if (offset
< offset_loopstart
+ PTP_V2_TLV_HEADER_LENGTH
+ tlv_length
) {
4044 /* unparsed bytes!*/
4045 offset
= offset_loopstart
+ PTP_V2_TLV_HEADER_LENGTH
+ tlv_length
;
4049 /* check if required TLVs are present and forbidden are absent*/
4051 if (ptp_v2_messageid
== PTP_V2_SYNC_MESSAGE
&& ((ptp_v2_flags
& PTP_V2_FLAGS_TWO_STEP_BITMASK
) != PTP_V2_FLAGS_TWO_STEP_BITMASK
) && !as_followup_tlv_present
) {
4052 expert_add_info(pinfo
, ti_tlv
, &ei_ptp_v2_sync_no_fup_tlv
);
4054 if (ptp_v2_messageid
== PTP_V2_SYNC_MESSAGE
&& ((ptp_v2_flags
& PTP_V2_FLAGS_TWO_STEP_BITMASK
) == PTP_V2_FLAGS_TWO_STEP_BITMASK
) && as_followup_tlv_present
) {
4055 expert_add_info(pinfo
, ti_tlv
, &ei_ptp_v2_sync_with_fup_tlv
);
4057 if (ptp_v2_messageid
== PTP_V2_FOLLOWUP_MESSAGE
&& !as_followup_tlv_present
) {
4058 expert_add_info(pinfo
, ti_tlv
, &ei_ptp_v2_followup_no_tlv
);
4062 return offset
- offset_orig
;
4066 dissect_ptp_v2(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, bool ptpv2_oE
) {
4069 uint8_t ptp_v2_ver
= 0;
4070 uint8_t ptp_v2_minorver
= 0;
4071 uint8_t ptp_v2_domain
= 0;
4072 uint8_t ptp_v2_minorsdoid
= 0;
4073 uint64_t ptp_v2_correction
= 0;
4074 uint64_t ptp_v2_clockid
= 0;
4075 uint16_t ptp_v2_sourceportid
= 0;
4076 uint16_t ptp_v2_seqid
= 0;
4077 uint64_t ptp_v2_clockidref
= 0;
4078 uint16_t ptp_v2_sourceportidref
= 0;
4080 /* Set up structures needed to add the protocol subtree and manage it */
4081 proto_item
*ti
= NULL
, *msg_len_item
= NULL
, *clockidentity_ti
, *ti_root
= NULL
;
4082 proto_tree
*ptp_tree
= NULL
, *ptp_clockidentity_tree
;
4084 /* Make entries in Protocol column and Info column on summary display */
4085 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PTPv2");
4087 /* Get majorSdoId bit to determine whether this is an AS packet or not */
4088 uint8_t ptp_v2_majorsdoid
= 0xF0 & tvb_get_uint8 (tvb
, PTP_V2_MAJORSDOID_MESSAGE_TYPE_OFFSET
);
4090 /* 802.1AS is indicated by majorSdoId = 1 and Ethernet, WIFI, EPON, or CSN transport */
4091 bool is_802_1as
= (ptp_v2_majorsdoid
& PTP_V2_MAJORSDOID_ASPACKET_BITMASK
) && (ptpv2_oE
== true);
4093 /* Get control field (what kind of message is this? (Sync, DelayReq, ...) */
4094 uint8_t ptp_v2_messageid
= 0x0F & tvb_get_uint8 (tvb
, PTP_V2_MAJORSDOID_MESSAGE_TYPE_OFFSET
);
4096 uint16_t msg_len
= tvb_get_ntohs(tvb
, PTP_V2_MESSAGE_LENGTH_OFFSET
);
4098 uint16_t ptp_v2_flags
= tvb_get_uint16(tvb
, PTP_V2_FLAGS_OFFSET
, ENC_BIG_ENDIAN
);
4100 if (ptp_analyze_messages
)
4102 ptp_v2_ver
= 0x0F & tvb_get_uint8(tvb
, PTP_V2_VERSIONPTP_OFFSET
);
4103 ptp_v2_minorver
= 0xF0 & tvb_get_uint8(tvb
, PTP_V2_MINORVERSIONPTP_OFFSET
);
4104 ptp_v2_domain
= tvb_get_uint8(tvb
, PTP_V2_DOMAIN_NUMBER_OFFSET
);
4105 ptp_v2_minorsdoid
= tvb_get_uint8(tvb
, PTP_V2_MINORSDOID_OFFSET
);
4106 ptp_v2_clockid
= tvb_get_uint64(tvb
, PTP_V2_CLOCKIDENTITY_OFFSET
, ENC_BIG_ENDIAN
);
4107 ptp_v2_sourceportid
= tvb_get_uint16(tvb
, PTP_V2_SOURCEPORTID_OFFSET
, ENC_BIG_ENDIAN
);
4108 ptp_v2_seqid
= tvb_get_uint16(tvb
, PTP_V2_SEQUENCEID_OFFSET
, ENC_BIG_ENDIAN
);
4109 ptp_v2_correction
= tvb_get_uint64(tvb
, PTP_V2_CORRECTION_OFFSET
, ENC_BIG_ENDIAN
);
4111 switch (ptp_v2_messageid
)
4113 case PTP_V2_PEER_DELAY_RESP_MESSAGE
:
4114 ptp_v2_clockidref
= tvb_get_uint64(tvb
, PTP_V2_PDRS_REQUESTINGPORTIDENTITY_OFFSET
, ENC_BIG_ENDIAN
);
4115 ptp_v2_sourceportidref
= tvb_get_uint16(tvb
, PTP_V2_PDRS_REQUESTINGSOURCEPORTID_OFFSET
, ENC_BIG_ENDIAN
);
4117 case PTP_V2_PEER_DELAY_FOLLOWUP_MESSAGE
:
4118 ptp_v2_clockidref
= tvb_get_uint64(tvb
, PTP_V2_PDFU_REQUESTINGPORTIDENTITY_OFFSET
, ENC_BIG_ENDIAN
);
4119 ptp_v2_sourceportidref
= tvb_get_uint16(tvb
, PTP_V2_PDFU_REQUESTINGSOURCEPORTID_OFFSET
, ENC_BIG_ENDIAN
);
4123 if (!(pinfo
->fd
->visited
))
4125 ptp_frame_info_t
*frame_info
= NULL
;
4126 switch (ptp_v2_messageid
)
4128 case PTP_V2_SYNC_MESSAGE
:
4129 frame_info
= create_frame_info(pinfo
, ptp_v2_ver
, ptp_v2_minorver
, ptp_v2_majorsdoid
, ptp_v2_minorsdoid
, PTP_V2_SYNC_MESSAGE
, ptp_v2_domain
, ptp_v2_clockid
, ptp_v2_sourceportid
, ptp_v2_seqid
);
4130 frame_info
->messagetype
= PTP_V2_SYNC_MESSAGE
;
4131 frame_info
->sync
.sync_two_step
= (ptp_v2_flags
& PTP_V2_FLAGS_TWO_STEP_BITMASK
) == PTP_V2_FLAGS_TWO_STEP_BITMASK
;
4132 frame_info
->sync
.sync_ts
= pinfo
->abs_ts
;
4133 /* Rapid sequence number resets can be detected here checking for non-zero frame_info->sync.sync_frame_num */
4134 frame_info
->sync
.sync_frame_num
= pinfo
->num
;
4136 if (!frame_info
->sync
.sync_two_step
) {
4137 /* In 1-step mode, the sync carries the followup information, so we set fup to sync */
4138 frame_info
->sync
.fup_frame_num
= pinfo
->num
;
4139 frame_info
->sync
.timestamp_s
= tvb_get_uint48(tvb
, PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET
, ENC_BIG_ENDIAN
);
4140 frame_info
->sync
.timestamp_ns
= tvb_get_uint32(tvb
, PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET
, ENC_BIG_ENDIAN
);
4141 frame_info
->sync
.correction_ns
= ptp_v2_correction
>> 16;
4142 frame_info
->sync
.correction_subns
= ptp_v2_correction
% 16;
4145 case PTP_V2_FOLLOWUP_MESSAGE
:
4146 frame_info
= create_frame_info(pinfo
, ptp_v2_ver
, ptp_v2_minorver
, ptp_v2_majorsdoid
, ptp_v2_minorsdoid
, PTP_V2_SYNC_MESSAGE
, ptp_v2_domain
, ptp_v2_clockid
, ptp_v2_sourceportid
, ptp_v2_seqid
);
4147 frame_info
->messagetype
= PTP_V2_SYNC_MESSAGE
;
4148 frame_info
->sync
.fup_frame_num
= pinfo
->num
;
4149 frame_info
->sync
.timestamp_s
= tvb_get_uint48(tvb
, PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET
, ENC_BIG_ENDIAN
);
4150 frame_info
->sync
.timestamp_ns
= tvb_get_uint32(tvb
, PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET
, ENC_BIG_ENDIAN
);
4151 frame_info
->sync
.correction_ns
= ptp_v2_correction
>> 16;
4152 frame_info
->sync
.correction_subns
= ptp_v2_correction
% 16;
4154 case PTP_V2_PEER_DELAY_REQ_MESSAGE
:
4155 frame_info
= create_frame_info(pinfo
, ptp_v2_ver
, ptp_v2_minorver
, ptp_v2_majorsdoid
, ptp_v2_minorsdoid
, PTP_V2_PEER_DELAY_REQ_MESSAGE
, ptp_v2_domain
, ptp_v2_clockid
, ptp_v2_sourceportid
, ptp_v2_seqid
);
4156 frame_info
->messagetype
= PTP_V2_PEER_DELAY_REQ_MESSAGE
;
4157 frame_info
->pdelay
.pdelay_req_frame_num
= pinfo
->num
;
4158 frame_info
->pdelay
.pdelay_req_ts
= pinfo
->abs_ts
;
4160 case PTP_V2_PEER_DELAY_RESP_MESSAGE
:
4161 frame_info
= create_frame_info(pinfo
, ptp_v2_ver
, ptp_v2_minorver
, ptp_v2_majorsdoid
, ptp_v2_minorsdoid
, PTP_V2_PEER_DELAY_REQ_MESSAGE
, ptp_v2_domain
, ptp_v2_clockidref
, ptp_v2_sourceportidref
, ptp_v2_seqid
);
4162 frame_info
->messagetype
= PTP_V2_PEER_DELAY_REQ_MESSAGE
;
4163 frame_info
->pdelay
.pdelay_res_frame_num
= pinfo
->num
;
4164 frame_info
->pdelay
.pdelay_res_two_step
= (ptp_v2_flags
& PTP_V2_FLAGS_TWO_STEP_BITMASK
) == PTP_V2_FLAGS_TWO_STEP_BITMASK
;
4165 frame_info
->pdelay
.pdelay_res_ts
= pinfo
->abs_ts
;
4166 frame_info
->pdelay
.pdelay_req_recv_ts_s
= tvb_get_uint48(tvb
, PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET
, ENC_BIG_ENDIAN
);
4167 frame_info
->pdelay
.pdelay_req_recv_ts_ns
= tvb_get_uint32(tvb
, PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPNANOSECONDS_OFFSET
, ENC_BIG_ENDIAN
);
4169 case PTP_V2_PEER_DELAY_FOLLOWUP_MESSAGE
:
4170 frame_info
= create_frame_info(pinfo
, ptp_v2_ver
, ptp_v2_minorver
, ptp_v2_majorsdoid
, ptp_v2_minorsdoid
, PTP_V2_PEER_DELAY_REQ_MESSAGE
, ptp_v2_domain
, ptp_v2_clockidref
, ptp_v2_sourceportidref
, ptp_v2_seqid
);
4171 frame_info
->messagetype
= PTP_V2_PEER_DELAY_REQ_MESSAGE
;
4172 frame_info
->pdelay
.pdelay_fup_frame_num
= pinfo
->num
;
4173 frame_info
->pdelay
.pdelay_res_send_ts_s
= tvb_get_uint48(tvb
, PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET
, ENC_BIG_ENDIAN
);
4174 frame_info
->pdelay
.pdelay_res_send_ts_ns
= tvb_get_uint32(tvb
, PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPNANOSECONDS_OFFSET
, ENC_BIG_ENDIAN
);
4178 if (frame_info
!= NULL
) {
4179 p_add_proto_data(wmem_file_scope(), pinfo
, proto_ptp
, 0, frame_info
);
4182 if PTP_FRAME_INFO_SYNC_SEEN(frame_info
) {
4184 if (PTP_FRAME_INFO_SYNC_COMPLETE(frame_info
) && !frame_info
->sync
.calculated_timestamp_valid
) {
4185 /* calculate two step sync timestamp */
4187 nstime_t ts
= NSTIME_INIT_SECS_NSECS(frame_info
->sync
.timestamp_s
, frame_info
->sync
.timestamp_ns
);
4189 /* we are ignoring subns */
4190 int64_t corr_s
= frame_info
->sync
.correction_ns
/ NS_PER_S
;
4191 int32_t corr_ns
= frame_info
->sync
.correction_ns
% NS_PER_S
;
4192 nstime_t corr
= NSTIME_INIT_SECS_NSECS(corr_s
, corr_ns
);
4194 nstime_sum(&(frame_info
->sync
.calculated_timestamp
), &(ts
), &(corr
));
4195 frame_info
->sync
.calculated_timestamp_valid
= true;
4198 if PTP_FRAME_INFO_SYNC_SEEN(frame_info
->prev
) {
4199 nstime_t delta_capture_ts
;
4200 nstime_delta(&delta_capture_ts
, &(frame_info
->sync
.sync_ts
), &(frame_info
->prev
->sync
.sync_ts
));
4202 frame_info
->sync
.syncInterval
= nstime_to_sec(&delta_capture_ts
);
4203 if (frame_info
->sync
.syncInterval
> 0)
4204 frame_info
->sync
.syncInterval_valid
= true;
4206 if (PTP_FRAME_INFO_SYNC_COMPLETE(frame_info
->prev
) && frame_info
->sync
.calculated_timestamp_valid
&& frame_info
->prev
->sync
.calculated_timestamp_valid
) {
4207 nstime_t delta_sync_ts
;
4208 nstime_delta(&delta_sync_ts
, &(frame_info
->sync
.calculated_timestamp
), &(frame_info
->prev
->sync
.calculated_timestamp
));
4210 if (frame_info
->sync
.syncInterval_valid
) {
4211 frame_info
->sync
.syncRateRatio
= nstime_to_sec(&delta_sync_ts
) / nstime_to_sec(&delta_capture_ts
);
4212 frame_info
->sync
.syncRateRatio_valid
= true;
4213 frame_info
->sync
.syncRateRatio_ppm
=
4214 (int32_t)((1.0 - frame_info
->sync
.syncRateRatio
) * 1000 * 1000);
4220 if (PTP_FRAME_INFO_PDELAY_REQ_SEEN(frame_info
) && PTP_FRAME_INFO_PDELAY_REQ_SEEN(frame_info
->prev
)) {
4222 nstime_delta(&t4_delta
, &frame_info
->pdelay
.pdelay_res_ts
, &frame_info
->prev
->pdelay
.pdelay_res_ts
);
4224 frame_info
->pdelay
.pdelayInterval
= nstime_to_sec(&t4_delta
);
4225 if (frame_info
->pdelay
.pdelayInterval
> 0)
4226 frame_info
->pdelay
.pdelayInterval_valid
= true;
4228 if (PTP_FRAME_INFO_PDELAY_COMPLETE(frame_info
) && PTP_FRAME_INFO_PDELAY_COMPLETE(frame_info
->prev
)) {
4229 /* lets calculate rate t3_delta / t4_delta */
4231 nstime_t t3_curr
= NSTIME_INIT_SECS_NSECS(frame_info
->pdelay
.pdelay_res_send_ts_s
, frame_info
->pdelay
.pdelay_res_send_ts_ns
);
4232 nstime_t t3_prev
= NSTIME_INIT_SECS_NSECS(frame_info
->prev
->pdelay
.pdelay_res_send_ts_s
, frame_info
->prev
->pdelay
.pdelay_res_send_ts_ns
);
4233 nstime_delta(&t3_delta
, &t3_curr
, &t3_prev
);
4235 if (frame_info
->pdelay
.pdelayInterval_valid
) {
4236 frame_info
->pdelay
.neighborRateRatio
= nstime_to_sec(&t3_delta
) / nstime_to_sec(&t4_delta
);
4237 frame_info
->pdelay
.neighborRateRatio_valid
= true;
4238 frame_info
->pdelay
.neighborRateRatio_ppm
=
4239 (int32_t)((1.0 - frame_info
->pdelay
.neighborRateRatio
) * 1000 * 1000);
4244 if PTP_FRAME_INFO_PDELAY_COMPLETE(frame_info
) {
4245 /* lets calculate peer delay: T4 - T1 - (t3 - t2) */
4246 nstime_t t2
= NSTIME_INIT_SECS_NSECS(frame_info
->pdelay
.pdelay_req_recv_ts_s
, frame_info
->pdelay
.pdelay_req_recv_ts_ns
);
4247 nstime_t t3
= NSTIME_INIT_SECS_NSECS(frame_info
->pdelay
.pdelay_res_send_ts_s
, frame_info
->pdelay
.pdelay_res_send_ts_ns
);
4248 nstime_t peer_delta_t3_t2
;
4249 nstime_delta(&peer_delta_t3_t2
, &t3
, &t2
);
4251 nstime_delta(&frame_info
->pdelay
.mean_propagation_delay_unscaled
, &(frame_info
->pdelay
.pdelay_res_ts
), &(frame_info
->pdelay
.pdelay_req_ts
));
4252 double delta_t4_t1
= nstime_to_sec(&(frame_info
->pdelay
.mean_propagation_delay_unscaled
));
4253 nstime_subtract(&frame_info
->pdelay
.mean_propagation_delay_unscaled
, &peer_delta_t3_t2
);
4255 /* now take only 1/2 of it */
4256 frame_info
->pdelay
.mean_propagation_delay_unscaled
.nsecs
/= 2;
4257 if ((frame_info
->pdelay
.mean_propagation_delay_unscaled
.secs
% 2) == 1) {
4258 frame_info
->pdelay
.mean_propagation_delay_unscaled
.secs
-= 1;
4259 frame_info
->pdelay
.mean_propagation_delay_unscaled
.nsecs
+= NS_PER_S
/ 2;
4261 frame_info
->pdelay
.mean_propagation_delay_unscaled
.secs
/= 2;
4263 /* lets scale by neighborRateRatio. converted to the capture timestamp timescale. */
4264 if (frame_info
->pdelay
.neighborRateRatio_valid
) {
4265 double delta_t3_t2
= nstime_to_sec(&peer_delta_t3_t2
);
4266 frame_info
->pdelay
.mean_propagation_delay_scaled
= 0.5 * (delta_t4_t1
- frame_info
->pdelay
.neighborRateRatio
* delta_t3_t2
);
4272 /* Extend Info column with managementId */
4273 /* Create and set the string for "Info" column */
4274 if ( ptp_v2_messageid
== PTP_V2_MANAGEMENT_MESSAGE
) {
4277 tlv_type
= tvb_get_ntohs (tvb
, PTP_V2_MM_TLV_TYPE_OFFSET
);
4278 /* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
4281 case PTP_V2_TLV_TYPE_MANAGEMENT
:
4283 uint16_t ptp_v2_mm_managementId
;
4284 uint8_t ptp_v2_management_action
;
4285 /* Get the managementId */
4286 ptp_v2_mm_managementId
= tvb_get_ntohs(tvb
, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET
);
4287 ptp_v2_management_action
= 0x0F & tvb_get_uint8(tvb
, PTP_V2_MM_ACTION_OFFSET
);
4288 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Management (%s) %s",
4289 val_to_str_ext(ptp_v2_mm_managementId
, &ptp_v2_managementID_infocolumn_vals_ext
, "Unknown management Id %u"),
4290 val_to_str(ptp_v2_management_action
, ptp_v2_mm_action_vals
, "Unknown Action %u"));
4293 case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS
:
4295 uint16_t ptp_v2_mm_managementId
;
4296 /* Get the managementErrorId */
4297 ptp_v2_mm_managementId
= tvb_get_ntohs(tvb
, PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET
);
4298 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Management Error Message (%s)",
4299 val_to_str_ext(ptp_v2_mm_managementId
, &ptp_v2_managementErrorId_vals_ext
, "Unknown Error Id %u"));
4303 col_add_str(pinfo
->cinfo
, COL_INFO
,
4304 val_to_str_ext(ptp_v2_messageid
, &ptp_v2_messagetype_vals_ext
, "Unknown PTP Message (%u)"));
4308 col_add_str(pinfo
->cinfo
, COL_INFO
, val_to_str_ext(ptp_v2_messageid
, &ptp_v2_messagetype_vals_ext
, "Unknown PTP Message (%u)"));
4312 ti_root
= proto_tree_add_item(tree
, proto_ptp
, tvb
, offset
, -1, ENC_NA
);
4313 ptp_tree
= proto_item_add_subtree(ti_root
, ett_ptp_v2
);
4315 proto_tree_add_item(ptp_tree
, hf_ptp_v2_majorsdoid
, tvb
, offset
, 1, ENC_NA
);
4316 proto_tree_add_item(ptp_tree
, hf_ptp_v2_messagetype
, tvb
, offset
, 1, ENC_NA
);
4319 proto_tree_add_item(ptp_tree
, hf_ptp_v2_minorversionptp
, tvb
, offset
, 1, ENC_NA
);
4320 proto_tree_add_item(ptp_tree
, hf_ptp_v2_versionptp
, tvb
, offset
, 1, ENC_NA
);
4323 msg_len_item
= proto_tree_add_item(ptp_tree
, hf_ptp_v2_messagelength
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4328 * Sanity-check the message length.
4330 if (msg_len
> tvb_reported_length(tvb
)) {
4331 /* Bogus message length - runs past the end of the packet */
4332 expert_add_info(pinfo
, msg_len_item
, &ei_ptp_v2_msg_len_too_large
);
4333 } else if (msg_len
< PTP_V2_MESSAGE_LENGTH_OFFSET
+ 2) {
4334 /* Bogus message length - not long enough to include the message length field */
4335 expert_add_info(pinfo
, msg_len_item
, &ei_ptp_v2_msg_len_too_small
);
4339 * Set the length of this tvbuff to the message length, chopping
4342 set_actual_length(tvb
, msg_len
);
4343 proto_item_set_len(ti_root
, msg_len
);
4347 static int * const ptp_flags
[] = {
4348 &hf_ptp_v2_flags_security
,
4349 &hf_ptp_v2_flags_specific2
,
4350 &hf_ptp_v2_flags_specific1
,
4351 &hf_ptp_v2_flags_unicast
,
4352 &hf_ptp_v2_flags_twostep
,
4353 &hf_ptp_v2_flags_alternatemaster
,
4354 &hf_ptp_v2_flags_synchronizationUncertain
,
4355 &hf_ptp_v2_flags_frequencytraceable
,
4356 &hf_ptp_v2_flags_timetraceable
,
4357 &hf_ptp_v2_flags_ptptimescale
,
4358 &hf_ptp_v2_flags_utcoffsetvalid
,
4359 &hf_ptp_v2_flags_li59
,
4360 &hf_ptp_v2_flags_li61
,
4364 ptp_frame_info_t
*frame_info
= (ptp_frame_info_t
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_ptp
, 0);
4366 proto_tree_add_item(ptp_tree
, hf_ptp_v2_domainnumber
, tvb
, offset
, 1, ENC_NA
);
4369 proto_tree_add_item(ptp_tree
, hf_ptp_v2_minorsdoid
, tvb
, offset
, 1, ENC_NA
);
4372 proto_tree_add_bitmask(ptp_tree
, tvb
, offset
, hf_ptp_v2_flags
, ett_ptp_v2_flags
, ptp_flags
, ENC_BIG_ENDIAN
);
4375 dissect_ptp_v2_timeInterval(tvb
, &offset
, ptp_tree
, "correctionField", hf_ptp_v2_correction
, hf_ptp_v2_correctionsubns
, NULL
, NULL
);
4376 /* offset was updated */
4378 proto_tree_add_item(ptp_tree
, hf_ptp_v2_messagetypespecific
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4381 clockidentity_ti
= proto_tree_add_item(ptp_tree
, hf_ptp_v2_clockidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
4383 /* EUI-64: vendor ID | 0xFF - 0xFE | card ID */
4384 if (tvb_get_ntohs(tvb
, offset
+ 3) == 0xFFFE) {
4385 ptp_clockidentity_tree
= proto_item_add_subtree(clockidentity_ti
, ett_ptp_v2_clockidentity
);
4387 const char *manuf_name
= tvb_get_manuf_name(tvb
, offset
);
4388 proto_tree_add_bytes_format_value(ptp_clockidentity_tree
, hf_ptp_v2_clockidentity_manuf
, tvb
, offset
, 3, NULL
, "%s", manuf_name
);
4392 proto_tree_add_item(ptp_tree
, hf_ptp_v2_sourceportid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4395 proto_tree_add_item(ptp_tree
, hf_ptp_v2_sequenceid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4398 /* IEEE 802.1AS defines the control field to be 0x00, so we turn off resolution */
4400 proto_tree_add_item(ptp_tree
, hf_ptp_v2_controlfield_default
, tvb
, offset
, 1, ENC_NA
);
4402 proto_tree_add_item(ptp_tree
, hf_ptp_v2_controlfield
, tvb
, offset
, 1, ENC_NA
);
4407 ti
= proto_tree_add_item_ret_int(ptp_tree
, hf_ptp_v2_logmessageperiod
, tvb
, offset
, 1, ENC_NA
, &logmsgperiod
);
4409 /* 127 is special */
4410 if (ptp_analyze_messages
&& logmsgperiod
!= 127) {
4411 proto_item_append_text(ti
, " (%.6f s)", pow(2.0, (double)logmsgperiod
));
4416 switch(ptp_v2_messageid
) {
4417 case PTP_V2_ANNOUNCE_MESSAGE
:{
4419 /* In 802.1AS there is no origin timestamp in an Announce Message */
4421 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_origintimestamp_seconds
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
4424 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_origintimestamp_nanoseconds
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4427 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_reserved1
, tvb
, offset
, 10, ENC_NA
);
4431 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_origincurrentutcoffset
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4434 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_reserved2
, tvb
, offset
, 1, ENC_NA
);
4437 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_priority1
, tvb
, offset
, 1, ENC_NA
);
4440 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_grandmasterclockclass
, tvb
, offset
, 1, ENC_NA
);
4443 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_grandmasterclockaccuracy
, tvb
, offset
, 1, ENC_NA
);
4446 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_grandmasterclockvariance
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4449 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_priority2
, tvb
, offset
, 1, ENC_NA
);
4452 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_grandmasterclockidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
4455 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_localstepsremoved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4458 proto_tree_add_item(ptp_tree
, hf_ptp_v2_an_timesource
, tvb
, offset
, 1, ENC_NA
);
4461 disect_ptp_v2_tlvs(tvb
, offset
, pinfo
, ti_root
, ptp_tree
, ptp_v2_messageid
, ptp_v2_flags
, is_802_1as
);
4465 case PTP_V2_SYNC_MESSAGE
:
4466 if (is_802_1as
&& ((ptp_v2_flags
& PTP_V2_FLAGS_TWO_STEP_BITMASK
) == PTP_V2_FLAGS_TWO_STEP_BITMASK
)) {
4467 /* IEEE 802.1AS 2-step does not have Origin Timestamp in Sync! See 11.4.3 */
4468 proto_tree_add_item(ptp_tree
, hf_ptp_v2_sync_reserved
, tvb
, offset
, 10, ENC_NA
);
4471 /* regular PTP or 802.1AS 1-step */
4472 proto_tree_add_item(ptp_tree
, hf_ptp_v2_sdr_origintimestamp_seconds
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
4475 proto_tree_add_item(ptp_tree
, hf_ptp_v2_sdr_origintimestamp_nanoseconds
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4479 disect_ptp_v2_tlvs(tvb
, offset
, pinfo
, ti_root
, ptp_tree
, ptp_v2_messageid
, ptp_v2_flags
, is_802_1as
);
4481 if (ptp_analyze_messages
) {
4482 if (PTP_FRAME_INFO_SYNC_COMPLETE(frame_info
)) {
4483 if (frame_info
->sync
.syncInterval_valid
) {
4484 ti
= proto_tree_add_double(ptp_tree
, hf_ptp_v2_analysis_sync_period
, tvb
, 0, 0, frame_info
->sync
.syncInterval
);
4485 proto_item_append_text(ti
, " %s", "s");
4486 proto_item_set_generated(ti
);
4489 if ((ptp_v2_flags
& PTP_V2_FLAGS_TWO_STEP_BITMASK
) == PTP_V2_FLAGS_TWO_STEP_BITMASK
) {
4490 ti
= proto_tree_add_uint(ptp_tree
, hf_ptp_v2_analysis_sync_to_followup
, tvb
, 0, 0, frame_info
->sync
.fup_frame_num
);
4491 proto_item_set_generated(ti
);
4493 if (frame_info
->sync
.calculated_timestamp_valid
) {
4494 ti
= proto_tree_add_double(ptp_tree
, hf_ptp_v2_analysis_sync_timestamp
, tvb
, 0, 0, nstime_to_sec(&(frame_info
->sync
.calculated_timestamp
)));
4495 proto_item_set_generated(ti
);
4496 proto_tree
*ts_tree
= proto_item_add_subtree(ti
, ett_ptp_analysis_timestamp
);
4497 ti
= proto_tree_add_uint64(ts_tree
, hf_ptp_v2_analysis_sync_timestamp_seconds
, tvb
, 0, 0, frame_info
->sync
.calculated_timestamp
.secs
);
4498 proto_item_set_generated(ti
);
4499 ti
= proto_tree_add_uint(ts_tree
, hf_ptp_v2_analysis_sync_timestamp_nanoseconds
, tvb
, 0, 0, frame_info
->sync
.calculated_timestamp
.nsecs
);
4500 proto_item_set_generated(ti
);
4503 if (frame_info
->sync
.syncRateRatio_valid
) {
4504 ti
= proto_tree_add_double(ptp_tree
, hf_ptp_v2_analysis_sync_rateRatio
, tvb
, 0, 0, frame_info
->sync
.syncRateRatio
);
4505 proto_item_set_generated(ti
);
4506 ti
= proto_tree_add_int(ptp_tree
, hf_ptp_v2_analysis_sync_rateRatio_ppm
, tvb
, 0, 0, frame_info
->sync
.syncRateRatio_ppm
);
4507 proto_item_set_generated(ti
);
4510 } else if ((ptp_v2_flags
& PTP_V2_FLAGS_TWO_STEP_BITMASK
) == PTP_V2_FLAGS_TWO_STEP_BITMASK
) {
4511 /* No FollowUp found! */
4512 expert_add_info(pinfo
, ti_root
, &ei_ptp_v2_sync_no_followup
);
4518 case PTP_V2_DELAY_REQ_MESSAGE
:{
4519 proto_tree_add_item(ptp_tree
, hf_ptp_v2_sdr_origintimestamp_seconds
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
4522 proto_tree_add_item(ptp_tree
, hf_ptp_v2_sdr_origintimestamp_nanoseconds
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4525 disect_ptp_v2_tlvs(tvb
, offset
, pinfo
, ti_root
, ptp_tree
, ptp_v2_messageid
, ptp_v2_flags
, is_802_1as
);
4530 case PTP_V2_FOLLOWUP_MESSAGE
:{
4531 proto_item
*ti_tstamp
;
4535 proto_tree_add_item_ret_uint64(ptp_tree
, hf_ptp_v2_fu_preciseorigintimestamp_seconds
, tvb
, offset
, 6, ENC_BIG_ENDIAN
, &ts_sec
);
4536 proto_tree_add_item_ret_uint(ptp_tree
, hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds
, tvb
, offset
+ 6, 4, ENC_BIG_ENDIAN
, &ts_ns
);
4537 ti_tstamp
= proto_tree_add_bytes_format_value(ptp_tree
, hf_ptp_v2_fu_preciseorigintimestamp_32bit
, tvb
, offset
, 10,
4538 NULL
, "%"PRIu64
, (ts_sec
* NS_PER_S
+ ts_ns
) % UINT64_C(0x100000000));
4539 proto_item_set_hidden(ti_tstamp
);
4540 proto_item_set_generated(ti_tstamp
);
4543 disect_ptp_v2_tlvs(tvb
, offset
, pinfo
, ptp_tree
, ti_root
, ptp_v2_messageid
, ptp_v2_flags
, is_802_1as
);
4545 if (ptp_analyze_messages
) {
4546 if (frame_info
!= NULL
) {
4547 if (PTP_FRAME_INFO_SYNC_COMPLETE(frame_info
) && frame_info
->sync
.sync_two_step
) {
4548 if (frame_info
->sync
.calculated_timestamp_valid
) {
4549 ti
= proto_tree_add_double(ptp_tree
, hf_ptp_v2_analysis_sync_timestamp
, tvb
, 0, 0, nstime_to_sec(&(frame_info
->sync
.calculated_timestamp
)));
4550 proto_item_set_generated(ti
);
4551 proto_tree
*ts_tree
= proto_item_add_subtree(ti
, ett_ptp_analysis_timestamp
);
4552 ti
= proto_tree_add_uint64(ts_tree
, hf_ptp_v2_analysis_sync_timestamp_seconds
, tvb
, 0, 0, frame_info
->sync
.calculated_timestamp
.secs
);
4553 proto_item_set_generated(ti
);
4554 ti
= proto_tree_add_uint(ts_tree
, hf_ptp_v2_analysis_sync_timestamp_nanoseconds
, tvb
, 0, 0, frame_info
->sync
.calculated_timestamp
.nsecs
);
4555 proto_item_set_generated(ti
);
4558 if (frame_info
->sync
.syncRateRatio_valid
) {
4559 ti
= proto_tree_add_double(ptp_tree
, hf_ptp_v2_analysis_sync_rateRatio
, tvb
, 0, 0, frame_info
->sync
.syncRateRatio
);
4560 proto_item_set_generated(ti
);
4561 ti
= proto_tree_add_int(ptp_tree
, hf_ptp_v2_analysis_sync_rateRatio_ppm
, tvb
, 0, 0, frame_info
->sync
.syncRateRatio_ppm
);
4562 proto_item_set_generated(ti
);
4565 ti
= proto_tree_add_uint(ptp_tree
, hf_ptp_v2_analysis_followup_to_sync
, tvb
, 0, 0, frame_info
->sync
.sync_frame_num
);
4566 proto_item_set_generated(ti
);
4568 /* No 2-step Sync found! */
4569 expert_add_info(pinfo
, ti_root
, &ei_ptp_v2_followup_no_sync
);
4577 case PTP_V2_DELAY_RESP_MESSAGE
:{
4578 proto_tree_add_item(ptp_tree
, hf_ptp_v2_dr_receivetimestamp_seconds
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
4581 proto_tree_add_item(ptp_tree
, hf_ptp_v2_dr_receivetimestamp_nanoseconds
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4584 proto_tree_add_item(ptp_tree
, hf_ptp_v2_dr_requestingportidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
4587 proto_tree_add_item(ptp_tree
, hf_ptp_v2_dr_requestingsourceportid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4590 disect_ptp_v2_tlvs(tvb
, offset
, pinfo
, ptp_tree
, ti_root
, ptp_v2_messageid
, ptp_v2_flags
, is_802_1as
);
4595 case PTP_V2_PEER_DELAY_REQ_MESSAGE
:{
4596 /* In 802.1AS there is no origin timestamp in a Pdelay_Req Message */
4598 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdrq_origintimestamp_seconds
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
4601 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdrq_origintimestamp_nanoseconds
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4604 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdrq_reserved
, tvb
, offset
, 10, ENC_NA
);
4607 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdrq_reserved
, tvb
, offset
, 10, ENC_NA
);
4610 disect_ptp_v2_tlvs(tvb
, offset
, pinfo
, ptp_tree
, ti_root
, ptp_v2_messageid
, ptp_v2_flags
, is_802_1as
);
4612 if (ptp_analyze_messages
) {
4613 if (frame_info
!= NULL
) {
4614 if PTP_FRAME_INFO_PDELAY_REQ_SEEN(frame_info
) {
4615 if (frame_info
->pdelay
.pdelayInterval_valid
) {
4616 ti
= proto_tree_add_double(ptp_tree
, hf_ptp_v2_analysis_pdelay_period
, tvb
, 0, 0, frame_info
->pdelay
.pdelayInterval
);
4617 proto_item_append_text(ti
, " %s", "s");
4618 proto_item_set_generated(ti
);
4622 if (frame_info
->pdelay
.pdelay_res_frame_num
!= 0) {
4623 ti
= proto_tree_add_uint(ptp_tree
, hf_ptp_v2_analysis_pdelayreq_to_pdelayres
, tvb
, 0, 0, frame_info
->pdelay
.pdelay_res_frame_num
);
4624 proto_item_set_generated(ti
);
4626 /* No Response found! */
4627 expert_add_info(pinfo
, ti_root
, &ei_ptp_v2_pdreq_no_pdresp
);
4634 case PTP_V2_PEER_DELAY_RESP_MESSAGE
:{
4635 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdrs_requestreceipttimestamp_seconds
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
4638 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4641 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdrs_requestingportidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
4644 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdrs_requestingsourceportid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4647 disect_ptp_v2_tlvs(tvb
, offset
, pinfo
, ptp_tree
, ti_root
, ptp_v2_messageid
, ptp_v2_flags
, is_802_1as
);
4649 if (ptp_analyze_messages
) {
4650 if (frame_info
!= NULL
) {
4651 if (frame_info
->pdelay
.pdelay_req_frame_num
!= 0) {
4652 ti
= proto_tree_add_uint(ptp_tree
, hf_ptp_v2_analysis_pdelayres_to_pdelayreq
, tvb
, 0, 0, frame_info
->pdelay
.pdelay_req_frame_num
);
4653 proto_item_set_generated(ti
);
4655 /* No Request found! */
4656 expert_add_info(pinfo
, ti_root
, &ei_ptp_v2_pdresp_no_pdreq
);
4658 if (frame_info
->pdelay
.pdelay_fup_frame_num
!= 0) {
4659 ti
= proto_tree_add_uint(ptp_tree
, hf_ptp_v2_analysis_pdelayres_to_pdelayfup
, tvb
, 0, 0, frame_info
->pdelay
.pdelay_fup_frame_num
);
4660 proto_item_set_generated(ti
);
4662 /* No Follow Up found! */
4663 expert_add_info(pinfo
, ti_root
, &ei_ptp_v2_pdresp_no_pdfup
);
4665 if (PTP_FRAME_INFO_PDELAY_COMPLETE(frame_info
) && frame_info
->pdelay
.pdelay_res_two_step
== false) {
4666 /* Two step false but follow up received! */
4667 /* According to 802.1AS-2011/2022 2-step must be true on pDelay Req */
4668 expert_add_info(pinfo
, ti_root
, &ei_ptp_v2_pdresp_twostep
);
4675 case PTP_V2_PEER_DELAY_FOLLOWUP_MESSAGE
:{
4676 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdfu_responseorigintimestamp_seconds
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
4679 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4682 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdfu_requestingportidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
4685 proto_tree_add_item(ptp_tree
, hf_ptp_v2_pdfu_requestingsourceportid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4688 disect_ptp_v2_tlvs(tvb
, offset
, pinfo
, ptp_tree
, ti_root
, ptp_v2_messageid
, ptp_v2_flags
, is_802_1as
);
4690 if (ptp_analyze_messages
) {
4691 if (frame_info
!= NULL
) {
4692 if PTP_FRAME_INFO_PDELAY_COMPLETE(frame_info
) {
4693 ti
= proto_tree_add_double(ptp_tree
, hf_ptp_v2_analysis_pdelay_mpd_unscaled
, tvb
, 0, 0, nstime_to_sec(&frame_info
->pdelay
.mean_propagation_delay_unscaled
));
4694 proto_item_set_generated(ti
);
4695 proto_tree
*ts_tree
= proto_item_add_subtree(ti
, ett_ptp_analysis_mean_propagation_delay
);
4696 ti
= proto_tree_add_int64(ts_tree
, hf_ptp_v2_analysis_pdelay_mpd_unscaled_seconds
, tvb
, 0, 0, frame_info
->pdelay
.mean_propagation_delay_unscaled
.secs
);
4697 proto_item_set_generated(ti
);
4698 ti
= proto_tree_add_int(ts_tree
, hf_ptp_v2_analysis_pdelay_mpd_unscaled_nanoseconds
, tvb
, 0, 0, frame_info
->pdelay
.mean_propagation_delay_unscaled
.nsecs
);
4699 proto_item_set_generated(ti
);
4701 if (frame_info
->pdelay
.neighborRateRatio_valid
) {
4702 ti
= proto_tree_add_double(ptp_tree
, hf_ptp_v2_analysis_pdelay_mpd_scaled
, tvb
, 0, 0, frame_info
->pdelay
.mean_propagation_delay_scaled
);
4703 proto_item_set_generated(ti
);
4704 ti
= proto_tree_add_double(ptp_tree
, hf_ptp_v2_analysis_pdelay_neighRateRatio
, tvb
, 0, 0, frame_info
->pdelay
.neighborRateRatio
);
4705 proto_item_set_generated(ti
);
4706 ti
= proto_tree_add_int(ptp_tree
, hf_ptp_v2_analysis_pdelay_neighRateRatio_ppm
, tvb
, 0, 0, frame_info
->pdelay
.neighborRateRatio_ppm
);
4707 proto_item_set_generated(ti
);
4711 if (frame_info
->pdelay
.pdelay_res_frame_num
!= 0) {
4712 ti
= proto_tree_add_uint(ptp_tree
, hf_ptp_v2_analysis_pdelayfup_to_pdelayres
, tvb
, 0, 0, frame_info
->pdelay
.pdelay_res_frame_num
);
4713 proto_item_set_generated(ti
);
4715 /* No Response found! */
4716 expert_add_info(pinfo
, ti_root
, &ei_ptp_v2_pdfup_no_pdresp
);
4723 case PTP_V2_SIGNALING_MESSAGE
:{
4724 proto_tree_add_item(ptp_tree
, hf_ptp_v2_sig_targetportidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
4727 proto_tree_add_item(ptp_tree
, hf_ptp_v2_sig_targetportid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4730 disect_ptp_v2_tlvs(tvb
, offset
, pinfo
, ptp_tree
, ti_root
, ptp_v2_messageid
, ptp_v2_flags
, is_802_1as
);
4735 case PTP_V2_MANAGEMENT_MESSAGE
: {
4736 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_targetportidentity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
4739 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_targetportid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4742 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_startingboundaryhops
, tvb
, offset
, 1, ENC_NA
);
4745 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_boundaryhops
, tvb
, offset
, 1, ENC_NA
);
4748 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_reserved1
, tvb
, offset
, 1, ENC_NA
);
4749 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_action
, tvb
, offset
, 1, ENC_NA
);
4752 proto_tree_add_item(ptp_tree
, hf_ptp_v2_mm_reserved2
, tvb
, offset
, 1, ENC_NA
);
4755 disect_ptp_v2_tlvs(tvb
, offset
, pinfo
, ptp_tree
, ti_root
, ptp_v2_messageid
, ptp_v2_flags
, is_802_1as
);
4758 } /* case Management Message */
4759 } /* switch message ID */
4764 /* Register the protocol with Wireshark */
4767 proto_register_ptp(void) {
4768 static hf_register_info hf
[] = {
4769 /* PTPv1 fields **********************************************************/
4770 /* Common fields for all frames */
4771 { &hf_ptp_versionptp
,
4772 { "versionPTP", "ptp.versionptp",
4773 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
4776 { &hf_ptp_versionnetwork
,
4777 { "versionNetwork", "ptp.versionnetwork",
4778 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
4781 { &hf_ptp_subdomain
,
4782 { "subdomain", "ptp.subdomain",
4783 FT_STRING
, BASE_NONE
, NULL
, 0x00,
4786 { &hf_ptp_messagetype
,
4787 { "messageType", "ptp.messagetype",
4788 FT_UINT8
, BASE_DEC
, VALS(ptp_messagetype_vals
), 0x00,
4791 { &hf_ptp_sourcecommunicationtechnology
,
4792 { "sourceCommunicationTechnology", "ptp.sourcecommunicationtechnology",
4793 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
4796 { &hf_ptp_sourceuuid
,
4797 { "sourceUuid", "ptp.sourceuuid",
4798 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
4801 { &hf_ptp_sourceportid
,
4802 { "sourcePortId", "ptp.sourceportid",
4803 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
4806 { &hf_ptp_sequenceid
,
4807 { "sequenceId", "ptp.sequenceid",
4808 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
4811 { &hf_ptp_controlfield
,
4812 { "controlField", "ptp.controlfield",
4813 FT_UINT8
, BASE_DEC
, VALS(ptp_controlfield_vals
), 0x00,
4816 /* THE FLAGS-FIELD */
4818 { "flags", "ptp.flags",
4819 FT_UINT16
, BASE_HEX
, NULL
, 0x00,
4822 { &hf_ptp_flags_li61
,
4823 { "PTP_LI61", "ptp.flags.li61",
4824 FT_BOOLEAN
, 16, NULL
, PTP_FLAGS_LI61_BITMASK
,
4827 { &hf_ptp_flags_li59
,
4828 { "PTP_LI59", "ptp.flags.li59",
4829 FT_BOOLEAN
, 16, NULL
, PTP_FLAGS_LI59_BITMASK
,
4832 { &hf_ptp_flags_boundary_clock
,
4833 { "PTP_BOUNDARY_CLOCK", "ptp.flags.boundary_clock",
4834 FT_BOOLEAN
, 16, NULL
, PTP_FLAGS_BOUNDARY_CLOCK_BITMASK
,
4837 { &hf_ptp_flags_assist
,
4838 { "PTP_ASSIST", "ptp.flags.assist",
4839 FT_BOOLEAN
, 16, NULL
, PTP_FLAGS_ASSIST_BITMASK
,
4842 { &hf_ptp_flags_ext_sync
,
4843 { "PTP_EXT_SYNC", "ptp.flags.ext_sync",
4844 FT_BOOLEAN
, 16, NULL
, PTP_FLAGS_EXT_SYNC_BITMASK
,
4847 { &hf_ptp_flags_parent
,
4848 { "PTP_PARENT_STATS", "ptp.flags.parent_stats",
4849 FT_BOOLEAN
, 16, NULL
, PTP_FLAGS_PARENT_STATS_BITMASK
,
4852 { &hf_ptp_flags_sync_burst
,
4853 { "PTP_SYNC_BURST", "ptp.flags.sync_burst",
4854 FT_BOOLEAN
, 16, NULL
, PTP_FLAGS_SYNC_BURST_BITMASK
,
4857 /* END OF THE FLAG-FIELD */
4859 /* offsets for ptp_sync and delay_req (=sdr) messages */
4860 { &hf_ptp_sdr_origintimestamp
,
4861 { "originTimestamp", "ptp.sdr.origintimestamp",
4862 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
4865 { &hf_ptp_sdr_origintimestamp_seconds
,
4866 { "originTimestamp (seconds)", "ptp.sdr.origintimestamp_seconds",
4867 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
4870 { &hf_ptp_sdr_origintimestamp_nanoseconds
,
4871 { "originTimestamp (nanoseconds)", "ptp.sdr.origintimestamp_nanoseconds",
4872 FT_INT32
, BASE_DEC
, NULL
, 0x00,
4875 { &hf_ptp_sdr_epochnumber
,
4876 { "epochNumber", "ptp.sdr.epochnumber",
4877 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
4880 { &hf_ptp_sdr_currentutcoffset
,
4881 { "currentUTCOffset", "ptp.sdr.currentutcoffset",
4882 FT_INT16
, BASE_DEC
, NULL
, 0x00,
4885 { &hf_ptp_sdr_grandmastercommunicationtechnology
,
4886 { "grandmasterCommunicationTechnology", "ptp.sdr.grandmastercommunicationtechnology",
4887 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
4890 { &hf_ptp_sdr_grandmasterclockuuid
,
4891 { "grandMasterClockUuid", "ptp.sdr.grandmasterclockuuid",
4892 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
4895 { &hf_ptp_sdr_grandmasterportid
,
4896 { "grandmasterPortId", "ptp.sdr.grandmasterportid",
4897 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
4900 { &hf_ptp_sdr_grandmastersequenceid
,
4901 { "grandmasterSequenceId", "ptp.sdr.grandmastersequenceid",
4902 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
4905 { &hf_ptp_sdr_grandmasterclockstratum
,
4906 { "grandmasterClockStratum", "ptp.sdr.grandmasterclockstratum",
4907 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
4910 { &hf_ptp_sdr_grandmasterclockidentifier
,
4911 { "grandmasterClockIdentifier", "ptp.sdr.grandmasterclockidentifier",
4912 FT_STRING
, BASE_NONE
, NULL
, 0x00,
4915 { &hf_ptp_sdr_grandmasterclockvariance
,
4916 { "grandmasterClockVariance", "ptp.sdr.grandmasterclockvariance",
4917 FT_INT16
, BASE_DEC
, NULL
, 0x00,
4920 { &hf_ptp_sdr_grandmasterpreferred
,
4921 { "grandmasterPreferred", "ptp.sdr.grandmasterpreferred",
4922 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
4925 { &hf_ptp_sdr_grandmasterisboundaryclock
,
4926 { "grandmasterIsBoundaryClock", "ptp.sdr.grandmasterisboundaryclock",
4927 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
4930 { &hf_ptp_sdr_syncinterval
,
4931 { "syncInterval", "ptp.sdr.syncinterval",
4932 FT_INT8
, BASE_DEC
, NULL
, 0x00,
4935 { &hf_ptp_sdr_localclockvariance
,
4936 { "localClockVariance", "ptp.sdr.localclockvariance",
4937 FT_INT16
, BASE_DEC
, NULL
, 0x00,
4940 { &hf_ptp_sdr_localstepsremoved
,
4941 { "localStepsRemoved", "ptp.sdr.localstepsremoved",
4942 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
4945 { &hf_ptp_sdr_localclockstratum
,
4946 { "localClockStratum", "ptp.sdr.localclockstratum",
4947 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
4950 { &hf_ptp_sdr_localclockidentifier
,
4951 { "localClockIdentifier", "ptp.sdr.localclockidentifier",
4952 FT_STRING
, BASE_NONE
, NULL
, 0x00,
4955 { &hf_ptp_sdr_parentcommunicationtechnology
,
4956 { "parentCommunicationTechnology", "ptp.sdr.parentcommunicationtechnology",
4957 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
4960 { &hf_ptp_sdr_parentuuid
,
4961 { "parentUuid", "ptp.sdr.parentuuid",
4962 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
4965 { &hf_ptp_sdr_parentportfield
,
4966 { "parentPortField", "ptp.sdr.parentportfield",
4967 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
4970 { &hf_ptp_sdr_estimatedmastervariance
,
4971 { "estimatedMasterVariance", "ptp.sdr.estimatedmastervariance",
4972 FT_INT16
, BASE_DEC
, NULL
, 0x00,
4975 { &hf_ptp_sdr_estimatedmasterdrift
,
4976 { "estimatedMasterDrift", "ptp.sdr.estimatedmasterdrift",
4977 FT_INT32
, BASE_DEC
, NULL
, 0x00,
4980 { &hf_ptp_sdr_utcreasonable
,
4981 { "utcReasonable", "ptp.sdr.utcreasonable",
4982 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
4985 /* offsets for follow_up (=fu) messages */
4986 { &hf_ptp_fu_associatedsequenceid
,
4987 { "associatedSequenceId", "ptp.fu.associatedsequenceid",
4988 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
4991 { &hf_ptp_fu_preciseorigintimestamp
,
4992 { "preciseOriginTimestamp", "ptp.fu.preciseorigintimestamp",
4993 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
4996 { &hf_ptp_fu_preciseorigintimestamp_seconds
,
4997 { "preciseOriginTimestamp (seconds)", "ptp.fu.preciseorigintimestamp_seconds",
4998 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5001 { &hf_ptp_fu_preciseorigintimestamp_nanoseconds
,
5002 { "preciseOriginTimestamp (nanoseconds)", "ptp.fu.preciseorigintimestamp_nanoseconds",
5003 FT_INT32
, BASE_DEC
, NULL
, 0x00,
5006 /* offsets for delay_resp (=dr) messages */
5007 { &hf_ptp_dr_delayreceipttimestamp
,
5008 { "delayReceiptTimestamp", "ptp.dr.delayreceipttimestamp",
5009 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
5012 { &hf_ptp_dr_delayreceipttimestamp_seconds
,
5013 { "delayReceiptTimestamp (Seconds)", "ptp.dr.delayreceipttimestamp_seconds",
5014 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5017 { &hf_ptp_dr_delayreceipttimestamp_nanoseconds
,
5018 { "delayReceiptTimestamp (nanoseconds)", "ptp.dr.delayreceipttimestamp_nanoseconds",
5019 FT_INT32
, BASE_DEC
, NULL
, 0x00,
5022 { &hf_ptp_dr_requestingsourcecommunicationtechnology
,
5023 { "requestingSourceCommunicationTechnology", "ptp.dr.requestingsourcecommunicationtechnology",
5024 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
5027 { &hf_ptp_dr_requestingsourceuuid
,
5028 { "requestingSourceUuid", "ptp.dr.requestingsourceuuid",
5029 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
5032 { &hf_ptp_dr_requestingsourceportid
,
5033 { "requestingSourcePortId", "ptp.dr.requestingsourceportid",
5034 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5037 { &hf_ptp_dr_requestingsourcesequenceid
,
5038 { "requestingSourceSequenceId", "ptp.dr.requestingsourcesequenceid",
5039 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5042 /* offsets for management (=mm) messages */
5043 { &hf_ptp_mm_targetcommunicationtechnology
,
5044 { "targetCommunicationTechnology", "ptp.mm.targetcommunicationtechnology",
5045 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
5048 { &hf_ptp_mm_targetuuid
,
5049 { "targetUuid", "ptp.mm.targetuuid",
5050 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
5053 { &hf_ptp_mm_targetportid
,
5054 { "targetPortId", "ptp.mm.targetportid",
5055 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5058 { &hf_ptp_mm_startingboundaryhops
,
5059 { "startingBoundaryHops", "ptp.mm.startingboundaryhops",
5060 FT_INT16
, BASE_DEC
, NULL
, 0x00,
5063 { &hf_ptp_mm_boundaryhops
,
5064 { "boundaryHops", "ptp.mm.boundaryhops",
5065 FT_INT16
, BASE_DEC
, NULL
, 0x00,
5068 { &hf_ptp_mm_managementmessagekey
,
5069 { "managementMessageKey", "ptp.mm.managementmessagekey",
5070 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_managementMessageKey_vals_ext
, 0x00,
5073 { &hf_ptp_mm_parameterlength
,
5074 { "parameterLength", "ptp.mm.parameterlength",
5075 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5078 /* parameterlength > 0 */
5080 { &hf_ptp_mm_messageparameters
,
5081 { "messageParameters", "ptp.mm.messageparameters",
5082 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5086 /* ptp_mm_clock_identity (parameterlength = 64) */
5087 { &hf_ptp_mm_clock_identity_clockcommunicationtechnology
,
5088 { "clockCommunicationTechnology", "ptp.mm.clock.identity.clockcommunicationtechnology",
5089 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
5092 { &hf_ptp_mm_clock_identity_clockuuidfield
,
5093 { "clockUuidField", "ptp.mm.clock.identity.clockuuidfield",
5094 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
5097 { &hf_ptp_mm_clock_identity_clockportfield
,
5098 { "clockPortField", "ptp.mm.clock.identity.clockportfield",
5099 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5102 { &hf_ptp_mm_clock_identity_manufactureridentity
,
5103 { "manufacturerIdentity", "ptp.mm.clock.identity.manufactureridentity",
5104 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5108 /* ptp_mm_initialize_clock (parameterlength = 4) */
5109 { &hf_ptp_mm_initialize_clock_initialisationkey
,
5110 { "initialisationKey", "ptp.mm.initialize.clock.initialisationkey",
5111 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5114 /* ptp_mm_set_subdomain (parameterlength = 16) */
5115 { &hf_ptp_mm_set_subdomain_subdomainname
,
5116 { "subdomainName", "ptp.mm.set.subdomain.subdomainname",
5117 FT_STRING
, BASE_NONE
, NULL
, 0x00,
5120 /* ptp_mm_default_data_set (parameterlength = 76) */
5121 { &hf_ptp_mm_default_data_set_clockcommunicationtechnology
,
5122 { "clockCommunicationTechnology", "ptp.mm.default.data.set.clockcommunicationtechnology",
5123 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
5126 { &hf_ptp_mm_default_data_set_clockuuidfield
,
5127 { "clockUuidField", "ptp.mm.default.data.set.clockuuidfield",
5128 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
5131 { &hf_ptp_mm_default_data_set_clockportfield
,
5132 { "clockPortField", "ptp.mm.default.data.set.clockportfield",
5133 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5136 { &hf_ptp_mm_default_data_set_clockstratum
,
5137 { "clockStratum", "ptp.mm.default.data.set.clockstratum",
5138 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5141 { &hf_ptp_mm_default_data_set_clockidentifier
,
5142 { "clockIdentifier", "ptp.mm.default.data.set.clockidentifier",
5143 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5146 { &hf_ptp_mm_default_data_set_clockvariance
,
5147 { "clockVariance", "ptp.mm.default.data.set.clockvariance",
5148 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5151 { &hf_ptp_mm_default_data_set_clockfollowupcapable
,
5152 { "clockFollowupCapable", "ptp.mm.default.data.set.clockfollowupcapable",
5153 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5156 { &hf_ptp_mm_default_data_set_preferred
,
5157 { "preferred", "ptp.mm.default.data.set.preferred",
5158 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5161 { &hf_ptp_mm_default_data_set_initializable
,
5162 { "initializable", "ptp.mm.default.data.set.initializable",
5163 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5166 { &hf_ptp_mm_default_data_set_externaltiming
,
5167 { "externalTiming", "ptp.mm.default.data.set.externaltiming",
5168 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5171 { &hf_ptp_mm_default_data_set_isboundaryclock
,
5172 { "isBoundaryClock", "ptp.mm.default.data.set.isboundaryclock",
5173 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5176 { &hf_ptp_mm_default_data_set_syncinterval
,
5177 { "syncInterval", "ptp.mm.default.data.set.syncinterval",
5178 FT_INT8
, BASE_DEC
, NULL
, 0x00,
5181 { &hf_ptp_mm_default_data_set_subdomainname
,
5182 { "subDomainName", "ptp.mm.default.data.set.subdomainname",
5183 FT_STRING
, BASE_NONE
, NULL
, 0x00,
5186 { &hf_ptp_mm_default_data_set_numberports
,
5187 { "numberPorts", "ptp.mm.default.data.set.numberports",
5188 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5191 { &hf_ptp_mm_default_data_set_numberforeignrecords
,
5192 { "numberForeignRecords", "ptp.mm.default.data.set.numberforeignrecords",
5193 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5196 /* ptp_mm_update_default_data_set (parameterlength = 36) */
5197 { &hf_ptp_mm_update_default_data_set_clockstratum
,
5198 { "clockStratum", "ptp.mm.update.default.data.set.clockstratum",
5199 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5202 { &hf_ptp_mm_update_default_data_set_clockidentifier
,
5203 { "clockIdentifier", "ptp.mm.update.default.data.set.clockidentifier",
5204 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5207 { &hf_ptp_mm_update_default_data_set_clockvariance
,
5208 { "clockVariance", "ptp.mm.update.default.data.set.clockvariance",
5209 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5212 { &hf_ptp_mm_update_default_data_set_preferred
,
5213 { "preferred", "ptp.mm.update.default.data.set.preferred",
5214 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5217 { &hf_ptp_mm_update_default_data_set_syncinterval
,
5218 { "syncInterval", "ptp.mm.update.default.data.set.syncinterval",
5219 FT_INT8
, BASE_DEC
, NULL
, 0x00,
5222 { &hf_ptp_mm_update_default_data_set_subdomainname
,
5223 { "subdomainName", "ptp.mm.update.default.data.set.subdomainname",
5224 FT_STRING
, BASE_NONE
, NULL
, 0x00,
5227 /* ptp_mm_current_data_set (parameterlength = 20) */
5228 { &hf_ptp_mm_current_data_set_stepsremoved
,
5229 { "stepsRemoved", "ptp.mm.current.data.set.stepsremoved",
5230 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5233 { &hf_ptp_mm_current_data_set_offsetfrommaster
,
5234 { "offsetFromMaster", "ptp.mm.current.data.set.offsetfrommaster",
5235 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
5238 { &hf_ptp_mm_current_data_set_offsetfrommasterseconds
,
5239 { "offsetFromMasterSeconds", "ptp.mm.current.data.set.offsetfrommasterseconds",
5240 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5243 { &hf_ptp_mm_current_data_set_offsetfrommasternanoseconds
,
5244 { "offsetFromMasterNanoseconds", "ptp.mm.current.data.set.offsetfrommasternanoseconds",
5245 FT_INT32
, BASE_DEC
, NULL
, 0x00,
5248 { &hf_ptp_mm_current_data_set_onewaydelay
,
5249 { "oneWayDelay", "ptp.mm.current.data.set.onewaydelay",
5250 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
5253 { &hf_ptp_mm_current_data_set_onewaydelayseconds
,
5254 { "oneWayDelaySeconds", "ptp.mm.current.data.set.onewaydelayseconds",
5255 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5258 { &hf_ptp_mm_current_data_set_onewaydelaynanoseconds
,
5259 { "oneWayDelayNanoseconds", "ptp.mm.current.data.set.onewaydelaynanoseconds",
5260 FT_INT32
, BASE_DEC
, NULL
, 0x00,
5263 /* ptp_mm_parent_data_set (parameterlength = 90) */
5264 { &hf_ptp_mm_parent_data_set_parentcommunicationtechnology
,
5265 { "parentCommunicationTechnology", "ptp.mm.parent.data.set.parentcommunicationtechnology",
5266 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
5269 { &hf_ptp_mm_parent_data_set_parentuuid
,
5270 { "parentUuid", "ptp.mm.parent.data.set.parentuuid",
5271 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
5274 { &hf_ptp_mm_parent_data_set_parentportid
,
5275 { "parentPortId", "ptp.mm.parent.data.set.parentportid",
5276 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5279 { &hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber
,
5280 { "parentLastSyncSequenceNumber", "ptp.mm.parent.data.set.parentlastsyncsequencenumber",
5281 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5284 { &hf_ptp_mm_parent_data_set_parentfollowupcapable
,
5285 { "parentFollowupCapable", "ptp.mm.parent.data.set.parentfollowupcapable",
5286 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5289 { &hf_ptp_mm_parent_data_set_parentexternaltiming
,
5290 { "parentExternalTiming", "ptp.mm.parent.data.set.parentexternaltiming",
5291 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5294 { &hf_ptp_mm_parent_data_set_parentvariance
,
5295 { "parentVariance", "ptp.mm.parent.data.set.parentvariance",
5296 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5299 { &hf_ptp_mm_parent_data_set_parentstats
,
5300 { "parentStats", "ptp.mm.parent.data.set.parentstats",
5301 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5304 { &hf_ptp_mm_parent_data_set_observedvariance
,
5305 { "observedVariance", "ptp.mm.parent.data.set.observedvariance",
5306 FT_INT16
, BASE_DEC
, NULL
, 0x00,
5309 { &hf_ptp_mm_parent_data_set_observeddrift
,
5310 { "observedDrift", "ptp.mm.parent.data.set.observeddrift",
5311 FT_INT32
, BASE_DEC
, NULL
, 0x00,
5314 { &hf_ptp_mm_parent_data_set_utcreasonable
,
5315 { "utcReasonable", "ptp.mm.parent.data.set.utcreasonable",
5316 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5319 { &hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology
,
5320 { "grandmasterCommunicationTechnology", "ptp.mm.parent.data.set.grandmastercommunicationtechnology",
5321 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
5324 { &hf_ptp_mm_parent_data_set_grandmasteruuidfield
,
5325 { "grandmasterUuidField", "ptp.mm.parent.data.set.grandmasteruuidfield",
5326 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
5329 { &hf_ptp_mm_parent_data_set_grandmasterportidfield
,
5330 { "grandmasterPortIdField", "ptp.mm.parent.data.set.grandmasterportidfield",
5331 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5334 { &hf_ptp_mm_parent_data_set_grandmasterstratum
,
5335 { "grandmasterStratum", "ptp.mm.parent.data.set.grandmasterstratum",
5336 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5339 { &hf_ptp_mm_parent_data_set_grandmasteridentifier
,
5340 { "grandmasterIdentifier", "ptp.mm.parent.data.set.grandmasteridentifier",
5341 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5344 { &hf_ptp_mm_parent_data_set_grandmastervariance
,
5345 { "grandmasterVariance", "ptp.mm.parent.data.set.grandmastervariance",
5346 FT_INT16
, BASE_DEC
, NULL
, 0x00,
5349 { &hf_ptp_mm_parent_data_set_grandmasterpreferred
,
5350 { "grandmasterPreferred", "ptp.mm.parent.data.set.grandmasterpreferred",
5351 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5354 { &hf_ptp_mm_parent_data_set_grandmasterisboundaryclock
,
5355 { "grandmasterIsBoundaryClock", "ptp.mm.parent.data.set.grandmasterisboundaryclock",
5356 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5359 { &hf_ptp_mm_parent_data_set_grandmastersequencenumber
,
5360 { "grandmasterSequenceNumber", "ptp.mm.parent.data.set.grandmastersequencenumber",
5361 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5364 /* ptp_mm_port_data_set (parameterlength = 52) */
5365 { &hf_ptp_mm_port_data_set_returnedportnumber
,
5366 { "returnedPortNumber", "ptp.mm.port.data.set.returnedportnumber",
5367 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5370 { &hf_ptp_mm_port_data_set_portstate
,
5371 { "portState", "ptp.mm.port.data.set.portstate",
5372 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5375 { &hf_ptp_mm_port_data_set_lastsynceventsequencenumber
,
5376 { "lastSyncEventSequenceNumber", "ptp.mm.port.data.set.lastsynceventsequencenumber",
5377 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5380 { &hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber
,
5381 { "lastGeneralEventSequenceNumber", "ptp.mm.port.data.set.lastgeneraleventsequencenumber",
5382 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5385 { &hf_ptp_mm_port_data_set_portcommunicationtechnology
,
5386 { "portCommunicationTechnology", "ptp.mm.port.data.set.portcommunicationtechnology",
5387 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
5390 { &hf_ptp_mm_port_data_set_portuuidfield
,
5391 { "portUuidField", "ptp.mm.port.data.set.portuuidfield",
5392 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
5395 { &hf_ptp_mm_port_data_set_portidfield
,
5396 { "portIdField", "ptp.mm.port.data.set.portidfield",
5397 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5400 { &hf_ptp_mm_port_data_set_burstenabled
,
5401 { "burstEnabled", "ptp.mm.port.data.set.burstenabled",
5402 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5405 { &hf_ptp_mm_port_data_set_subdomainaddressoctets
,
5406 { "subdomainAddressOctets", "ptp.mm.port.data.set.subdomainaddressoctets",
5407 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5410 { &hf_ptp_mm_port_data_set_eventportaddressoctets
,
5411 { "eventPortAddressOctets", "ptp.mm.port.data.set.eventportaddressoctets",
5412 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5415 { &hf_ptp_mm_port_data_set_generalportaddressoctets
,
5416 { "generalPortAddressOctets", "ptp.mm.port.data.set.generalportaddressoctets",
5417 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5420 { &hf_ptp_mm_port_data_set_subdomainaddress
,
5421 { "subdomainAddress", "ptp.mm.port.data.set.subdomainaddress",
5422 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5425 { &hf_ptp_mm_port_data_set_eventportaddress
,
5426 { "eventPortAddress", "ptp.mm.port.data.set.eventportaddress",
5427 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5430 { &hf_ptp_mm_port_data_set_generalportaddress
,
5431 { "generalPortAddress", "ptp.mm.port.data.set.generalportaddress",
5432 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5435 /* ptp_mm_global_time_data_set (parameterlength = 24) */
5436 { &hf_ptp_mm_global_time_data_set_localtime
,
5437 { "localTime", "ptp.mm.global.time.data.set.localtime",
5438 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
5441 { &hf_ptp_mm_global_time_data_set_localtimeseconds
,
5442 { "localTimeSeconds", "ptp.mm.global.time.data.set.localtimeseconds",
5443 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5446 { &hf_ptp_mm_global_time_data_set_localtimenanoseconds
,
5447 { "localTimeNanoseconds", "ptp.mm.global.time.data.set.localtimenanoseconds",
5448 FT_INT32
, BASE_DEC
, NULL
, 0x00,
5451 { &hf_ptp_mm_global_time_data_set_currentutcoffset
,
5452 { "currentUtcOffset", "ptp.mm.global.time.data.set.currentutcoffset",
5453 FT_INT16
, BASE_DEC
, NULL
, 0x00,
5456 { &hf_ptp_mm_global_time_data_set_leap59
,
5457 { "leap59", "ptp.mm.global.time.data.set.leap59",
5458 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5461 { &hf_ptp_mm_global_time_data_set_leap61
,
5462 { "leap61", "ptp.mm.global.time.data.set.leap61",
5463 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5466 { &hf_ptp_mm_global_time_data_set_epochnumber
,
5467 { "epochNumber", "ptp.mm.global.time.data.set.epochnumber",
5468 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5471 /* ptp_mm_update_global_time_properties (parameterlength = 16) */
5472 { &hf_ptp_mm_update_global_time_properties_currentutcoffset
,
5473 { "currentUtcOffset", "ptp.mm.update.global.time.properties.currentutcoffset",
5474 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5477 { &hf_ptp_mm_update_global_time_properties_leap59
,
5478 { "leap59", "ptp.mm.update.global.time.properties.leap59",
5479 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5482 { &hf_ptp_mm_update_global_time_properties_leap61
,
5483 { "leap61", "ptp.mm.update.global.time.properties.leap61",
5484 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
5488 { &hf_ptp_mm_update_global_time_properties_epochnumber
,
5489 { "epochNumber", "ptp.mm.update.global.time.properties.epochnumber",
5490 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5494 /* ptp_mm_get_foreign_data_set (parameterlength = 4) */
5495 { &hf_ptp_mm_get_foreign_data_set_recordkey
,
5496 { "recordKey", "ptp.mm.get.foreign.data.set.recordkey",
5497 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5500 /* ptp_mm_foreign_data_set (parameterlength = 28) */
5501 { &hf_ptp_mm_foreign_data_set_returnedportnumber
,
5502 { "returnedPortNumber", "ptp.mm.foreign.data.set.returnedportnumber",
5503 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5506 { &hf_ptp_mm_foreign_data_set_returnedrecordnumber
,
5507 { "returnedRecordNumber", "ptp.mm.foreign.data.set.returnedrecordnumber",
5508 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5511 { &hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology
,
5512 { "foreignMasterCommunicationTechnology",
5513 "ptp.mm.foreign.data.set.foreignmastercommunicationtechnology",
5514 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_communicationid_vals_ext
, 0x00,
5517 { &hf_ptp_mm_foreign_data_set_foreignmasteruuidfield
,
5518 { "foreignMasterUuidField", "ptp.mm.foreign.data.set.foreignmasteruuidfield",
5519 FT_ETHER
, BASE_NONE
, NULL
, 0x00,
5522 { &hf_ptp_mm_foreign_data_set_foreignmasterportidfield
,
5523 { "foreignMasterPortIdField", "ptp.mm.foreign.data.set.foreignmasterportidfield",
5524 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5527 { &hf_ptp_mm_foreign_data_set_foreignmastersyncs
,
5528 { "foreignMasterSyncs", "ptp.mm.foreign.data.set.foreignmastersyncs",
5529 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5532 /* ptp_mm_set_sync_interval (parameterlength = 4) */
5533 { &hf_ptp_mm_set_sync_interval_syncinterval
,
5534 { "syncInterval", "ptp.mm.set.sync.interval.syncinterval",
5535 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5538 /* ptp_mm_set_time (parameterlength = 8) */
5539 { &hf_ptp_mm_set_time_localtime
,
5540 { "localtime", "ptp.mm.set.time.localtime",
5541 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
5544 { &hf_ptp_mm_set_time_localtimeseconds
,
5545 { "localtimeSeconds", "ptp.mm.set.time.localtimeseconds",
5546 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5549 { &hf_ptp_mm_set_time_localtimenanoseconds
,
5550 { "localTimeNanoseconds", "ptp.mm.set.time.localtimenanoseconds",
5551 FT_INT32
, BASE_DEC
, NULL
, 0x0,
5558 /* PTPv2 fields **********************************************************/
5559 /* Common fields for all frames */
5560 { &hf_ptp_v2_majorsdoid
,
5561 { "majorSdoId", "ptp.v2.majorsdoid",
5562 FT_UINT8
, BASE_HEX
, VALS(ptpv2_majorsdoid_vals
), 0xF0,
5565 { &hf_ptp_v2_messagetype
,
5566 { "messageType", "ptp.v2.messagetype",
5567 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, & ptp_v2_messagetype_vals_ext
, 0x0F,
5570 { &hf_ptp_v2_minorversionptp
,
5571 { "minorVersionPTP", "ptp.v2.minorversionptp",
5572 FT_UINT8
, BASE_DEC
, NULL
, 0xF0,
5575 { &hf_ptp_v2_versionptp
,
5576 { "versionPTP", "ptp.v2.versionptp",
5577 FT_UINT8
, BASE_DEC
, NULL
, 0x0F,
5580 { &hf_ptp_v2_messagelength
,
5581 { "messageLength", "ptp.v2.messagelength",
5582 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5585 { &hf_ptp_v2_minorsdoid
,
5586 { "minorSdoId", "ptp.v2.minorsdoid",
5587 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5590 { &hf_ptp_v2_domainnumber
,
5591 { "domainNumber", "ptp.v2.domainnumber",
5592 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5596 { "flags", "ptp.v2.flags",
5597 FT_UINT16
, BASE_HEX
, NULL
, 0x00,
5600 { &hf_ptp_v2_flags_alternatemaster
,
5601 { "PTP_ALTERNATE_MASTER", "ptp.v2.flags.alternatemaster",
5602 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_ALTERNATE_BITMASK
,
5605 { &hf_ptp_v2_flags_twostep
,
5606 { "PTP_TWO_STEP", "ptp.v2.flags.twostep",
5607 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_TWO_STEP_BITMASK
,
5610 { &hf_ptp_v2_flags_unicast
,
5611 { "PTP_UNICAST", "ptp.v2.flags.unicast",
5612 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_UNICAST_BITMASK
,
5615 { &hf_ptp_v2_flags_specific1
,
5616 { "PTP profile Specific 1", "ptp.v2.flags.specific1",
5617 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_SPECIFIC1_BITMASK
,
5620 { &hf_ptp_v2_flags_specific2
,
5621 { "PTP profile Specific 2", "ptp.v2.flags.specific2",
5622 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_SPECIFIC2_BITMASK
,
5625 { &hf_ptp_v2_flags_security
,
5626 { "PTP_SECURITY", "ptp.v2.flags.security",
5627 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_SECURITY_BITMASK
,
5630 { &hf_ptp_v2_flags_li61
,
5631 { "PTP_LI_61", "ptp.v2.flags.li61",
5632 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_LI61_BITMASK
,
5635 { &hf_ptp_v2_flags_li59
,
5636 { "PTP_LI_59", "ptp.v2.flags.li59",
5637 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_LI59_BITMASK
,
5640 { &hf_ptp_v2_flags_utcoffsetvalid
,
5641 { "PTP_UTC_REASONABLE", "ptp.v2.flags.utcreasonable",
5642 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_UTC_OFFSET_VALID_BITMASK
,
5645 { &hf_ptp_v2_flags_ptptimescale
,
5646 { "PTP_TIMESCALE", "ptp.v2.flags.timescale",
5647 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_PTP_TIMESCALE_BITMASK
,
5650 { &hf_ptp_v2_flags_timetraceable
,
5651 { "TIME_TRACEABLE", "ptp.v2.flags.timetraceable",
5652 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_TIME_TRACEABLE_BITMASK
,
5655 { &hf_ptp_v2_flags_frequencytraceable
,
5656 { "FREQUENCY_TRACEABLE", "ptp.v2.flags.frequencytraceable",
5657 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK
,
5660 { &hf_ptp_v2_flags_synchronizationUncertain
,
5661 { "SYNCHRONIZATION_UNCERTAIN", "ptp.v2.flags.synchronizationUncertain",
5662 FT_BOOLEAN
, 16, NULL
, PTP_V2_FLAGS_SYNCHRONIZATION_UNCERTAIN_BITMASK
,
5665 { &hf_ptp_v2_messagetypespecific
,
5666 { "messageTypeSpecific", "ptp.v2.messagetypespecific",
5667 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5670 { &hf_ptp_v2_correction
,
5671 { "correctionNs", "ptp.v2.correction.ns",
5672 FT_INT64
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
5675 { &hf_ptp_v2_correctionsubns
,
5676 { "correctionSubNs", "ptp.v2.correction.subns",
5677 FT_DOUBLE
, BASE_NONE
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
5680 { &hf_ptp_v2_clockidentity
,
5681 { "ClockIdentity", "ptp.v2.clockidentity",
5682 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
5685 { &hf_ptp_v2_clockidentity_manuf
,
5686 { "MAC Vendor", "ptp.v2.clockidentity_manuf",
5687 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5690 { &hf_ptp_v2_sourceportid
,
5691 { "SourcePortID", "ptp.v2.sourceportid",
5692 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5695 { &hf_ptp_v2_sequenceid
,
5696 { "sequenceId", "ptp.v2.sequenceid",
5697 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5700 { &hf_ptp_v2_controlfield_default
,
5701 { "controlField", "ptp.v2.controlfield",
5702 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5705 { &hf_ptp_v2_controlfield
,
5706 { "controlField", "ptp.v2.controlfield",
5707 FT_UINT8
, BASE_DEC
, VALS(ptp_controlfield_vals
), 0x00,
5710 { &hf_ptp_v2_logmessageperiod
,
5711 { "logMessagePeriod", "ptp.v2.logmessageperiod",
5712 FT_INT8
, BASE_DEC
, NULL
, 0x00,
5716 /* Fields for PTP_Announce (=an) messages */
5717 { &hf_ptp_v2_an_reserved1
,
5718 { "reserved", "ptp.v2.an.reserved1",
5719 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5722 { &hf_ptp_v2_an_reserved2
,
5723 { "reserved", "ptp.v2.an.reserved2",
5724 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5728 { &hf_ptp_v2_an_origintimestamp
,
5729 { "originTimestamp", "ptp.v2.an.origintimestamp",
5730 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
5734 { &hf_ptp_v2_an_origintimestamp_seconds
,
5735 { "originTimestamp (seconds)", "ptp.v2.an.origintimestamp.seconds",
5736 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
5739 { &hf_ptp_v2_an_origintimestamp_nanoseconds
,
5740 { "originTimestamp (nanoseconds)", "ptp.v2.an.origintimestamp.nanoseconds",
5741 FT_INT32
, BASE_DEC
, NULL
, 0x00,
5744 { &hf_ptp_v2_an_origincurrentutcoffset
,
5745 { "originCurrentUTCOffset", "ptp.v2.an.origincurrentutcoffset",
5746 FT_INT16
, BASE_DEC
, NULL
, 0x00,
5749 { &hf_ptp_v2_an_timesource
,
5750 { "TimeSource", "ptp.v2.timesource",
5751 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &ptp_v2_timeSource_vals_ext
, 0x00,
5754 { &hf_ptp_v2_an_localstepsremoved
,
5755 { "localStepsRemoved", "ptp.v2.an.localstepsremoved",
5756 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5759 { &hf_ptp_v2_an_grandmasterclockidentity
,
5760 { "grandmasterClockIdentity", "ptp.v2.an.grandmasterclockidentity",
5761 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
5764 { &hf_ptp_v2_an_grandmasterclockclass
,
5765 { "grandmasterClockClass", "ptp.v2.an.grandmasterclockclass",
5766 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5769 { &hf_ptp_v2_an_grandmasterclockaccuracy
,
5770 { "grandmasterClockAccuracy", "ptp.v2.an.grandmasterclockaccuracy",
5771 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &ptp_v2_clockAccuracy_vals_ext
, 0x00,
5774 { &hf_ptp_v2_an_grandmasterclockvariance
,
5775 { "grandmasterClockVariance", "ptp.v2.an.grandmasterclockvariance",
5776 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5779 { &hf_ptp_v2_an_priority1
,
5780 { "priority1", "ptp.v2.an.priority1",
5781 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5784 { &hf_ptp_v2_an_priority2
,
5785 { "priority2", "ptp.v2.an.priority2",
5786 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5790 /* Fields for TLVs */
5791 { &hf_ptp_tlv_tlvtype
,
5792 { "tlvType", "ptp.v2.tlv.tlvType",
5793 FT_UINT16
, BASE_HEX
| BASE_EXT_STRING
, &ptp_v2_TLV_type_vals_ext
, 0x00,
5796 { &hf_ptp_tlv_lengthfield
,
5797 { "lengthField", "ptp.v2.tlv.lengthField",
5798 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5801 { &hf_ptp_tlv_unparsed_payload
,
5802 { "Unparsed Payload", "ptp.v2.tlv.unparsed_payload",
5803 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5806 /* Fields for ORGANIZATION_EXTENSION TLV */
5807 { &hf_ptp_tlv_oe_organizationid
,
5808 { "organizationId", "ptp.v2.tlv.oe.organizationId",
5809 FT_UINT24
, BASE_OUI
, NULL
, 0x00,
5812 { &hf_ptp_tlv_oe_organizationsubtype
,
5813 { "organizationSubType", "ptp.v2.tlv.oe.organizationSubType",
5814 FT_UINT24
, BASE_HEX
, NULL
, 0x00,
5817 { &hf_ptp_tlv_oe_organizationsubtype_802_1
,
5818 { "organizationSubType", "ptp.v2.tlv.oe.organizationSubType",
5819 FT_UINT24
, BASE_HEX
, VALS(ptp_v2_org_802_1_subtype_vals
), 0x00,
5822 { &hf_ptp_tlv_oe_organizationsubtype_802_1_no_propagate
,
5823 { "organizationSubType", "ptp.v2.tlv.oe.organizationSubType",
5824 FT_UINT24
, BASE_HEX
, VALS(ptp_v2_org_802_1_no_propagate_subtype_vals
), 0x00,
5827 { &hf_ptp_v2_oe_tlv_ieee_c37_238_2017_organizationsubtype
,
5828 { "organizationSubType", "ptp.v2.tlv.oe.organizationSubType",
5829 FT_UINT24
, BASE_HEX
, VALS(ptp_v2_org_ieee_c37_238_2017_subtype_vals
), 0x00,
5833 { &hf_ptp_v2_oe_tlv_datafield
,
5834 { "dataField", "ptp.v2.an.oe.dataField",
5835 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5839 /* Fields for CERN White Rabbit TLV (OE TLV subtype) */
5840 { &hf_ptp_v2_an_tlv_oe_cern_subtype
,
5841 { "organizationSubType", "ptp.v2.tlv.oe.organizationSubType",
5842 FT_UINT24
, BASE_HEX
, VALS(ptp_v2_org_cern_subtype_vals
), 0x00,
5845 { &hf_ptp_v2_an_tlv_oe_cern_wrMessageID
,
5846 { "wrMessageID", "ptp.v2.an.oe.cern.wr.wrMessageID",
5847 FT_UINT16
, BASE_HEX
, VALS(ptp_v2_org_cern_wrMessageID_vals
), 0x00,
5850 { &hf_ptp_v2_an_tlv_oe_cern_wrFlags
,
5851 { "wrFlags", "ptp.v2.an.oe.cern.wr.wrFlags",
5852 FT_UINT16
, BASE_HEX
, NULL
, 0x00,
5855 { &hf_ptp_v2_an_tlv_oe_cern_wrFlags_wrConfig
,
5856 { "wrConfig", "ptp.v2.an.oe.cern.wr.wrFlags.wrConfig",
5857 FT_UINT16
, BASE_HEX
, VALS(ptp_v2_tlv_oe_cern_wrFlags_wrConfig_vals
), PTP_V2_TLV_OE_CERN_WRFLAGS_WRCONFIG_BITMASK
,
5860 { &hf_ptp_v2_an_tlv_oe_cern_wrFlags_calibrated
,
5861 { "calibrated", "ptp.v2.an.oe.cern.wr.wrFlags.calibrated",
5862 FT_BOOLEAN
, 16, NULL
, PTP_V2_TLV_OE_CERN_WRFLAGS_CALIBRATED_BITMASK
,
5865 { &hf_ptp_v2_an_tlv_oe_cern_wrFlags_wrModeOn
,
5866 { "wrModeOn", "ptp.v2.an.oe.cern.wr.wrFlags.wrModeOn",
5867 FT_BOOLEAN
, 16, NULL
, PTP_V2_TLV_OE_CERN_WRFLAGS_WRMODEON_BITMASK
,
5870 /* Fields for IEEE_C37_238 TLV (OE TLV subtype) */
5871 { &hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmasterid
,
5872 { "grandmasterID", "ptp.v2.an.oe.grandmasterID",
5873 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
5876 { &hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmastertimeinaccuracy
,
5877 { "grandmasterTimeInaccuracy (nanoseconds)", "ptp.v2.an.oe.grandmasterTimeInaccuracy",
5878 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5881 { &hf_ptp_v2_oe_tlv_subtype_c37238tlv_networktimeinaccuracy
,
5882 { "networkTimeInaccuracy (nanoseconds)", "ptp.v2.an.oe.networkTimeInaccuracy",
5883 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5886 { &hf_ptp_v2_oe_tlv_subtype_c37238tlv_reserved
,
5887 { "reserved", "ptp.v2.an.oe.reserved",
5888 FT_UINT16
, BASE_HEX
, NULL
, 0x00,
5891 /* Additional fields in C37.238-2017 compared to C37.238-2011 */
5892 { &hf_ptp_v2_oe_tlv_subtype_c372382017tlv_reserved
,
5893 { "reserved", "ptp.v2.an.oe.reserved",
5894 FT_UINT32
, BASE_HEX
, NULL
, 0x00,
5897 { &hf_ptp_v2_oe_tlv_subtype_c37238tlv_totaltimeinaccuracy
,
5898 { "totalTimeInaccuracy (nanoseconds)", "ptp.v2.an.oe.totalTimeInaccuracy",
5899 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5902 /* Fields for ALTERNATE_TIME_OFFSET_INDICATOR TLV */
5903 { &hf_ptp_v2_atoi_tlv_keyfield
,
5904 { "keyField", "ptp.v2.an.atoi.keyField",
5905 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5908 { &hf_ptp_v2_atoi_tlv_currentoffset
,
5909 { "currentOffset", "ptp.v2.an.atoi.currentOffset",
5910 FT_INT32
, BASE_DEC
, NULL
, 0x00,
5913 { &hf_ptp_v2_atoi_tlv_jumpseconds
,
5914 { "jumpSeconds", "ptp.v2.an.atoi.jumpSeconds",
5915 FT_INT32
, BASE_DEC
, NULL
, 0x00,
5918 { &hf_ptp_v2_atoi_tlv_timeofnextjump
,
5919 { "timeOfNextJump", "ptp.v2.an.atoi.timeOfNextJump",
5920 FT_INT48
, BASE_DEC
, NULL
, 0x00,
5923 { &hf_ptp_v2_atoi_tlv_displayname
,
5924 { "displayName", "ptp.v2.an.atoi.displayName",
5925 FT_STRING
, BASE_NONE
, NULL
, 0x00,
5928 { &hf_ptp_v2_atoi_tlv_displayname_length
,
5929 { "length", "ptp.v2.an.atoi.displayName.length",
5930 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
5933 /* Field for Path Trace TLV */
5934 { &hf_ptp_v2_an_tlv_pathsequence
,
5935 { "PathSequence", "ptp.v2.an.pathsequence",
5936 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
5940 /* Fields for undissected TLV */
5941 { &hf_ptp_v2_an_tlv_data
,
5942 { "data", "ptp.v2.an.tlv.data",
5943 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5947 /* Fields for PTP_Sync AND PTP_DelayRequest (=sdr) messages */
5949 { &hf_ptp_v2_sdr_origintimestamp
,
5950 { "originTimestamp", "ptp.v2.sdr.origintimestamp",
5951 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
5955 { &hf_ptp_v2_sdr_origintimestamp_seconds
,
5956 { "originTimestamp (seconds)", "ptp.v2.sdr.origintimestamp.seconds",
5957 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
5960 { &hf_ptp_v2_sdr_origintimestamp_nanoseconds
,
5961 { "originTimestamp (nanoseconds)", "ptp.v2.sdr.origintimestamp.nanoseconds",
5962 FT_INT32
, BASE_DEC
, NULL
, 0x00,
5966 { &hf_ptp_v2_sync_reserved
,
5967 { "reserved", "ptp.v2.sync.reserved",
5968 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5972 /* Fields for PTP_Follow_Up (=fu) messages */
5974 { &hf_ptp_v2_fu_preciseorigintimestamp
,
5975 { "preciseOriginTimestamp", "ptp.v2.fu.preciseorigintimestamp",
5976 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
5980 { &hf_ptp_v2_fu_preciseorigintimestamp_seconds
,
5981 { "preciseOriginTimestamp (seconds)", "ptp.v2.fu.preciseorigintimestamp.seconds",
5982 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
5985 { &hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds
,
5986 { "preciseOriginTimestamp (nanoseconds)", "ptp.v2.fu.preciseorigintimestamp.nanoseconds",
5987 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
5990 { &hf_ptp_v2_fu_preciseorigintimestamp_32bit
,
5991 { "preciseOriginTimestamp (32bit)", "ptp.v2.fu.preciseorigintimestamp.32bit",
5992 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
5995 /* Fields for PTP_Follow_up TLVs */
5996 { &hf_ptp_as_fu_tlv_cumulative_scaled_rate_offset
,
5997 { "cumulativeScaledRateOffset", "ptp.as.fu.cumulativeScaledRateOffset",
5998 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6001 { &hf_ptp_as_fu_tlv_cumulative_rate_ratio
,
6002 { "cumulativeRateRatio", "ptp.as.fu.cumulativeRateRatio",
6003 FT_DOUBLE
, BASE_NONE
, NULL
, 0x00,
6006 { &hf_ptp_as_fu_tlv_gm_base_indicator
,
6007 { "gmTimeBaseIndicator", "ptp.as.fu.gmTimeBaseIndicator",
6008 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6011 { &hf_ptp_as_fu_tlv_last_gm_phase_change
,
6012 { "lastGMPhaseChange", "ptp.as.fu.lastGmPhaseChange",
6013 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6016 { &hf_ptp_as_fu_tlv_scaled_last_gm_freq_change
,
6017 { "scaledLastGmFreqChange", "ptp.as.fu.scaledLastGmFreqChange",
6018 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6021 /* Fields for Drift_Tracking TLVs (802.1ASdm) */
6022 { &hf_ptp_as_dt_tlv_sync_egress_timestamp_seconds
,
6023 { "syncEgressTimestamp (seconds)", "ptp.as.dt.syncEgressTimestamp.seconds",
6024 FT_UINT48
, BASE_DEC
, NULL
, 0x00,
6027 { &hf_ptp_as_dt_tlv_sync_egress_timestamp_fractional_nanoseconds
,
6028 { "syncEgressTimestamp (nanoseconds)", "ptp.as.dt.syncEgressTimestamp.scaledNanoseconds",
6029 FT_DOUBLE
, BASE_NONE
, NULL
, 0x00,
6030 "fractionalNanoseconds converted into nanoseconds (double)", HFILL
}
6032 { &hf_ptp_as_dt_tlv_sync_grandmaster_identity
,
6033 { "syncGrandmasterIdentity", "ptp.as.dt.syncGrandmasterIdentity",
6034 FT_EUI64
, BASE_NONE
, NULL
, 0x00,
6037 { &hf_ptp_as_dt_tlv_sync_steps_removed
,
6038 { "syncStepsRemoved", "ptp.as.dt.syncStepsRemoved",
6039 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6042 { &hf_ptp_as_dt_tlv_rate_ratio_drift
,
6043 { "rateRatioDrift", "ptp.as.dt.rateRatioDrift",
6044 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6047 { &hf_ptp_as_dt_tlv_rate_ratio_drift_ppm
,
6048 { "rateRatioDrift (ppm/s)", "ptp.as.fu.rateRatioDrift.ppm",
6049 FT_DOUBLE
, BASE_NONE
, NULL
, 0x00,
6053 /* Fields for PTP_DelayResponse (=dr) messages */
6055 { &hf_ptp_v2_dr_receivetimestamp
,
6056 { "receiveTimestamp", "ptp.v2.dr.receivetimestamp",
6057 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
6061 { &hf_ptp_v2_dr_receivetimestamp_seconds
,
6062 { "receiveTimestamp (seconds)", "ptp.v2.dr.receivetimestamp.seconds",
6063 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
6066 { &hf_ptp_v2_dr_receivetimestamp_nanoseconds
,
6067 { "receiveTimestamp (nanoseconds)", "ptp.v2.dr.receivetimestamp.nanoseconds",
6068 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6071 { &hf_ptp_v2_dr_requestingportidentity
,
6072 { "requestingSourcePortIdentity", "ptp.v2.dr.requestingsourceportidentity",
6073 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
6076 { &hf_ptp_v2_dr_requestingsourceportid
,
6077 { "requestingSourcePortId", "ptp.v2.dr.requestingsourceportid",
6078 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6082 /* Fields for PTP_PDelayRequest (=pdrq) messages */
6084 { &hf_ptp_v2_pdrq_origintimestamp
,
6085 { "originTimestamp", "ptp.v2.pdrq.origintimestamp",
6086 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
6090 { &hf_ptp_v2_pdrq_origintimestamp_seconds
,
6091 { "originTimestamp (seconds)", "ptp.v2.pdrq.origintimestamp.seconds",
6092 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
6095 { &hf_ptp_v2_pdrq_origintimestamp_nanoseconds
,
6096 { "originTimestamp (nanoseconds)", "ptp.v2.pdrq.origintimestamp.nanoseconds",
6097 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6100 { &hf_ptp_v2_pdrq_reserved
,
6101 { "reserved", "ptp.v2.pdrq.reserved",
6102 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6106 /* Fields for PTP_PDelayResponse (=pdrs) messages */
6108 { &hf_ptp_v2_pdrs_requestreceipttimestamp
,
6109 { "requestreceiptTimestamp", "ptp.v2.pdrs.requestreceipttimestamp",
6110 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
6114 { &hf_ptp_v2_pdrs_requestreceipttimestamp_seconds
,
6115 { "requestreceiptTimestamp (seconds)", "ptp.v2.pdrs.requestreceipttimestamp.seconds",
6116 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
6119 { &hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds
,
6120 { "requestreceiptTimestamp (nanoseconds)", "ptp.v2.pdrs.requestreceipttimestamp.nanoseconds",
6121 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6124 { &hf_ptp_v2_pdrs_requestingportidentity
,
6125 { "requestingSourcePortIdentity", "ptp.v2.pdrs.requestingportidentity",
6126 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
6129 { &hf_ptp_v2_pdrs_requestingsourceportid
,
6130 { "requestingSourcePortId", "ptp.v2.pdrs.requestingsourceportid",
6131 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6135 /* Fields for PTP_PDelayResponseFollowUp (=pdfu) messages */
6137 { &hf_ptp_v2_pdfu_responseorigintimestamp
,
6138 { "responseOriginTimestamp", "ptp.v2.pdfu.responseorigintimestamp",
6139 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
6143 { &hf_ptp_v2_pdfu_responseorigintimestamp_seconds
,
6144 { "responseOriginTimestamp (seconds)", "ptp.v2.pdfu.responseorigintimestamp.seconds",
6145 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
6148 { &hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds
,
6149 { "responseOriginTimestamp (nanoseconds)", "ptp.v2.pdfu.responseorigintimestamp.nanoseconds",
6150 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6153 { &hf_ptp_v2_pdfu_requestingportidentity
,
6154 { "requestingSourcePortIdentity", "ptp.v2.pdfu.requestingportidentity",
6155 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
6158 { &hf_ptp_v2_pdfu_requestingsourceportid
,
6159 { "requestingSourcePortId", "ptp.v2.pdfu.requestingsourceportid",
6160 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6164 /* Fields for PTP_Signaling (=sig) messages */
6165 { &hf_ptp_v2_sig_targetportidentity
,
6166 { "targetPortIdentity", "ptp.v2.sig.targetportidentity",
6167 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
6170 { &hf_ptp_v2_sig_targetportid
,
6171 { "targetPortId", "ptp.v2.sig.targetportid",
6172 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6175 { &hf_ptp_v2_sig_tlv_data
,
6176 { "data", "ptp.v2.sig.tlv.data",
6177 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6180 { &hf_ptp_v2_sig_tlv_messageType
,
6181 { "messageType", "ptp.v2.sig.tlv.messageType",
6182 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, & ptp_v2_messagetype_vals_ext
, 0xF0,
6185 { &hf_ptp_v2_sig_tlv_logInterMessagePeriod
,
6186 { "logInterMessagePeriod", "ptp.v2.sig.tlv.logInterMessagePeriod",
6187 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6190 { &hf_ptp_v2_sig_tlv_logInterMessagePeriod_period
,
6191 { "period", "ptp.v2.sig.tlv.logInterMessagePeriod.period",
6192 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6195 { &hf_ptp_v2_sig_tlv_logInterMessagePeriod_rate
,
6196 { "rate", "ptp.v2.sig.tlv.logInterMessagePeriod.rate",
6197 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6200 { &hf_ptp_v2_sig_tlv_durationField
,
6201 { "durationField", "ptp.v2.sig.tlv.durationField",
6202 FT_UINT32
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_second_seconds
), 0x00,
6205 { &hf_ptp_v2_sig_tlv_renewalInvited
,
6206 { "renewalInvited", "ptp.v2.sig.tlv.renewalInvited",
6207 FT_BOOLEAN
, 8, NULL
, 0x01,
6210 { &hf_ptp_v2_sig_tlv_maintainRequest
,
6211 { "maintainRequest", "ptp.v2.sig.tlv.maintainRequest",
6212 FT_BOOLEAN
, 8, NULL
, 0x01,
6215 { &hf_ptp_v2_sig_tlv_maintainGrant
,
6216 { "maintainGrant", "ptp.v2.sig.tlv.maintainGrant",
6217 FT_BOOLEAN
, 8, NULL
, 0x02,
6220 { &hf_ptp_v2_sig_tlv_reserved
,
6221 { "reserved", "ptp.v2.sig.tlv.reserved",
6222 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6225 { &hf_ptp_v2_sig_tlv_flags2
,
6226 { "flags", "ptp.v2.sig.tlv.l1sync.flags",
6227 FT_UINT16
, BASE_HEX
, NULL
, 0x00,
6230 { &hf_ptp_v2_sig_tlv_flags3
,
6231 { "flags", "ptp.v2.sig.tlv.l1sync.flags",
6232 FT_UINT24
, BASE_HEX
, NULL
, 0x00,
6235 { &hf_ptp_v2_sig_tlv_l1sync_flags2_tcr
, /* Version with 2 bytes flags field */
6236 { "txCoherentIsRequired", "ptp.v2.sig.tlv.l1sync.flags.tcr",
6237 FT_BOOLEAN
, 16, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_TCR_BITMASK
,
6240 { &hf_ptp_v2_sig_tlv_l1sync_flags3_tcr
, /* Version with 3 bytes flags field */
6241 { "txCoherentIsRequired", "ptp.v2.sig.tlv.l1sync.flags.tcr",
6242 FT_BOOLEAN
, 24, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_TCR_BITMASK
<< 8,
6245 { &hf_ptp_v2_sig_tlv_l1sync_flags2_rcr
, /* Version with 2 bytes flags field */
6246 { "rxCoherentIsRequired", "ptp.v2.sig.tlv.l1sync.flags.rcr",
6247 FT_BOOLEAN
, 16, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_RCR_BITMASK
,
6250 { &hf_ptp_v2_sig_tlv_l1sync_flags3_rcr
, /* Version with 3 bytes flags field */
6251 { "rxCoherentIsRequired", "ptp.v2.sig.tlv.l1sync.flags.rcr",
6252 FT_BOOLEAN
, 24, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_RCR_BITMASK
<< 8,
6255 { &hf_ptp_v2_sig_tlv_l1sync_flags2_cr
, /* Version with 2 bytes flags field */
6256 { "congruentIsRequired", "ptp.v2.sig.tlv.l1sync.flags.cr",
6257 FT_BOOLEAN
, 16, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_CR_BITMASK
,
6260 { &hf_ptp_v2_sig_tlv_l1sync_flags3_cr
, /* Version with 3 bytes flags field */
6261 { "congruentIsRequired", "ptp.v2.sig.tlv.l1sync.flags.cr",
6262 FT_BOOLEAN
, 24, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_CR_BITMASK
<< 8,
6265 { &hf_ptp_v2_sig_tlv_l1sync_flags2_ope
, /* Version with 2 bytes flags field */
6266 { "optParamsEnabled", "ptp.v2.sig.tlv.l1sync.flags.ope",
6267 FT_BOOLEAN
, 16, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_OPE_BITMASK
,
6270 { &hf_ptp_v2_sig_tlv_l1sync_flags3_ope
, /* Version with 3 bytes flags field */
6271 { "optParamsEnabled", "ptp.v2.sig.tlv.l1sync.flags.ope",
6272 FT_BOOLEAN
, 24, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS1_OPE_BITMASK
<< 8,
6275 { &hf_ptp_v2_sig_tlv_l1sync_flags2_itc
, /* Version with 2 bytes flags field */
6276 { "isTxCoherent", "ptp.v2.sig.tlv.l1sync.flags.itc",
6277 FT_BOOLEAN
, 16, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_ITC_BITMASK
,
6280 { &hf_ptp_v2_sig_tlv_l1sync_flags3_itc
, /* Version with 3 bytes flags field */
6281 { "isTxCoherent", "ptp.v2.sig.tlv.l1sync.flags.itc",
6282 FT_BOOLEAN
, 24, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_ITC_BITMASK
<< 8,
6285 { &hf_ptp_v2_sig_tlv_l1sync_flags2_irc
, /* Version with 2 bytes flags field */
6286 { "isRxCoherent", "ptp.v2.sig.tlv.l1sync.flags.irc",
6287 FT_BOOLEAN
, 16, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_IRC_BITMASK
,
6290 { &hf_ptp_v2_sig_tlv_l1sync_flags3_irc
, /* Version with 3 bytes flags field */
6291 { "isRxCoherent", "ptp.v2.sig.tlv.l1sync.flags.irc",
6292 FT_BOOLEAN
, 24, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_IRC_BITMASK
<< 8,
6295 { &hf_ptp_v2_sig_tlv_l1sync_flags2_ic
, /* Version with 2 bytes flags field */
6296 { "isCongruent", "ptp.v2.sig.tlv.l1sync.flags.ic",
6297 FT_BOOLEAN
, 16, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_IC_BITMASK
,
6300 { &hf_ptp_v2_sig_tlv_l1sync_flags3_ic
, /* Version with 3 bytes flags field */
6301 { "isCongruent", "ptp.v2.sig.tlv.l1sync.flags.ic",
6302 FT_BOOLEAN
, 24, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_IC_BITMASK
<< 8,
6305 { &hf_ptp_v2_sig_tlv_l1sync_flags3_fov
,
6306 { "frequencyOffsetTxValid", "ptp.v2.sig.tlv.l1sync.flags.fov",
6307 FT_BOOLEAN
, 24, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS3_FOV_BITMASK
,
6310 { &hf_ptp_v2_sig_tlv_l1sync_flags3_pov
,
6311 { "phaseOffsetTxValid", "ptp.v2.sig.tlv.l1sync.flags.pov",
6312 FT_BOOLEAN
, 24, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS3_POV_BITMASK
,
6315 { &hf_ptp_v2_sig_tlv_l1sync_flags3_tct
,
6316 { "timestampsCorrectedTx", "ptp.v2.sig.tlv.l1sync.flags.tct",
6317 FT_BOOLEAN
, 24, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS3_TCT_BITMASK
,
6320 { &hf_ptp_v2_sig_tlv_l1sync_flags2_reserved
,
6321 { "reserved", "ptp.v2.sig.tlv.l1sync.flags.reserved",
6322 FT_UINT16
, BASE_HEX
, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS2_RESERVED_ALL_BITMASK
,
6325 { &hf_ptp_v2_sig_tlv_l1sync_flags3_reserved
,
6326 { "reserved", "ptp.v2.sig.tlv.l1sync.flags.reserved",
6327 FT_UINT24
, BASE_HEX
, NULL
, PTP_V2_TLV_SIG_TLV_L1SYNC_FLAGS3_RESERVED_ALL_BITMASK
,
6330 { &hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTx_ns
,
6331 { "Ns", "ptp.v2.sig.tlv.l1sync.phaseOffsetTx.ns",
6332 FT_INT64
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6335 { &hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTx_subns
,
6336 { "SubNs", "ptp.v2.sig.tlv.l1sync.phaseOffsetTx.subns",
6337 FT_DOUBLE
, BASE_NONE
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6340 { &hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTxTimestamp_s
,
6341 { "S", "ptp.v2.sig.tlv.l1sync.phaseOffsetTxTimestamp.s",
6342 FT_UINT64
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_second_seconds
), 0x00,
6345 { &hf_ptp_v2_sig_tlv_l1syncext_phaseOffsetTxTimestamp_ns
,
6346 { "Ns", "ptp.v2.sig.tlv.l1sync.phaseOffsetTxTimestamp.ns",
6347 FT_INT32
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6350 { &hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTx_ns
,
6351 { "Ns", "ptp.v2.sig.tlv.l1sync.freqOffsetTx.ns",
6352 FT_INT64
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6355 { &hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTx_subns
,
6356 { "SubNs", "ptp.v2.sig.tlv.l1sync.freqOffsetTx.subns",
6357 FT_DOUBLE
, BASE_NONE
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6360 { &hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTxTimestamp_s
,
6361 { "S", "ptp.v2.sig.tlv.l1sync.freqOffsetTxTimestamp.s",
6362 FT_UINT64
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_second_seconds
), 0x00,
6365 { &hf_ptp_v2_sig_tlv_l1syncext_freqOffsetTxTimestamp_ns
,
6366 { "Ns", "ptp.v2.sig.tlv.l1sync.freqOffsetTxTimestamp.ns",
6367 FT_INT32
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6370 { &hf_ptp_v2_sig_oe_tlv_cern_subtype
,
6371 { "organizationSubType", "ptp.v2.tlv.oe.organizationSubType",
6372 FT_UINT24
, BASE_HEX
, VALS(ptp_v2_org_cern_subtype_vals
), 0x00,
6375 { &hf_ptp_v2_sig_oe_tlv_itut_subtype
,
6376 { "organizationSubType", "ptp.v2.tlv.oe.organizationSubType",
6377 FT_UINT24
, BASE_HEX
, VALS(ptp_v2_org_itut_subtype_vals
), 0x00,
6380 { &hf_ptp_v2_sig_oe_tlv_cern_wrMessageID
,
6381 { "wrMessageID", "ptp.v2.sig.oe.cern.wr.wrMessageID",
6382 FT_UINT16
, BASE_HEX
, VALS(ptp_v2_org_cern_wrMessageID_vals
), 0x00,
6385 { &hf_ptp_v2_sig_oe_tlv_cern_calSendPattern
,
6386 { "calSendPattern", "ptp.v2.sig.oe.cern.wr.calSendPattern",
6387 FT_BOOLEAN
, 8, NULL
, 0x01,
6390 { &hf_ptp_v2_sig_oe_tlv_cern_calRety
,
6391 { "calRety", "ptp.v2.sig.oe.cern.wr.calRety",
6392 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6395 { &hf_ptp_v2_sig_oe_tlv_cern_calPeriod
,
6396 { "calPeriod", "ptp.v2.sig.oe.cern.wr.calPeriod",
6397 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
6400 { &hf_ptp_v2_sig_oe_tlv_cern_deltaTx
,
6401 { "deltaTx", "ptp.v2.sig.oe.cern.wr.deltaTx",
6402 FT_DOUBLE
, BASE_NONE
| BASE_UNIT_STRING
, UNS(&units_picoseconds
), 0x00,
6405 { &hf_ptp_v2_sig_oe_tlv_cern_deltaRx
,
6406 { "deltaRx", "ptp.v2.sig.oe.cern.wr.deltaRx",
6407 FT_DOUBLE
, BASE_NONE
| BASE_UNIT_STRING
, UNS(&units_picoseconds
), 0x00,
6410 /* Fields for PTP_Signaling (=sig) TLVs */
6411 { &hf_ptp_as_sig_tlv_link_delay_interval
,
6412 { "linkDelayInterval", "ptp.as.sig.tlv.linkdelayinterval",
6413 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6416 { &hf_ptp_as_sig_tlv_time_sync_interval
,
6417 { "timeSyncInterval", "ptp.as.sig.tlv.timesyncinterval",
6418 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6421 { &hf_ptp_as_sig_tlv_announce_interval
,
6422 { "announceInterval", "ptp.as.sig.tlv.announceinterval",
6423 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6426 { &hf_ptp_as_sig_tlv_flags
,
6427 { "flags", "ptp.as.sig.tlv.flags",
6428 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
6431 { &hf_ptp_as_sig_tlv_flags_comp_rate_ratio
,
6432 { "computeNeighborRateRatio", "ptp.as.sig.tlv.flags.rateratio",
6433 FT_BOOLEAN
, 8, NULL
, PTP_AS_FLAGS_COMP_NEIGHBOR_RATE_RATIO_BITMASK
,
6436 { &hf_ptp_as_sig_tlv_flags_comp_mean_link_delay
,
6437 { "computeMeanLinkDelay", "ptp.as.sig.tlv.flags.meanlinkdelay",
6438 FT_BOOLEAN
, 8, NULL
, PTP_AS_FLAGS_COMP_MEAN_LINK_DELAY_BITMASK
,
6441 { &hf_ptp_as_sig_tlv_flags_one_step_receive_capable
,
6442 { "oneStepReceiveCapable", "ptp.as.sig.tlv.flags.stepreceivecapable",
6443 FT_BOOLEAN
, 8, NULL
, PTP_AS_FLAGS_ONE_STEP_RECEIVE_CAPABLE
,
6446 { &hf_ptp_as_sig_tlv_gptp_capable_message_interval
,
6447 { "gptpCapableMessageInterval", "ptp.as.sig.tlv.gptpcapablemessageinterval",
6448 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6451 { &hf_ptp_as_sig_tlv_gptp_capable_reserved
,
6452 { "reserved", "ptp.as.sig.tlv.reserved",
6453 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6456 { &hf_ptp_as_sig_tlv_reserved
,
6457 { "reserved", "ptp.as.sig.tlv.reserved",
6458 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6462 { &hf_ptp_as_csn_upstream_tx_time
,
6463 { "upstreamTxTime", "ptp.as.tlv.csn.upstream_tx_time",
6464 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6467 { &hf_ptp_as_csn_neighbor_rate_ratio
,
6468 { "neighborRateRatio", "ptp.as.tlv.csn.neighbor_rate_ratio",
6469 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6472 { &hf_ptp_as_csn_mean_link_delay
,
6473 { "meanLinkDelay", "ptp.as.tlv.csn.mean_link_delay",
6474 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6477 { &hf_ptp_as_csn_delay_asymmetry
,
6478 { "delayAsymmetry", "ptp.as.tlv.csn.delay_asymmetry",
6479 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6482 { &hf_ptp_as_csn_domain_number
,
6483 { "domainNumber", "ptp.as.tlv.csn.domain_number",
6484 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6488 { &hf_ptp_v2_sig_tlv_interface_bit_period
,
6489 { "interfaceBitPeriod", "ptp.as.sig.tlv.interfaceBitPeriod",
6490 FT_UINT64
, BASE_DEC
| BASE_UNIT_STRING
, UNS(&units_attoseconds
), 0x00,
6493 { &hf_ptp_v2_sig_tlv_numberbits_before_timestamp
,
6494 { "numberBitsBeforeTimestamp", "ptp.as.sig.tlv.numberBitsBeforeTimestamp",
6495 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6498 { &hf_ptp_v2_sig_tlv_numberbits_after_timestamp
,
6499 { "numberBitsAfterTimestamp", "ptp.as.sig.tlv.numberBitsAfterTimestamp",
6500 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6503 /* Fields for PTP_Management (=mm) messages */
6504 { &hf_ptp_v2_mm_targetportidentity
,
6505 { "targetPortIdentity", "ptp.v2.mm.targetportidentity",
6506 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
6509 { &hf_ptp_v2_mm_targetportid
,
6510 { "targetPortId", "ptp.v2.mm.targetportid",
6511 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6514 { &hf_ptp_v2_mm_startingboundaryhops
,
6515 { "startingBoundaryHops", "ptp.v2.mm.startingboundaryhops",
6516 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6519 { &hf_ptp_v2_mm_boundaryhops
,
6520 { "boundaryHops", "ptp.v2.mm.boundaryhops",
6521 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6524 { &hf_ptp_v2_mm_action
,
6525 { "action", "ptp.v2.mm.action",
6526 FT_UINT8
, BASE_DEC
, VALS(ptp_v2_mm_action_vals
), 0x0F,
6529 { &hf_ptp_v2_mm_reserved1
,
6530 { "reserved", "ptp.v2.mm.reserved1",
6531 FT_UINT8
, BASE_DEC
, NULL
, 0xF0,
6534 { &hf_ptp_v2_mm_reserved2
,
6535 { "reserved", "ptp.v2.mm.reserved2",
6536 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6539 /* Management TLV */
6540 { &hf_ptp_v2_mm_tlvType
,
6541 { "tlvType", "ptp.v2.mm.tlvType",
6542 FT_UINT16
, BASE_HEX
| BASE_EXT_STRING
, &ptp_v2_TLV_type_vals_ext
, 0x00,
6545 { &hf_ptp_v2_mm_lengthField
,
6546 { "lengthField", "ptp.v2.mm.lengthField",
6547 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6550 { &hf_ptp_v2_mm_managementId
,
6551 { "managementId", "ptp.v2.mm.managementId",
6552 FT_UINT16
, BASE_DEC
| BASE_EXT_STRING
, &ptp_v2_managementID_vals_ext
, 0x00,
6555 { &hf_ptp_v2_mm_data
,
6556 { "data", "ptp.v2.mm.data",
6557 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6560 /* Management TLV dataField */
6561 /* CLOCK_DESCRIPTION */
6562 { &hf_ptp_v2_mm_clockType
,
6563 { "clockType", "ptp.v2.mm.clockType",
6564 FT_UINT16
, BASE_HEX
, NULL
, 0x00,
6567 { &hf_ptp_v2_mm_clockType_ordinaryClock
,
6568 { "The node implements an ordinary clock", "ptp.v2.mm.clockType.OC",
6569 FT_BOOLEAN
, 16, NULL
, CLOCKTYPE_ORDINARY_CLOCK
,
6572 { &hf_ptp_v2_mm_clockType_boundaryClock
,
6573 { "The node implements a boundary clock", "ptp.v2.mm.clockType.BC",
6574 FT_BOOLEAN
, 16, NULL
, CLOCKTYPE_BOUNDARY_CLOCK
,
6577 { &hf_ptp_v2_mm_clockType_p2p_transparentClock
,
6578 { "The node implements a peer-to-peer transparent clock", "ptp.v2.mm.clockType.p2p_TC",
6579 FT_BOOLEAN
, 16, NULL
, CLOCKTYPE_P2P_TC
,
6582 { &hf_ptp_v2_mm_clockType_e2e_transparentClock
,
6583 { "The node implements an end-to-end transparent clock", "ptp.v2.mm.clockType.e2e_TC",
6584 FT_BOOLEAN
, 16, NULL
, CLOCKTYPE_E2E_TC
,
6587 { &hf_ptp_v2_mm_clockType_managementNode
,
6588 { "The node implements a management node", "ptp.v2.mm.clockType.MM",
6589 FT_BOOLEAN
, 16, NULL
, CLOCKTYPE_MANAGEMENT_NODE
,
6592 { &hf_ptp_v2_mm_clockType_reserved
,
6593 { "reserved", "ptp.v2.mm.clockType.reserved",
6594 FT_BOOLEAN
, 16, NULL
, CLOCKTYPE_RESERVED
,
6597 { &hf_ptp_v2_mm_physicalLayerProtocol
,
6598 { "physicalLayerProtocol", "ptp.v2.mm.physicalLayerProtocol",
6599 FT_STRING
, BASE_NONE
, NULL
, 0x00,
6602 { &hf_ptp_v2_mm_physicalLayerProtocol_length
,
6603 { "length", "ptp.v2.mm.physicalLayerProtocol.length",
6604 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6607 { &hf_ptp_v2_mm_physicalAddressLength
,
6608 { "physical address length", "ptp.v2.mm.physicalAddressLength",
6609 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6612 { &hf_ptp_v2_mm_physicalAddress
,
6613 { "physical address", "ptp.v2.mm.physicalAddress",
6614 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6617 { &hf_ptp_v2_mm_protocolAddress
,
6618 { "protocol address", "ptp.v2.mm.protocolAddress",
6619 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6622 { &hf_ptp_v2_mm_protocolAddress_networkProtocol
,
6623 { "network protocol", "ptp.v2.mm.networkProtocol",
6624 FT_UINT16
, BASE_DEC
| BASE_EXT_STRING
, &ptp_v2_networkProtocol_vals_ext
, 0x00,
6627 { &hf_ptp_v2_mm_protocolAddress_length
,
6628 { "length", "ptp.v2.mm.protocolAddress.length",
6629 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6632 { &hf_ptp_v2_mm_manufacturerIdentity
,
6633 { "manufacturer identity", "ptp.v2.mm.manufacturerIdentity",
6634 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6637 { &hf_ptp_v2_mm_reserved
,
6638 { "reserved", "ptp.v2.mm.reserved",
6639 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6642 { &hf_ptp_v2_mm_productDescription
,
6643 { "product description", "ptp.v2.mm.productDescription",
6644 FT_STRING
, BASE_NONE
, NULL
, 0x00,
6647 { &hf_ptp_v2_mm_productDescription_length
,
6648 { "length", "ptp.v2.mm.productDescription.length",
6649 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6652 { &hf_ptp_v2_mm_revisionData
,
6653 { "revision data", "ptp.v2.mm.revisionData",
6654 FT_STRING
, BASE_NONE
, NULL
, 0x00,
6657 { &hf_ptp_v2_mm_revisionData_length
,
6658 { "length", "ptp.v2.mm.revisionData.length",
6659 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6662 { &hf_ptp_v2_mm_userDescription
,
6663 { "user description", "ptp.v2.mm.userDescription",
6664 FT_STRING
, BASE_NONE
, NULL
, 0x00,
6667 { &hf_ptp_v2_mm_userDescription_length
,
6668 { "length", "ptp.v2.mm.userDescription.length",
6669 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6672 { &hf_ptp_v2_mm_profileIdentity
,
6673 { "profileIdentity", "ptp.v2.mm.profileIdentity",
6674 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6677 { &hf_ptp_v2_mm_pad
,
6678 { "Pad", "ptp.v2.mm.pad",
6679 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
6682 { &hf_ptp_v2_mm_initializationKey
,
6683 { "initialization key", "ptp.v2.mm.initializationKey",
6684 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6687 { &hf_ptp_v2_mm_numberOfFaultRecords
,
6688 { "number of fault records", "ptp.v2.mm.numberOfFaultRecords",
6689 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6693 { &hf_ptp_v2_mm_faultRecord
,
6694 { "fault record", "ptp.v2.mm.faultRecord",
6695 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
6699 { &hf_ptp_v2_mm_faultRecordLength
,
6700 { "fault record length", "ptp.v2.mm.faultRecordLength",
6701 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6704 { &hf_ptp_v2_mm_severityCode
,
6705 { "severity code", "ptp.v2.mm.severityCode",
6706 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_v2_severityCode_vals_ext
, 0x00,
6709 { &hf_ptp_v2_mm_faultName
,
6710 { "faultName", "ptp.v2.mm.faultName",
6711 FT_STRING
, BASE_NONE
, NULL
, 0x00,
6714 { &hf_ptp_v2_mm_faultName_length
,
6715 { "length", "ptp.v2.mm.faultName.length",
6716 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6719 { &hf_ptp_v2_mm_faultValue
,
6720 { "faultValue", "ptp.v2.mm.faultValue",
6721 FT_STRING
, BASE_NONE
, NULL
, 0x00,
6724 { &hf_ptp_v2_mm_faultValue_length
,
6725 { "length", "ptp.v2.mm.faultValue.length",
6726 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6729 { &hf_ptp_v2_mm_faultDescription
,
6730 { "faultDescription", "ptp.v2.mm.faultDescription",
6731 FT_STRING
, BASE_NONE
, NULL
, 0x00,
6734 { &hf_ptp_v2_mm_faultDescription_length
,
6735 { "length", "ptp.v2.mm.faultDescription.length",
6736 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6740 { &hf_ptp_v2_mm_faultTime
,
6741 { "Fault time", "ptp.v2.mm.faultTime",
6742 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x00,
6746 { &hf_ptp_v2_mm_faultTime_s
,
6747 { "Fault time (seconds)", "ptp.v2.mm.faultTime.seconds",
6748 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
6751 { &hf_ptp_v2_mm_faultTime_ns
,
6752 { "Fault time (nanoseconds)", "ptp.v2.mm.faultTime.nanoseconds",
6753 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6756 { &hf_ptp_v2_mm_currentTime_s
,
6757 { "current time (seconds)", "ptp.v2.mm.currentTime.seconds",
6758 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
6761 { &hf_ptp_v2_mm_currentTime_ns
,
6762 { "current time (nanoseconds)", "ptp.v2.mm.currentTime.nanoseconds",
6763 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6766 { &hf_ptp_v2_mm_clockAccuracy
,
6767 { "Clock accuracy", "ptp.v2.mm.clockaccuracy",
6768 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &ptp_v2_clockAccuracy_vals_ext
, 0x00,
6772 { &hf_ptp_v2_mm_priority1
,
6773 { "priority1", "ptp.v2.mm.priority1",
6774 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6777 { &hf_ptp_v2_mm_priority2
,
6778 { "priority2", "ptp.v2.mm.priority2",
6779 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6782 { &hf_ptp_v2_mm_dds_SO
,
6783 { "Slave only", "ptp.v2.mm.SlaveOnly",
6784 FT_BOOLEAN
, 8, NULL
, 0x02,
6787 { &hf_ptp_v2_mm_TSC
,
6788 { "Two step", "ptp.v2.mm.twoStep",
6789 FT_BOOLEAN
, 8, NULL
, 0x01,
6792 { &hf_ptp_v2_mm_numberPorts
,
6793 { "number of ports", "ptp.v2.mm.numberPorts",
6794 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6797 { &hf_ptp_v2_mm_clockclass
,
6798 { "Clock class", "ptp.v2.mm.clockclass",
6799 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6802 { &hf_ptp_v2_mm_clockaccuracy
,
6803 { "Clock accuracy", "ptp.v2.mm.clockaccuracy",
6804 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &ptp_v2_clockAccuracy_vals_ext
, 0x00,
6807 { &hf_ptp_v2_mm_clockvariance
,
6808 { "Clock variance", "ptp.v2.mm.clockvariance",
6809 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6812 { &hf_ptp_v2_mm_clockidentity
,
6813 { "Clock identity", "ptp.v2.mm.clockidentity",
6814 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
6817 { &hf_ptp_v2_mm_domainNumber
,
6818 { "domain number", "ptp.v2.mm.domainNumber",
6819 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6823 { "Slave only", "ptp.v2.mm.SlavOnly",
6824 FT_BOOLEAN
, 8, NULL
, 0x01,
6827 { &hf_ptp_v2_mm_stepsRemoved
,
6828 { "steps removed", "ptp.v2.mm.stepsRemoved",
6829 FT_INT16
, BASE_DEC
, NULL
, 0x00,
6832 { &hf_ptp_v2_mm_parentIdentity
,
6833 { "parent ClockIdentity", "ptp.v2.mm.parentclockidentity",
6834 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
6837 { &hf_ptp_v2_mm_parentPort
,
6838 { "parent SourcePortID", "ptp.v2.mm.parentsourceportid",
6839 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6842 { &hf_ptp_v2_mm_parentStats
,
6843 { "parent stats", "ptp.v2.mm.parentstats",
6844 FT_BOOLEAN
, 8, NULL
, 0x01,
6847 { &hf_ptp_v2_mm_observedParentOffsetScaledLogVariance
,
6848 { "observedParentOffsetScaledLogVariance", "ptp.v2.mm.observedParentOffsetScaledLogVariance",
6849 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6852 { &hf_ptp_v2_mm_observedParentClockPhaseChangeRate
,
6853 { "observedParentClockPhaseChangeRate", "ptp.v2.mm.observedParentClockPhaseChangeRate",
6854 FT_INT32
, BASE_DEC
, NULL
, 0x00,
6857 { &hf_ptp_v2_mm_grandmasterPriority1
,
6858 { "Grandmaster priority1", "ptp.v2.mm.grandmasterPriority1",
6859 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6862 { &hf_ptp_v2_mm_grandmasterPriority2
,
6863 { "Grandmaster priority2", "ptp.v2.mm.grandmasterPriority2",
6864 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6867 { &hf_ptp_v2_mm_grandmasterclockclass
,
6868 { "Grandmaster clock class", "ptp.v2.mm.grandmasterclockclass",
6869 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6872 { &hf_ptp_v2_mm_grandmasterclockaccuracy
,
6873 { "Grandmaster clock accuracy", "ptp.v2.mm.grandmasterclockaccuracy",
6874 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &ptp_v2_clockAccuracy_vals_ext
, 0x00,
6877 { &hf_ptp_v2_mm_grandmasterclockvariance
,
6878 { "Grandmaster clock variance", "ptp.v2.mm.grandmasterclockvariance",
6879 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6882 { &hf_ptp_v2_mm_grandmasterIdentity
,
6883 { "Grandmaster clock identity", "ptp.v2.mm.grandmasterclockidentity",
6884 FT_UINT64
, BASE_HEX
, NULL
, 0x00,
6887 { &hf_ptp_v2_mm_currentUtcOffset
,
6888 { "CurrentUTCOffset", "ptp.v2.mm.currentutcoffset",
6889 FT_INT16
, BASE_DEC
, NULL
, 0x00,
6892 { &hf_ptp_v2_mm_LI_61
,
6893 { "leap 61", "ptp.v2.mm.li61",
6894 FT_BOOLEAN
, 8, NULL
, 0x01,
6897 { &hf_ptp_v2_mm_LI_59
,
6898 { "leap 59", "ptp.v2.mm.li59",
6899 FT_BOOLEAN
, 8, NULL
, 0x02,
6902 { &hf_ptp_v2_mm_UTCV
,
6903 { "CurrentUTCOffset valid", "ptp.v2.mm.CurrentUTCOffsetValid",
6904 FT_BOOLEAN
, 8, NULL
, 0x04,
6907 { &hf_ptp_v2_mm_PTP
,
6908 { "PTP timescale", "ptp.v2.mm.ptptimescale",
6909 FT_BOOLEAN
, 8, NULL
, 0x08,
6912 { &hf_ptp_v2_mm_TTRA
,
6913 { "Time traceable", "ptp.v2.mm.timeTraceable",
6914 FT_BOOLEAN
, 8, NULL
, 0x10,
6917 { &hf_ptp_v2_mm_FTRA
,
6918 { "Frequency traceable", "ptp.v2.mm.frequencyTraceable",
6919 FT_BOOLEAN
, 8, NULL
, 0x20,
6922 { &hf_ptp_v2_mm_timesource
,
6923 { "TimeSource", "ptp.v2.mm.timesource",
6924 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &ptp_v2_timeSource_vals_ext
, 0x00,
6927 { &hf_ptp_v2_mm_offset_ns
,
6928 { "Ns", "ptp.v2.mm.offset.ns",
6929 FT_INT64
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6932 { &hf_ptp_v2_mm_offset_subns
,
6933 { "SubNs", "ptp.v2.mm.offset.subns",
6934 FT_DOUBLE
, BASE_NONE
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6937 { &hf_ptp_v2_mm_pathDelay_ns
,
6938 { "Ns", "ptp.v2.mm.pathDelay.ns",
6939 FT_INT64
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6942 { &hf_ptp_v2_mm_pathDelay_subns
,
6943 { "SubNs", "ptp.v2.mm.pathDelay.subns",
6944 FT_DOUBLE
, BASE_NONE
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6947 { &hf_ptp_v2_mm_PortNumber
,
6948 { "PortNumber", "ptp.v2.mm.PortNumber",
6949 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
6952 { &hf_ptp_v2_mm_portState
,
6953 { "Port state", "ptp.v2.mm.portState",
6954 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &ptp_v2_portState_vals_ext
, 0x00,
6957 { &hf_ptp_v2_mm_logMinDelayReqInterval
,
6958 { "logMinDelayReqInterval", "ptp.v2.mm.logMinDelayReqInterval",
6959 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6962 { &hf_ptp_v2_mm_peerMeanPathDelay_ns
,
6963 { "Ns", "ptp.v2.mm.peerMeanPathDelay.ns",
6964 FT_INT64
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6967 { &hf_ptp_v2_mm_peerMeanPathDelay_subns
,
6968 { "SubNs", "ptp.v2.mm.peerMeanPathDelay.subns",
6969 FT_DOUBLE
, BASE_NONE
|BASE_UNIT_STRING
, UNS(&units_nanosecond_nanoseconds
), 0x00,
6972 { &hf_ptp_v2_mm_logAnnounceInterval
,
6973 { "logAnnounceInterval", "ptp.v2.mm.logAnnounceInterval",
6974 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6977 { &hf_ptp_v2_mm_announceReceiptTimeout
,
6978 { "announceReceiptTimeout", "ptp.v2.mm.announceReceiptTimeout",
6979 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
6982 { &hf_ptp_v2_mm_logSyncInterval
,
6983 { "logSyncInterval", "ptp.v2.mm.logSyncInterval",
6984 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6987 { &hf_ptp_v2_mm_delayMechanism
,
6988 { "Delay mechanism", "ptp.v2.mm.delayMechanism",
6989 FT_UINT8
, BASE_DEC
, VALS(ptp_v2_delayMechanism_vals
), 0x00,
6992 { &hf_ptp_v2_mm_logMinPdelayReqInterval
,
6993 { "logMinPdelayReqInterval", "ptp.v2.mm.logMinPdelayReqInterval",
6994 FT_INT8
, BASE_DEC
, NULL
, 0x00,
6997 { &hf_ptp_v2_mm_versionNumber
,
6998 { "versionNumber", "ptp.v2.mm.versionNumber",
6999 FT_UINT8
, BASE_DEC
, NULL
, 0x0F,
7002 { &hf_ptp_v2_mm_primaryDomain
,
7003 { "Primary domain number", "ptp.v2.mm.primaryDomain",
7004 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
7007 { &hf_ptp_v2_mm_faultyFlag
,
7008 { "Faulty flag", "ptp.v2.mm.faultyFlag",
7009 FT_BOOLEAN
, 8, NULL
, 0x01,
7013 { &hf_ptp_v2_mm_managementErrorId
,
7014 { "managementErrorId", "ptp.v2.mm.managementErrorId",
7015 FT_UINT16
, BASE_DEC
| BASE_EXT_STRING
, &ptp_v2_managementErrorId_vals_ext
, 0x00,
7018 { &hf_ptp_v2_mm_displayData
,
7019 { "Display data", "ptp.v2.mm.displayData",
7020 FT_STRING
, BASE_NONE
, NULL
, 0x00,
7023 { &hf_ptp_v2_mm_displayData_length
,
7024 { "length", "ptp.v2.mm.displayData.length",
7025 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
7028 { &hf_ptp_v2_mm_ucEN
,
7029 { "Enable unicast", "ptp.v2.mm.unicastEnable",
7030 FT_BOOLEAN
, 8, NULL
, 0x01,
7033 { &hf_ptp_v2_mm_ptEN
,
7034 { "Path trace unicast", "ptp.v2.mm.pathTraceEnable",
7035 FT_BOOLEAN
, 8, NULL
, 0x01,
7038 { &hf_ptp_v2_mm_atEN
,
7039 { "Path trace unicast", "ptp.v2.mm.pathTraceEnable",
7040 FT_BOOLEAN
, 8, NULL
, 0x01,
7043 { &hf_ptp_v2_mm_keyField
,
7044 { "Key field", "ptp.v2.mm.keyField",
7045 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
7048 { &hf_ptp_v2_mm_displayName
,
7049 { "Display name", "ptp.v2.mm.displayName",
7050 FT_STRING
, BASE_NONE
, NULL
, 0x00,
7053 { &hf_ptp_v2_mm_displayName_length
,
7054 { "length", "ptp.v2.mm.displayName.length",
7055 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
7058 { &hf_ptp_v2_mm_maxKey
,
7059 { "Max key", "ptp.v2.mm.maxKey",
7060 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
7063 { &hf_ptp_v2_mm_currentOffset
,
7064 { "Current offset", "ptp.v2.mm.currentOffset",
7065 FT_INT32
, BASE_DEC
, NULL
, 0x00,
7068 { &hf_ptp_v2_mm_jumpSeconds
,
7069 { "Jump seconds", "ptp.v2.mm.jumpSeconds",
7070 FT_INT32
, BASE_DEC
, NULL
, 0x00,
7073 { &hf_ptp_v2_mm_nextjumpSeconds
,
7074 { "Time of next jump (seconds)", "ptp.v2.mm.nextjumpSeconds",
7075 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
7078 { &hf_ptp_v2_mm_numberOfAlternateMasters
,
7079 { "Number of alternate masters", "ptp.v2.mm.numberOfAlternateMasters",
7080 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
7083 { &hf_ptp_v2_mm_logAlternateMulticastSyncInterval
,
7084 { "Alternate multicast sync interval", "ptp.v2.mm.AlternateMulticastSyncInterval",
7085 FT_INT8
, BASE_DEC
, NULL
, 0x00,
7088 { &hf_ptp_v2_mm_transmitAlternateMulticastSync
,
7089 { "Transmit alternate multicast sync", "ptp.v2.mm.transmitAlternateMulticastSync",
7090 FT_BOOLEAN
, 8, NULL
, 0x01,
7093 { &hf_ptp_v2_oe_tlv_smpte_subtype
,
7094 { "SMPTE SubType", "ptp.v2.oe.smpte.SubType",
7095 FT_UINT24
, BASE_HEX
, VALS(ptp_v2_org_smpte_subtype_vals
), 0x00,
7098 { &hf_ptp_v2_oe_tlv_subtype_smpte_data
,
7099 { "SMPTE Data", "ptp.v2.oe.smpte.data",
7100 FT_NONE
, BASE_NONE
, NULL
, 0x00,
7103 { &hf_ptp_v2_oe_tlv_subtype_smpte_defaultsystemframerate
,
7104 { "defaultSystemFramerate", "ptp.v2.oe.smpte.defaultsystemframerate",
7105 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
7108 { &hf_ptp_v2_oe_tlv_subtype_smpte_defaultsystemframerate_numerator
,
7109 { "Numerator", "ptp.v2.oe.smpte.defaultsystemframerate.numerator",
7110 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
7113 { &hf_ptp_v2_oe_tlv_subtype_smpte_defaultsystemframerate_denominator
,
7114 { "Denominator", "ptp.v2.oe.smpte.defaultsystemframerate.denominator",
7115 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
7118 { &hf_ptp_v2_oe_tlv_subtype_smpte_masterlockingstatus
,
7119 { "masterLockingStatus", "ptp.v2.oe.smpte.masterlockingstatus",
7120 FT_UINT8
, BASE_DEC
, VALS(ptp_v2_org_smpte_subtype_masterlockingstatus_vals
), 0x00,
7123 { &hf_ptp_v2_oe_tlv_subtype_smpte_timeaddressflags
,
7124 { "timeAddressFlags", "ptp.v2.oe.smpte.timeaddressflags",
7125 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
7128 { &hf_ptp_v2_oe_tlv_subtype_smpte_timeaddressflags_drop
,
7129 { "Drop frame", "ptp.v2.oe.smpte.timeaddressflags.drop",
7130 FT_BOOLEAN
, 8, TFS(&tfs_inuse_not_inuse
), PTP_V2_FLAGS_OE_SMPTE_TIME_ADDRESS_FIELD_DROP
,
7133 { &hf_ptp_v2_oe_tlv_subtype_smpte_timeaddressflags_color
,
7134 { "Color frame identification", "ptp.v2.oe.smpte.timeaddressflags.color",
7135 FT_BOOLEAN
, 8, TFS(&tfs_inuse_not_inuse
), PTP_V2_FLAGS_OE_SMPTE_TIME_ADDRESS_FIELD_COLOR
,
7138 { &hf_ptp_v2_oe_tlv_subtype_smpte_currentlocaloffset
,
7139 { "currentLocalOffset", "ptp.v2.oe.smpte.currentlocaloffset",
7140 FT_INT32
, BASE_DEC
, NULL
, 0x00,
7141 "Offset in seconds of Local Time from grandmaster PTP time", HFILL
}
7143 { &hf_ptp_v2_oe_tlv_subtype_smpte_jumpseconds
,
7144 { "jumpSeconds", "ptp.v2.oe.smpte.jumpseconds",
7145 FT_INT32
, BASE_DEC
, NULL
, 0x00,
7146 "Size of next discontinuity, in seconds, of Local Time", HFILL
}
7148 { &hf_ptp_v2_oe_tlv_subtype_smpte_timeofnextjump
,
7149 { "timeOfNextJump", "ptp.v2.oe.smpte.timeofnextjump",
7150 FT_UINT48
, BASE_DEC
, NULL
, 0x00,
7151 "Value of the seconds portion at the time that the next discontinuity of the currentLocalOffset will occur", HFILL
}
7153 { &hf_ptp_v2_oe_tlv_subtype_smpte_timeofnextjam
,
7154 { "timeOfNextJam", "ptp.v2.oe.smpte.timeofnextjam",
7155 FT_UINT48
, BASE_DEC
, NULL
, 0x00,
7156 "Value of the seconds portion to the next scheduled Daily Jam", HFILL
}
7158 { &hf_ptp_v2_oe_tlv_subtype_smpte_timeofpreviousjam
,
7159 { "timeOfPreviousJam", "ptp.v2.oe.smpte.timeofpreviousjam",
7160 FT_UINT48
, BASE_DEC
, NULL
, 0x00,
7161 "Value of the seconds portion of the previous Daily Jam", HFILL
}
7163 { &hf_ptp_v2_oe_tlv_subtype_smpte_previousjamlocaloffset
,
7164 { "previousJamLocalOffset", "ptp.v2.oe.smpte.previousjamlocaloffset",
7165 FT_INT32
, BASE_DEC
, NULL
, 0x00,
7166 "Value of current LocalOffset at the time of the previous Daily Jam", HFILL
}
7168 { &hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving
,
7169 { "daylightSaving", "ptp.v2.oe.smpte.daylightsaving",
7170 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
7173 { &hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving_current
,
7174 { "Current", "ptp.v2.oe.smpte.daylightsaving.current",
7175 FT_BOOLEAN
, 8, TFS(&tfs_used_notused
), PTP_V2_FLAGS_OE_SMPTE_DAYLIGHT_SAVING_CURRENT
,
7178 { &hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving_next
,
7179 { "Next", "ptp.v2.oe.smpte.daylightsaving.next",
7180 FT_BOOLEAN
, 8, TFS(&tfs_used_notused
), PTP_V2_FLAGS_OE_SMPTE_DAYLIGHT_SAVING_NEXT
,
7183 { &hf_ptp_v2_oe_tlv_subtype_smpte_daylightsaving_previous
,
7184 { "Previous", "ptp.v2.oe.smpte.daylightsaving.previous",
7185 FT_BOOLEAN
, 8, TFS(&tfs_used_notused
), PTP_V2_FLAGS_OE_SMPTE_DAYLIGHT_SAVING_PREVIOUS
,
7188 { &hf_ptp_v2_oe_tlv_subtype_smpte_leapsecondjump
,
7189 { "leapSecondJump", "ptp.v2.oe.smpte.leapsecondjump",
7190 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
7193 { &hf_ptp_v2_oe_tlv_subtype_smpte_leapsecondjump_change
,
7194 { "Change in number", "ptp.v2.oe.smpte.leapsecondjump.change",
7195 FT_BOOLEAN
, 8, TFS(&tfs_set_notset
), PTP_V2_FLAGS_OE_SMPTE_LEAP_SECOND_JUMP_CHANGE
,
7198 { &hf_ptp_v2_analysis_followup_to_sync
,
7199 { "This is a Follow Up to Sync in Frame", "ptp.v2.analysis.followuptosync",
7200 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x0,
7201 "Which message is this a Follow Up for", HFILL
}
7203 { &hf_ptp_v2_analysis_sync_to_followup
,
7204 { "This is a Sync to Follow Up in Frame", "ptp.v2.analysis.synctofollowup",
7205 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x0,
7206 "Which message is this a Sync for", HFILL
}
7208 { &hf_ptp_v2_analysis_pdelayreq_to_pdelayres
,
7209 { "This is a Peer Delay Request to Response in Frame", "ptp.v2.analysis.pdelayreqtores",
7210 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x0,
7211 "Which Peer Delay Response is this a Peer Delay Request for", HFILL
}
7213 { &hf_ptp_v2_analysis_pdelayres_to_pdelayreq
,
7214 { "This is a Peer Delay Response to Request in Frame", "ptp.v2.analysis.pdelayrestoreq",
7215 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x0,
7216 "Which Peer Delay Request is this a Peer Delay Response for", HFILL
}
7218 { &hf_ptp_v2_analysis_pdelayres_to_pdelayfup
,
7219 { "This is a Peer Delay Response to Follow Up in Frame", "ptp.v2.analysis.pdelayfuptores",
7220 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x0,
7221 "Which Peer Delay FollowUp is this a Peer Delay Response for", HFILL
}
7223 { &hf_ptp_v2_analysis_pdelayfup_to_pdelayres
,
7224 { "This is a Peer Delay Follow Up to Response in Frame", "ptp.v2.analysis.pdelayrestofup",
7225 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x0,
7226 "Which Peer Delay Response is this a Peer Delay FollowUp for", HFILL
}
7228 { &hf_ptp_v2_analysis_sync_timestamp
,
7229 { "calculatedSyncTimestamp", "ptp.v2.analysis.sync.timestamp",
7230 FT_DOUBLE
, BASE_NONE
, NULL
, 0x00,
7233 { &hf_ptp_v2_analysis_sync_timestamp_seconds
,
7234 { "calculatedSyncTimestamp (s)", "ptp.v2.analysis.sync.timestamp_seconds",
7235 FT_UINT64
, BASE_DEC
, NULL
, 0x00,
7238 { &hf_ptp_v2_analysis_sync_timestamp_nanoseconds
,
7239 { "calculatedSyncTimestamp (ns)", "ptp.v2.analysis.sync.timestamp_nanoseconds",
7240 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
7243 { &hf_ptp_v2_analysis_sync_period
,
7244 { "measuredMessagePeriod", "ptp.v2.analysis.sync.measuredMessagePeriod",
7245 FT_DOUBLE
, BASE_NONE
, NULL
, 0x00,
7248 { &hf_ptp_v2_analysis_sync_rateRatio
,
7249 { "calculatedSyncRateRatio", "ptp.v2.analysis.sync.calculatedRateRatio",
7250 FT_DOUBLE
, BASE_NONE
, NULL
, 0x00,
7253 { &hf_ptp_v2_analysis_sync_rateRatio_ppm
,
7254 { "calculatedSyncRateRatio PPM", "ptp.v2.analysis.sync.calculatedRateRatio_ppm",
7255 FT_INT32
, BASE_DEC
, NULL
, 0x00,
7258 { &hf_ptp_v2_analysis_pdelay_mpd_unscaled
,
7259 { "calculatedUnscaledMeanPropagationDelay", "ptp.v2.analysis.pdelay.meanpropdelay_unscaled",
7260 FT_DOUBLE
, BASE_NONE
, NULL
, 0x00,
7263 { &hf_ptp_v2_analysis_pdelay_mpd_unscaled_seconds
,
7264 { "calculatedUnscaledMeanPropagationDelay (s)", "ptp.v2.analysis.pdelay.meanpropdelay_unscaled_seconds",
7265 FT_INT64
, BASE_DEC
, NULL
, 0x00,
7268 { &hf_ptp_v2_analysis_pdelay_mpd_unscaled_nanoseconds
,
7269 { "calculatedUnscaledMeanPropagationDelay (ns)", "ptp.v2.analysis.pdelay.meanpropdelay_unscaled_nanoseconds",
7270 FT_INT32
, BASE_DEC
, NULL
, 0x00,
7273 { &hf_ptp_v2_analysis_pdelay_mpd_scaled
,
7274 { "calculatedScaledMeanPropagationDelay", "ptp.v2.analysis.pdelay.meanpropdelay_scaled",
7275 FT_DOUBLE
, BASE_NONE
, NULL
, 0x00,
7278 { &hf_ptp_v2_analysis_pdelay_period
,
7279 { "measuredMessagePeriod", "ptp.v2.analysis.pdelay.measuredMessagePeriod",
7280 FT_DOUBLE
, BASE_NONE
, NULL
, 0x00,
7283 { &hf_ptp_v2_analysis_pdelay_neighRateRatio
,
7284 { "calculatedNeighborRateRatio", "ptp.v2.analysis.pdelay.calculatedNeighborRateRatio",
7285 FT_DOUBLE
, BASE_NONE
, NULL
, 0x00,
7288 { &hf_ptp_v2_analysis_pdelay_neighRateRatio_ppm
,
7289 { "calculatedNeighborRateRatio PPM", "ptp.v2.analysis.pdelay.calculatedNeighborRateRatio_ppm",
7290 FT_INT32
, BASE_DEC
, NULL
, 0x00,
7296 /* Setup protocol subtree array */
7297 static int *ett
[] = {
7303 &ett_ptp_v2_majorsdoid
,
7305 &ett_ptp_v2_clockidentity
,
7306 &ett_ptp_v2_correction
,
7309 &ett_ptp_v2_managementData
,
7310 &ett_ptp_v2_clockType
,
7311 &ett_ptp_v2_physicalLayerProtocol
,
7312 &ett_ptp_v2_protocolAddress
,
7313 &ett_ptp_v2_ptptext
,
7314 &ett_ptp_v2_faultRecord
,
7315 &ett_ptp_v2_timeInterval
,
7317 &ett_ptp_v2_tlv_log_period
,
7318 &ett_ptp_v2_sig_l1sync_flags
,
7319 &ett_ptp_as_sig_tlv_flags
,
7320 &ett_ptp_oe_wr_flags
,
7321 &ett_ptp_oe_smpte_data
,
7322 &ett_ptp_oe_smpte_framerate
,
7323 &ett_ptp_oe_smpte_timeaddress
,
7324 &ett_ptp_oe_smpte_daylightsaving
,
7325 &ett_ptp_oe_smpte_leapsecondjump
,
7326 &ett_ptp_analysis_timestamp
,
7327 &ett_ptp_analysis_mean_propagation_delay
,
7330 static ei_register_info ei
[] = {
7331 { &ei_ptp_v2_msg_len_too_large
, { "ptp.v2.msg_len_too_large", PI_MALFORMED
, PI_ERROR
, "Message length goes past the end of the packet", EXPFILL
}},
7332 { &ei_ptp_v2_msg_len_too_small
, { "ptp.v2.msg_len_too_small", PI_MALFORMED
, PI_ERROR
, "Message length too short to include the message length field", EXPFILL
}},
7333 { &ei_ptp_v2_sync_no_followup
, { "ptp.v2.sync_no_fup", PI_PROTOCOL
, PI_WARN
, "No Follow Up for this Two Step Sync", EXPFILL
}},
7334 { &ei_ptp_v2_sync_no_fup_tlv
, { "ptp.v2.sync_no_fup_tlv", PI_PROTOCOL
, PI_WARN
, "No Follow Up Information TLV for this gPTP One Step Sync", EXPFILL
}},
7335 { &ei_ptp_v2_sync_with_fup_tlv
, { "ptp.v2.sync_with_fup_tlv", PI_PROTOCOL
, PI_WARN
, "Two Step Sync should not have Follow Up Information TLV", EXPFILL
}},
7336 { &ei_ptp_v2_followup_no_sync
, { "ptp.v2.fup_without_sync", PI_PROTOCOL
, PI_WARN
, "No Sync for this Follow Up", EXPFILL
}},
7337 { &ei_ptp_v2_followup_no_tlv
, { "ptp.v2.fup_without_fup_tlv", PI_PROTOCOL
, PI_WARN
, "Follow Up without Follow Up TLV", EXPFILL
}},
7338 { &ei_ptp_v2_pdreq_no_pdresp
, { "ptp.v2.pdelay_req_without_resp", PI_PROTOCOL
, PI_WARN
, "No Response for this Peer Delay Request", EXPFILL
}},
7339 { &ei_ptp_v2_pdresp_no_pdreq
, { "ptp.v2.pdelay_resp_without_req", PI_PROTOCOL
, PI_WARN
, "No Request for this Peer Delay Response", EXPFILL
}},
7340 { &ei_ptp_v2_pdresp_no_pdfup
, { "ptp.v2.pdelay_resp_without_fup", PI_PROTOCOL
, PI_WARN
, "No Follow Up for this Peer Delay Response", EXPFILL
}},
7341 { &ei_ptp_v2_pdresp_twostep
, { "ptp.v2.pdelay_resp_two_step_false", PI_PROTOCOL
, PI_WARN
, "Peer Delay Response with Two Step Flag set to false but Follow Up received", EXPFILL
}},
7342 { &ei_ptp_v2_pdfup_no_pdresp
, { "ptp.v2.pdelay_fup_without_resp", PI_PROTOCOL
, PI_WARN
, "No Response for this Peer Delay Follow Up", EXPFILL
}},
7343 { &ei_ptp_v2_period_invalid
, { "ptp.v2.period.invalid", PI_PROTOCOL
, PI_WARN
, "Period invalid", EXPFILL
}},
7344 { &ei_ptp_v2_as_tlv_in_non_as
, { "ptp.v2.as_tlv_in_non_as", PI_PROTOCOL
, PI_WARN
, "TLV defined for 802.1AS but this is PTPv2", EXPFILL
}},
7347 expert_module_t
* expert_ptp
;
7349 /* Register the protocol name and description */
7350 proto_ptp
= proto_register_protocol("Precision Time Protocol (IEEE1588)", "PTP", "ptp");
7352 /* Required function calls to register the header fields and subtrees used */
7353 proto_register_field_array(proto_ptp
, hf
, array_length(hf
));
7354 proto_register_subtree_array(ett
, array_length(ett
));
7356 expert_ptp
= expert_register_protocol(proto_ptp
);
7357 expert_register_field_array(expert_ptp
, ei
, array_length(ei
));
7359 /* Get the decimal point based on locale */
7360 decimal_point
= localeconv()->decimal_point
;
7363 module_t
*ptp_module
= prefs_register_protocol(proto_ptp
, NULL
);
7364 prefs_register_bool_preference(ptp_module
, "analyze_ptp_messages", "Analyze PTP messages",
7365 "Make the PTP dissector analyze PTP messages. Accurate Capture Timestamps required!",
7366 &ptp_analyze_messages
);
7368 prefs_register_bool_preference(ptp_module
, "analyze_ptp_strict_minor_version_matching", "Analysis: Only match messages, if minor version matches",
7369 "Take minor version for matching of messages into account!",
7370 &ptp_analyze_messages_with_minor_version
);
7372 prefs_register_uint_preference(ptp_module
, "analyze_ptp_delta", "Analysis: Max message delta",
7373 "Maximum allowed time between messages of same type when finding "
7374 "consecutive messages for analysis calculations.",
7375 10, &ptp_analysis_max_consecutive_delta
);
7377 /* Setup analysis data structures */
7378 ptp_clocks
= wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash
, g_int64_equal
);
7380 ptpv2_tlv_org_id_subdissector_table
= register_dissector_table("ptp.v2.tlv.oe.organizationId", "PTPv2 TLV Organization ID", proto_ptp
, FT_UINT24
, BASE_HEX
);
7385 proto_reg_handoff_ptp(void) {
7386 dissector_handle_t ptp_handle
;
7387 dissector_handle_t ethertype_ptp_handle
;
7389 ptp_handle
= register_dissector("ptp", dissect_ptp
, proto_ptp
);
7390 ethertype_ptp_handle
= register_dissector("ptp_over_ethernet", dissect_ptp_oE
, proto_ptp
);
7392 dissector_add_uint_range_with_preference("udp.port", PTP_PORT_RANGE
, ptp_handle
);
7393 dissector_add_uint("ethertype", ETHERTYPE_PTP
, ethertype_ptp_handle
);
7397 * Editor modelines - https://www.wireshark.org/tools/modelines.html
7402 * indent-tabs-mode: nil
7405 * vi: set shiftwidth=4 tabstop=8 expandtab:
7406 * :indentSize=4:tabSize=8:noTabs=true: