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>
12 * - Markus Seehofer 09.08.2005 <mseehofe@nt.hirschmann.de>
13 * - Included the "startingBoundaryHops" field in
14 * ptp_management messages.
15 * - Christian Schaer 07.07.2006 <scc@zhwin.ch>
16 * - Added support for PTP version 2
17 * - Markus Renz 2007-06-01
18 * - updated support for PTPv2
19 * - Markus Renz added Management for PTPv2, update to Draft 2.2
20 * - Torrey Atcitty & Dave Olsen 05.14.2010
21 * - Added support for 802.1AS D7.0
25 * Wireshark - Network traffic analyzer
26 * By Gerald Combs <gerald@wireshark.org>
27 * Copyright 1998 Gerald Combs
29 * This program is free software; you can redistribute it and/or
30 * modify it under the terms of the GNU General Public License
31 * as published by the Free Software Foundation; either version 2
32 * of the License, or (at your option) any later version.
34 * This program is distributed in the hope that it will be useful,
35 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 * GNU General Public License for more details.
39 * You should have received a copy of the GNU General Public License
40 * along with this program; if not, write to the Free Software
41 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
54 #include <epan/packet.h>
55 #include <epan/etypes.h>
58 /**********************************************************/
59 /* Port definition's for PTP */
60 /**********************************************************/
61 #define EVENT_PORT_PTP 319
62 #define GENERAL_PORT_PTP 320
64 /*END Port definition's for PTP*/
66 static int proto_ptp = -1;
68 /***********************************************************************************/
69 /* Definitions and fields for PTPv1 dissection. */
70 /***********************************************************************************/
73 /**********************************************************/
74 /* Offsets of fields within a PTPv1 packet. */
75 /**********************************************************/
77 /*Common offsets for all Messages (Synch, Delay_Req, Follow_Up, Delay_Resp ....)*/
78 #define PTP_VERSIONPTP_OFFSET 0
79 #define PTP_VERSIONNETWORK_OFFSET 2
80 #define PTP_SUBDOMAIN_OFFSET 4
81 #define PTP_MESSAGETYPE_OFFSET 20
82 #define PTP_SOURCECOMMUNICATIONTECHNOLOGY_OFFSET 21
83 #define PTP_SOURCEUUID_OFFSET 22
84 #define PTP_SOURCEPORTID_OFFSET 28
85 #define PTP_SEQUENCEID_OFFSET 30
86 #define PTP_CONTROL_OFFSET 32
87 #define PTP_FLAGS_OFFSET 34
88 #define PTP_FLAGS_LI61_OFFSET 34
89 #define PTP_FLAGS_LI59_OFFSET 34
90 #define PTP_FLAGS_BOUNDARY_CLOCK_OFFSET 34
91 #define PTP_FLAGS_ASSIST_OFFSET 34
92 #define PTP_FLAGS_EXT_SYNC_OFFSET 34
93 #define PTP_FLAGS_PARENT_STATS_OFFSET 34
94 #define PTP_FLAGS_SYNC_BURST_OFFSET 34
96 /*Offsets for PTP_Sync and Delay_Req (=SDR) messages*/
97 #define PTP_SDR_ORIGINTIMESTAMP_OFFSET 40
98 #define PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET 40
99 #define PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET 44
100 #define PTP_SDR_EPOCHNUMBER_OFFSET 48
101 #define PTP_SDR_CURRENTUTCOFFSET_OFFSET 50
102 #define PTP_SDR_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 53
103 #define PTP_SDR_GRANDMASTERCLOCKUUID_OFFSET 54
104 #define PTP_SDR_GRANDMASTERPORTID_OFFSET 60
105 #define PTP_SDR_GRANDMASTERSEQUENCEID_OFFSET 62
106 #define PTP_SDR_GRANDMASTERCLOCKSTRATUM_OFFSET 67
107 #define PTP_SDR_GRANDMASTERCLOCKIDENTIFIER_OFFSET 68
108 #define PTP_SDR_GRANDMASTERCLOCKVARIANCE_OFFSET 74
109 #define PTP_SDR_GRANDMASTERPREFERRED_OFFSET 77
110 #define PTP_SDR_GRANDMASTERISBOUNDARYCLOCK_OFFSET 79
111 #define PTP_SDR_SYNCINTERVAL_OFFSET 83
112 #define PTP_SDR_LOCALCLOCKVARIANCE_OFFSET 86
113 #define PTP_SDR_LOCALSTEPSREMOVED_OFFSET 90
114 #define PTP_SDR_LOCALCLOCKSTRATUM_OFFSET 95
115 #define PTP_SDR_LOCALCLOCKIDENTIFIER_OFFSET 96
116 #define PTP_SDR_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET 101
117 #define PTP_SDR_PARENTUUID_OFFSET 102
118 #define PTP_SDR_PARENTPORTFIELD_OFFSET 110
119 #define PTP_SDR_ESTIMATEDMASTERVARIANCE_OFFSET 114
120 #define PTP_SDR_ESTIMATEDMASTERDRIFT_OFFSET 116
121 #define PTP_SDR_UTCREASONABLE_OFFSET 123
123 /*Offsets for Follow_Up (=FU) messages*/
124 #define PTP_FU_ASSOCIATEDSEQUENCEID_OFFSET 42
125 #define PTP_FU_PRECISEORIGINTIMESTAMP_OFFSET 44
126 #define PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET 44
127 #define PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET 48
129 /*Offsets for Delay_Resp (=DR) messages*/
130 #define PTP_DR_DELAYRECEIPTTIMESTAMP_OFFSET 40
131 #define PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET 40
132 #define PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET 44
133 #define PTP_DR_REQUESTINGSOURCECOMMUNICATIONTECHNOLOGY_OFFSET 49
134 #define PTP_DR_REQUESTINGSOURCEUUID_OFFSET 50
135 #define PTP_DR_REQUESTINGSOURCEPORTID_OFFSET 56
136 #define PTP_DR_REQUESTINGSOURCESEQUENCEID_OFFSET 58
138 /*Offsets for Management (=MM) messages*/
139 #define PTP_MM_TARGETCOMMUNICATIONTECHNOLOGY_OFFSET 41
140 #define PTP_MM_TARGETUUID_OFFSET 42
141 #define PTP_MM_TARGETPORTID_OFFSET 48
142 #define PTP_MM_STARTINGBOUNDARYHOPS_OFFSET 50
143 #define PTP_MM_BOUNDARYHOPS_OFFSET 52
144 #define PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET 55
145 #define PTP_MM_PARAMETERLENGTH_OFFSET 58
147 /*PARAMETERLENGTH > 0*/
148 #define PTP_MM_MESSAGEPARAMETERS_OFFSET 60
150 /*PTP_MM_CLOCK_IDENTITY (PARAMETERLENGTH = 64)*/
151 #define PTP_MM_CLOCK_IDENTITY_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET 63
152 #define PTP_MM_CLOCK_IDENTITY_CLOCKUUIDFIELD_OFFSET 64
153 #define PTP_MM_CLOCK_IDENTITY_CLOCKPORTFIELD_OFFSET 74
154 #define PTP_MM_CLOCK_IDENTITY_MANUFACTURERIDENTITY_OFFSET 76
156 /*PTP_MM_INITIALIZE_CLOCK (PARAMETERLENGTH = 4)*/
157 #define PTP_MM_INITIALIZE_CLOCK_INITIALISATIONKEY_OFFSET 62
159 /*PTP_MM_SET_SUBDOMAIN (PARAMETERLENGTH = 16)*/
160 #define PTP_MM_SET_SUBDOMAIN_SUBDOMAINNAME_OFFSET 60
162 /*PTP_MM_DEFAULT_DATA_SET (PARAMETERLENGTH = 76)*/
163 #define PTP_MM_DEFAULT_DATA_SET_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET 63
164 #define PTP_MM_DEFAULT_DATA_SET_CLOCKUUIDFIELD_OFFSET 64
165 #define PTP_MM_DEFAULT_DATA_SET_CLOCKPORTFIELD_OFFSET 74
166 #define PTP_MM_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET 79
167 #define PTP_MM_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET 80
168 #define PTP_MM_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET 86
169 #define PTP_MM_DEFAULT_DATA_SET_CLOCKFOLLOWUPCAPABLE_OFFSET 89
170 #define PTP_MM_DEFAULT_DATA_SET_PREFERRED_OFFSET 95
171 #define PTP_MM_DEFAULT_DATA_SET_INITIALIZABLE_OFFSET 99
172 #define PTP_MM_DEFAULT_DATA_SET_EXTERNALTIMING_OFFSET 103
173 #define PTP_MM_DEFAULT_DATA_SET_ISBOUNDARYCLOCK_OFFSET 107
174 #define PTP_MM_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET 111
175 #define PTP_MM_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET 112
176 #define PTP_MM_DEFAULT_DATA_SET_NUMBERPORTS_OFFSET 130
177 #define PTP_MM_DEFAULT_DATA_SET_NUMBERFOREIGNRECORDS_OFFSET 134
179 /*PTP_MM_UPDATE_DEFAULT_DATA_SET (PARAMETERLENGTH = 36)*/
180 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET 63
181 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET 64
182 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET 70
183 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_PREFERRED_OFFSET 75
184 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET 79
185 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET 80
187 /*PTP_MM_CURRENT_DATA_SET (PARAMETERLENGTH = 20)*/
188 #define PTP_MM_CURRENT_DATA_SET_STEPSREMOVED_OFFSET 62
189 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTER_OFFSET 64
190 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET 64
191 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET 68
192 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAY_OFFSET 72
193 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET 72
194 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET 76
196 /*PTP_MM_PARENT_DATA_SET (PARAMETERLENGTH = 90)*/
197 #define PTP_MM_PARENT_DATA_SET_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET 63
198 #define PTP_MM_PARENT_DATA_SET_PARENTUUID_OFFSET 64
199 #define PTP_MM_PARENT_DATA_SET_PARENTPORTID_OFFSET 74
200 #define PTP_MM_PARENT_DATA_SET_PARENTLASTSYNCSEQUENCENUMBER_OFFSET 78
201 #define PTP_MM_PARENT_DATA_SET_PARENTFOLLOWUPCAPABLE_OFFSET 83
202 #define PTP_MM_PARENT_DATA_SET_PARENTEXTERNALTIMING_OFFSET 87
203 #define PTP_MM_PARENT_DATA_SET_PARENTVARIANCE_OFFSET 90
204 #define PTP_MM_PARENT_DATA_SET_PARENTSTATS_OFFSET 95
205 #define PTP_MM_PARENT_DATA_SET_OBSERVEDVARIANCE_OFFSET 98
206 #define PTP_MM_PARENT_DATA_SET_OBSERVEDDRIFT_OFFSET 100
207 #define PTP_MM_PARENT_DATA_SET_UTCREASONABLE_OFFSET 107
208 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 111
209 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERUUIDFIELD_OFFSET 112
210 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERPORTIDFIELD_OFFSET 122
211 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERSTRATUM_OFFSET 127
212 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERIDENTIFIER_OFFSET 128
213 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERVARIANCE_OFFSET 134
214 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERPREFERRED_OFFSET 139
215 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERISBOUNDARYCLOCK_OFFSET 143
216 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERSEQUENCENUMBER_OFFSET 146
218 /*PTP_MM_PORT_DATA_SET (PARAMETERLENGTH = 52)*/
219 #define PTP_MM_PORT_DATA_SET_RETURNEDPORTNUMBER_OFFSET 62
220 #define PTP_MM_PORT_DATA_SET_PORTSTATE_OFFSET 67
221 #define PTP_MM_PORT_DATA_SET_LASTSYNCEVENTSEQUENCENUMBER_OFFSET 70
222 #define PTP_MM_PORT_DATA_SET_LASTGENERALEVENTSEQUENCENUMBER_OFFSET 74
223 #define PTP_MM_PORT_DATA_SET_PORTCOMMUNICATIONTECHNOLOGY_OFFSET 79
224 #define PTP_MM_PORT_DATA_SET_PORTUUIDFIELD_OFFSET 80
225 #define PTP_MM_PORT_DATA_SET_PORTIDFIELD_OFFSET 90
226 #define PTP_MM_PORT_DATA_SET_BURSTENABLED_OFFSET 95
227 #define PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESSOCTETS_OFFSET 97
228 #define PTP_MM_PORT_DATA_SET_EVENTPORTADDRESSOCTETS_OFFSET 98
229 #define PTP_MM_PORT_DATA_SET_GENERALPORTADDRESSOCTETS_OFFSET 99
230 #define PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESS_OFFSET 100
231 #define PTP_MM_PORT_DATA_SET_EVENTPORTADDRESS_OFFSET 106
232 #define PTP_MM_PORT_DATA_SET_GENERALPORTADDRESS_OFFSET 110
234 /*PTP_MM_GLOBAL_TIME_DATA_SET (PARAMETERLENGTH = 24)*/
235 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIME_OFFSET 60
236 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET 60
237 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET 64
238 #define PTP_MM_GLOBAL_TIME_DATA_SET_CURRENTUTCOFFSET_OFFSET 70
239 #define PTP_MM_GLOBAL_TIME_DATA_SET_LEAP59_OFFSET 75
240 #define PTP_MM_GLOBAL_TIME_DATA_SET_LEAP61_OFFSET 79
241 #define PTP_MM_GLOBAL_TIME_DATA_SET_EPOCHNUMBER_OFFSET 82
243 /*PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES (PARAMETERLENGTH = 16)*/
244 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_CURRENTUTCOFFSET_OFFSET 62
245 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP59_OFFSET 67
246 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP61_OFFSET 71
247 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_EPOCHNUMBER_OFFSET 74
249 /*PTP_MM_GET_FOREIGN_DATA_SET (PARAMETERLENGTH = 4)*/
250 #define PTP_MM_GET_FOREIGN_DATA_SET_RECORDKEY_OFFSET 62
252 /*PTP_MM_FOREIGN_DATA_SET (PARAMETERLENGTH = 28)*/
253 #define PTP_MM_FOREIGN_DATA_SET_RETURNEDPORTNUMBER_OFFSET 62
254 #define PTP_MM_FOREIGN_DATA_SET_RETURNEDRECORDNUMBER_OFFSET 66
255 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 71
256 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERUUIDFIELD_OFFSET 72
257 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERPORTIDFIELD_OFFSET 82
258 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERSYNCS_OFFSET 86
260 /*PTP_MM_SET_SYNC_INTERVAL (PARAMETERLENGTH = 4)*/
261 #define PTP_MM_SET_SYNC_INTERVAL_SYNCINTERVAL_OFFSET 62
263 /*PTP_MM_SET_TIME (PARAMETERLENGTH = 8)*/
264 #define PTP_MM_SET_TIME_LOCALTIME_OFFSET 60
265 #define PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET 60
266 #define PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET 64
268 /*END Offsets of fields within a PTP packet.*/
270 /**********************************************************/
271 /* flag-field-mask-definitions */
272 /**********************************************************/
273 #define PTP_FLAGS_LI61_BITMASK 0x01
274 #define PTP_FLAGS_LI59_BITMASK 0x02
275 #define PTP_FLAGS_BOUNDARY_CLOCK_BITMASK 0x04
276 #define PTP_FLAGS_ASSIST_BITMASK 0x08
277 #define PTP_FLAGS_EXT_SYNC_BITMASK 0x10
278 #define PTP_FLAGS_PARENT_STATS_BITMASK 0x20
279 #define PTP_FLAGS_SYNC_BURST_BITMASK 0x40
281 /*END flag-field-mask-definitions*/
283 /**********************************************************/
284 /* managementMessage definitions */
285 /**********************************************************/
286 #define PTP_MM_NULL 0
287 #define PTP_MM_OBTAIN_IDENTITY 1
288 #define PTP_MM_CLOCK_IDENTITY 2
289 #define PTP_MM_INITIALIZE_CLOCK 3
290 #define PTP_MM_SET_SUBDOMAIN 4
291 #define PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER 5
292 #define PTP_MM_SET_DESIGNATED_PREFERRED_MASTER 6
293 #define PTP_MM_GET_DEFAULT_DATA_SET 7
294 #define PTP_MM_DEFAULT_DATA_SET 8
295 #define PTP_MM_UPDATE_DEFAULT_DATA_SET 9
296 #define PTP_MM_GET_CURRENT_DATA_SET 10
297 #define PTP_MM_CURRENT_DATA_SET 11
298 #define PTP_MM_GET_PARENT_DATA_SET 12
299 #define PTP_MM_PARENT_DATA_SET 13
300 #define PTP_MM_GET_PORT_DATA_SET 14
301 #define PTP_MM_PORT_DATA_SET 15
302 #define PTP_MM_GET_GLOBAL_TIME_DATA_SET 16
303 #define PTP_MM_GLOBAL_TIME_DATA_SET 17
304 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES 18
305 #define PTP_MM_GOTO_FAULTY_STATE 19
306 #define PTP_MM_GET_FOREIGN_DATA_SET 20
307 #define PTP_MM_FOREIGN_DATA_SET 21
308 #define PTP_MM_SET_SYNC_INTERVAL 22
309 #define PTP_MM_DISABLE_PORT 23
310 #define PTP_MM_ENABLE_PORT 24
311 #define PTP_MM_DISABLE_BURST 25
312 #define PTP_MM_ENABLE_BURST 26
313 #define PTP_MM_SET_TIME 27
315 static const value_string ptp_managementMessageKey_vals[] = {
316 {PTP_MM_NULL , "PTP_MM_NULL"},
317 {PTP_MM_OBTAIN_IDENTITY , "PTP_MM_OBTAIN_IDENTITY"},
318 {PTP_MM_CLOCK_IDENTITY , "PTP_MM_CLOCK_IDENTITY"},
319 {PTP_MM_INITIALIZE_CLOCK , "PTP_MM_INITIALIZE_CLOCK"},
320 {PTP_MM_SET_SUBDOMAIN , "PTP_MM_SET_SUBDOMAIN"},
321 {PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER , "PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER"},
322 {PTP_MM_SET_DESIGNATED_PREFERRED_MASTER , "PTP_MM_SET_DESIGNATED_PREFERRED_MASTER"},
323 {PTP_MM_GET_DEFAULT_DATA_SET , "PTP_MM_GET_DEFAULT_DATA_SET"},
324 {PTP_MM_DEFAULT_DATA_SET , "PTP_MM_DEFAULT_DATA_SET"},
325 {PTP_MM_UPDATE_DEFAULT_DATA_SET , "PTP_MM_UPDATE_DEFAULT_DATA_SET"},
326 {PTP_MM_GET_CURRENT_DATA_SET , "PTP_MM_GET_CURRENT_DATA_SET"},
327 {PTP_MM_CURRENT_DATA_SET , "PTP_MM_CURRENT_DATA_SET"},
328 {PTP_MM_GET_PARENT_DATA_SET , "PTP_MM_GET_PARENT_DATA_SET"},
329 {PTP_MM_PARENT_DATA_SET , "PTP_MM_PARENT_DATA_SET"},
330 {PTP_MM_GET_PORT_DATA_SET , "PTP_MM_GET_PORT_DATA_SET"},
331 {PTP_MM_PORT_DATA_SET , "PTP_MM_PORT_DATA_SET"},
332 {PTP_MM_GET_GLOBAL_TIME_DATA_SET , "PTP_MM_GET_GLOBAL_TIME_DATA_SET"},
333 {PTP_MM_GLOBAL_TIME_DATA_SET , "PTP_MM_GLOBAL_TIME_DATA_SET"},
334 {PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES , "PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES"},
335 {PTP_MM_GOTO_FAULTY_STATE , "PTP_MM_GOTO_FAULTY_STATE"},
336 {PTP_MM_GET_FOREIGN_DATA_SET , "PTP_MM_GET_FOREIGN_DATA_SET"},
337 {PTP_MM_FOREIGN_DATA_SET , "PTP_MM_FOREIGN_DATA_SET"},
338 {PTP_MM_SET_SYNC_INTERVAL , "PTP_MM_SET_SYNC_INTERVAL"},
339 {PTP_MM_DISABLE_PORT , "PTP_MM_DISABLE_PORT"},
340 {PTP_MM_ENABLE_PORT , "PTP_MM_ENABLE_PORT"},
341 {PTP_MM_DISABLE_BURST , "PTP_MM_DISABLE_BURST"},
342 {PTP_MM_ENABLE_BURST , "PTP_MM_ENABLE_BURST"},
343 {PTP_MM_SET_TIME , "PTP_MM_SET_TIME"},
346 /*same again but better readable text for info column*/
347 static const value_string ptp_managementMessageKey_infocolumn_vals[] = {
348 {PTP_MM_NULL , "Null"},
349 {PTP_MM_OBTAIN_IDENTITY , "Obtain Identity"},
350 {PTP_MM_CLOCK_IDENTITY , "Clock Identity"},
351 {PTP_MM_INITIALIZE_CLOCK , "Initialize Clock"},
352 {PTP_MM_SET_SUBDOMAIN , "Set Subdomain"},
353 {PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER , "Clear Designated Preferred Master"},
354 {PTP_MM_SET_DESIGNATED_PREFERRED_MASTER , "Set Designated Preferred Master"},
355 {PTP_MM_GET_DEFAULT_DATA_SET , "Get Default Data Set"},
356 {PTP_MM_DEFAULT_DATA_SET , "Default Data Set"},
357 {PTP_MM_UPDATE_DEFAULT_DATA_SET , "Update Default Data Set"},
358 {PTP_MM_GET_CURRENT_DATA_SET , "Get Current Data Set"},
359 {PTP_MM_CURRENT_DATA_SET , "Current Data Set"},
360 {PTP_MM_GET_PARENT_DATA_SET , "Get Parent Data Set"},
361 {PTP_MM_PARENT_DATA_SET , "Parent Data Set"},
362 {PTP_MM_GET_PORT_DATA_SET , "Get Port Data Set"},
363 {PTP_MM_PORT_DATA_SET , "Port Data Set"},
364 {PTP_MM_GET_GLOBAL_TIME_DATA_SET , "Get Global Time Data Set"},
365 {PTP_MM_GLOBAL_TIME_DATA_SET , "Global Time Data Set"},
366 {PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES , "Update Global Time Properties"},
367 {PTP_MM_GOTO_FAULTY_STATE , "Goto Faulty State"},
368 {PTP_MM_GET_FOREIGN_DATA_SET , "Get Foreign Data Set"},
369 {PTP_MM_FOREIGN_DATA_SET , "Foreign Data Set"},
370 {PTP_MM_SET_SYNC_INTERVAL , "Set Sync Interval"},
371 {PTP_MM_DISABLE_PORT , "Disable Port"},
372 {PTP_MM_ENABLE_PORT , "Enable Port"},
373 {PTP_MM_DISABLE_BURST , "Disable Burst"},
374 {PTP_MM_ENABLE_BURST , "Enable Burst"},
375 {PTP_MM_SET_TIME , "Set Time"},
378 /*END managementMessage definitions*/
380 /**********************************************************/
381 /* CommunicationId definitions */
382 /**********************************************************/
386 #define PTP_PROFIBUS 5
390 #define PTP_CONTROLNET 9
391 #define PTP_CANOPEN 10
392 #define PTP_IEEE1394 243
393 #define PTP_IEEE802_11A 244
394 #define PTP_IEEE_WIRELESS 245
395 #define PTP_INFINIBAND 246
396 #define PTP_BLUETOOTH 247
397 #define PTP_IEEE802_15_1 248
398 #define PTP_IEEE1451_3 249
399 #define PTP_IEEE1451_5 250
404 #define PTP_DEFAULT 255
406 static const value_string ptp_communicationid_vals[] = {
407 {PTP_CLOSED , "Closed system outside the scope of this standard."},
408 {PTP_ETHER , "IEEE 802.3 (Ethernet)"},
409 {PTP_FFBUS , "FOUNDATION Fieldbus"},
410 {PTP_PROFIBUS , "PROFIBUS"},
411 {PTP_LON , "LonTalk"},
412 {PTP_DNET , "DeviceNet"},
413 {PTP_SDS , "SmartDistributedSystem"},
414 {PTP_CONTROLNET , "ControlNet"},
415 {PTP_CANOPEN , "CANopen"},
416 {PTP_IEEE1394 , "IEEE 1394"},
417 {PTP_IEEE802_11A , "IEEE 802.11a"},
418 {PTP_IEEE_WIRELESS , "IEEE 802.11b"},
419 {PTP_INFINIBAND , "InfiniBand"},
420 {PTP_BLUETOOTH , "Bluetooth wireless"},
421 {PTP_IEEE802_15_1 , "IEEE 802.15.1"},
422 {PTP_IEEE1451_3 , "IEEE 1451.3"},
423 {PTP_IEEE1451_5 , "IEEE 1451.5"},
424 {PTP_USB , "USB bus"},
425 {PTP_ISA , "ISA bus"},
426 {PTP_PCI , "PCI bus"},
427 {PTP_VXI , "VXI bus"},
428 {PTP_DEFAULT , "Default value"},
431 /*END CommunicationId definitions*/
433 /**********************************************************/
434 /* PTP message types (PTP_CONTROL field) */
435 /**********************************************************/
436 #define PTP_SYNC_MESSAGE 0x00
437 #define PTP_DELAY_REQ_MESSAGE 0x01
438 #define PTP_FOLLOWUP_MESSAGE 0x02
439 #define PTP_DELAY_RESP_MESSAGE 0x03
440 #define PTP_MANAGEMENT_MESSAGE 0x04
441 #define PTP_OTHER_MESSAGE 0x05
443 static const value_string ptp_control_vals[] = {
444 {PTP_SYNC_MESSAGE , "Sync Message"},
445 {PTP_DELAY_REQ_MESSAGE , "Delay_Req Message"},
446 {PTP_FOLLOWUP_MESSAGE , "Follow_Up Message"},
447 {PTP_DELAY_RESP_MESSAGE , "Delay_Resp Message"},
448 {PTP_MANAGEMENT_MESSAGE , "Management Message"},
449 {PTP_OTHER_MESSAGE , "Other Message"},
452 /*END PTP message types*/
454 /**********************************************************/
455 /* Channel values for the PTP_MESSAGETYPE field */
456 /**********************************************************/
457 #define PTP_MESSAGETYPE_EVENT 0x01
458 #define PTP_MESSAGETYPE_GENERAL 0x02
460 static const value_string ptp_messagetype_vals[] = {
461 {PTP_MESSAGETYPE_EVENT , "Event Message"},
462 {PTP_MESSAGETYPE_GENERAL , "General Message"},
465 /*END channel values for the PTP_MESSAGETYPE field*/
467 /* Channel values for boolean vals (FLAGS)*/
469 static const value_string ptp_bool_vals[] = {
474 /**********************************************************/
475 /* Initialize the protocol and registered fields */
476 /**********************************************************/
478 static int hf_ptp_versionptp = -1;
479 static int hf_ptp_versionnetwork = -1;
480 static int hf_ptp_subdomain = -1;
481 static int hf_ptp_messagetype = -1;
482 static int hf_ptp_sourcecommunicationtechnology = -1;
483 static int hf_ptp_sourceuuid = -1;
484 static int hf_ptp_sourceportid = -1;
485 static int hf_ptp_sequenceid = -1;
486 static int hf_ptp_control = -1;
487 static int hf_ptp_flags = -1;
488 static int hf_ptp_flags_li61 = -1;
489 static int hf_ptp_flags_li59 = -1;
490 static int hf_ptp_flags_boundary_clock = -1;
491 static int hf_ptp_flags_assist = -1;
492 static int hf_ptp_flags_ext_sync = -1;
493 static int hf_ptp_flags_parent = -1;
494 static int hf_ptp_flags_sync_burst = -1;
496 /*Fields for ptp_sync and delay_req (=sdr) messages*/
497 static int hf_ptp_sdr_origintimestamp = -1; /*Field for seconds & nanoseconds*/
498 static int hf_ptp_sdr_origintimestamp_seconds = -1;
499 static int hf_ptp_sdr_origintimestamp_nanoseconds = -1;
500 static int hf_ptp_sdr_epochnumber = -1;
501 static int hf_ptp_sdr_currentutcoffset = -1;
502 static int hf_ptp_sdr_grandmastercommunicationtechnology = -1;
503 static int hf_ptp_sdr_grandmasterclockuuid = -1;
504 static int hf_ptp_sdr_grandmasterportid = -1;
505 static int hf_ptp_sdr_grandmastersequenceid = -1;
506 static int hf_ptp_sdr_grandmasterclockstratum = -1;
507 static int hf_ptp_sdr_grandmasterclockidentifier = -1;
508 static int hf_ptp_sdr_grandmasterclockvariance = -1;
509 static int hf_ptp_sdr_grandmasterpreferred = -1;
510 static int hf_ptp_sdr_grandmasterisboundaryclock = -1;
511 static int hf_ptp_sdr_syncinterval = -1;
512 static int hf_ptp_sdr_localclockvariance = -1;
513 static int hf_ptp_sdr_localstepsremoved = -1;
514 static int hf_ptp_sdr_localclockstratum = -1;
515 static int hf_ptp_sdr_localclockidentifier = -1;
516 static int hf_ptp_sdr_parentcommunicationtechnology = -1;
517 static int hf_ptp_sdr_parentuuid = -1;
518 static int hf_ptp_sdr_parentportfield = -1;
519 static int hf_ptp_sdr_estimatedmastervariance = -1;
520 static int hf_ptp_sdr_estimatedmasterdrift = -1;
521 static int hf_ptp_sdr_utcreasonable = -1;
523 /*Fields for follow_up (=fu) messages*/
524 static int hf_ptp_fu_associatedsequenceid = -1;
525 static int hf_ptp_fu_preciseorigintimestamp = -1;
526 static int hf_ptp_fu_preciseorigintimestamp_seconds = -1;
527 static int hf_ptp_fu_preciseorigintimestamp_nanoseconds = -1;
529 /*Fields for delay_resp (=dr) messages*/
530 static int hf_ptp_dr_delayreceipttimestamp = -1;
531 static int hf_ptp_dr_delayreceipttimestamp_seconds = -1;
532 static int hf_ptp_dr_delayreceipttimestamp_nanoseconds = -1;
533 static int hf_ptp_dr_requestingsourcecommunicationtechnology = -1;
534 static int hf_ptp_dr_requestingsourceuuid = -1;
535 static int hf_ptp_dr_requestingsourceportid = -1;
536 static int hf_ptp_dr_requestingsourcesequenceid = -1;
538 /*Fields for management (=mm) messages*/
539 static int hf_ptp_mm_targetcommunicationtechnology = -1;
540 static int hf_ptp_mm_targetuuid = -1;
541 static int hf_ptp_mm_targetportid = -1;
542 static int hf_ptp_mm_startingboundaryhops = -1;
543 static int hf_ptp_mm_boundaryhops = -1;
544 static int hf_ptp_mm_managementmessagekey = -1;
545 static int hf_ptp_mm_parameterlength = -1;
546 /*parameterlength > 0*/
547 static int hf_ptp_mm_messageparameters = -1;
548 /*ptp_mm_clock_identity (parameterlength = 64)*/
549 static int hf_ptp_mm_clock_identity_clockcommunicationtechnology = -1;
550 static int hf_ptp_mm_clock_identity_clockuuidfield = -1;
551 static int hf_ptp_mm_clock_identity_clockportfield = -1;
552 static int hf_ptp_mm_clock_identity_manufactureridentity = -1;
554 /*ptp_mm_initialize_clock (parameterlength = 4)*/
555 static int hf_ptp_mm_initialize_clock_initialisationkey = -1;
557 /*ptp_mm_set_subdomain (parameterlength = 16)*/
558 static int hf_ptp_mm_set_subdomain_subdomainname = -1;
560 /*ptp_mm_default_data_set (parameterlength = 76)*/
561 static int hf_ptp_mm_default_data_set_clockcommunicationtechnology = -1;
562 static int hf_ptp_mm_default_data_set_clockuuidfield = -1;
563 static int hf_ptp_mm_default_data_set_clockportfield = -1;
564 static int hf_ptp_mm_default_data_set_clockstratum = -1;
565 static int hf_ptp_mm_default_data_set_clockidentifier = -1;
566 static int hf_ptp_mm_default_data_set_clockvariance = -1;
567 static int hf_ptp_mm_default_data_set_clockfollowupcapable = -1;
568 static int hf_ptp_mm_default_data_set_preferred = -1;
569 static int hf_ptp_mm_default_data_set_initializable = -1;
570 static int hf_ptp_mm_default_data_set_externaltiming = -1;
571 static int hf_ptp_mm_default_data_set_isboundaryclock = -1;
572 static int hf_ptp_mm_default_data_set_syncinterval = -1;
573 static int hf_ptp_mm_default_data_set_subdomainname = -1;
574 static int hf_ptp_mm_default_data_set_numberports = -1;
575 static int hf_ptp_mm_default_data_set_numberforeignrecords = -1;
577 /*ptp_mm_update_default_data_set (parameterlength = 36)*/
578 static int hf_ptp_mm_update_default_data_set_clockstratum = -1;
579 static int hf_ptp_mm_update_default_data_set_clockidentifier = -1;
580 static int hf_ptp_mm_update_default_data_set_clockvariance = -1;
581 static int hf_ptp_mm_update_default_data_set_preferred = -1;
582 static int hf_ptp_mm_update_default_data_set_syncinterval = -1;
583 static int hf_ptp_mm_update_default_data_set_subdomainname = -1;
585 /*ptp_mm_current_data_set (parameterlength = 20)*/
586 static int hf_ptp_mm_current_data_set_stepsremoved = -1;
587 static int hf_ptp_mm_current_data_set_offsetfrommaster = -1;
588 static int hf_ptp_mm_current_data_set_offsetfrommasterseconds = -1;
589 static int hf_ptp_mm_current_data_set_offsetfrommasternanoseconds = -1;
590 static int hf_ptp_mm_current_data_set_onewaydelay = -1;
591 static int hf_ptp_mm_current_data_set_onewaydelayseconds = -1;
592 static int hf_ptp_mm_current_data_set_onewaydelaynanoseconds = -1;
594 /*ptp_mm_parent_data_set (parameterlength = 90)*/
595 static int hf_ptp_mm_parent_data_set_parentcommunicationtechnology = -1;
596 static int hf_ptp_mm_parent_data_set_parentuuid = -1;
597 static int hf_ptp_mm_parent_data_set_parentportid = -1;
598 static int hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber = -1;
599 static int hf_ptp_mm_parent_data_set_parentfollowupcapable = -1;
600 static int hf_ptp_mm_parent_data_set_parentexternaltiming = -1;
601 static int hf_ptp_mm_parent_data_set_parentvariance = -1;
602 static int hf_ptp_mm_parent_data_set_parentstats = -1;
603 static int hf_ptp_mm_parent_data_set_observedvariance = -1;
604 static int hf_ptp_mm_parent_data_set_observeddrift = -1;
605 static int hf_ptp_mm_parent_data_set_utcreasonable = -1;
606 static int hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology = -1;
607 static int hf_ptp_mm_parent_data_set_grandmasteruuidfield = -1;
608 static int hf_ptp_mm_parent_data_set_grandmasterportidfield = -1;
609 static int hf_ptp_mm_parent_data_set_grandmasterstratum = -1;
610 static int hf_ptp_mm_parent_data_set_grandmasteridentifier = -1;
611 static int hf_ptp_mm_parent_data_set_grandmastervariance = -1;
612 static int hf_ptp_mm_parent_data_set_grandmasterpreferred = -1;
613 static int hf_ptp_mm_parent_data_set_grandmasterisboundaryclock = -1;
614 static int hf_ptp_mm_parent_data_set_grandmastersequencenumber = -1;
616 /*ptp_mm_port_data_set (parameterlength = 52)*/
617 static int hf_ptp_mm_port_data_set_returnedportnumber = -1;
618 static int hf_ptp_mm_port_data_set_portstate = -1;
619 static int hf_ptp_mm_port_data_set_lastsynceventsequencenumber = -1;
620 static int hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber = -1;
621 static int hf_ptp_mm_port_data_set_portcommunicationtechnology = -1;
622 static int hf_ptp_mm_port_data_set_portuuidfield = -1;
623 static int hf_ptp_mm_port_data_set_portidfield = -1;
624 static int hf_ptp_mm_port_data_set_burstenabled = -1;
625 static int hf_ptp_mm_port_data_set_subdomainaddressoctets = -1;
626 static int hf_ptp_mm_port_data_set_eventportaddressoctets = -1;
627 static int hf_ptp_mm_port_data_set_generalportaddressoctets = -1;
628 static int hf_ptp_mm_port_data_set_subdomainaddress = -1;
629 static int hf_ptp_mm_port_data_set_eventportaddress = -1;
630 static int hf_ptp_mm_port_data_set_generalportaddress = -1;
632 /*ptp_mm_global_time_data_set (parameterlength = 24)*/
633 static int hf_ptp_mm_global_time_data_set_localtime = -1;
634 static int hf_ptp_mm_global_time_data_set_localtimeseconds = -1;
635 static int hf_ptp_mm_global_time_data_set_localtimenanoseconds = -1;
636 static int hf_ptp_mm_global_time_data_set_currentutcoffset = -1;
637 static int hf_ptp_mm_global_time_data_set_leap59 = -1;
638 static int hf_ptp_mm_global_time_data_set_leap61 = -1;
639 static int hf_ptp_mm_global_time_data_set_epochnumber = -1;
641 /*ptp_mm_update_global_time_properties (parameterlength = 16)*/
642 static int hf_ptp_mm_update_global_time_properties_currentutcoffset = -1;
643 static int hf_ptp_mm_update_global_time_properties_leap59 = -1;
644 static int hf_ptp_mm_update_global_time_properties_leap61 = -1;
645 static int hf_ptp_mm_update_global_time_properties_epochnumber = -1;
647 /*ptp_mm_get_foreign_data_set (parameterlength = 4)*/
648 static int hf_ptp_mm_get_foreign_data_set_recordkey = -1;
650 /*ptp_mm_foreign_data_set (parameterlength = 28)*/
651 static int hf_ptp_mm_foreign_data_set_returnedportnumber = -1;
652 static int hf_ptp_mm_foreign_data_set_returnedrecordnumber = -1;
653 static int hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology = -1;
654 static int hf_ptp_mm_foreign_data_set_foreignmasteruuidfield = -1;
655 static int hf_ptp_mm_foreign_data_set_foreignmasterportidfield = -1;
656 static int hf_ptp_mm_foreign_data_set_foreignmastersyncs = -1;
658 /*ptp_mm_set_sync_interval (parameterlength = 4)*/
659 static int hf_ptp_mm_set_sync_interval_syncinterval = -1;
661 /*ptp_mm_set_time (parameterlength = 8)*/
662 static int hf_ptp_mm_set_time_localtime = -1;
663 static int hf_ptp_mm_set_time_localtimeseconds = -1;
664 static int hf_ptp_mm_set_time_localtimenanoseconds = -1;
666 /*END Initialize the protocol and registered fields */
668 /* Initialize the subtree pointers */
669 static gint ett_ptp = -1;
670 static gint ett_ptp_flags = -1;
671 static gint ett_ptp_time = -1;
672 static gint ett_ptp_time2 = -1;
674 /* END Definitions and fields for PTPv1 dissection. */
680 /***********************************************************************************/
681 /* Definitions and fields for PTPv2 dissection. */
682 /***********************************************************************************/
685 /**********************************************************/
686 /* Offsets of fields within a PTPv2 packet. */
687 /**********************************************************/
689 /*Common offsets for all Messages (Sync, Delay_Req, Follow_Up, Delay_Resp ....)*/
690 #define PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET 0
691 #define PTP_V2_VERSIONPTP_OFFSET 1
692 #define PTP_V2_MESSAGE_LENGTH_OFFSET 2
693 #define PTP_V2_DOMAIN_NUMBER_OFFSET 4
694 #define PTP_V2_FLAGS_OFFSET 6
695 #define PTP_V2_CORRECTION_OFFSET 8
696 #define PTP_V2_CORRECTIONNS_OFFSET 8
697 #define PTP_V2_CORRECTIONSUBNS_OFFSET 14
698 #define PTP_V2_CLOCKIDENTITY_OFFSET 20
699 #define PTP_V2_SOURCEPORTID_OFFSET 28
700 #define PTP_V2_SEQUENCEID_OFFSET 30
701 #define PTP_V2_CONTROL_OFFSET 32
702 #define PTP_V2_LOGMESSAGEPERIOD_OFFSET 33
705 /*Offsets for PTP_Announce (=AN) messages*/
706 #define PTP_V2_AN_ORIGINTIMESTAMP_OFFSET 34
707 #define PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET 34
708 #define PTP_V2_AN_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
709 #define PTP_V2_AN_ORIGINCURRENTUTCOFFSET_OFFSET 44
710 #define PTP_V2_AN_PRIORITY_1_OFFSET 47
711 #define PTP_V2_AN_GRANDMASTERCLOCKCLASS_OFFSET 48
712 #define PTP_V2_AN_GRANDMASTERCLOCKACCURACY_OFFSET 49
713 #define PTP_V2_AN_GRANDMASTERCLOCKVARIANCE_OFFSET 50
714 #define PTP_V2_AN_PRIORITY_2_OFFSET 52
715 #define PTP_V2_AN_GRANDMASTERCLOCKIDENTITY_OFFSET 53
716 #define PTP_V2_AN_LOCALSTEPSREMOVED_OFFSET 61
717 #define PTP_V2_AN_TIMESOURCE_OFFSET 63
718 #define PTP_V2_AN_TLV_OFFSET 64
720 /* Announce TLV field offsets */
721 #define PTP_V2_AN_TLV_TYPE_OFFSET 0
722 #define PTP_V2_AN_TLV_LENGTHFIELD_OFFSET 2
724 /* PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR field offsets */
725 #define PTP_V2_AN_TLV_ATOI_KEYFIELD_OFFSET 4
726 #define PTP_V2_AN_TLV_ATOI_CURRENTOFFSET_OFFSET 5
727 #define PTP_V2_AN_TLV_ATOI_JUMPSECONDS_OFFSET 9
728 #define PTP_V2_AN_TLV_ATOI_TIMEOFNEXTJUMP_OFFSET 13
729 #define PTP_V2_AN_TLV_ATOI_DISPLAYNAME_OFFSET 19
731 /* Undissected TLV field offset */
732 #define PTP_V2_AN_TLV_DATA_OFFSET 4
734 /* 802.1AS Path Sequence Offset */
735 #define PTP_AS_AN_TLV_PATH_TRACE_OFFSET 4
737 /*Offsets for PTP_Sync AND PTP_DelayRequest (=SDR) messages*/
738 #define PTP_V2_SDR_ORIGINTIMESTAMP_OFFSET 34
739 #define PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET 34
740 #define PTP_V2_SDR_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
742 /*Offsets for PTP_Follow_Up (=FU) messages*/
743 #define PTP_V2_FU_PRECISEORIGINTIMESTAMP_OFFSET 34
744 #define PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET 34
745 #define PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET 40
747 /* 802.1AS Follow_Up information TLV */
748 #define PTP_AS_FU_TLV_INFORMATION_OFFSET 44
750 /* 802.1AS Follow_Up TLV field offsets */
751 #define PTP_AS_FU_TLV_TYPE_OFFSET 0
752 #define PTP_AS_FU_TLV_LENGTHFIELD_OFFSET 2
753 #define PTP_AS_FU_TLV_ORGANIZATIONID_OFFSET 4
754 #define PTP_AS_FU_TLV_ORGANIZATIONSUBTYPE_OFFSET 7
755 #define PTP_AS_FU_TLV_CUMULATIVESCALEDRATEOFFSET_OFFSET 10
756 #define PTP_AS_FU_TLV_GMTIMEBASEINDICATOR_OFFSET 14
757 #define PTP_AS_FU_TLV_LASTGMPHASECHANGE_OFFSET 16
758 #define PTP_AS_FU_TLV_SCALEDLASTGMFREQCHANGE_OFFSET 28
760 /*Offsets for PTP_DelayResponse (=DR) messages*/
761 #define PTP_V2_DR_RECEIVETIMESTAMP_OFFSET 34
762 #define PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET 34
763 #define PTP_V2_DR_RECEIVETIMESTAMPNANOSECONDS_OFFSET 40
764 #define PTP_V2_DR_REQUESTINGPORTIDENTITY_OFFSET 44
765 #define PTP_V2_DR_REQUESTINGSOURCEPORTID_OFFSET 52
767 /*Offsets for PTP_PDelayRequest (=PDRQ) messages*/
768 #define PTP_V2_PDRQ_ORIGINTIMESTAMP_OFFSET 34
769 #define PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET 34
770 #define PTP_V2_PDRQ_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
771 #define PTP_V2_PDRQ_RESERVED_OFFSET 44
773 /*Offsets for PTP_PDelayResponse (=PDRS) messages*/
774 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMP_OFFSET 34
775 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET 34
776 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPNANOSECONDS_OFFSET 40
777 #define PTP_V2_PDRS_REQUESTINGPORTIDENTITY_OFFSET 44 /* ++ */
778 #define PTP_V2_PDRS_REQUESTINGSOURCEPORTID_OFFSET 52 /* ++ */
781 /*Offsets for PTP_PDelayResponseFollowUp (=PDFU) messages*/
782 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMP_OFFSET 34
783 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET 34
784 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPNANOSECONDS_OFFSET 40
785 #define PTP_V2_PDFU_REQUESTINGPORTIDENTITY_OFFSET 44 /* ++ */
786 #define PTP_V2_PDFU_REQUESTINGSOURCEPORTID_OFFSET 52
789 /*Offsets for PTP_Signalling (=SIG) messages*/
790 #define PTP_V2_SIG_TARGETPORTIDENTITY_OFFSET 34
791 #define PTP_V2_SIG_TARGETPORTID_OFFSET 42
793 /* 802.1AS Signalling Message Interval Request TLV */
794 #define PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET 44
796 /* 802.1AS Signalling TLV field offsets */
797 #define PTP_AS_SIG_TLV_TYPE_OFFSET 0
798 #define PTP_AS_SIG_TLV_LENGTHFIELD_OFFSET 2
799 #define PTP_AS_SIG_TLV_ORGANIZATIONID_OFFSET 4
800 #define PTP_AS_SIG_TLV_ORGANIZATIONSUBTYPE_OFFSET 7
801 #define PTP_AS_SIG_TLV_LINKDELAYINTERVAL_OFFSET 10
802 #define PTP_AS_SIG_TLV_TIMESYNCINTERVAL_OFFSET 11
803 #define PTP_AS_SIG_TLV_ANNOUNCEINTERVAL_OFFSET 12
804 #define PTP_AS_SIG_TLV_FLAGS_OFFSET 13
806 /**********************************************************/
807 /* Message Interval Request flag-field-mask-definitions */
808 /**********************************************************/
809 #define PTP_AS_FLAGS_COMP_NEIGHBOR_RATE_RATIO_BITMASK 0x0002
810 #define PTP_AS_FLAGS_COMP_NEIGHBOR_PROP_DELAY_BITMASK 0x0004
812 /*Offsets for PTP_V2_Management (=MM) messages*/
813 #define PTP_V2_MM_TARGETPORTIDENTITY_OFFSET 34
814 #define PTP_V2_MM_TARGETPORTID_OFFSET 42
815 #define PTP_V2_MM_STARTINGBOUNDARYHOPS_OFFSET 44
816 #define PTP_V2_MM_BOUNDARYHOPS_OFFSET 45
817 #define PTP_V2_MM_ACTION_OFFSET 46
818 #define PTP_V2_MM_RESERVED_OFFSET 47
820 #define PTP_V2_MM_MANAGEMENTTLV_OFFSET 48
822 #define PTP_V2_MM_TLV_TYPE_OFFSET 48
823 #define PTP_V2_MM_TLV_LENGTHFIELD_OFFSET 50
824 #define PTP_V2_MM_TLV_MANAGEMENTID_OFFSET 52
825 #define PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET 52
826 #define PTP_V2_MM_TLV_DATAFIELD_OFFSET 54
829 #define PTP_V2_TLV_TYPE_RESERVED 0x0000
830 #define PTP_V2_TLV_TYPE_MANAGEMENT 0x0001
831 #define PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS 0x0002
832 #define PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION 0x0003
833 #define PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION 0x0004
834 #define PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION 0x0005
835 #define PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION 0x0006
836 #define PTP_V2_TLV_TYPE_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION 0x0007
837 #define PTP_V2_TLV_TYPE_PATH_TRACE 0x0008
838 #define PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR 0x0009
839 #define PTP_V2_TLV_TYPE_AUTHENTICATION 0x2000
840 #define PTP_V2_TLV_TYPE_AUTHENTICATION_CHALLENGE 0x2001
841 #define PTP_V2_TLV_TYPE_SECURITY_ASSOCIATION_UPDATE 0x2002
842 #define PTP_V2_TLV_TYPE_CUM_FREQ_SCALE_FACTOR_OFFSET 0x2003
844 /* Signalling TLV Object IDs */
845 #define PTP_AS_TLV_OID_TYPE_802 0x0080C2
847 /* PTPv2 Management clockType Boolean[16] Bits mask */
848 #define CLOCKTYPE_ORDINARY_CLOCK 0x8000
849 #define CLOCKTYPE_BOUNDARY_CLOCK 0x4000
850 #define CLOCKTYPE_P2P_TC 0x2000
851 #define CLOCKTYPE_E2E_TC 0x1000
852 #define CLOCKTYPE_MANAGEMENT_NODE 0x0800
853 #define CLOCKTYPE_RESERVED 0x07FF
855 /* PTPv2 Management IDs */
856 #define PTP_V2_MM_ID_NULL_MANAGEMENT 0x0000
857 #define PTP_V2_MM_ID_CLOCK_DESCRIPTION 0x0001
858 #define PTP_V2_MM_ID_USER_DESCRIPTION 0x0002
859 #define PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE 0x0003
860 #define PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE 0x0004
861 #define PTP_V2_MM_ID_INITIALIZE 0x0005
862 #define PTP_V2_MM_ID_FAULT_LOG 0x0006
863 #define PTP_V2_MM_ID_FAULT_LOG_RESET 0x0007
864 #define PTP_V2_MM_ID_DEFAULT_DATA_SET 0x2000
865 #define PTP_V2_MM_ID_CURRENT_DATA_SET 0x2001
866 #define PTP_V2_MM_ID_PARENT_DATA_SET 0x2002
867 #define PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET 0x2003
868 #define PTP_V2_MM_ID_PORT_DATA_SET 0x2004
869 #define PTP_V2_MM_ID_PRIORITY1 0x2005
870 #define PTP_V2_MM_ID_PRIORITY2 0x2006
871 #define PTP_V2_MM_ID_DOMAIN 0x2007
872 #define PTP_V2_MM_ID_SLAVE_ONLY 0x2008
873 #define PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL 0x2009
874 #define PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT 0x200A
875 #define PTP_V2_MM_ID_LOG_SYNC_INTERVAL 0x200B
876 #define PTP_V2_MM_ID_VERSION_NUMBER 0x200C
877 #define PTP_V2_MM_ID_ENABLE_PORT 0x200D
878 #define PTP_V2_MM_ID_DISABLE_PORT 0x200E
879 #define PTP_V2_MM_ID_TIME 0x200F
880 #define PTP_V2_MM_ID_CLOCK_ACCURACY 0x2010
881 #define PTP_V2_MM_ID_UTC_PROPERTIES 0x2011
882 #define PTP_V2_MM_ID_TRACEABILITY_PROPERTIES 0x2012
883 #define PTP_V2_MM_ID_TIMESCALE_PROPERTIES 0x2013
884 #define PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE 0x2014
885 #define PTP_V2_MM_ID_PATH_TRACE_LIST 0x2015
886 #define PTP_V2_MM_ID_PATH_TRACE_ENABLE 0x2016
887 #define PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE 0x2017
888 #define PTP_V2_MM_ID_UNICAST_MASTER_TABLE 0x2018
889 #define PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE 0x2019
890 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE 0x201A
891 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED 0x201B
892 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE 0x201C
893 #define PTP_V2_MM_ID_ALTERNATE_MASTER 0x201D
894 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE 0x201E
895 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME 0x201F
896 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY 0x2020
897 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES 0x2021
898 #define PTP_V2_MM_ID_TC_DEFAULT_DATA_SET 0x4000
899 #define PTP_V2_MM_ID_TC_PORT_DATA_SET 0x4001
900 #define PTP_V2_MM_ID_PRIMARY_DOMAIN 0x4002
901 #define PTP_V2_MM_ID_DELAY_MECHANISM 0x6000
902 #define PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL 0x6001
904 /* Management DataField for DefaultDS */
905 #define PTP_V2_MM_RESERVED1 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 1
906 #define PTP_V2_MM_NUMBERPORTS PTP_V2_MM_TLV_DATAFIELD_OFFSET + 2
907 #define PTP_V2_MM_PRIORITY1 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 4
908 #define PTP_V2_MM_CLOCKQUALITY PTP_V2_MM_TLV_DATAFIELD_OFFSET + 5
909 #define PTP_V2_MM_PRIORITY2 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 9
910 #define PTP_V2_MM_CLOCKIDENTITY PTP_V2_MM_TLV_DATAFIELD_OFFSET + 10
911 #define PTP_V2_MM_DOMAINNUMBER PTP_V2_MM_TLV_DATAFIELD_OFFSET + 18
912 #define PTP_V2_MM_RESERVED2 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 19
914 #define PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK 0x10
916 #define PTP_V2_TRANSPORTSPECIFIC_ASPACKET_BITMASK 0x10
919 /**********************************************************/
920 /* flag-field-mask-definitions */
921 /**********************************************************/
922 #define PTP_V2_FLAGS_LI61_BITMASK 0x0001
923 #define PTP_V2_FLAGS_LI59_BITMASK 0x0002
924 #define PTP_V2_FLAGS_UTC_OFFSET_VALID_BITMASK 0x0004
925 #define PTP_V2_FLAGS_PTP_TIMESCALE_BITMASK 0x0008
926 #define PTP_V2_FLAGS_TIME_TRACEABLE_BITMASK 0x0010
927 #define PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK 0x0020
928 #define PTP_V2_FLAGS_ALTERNATE_BITMASK 0x0100
929 #define PTP_V2_FLAGS_TWO_STEP_BITMASK 0x0200
930 #define PTP_V2_FLAGS_UNICAST_BITMASK 0x0400
931 #define PTP_V2_FLAGS_SPECIFIC1_BITMASK 0x2000
932 #define PTP_V2_FLAGS_SPECIFIC2_BITMASK 0x4000
933 #define PTP_V2_FLAGS_SECURITY_BITMASK 0x8000
937 /**********************************************************/
938 /* PTP v2 message ids (ptp messageid field) */
939 /**********************************************************/
940 #define PTP_V2_SYNC_MESSAGE 0x00
941 #define PTP_V2_DELAY_REQ_MESSAGE 0x01
942 #define PTP_V2_PATH_DELAY_REQ_MESSAGE 0x02
943 #define PTP_V2_PATH_DELAY_RESP_MESSAGE 0x03
944 #define PTP_V2_FOLLOWUP_MESSAGE 0x08
945 #define PTP_V2_DELAY_RESP_MESSAGE 0x09
946 #define PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE 0x0A
947 #define PTP_V2_ANNOUNCE_MESSAGE 0x0B
948 #define PTP_V2_SIGNALLING_MESSAGE 0x0C
949 #define PTP_V2_MANAGEMENT_MESSAGE 0x0D
952 static const value_string ptp_v2_managementID_vals[] = {
953 {PTP_V2_MM_ID_NULL_MANAGEMENT ,"NULL_MANAGEMENT"},
954 {PTP_V2_MM_ID_CLOCK_DESCRIPTION ,"CLOCK_DESCRIPTION"},
955 {PTP_V2_MM_ID_USER_DESCRIPTION ,"USER_DESCRIPTION"},
956 {PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE ,"SAVE_IN_NON_VOLATILE_STORAGE"},
957 {PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE ,"RESET_NON_VOLATILE_STORAGE"},
958 {PTP_V2_MM_ID_INITIALIZE ,"INITIALIZE"},
959 {PTP_V2_MM_ID_FAULT_LOG ,"FAULT_LOG"},
960 {PTP_V2_MM_ID_FAULT_LOG_RESET ,"FAULT_LOG_RESET"},
961 {PTP_V2_MM_ID_DEFAULT_DATA_SET ,"DEFAULT_DATA_SET"},
962 {PTP_V2_MM_ID_CURRENT_DATA_SET ,"CURRENT_DATA_SET"},
963 {PTP_V2_MM_ID_PARENT_DATA_SET ,"PARENT_DATA_SET"},
964 {PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET ,"TIME_PROPERTIES_DATA_SET"},
965 {PTP_V2_MM_ID_PORT_DATA_SET ,"PORT_DATA_SET"},
966 {PTP_V2_MM_ID_PRIORITY1 ,"PRIORITY1"},
967 {PTP_V2_MM_ID_PRIORITY2 ,"PRIORITY2"},
968 {PTP_V2_MM_ID_DOMAIN ,"DOMAIN"},
969 {PTP_V2_MM_ID_SLAVE_ONLY ,"SLAVE_ONLY"},
970 {PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL ,"LOG_ANNOUNCE_INTERVAL"},
971 {PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT ,"ANNOUNCE_RECEIPT_TIMEOUT"},
972 {PTP_V2_MM_ID_LOG_SYNC_INTERVAL ,"LOG_SYNC_INTERVAL"},
973 {PTP_V2_MM_ID_VERSION_NUMBER ,"VERSION_NUMBER"},
974 {PTP_V2_MM_ID_ENABLE_PORT ,"ENABLE_PORT"},
975 {PTP_V2_MM_ID_DISABLE_PORT ,"DISABLE_PORT"},
976 {PTP_V2_MM_ID_TIME ,"TIME"},
977 {PTP_V2_MM_ID_CLOCK_ACCURACY ,"CLOCK_ACCURACY"},
978 {PTP_V2_MM_ID_UTC_PROPERTIES ,"UTC_PROPERTIES"},
979 {PTP_V2_MM_ID_TRACEABILITY_PROPERTIES ,"TRACEABILITY_PROPERTIES"},
980 {PTP_V2_MM_ID_TIMESCALE_PROPERTIES ,"TIMESCALE_PROPERTIES"},
981 {PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE ,"UNICAST_NEGOTIATION_ENABLE"},
982 {PTP_V2_MM_ID_PATH_TRACE_LIST ,"PATH_TRACE_LIST"},
983 {PTP_V2_MM_ID_PATH_TRACE_ENABLE ,"PATH_TRACE_ENABLE"},
984 {PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE ,"GRANDMASTER_CLUSTER_TABLE"},
985 {PTP_V2_MM_ID_UNICAST_MASTER_TABLE ,"UNICAST_MASTER_TABLE"},
986 {PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE ,"UNICAST_MASTER_MAX_TABLE_SIZE"},
987 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE ,"ACCEPTABLE_MASTER_TABLE"},
988 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED ,"ACCEPTABLE_MASTER_TABLE_ENABLED"},
989 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE ,"ACCEPTABLE_MASTER_MAX_TABLE_SIZE"},
990 {PTP_V2_MM_ID_ALTERNATE_MASTER ,"ALTERNATE_MASTER"},
991 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE ,"ALTERNATE_TIME_OFFSET_ENABLE"},
992 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME ,"ALTERNATE_TIME_OFFSET_NAME"},
993 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY ,"ALTERNATE_TIME_OFFSET_MAX_KEY"},
994 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES ,"ALTERNATE_TIME_OFFSET_PROPERTIES"},
995 {PTP_V2_MM_ID_TC_DEFAULT_DATA_SET ,"TC_DEFAULT_DATA_SET"},
996 {PTP_V2_MM_ID_TC_PORT_DATA_SET ,"TC_PORT_DATA_SET"},
997 {PTP_V2_MM_ID_PRIMARY_DOMAIN ,"PRIMARY_DOMAIN"},
998 {PTP_V2_MM_ID_DELAY_MECHANISM ,"DELAY_MECHANISM"},
999 {PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL ,"LOG_MIN_PDELAY_REQ_INTERVAL"},
1002 /*same again but better readable text for info column*/
1003 static const value_string ptp_v2_managementID_infocolumn_vals[] = {
1004 {PTP_V2_MM_ID_NULL_MANAGEMENT ,"Null management"},
1005 {PTP_V2_MM_ID_CLOCK_DESCRIPTION ,"Clock description"},
1006 {PTP_V2_MM_ID_USER_DESCRIPTION ,"User description"},
1007 {PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE ,"Save in non volatile storage"},
1008 {PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE ,"Reset non volatile storage"},
1009 {PTP_V2_MM_ID_INITIALIZE ,"Initialize"},
1010 {PTP_V2_MM_ID_FAULT_LOG ,"Fault log"},
1011 {PTP_V2_MM_ID_FAULT_LOG_RESET ,"Fault log reset"},
1012 {PTP_V2_MM_ID_DEFAULT_DATA_SET ,"Default dataset"},
1013 {PTP_V2_MM_ID_CURRENT_DATA_SET ,"Current dataset"},
1014 {PTP_V2_MM_ID_PARENT_DATA_SET ,"Parent dataset"},
1015 {PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET ,"Time properties dataset"},
1016 {PTP_V2_MM_ID_PORT_DATA_SET ,"Port dataset"},
1017 {PTP_V2_MM_ID_PRIORITY1 ,"Priority 1"},
1018 {PTP_V2_MM_ID_PRIORITY2 ,"Priority 2"},
1019 {PTP_V2_MM_ID_DOMAIN ,"Domain"},
1020 {PTP_V2_MM_ID_SLAVE_ONLY ,"Slave only"},
1021 {PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL ,"Log announce interval"},
1022 {PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT ,"Announce receipt timeout"},
1023 {PTP_V2_MM_ID_LOG_SYNC_INTERVAL ,"Log sync interval"},
1024 {PTP_V2_MM_ID_VERSION_NUMBER ,"Version number"},
1025 {PTP_V2_MM_ID_ENABLE_PORT ,"Enable port"},
1026 {PTP_V2_MM_ID_DISABLE_PORT ,"Disable port"},
1027 {PTP_V2_MM_ID_TIME ,"Time"},
1028 {PTP_V2_MM_ID_CLOCK_ACCURACY ,"Clock accuracy"},
1029 {PTP_V2_MM_ID_UTC_PROPERTIES ,"UTC properties"},
1030 {PTP_V2_MM_ID_TRACEABILITY_PROPERTIES ,"Traceability properties"},
1031 {PTP_V2_MM_ID_TIMESCALE_PROPERTIES ,"Timescale properties"},
1032 {PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE ,"Unicast negotiation enable"},
1033 {PTP_V2_MM_ID_PATH_TRACE_LIST ,"Path trace list"},
1034 {PTP_V2_MM_ID_PATH_TRACE_ENABLE ,"Path trace enable"},
1035 {PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE ,"Grandmaster cluster table"},
1036 {PTP_V2_MM_ID_UNICAST_MASTER_TABLE ,"Unicast master table"},
1037 {PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE ,"Unicast master max table size"},
1038 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE ,"Acceptable master table"},
1039 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED ,"Acceptable master table enabled"},
1040 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE ,"Acceptable master max table size"},
1041 {PTP_V2_MM_ID_ALTERNATE_MASTER ,"Alternate master"},
1042 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE ,"Alternate time offset enable"},
1043 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME ,"Alternate time offset name"},
1044 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY ,"Alternate time offset max key"},
1045 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES ,"Alternate time offset properties"},
1046 {PTP_V2_MM_ID_TC_DEFAULT_DATA_SET ,"Transparent clock default dataset"},
1047 {PTP_V2_MM_ID_TC_PORT_DATA_SET ,"Transparent clock port dataset"},
1048 {PTP_V2_MM_ID_PRIMARY_DOMAIN ,"Primary domain"},
1049 {PTP_V2_MM_ID_DELAY_MECHANISM ,"Delay mechanism"},
1050 {PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL ,"Log min pdelay req. interval"},
1053 static const value_string ptp_v2_TLV_type_vals[] = {
1054 {PTP_V2_TLV_TYPE_RESERVED ,"Reserved"},
1055 {PTP_V2_TLV_TYPE_MANAGEMENT ,"Management"},
1056 {PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS ,"Management error status"},
1057 {PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION ,"Organization extension"},
1058 {PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION ,"Request unicast transmission"},
1059 {PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION ,"Grant unicast transmission"},
1060 {PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION ,"Cancel unicast transmission"},
1061 {PTP_V2_TLV_TYPE_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION ,"Acknowledge cancel unicast transmission"},
1062 {PTP_V2_TLV_TYPE_PATH_TRACE ,"Path trace"},
1063 {PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR,"Alternate time offset indicator"},
1064 {PTP_V2_TLV_TYPE_AUTHENTICATION ,"Authentication"},
1065 {PTP_V2_TLV_TYPE_AUTHENTICATION_CHALLENGE ,"Authentication challenge"},
1066 {PTP_V2_TLV_TYPE_SECURITY_ASSOCIATION_UPDATE ,"Security association update"},
1067 {PTP_V2_TLV_TYPE_CUM_FREQ_SCALE_FACTOR_OFFSET ,"Cum. freq. scale factor offset"},
1070 static const value_string ptp_as_TLV_oid_vals[] = {
1071 {PTP_AS_TLV_OID_TYPE_802 ,"IEEE 802"},
1074 static const value_string ptp2_networkProtocol_vals[] = {
1075 {0x0000, "Reserved"},
1076 {0x0001, "UDP/IPv4"},
1077 {0x0002, "UDP/IPv6"},
1078 {0x0003, "IEEE 802.3"},
1079 {0x0004, "DeviceNet"},
1080 {0x0005, "ControlNet"},
1081 {0x0006, "PROFINET"},
1082 {0x0007, "Reserved"},
1083 {0xFFFE, "Unknown Protocol"},
1084 {0xFFFF, "Reserved"},
1088 static const value_string ptp_v2_messageid_vals[] = {
1089 {PTP_V2_SYNC_MESSAGE, "Sync Message"},
1090 {PTP_V2_DELAY_REQ_MESSAGE, "Delay_Req Message"},
1091 {PTP_V2_PATH_DELAY_REQ_MESSAGE, "Path_Delay_Req Message"},
1092 {PTP_V2_PATH_DELAY_RESP_MESSAGE, "Path_Delay_Resp Message"},
1093 {PTP_V2_FOLLOWUP_MESSAGE, "Follow_Up Message"},
1094 {PTP_V2_DELAY_RESP_MESSAGE, "Delay_Resp Message"},
1095 {PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE,"Path_Delay_Resp_Follow_Up Message"},
1096 {PTP_V2_ANNOUNCE_MESSAGE, "Announce Message"},
1097 {PTP_V2_SIGNALLING_MESSAGE, "Signalling Message"},
1098 {PTP_V2_MANAGEMENT_MESSAGE, "Management Message"},
1102 static const value_string ptp_v2_clockaccuracy_vals[] = {
1103 {0x20, "The time is accurate to within 25 ns"},
1104 {0x21, "The time is accurate to within 100 ns"},
1105 {0x22, "The time is accurate to within 250 ns"},
1106 {0x23, "The time is accurate to within 1 us"},
1107 {0x24, "The time is accurate to within 2,5 us"},
1108 {0x25, "The time is accurate to within 10 us"},
1109 {0x26, "The time is accurate to within 25 us"},
1110 {0x27, "The time is accurate to within 100 us"},
1111 {0x28, "The time is accurate to within 250 us"},
1112 {0x29, "The time is accurate to within 1 ms"},
1113 {0x2A, "The time is accurate to within 2,5 ms"},
1114 {0x2B, "The time is accurate to within 10 ms"},
1115 {0x2C, "The time is accurate to within 25 ms"},
1116 {0x2D, "The time is accurate to within 100 ms"},
1117 {0x2E, "The time is accurate to within 250 ms"},
1118 {0x2F, "The time is accurate to within 1 s"},
1119 {0x30, "The time is accurate to within 10 s"},
1120 {0x31, "The time is accurate to >10 s"},
1122 {0x80, "For use by alternate PTP profiles"},
1123 {0xFE, "Accuracy Unknown"},
1128 static const value_string ptp_v2_timesource_vals[] = {
1129 {0x10, "ATOMIC_CLOCK"},
1131 {0x30, "TERRESTRIAL_RADIO"},
1136 {0xA0, "INTERNAL_OSCILLATOR"},
1141 static const value_string ptp_v2_mm_action_vals[] = {
1146 {0x4, "ACKNOWLEDGE"},
1150 static const value_string ptp2_severityCode_vals[] = {
1151 {0x00, "Emergency: system is unusable"},
1152 {0x01, "Alert: immediate action needed"},
1153 {0x02, "Critical: critical conditions"},
1154 {0x03, "Error: error conditions"},
1155 {0x04, "Warning: warning conditions"},
1156 {0x05, "Notice: normal but significant condition"},
1157 {0x06, "Informational: informational messages"},
1158 {0x07, "Debug: debug-level messages"},
1164 static const value_string ptp2_portState_vals[] = {
1165 {0x01, "INITIALIZING"},
1168 {0x04, "LISTENING"},
1169 {0x05, "PRE_MASTER"},
1172 {0x08, "UNCALIBRATED"},
1177 static const value_string ptp2_delayMechanism_vals[] = {
1184 static const value_string ptp2_managementErrorId_vals[] = {
1185 {0x0000, "Reserved"},
1186 {0x0001, "RESPONSE_TOO_BIG"},
1187 {0x0002, "NO_SUCH_ID"},
1188 {0x0003, "WRONG_LENGTH"},
1189 {0x0004, "WRONG_VALUE"},
1190 {0x0005, "NOT_SETABLE"},
1191 {0x0006, "NOT_SUPPORTED"},
1192 {0x0007, "Reserved"},
1193 {0xFFFE, "GENERAL_ERROR"},
1194 {0xFFFF, "Reserved"},
1198 /**********************************************************/
1199 /* Initialize the protocol and registered fields */
1200 /**********************************************************/
1202 static int hf_ptp_v2_transportspecific = -1;
1203 static int hf_ptp_v2_transportspecific_v1_compatibility = -1; /* over UDP */
1204 static int hf_ptp_v2_transportspecific_802as_conform = -1; /* over Ethernet */
1205 static int hf_ptp_v2_messageid = -1;
1206 static int hf_ptp_v2_versionptp = -1;
1207 static int hf_ptp_v2_messagelength = -1;
1208 static int hf_ptp_v2_domainnumber = -1;
1209 static int hf_ptp_v2_flags = -1;
1210 static int hf_ptp_v2_flags_alternatemaster = -1;
1211 static int hf_ptp_v2_flags_twostep = -1;
1212 static int hf_ptp_v2_flags_unicast = -1;
1213 static int hf_ptp_v2_flags_specific1 = -1;
1214 static int hf_ptp_v2_flags_specific2 = -1;
1215 static int hf_ptp_v2_flags_security = -1;
1216 static int hf_ptp_v2_flags_li61 = -1;
1217 static int hf_ptp_v2_flags_li59 = -1;
1218 static int hf_ptp_v2_flags_utcoffsetvalid = -1;
1219 static int hf_ptp_v2_flags_ptptimescale = -1;
1220 static int hf_ptp_v2_flags_timetraceable = -1;
1221 static int hf_ptp_v2_flags_frequencytraceable = -1;
1222 static int hf_ptp_v2_correction = -1;
1223 static int hf_ptp_v2_correctionsubns = -1;
1224 static int hf_ptp_v2_clockidentity = -1;
1225 static int hf_ptp_v2_sourceportid = -1;
1226 static int hf_ptp_v2_sequenceid = -1;
1227 static int hf_ptp_v2_control = -1;
1228 static int hf_ptp_v2_logmessageperiod = -1;
1231 /*Fields for PTP_Announce (=an) messages*/
1232 static int hf_ptp_v2_an_origintimestamp = -1; /*Field for seconds & nanoseconds*/
1233 static int hf_ptp_v2_an_origintimestamp_seconds = -1;
1234 static int hf_ptp_v2_an_origintimestamp_nanoseconds = -1;
1235 static int hf_ptp_v2_an_origincurrentutcoffset = -1;
1236 static int hf_ptp_v2_an_timesource = -1;
1237 static int hf_ptp_v2_an_localstepsremoved = -1;
1238 static int hf_ptp_v2_an_grandmasterclockidentity = -1;
1239 static int hf_ptp_v2_an_grandmasterclockclass = -1;
1240 static int hf_ptp_v2_an_grandmasterclockaccuracy = -1;
1241 static int hf_ptp_v2_an_grandmasterclockvariance = -1;
1242 static int hf_ptp_v2_an_priority1 = -1;
1243 static int hf_ptp_v2_an_priority2 = -1;
1245 /* Fields for PTP_Announce TLVs */
1246 static int hf_ptp_v2_an_tlv_tlvtype = -1;
1247 static int hf_ptp_v2_an_tlv_lengthfield = -1;
1248 /* Fields for the ALTERNATE_TIME_OFFSET_INDICATOR TLV */
1249 static int hf_ptp_v2_atoi_tlv_keyfield = -1;
1250 static int hf_ptp_v2_atoi_tlv_currentoffset = -1;
1251 static int hf_ptp_v2_atoi_tlv_jumpseconds = -1;
1252 static int hf_ptp_v2_atoi_tlv_timeofnextjump = -1;
1253 static int hf_ptp_v2_atoi_tlv_displayname = -1;
1254 static int hf_ptp_v2_atoi_tlv_displayname_length = -1;
1255 /* Field for the PATH TRACE TLV */
1256 static int hf_ptp_v2_an_tlv_pathsequence = -1;
1258 /* Fields for an undissected TLV */
1259 static int hf_ptp_v2_an_tlv_data = -1;
1261 /*Fields for PTP_Sync AND PTP_DelayRequest (=sdr) messages*/
1262 static int hf_ptp_v2_sdr_origintimestamp = -1; /*Field for seconds & nanoseconds*/
1263 static int hf_ptp_v2_sdr_origintimestamp_seconds = -1;
1264 static int hf_ptp_v2_sdr_origintimestamp_nanoseconds = -1;
1267 /*Fields for PTP_Follow_Up (=fu) messages*/
1268 static int hf_ptp_v2_fu_preciseorigintimestamp = -1; /*Field for seconds & nanoseconds*/
1269 static int hf_ptp_v2_fu_preciseorigintimestamp_seconds = -1;
1270 static int hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds = -1;
1271 /* Fields for the Follow_Up Information TLV */
1272 static int hf_ptp_as_fu_tlv_tlvtype = -1;
1273 static int hf_ptp_as_fu_tlv_lengthfield = -1;
1274 static int hf_ptp_as_fu_tlv_organization_id = -1;
1275 static int hf_ptp_as_fu_tlv_organization_subtype = -1;
1276 static int hf_ptp_as_fu_tlv_cumulative_offset = -1;
1277 static int hf_ptp_as_fu_tlv_gm_base_indicator = -1;
1278 static int hf_ptp_as_fu_tlv_last_gm_phase_change = -1;
1279 static int hf_ptp_as_fu_tlv_scaled_last_gm_phase_change = -1;
1281 /*Fields for PTP_DelayResponse (=dr) messages*/
1282 static int hf_ptp_v2_dr_receivetimestamp = -1; /*Field for seconds & nanoseconds*/
1283 static int hf_ptp_v2_dr_receivetimestamp_seconds = -1;
1284 static int hf_ptp_v2_dr_receivetimestamp_nanoseconds = -1;
1285 static int hf_ptp_v2_dr_requestingportidentity = -1;
1286 static int hf_ptp_v2_dr_requestingsourceportid = -1;
1289 /*Fields for PTP_PDelayRequest (=pdrq) messages*/
1290 static int hf_ptp_v2_pdrq_origintimestamp = -1; /*Field for seconds & nanoseconds*/
1291 static int hf_ptp_v2_pdrq_origintimestamp_seconds = -1;
1292 static int hf_ptp_v2_pdrq_origintimestamp_nanoseconds = -1;
1295 /*Fields for PTP_PDelayResponse (=pdrs) messages*/
1296 static int hf_ptp_v2_pdrs_requestreceipttimestamp = -1; /*Field for seconds & nanoseconds*/
1297 static int hf_ptp_v2_pdrs_requestreceipttimestamp_seconds = -1;
1298 static int hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds = -1;
1299 static int hf_ptp_v2_pdrs_requestingportidentity = -1;
1300 static int hf_ptp_v2_pdrs_requestingsourceportid = -1;
1303 /*Fields for PTP_PDelayResponseFollowUp (=pdfu) messages*/
1304 static int hf_ptp_v2_pdfu_responseorigintimestamp = -1; /*Field for seconds & nanoseconds*/
1305 static int hf_ptp_v2_pdfu_responseorigintimestamp_seconds = -1;
1306 static int hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds = -1;
1307 static int hf_ptp_v2_pdfu_requestingportidentity = -1;
1308 static int hf_ptp_v2_pdfu_requestingsourceportid = -1;
1311 /*Fields for PTP_Signalling (=sig) messages*/
1312 static int hf_ptp_v2_sig_targetportidentity = -1;
1313 static int hf_ptp_v2_sig_targetportid = -1;
1314 /* Fields for the Message Interval Request TLV */
1315 static int hf_ptp_as_sig_tlv_tlvtype = -1;
1316 static int hf_ptp_as_sig_tlv_lengthfield = -1;
1317 static int hf_ptp_as_sig_tlv_organization_id = -1;
1318 static int hf_ptp_as_sig_tlv_organization_subtype = -1;
1319 static int hf_ptp_as_sig_tlv_link_delay_interval = -1;
1320 static int hf_ptp_as_sig_tlv_time_sync_interval = -1;
1321 static int hf_ptp_as_sig_tlv_announce_interval = -1;
1322 static int hf_ptp_as_sig_tlv_flags = -1;
1323 static int hf_ptp_as_sig_tlv_flags_comp_rate_ratio = -1;
1324 static int hf_ptp_as_sig_tlv_flags_comp_prop_delay = -1;
1326 /*Fields for PTP_Management (=mm) messages*/
1327 static int hf_ptp_v2_mm_targetportidentity = -1;
1328 static int hf_ptp_v2_mm_targetportid = -1;
1329 static int hf_ptp_v2_mm_startingboundaryhops = -1;
1330 static int hf_ptp_v2_mm_boundaryhops = -1;
1331 static int hf_ptp_v2_mm_action = -1;
1333 /* management TLV */
1334 static int hf_ptp_v2_mm_tlvType = -1;
1335 static int hf_ptp_v2_mm_lengthField = -1;
1336 static int hf_ptp_v2_mm_managementId = -1;
1337 static int hf_ptp_v2_mm_data = -1;
1338 /* Management dataField */
1340 static int hf_ptp_v2_mm_clockType = -1;
1341 static int hf_ptp_v2_mm_clockType_ordinaryClock = -1;
1342 static int hf_ptp_v2_mm_clockType_boundaryClock = -1;
1343 static int hf_ptp_v2_mm_clockType_p2p_transparentClock = -1;
1344 static int hf_ptp_v2_mm_clockType_e2e_transparentClock = -1;
1345 static int hf_ptp_v2_mm_clockType_managementNode = -1;
1346 static int hf_ptp_v2_mm_clockType_reserved = -1;
1347 static int hf_ptp_v2_mm_physicalLayerProtocol = -1;
1348 static int hf_ptp_v2_mm_physicalLayerProtocol_length = -1;
1349 static int hf_ptp_v2_mm_physicalAddressLength = -1;
1350 static int hf_ptp_v2_mm_physicalAddress = -1;
1351 static int hf_ptp_v2_mm_protocolAddress = -1;
1352 static int hf_ptp_v2_mm_protocolAddress_networkProtocol = -1;
1353 static int hf_ptp_v2_mm_protocolAddress_length = -1;
1354 static int hf_ptp_v2_mm_manufacturerIdentity = -1;
1356 static int hf_ptp_v2_mm_reserved = -1;
1357 static int hf_ptp_v2_mm_productDescription = -1;
1358 static int hf_ptp_v2_mm_productDescription_length = -1;
1359 static int hf_ptp_v2_mm_revisionData = -1;
1360 static int hf_ptp_v2_mm_revisionData_length = -1;
1361 static int hf_ptp_v2_mm_userDescription = -1;
1362 static int hf_ptp_v2_mm_userDescription_length = -1;
1363 static int hf_ptp_v2_mm_profileIdentity = -1;
1364 static int hf_ptp_v2_mm_pad = -1;
1366 static int hf_ptp_v2_mm_numberOfFaultRecords = -1;
1367 static int hf_ptp_v2_mm_faultRecord = -1;
1369 static int hf_ptp_v2_mm_initializationKey = -1;
1370 static int hf_ptp_v2_mm_severityCode = -1;
1371 static int hf_ptp_v2_mm_faultRecordLength = -1;
1372 static int hf_ptp_v2_mm_faultTime = -1;
1373 static int hf_ptp_v2_mm_faultTime_s = -1;
1374 static int hf_ptp_v2_mm_faultTime_ns = -1;
1375 static int hf_ptp_v2_mm_faultValue = -1;
1376 static int hf_ptp_v2_mm_faultName = -1;
1377 static int hf_ptp_v2_mm_faultName_length = -1;
1378 static int hf_ptp_v2_mm_faultValue_length = -1;
1379 static int hf_ptp_v2_mm_faultDescription = -1;
1380 static int hf_ptp_v2_mm_faultDescription_length = -1;
1381 static int hf_ptp_v2_mm_currentTime_s = -1;
1382 static int hf_ptp_v2_mm_currentTime_ns = -1;
1383 static int hf_ptp_v2_mm_clockAccuracy = -1;
1384 static int hf_ptp_v2_mm_priority1 = -1;
1385 static int hf_ptp_v2_mm_priority2 = -1;
1386 static int hf_ptp_v2_mm_dds_SO = -1;
1387 static int hf_ptp_v2_mm_TSC = -1;
1388 static int hf_ptp_v2_mm_numberPorts = -1;
1389 static int hf_ptp_v2_mm_clockclass = -1;
1390 static int hf_ptp_v2_mm_clockaccuracy = -1;
1391 static int hf_ptp_v2_mm_clockvariance = -1;
1392 static int hf_ptp_v2_mm_clockidentity = -1;
1393 static int hf_ptp_v2_mm_domainNumber = -1;
1394 static int hf_ptp_v2_mm_SO = -1;
1395 static int hf_ptp_v2_mm_stepsRemoved = -1;
1396 static int hf_ptp_v2_mm_parentIdentity = -1;
1397 static int hf_ptp_v2_mm_parentPort = -1;
1398 static int hf_ptp_v2_mm_parentStats = -1;
1399 static int hf_ptp_v2_mm_observedParentOffsetScaledLogVariance = -1;
1400 static int hf_ptp_v2_mm_observedParentClockPhaseChangeRate = -1;
1401 static int hf_ptp_v2_mm_grandmasterPriority1 = -1;
1402 static int hf_ptp_v2_mm_grandmasterPriority2 = -1;
1403 static int hf_ptp_v2_mm_grandmasterclockclass = -1;
1404 static int hf_ptp_v2_mm_grandmasterclockaccuracy = -1;
1405 static int hf_ptp_v2_mm_grandmasterclockvariance = -1;
1406 static int hf_ptp_v2_mm_grandmasterIdentity = -1;
1407 static int hf_ptp_v2_mm_currentUtcOffset = -1;
1408 static int hf_ptp_v2_mm_LI_61 = -1;
1409 static int hf_ptp_v2_mm_LI_59 = -1;
1410 static int hf_ptp_v2_mm_UTCV = -1;
1411 static int hf_ptp_v2_mm_PTP = -1;
1412 static int hf_ptp_v2_mm_TTRA = -1;
1413 static int hf_ptp_v2_mm_FTRA = -1;
1414 static int hf_ptp_v2_mm_timesource = -1;
1415 static int hf_ptp_v2_mm_offset_ns = -1;
1416 static int hf_ptp_v2_mm_pathDelay_ns = -1;
1417 static int hf_ptp_v2_mm_offset_subns = -1;
1418 static int hf_ptp_v2_mm_pathDelay_subns = -1;
1419 static int hf_ptp_v2_mm_PortNumber = -1;
1420 static int hf_ptp_v2_mm_portState = -1;
1421 static int hf_ptp_v2_mm_logMinDelayReqInterval = -1;
1422 static int hf_ptp_v2_mm_peerMeanPathDelay_ns = -1;
1423 static int hf_ptp_v2_mm_peerMeanPathDelay_subns = -1;
1424 static int hf_ptp_v2_mm_logAnnounceInterval = -1;
1425 static int hf_ptp_v2_mm_announceReceiptTimeout = -1;
1426 static int hf_ptp_v2_mm_logSyncInterval = -1;
1427 static int hf_ptp_v2_mm_delayMechanism = -1;
1428 static int hf_ptp_v2_mm_logMinPdelayReqInterval = -1;
1429 static int hf_ptp_v2_mm_versionNumber = -1;
1430 static int hf_ptp_v2_mm_primaryDomain = -1;
1431 static int hf_ptp_v2_mm_faultyFlag = -1;
1432 static int hf_ptp_v2_mm_managementErrorId = -1;
1433 static int hf_ptp_v2_mm_displayData = -1;
1434 static int hf_ptp_v2_mm_displayData_length = -1;
1435 static int hf_ptp_v2_mm_ucEN = -1;
1436 static int hf_ptp_v2_mm_ptEN = -1;
1437 static int hf_ptp_v2_mm_atEN = -1;
1438 static int hf_ptp_v2_mm_keyField = -1;
1439 static int hf_ptp_v2_mm_displayName = -1;
1440 static int hf_ptp_v2_mm_displayName_length = -1;
1441 static int hf_ptp_v2_mm_maxKey = -1;
1442 static int hf_ptp_v2_mm_currentOffset = -1;
1443 static int hf_ptp_v2_mm_jumpSeconds = -1;
1444 static int hf_ptp_v2_mm_logAlternateMulticastSyncInterval = -1;
1445 static int hf_ptp_v2_mm_numberOfAlternateMasters = -1;
1446 static int hf_ptp_v2_mm_transmitAlternateMulticastSync = -1;
1448 /* Initialize the subtree pointers */
1449 static gint ett_ptp_v2 = -1;
1450 static gint ett_ptp_v2_flags = -1;
1451 static gint ett_ptp_v2_correction = -1;
1452 static gint ett_ptp_v2_time = -1;
1453 static gint ett_ptp_v2_time2 = -1;
1454 static gint ett_ptp_v2_managementData = -1;
1455 static gint ett_ptp_v2_clockType = -1;
1456 static gint ett_ptp_v2_physicalLayerProtocol = -1;
1457 static gint ett_ptp_v2_protocolAddress = -1;
1458 static gint ett_ptp_v2_faultRecord = -1;
1459 static gint ett_ptp_v2_ptptext = -1;
1460 static gint ett_ptp_v2_timeInterval = -1;
1461 static gint ett_ptp_v2_tlv = -1;
1462 static gint ett_ptp_as_sig_tlv_flags = -1;
1464 /* static gint ett_ptp_v2_timesource = -1;
1465 static gint ett_ptp_v2_priority = -1; */
1466 static gint ett_ptp_v2_transportspecific = -1;
1468 /* For transport specific field Ethernet or UDP */
1469 static gboolean ptpv2_oE = FALSE;
1470 /* END Definitions and fields for PTPv2 dissection. */
1473 /* forward declaration of local functions for v1 and v2 */
1476 dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1479 is_ptp_v1(tvbuff_t *tvb);
1482 dissect_ptp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1485 is_ptp_v2(tvbuff_t *tvb);
1488 dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1490 /**********************************************************/
1491 /* Implementation of the functions */
1492 /**********************************************************/
1495 /* Code to dissect the packet */
1498 dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1501 /* PTP over Ethernet only available with PTPv2 */
1502 dissect_ptp_v2(tvb, pinfo, tree);
1506 dissect_ptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1510 dissect_ptp_v1(tvb, pinfo, tree);
1511 else if(is_ptp_v2(tvb))
1512 dissect_ptp_v2(tvb, pinfo, tree);
1516 /* Code to check if packet is PTPv1 */
1519 is_ptp_v1(tvbuff_t *tvb)
1521 guint16 version_ptp;
1523 version_ptp = tvb_get_ntohs(tvb, PTP_VERSIONPTP_OFFSET);
1525 if( version_ptp == 1) return TRUE;
1530 /* Code to check if packet is PTPv2 */
1533 is_ptp_v2(tvbuff_t *tvb)
1537 version_ptp = 0x0F & tvb_get_guint8(tvb, PTP_V2_VERSIONPTP_OFFSET);
1539 if( version_ptp == 2) return TRUE;
1544 /* Code to actually dissect the PTPv1 packets */
1547 dissect_ptp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1549 guint8 ptp_control, ptp_mm_messagekey = 0;
1550 nstime_t ts; /*time structure with seconds and nanoseconds*/
1552 /* Set up structures needed to add the protocol subtree and manage it */
1553 proto_item *ti, *flags_ti, *time_ti, *time2_ti;
1554 proto_tree *ptp_tree, *ptp_flags_tree, *ptp_time_tree, *ptp_time2_tree;
1556 /* Make entries in Protocol column and Info column on summary display */
1557 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PTPv1");
1560 /* Get control field (what kind of message is this? (Sync, DelayReq, ...) */
1562 ptp_control = tvb_get_guint8 (tvb, PTP_CONTROL_OFFSET);
1564 if ( ptp_control == PTP_MANAGEMENT_MESSAGE ){
1565 /* Get the managementMessageKey */
1566 ptp_mm_messagekey = tvb_get_guint8(tvb, PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET);
1569 /* Create and set the string for "Info" column */
1570 switch(ptp_control){
1571 case PTP_SYNC_MESSAGE:{
1572 col_set_str(pinfo->cinfo, COL_INFO, "Sync Message");
1575 case PTP_DELAY_REQ_MESSAGE:{
1576 col_set_str(pinfo->cinfo, COL_INFO, "Delay_Request Message");
1579 case PTP_FOLLOWUP_MESSAGE:{
1580 col_set_str(pinfo->cinfo, COL_INFO, "Follow_Up Message");
1583 case PTP_DELAY_RESP_MESSAGE:{
1584 col_set_str(pinfo->cinfo, COL_INFO, "Delay_Response Message");
1587 case PTP_MANAGEMENT_MESSAGE:{
1588 if (check_col(pinfo->cinfo, COL_INFO)){
1589 col_add_fstr(pinfo->cinfo, COL_INFO, "Management Message (%s)",
1590 val_to_str(ptp_mm_messagekey,
1591 ptp_managementMessageKey_infocolumn_vals,
1592 "Unknown message key %u"));
1597 col_set_str(pinfo->cinfo, COL_INFO, "Unknown Message");
1604 /* create display subtree for the protocol */
1605 ti = proto_tree_add_item(tree, proto_ptp, tvb, 0, -1, FALSE);
1607 ptp_tree = proto_item_add_subtree(ti, ett_ptp);
1609 proto_tree_add_item(ptp_tree,
1610 hf_ptp_versionptp, tvb, PTP_VERSIONPTP_OFFSET, 2, FALSE);
1612 proto_tree_add_item(ptp_tree,
1613 hf_ptp_versionnetwork, tvb, PTP_VERSIONNETWORK_OFFSET, 2, FALSE);
1615 proto_tree_add_item(ptp_tree,
1616 hf_ptp_subdomain, tvb, PTP_SUBDOMAIN_OFFSET, 16, FALSE);
1618 proto_tree_add_item(ptp_tree,
1619 hf_ptp_messagetype, tvb, PTP_MESSAGETYPE_OFFSET, 1, FALSE);
1621 proto_tree_add_item(ptp_tree,
1622 hf_ptp_sourcecommunicationtechnology, tvb, PTP_SOURCECOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1624 proto_tree_add_item(ptp_tree,
1625 hf_ptp_sourceuuid, tvb, PTP_SOURCEUUID_OFFSET, 6, FALSE);
1627 proto_tree_add_item(ptp_tree,
1628 hf_ptp_sourceportid, tvb, PTP_SOURCEPORTID_OFFSET, 2, FALSE);
1630 proto_tree_add_item(ptp_tree,
1631 hf_ptp_sequenceid, tvb, PTP_SEQUENCEID_OFFSET, 2, FALSE);
1633 proto_tree_add_item(ptp_tree,
1634 hf_ptp_control, tvb, PTP_CONTROL_OFFSET, 1, FALSE);
1636 /*Subtree for the flag-field*/
1638 flags_ti = proto_tree_add_item(ptp_tree,
1639 hf_ptp_flags, tvb, PTP_FLAGS_OFFSET, 2, FALSE);
1641 ptp_flags_tree = proto_item_add_subtree(flags_ti, ett_ptp_flags);
1643 proto_tree_add_item(ptp_flags_tree,
1644 hf_ptp_flags_li61, tvb, PTP_FLAGS_LI61_OFFSET, 2, FALSE);
1646 proto_tree_add_item(ptp_flags_tree,
1647 hf_ptp_flags_li59, tvb, PTP_FLAGS_LI59_OFFSET, 2, FALSE);
1649 proto_tree_add_item(ptp_flags_tree,
1650 hf_ptp_flags_boundary_clock, tvb, PTP_FLAGS_BOUNDARY_CLOCK_OFFSET, 2, FALSE);
1652 proto_tree_add_item(ptp_flags_tree,
1653 hf_ptp_flags_assist, tvb, PTP_FLAGS_ASSIST_OFFSET, 2, FALSE);
1655 proto_tree_add_item(ptp_flags_tree,
1656 hf_ptp_flags_ext_sync, tvb, PTP_FLAGS_EXT_SYNC_OFFSET, 2, FALSE);
1658 proto_tree_add_item(ptp_flags_tree,
1659 hf_ptp_flags_parent, tvb, PTP_FLAGS_PARENT_STATS_OFFSET, 2, FALSE);
1661 proto_tree_add_item(ptp_flags_tree,
1662 hf_ptp_flags_sync_burst, tvb, PTP_FLAGS_SYNC_BURST_OFFSET, 2, FALSE);
1665 /* The rest of the ptp-dissector depends on the control-field */
1667 switch(ptp_control){
1668 case PTP_SYNC_MESSAGE:
1669 case PTP_DELAY_REQ_MESSAGE:{
1671 /*Subtree for the timestamp-field*/
1672 ts.secs = tvb_get_ntohl(tvb, PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET);
1673 ts.nsecs = tvb_get_ntohl(tvb, PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET);
1675 time_ti = proto_tree_add_time(ptp_tree,
1676 hf_ptp_sdr_origintimestamp, tvb, PTP_SDR_ORIGINTIMESTAMP_OFFSET, 8, &ts);
1678 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1680 proto_tree_add_item(ptp_time_tree,
1681 hf_ptp_sdr_origintimestamp_seconds, tvb,
1682 PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET, 4, FALSE);
1684 proto_tree_add_item(ptp_time_tree, hf_ptp_sdr_origintimestamp_nanoseconds, tvb,
1685 PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET, 4, FALSE);
1688 proto_tree_add_item(ptp_tree,
1689 hf_ptp_sdr_epochnumber, tvb, PTP_SDR_EPOCHNUMBER_OFFSET, 2, FALSE);
1691 proto_tree_add_item(ptp_tree,
1692 hf_ptp_sdr_currentutcoffset, tvb, PTP_SDR_CURRENTUTCOFFSET_OFFSET, 2, FALSE);
1694 proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmastercommunicationtechnology, tvb,
1695 PTP_SDR_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1697 proto_tree_add_item(ptp_tree,
1698 hf_ptp_sdr_grandmasterclockuuid, tvb, PTP_SDR_GRANDMASTERCLOCKUUID_OFFSET, 6, FALSE);
1700 proto_tree_add_item(ptp_tree,
1701 hf_ptp_sdr_grandmasterportid, tvb, PTP_SDR_GRANDMASTERPORTID_OFFSET, 2, FALSE);
1703 proto_tree_add_item(ptp_tree,
1704 hf_ptp_sdr_grandmastersequenceid, tvb, PTP_SDR_GRANDMASTERSEQUENCEID_OFFSET, 2, FALSE);
1706 proto_tree_add_item(ptp_tree,
1707 hf_ptp_sdr_grandmasterclockstratum, tvb,
1708 PTP_SDR_GRANDMASTERCLOCKSTRATUM_OFFSET, 1, FALSE);
1710 proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmasterclockidentifier, tvb,
1711 PTP_SDR_GRANDMASTERCLOCKIDENTIFIER_OFFSET, 4, FALSE);
1713 proto_tree_add_item(ptp_tree,
1714 hf_ptp_sdr_grandmasterclockvariance, tvb,
1715 PTP_SDR_GRANDMASTERCLOCKVARIANCE_OFFSET, 2, FALSE);
1717 proto_tree_add_item(ptp_tree,
1718 hf_ptp_sdr_grandmasterpreferred, tvb, PTP_SDR_GRANDMASTERPREFERRED_OFFSET, 1, FALSE);
1720 proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmasterisboundaryclock, tvb,
1721 PTP_SDR_GRANDMASTERISBOUNDARYCLOCK_OFFSET, 1, FALSE);
1723 proto_tree_add_item(ptp_tree,
1724 hf_ptp_sdr_syncinterval, tvb, PTP_SDR_SYNCINTERVAL_OFFSET, 1, FALSE);
1726 proto_tree_add_item(ptp_tree,
1727 hf_ptp_sdr_localclockvariance, tvb, PTP_SDR_LOCALCLOCKVARIANCE_OFFSET, 2, FALSE);
1729 proto_tree_add_item(ptp_tree,
1730 hf_ptp_sdr_localstepsremoved, tvb, PTP_SDR_LOCALSTEPSREMOVED_OFFSET, 2, FALSE);
1732 proto_tree_add_item(ptp_tree,
1733 hf_ptp_sdr_localclockstratum, tvb, PTP_SDR_LOCALCLOCKSTRATUM_OFFSET, 1, FALSE);
1735 proto_tree_add_item(ptp_tree,
1736 hf_ptp_sdr_localclockidentifier, tvb, PTP_SDR_LOCALCLOCKIDENTIFIER_OFFSET, 4, FALSE);
1738 proto_tree_add_item(ptp_tree, hf_ptp_sdr_parentcommunicationtechnology, tvb,
1739 PTP_SDR_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1741 proto_tree_add_item(ptp_tree,
1742 hf_ptp_sdr_parentuuid, tvb, PTP_SDR_PARENTUUID_OFFSET, 6, FALSE);
1744 proto_tree_add_item(ptp_tree,
1745 hf_ptp_sdr_parentportfield, tvb, PTP_SDR_PARENTPORTFIELD_OFFSET, 2, FALSE);
1747 proto_tree_add_item(ptp_tree,
1748 hf_ptp_sdr_estimatedmastervariance, tvb,
1749 PTP_SDR_ESTIMATEDMASTERVARIANCE_OFFSET, 2, FALSE);
1751 proto_tree_add_item(ptp_tree,
1752 hf_ptp_sdr_estimatedmasterdrift, tvb, PTP_SDR_ESTIMATEDMASTERDRIFT_OFFSET, 4, FALSE);
1754 proto_tree_add_item(ptp_tree,
1755 hf_ptp_sdr_utcreasonable, tvb, PTP_SDR_UTCREASONABLE_OFFSET, 1, FALSE);
1758 case PTP_FOLLOWUP_MESSAGE:{
1759 proto_tree_add_item(ptp_tree,
1760 hf_ptp_fu_associatedsequenceid, tvb, PTP_FU_ASSOCIATEDSEQUENCEID_OFFSET, 2, FALSE);
1762 /*Subtree for the timestamp-field*/
1763 ts.secs = tvb_get_ntohl(tvb, PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET);
1764 ts.nsecs = tvb_get_ntohl(tvb, PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET);
1766 time_ti = proto_tree_add_time(ptp_tree,
1767 hf_ptp_fu_preciseorigintimestamp, tvb,
1768 PTP_FU_PRECISEORIGINTIMESTAMP_OFFSET, 8, &ts);
1770 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1772 proto_tree_add_item(ptp_time_tree, hf_ptp_fu_preciseorigintimestamp_seconds, tvb,
1773 PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET, 4, FALSE);
1775 proto_tree_add_item(ptp_time_tree, hf_ptp_fu_preciseorigintimestamp_nanoseconds, tvb,
1776 PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET, 4, FALSE);
1780 case PTP_DELAY_RESP_MESSAGE:{
1781 /*Subtree for the timestamp-field*/
1782 ts.secs = tvb_get_ntohl(tvb, PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET);
1783 ts.nsecs = tvb_get_ntohl(tvb, PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET);
1785 time_ti = proto_tree_add_time(ptp_tree,
1786 hf_ptp_dr_delayreceipttimestamp, tvb,
1787 PTP_DR_DELAYRECEIPTTIMESTAMP_OFFSET, 8, &ts);
1789 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1791 proto_tree_add_item(ptp_time_tree, hf_ptp_dr_delayreceipttimestamp_seconds, tvb,
1792 PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET, 4, FALSE);
1794 proto_tree_add_item(ptp_time_tree, hf_ptp_dr_delayreceipttimestamp_nanoseconds, tvb,
1795 PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET, 4, FALSE);
1798 proto_tree_add_item(ptp_tree, hf_ptp_dr_requestingsourcecommunicationtechnology, tvb,
1799 PTP_DR_REQUESTINGSOURCECOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1801 proto_tree_add_item(ptp_tree,
1802 hf_ptp_dr_requestingsourceuuid, tvb, PTP_DR_REQUESTINGSOURCEUUID_OFFSET, 6, FALSE);
1804 proto_tree_add_item(ptp_tree,
1805 hf_ptp_dr_requestingsourceportid, tvb, PTP_DR_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
1807 proto_tree_add_item(ptp_tree,
1808 hf_ptp_dr_requestingsourcesequenceid, tvb,
1809 PTP_DR_REQUESTINGSOURCESEQUENCEID_OFFSET, 2, FALSE);
1812 case PTP_MANAGEMENT_MESSAGE:{
1813 proto_tree_add_item(ptp_tree, hf_ptp_mm_targetcommunicationtechnology, tvb,
1814 PTP_MM_TARGETCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1816 proto_tree_add_item(ptp_tree,
1817 hf_ptp_mm_targetuuid, tvb, PTP_MM_TARGETUUID_OFFSET, 6, FALSE);
1819 proto_tree_add_item(ptp_tree,
1820 hf_ptp_mm_targetportid, tvb, PTP_MM_TARGETPORTID_OFFSET, 2, FALSE);
1822 proto_tree_add_item(ptp_tree,
1823 hf_ptp_mm_startingboundaryhops, tvb, PTP_MM_STARTINGBOUNDARYHOPS_OFFSET, 2, FALSE);
1825 proto_tree_add_item(ptp_tree,
1826 hf_ptp_mm_boundaryhops, tvb, PTP_MM_BOUNDARYHOPS_OFFSET, 2, FALSE);
1829 proto_tree_add_item(ptp_tree,
1830 hf_ptp_mm_managementmessagekey, tvb, PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET, 1, FALSE);
1832 proto_tree_add_item(ptp_tree,
1833 hf_ptp_mm_parameterlength, tvb, PTP_MM_PARAMETERLENGTH_OFFSET, 2, FALSE);
1835 switch(ptp_mm_messagekey){
1836 case PTP_MM_CLOCK_IDENTITY:{
1837 proto_tree_add_item(ptp_tree,
1838 hf_ptp_mm_clock_identity_clockcommunicationtechnology, tvb,
1839 PTP_MM_CLOCK_IDENTITY_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1841 proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_clockuuidfield, tvb,
1842 PTP_MM_CLOCK_IDENTITY_CLOCKUUIDFIELD_OFFSET, 6, FALSE);
1844 proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_clockportfield, tvb,
1845 PTP_MM_CLOCK_IDENTITY_CLOCKPORTFIELD_OFFSET, 2, FALSE);
1847 proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_manufactureridentity, tvb,
1848 PTP_MM_CLOCK_IDENTITY_MANUFACTURERIDENTITY_OFFSET, 48, FALSE);
1851 case PTP_MM_INITIALIZE_CLOCK:{
1852 proto_tree_add_item(ptp_tree, hf_ptp_mm_initialize_clock_initialisationkey, tvb,
1853 PTP_MM_INITIALIZE_CLOCK_INITIALISATIONKEY_OFFSET, 2, FALSE);
1856 case PTP_MM_SET_SUBDOMAIN:{
1857 proto_tree_add_item(ptp_tree, hf_ptp_mm_set_subdomain_subdomainname, tvb,
1858 PTP_MM_SET_SUBDOMAIN_SUBDOMAINNAME_OFFSET, 16, FALSE);
1861 case PTP_MM_DEFAULT_DATA_SET:{
1862 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockcommunicationtechnology,
1863 tvb, PTP_MM_DEFAULT_DATA_SET_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET,
1866 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockuuidfield, tvb,
1867 PTP_MM_DEFAULT_DATA_SET_CLOCKUUIDFIELD_OFFSET, 6, FALSE);
1869 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockportfield, tvb,
1870 PTP_MM_DEFAULT_DATA_SET_CLOCKPORTFIELD_OFFSET, 2, FALSE);
1872 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockstratum, tvb,
1873 PTP_MM_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET, 1, FALSE);
1875 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockidentifier, tvb,
1876 PTP_MM_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET, 4, FALSE);
1878 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockvariance, tvb,
1879 PTP_MM_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET, 2, FALSE);
1881 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockfollowupcapable, tvb,
1882 PTP_MM_DEFAULT_DATA_SET_CLOCKFOLLOWUPCAPABLE_OFFSET, 1, FALSE);
1884 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_preferred, tvb,
1885 PTP_MM_DEFAULT_DATA_SET_PREFERRED_OFFSET, 1, FALSE);
1887 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_initializable, tvb,
1888 PTP_MM_DEFAULT_DATA_SET_INITIALIZABLE_OFFSET, 1, FALSE);
1890 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_externaltiming, tvb,
1891 PTP_MM_DEFAULT_DATA_SET_EXTERNALTIMING_OFFSET, 1, FALSE);
1893 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_isboundaryclock, tvb,
1894 PTP_MM_DEFAULT_DATA_SET_ISBOUNDARYCLOCK_OFFSET, 1, FALSE);
1896 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_syncinterval, tvb,
1897 PTP_MM_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET, 1, FALSE);
1899 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_subdomainname, tvb,
1900 PTP_MM_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET, 16, FALSE);
1902 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_numberports, tvb,
1903 PTP_MM_DEFAULT_DATA_SET_NUMBERPORTS_OFFSET, 2, FALSE);
1905 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_numberforeignrecords, tvb,
1906 PTP_MM_DEFAULT_DATA_SET_NUMBERFOREIGNRECORDS_OFFSET, 2, FALSE);
1909 case PTP_MM_UPDATE_DEFAULT_DATA_SET:{
1910 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockstratum, tvb,
1911 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET, 1, FALSE);
1913 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockidentifier, tvb,
1914 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET, 4, FALSE);
1916 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockvariance, tvb,
1917 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET, 2, FALSE);
1919 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_preferred, tvb,
1920 PTP_MM_UPDATE_DEFAULT_DATA_SET_PREFERRED_OFFSET, 1, FALSE);
1922 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_syncinterval, tvb,
1923 PTP_MM_UPDATE_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET, 1, FALSE);
1925 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_subdomainname, tvb,
1926 PTP_MM_UPDATE_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET, 16, FALSE);
1929 case PTP_MM_CURRENT_DATA_SET:{
1930 proto_tree_add_item(ptp_tree, hf_ptp_mm_current_data_set_stepsremoved, tvb,
1931 PTP_MM_CURRENT_DATA_SET_STEPSREMOVED_OFFSET, 2, FALSE);
1933 /* Subtree for offset from master*/
1934 ts.secs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET);
1936 ts.nsecs = tvb_get_ntohl(tvb,
1937 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET);
1939 if (ts.nsecs & 0x80000000) ts.nsecs = ts.nsecs & 0x7FFFFFFF;
1942 time_ti = proto_tree_add_time(ptp_tree,
1943 hf_ptp_mm_current_data_set_offsetfrommaster, tvb,
1944 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTER_OFFSET, 8, &ts);
1946 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1948 proto_tree_add_item(ptp_time_tree,
1949 hf_ptp_mm_current_data_set_offsetfrommasterseconds, tvb,
1950 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET, 4, FALSE);
1952 proto_tree_add_item(ptp_time_tree,
1953 hf_ptp_mm_current_data_set_offsetfrommasternanoseconds, tvb,
1954 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET, 4, FALSE);
1957 /* Subtree for offset from master*/
1958 ts.secs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET);
1960 ts.nsecs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET);
1963 time2_ti = proto_tree_add_time(ptp_tree,
1964 hf_ptp_mm_current_data_set_onewaydelay, tvb,
1965 PTP_MM_CURRENT_DATA_SET_ONEWAYDELAY_OFFSET, 8, &ts);
1967 ptp_time2_tree = proto_item_add_subtree(time2_ti, ett_ptp_time2);
1969 proto_tree_add_item(ptp_time2_tree, hf_ptp_mm_current_data_set_onewaydelayseconds,
1970 tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET, 4, FALSE);
1972 proto_tree_add_item(ptp_time2_tree,
1973 hf_ptp_mm_current_data_set_onewaydelaynanoseconds,
1974 tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET, 4, FALSE);
1978 case PTP_MM_PARENT_DATA_SET:{
1979 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentcommunicationtechnology,
1980 tvb, PTP_MM_PARENT_DATA_SET_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET,
1983 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentuuid, tvb,
1984 PTP_MM_PARENT_DATA_SET_PARENTUUID_OFFSET, 6, FALSE);
1986 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentportid, tvb,
1987 PTP_MM_PARENT_DATA_SET_PARENTPORTID_OFFSET, 2, FALSE);
1989 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber,
1990 tvb, PTP_MM_PARENT_DATA_SET_PARENTLASTSYNCSEQUENCENUMBER_OFFSET,
1993 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentfollowupcapable, tvb,
1994 PTP_MM_PARENT_DATA_SET_PARENTFOLLOWUPCAPABLE_OFFSET, 1, FALSE);
1996 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentexternaltiming, tvb,
1997 PTP_MM_PARENT_DATA_SET_PARENTEXTERNALTIMING_OFFSET, 1, FALSE);
1999 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentvariance, tvb,
2000 PTP_MM_PARENT_DATA_SET_PARENTVARIANCE_OFFSET, 2, FALSE);
2002 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentstats, tvb,
2003 PTP_MM_PARENT_DATA_SET_PARENTSTATS_OFFSET, 1, FALSE);
2005 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_observedvariance, tvb,
2006 PTP_MM_PARENT_DATA_SET_OBSERVEDVARIANCE_OFFSET, 2, FALSE);
2008 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_observeddrift, tvb,
2009 PTP_MM_PARENT_DATA_SET_OBSERVEDDRIFT_OFFSET, 4, FALSE);
2011 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_utcreasonable, tvb,
2012 PTP_MM_PARENT_DATA_SET_UTCREASONABLE_OFFSET, 1, FALSE);
2014 proto_tree_add_item(ptp_tree,
2015 hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology,
2016 tvb, PTP_MM_PARENT_DATA_SET_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1,
2019 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasteruuidfield, tvb,
2020 PTP_MM_PARENT_DATA_SET_GRANDMASTERUUIDFIELD_OFFSET, 6, FALSE);
2022 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterportidfield, tvb,
2023 PTP_MM_PARENT_DATA_SET_GRANDMASTERPORTIDFIELD_OFFSET, 2, FALSE);
2025 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterstratum, tvb,
2026 PTP_MM_PARENT_DATA_SET_GRANDMASTERSTRATUM_OFFSET, 1, FALSE);
2028 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasteridentifier, tvb,
2029 PTP_MM_PARENT_DATA_SET_GRANDMASTERIDENTIFIER_OFFSET, 4, FALSE);
2031 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmastervariance, tvb,
2032 PTP_MM_PARENT_DATA_SET_GRANDMASTERVARIANCE_OFFSET, 2, FALSE);
2034 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterpreferred, tvb,
2035 PTP_MM_PARENT_DATA_SET_GRANDMASTERPREFERRED_OFFSET, 1, FALSE);
2037 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterisboundaryclock, tvb,
2038 PTP_MM_PARENT_DATA_SET_GRANDMASTERISBOUNDARYCLOCK_OFFSET, 1, FALSE);
2040 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmastersequencenumber, tvb,
2041 PTP_MM_PARENT_DATA_SET_GRANDMASTERSEQUENCENUMBER_OFFSET, 2, FALSE);
2044 case PTP_MM_PORT_DATA_SET:{
2045 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_returnedportnumber, tvb,
2046 PTP_MM_PORT_DATA_SET_RETURNEDPORTNUMBER_OFFSET, 2, FALSE);
2048 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portstate, tvb,
2049 PTP_MM_PORT_DATA_SET_PORTSTATE_OFFSET, 1, FALSE);
2051 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_lastsynceventsequencenumber, tvb,
2052 PTP_MM_PORT_DATA_SET_LASTSYNCEVENTSEQUENCENUMBER_OFFSET, 2, FALSE);
2054 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber,
2055 tvb, PTP_MM_PORT_DATA_SET_LASTGENERALEVENTSEQUENCENUMBER_OFFSET,
2058 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portcommunicationtechnology, tvb,
2059 PTP_MM_PORT_DATA_SET_PORTCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
2061 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portuuidfield, tvb,
2062 PTP_MM_PORT_DATA_SET_PORTUUIDFIELD_OFFSET, 6, FALSE);
2064 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portidfield, tvb,
2065 PTP_MM_PORT_DATA_SET_PORTIDFIELD_OFFSET, 2, FALSE);
2067 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_burstenabled, tvb,
2068 PTP_MM_PORT_DATA_SET_BURSTENABLED_OFFSET, 1, FALSE);
2070 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_subdomainaddressoctets, tvb,
2071 PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESSOCTETS_OFFSET, 1, FALSE);
2073 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_eventportaddressoctets, tvb,
2074 PTP_MM_PORT_DATA_SET_EVENTPORTADDRESSOCTETS_OFFSET, 1, FALSE);
2076 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_generalportaddressoctets, tvb,
2077 PTP_MM_PORT_DATA_SET_GENERALPORTADDRESSOCTETS_OFFSET, 1, FALSE);
2079 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_subdomainaddress, tvb,
2080 PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESS_OFFSET, 4, FALSE);
2082 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_eventportaddress, tvb,
2083 PTP_MM_PORT_DATA_SET_EVENTPORTADDRESS_OFFSET, 2, FALSE);
2085 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_generalportaddress, tvb,
2086 PTP_MM_PORT_DATA_SET_GENERALPORTADDRESS_OFFSET, 2, FALSE);
2089 case PTP_MM_GLOBAL_TIME_DATA_SET:{
2090 /* Subtree for local time*/
2091 ts.secs = tvb_get_ntohl(tvb, PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET);
2093 ts.nsecs = tvb_get_ntohl(tvb,
2094 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET);
2097 time_ti = proto_tree_add_time(ptp_tree,
2098 hf_ptp_mm_global_time_data_set_localtime, tvb,
2099 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIME_OFFSET, 8, &ts);
2101 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
2103 proto_tree_add_item(ptp_time_tree,
2104 hf_ptp_mm_global_time_data_set_localtimeseconds, tvb,
2105 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET, 4, FALSE);
2107 proto_tree_add_item(ptp_time_tree,
2108 hf_ptp_mm_global_time_data_set_localtimenanoseconds,
2109 tvb, PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET, 4, FALSE);
2112 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_currentutcoffset, tvb,
2113 PTP_MM_GLOBAL_TIME_DATA_SET_CURRENTUTCOFFSET_OFFSET, 2, FALSE);
2115 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_leap59, tvb,
2116 PTP_MM_GLOBAL_TIME_DATA_SET_LEAP59_OFFSET, 1, FALSE);
2118 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_leap61, tvb,
2119 PTP_MM_GLOBAL_TIME_DATA_SET_LEAP61_OFFSET, 1, FALSE);
2121 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_epochnumber, tvb,
2122 PTP_MM_GLOBAL_TIME_DATA_SET_EPOCHNUMBER_OFFSET, 2, FALSE);
2125 case PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES:{
2126 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_currentutcoffset,
2127 tvb, PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_CURRENTUTCOFFSET_OFFSET,
2130 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_leap59, tvb,
2131 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP59_OFFSET, 1, FALSE);
2133 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_leap61, tvb,
2134 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP61_OFFSET, 1, FALSE);
2136 proto_tree_add_item(ptp_tree, hf_ptp_mm_get_foreign_data_set_recordkey, tvb,
2137 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_EPOCHNUMBER_OFFSET, 2, FALSE);
2140 case PTP_MM_GET_FOREIGN_DATA_SET:{
2141 proto_tree_add_item(ptp_tree, hf_ptp_mm_get_foreign_data_set_recordkey, tvb,
2142 PTP_MM_GET_FOREIGN_DATA_SET_RECORDKEY_OFFSET, 2, FALSE);
2145 case PTP_MM_FOREIGN_DATA_SET:{
2146 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_returnedportnumber, tvb,
2147 PTP_MM_FOREIGN_DATA_SET_RETURNEDPORTNUMBER_OFFSET, 2, FALSE);
2149 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_returnedrecordnumber, tvb,
2150 PTP_MM_FOREIGN_DATA_SET_RETURNEDRECORDNUMBER_OFFSET, 2, FALSE);
2152 proto_tree_add_item(ptp_tree,
2153 hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology,
2154 tvb, PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1,
2157 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmasteruuidfield, tvb,
2158 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERUUIDFIELD_OFFSET, 6, FALSE);
2160 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmasterportidfield, tvb,
2161 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERPORTIDFIELD_OFFSET, 2, FALSE);
2163 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmastersyncs, tvb,
2164 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERSYNCS_OFFSET, 2, FALSE);
2167 case PTP_MM_SET_SYNC_INTERVAL:{
2168 proto_tree_add_item(ptp_tree, hf_ptp_mm_set_sync_interval_syncinterval, tvb,
2169 PTP_MM_SET_SYNC_INTERVAL_SYNCINTERVAL_OFFSET, 2, FALSE);
2172 case PTP_MM_SET_TIME:{
2173 /* Subtree for local time*/
2174 ts.secs = tvb_get_ntohl(tvb, PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET);
2176 ts.nsecs = tvb_get_ntohl(tvb, PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET);
2179 time_ti = proto_tree_add_time(ptp_tree, hf_ptp_mm_set_time_localtime, tvb,
2180 PTP_MM_SET_TIME_LOCALTIME_OFFSET, 8, &ts);
2182 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
2184 proto_tree_add_item(ptp_time_tree, hf_ptp_mm_set_time_localtimeseconds, tvb,
2185 PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET, 4, FALSE);
2187 proto_tree_add_item(ptp_time_tree, hf_ptp_mm_set_time_localtimenanoseconds,
2188 tvb, PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET, 4, FALSE);
2193 /*- don't dissect any further. */
2200 /* Not a valid MessageType - can't dissect. */
2208 /* Code to dissect PTPText */
2210 dissect_ptp_v2_text(tvbuff_t *tvb, guint16 *cur_offset, proto_tree *tree, int hf_ptp_v2_mm_ptptext, int hf_ptp_v2_mm_ptptext_length)
2213 proto_item *ptptext_ti;
2214 proto_tree *ptptext_subtree;
2216 length = tvb_get_guint8 (tvb, *cur_offset);
2220 ptptext_ti = proto_tree_add_item(tree, hf_ptp_v2_mm_ptptext, tvb,
2221 *cur_offset+1, length, FALSE);
2223 ptptext_subtree = proto_item_add_subtree(ptptext_ti, ett_ptp_v2_ptptext);
2225 proto_tree_add_item(ptptext_subtree, hf_ptp_v2_mm_ptptext_length, tvb,
2226 *cur_offset, 1, FALSE);
2227 proto_tree_add_item(ptptext_subtree, hf_ptp_v2_mm_ptptext, tvb,
2228 *cur_offset+1, length, FALSE);
2230 *cur_offset = *cur_offset + length + 1;
2235 dissect_ptp_v2_timeInterval(tvbuff_t *tvb, guint16 *cur_offset, proto_tree *tree, const char* name, int hf_ptp_v2_timeInterval_ns, int hf_ptp_v2_timeInterval_subns)
2241 proto_item *ptptimeInterval_ti;
2242 proto_tree *ptptimeInterval_subtree;
2244 time_ns = tvb_get_ntoh64(tvb, *cur_offset);
2245 time_double = (1.0*time_ns) / 65536.0;
2246 time_ns = time_ns >> 16;
2247 time_subns = tvb_get_ntohs(tvb, *cur_offset+6);
2249 ptptimeInterval_ti = proto_tree_add_text(tree, tvb, *cur_offset, 8,
2250 "%s: %f nanoseconds", name, time_double);
2252 ptptimeInterval_subtree = proto_item_add_subtree(ptptimeInterval_ti, ett_ptp_v2_timeInterval);
2254 proto_tree_add_uint64_format_value(ptptimeInterval_subtree,
2255 hf_ptp_v2_timeInterval_ns, tvb, *cur_offset, 6, time_ns, "Ns: %" G_GINT64_MODIFIER "d nanoseconds", time_ns);
2257 proto_tree_add_double_format(ptptimeInterval_subtree,
2258 hf_ptp_v2_timeInterval_subns, tvb, *cur_offset+6, 2, (time_subns/65536.0),
2259 "SubNs: %f nanoseconds", (time_subns/65536.0));
2261 *cur_offset = *cur_offset + 8;
2264 /* Code to actually dissect the PTPv2 packets */
2267 dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2269 guint8 ptp_v2_transport_specific = 0;
2270 guint8 ptp_v2_messageid = 0;
2271 guint16 ptp_v2_mm_managementId = 0;
2272 guint8 ptp_v2_management_action = 0;
2277 /* Set up structures needed to add the protocol subtree and manage it */
2278 proto_item *ti, *transportspecific_ti, *flags_ti, *managementData_ti, *clockType_ti, *protocolAddress_ti;
2279 proto_tree *ptp_tree, *ptp_transportspecific_tree, *ptp_flags_tree, *ptp_managementData_tree,
2280 *ptp_clockType_tree, *ptp_protocolAddress_tree;
2282 /* Make entries in Protocol column and Info column on summary display */
2283 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PTPv2");
2285 /* Get transport specific bit to determine whether this is an AS packet or not */
2286 ptp_v2_transport_specific = 0xF0 & tvb_get_guint8 (tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET);
2288 /* Get control field (what kind of message is this? (Sync, DelayReq, ...) */
2289 ptp_v2_messageid = 0x0F & tvb_get_guint8 (tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET);
2291 /* Extend Info column with managementId */
2292 if (check_col(pinfo->cinfo, COL_INFO))
2294 /* Create and set the string for "Info" column */
2295 if ( ptp_v2_messageid == PTP_V2_MANAGEMENT_MESSAGE )
2299 tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
2300 /* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
2303 case PTP_V2_TLV_TYPE_MANAGEMENT:
2304 /* Get the managementId */
2305 ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET);
2306 ptp_v2_management_action = 0x0F & tvb_get_guint8(tvb, PTP_V2_MM_ACTION_OFFSET);
2307 col_add_fstr(pinfo->cinfo, COL_INFO, "Management (%s) %s",
2308 val_to_str(ptp_v2_mm_managementId, ptp_v2_managementID_infocolumn_vals, "Unknown management Id %u"),
2309 val_to_str(ptp_v2_management_action, ptp_v2_mm_action_vals, "Unknown Action %u"));
2311 case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS:
2312 /* Get the managementErrorId */
2313 ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET);
2314 col_add_fstr(pinfo->cinfo, COL_INFO, "Management Error Message (%s)", val_to_str(ptp_v2_mm_managementId,
2315 ptp2_managementErrorId_vals, "Unknown Error Id %u"));
2318 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
2324 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
2330 ti = proto_tree_add_item(tree, proto_ptp, tvb, 0, -1, FALSE);
2332 ptp_tree = proto_item_add_subtree(ti, ett_ptp_v2);
2334 transportspecific_ti = proto_tree_add_item(ptp_tree,
2335 hf_ptp_v2_transportspecific, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
2337 ptp_transportspecific_tree = proto_item_add_subtree(transportspecific_ti, ett_ptp_v2_transportspecific);
2339 if (ptpv2_oE == TRUE)
2341 proto_tree_add_item(ptp_transportspecific_tree,
2342 hf_ptp_v2_transportspecific_802as_conform, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
2346 proto_tree_add_item(ptp_transportspecific_tree,
2347 hf_ptp_v2_transportspecific_v1_compatibility, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
2350 proto_tree_add_item(ptp_tree,
2351 hf_ptp_v2_messageid, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
2353 proto_tree_add_item(ptp_tree,
2354 hf_ptp_v2_versionptp, tvb, PTP_V2_VERSIONPTP_OFFSET, 1, FALSE);
2356 proto_tree_add_item(ptp_tree,
2357 hf_ptp_v2_messagelength, tvb, PTP_V2_MESSAGE_LENGTH_OFFSET, 2, FALSE);
2359 proto_tree_add_item(ptp_tree,
2360 hf_ptp_v2_domainnumber, tvb, PTP_V2_DOMAIN_NUMBER_OFFSET, 1, FALSE);
2363 flags_ti = proto_tree_add_item(ptp_tree,
2364 hf_ptp_v2_flags, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2366 ptp_flags_tree = proto_item_add_subtree(flags_ti, ett_ptp_v2_flags);
2368 proto_tree_add_item(ptp_flags_tree,
2369 hf_ptp_v2_flags_security, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2371 proto_tree_add_item(ptp_flags_tree,
2372 hf_ptp_v2_flags_specific2, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2374 proto_tree_add_item(ptp_flags_tree,
2375 hf_ptp_v2_flags_specific1, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2377 proto_tree_add_item(ptp_flags_tree,
2378 hf_ptp_v2_flags_unicast, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2380 proto_tree_add_item(ptp_flags_tree,
2381 hf_ptp_v2_flags_twostep, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2383 proto_tree_add_item(ptp_flags_tree,
2384 hf_ptp_v2_flags_alternatemaster, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2386 proto_tree_add_item(ptp_flags_tree,
2387 hf_ptp_v2_flags_frequencytraceable, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2389 proto_tree_add_item(ptp_flags_tree,
2390 hf_ptp_v2_flags_timetraceable, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2392 proto_tree_add_item(ptp_flags_tree,
2393 hf_ptp_v2_flags_ptptimescale, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2395 proto_tree_add_item(ptp_flags_tree,
2396 hf_ptp_v2_flags_utcoffsetvalid, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2398 proto_tree_add_item(ptp_flags_tree,
2399 hf_ptp_v2_flags_li59, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2401 proto_tree_add_item(ptp_flags_tree,
2402 hf_ptp_v2_flags_li61, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2404 temp = PTP_V2_CORRECTIONNS_OFFSET;
2406 dissect_ptp_v2_timeInterval(tvb, &temp, ptp_tree, "correction", hf_ptp_v2_correction, hf_ptp_v2_correctionsubns);
2408 proto_tree_add_item(ptp_tree,
2409 hf_ptp_v2_clockidentity, tvb, PTP_V2_CLOCKIDENTITY_OFFSET, 8, FALSE);
2411 proto_tree_add_item(ptp_tree,
2412 hf_ptp_v2_sourceportid, tvb, PTP_V2_SOURCEPORTID_OFFSET, 2, FALSE);
2414 proto_tree_add_item(ptp_tree,
2415 hf_ptp_v2_sequenceid, tvb, PTP_V2_SEQUENCEID_OFFSET, 2, FALSE);
2417 proto_tree_add_item(ptp_tree,
2418 hf_ptp_v2_control, tvb, PTP_V2_CONTROL_OFFSET, 1, FALSE);
2420 proto_tree_add_item(ptp_tree,
2421 hf_ptp_v2_logmessageperiod, tvb, PTP_V2_LOGMESSAGEPERIOD_OFFSET, 1, FALSE);
2423 switch(ptp_v2_messageid){
2424 case PTP_V2_ANNOUNCE_MESSAGE:{
2428 guint16 tlv_total_length;
2430 proto_tree *ptp_tlv_tree;
2432 /* In 802.1AS there is no origin timestamp in an Announce Message */
2433 if(!(ptp_v2_transport_specific & PTP_V2_TRANSPORTSPECIFIC_ASPACKET_BITMASK)){
2435 timeStamp = tvb_get_ntohl(tvb, PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET);
2436 timeStamp = timeStamp << 16;
2437 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET+4);
2439 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origintimestamp_seconds, tvb,
2440 PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2442 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origintimestamp_nanoseconds, tvb,
2443 PTP_V2_AN_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2446 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origincurrentutcoffset, tvb,
2447 PTP_V2_AN_ORIGINCURRENTUTCOFFSET_OFFSET, 2, FALSE);
2449 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_priority1, tvb,
2450 PTP_V2_AN_PRIORITY_1_OFFSET, 1, FALSE);
2452 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockclass, tvb,
2453 PTP_V2_AN_GRANDMASTERCLOCKCLASS_OFFSET, 1, FALSE);
2455 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockaccuracy, tvb,
2456 PTP_V2_AN_GRANDMASTERCLOCKACCURACY_OFFSET, 1, FALSE);
2458 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockvariance, tvb,
2459 PTP_V2_AN_GRANDMASTERCLOCKVARIANCE_OFFSET, 2, FALSE);
2461 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_priority2, tvb,
2462 PTP_V2_AN_PRIORITY_2_OFFSET, 1, FALSE);
2464 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockidentity, tvb,
2465 PTP_V2_AN_GRANDMASTERCLOCKIDENTITY_OFFSET, 8, FALSE);
2467 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_localstepsremoved, tvb,
2468 PTP_V2_AN_LOCALSTEPSREMOVED_OFFSET, 2, FALSE);
2470 proto_tree_add_item(ptp_tree,
2471 hf_ptp_v2_an_timesource, tvb, PTP_V2_AN_TIMESOURCE_OFFSET, 1, FALSE);
2473 tlv_total_length = 0;
2474 while (tvb_reported_length_remaining(tvb, PTP_V2_AN_TLV_OFFSET + tlv_total_length) >= 2)
2476 /* There are TLV's to be processed */
2477 tlv_type = tvb_get_ntohs (tvb, PTP_V2_AN_TLV_OFFSET+tlv_total_length+PTP_V2_AN_TLV_TYPE_OFFSET);
2478 tlv_length = tvb_get_ntohs (tvb, PTP_V2_AN_TLV_OFFSET+tlv_total_length+PTP_V2_AN_TLV_LENGTHFIELD_OFFSET);
2480 tlv_ti = proto_tree_add_text(
2483 PTP_V2_AN_TLV_OFFSET + tlv_total_length,
2484 tlv_length + PTP_V2_AN_TLV_DATA_OFFSET,
2486 val_to_str(tlv_type,
2487 ptp_v2_TLV_type_vals,
2490 ptp_tlv_tree = proto_item_add_subtree(tlv_ti, ett_ptp_v2_tlv);
2492 proto_tree_add_item(ptp_tlv_tree,
2493 hf_ptp_v2_an_tlv_tlvtype,
2495 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_TYPE_OFFSET,
2499 proto_tree_add_item(ptp_tlv_tree,
2500 hf_ptp_v2_an_tlv_lengthfield,
2502 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_LENGTHFIELD_OFFSET,
2508 case PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR:
2510 proto_tree_add_item(ptp_tlv_tree,
2511 hf_ptp_v2_atoi_tlv_keyfield,
2513 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_KEYFIELD_OFFSET,
2517 proto_tree_add_item(ptp_tlv_tree,
2518 hf_ptp_v2_atoi_tlv_currentoffset,
2520 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_CURRENTOFFSET_OFFSET,
2524 proto_tree_add_item(ptp_tlv_tree,
2525 hf_ptp_v2_atoi_tlv_jumpseconds,
2527 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_JUMPSECONDS_OFFSET,
2531 proto_tree_add_item(ptp_tlv_tree,
2532 hf_ptp_v2_atoi_tlv_timeofnextjump,
2534 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_TIMEOFNEXTJUMP_OFFSET,
2538 Offset = PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_DISPLAYNAME_OFFSET;
2539 dissect_ptp_v2_text(tvb,
2542 hf_ptp_v2_atoi_tlv_displayname,
2543 hf_ptp_v2_atoi_tlv_displayname_length);
2547 case PTP_V2_TLV_TYPE_PATH_TRACE:
2549 guint16 path_seq_total_length;
2551 for(path_seq_total_length = 0; path_seq_total_length < tlv_length; path_seq_total_length+=8)
2553 proto_tree_add_item(ptp_tlv_tree, hf_ptp_v2_an_tlv_pathsequence, tvb,
2554 PTP_V2_AN_TLV_OFFSET + PTP_AS_AN_TLV_PATH_TRACE_OFFSET + path_seq_total_length,
2562 proto_tree_add_item(ptp_tlv_tree,
2563 hf_ptp_v2_an_tlv_data,
2565 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_DATA_OFFSET,
2572 tlv_total_length += (tlv_length + PTP_V2_AN_TLV_DATA_OFFSET);
2578 case PTP_V2_SYNC_MESSAGE:
2579 case PTP_V2_DELAY_REQ_MESSAGE:{
2580 timeStamp = tvb_get_ntohl(tvb, PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET);
2581 timeStamp = timeStamp << 16;
2582 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET+4);
2584 proto_tree_add_item(ptp_tree, hf_ptp_v2_sdr_origintimestamp_seconds, tvb,
2585 PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2587 proto_tree_add_item(ptp_tree, hf_ptp_v2_sdr_origintimestamp_nanoseconds, tvb,
2588 PTP_V2_SDR_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2593 case PTP_V2_FOLLOWUP_MESSAGE:{
2597 proto_tree *ptp_tlv_tree;
2599 timeStamp = tvb_get_ntohl(tvb, PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET);
2600 timeStamp = timeStamp << 16;
2601 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET+4);
2603 proto_tree_add_item(ptp_tree, hf_ptp_v2_fu_preciseorigintimestamp_seconds, tvb,
2604 PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2606 proto_tree_add_item(ptp_tree, hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds, tvb,
2607 PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2609 /* In 802.1AS there is a Follow_UP information TLV in the Follow Up Message */
2610 if(ptp_v2_transport_specific & PTP_V2_TRANSPORTSPECIFIC_ASPACKET_BITMASK){
2612 /* There are TLV's to be processed */
2613 tlv_type = tvb_get_ntohs (tvb, PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_TYPE_OFFSET);
2614 tlv_length = tvb_get_ntohs (tvb, PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_LENGTHFIELD_OFFSET);
2616 tlv_ti = proto_tree_add_text(
2619 PTP_AS_FU_TLV_INFORMATION_OFFSET,
2620 tlv_length + PTP_AS_FU_TLV_ORGANIZATIONID_OFFSET,
2622 "Follow Up information");
2624 ptp_tlv_tree = proto_item_add_subtree(tlv_ti, ett_ptp_v2_tlv);
2626 proto_tree_add_item(ptp_tlv_tree,
2627 hf_ptp_as_fu_tlv_tlvtype,
2629 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_TYPE_OFFSET,
2633 proto_tree_add_item(ptp_tlv_tree,
2634 hf_ptp_as_fu_tlv_lengthfield,
2636 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_LENGTHFIELD_OFFSET,
2640 proto_tree_add_item(ptp_tlv_tree,
2641 hf_ptp_as_fu_tlv_organization_id,
2643 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_ORGANIZATIONID_OFFSET,
2647 proto_tree_add_item(ptp_tlv_tree,
2648 hf_ptp_as_fu_tlv_organization_subtype,
2650 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_ORGANIZATIONSUBTYPE_OFFSET,
2654 proto_tree_add_item(ptp_tlv_tree,
2655 hf_ptp_as_fu_tlv_cumulative_offset,
2657 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_CUMULATIVESCALEDRATEOFFSET_OFFSET,
2661 proto_tree_add_item(ptp_tlv_tree,
2662 hf_ptp_as_fu_tlv_gm_base_indicator,
2664 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_GMTIMEBASEINDICATOR_OFFSET,
2668 proto_tree_add_item(ptp_tlv_tree,
2669 hf_ptp_as_fu_tlv_last_gm_phase_change,
2671 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_LASTGMPHASECHANGE_OFFSET,
2675 proto_tree_add_item(ptp_tlv_tree,
2676 hf_ptp_as_fu_tlv_scaled_last_gm_phase_change,
2678 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_SCALEDLASTGMFREQCHANGE_OFFSET,
2687 case PTP_V2_DELAY_RESP_MESSAGE:{
2688 timeStamp = tvb_get_ntohl(tvb, PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET);
2689 timeStamp = timeStamp << 16;
2690 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET+4);
2692 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_receivetimestamp_seconds, tvb,
2693 PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET, 6, FALSE);
2695 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_receivetimestamp_nanoseconds, tvb,
2696 PTP_V2_DR_RECEIVETIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2698 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_requestingportidentity, tvb,
2699 PTP_V2_DR_REQUESTINGPORTIDENTITY_OFFSET, 8, FALSE);
2701 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_requestingsourceportid, tvb,
2702 PTP_V2_DR_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
2707 case PTP_V2_PATH_DELAY_REQ_MESSAGE:{
2708 /* In 802.1AS there is no origin timestamp in a Pdelay_Req Message */
2709 if(!(ptp_v2_transport_specific & PTP_V2_TRANSPORTSPECIFIC_ASPACKET_BITMASK)){
2711 timeStamp = tvb_get_ntohl(tvb, PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET);
2712 timeStamp = timeStamp << 16;
2713 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET+4);
2715 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrq_origintimestamp_seconds, tvb,
2716 PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2718 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrq_origintimestamp_nanoseconds, tvb,
2719 PTP_V2_PDRQ_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2725 case PTP_V2_PATH_DELAY_RESP_MESSAGE:{
2726 timeStamp = tvb_get_ntohl(tvb, PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET);
2727 timeStamp = timeStamp << 16;
2728 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET+4);
2730 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestreceipttimestamp_seconds, tvb,
2731 PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2733 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds, tvb,
2734 PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2736 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestingportidentity, tvb,
2737 PTP_V2_PDRS_REQUESTINGPORTIDENTITY_OFFSET, 8, FALSE);
2739 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestingsourceportid, tvb,
2740 PTP_V2_PDRS_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
2745 case PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE:{
2746 timeStamp = tvb_get_ntohl(tvb, PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET);
2747 timeStamp = timeStamp << 16;
2748 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET+4);
2750 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_responseorigintimestamp_seconds, tvb,
2751 PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2753 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds, tvb,
2754 PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2757 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_requestingportidentity, tvb,
2758 PTP_V2_PDFU_REQUESTINGPORTIDENTITY_OFFSET, 8, FALSE);
2760 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_requestingsourceportid, tvb,
2761 PTP_V2_PDFU_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
2766 case PTP_V2_SIGNALLING_MESSAGE:{
2767 guint16 tlv_type, tlv_length;
2768 proto_item *tlv_ti, *sig_tlv_flags_ti;
2769 proto_tree *ptp_tlv_tree, *sig_tlv_flags_tree;
2771 proto_tree_add_item(ptp_tree, hf_ptp_v2_sig_targetportidentity, tvb,
2772 PTP_V2_SIG_TARGETPORTIDENTITY_OFFSET, 8, FALSE);
2774 proto_tree_add_item(ptp_tree, hf_ptp_v2_sig_targetportid, tvb,
2775 PTP_V2_SIG_TARGETPORTID_OFFSET, 2, FALSE);
2777 /* In 802.1AS there is a Message Interval Request TLV in the Signalling Message */
2778 if(ptp_v2_transport_specific & PTP_V2_TRANSPORTSPECIFIC_ASPACKET_BITMASK){
2780 /* There are TLV's to be processed */
2781 tlv_type = tvb_get_ntohs (tvb, PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_TYPE_OFFSET);
2782 tlv_length = tvb_get_ntohs (tvb, PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_LENGTHFIELD_OFFSET);
2784 tlv_ti = proto_tree_add_text(
2787 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET,
2788 tlv_length + PTP_AS_SIG_TLV_ORGANIZATIONID_OFFSET,
2790 "Message Interval Request");
2792 ptp_tlv_tree = proto_item_add_subtree(tlv_ti, ett_ptp_v2_tlv);
2794 proto_tree_add_item(ptp_tlv_tree,
2795 hf_ptp_as_sig_tlv_tlvtype,
2797 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_TYPE_OFFSET,
2801 proto_tree_add_item(ptp_tlv_tree,
2802 hf_ptp_as_sig_tlv_lengthfield,
2804 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_LENGTHFIELD_OFFSET,
2808 proto_tree_add_item(ptp_tlv_tree,
2809 hf_ptp_as_sig_tlv_organization_id,
2811 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_ORGANIZATIONID_OFFSET,
2815 proto_tree_add_item(ptp_tlv_tree,
2816 hf_ptp_as_sig_tlv_organization_subtype,
2818 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_ORGANIZATIONSUBTYPE_OFFSET,
2822 proto_tree_add_item(ptp_tlv_tree,
2823 hf_ptp_as_sig_tlv_link_delay_interval,
2825 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_LINKDELAYINTERVAL_OFFSET,
2829 proto_tree_add_item(ptp_tlv_tree,
2830 hf_ptp_as_sig_tlv_time_sync_interval,
2832 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_TIMESYNCINTERVAL_OFFSET,
2836 proto_tree_add_item(ptp_tlv_tree,
2837 hf_ptp_as_sig_tlv_announce_interval,
2839 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_ANNOUNCEINTERVAL_OFFSET,
2843 sig_tlv_flags_ti = proto_tree_add_item(ptp_tlv_tree,
2844 hf_ptp_as_sig_tlv_flags,
2846 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_FLAGS_OFFSET,
2850 sig_tlv_flags_tree = proto_item_add_subtree(sig_tlv_flags_ti, ett_ptp_as_sig_tlv_flags);
2852 proto_tree_add_item(sig_tlv_flags_tree,
2853 hf_ptp_as_sig_tlv_flags_comp_rate_ratio,
2855 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_FLAGS_OFFSET,
2859 proto_tree_add_item(sig_tlv_flags_tree,
2860 hf_ptp_as_sig_tlv_flags_comp_prop_delay,
2862 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_FLAGS_OFFSET,
2869 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_tlvType, tvb,
2870 PTP_V2_SIG_TARGETPORTID_OFFSET+2, 2, FALSE);
2872 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_lengthField, tvb,
2873 PTP_V2_SIG_TARGETPORTID_OFFSET+4, 2, FALSE);
2875 tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
2876 tlv_length = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_LENGTHFIELD_OFFSET);
2878 if (tlv_length <= 2)
2883 /* ToDO: Add dissector for TLVs and allow multiple TLVs */
2884 proto_tree_add_text(ptp_tree, tvb, PTP_V2_SIG_TARGETPORTID_OFFSET+6, tlv_length, "Data");
2889 case PTP_V2_MANAGEMENT_MESSAGE:
2891 guint16 tlv_type, tlv_length;
2893 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_targetportidentity, tvb,
2894 PTP_V2_MM_TARGETPORTIDENTITY_OFFSET, 8, FALSE);
2896 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_targetportid, tvb,
2897 PTP_V2_MM_TARGETPORTID_OFFSET, 2, FALSE);
2899 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_startingboundaryhops, tvb,
2900 PTP_V2_MM_STARTINGBOUNDARYHOPS_OFFSET, 1, FALSE);
2902 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_boundaryhops, tvb,
2903 PTP_V2_MM_BOUNDARYHOPS_OFFSET, 1, FALSE);
2905 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_action, tvb,
2906 PTP_V2_MM_ACTION_OFFSET, 1, FALSE);
2908 /* management TLV */
2909 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_tlvType, tvb,
2910 PTP_V2_MM_TLV_TYPE_OFFSET, 2, FALSE);
2912 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_lengthField, tvb,
2913 PTP_V2_MM_TLV_LENGTHFIELD_OFFSET, 2, FALSE);
2915 tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
2916 tlv_length = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_LENGTHFIELD_OFFSET);
2918 /* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
2920 case PTP_V2_TLV_TYPE_MANAGEMENT:
2922 guint16 ptp_v2_managementId;
2923 guint16 Offset = PTP_V2_MM_TLV_DATAFIELD_OFFSET;
2925 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_managementId, tvb,
2926 PTP_V2_MM_TLV_MANAGEMENTID_OFFSET, 2, FALSE);
2928 ptp_v2_managementId = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET);
2930 if (tlv_length <= 2)
2936 managementData_ti = proto_tree_add_text(ptp_tree, tvb, Offset, tlv_length, "Data");
2938 /* data field of the management message (subtree)*/
2939 ptp_managementData_tree = proto_item_add_subtree(managementData_ti, ett_ptp_v2_managementData);
2941 switch(ptp_v2_managementId) {
2942 case PTP_V2_MM_ID_NULL_MANAGEMENT:
2944 /* no data in NULL management */
2947 case PTP_V2_MM_ID_CLOCK_DESCRIPTION:
2949 guint16 N = 0, S = 0;
2950 clockType_ti = proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockType, tvb,
2953 ptp_clockType_tree = proto_item_add_subtree(clockType_ti, ett_ptp_v2_clockType);
2954 /* ClockType Subtree */
2955 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_ordinaryClock, tvb,
2958 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_boundaryClock, tvb,
2961 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_p2p_transparentClock, tvb,
2964 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_e2e_transparentClock, tvb,
2967 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_managementNode, tvb,
2970 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_reserved, tvb,
2974 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
2975 hf_ptp_v2_mm_physicalLayerProtocol, hf_ptp_v2_mm_physicalLayerProtocol_length);
2977 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_physicalAddressLength, tvb,
2980 S = tvb_get_ntohs (tvb, Offset);
2983 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_physicalAddress, tvb,
2987 N = tvb_get_ntohs (tvb, Offset+2);
2989 protocolAddress_ti = proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_protocolAddress, tvb,
2990 Offset+4, N, FALSE);
2992 ptp_protocolAddress_tree = proto_item_add_subtree(protocolAddress_ti, ett_ptp_v2_protocolAddress);
2993 /* physicalLayerProtocol subtree */
2994 proto_tree_add_item(ptp_protocolAddress_tree, hf_ptp_v2_mm_protocolAddress_networkProtocol, tvb,
2997 proto_tree_add_item(ptp_protocolAddress_tree, hf_ptp_v2_mm_protocolAddress_length, tvb,
2998 Offset+2, 2, FALSE);
3000 proto_tree_add_item(ptp_protocolAddress_tree, hf_ptp_v2_mm_protocolAddress, tvb,
3001 Offset+4, N, FALSE);
3005 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_manufacturerIdentity, tvb,
3010 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3014 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3015 hf_ptp_v2_mm_productDescription, hf_ptp_v2_mm_productDescription_length);
3016 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3017 hf_ptp_v2_mm_revisionData, hf_ptp_v2_mm_revisionData_length);
3018 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3019 hf_ptp_v2_mm_userDescription, hf_ptp_v2_mm_userDescription_length);
3021 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_profileIdentity, tvb,
3025 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3026 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
3028 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
3033 case PTP_V2_MM_ID_USER_DESCRIPTION:
3036 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3037 hf_ptp_v2_mm_userDescription, hf_ptp_v2_mm_userDescription_length);
3039 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3040 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
3042 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
3047 case PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE:
3052 case PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE:
3057 case PTP_V2_MM_ID_INITIALIZE:
3059 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_initializationKey, tvb,
3063 case PTP_V2_MM_ID_FAULT_LOG:
3066 proto_item *ptpError_ti;
3067 proto_tree *ptpError_subtree;
3069 num = tvb_get_ntohs (tvb, Offset);
3071 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberOfFaultRecords, tvb,
3075 for (i = 1; i <= num; i++)
3077 ptpError_ti = proto_tree_add_text(ptp_managementData_tree, tvb, Offset, tvb_get_ntohs (tvb, Offset), "Fault record");
3080 ptpError_subtree = proto_item_add_subtree(ptpError_ti, ett_ptp_v2_faultRecord);
3082 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_faultRecordLength, tvb,
3086 timeStamp = tvb_get_ntohl(tvb, Offset);
3087 timeStamp = timeStamp << 16;
3088 timeStamp = timeStamp | tvb_get_ntohs(tvb, Offset+4);
3090 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_faultTime_s, tvb,
3094 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_faultTime_ns, tvb,
3097 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_severityCode, tvb,
3101 dissect_ptp_v2_text (tvb, &Offset, ptpError_subtree,
3102 hf_ptp_v2_mm_faultName, hf_ptp_v2_mm_faultName_length);
3104 dissect_ptp_v2_text (tvb, &Offset, ptpError_subtree,
3105 hf_ptp_v2_mm_faultValue, hf_ptp_v2_mm_faultValue_length);
3107 dissect_ptp_v2_text (tvb, &Offset, ptpError_subtree,
3108 hf_ptp_v2_mm_faultDescription, hf_ptp_v2_mm_faultDescription_length);
3111 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3112 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
3114 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
3119 case PTP_V2_MM_ID_FAULT_LOG_RESET:
3124 case PTP_V2_MM_ID_DEFAULT_DATA_SET:
3126 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_TSC, tvb,
3127 PTP_V2_MM_TLV_DATAFIELD_OFFSET, 1, FALSE);
3129 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_dds_SO, tvb,
3130 PTP_V2_MM_TLV_DATAFIELD_OFFSET, 1, FALSE);
3132 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3133 PTP_V2_MM_RESERVED1, 1, FALSE);
3135 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberPorts, tvb,
3136 PTP_V2_MM_NUMBERPORTS, 2, FALSE);
3138 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority1, tvb,
3139 PTP_V2_MM_PRIORITY1, 1, FALSE);
3141 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockclass, tvb,
3142 PTP_V2_MM_CLOCKQUALITY, 1, FALSE);
3144 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockaccuracy, tvb,
3145 PTP_V2_MM_CLOCKQUALITY+1, 1, FALSE);
3147 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockvariance, tvb,
3148 PTP_V2_MM_CLOCKQUALITY+2, 2, FALSE);
3150 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority2, tvb,
3151 PTP_V2_MM_PRIORITY2, 1, FALSE);
3153 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3154 PTP_V2_MM_CLOCKIDENTITY, 8, FALSE);
3156 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_domainNumber, tvb,
3157 PTP_V2_MM_DOMAINNUMBER, 1, FALSE);
3159 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3160 PTP_V2_MM_RESERVED2, 1, FALSE);
3163 case PTP_V2_MM_ID_CURRENT_DATA_SET:
3165 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_stepsRemoved, tvb,
3169 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
3170 "Offset from Master", hf_ptp_v2_mm_offset_ns, hf_ptp_v2_mm_offset_subns);
3171 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
3172 "Mean path delay", hf_ptp_v2_mm_pathDelay_ns, hf_ptp_v2_mm_pathDelay_subns);
3175 case PTP_V2_MM_ID_PARENT_DATA_SET:
3177 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_parentIdentity, tvb,
3180 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_parentPort, tvb,
3181 Offset+8, 2, FALSE);
3184 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_parentStats, tvb,
3188 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3192 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_observedParentOffsetScaledLogVariance, tvb,
3196 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_observedParentClockPhaseChangeRate, tvb,
3200 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterPriority1, tvb,
3204 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterclockclass, tvb,
3207 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterclockaccuracy, tvb,
3208 Offset+1, 1, FALSE);
3210 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterclockvariance, tvb,
3211 Offset+2, 2, FALSE);
3214 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterPriority2, tvb,
3218 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterIdentity, tvb,
3223 case PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET:
3225 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentUtcOffset, tvb,
3229 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_61, tvb,
3231 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_59, tvb,
3233 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_UTCV, tvb,
3235 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PTP, tvb,
3237 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_TTRA, tvb,
3239 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_FTRA, tvb,
3243 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_timesource, tvb,
3248 case PTP_V2_MM_ID_PORT_DATA_SET:
3250 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3254 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PortNumber, tvb,
3258 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_portState, tvb,
3262 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinDelayReqInterval, tvb,
3266 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
3267 "Peer mean path delay", hf_ptp_v2_mm_peerMeanPathDelay_ns, hf_ptp_v2_mm_peerMeanPathDelay_subns);
3269 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logAnnounceInterval, tvb,
3273 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_announceReceiptTimeout, tvb,
3277 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logSyncInterval, tvb,
3281 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_delayMechanism, tvb,
3285 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinPdelayReqInterval, tvb,
3289 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_versionNumber, tvb,
3295 case PTP_V2_MM_ID_PRIORITY1:
3297 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority1, tvb,
3299 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3300 Offset+1, 1, FALSE);
3303 case PTP_V2_MM_ID_PRIORITY2:
3305 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority2, tvb,
3307 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3308 Offset+1, 1, FALSE);
3311 case PTP_V2_MM_ID_DOMAIN:
3313 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_domainNumber, tvb,
3315 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3316 Offset+1, 1, FALSE);
3319 case PTP_V2_MM_ID_SLAVE_ONLY:
3321 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_SO, tvb,
3323 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3324 Offset+1, 1, FALSE);
3327 case PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL:
3329 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logAnnounceInterval, tvb,
3332 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3333 Offset+1, 1, FALSE);
3336 case PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT:
3338 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_announceReceiptTimeout, tvb,
3341 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3342 Offset+1, 1, FALSE);
3345 case PTP_V2_MM_ID_LOG_SYNC_INTERVAL:
3347 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logSyncInterval, tvb,
3350 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3351 Offset+1, 1, FALSE);
3354 case PTP_V2_MM_ID_VERSION_NUMBER:
3356 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_versionNumber, tvb,
3359 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3360 Offset+1, 1, FALSE);
3363 case PTP_V2_MM_ID_ENABLE_PORT:
3368 case PTP_V2_MM_ID_DISABLE_PORT:
3373 case PTP_V2_MM_ID_TIME:
3375 timeStamp = tvb_get_ntohl(tvb, Offset);
3376 timeStamp = timeStamp << 16;
3377 timeStamp = timeStamp | tvb_get_ntohs(tvb, Offset+4);
3379 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentTime_s, tvb,
3383 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentTime_ns, tvb,
3387 case PTP_V2_MM_ID_CLOCK_ACCURACY:
3389 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockAccuracy, tvb,
3391 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3392 Offset+1, 1, FALSE);
3395 case PTP_V2_MM_ID_UTC_PROPERTIES:
3397 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentUtcOffset, tvb,
3401 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_61, tvb,
3403 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_59, tvb,
3405 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_UTCV, tvb,
3409 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3413 case PTP_V2_MM_ID_TRACEABILITY_PROPERTIES:
3415 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_TTRA, tvb,
3417 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_FTRA, tvb,
3421 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3426 case PTP_V2_MM_ID_TIMESCALE_PROPERTIES:
3428 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PTP, tvb,
3432 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_timesource, tvb,
3437 case PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE:
3439 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_ucEN, tvb,
3443 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3447 case PTP_V2_MM_ID_PATH_TRACE_LIST:
3450 /* one or more ClockIdentity */
3451 for (i = 1; i <= (tlv_length / 8); i++)
3453 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3459 case PTP_V2_MM_ID_PATH_TRACE_ENABLE:
3461 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_ptEN, tvb,
3465 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3470 case PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE:
3475 case PTP_V2_MM_ID_UNICAST_MASTER_TABLE:
3480 case PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE:
3485 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE:
3490 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED:
3495 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE:
3500 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE:
3502 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_keyField, tvb,
3506 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_atEN, tvb,
3512 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME:
3514 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_keyField, tvb,
3518 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3519 hf_ptp_v2_mm_displayName, hf_ptp_v2_mm_displayName_length);
3521 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3522 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
3524 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
3529 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY:
3531 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_maxKey, tvb,
3535 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3540 case PTP_V2_MM_ID_ALTERNATE_MASTER:
3542 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_transmitAlternateMulticastSync, tvb,
3546 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberOfAlternateMasters, tvb,
3550 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logAlternateMulticastSyncInterval, tvb,
3554 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3558 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES:
3560 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_keyField, tvb,
3564 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentOffset, tvb,
3568 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_jumpSeconds, tvb,
3572 timeStamp = tvb_get_ntohl(tvb, Offset);
3573 timeStamp = timeStamp << 16;
3574 timeStamp = timeStamp | tvb_get_ntohs(tvb, Offset+4);
3576 proto_tree_add_text(ptp_managementData_tree, tvb, Offset, 6,
3577 "Time of next jump (seconds): %" G_GINT64_MODIFIER "u", timeStamp);
3580 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3584 case PTP_V2_MM_ID_TC_DEFAULT_DATA_SET:
3586 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3590 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberPorts, tvb,
3594 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_delayMechanism, tvb,
3598 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_primaryDomain, tvb,
3603 case PTP_V2_MM_ID_TC_PORT_DATA_SET:
3605 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3609 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PortNumber, tvb,
3613 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_faultyFlag, tvb,
3617 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinPdelayReqInterval, tvb,
3621 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
3622 "Peer mean path delay", hf_ptp_v2_mm_peerMeanPathDelay_ns, hf_ptp_v2_mm_peerMeanPathDelay_subns);
3625 case PTP_V2_MM_ID_PRIMARY_DOMAIN:
3627 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_primaryDomain, tvb,
3630 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3631 Offset+1, 1, FALSE);
3634 case PTP_V2_MM_ID_DELAY_MECHANISM:
3636 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_delayMechanism, tvb,
3639 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3640 Offset+1, 1, FALSE);
3643 case PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL:
3645 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinPdelayReqInterval, tvb,
3648 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3649 Offset+1, 1, FALSE);
3657 } /* switch(ptp_v2_managementId) */
3660 case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS:
3662 /* there is only one error TLV */
3663 guint16 Offset = PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET;
3665 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_managementErrorId, tvb,
3669 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_managementId, tvb,
3673 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_reserved, tvb,
3677 /* optional Field! */
3678 if (Offset - PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET + 2 < tlv_length)
3680 dissect_ptp_v2_text (tvb, &Offset, ptp_tree,
3681 hf_ptp_v2_mm_displayData, hf_ptp_v2_mm_displayData_length);
3684 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3685 if ( (Offset - PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET) % 2 )
3687 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_pad, tvb,
3696 } /* switch TLV Type */
3697 } /* case Management Message */
3698 } /* switch message ID*/
3703 /* Register the protocol with Wireshark */
3706 proto_register_ptp(void)
3708 static hf_register_info hf[] = {
3709 /* PTPv1 fields **********************************************************/
3710 /*Common fields for all frames*/
3711 { &hf_ptp_versionptp,
3712 { "versionPTP", "ptp.versionptp",
3713 FT_UINT16, BASE_DEC, NULL, 0x00,
3716 { &hf_ptp_versionnetwork,
3717 { "versionNetwork", "ptp.versionnetwork",
3718 FT_UINT16, BASE_DEC, NULL, 0x00,
3721 { &hf_ptp_subdomain,
3722 { "subdomain", "ptp.subdomain",
3723 FT_STRING, BASE_NONE, NULL, 0x00,
3726 { &hf_ptp_messagetype,
3727 { "messageType", "ptp.messagetype",
3728 FT_UINT8, BASE_DEC, VALS(ptp_messagetype_vals), 0x00,
3731 { &hf_ptp_sourcecommunicationtechnology,
3732 { "sourceCommunicationTechnology", "ptp.sourcecommunicationtechnology",
3733 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3736 { &hf_ptp_sourceuuid,
3737 { "sourceUuid", "ptp.sourceuuid",
3738 FT_ETHER, BASE_NONE, NULL, 0x00,
3741 { &hf_ptp_sourceportid,
3742 { "sourcePortId", "ptp.sourceportid",
3743 FT_UINT16, BASE_DEC, NULL, 0x00,
3746 { &hf_ptp_sequenceid,
3747 { "sequenceId", "ptp.sequenceid",
3748 FT_UINT16, BASE_DEC, NULL, 0x00,
3752 { "control", "ptp.control",
3753 FT_UINT8, BASE_DEC, VALS(ptp_control_vals), 0x00,
3758 { "flags", "ptp.flags",
3759 FT_UINT16, BASE_HEX, NULL, 0x00,
3762 { &hf_ptp_flags_li61,
3763 { "PTP_LI61", "ptp.flags.li61",
3764 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_LI61_BITMASK,
3767 { &hf_ptp_flags_li59,
3768 { "PTP_LI59", "ptp.flags.li59",
3769 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_LI59_BITMASK,
3772 { &hf_ptp_flags_boundary_clock,
3773 { "PTP_BOUNDARY_CLOCK", "ptp.flags.boundary_clock",
3774 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_BOUNDARY_CLOCK_BITMASK,
3777 { &hf_ptp_flags_assist,
3778 { "PTP_ASSIST", "ptp.flags.assist",
3779 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_ASSIST_BITMASK,
3782 { &hf_ptp_flags_ext_sync,
3783 { "PTP_EXT_SYNC", "ptp.flags.ext_sync",
3784 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_EXT_SYNC_BITMASK,
3787 { &hf_ptp_flags_parent,
3788 { "PTP_PARENT_STATS", "ptp.flags.parent_stats",
3789 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_PARENT_STATS_BITMASK,
3792 { &hf_ptp_flags_sync_burst,
3793 { "PTP_SYNC_BURST", "ptp.flags.sync_burst",
3794 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_SYNC_BURST_BITMASK,
3797 /*END OF THE FLAG-FIELD*/
3799 /*offsets for ptp_sync and delay_req (=sdr) messages*/
3800 { &hf_ptp_sdr_origintimestamp,
3801 { "originTimestamp", "ptp.sdr.origintimestamp",
3802 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
3805 { &hf_ptp_sdr_origintimestamp_seconds,
3806 { "originTimestamp (seconds)", "ptp.sdr.origintimestamp_seconds",
3807 FT_UINT32, BASE_DEC, NULL, 0x00,
3810 { &hf_ptp_sdr_origintimestamp_nanoseconds,
3811 { "originTimestamp (nanoseconds)", "ptp.sdr.origintimestamp_nanoseconds",
3812 FT_INT32, BASE_DEC, NULL, 0x00,
3815 { &hf_ptp_sdr_epochnumber,
3816 { "epochNumber", "ptp.sdr.epochnumber",
3817 FT_UINT16, BASE_DEC, NULL, 0x00,
3820 { &hf_ptp_sdr_currentutcoffset,
3821 { "currentUTCOffset", "ptp.sdr.currentutcoffset",
3822 FT_INT16, BASE_DEC, NULL, 0x00,
3825 { &hf_ptp_sdr_grandmastercommunicationtechnology,
3826 { "grandmasterCommunicationTechnology", "ptp.sdr.grandmastercommunicationtechnology",
3827 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3830 { &hf_ptp_sdr_grandmasterclockuuid,
3831 { "grandMasterClockUuid", "ptp.sdr.grandmasterclockuuid",
3832 FT_ETHER, BASE_NONE, NULL, 0x00,
3835 { &hf_ptp_sdr_grandmasterportid,
3836 { "grandmasterPortId", "ptp.sdr.grandmasterportid",
3837 FT_UINT16, BASE_DEC, NULL, 0x00,
3840 { &hf_ptp_sdr_grandmastersequenceid,
3841 { "grandmasterSequenceId", "ptp.sdr.grandmastersequenceid",
3842 FT_UINT16, BASE_DEC, NULL, 0x00,
3845 { &hf_ptp_sdr_grandmasterclockstratum,
3846 { "grandmasterClockStratum", "ptp.sdr.grandmasterclockstratum",
3847 FT_UINT8, BASE_DEC, NULL, 0x00,
3850 { &hf_ptp_sdr_grandmasterclockidentifier,
3851 { "grandmasterClockIdentifier", "ptp.sdr.grandmasterclockidentifier",
3852 FT_STRING, BASE_NONE, NULL, 0x00,
3855 { &hf_ptp_sdr_grandmasterclockvariance,
3856 { "grandmasterClockVariance", "ptp.sdr.grandmasterclockvariance",
3857 FT_INT16, BASE_DEC, NULL, 0x00,
3860 { &hf_ptp_sdr_grandmasterpreferred,
3861 { "grandmasterPreferred", "ptp.sdr.grandmasterpreferred",
3862 FT_UINT8, BASE_DEC, NULL, 0x00,
3865 { &hf_ptp_sdr_grandmasterisboundaryclock,
3866 { "grandmasterIsBoundaryClock", "ptp.sdr.grandmasterisboundaryclock",
3867 FT_UINT8, BASE_DEC, NULL, 0x00,
3870 { &hf_ptp_sdr_syncinterval,
3871 { "syncInterval", "ptp.sdr.syncinterval",
3872 FT_INT8, BASE_DEC, NULL, 0x00,
3875 { &hf_ptp_sdr_localclockvariance,
3876 { "localClockVariance", "ptp.sdr.localclockvariance",
3877 FT_INT16, BASE_DEC, NULL, 0x00,
3880 { &hf_ptp_sdr_localstepsremoved,
3881 { "localStepsRemoved", "ptp.sdr.localstepsremoved",
3882 FT_UINT16, BASE_DEC, NULL, 0x00,
3885 { &hf_ptp_sdr_localclockstratum,
3886 { "localClockStratum", "ptp.sdr.localclockstratum",
3887 FT_UINT8, BASE_DEC, NULL, 0x00,
3890 { &hf_ptp_sdr_localclockidentifier,
3891 { "localClockIdentifier", "ptp.sdr.localclockidentifier",
3892 FT_STRING, BASE_NONE, NULL, 0x00,
3895 { &hf_ptp_sdr_parentcommunicationtechnology,
3896 { "parentCommunicationTechnology", "ptp.sdr.parentcommunicationtechnology",
3897 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3900 { &hf_ptp_sdr_parentuuid,
3901 { "parentUuid", "ptp.sdr.parentuuid",
3902 FT_ETHER, BASE_NONE, NULL, 0x00,
3905 { &hf_ptp_sdr_parentportfield,
3906 { "parentPortField", "ptp.sdr.parentportfield",
3907 FT_UINT16, BASE_DEC, NULL, 0x00,
3910 { &hf_ptp_sdr_estimatedmastervariance,
3911 { "estimatedMasterVariance", "ptp.sdr.estimatedmastervariance",
3912 FT_INT16, BASE_DEC, NULL, 0x00,
3915 { &hf_ptp_sdr_estimatedmasterdrift,
3916 { "estimatedMasterDrift", "ptp.sdr.estimatedmasterdrift",
3917 FT_INT32, BASE_DEC, NULL, 0x00,
3920 { &hf_ptp_sdr_utcreasonable,
3921 { "utcReasonable", "ptp.sdr.utcreasonable",
3922 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3925 /*offsets for follow_up (=fu) messages*/
3926 { &hf_ptp_fu_associatedsequenceid,
3927 { "associatedSequenceId", "ptp.fu.associatedsequenceid",
3928 FT_UINT16, BASE_DEC, NULL, 0x00,
3931 { &hf_ptp_fu_preciseorigintimestamp,
3932 { "preciseOriginTimestamp", "ptp.fu.hf_ptp_fu_preciseorigintimestamp",
3933 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
3936 { &hf_ptp_fu_preciseorigintimestamp_seconds,
3937 { "preciseOriginTimestamp (seconds)", "ptp.fu.hf_ptp_fu_preciseorigintimestamp_seconds",
3938 FT_UINT32, BASE_DEC, NULL, 0x00,
3941 { &hf_ptp_fu_preciseorigintimestamp_nanoseconds,
3942 { "preciseOriginTimestamp (nanoseconds)", "ptp.fu.preciseorigintimestamp_nanoseconds",
3943 FT_INT32, BASE_DEC, NULL, 0x00,
3946 /*offsets for delay_resp (=dr) messages*/
3947 { &hf_ptp_dr_delayreceipttimestamp,
3948 { "delayReceiptTimestamp", "ptp.dr.delayreceipttimestamp",
3949 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
3952 { &hf_ptp_dr_delayreceipttimestamp_seconds,
3953 { "delayReceiptTimestamp (Seconds)", "ptp.dr.delayreceipttimestamp_seconds",
3954 FT_UINT32, BASE_DEC, NULL, 0x00,
3957 { &hf_ptp_dr_delayreceipttimestamp_nanoseconds,
3958 { "delayReceiptTimestamp (nanoseconds)", "ptp.dr.delayreceipttimestamp_nanoseconds",
3959 FT_INT32, BASE_DEC, NULL, 0x00,
3962 { &hf_ptp_dr_requestingsourcecommunicationtechnology,
3963 { "requestingSourceCommunicationTechnology", "ptp.dr.requestingsourcecommunicationtechnology",
3964 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3967 { &hf_ptp_dr_requestingsourceuuid,
3968 { "requestingSourceUuid", "ptp.dr.requestingsourceuuid",
3969 FT_ETHER, BASE_NONE, NULL, 0x00,
3972 { &hf_ptp_dr_requestingsourceportid,
3973 { "requestingSourcePortId", "ptp.dr.requestingsourceportid",
3974 FT_UINT16, BASE_DEC, NULL, 0x00,
3977 { &hf_ptp_dr_requestingsourcesequenceid,
3978 { "requestingSourceSequenceId", "ptp.dr.requestingsourcesequenceid",
3979 FT_UINT16, BASE_DEC, NULL, 0x00,
3982 /*offsets for management (=mm) messages*/
3983 { &hf_ptp_mm_targetcommunicationtechnology,
3984 { "targetCommunicationTechnology", "ptp.mm.targetcommunicationtechnology",
3985 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3988 { &hf_ptp_mm_targetuuid,
3989 { "targetUuid", "ptp.mm.targetuuid",
3990 FT_ETHER, BASE_NONE, NULL, 0x00,
3993 { &hf_ptp_mm_targetportid,
3994 { "targetPortId", "ptp.mm.targetportid",
3995 FT_UINT16, BASE_DEC, NULL, 0x00,
3998 { &hf_ptp_mm_startingboundaryhops,
3999 { "startingBoundaryHops", "ptp.mm.startingboundaryhops",
4000 FT_INT16, BASE_DEC, NULL, 0x00,
4003 { &hf_ptp_mm_boundaryhops,
4004 { "boundaryHops", "ptp.mm.boundaryhops",
4005 FT_INT16, BASE_DEC, NULL, 0x00,
4008 { &hf_ptp_mm_managementmessagekey,
4009 { "managementMessageKey", "ptp.mm.managementmessagekey",
4010 FT_UINT8, BASE_DEC, VALS(ptp_managementMessageKey_vals), 0x00,
4013 { &hf_ptp_mm_parameterlength,
4014 { "parameterLength", "ptp.mm.parameterlength",
4015 FT_UINT16, BASE_DEC, NULL, 0x00,
4018 /*parameterlength > 0*/
4019 { &hf_ptp_mm_messageparameters,
4020 { "messageParameters", "ptp.mm.messageparameters",
4021 FT_BYTES, BASE_NONE, NULL, 0x00,
4024 /*ptp_mm_clock_identity (parameterlength = 64)*/
4025 { &hf_ptp_mm_clock_identity_clockcommunicationtechnology,
4026 { "clockCommunicationTechnology", "ptp.mm.clock.identity.clockcommunicationtechnology",
4027 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4030 { &hf_ptp_mm_clock_identity_clockuuidfield,
4031 { "clockUuidField", "ptp.mm.clock.identity.clockuuidfield",
4032 FT_ETHER, BASE_NONE, NULL, 0x00,
4035 { &hf_ptp_mm_clock_identity_clockportfield,
4036 { "clockPortField", "ptp.mm.clock.identity.clockportfield",
4037 FT_UINT16, BASE_DEC, NULL, 0x00,
4040 { &hf_ptp_mm_clock_identity_manufactureridentity,
4041 { "manufacturerIdentity", "ptp.mm.clock.identity.manufactureridentity",
4042 FT_BYTES, BASE_NONE, NULL, 0x00,
4046 /*ptp_mm_initialize_clock (parameterlength = 4)*/
4047 { &hf_ptp_mm_initialize_clock_initialisationkey,
4048 { "initialisationKey", "ptp.mm.initialize.clock.initialisationkey",
4049 FT_UINT16, BASE_DEC, NULL, 0x00,
4052 /*ptp_mm_set_subdomain (parameterlength = 16)*/
4053 { &hf_ptp_mm_set_subdomain_subdomainname,
4054 { "subdomainName", "ptp.mm.set.subdomain.subdomainname",
4055 FT_STRING, BASE_NONE, NULL, 0x00,
4058 /*ptp_mm_default_data_set (parameterlength = 76)*/
4059 { &hf_ptp_mm_default_data_set_clockcommunicationtechnology,
4060 { "clockCommunicationTechnology", "ptp.mm.default.data.set.clockcommunicationtechnology",
4061 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4064 { &hf_ptp_mm_default_data_set_clockuuidfield,
4065 { "clockUuidField", "ptp.mm.default.data.set.clockuuidfield",
4066 FT_ETHER, BASE_NONE, NULL, 0x00,
4069 { &hf_ptp_mm_default_data_set_clockportfield,
4070 { "clockPortField", "ptp.mm.default.data.set.clockportfield",
4071 FT_UINT16, BASE_DEC, NULL, 0x00,
4074 { &hf_ptp_mm_default_data_set_clockstratum,
4075 { "clockStratum", "ptp.mm.default.data.set.clockstratum",
4076 FT_UINT8, BASE_DEC, NULL, 0x00,
4079 { &hf_ptp_mm_default_data_set_clockidentifier,
4080 { "clockIdentifier", "ptp.mm.default.data.set.clockidentifier",
4081 FT_BYTES, BASE_NONE, NULL, 0x00,
4084 { &hf_ptp_mm_default_data_set_clockvariance,
4085 { "clockVariance", "ptp.mm.default.data.set.clockvariance",
4086 FT_UINT16, BASE_DEC, NULL, 0x00,
4089 { &hf_ptp_mm_default_data_set_clockfollowupcapable,
4090 { "clockFollowupCapable", "ptp.mm.default.data.set.clockfollowupcapable",
4091 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4094 { &hf_ptp_mm_default_data_set_preferred,
4095 { "preferred", "ptp.mm.default.data.set.preferred",
4096 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4099 { &hf_ptp_mm_default_data_set_initializable,
4100 { "initializable", "ptp.mm.default.data.set.initializable",
4101 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4104 { &hf_ptp_mm_default_data_set_externaltiming,
4105 { "externalTiming", "ptp.mm.default.data.set.externaltiming",
4106 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4109 { &hf_ptp_mm_default_data_set_isboundaryclock,
4110 { "isBoundaryClock", "ptp.mm.default.data.set.isboundaryclock",
4111 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4114 { &hf_ptp_mm_default_data_set_syncinterval,
4115 { "syncInterval", "ptp.mm.default.data.set.syncinterval",
4116 FT_INT8, BASE_DEC, NULL, 0x00,
4119 { &hf_ptp_mm_default_data_set_subdomainname,
4120 { "subDomainName", "ptp.mm.default.data.set.subdomainname",
4121 FT_STRING, BASE_NONE, NULL, 0x00,
4124 { &hf_ptp_mm_default_data_set_numberports,
4125 { "numberPorts", "ptp.mm.default.data.set.numberports",
4126 FT_UINT16, BASE_DEC, NULL, 0x00,
4129 { &hf_ptp_mm_default_data_set_numberforeignrecords,
4130 { "numberForeignRecords", "ptp.mm.default.data.set.numberforeignrecords",
4131 FT_UINT16, BASE_DEC, NULL, 0x00,
4134 /*ptp_mm_update_default_data_set (parameterlength = 36)*/
4135 { &hf_ptp_mm_update_default_data_set_clockstratum,
4136 { "clockStratum", "ptp.mm.update.default.data.set.clockstratum",
4137 FT_UINT8, BASE_DEC, NULL, 0x00,
4140 { &hf_ptp_mm_update_default_data_set_clockidentifier,
4141 { "clockIdentifier", "ptp.mm.update.default.data.set.clockidentifier",
4142 FT_BYTES, BASE_NONE, NULL, 0x00,
4145 { &hf_ptp_mm_update_default_data_set_clockvariance,
4146 { "clockVariance", "ptp.mm.update.default.data.set.clockvariance",
4147 FT_UINT16, BASE_DEC, NULL, 0x00,
4150 { &hf_ptp_mm_update_default_data_set_preferred,
4151 { "preferred", "ptp.mm.update.default.data.set.preferred",
4152 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4155 { &hf_ptp_mm_update_default_data_set_syncinterval,
4156 { "syncInterval", "ptp.mm.update.default.data.set.syncinterval",
4157 FT_INT8, BASE_DEC, NULL, 0x00,
4160 { &hf_ptp_mm_update_default_data_set_subdomainname,
4161 { "subdomainName", "ptp.mm.update.default.data.set.subdomainname",
4162 FT_STRING, BASE_NONE, NULL, 0x00,
4165 /*ptp_mm_current_data_set (parameterlength = 20)*/
4166 { &hf_ptp_mm_current_data_set_stepsremoved,
4167 { "stepsRemoved", "ptp.mm.current.data.set.stepsremoved",
4168 FT_UINT16, BASE_DEC, NULL, 0x00,
4171 { &hf_ptp_mm_current_data_set_offsetfrommaster,
4172 { "offsetFromMaster", "ptp.mm.current.data.set.offsetfrommaster",
4173 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4176 { &hf_ptp_mm_current_data_set_offsetfrommasterseconds,
4177 { "offsetFromMasterSeconds", "ptp.mm.current.data.set.offsetfrommasterseconds",
4178 FT_UINT32, BASE_DEC, NULL, 0x00,
4181 { &hf_ptp_mm_current_data_set_offsetfrommasternanoseconds,
4182 { "offsetFromMasterNanoseconds", "ptp.mm.current.data.set.offsetfrommasternanoseconds",
4183 FT_INT32, BASE_DEC, NULL, 0x00,
4186 { &hf_ptp_mm_current_data_set_onewaydelay,
4187 { "oneWayDelay", "ptp.mm.current.data.set.onewaydelay",
4188 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4191 { &hf_ptp_mm_current_data_set_onewaydelayseconds,
4192 { "oneWayDelaySeconds", "ptp.mm.current.data.set.onewaydelayseconds",
4193 FT_UINT32, BASE_DEC, NULL, 0x00,
4196 { &hf_ptp_mm_current_data_set_onewaydelaynanoseconds,
4197 { "oneWayDelayNanoseconds", "ptp.mm.current.data.set.onewaydelaynanoseconds",
4198 FT_INT32, BASE_DEC, NULL, 0x00,
4201 /*ptp_mm_parent_data_set (parameterlength = 90)*/
4202 { &hf_ptp_mm_parent_data_set_parentcommunicationtechnology,
4203 { "parentCommunicationTechnology", "ptp.mm.parent.data.set.parentcommunicationtechnology",
4204 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4207 { &hf_ptp_mm_parent_data_set_parentuuid,
4208 { "parentUuid", "ptp.mm.parent.data.set.parentuuid",
4209 FT_ETHER, BASE_NONE, NULL, 0x00,
4212 { &hf_ptp_mm_parent_data_set_parentportid,
4213 { "parentPortId", "ptp.mm.parent.data.set.parentportid",
4214 FT_UINT16, BASE_DEC, NULL, 0x00,
4217 { &hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber,
4218 { "parentLastSyncSequenceNumber", "ptp.mm.parent.data.set.parentlastsyncsequencenumber",
4219 FT_UINT16, BASE_DEC, NULL, 0x00,
4222 { &hf_ptp_mm_parent_data_set_parentfollowupcapable,
4223 { "parentFollowupCapable", "ptp.mm.parent.data.set.parentfollowupcapable",
4224 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4227 { &hf_ptp_mm_parent_data_set_parentexternaltiming,
4228 { "parentExternalTiming", "ptp.mm.parent.data.set.parentexternaltiming",
4229 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4232 { &hf_ptp_mm_parent_data_set_parentvariance,
4233 { "parentVariance", "ptp.mm.parent.data.set.parentvariance",
4234 FT_UINT16, BASE_DEC, NULL, 0x00,
4237 { &hf_ptp_mm_parent_data_set_parentstats,
4238 { "parentStats", "ptp.mm.parent.data.set.parentstats",
4239 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4242 { &hf_ptp_mm_parent_data_set_observedvariance,
4243 { "observedVariance", "ptp.mm.parent.data.set.observedvariance",
4244 FT_INT16, BASE_DEC, NULL, 0x00,
4247 { &hf_ptp_mm_parent_data_set_observeddrift,
4248 { "observedDrift", "ptp.mm.parent.data.set.observeddrift",
4249 FT_INT32, BASE_DEC, NULL, 0x00,
4252 { &hf_ptp_mm_parent_data_set_utcreasonable,
4253 { "utcReasonable", "ptp.mm.parent.data.set.utcreasonable",
4254 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4257 { &hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology,
4258 { "grandmasterCommunicationTechnology", "ptp.mm.parent.data.set.grandmastercommunicationtechnology",
4259 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4262 { &hf_ptp_mm_parent_data_set_grandmasteruuidfield,
4263 { "grandmasterUuidField", "ptp.mm.parent.data.set.grandmasteruuidfield",
4264 FT_ETHER, BASE_NONE, NULL, 0x00,
4267 { &hf_ptp_mm_parent_data_set_grandmasterportidfield,
4268 { "grandmasterPortIdField", "ptp.mm.parent.data.set.grandmasterportidfield",
4269 FT_UINT16, BASE_DEC, NULL, 0x00,
4272 { &hf_ptp_mm_parent_data_set_grandmasterstratum,
4273 { "grandmasterStratum", "ptp.mm.parent.data.set.grandmasterstratum",
4274 FT_UINT8, BASE_DEC, NULL, 0x00,
4277 { &hf_ptp_mm_parent_data_set_grandmasteridentifier,
4278 { "grandmasterIdentifier", "ptp.mm.parent.data.set.grandmasteridentifier",
4279 FT_BYTES, BASE_NONE, NULL, 0x00,
4282 { &hf_ptp_mm_parent_data_set_grandmastervariance,
4283 { "grandmasterVariance", "ptp.mm.parent.data.set.grandmastervariance",
4284 FT_INT16, BASE_DEC, NULL, 0x00,
4287 { &hf_ptp_mm_parent_data_set_grandmasterpreferred,
4288 { "grandmasterPreferred", "ptp.mm.parent.data.set.grandmasterpreferred",
4289 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4292 { &hf_ptp_mm_parent_data_set_grandmasterisboundaryclock,
4293 { "grandmasterIsBoundaryClock", "ptp.mm.parent.data.set.grandmasterisboundaryclock",
4294 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4297 { &hf_ptp_mm_parent_data_set_grandmastersequencenumber,
4298 { "grandmasterSequenceNumber", "ptp.mm.parent.data.set.grandmastersequencenumber",
4299 FT_UINT16, BASE_DEC, NULL, 0x00,
4302 /*ptp_mm_port_data_set (parameterlength = 52)*/
4303 { &hf_ptp_mm_port_data_set_returnedportnumber,
4304 { "returnedPortNumber", "ptp.mm.port.data.set.returnedportnumber",
4305 FT_UINT16, BASE_DEC, NULL, 0x00,
4308 { &hf_ptp_mm_port_data_set_portstate,
4309 { "portState", "ptp.mm.port.data.set.portstate",
4310 FT_UINT8, BASE_DEC, NULL, 0x00,
4313 { &hf_ptp_mm_port_data_set_lastsynceventsequencenumber,
4314 { "lastSyncEventSequenceNumber", "ptp.mm.port.data.set.lastsynceventsequencenumber",
4315 FT_UINT16, BASE_DEC, NULL, 0x00,
4318 { &hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber,
4319 { "lastGeneralEventSequenceNumber", "ptp.mm.port.data.set.lastgeneraleventsequencenumber",
4320 FT_UINT16, BASE_DEC, NULL, 0x00,
4323 { &hf_ptp_mm_port_data_set_portcommunicationtechnology,
4324 { "portCommunicationTechnology", "ptp.mm.port.data.set.portcommunicationtechnology",
4325 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4328 { &hf_ptp_mm_port_data_set_portuuidfield,
4329 { "portUuidField", "ptp.mm.port.data.set.portuuidfield",
4330 FT_ETHER, BASE_NONE, NULL, 0x00,
4333 { &hf_ptp_mm_port_data_set_portidfield,
4334 { "portIdField", "ptp.mm.port.data.set.portidfield",
4335 FT_UINT16, BASE_DEC, NULL, 0x00,
4338 { &hf_ptp_mm_port_data_set_burstenabled,
4339 { "burstEnabled", "ptp.mm.port.data.set.burstenabled",
4340 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4343 { &hf_ptp_mm_port_data_set_subdomainaddressoctets,
4344 { "subdomainAddressOctets", "ptp.mm.port.data.set.subdomainaddressoctets",
4345 FT_UINT8, BASE_DEC, NULL, 0x00,
4348 { &hf_ptp_mm_port_data_set_eventportaddressoctets,
4349 { "eventPortAddressOctets", "ptp.mm.port.data.set.eventportaddressoctets",
4350 FT_UINT8, BASE_DEC, NULL, 0x00,
4353 { &hf_ptp_mm_port_data_set_generalportaddressoctets,
4354 { "generalPortAddressOctets", "ptp.mm.port.data.set.generalportaddressoctets",
4355 FT_UINT8, BASE_DEC, NULL, 0x00,
4358 { &hf_ptp_mm_port_data_set_subdomainaddress,
4359 { "subdomainAddress", "ptp.mm.port.data.set.subdomainaddress",
4360 FT_BYTES, BASE_NONE, NULL, 0x00,
4363 { &hf_ptp_mm_port_data_set_eventportaddress,
4364 { "eventPortAddress", "ptp.mm.port.data.set.eventportaddress",
4365 FT_BYTES, BASE_NONE, NULL, 0x00,
4368 { &hf_ptp_mm_port_data_set_generalportaddress,
4369 { "generalPortAddress", "ptp.mm.port.data.set.generalportaddress",
4370 FT_BYTES, BASE_NONE, NULL, 0x00,
4373 /*ptp_mm_global_time_data_set (parameterlength = 24)*/
4374 { &hf_ptp_mm_global_time_data_set_localtime,
4375 { "localTime", "ptp.mm.global.time.data.set.localtime",
4376 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4379 { &hf_ptp_mm_global_time_data_set_localtimeseconds,
4380 { "localTimeSeconds", "ptp.mm.global.time.data.set.localtimeseconds",
4381 FT_UINT32, BASE_DEC, NULL, 0x00,
4384 { &hf_ptp_mm_global_time_data_set_localtimenanoseconds,
4385 { "localTimeNanoseconds", "ptp.mm.global.time.data.set.localtimenanoseconds",
4386 FT_INT32, BASE_DEC, NULL, 0x00,
4389 { &hf_ptp_mm_global_time_data_set_currentutcoffset,
4390 { "currentUtcOffset", "ptp.mm.global.time.data.set.currentutcoffset",
4391 FT_INT16, BASE_DEC, NULL, 0x00,
4394 { &hf_ptp_mm_global_time_data_set_leap59,
4395 { "leap59", "ptp.mm.global.time.data.set.leap59",
4396 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4399 { &hf_ptp_mm_global_time_data_set_leap61,
4400 { "leap61", "ptp.mm.global.time.data.set.leap61",
4401 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4404 { &hf_ptp_mm_global_time_data_set_epochnumber,
4405 { "epochNumber", "ptp.mm.global.time.data.set.epochnumber",
4406 FT_UINT16, BASE_DEC, NULL, 0x00,
4409 /*ptp_mm_update_global_time_properties (parameterlength = 16)*/
4410 { &hf_ptp_mm_update_global_time_properties_currentutcoffset,
4411 { "currentUtcOffset", "ptp.mm.update.global.time.properties.currentutcoffset",
4412 FT_UINT16, BASE_DEC, NULL, 0x00,
4415 { &hf_ptp_mm_update_global_time_properties_leap59,
4416 { "leap59", "ptp.mm.update.global.time.properties.leap59",
4417 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4420 { &hf_ptp_mm_update_global_time_properties_leap61,
4421 { "leap61", "ptp.mm.update.global.time.properties.leap61",
4422 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4425 { &hf_ptp_mm_update_global_time_properties_epochnumber,
4426 { "epochNumber", "ptp.mm.update.global.time.properties.epochnumber",
4427 FT_UINT16, BASE_DEC, NULL, 0x00,
4430 /*ptp_mm_get_foreign_data_set (parameterlength = 4)*/
4431 { &hf_ptp_mm_get_foreign_data_set_recordkey,
4432 { "recordKey", "ptp.mm.get.foreign.data.set.recordkey",
4433 FT_UINT16, BASE_DEC, NULL, 0x00,
4436 /*ptp_mm_foreign_data_set (parameterlength = 28)*/
4437 { &hf_ptp_mm_foreign_data_set_returnedportnumber,
4438 { "returnedPortNumber", "ptp.mm.foreign.data.set.returnedportnumber",
4439 FT_UINT16, BASE_DEC, NULL, 0x00,
4442 { &hf_ptp_mm_foreign_data_set_returnedrecordnumber,
4443 { "returnedRecordNumber", "ptp.mm.foreign.data.set.returnedrecordnumber",
4444 FT_UINT16, BASE_DEC, NULL, 0x00,
4447 { &hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology,
4448 { "foreignMasterCommunicationTechnology",
4449 "ptp.mm.foreign.data.set.foreignmastercommunicationtechnology",
4450 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4453 { &hf_ptp_mm_foreign_data_set_foreignmasteruuidfield,
4454 { "foreignMasterUuidField", "ptp.mm.foreign.data.set.foreignmasteruuidfield",
4455 FT_ETHER, BASE_NONE, NULL, 0x00,
4458 { &hf_ptp_mm_foreign_data_set_foreignmasterportidfield,
4459 { "foreignMasterPortIdField", "ptp.mm.foreign.data.set.foreignmasterportidfield",
4460 FT_UINT16, BASE_DEC, NULL, 0x00,
4463 { &hf_ptp_mm_foreign_data_set_foreignmastersyncs,
4464 { "foreignMasterSyncs", "ptp.mm.foreign.data.set.foreignmastersyncs",
4465 FT_UINT16, BASE_DEC, NULL, 0x00,
4468 /*ptp_mm_set_sync_interval (parameterlength = 4)*/
4469 { &hf_ptp_mm_set_sync_interval_syncinterval,
4470 { "syncInterval", "ptp.mm.set.sync.interval.syncinterval",
4471 FT_UINT16, BASE_DEC, NULL, 0x00,
4474 /*ptp_mm_set_time (parameterlength = 8)*/
4475 { &hf_ptp_mm_set_time_localtime,
4476 { "localtime", "ptp.mm.set.time.localtime",
4477 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4480 { &hf_ptp_mm_set_time_localtimeseconds,
4481 { "localtimeSeconds", "ptp.mm.set.time.localtimeseconds",
4482 FT_UINT32, BASE_DEC, NULL, 0x00,
4485 { &hf_ptp_mm_set_time_localtimenanoseconds,
4486 { "localTimeNanoseconds", "ptp.mm.set.time.localtimenanoseconds",
4487 FT_INT32, BASE_DEC, NULL, 0x0,
4494 /* PTPv2 fields **********************************************************/
4495 /*Common fields for all frames*/
4496 { &hf_ptp_v2_transportspecific,
4497 { "transportSpecific", "ptp.v2.transportspecific",
4498 FT_UINT8, BASE_HEX, NULL, 0xF0,
4501 { &hf_ptp_v2_transportspecific_v1_compatibility,
4502 { "V1 Compatibility", "ptp.v2.transportspecific.v1compatibility",
4503 FT_BOOLEAN, 8, NULL, PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK,
4506 { &hf_ptp_v2_transportspecific_802as_conform,
4507 { "802.1as conform", "ptp.v2.transportspecific.802.1asconform",
4508 FT_BOOLEAN, 8, NULL, PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK,
4511 { &hf_ptp_v2_messageid,
4512 { "messageId", "ptp.v2.messageid",
4513 FT_UINT8, BASE_HEX, VALS(ptp_v2_messageid_vals), 0x0F,
4516 { &hf_ptp_v2_versionptp,
4517 { "versionPTP", "ptp.v2.versionptp",
4518 FT_UINT8, BASE_DEC, NULL, 0x0F,
4521 { &hf_ptp_v2_messagelength,
4522 { "messageLength", "ptp.v2.messagelength",
4523 FT_UINT16, BASE_DEC, NULL, 0x00,
4526 { &hf_ptp_v2_domainnumber,
4527 { "subdomainNumber", "ptp.v2.subdomainnumber",
4528 FT_UINT8, BASE_DEC, NULL, 0x00,
4532 { "flags", "ptp.v2.flags",
4533 FT_UINT16, BASE_HEX, NULL, 0x00,
4536 { &hf_ptp_v2_flags_alternatemaster,
4537 { "PTP_ALTERNATE_MASTER", "ptp.v2.flags.alternatemaster",
4538 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_ALTERNATE_BITMASK,
4541 { &hf_ptp_v2_flags_twostep,
4542 { "PTP_TWO_STEP", "ptp.v2.flags.twostep",
4543 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_TWO_STEP_BITMASK,
4546 { &hf_ptp_v2_flags_unicast,
4547 { "PTP_UNICAST", "ptp.v2.flags.unicast",
4548 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_UNICAST_BITMASK,
4551 { &hf_ptp_v2_flags_specific1,
4552 { "PTP profile Specific 1", "ptp.v2.flags.specific1",
4553 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SPECIFIC1_BITMASK,
4556 { &hf_ptp_v2_flags_specific2,
4557 { "PTP profile Specific 2", "ptp.v2.flags.specific2",
4558 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SPECIFIC2_BITMASK,
4561 { &hf_ptp_v2_flags_security,
4562 { "PTP_SECURITY", "ptp.v2.flags.security",
4563 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SECURITY_BITMASK,
4566 { &hf_ptp_v2_flags_li61,
4567 { "PTP_LI_61", "ptp.v2.flags.li61",
4568 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_LI61_BITMASK,
4571 { &hf_ptp_v2_flags_li59,
4572 { "PTP_LI_59", "ptp.v2.flags.li59",
4573 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_LI59_BITMASK,
4576 { &hf_ptp_v2_flags_utcoffsetvalid,
4577 { "PTP_UTC_REASONABLE", "ptp.v2.flags.utcreasonable",
4578 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_UTC_OFFSET_VALID_BITMASK,
4581 { &hf_ptp_v2_flags_ptptimescale,
4582 { "PTP_TIMESCALE", "ptp.v2.flags.timescale",
4583 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_PTP_TIMESCALE_BITMASK,
4586 { &hf_ptp_v2_flags_timetraceable,
4587 { "TIME_TRACEABLE", "ptp.v2.flags.timetraceable",
4588 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_TIME_TRACEABLE_BITMASK,
4591 { &hf_ptp_v2_flags_frequencytraceable,
4592 { "FREQUENCY_TRACEABLE", "ptp.v2.flags.frequencytraceable",
4593 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK,
4596 { &hf_ptp_v2_correction,
4597 { "correction", "ptp.v2.correction.ns",
4598 FT_UINT64, BASE_DEC, NULL, 0x00,
4601 { &hf_ptp_v2_correctionsubns,
4602 { "correctionSubNs", "ptp.v2.correction.subns",
4603 FT_DOUBLE, BASE_NONE, NULL, 0x00,
4606 { &hf_ptp_v2_clockidentity,
4607 { "ClockIdentity", "ptp.v2.clockidentity",
4608 FT_UINT64, BASE_HEX, NULL, 0x00,
4611 { &hf_ptp_v2_sourceportid,
4612 { "SourcePortID", "ptp.v2.sourceportid",
4613 FT_UINT16, BASE_DEC, NULL, 0x00,
4616 { &hf_ptp_v2_sequenceid,
4617 { "sequenceId", "ptp.v2.sequenceid",
4618 FT_UINT16, BASE_DEC, NULL, 0x00,
4621 { &hf_ptp_v2_control,
4622 { "control", "ptp.v2.control",
4623 FT_UINT8, BASE_DEC, VALS(ptp_control_vals), 0x00,
4626 { &hf_ptp_v2_logmessageperiod,
4627 { "logMessagePeriod", "ptp.v2.logmessageperiod",
4628 FT_INT8, BASE_DEC, NULL, 0x00,
4632 /*Fields for PTP_Announce (=an) messages*/
4633 { &hf_ptp_v2_an_origintimestamp,
4634 { "originTimestamp", "ptp.v2.an.origintimestamp",
4635 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4638 { &hf_ptp_v2_an_origintimestamp_seconds,
4639 { "originTimestamp (seconds)", "ptp.v2.an.origintimestamp.seconds",
4640 FT_UINT64, BASE_DEC, NULL, 0x00,
4643 { &hf_ptp_v2_an_origintimestamp_nanoseconds,
4644 { "originTimestamp (nanoseconds)", "ptp.v2.an.origintimestamp.nanoseconds",
4645 FT_INT32, BASE_DEC, NULL, 0x00,
4648 { &hf_ptp_v2_an_origincurrentutcoffset,
4649 { "originCurrentUTCOffset", "ptp.v2.an.origincurrentutcoffset",
4650 FT_INT16, BASE_DEC, NULL, 0x00,
4653 { &hf_ptp_v2_an_timesource,
4654 { "TimeSource", "ptp.v2.timesource",
4655 FT_UINT8, BASE_HEX, VALS(ptp_v2_timesource_vals), 0x00,
4658 { &hf_ptp_v2_an_localstepsremoved,
4659 { "localStepsRemoved", "ptp.v2.an.localstepsremoved",
4660 FT_UINT16, BASE_DEC, NULL, 0x00,
4663 { &hf_ptp_v2_an_grandmasterclockidentity,
4664 { "grandmasterClockIdentity", "ptp.v2.an.grandmasterclockidentity",
4665 FT_UINT64, BASE_HEX, NULL, 0x00,
4668 { &hf_ptp_v2_an_grandmasterclockclass,
4669 { "grandmasterClockClass", "ptp.v2.an.grandmasterclockclass",
4670 FT_UINT8, BASE_DEC, NULL, 0x00,
4673 { &hf_ptp_v2_an_grandmasterclockaccuracy,
4674 { "grandmasterClockAccuracy", "ptp.v2.an.grandmasterclockaccuracy",
4675 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
4678 { &hf_ptp_v2_an_grandmasterclockvariance,
4679 { "grandmasterClockVariance", "ptp.v2.an.grandmasterclockvariance",
4680 FT_UINT16, BASE_DEC, NULL, 0x00,
4683 { &hf_ptp_v2_an_priority1,
4684 { "priority1", "ptp.v2.an.priority1",
4685 FT_UINT8, BASE_DEC, NULL, 0x00,
4688 { &hf_ptp_v2_an_priority2,
4689 { "priority2", "ptp.v2.an.priority2",
4690 FT_UINT8, BASE_DEC, NULL, 0x00,
4694 /*Fields for PTP_Announce TLVs */
4695 { &hf_ptp_v2_an_tlv_tlvtype,
4696 { "tlvType", "ptp.v2.an.tlvType",
4697 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
4700 { &hf_ptp_v2_an_tlv_lengthfield,
4701 { "lengthField", "ptp.v2.an.lengthField",
4702 FT_UINT16, BASE_DEC, NULL, 0x00,
4705 /*Fields for ALTERNATE_TIME_OFFSET_INDICATOR TLV */
4706 { &hf_ptp_v2_atoi_tlv_keyfield,
4707 { "keyField", "ptp.v2.an.atoi.keyField",
4708 FT_UINT8, BASE_DEC, NULL, 0x00,
4711 { &hf_ptp_v2_atoi_tlv_currentoffset,
4712 { "currentOffset", "ptp.v2.an.atoi.currentOffset",
4713 FT_INT32, BASE_DEC, NULL, 0x00,
4716 { &hf_ptp_v2_atoi_tlv_jumpseconds,
4717 { "jumpSeconds", "ptp.v2.an.atoi.jumpSeconds",
4718 FT_INT32, BASE_DEC, NULL, 0x00,
4721 { &hf_ptp_v2_atoi_tlv_timeofnextjump,
4722 { "timeOfNextJump", "ptp.v2.an.atoi.timeOfNextJump",
4723 FT_BYTES, BASE_NONE, NULL, 0x00,
4726 { &hf_ptp_v2_atoi_tlv_displayname,
4727 { "displayName", "ptp.v2.an.atoi.dislpayName",
4728 FT_STRING, BASE_NONE, NULL, 0x00,
4731 { &hf_ptp_v2_atoi_tlv_displayname_length,
4732 { "length", "ptp.v2.an.atoi.dislpayName.length",
4733 FT_UINT8, BASE_DEC, NULL, 0x00,
4736 /* Field for Path Trace TLV */
4737 { &hf_ptp_v2_an_tlv_pathsequence,
4738 { "PathSequence", "ptp.v2.an.pathsequence",
4739 FT_UINT64, BASE_HEX, NULL, 0x00,
4743 /* Fields for undissected TLV */
4744 { &hf_ptp_v2_an_tlv_data,
4745 { "data", "ptp.v2.an.tlv.data",
4746 FT_BYTES, BASE_NONE, NULL, 0x00,
4750 /*Fields for PTP_Sync AND PTP_DelayRequest (=sdr) messages*/
4751 { &hf_ptp_v2_sdr_origintimestamp,
4752 { "originTimestamp", "ptp.v2.sdr.origintimestamp",
4753 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4756 { &hf_ptp_v2_sdr_origintimestamp_seconds,
4757 { "originTimestamp (seconds)", "ptp.v2.sdr.origintimestamp.seconds",
4758 FT_UINT64, BASE_DEC, NULL, 0x00,
4761 { &hf_ptp_v2_sdr_origintimestamp_nanoseconds,
4762 { "originTimestamp (nanoseconds)", "ptp.v2.sdr.origintimestamp.nanoseconds",
4763 FT_INT32, BASE_DEC, NULL, 0x00,
4767 /*Fields for PTP_Follow_Up (=fu) messages*/
4768 { &hf_ptp_v2_fu_preciseorigintimestamp,
4769 { "preciseOriginTimestamp", "ptp.v2.fu.preciseorigintimestamp",
4770 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4773 { &hf_ptp_v2_fu_preciseorigintimestamp_seconds,
4774 { "preciseOriginTimestamp (seconds)", "ptp.v2.fu.preciseorigintimestamp.seconds",
4775 FT_UINT64, BASE_DEC, NULL, 0x00,
4778 { &hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds,
4779 { "preciseOriginTimestamp (nanoseconds)", "ptp.v2.fu.preciseorigintimestamp.nanoseconds",
4780 FT_INT32, BASE_DEC, NULL, 0x00,
4783 /*Fields for PTP_Follow_up TLVs */
4784 { &hf_ptp_as_fu_tlv_tlvtype,
4785 { "tlvType", "ptp.as.fu.tlvType",
4786 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
4789 { &hf_ptp_as_fu_tlv_lengthfield,
4790 { "lengthField", "ptp.as.fu.lengthField",
4791 FT_UINT16, BASE_DEC, NULL, 0x00,
4794 { &hf_ptp_as_fu_tlv_organization_id,
4795 { "organizationId", "ptp.as.fu.organizationId",
4796 FT_UINT24, BASE_DEC, NULL, 0x00,
4799 { &hf_ptp_as_fu_tlv_organization_subtype,
4800 { "OrganizationSubType", "ptp.as.fu.organizationSubType",
4801 FT_INT24, BASE_DEC, NULL, 0x00,
4804 { &hf_ptp_as_fu_tlv_cumulative_offset,
4805 { "cumulativeScaledRateOffset", "ptp.as.fu.cumulativeScaledRateOffset",
4806 FT_UINT32, BASE_DEC, NULL, 0x00,
4809 { &hf_ptp_as_fu_tlv_gm_base_indicator,
4810 { "gmTimeBaseIndicator", "ptp.as.fu.gmTimeBaseIndicator",
4811 FT_UINT16, BASE_DEC, NULL, 0x00,
4814 { &hf_ptp_as_fu_tlv_last_gm_phase_change,
4815 { "lastGMPhaseChange", "ptp.as.fu.lastGmPhaseChange",
4816 FT_BYTES, BASE_NONE, NULL, 0x00,
4819 { &hf_ptp_as_fu_tlv_scaled_last_gm_phase_change,
4820 { "scaledLastGMPhaseChange", "ptp.as.fu.scaledLastGmPhaseChange",
4821 FT_INT32, BASE_DEC, NULL, 0x00,
4825 /*Fields for PTP_DelayResponse (=dr) messages*/
4826 { &hf_ptp_v2_dr_receivetimestamp,
4827 { "receiveTimestamp", "ptp.v2.dr.receivetimestamp",
4828 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4831 { &hf_ptp_v2_dr_receivetimestamp_seconds,
4832 { "receiveTimestamp (seconds)", "ptp.v2.dr.receivetimestamp.seconds",
4833 FT_UINT64, BASE_DEC, NULL, 0x00,
4836 { &hf_ptp_v2_dr_receivetimestamp_nanoseconds,
4837 { "receiveTimestamp (nanoseconds)", "ptp.v2.dr.receivetimestamp.nanoseconds",
4838 FT_INT32, BASE_DEC, NULL, 0x00,
4841 { &hf_ptp_v2_dr_requestingportidentity,
4842 { "requestingSourcePortIdentity", "ptp.v2.dr.requestingsourceportidentity",
4843 FT_UINT64, BASE_HEX, NULL, 0x00,
4846 { &hf_ptp_v2_dr_requestingsourceportid,
4847 { "requestingSourcePortId", "ptp.v2.dr.requestingsourceportid",
4848 FT_UINT16, BASE_DEC, NULL, 0x00,
4852 /*Fields for PTP_PDelayRequest (=pdrq) messages*/
4853 { &hf_ptp_v2_pdrq_origintimestamp,
4854 { "originTimestamp", "ptp.v2.pdrq.origintimestamp",
4855 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4858 { &hf_ptp_v2_pdrq_origintimestamp_seconds,
4859 { "originTimestamp (seconds)", "ptp.v2.pdrq.origintimestamp.seconds",
4860 FT_UINT64, BASE_DEC, NULL, 0x00,
4863 { &hf_ptp_v2_pdrq_origintimestamp_nanoseconds,
4864 { "originTimestamp (nanoseconds)", "ptp.v2.pdrq.origintimestamp.nanoseconds",
4865 FT_INT32, BASE_DEC, NULL, 0x00,
4869 /*Fields for PTP_PDelayResponse (=pdrs) messages*/
4870 { &hf_ptp_v2_pdrs_requestreceipttimestamp,
4871 { "requestreceiptTimestamp", "ptp.v2.pdrs.requestreceipttimestamp",
4872 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4875 { &hf_ptp_v2_pdrs_requestreceipttimestamp_seconds,
4876 { "requestreceiptTimestamp (seconds)", "ptp.v2.pdrs.requestreceipttimestamp.seconds",
4877 FT_UINT64, BASE_DEC, NULL, 0x00,
4880 { &hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds,
4881 { "requestreceiptTimestamp (nanoseconds)", "ptp.v2.pdrs.requestreceipttimestamp.nanoseconds",
4882 FT_INT32, BASE_DEC, NULL, 0x00,
4885 { &hf_ptp_v2_pdrs_requestingportidentity,
4886 { "requestingSourcePortIdentity", "ptp.v2.pdrs.requestingportidentity",
4887 FT_UINT64, BASE_HEX, NULL, 0x00,
4890 { &hf_ptp_v2_pdrs_requestingsourceportid,
4891 { "requestingSourcePortId", "ptp.v2.pdrs.requestingsourceportid",
4892 FT_UINT16, BASE_DEC, NULL, 0x00,
4896 /*Fields for PTP_PDelayResponseFollowUp (=pdfu) messages*/
4897 { &hf_ptp_v2_pdfu_responseorigintimestamp,
4898 { "responseOriginTimestamp", "ptp.v2.pdfu.responseorigintimestamp",
4899 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4902 { &hf_ptp_v2_pdfu_responseorigintimestamp_seconds,
4903 { "responseOriginTimestamp (seconds)", "ptp.v2.pdfu.responseorigintimestamp.seconds",
4904 FT_UINT64, BASE_DEC, NULL, 0x00,
4907 { &hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds,
4908 { "responseOriginTimestamp (nanoseconds)", "ptp.v2.pdfu.responseorigintimestamp.nanoseconds",
4909 FT_INT32, BASE_DEC, NULL, 0x00,
4912 { &hf_ptp_v2_pdfu_requestingportidentity,
4913 { "requestingSourcePortIdentity", "ptp.v2.pdfu.requestingportidentity",
4914 FT_UINT64, BASE_HEX, NULL, 0x00,
4917 { &hf_ptp_v2_pdfu_requestingsourceportid,
4918 { "requestingSourcePortId", "ptp.v2.pdfu.requestingsourceportid",
4919 FT_UINT16, BASE_DEC, NULL, 0x00,
4923 /*Fields for PTP_Signalling (=sig) messages*/
4924 { &hf_ptp_v2_sig_targetportidentity,
4925 { "targetPortIdentity", "ptp.v2.sig.targetportidentity",
4926 FT_UINT64, BASE_HEX, NULL, 0x00,
4929 { &hf_ptp_v2_sig_targetportid,
4930 { "targetPortId", "ptp.v2.sig.targetportid",
4931 FT_UINT16, BASE_DEC, NULL, 0x00,
4934 /*Fields for PTP_Signalling (=sig) TLVs */
4935 { &hf_ptp_as_sig_tlv_tlvtype,
4936 { "tlvType", "ptp.as.sig.tlvType",
4937 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
4940 { &hf_ptp_as_sig_tlv_lengthfield,
4941 { "lengthField", "ptp.as.sig.lengthField",
4942 FT_UINT16, BASE_DEC, NULL, 0x00,
4945 { &hf_ptp_as_sig_tlv_organization_id,
4946 { "organizationId", "ptp.as.sig.tlv.organizationId",
4947 FT_UINT24, BASE_HEX, VALS(ptp_as_TLV_oid_vals), 0x00,
4950 { &hf_ptp_as_sig_tlv_organization_subtype,
4951 { "OrganizationSubType", "ptp.as.sig.tlv.organizationSubType",
4952 FT_INT24, BASE_DEC, NULL, 0x00,
4955 { &hf_ptp_as_sig_tlv_link_delay_interval,
4956 { "linkDelayInterval", "ptp.as.sig.tlv.linkdelayinterval",
4957 FT_INT8, BASE_DEC, NULL, 0x00,
4960 { &hf_ptp_as_sig_tlv_time_sync_interval,
4961 { "timeSyncInterval", "ptp.as.sig.tlv.timesyncinterval",
4962 FT_INT8, BASE_DEC, NULL, 0x00,
4965 { &hf_ptp_as_sig_tlv_announce_interval,
4966 { "announceInterval", "ptp.as.sig.tlv.announceinterval",
4967 FT_INT8, BASE_DEC, NULL, 0x00,
4970 { &hf_ptp_as_sig_tlv_flags,
4971 { "flags", "ptp.as.sig.tvl.flags",
4972 FT_UINT8, BASE_HEX, NULL, 0x00,
4975 { &hf_ptp_as_sig_tlv_flags_comp_rate_ratio,
4976 { "computeNeighborRateRatio", "ptp.as.sig.tlv.flags.rateratio",
4977 FT_BOOLEAN, 8, NULL, PTP_AS_FLAGS_COMP_NEIGHBOR_RATE_RATIO_BITMASK,
4980 { &hf_ptp_as_sig_tlv_flags_comp_prop_delay,
4981 { "computeNeighborPropDelay", "ptp.as.sig.tlv.flags.propdelay",
4982 FT_BOOLEAN, 8, NULL, PTP_AS_FLAGS_COMP_NEIGHBOR_PROP_DELAY_BITMASK,
4986 /*Fields for PTP_Management (=mm) messages*/
4987 { &hf_ptp_v2_mm_targetportidentity,
4988 { "targetPortIdentity", "ptp.v2.mm.targetportidentity",
4989 FT_UINT64, BASE_HEX, NULL, 0x00,
4992 { &hf_ptp_v2_mm_targetportid,
4993 { "targetPortId", "ptp.v2.mm.targetportid",
4994 FT_UINT16, BASE_DEC, NULL, 0x00,
4997 { &hf_ptp_v2_mm_startingboundaryhops,
4998 { "startingBoundaryHops", "ptp.v2.mm.startingboundaryhops",
4999 FT_UINT8, BASE_DEC, NULL, 0x00,
5002 { &hf_ptp_v2_mm_boundaryhops,
5003 { "boundaryHops", "ptp.v2.mm.boundaryhops",
5004 FT_UINT8, BASE_DEC, NULL, 0x00,
5007 { &hf_ptp_v2_mm_action,
5008 { "action", "ptp.v2.mm.action",
5009 FT_UINT8, BASE_DEC, VALS(ptp_v2_mm_action_vals), 0x0F,
5012 /* Management TLV */
5013 { &hf_ptp_v2_mm_tlvType,
5014 { "tlvType", "ptp.v2.mm.tlvType",
5015 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
5018 { &hf_ptp_v2_mm_lengthField,
5019 { "lengthField", "ptp.v2.mm.lengthField",
5020 FT_UINT16, BASE_DEC, NULL, 0x00,
5023 { &hf_ptp_v2_mm_managementId,
5024 { "managementId", "ptp.v2.mm.managementId",
5025 FT_UINT16, BASE_DEC, VALS(ptp_v2_managementID_vals), 0x00,
5028 { &hf_ptp_v2_mm_data,
5029 { "data", "ptp.v2.mm.data",
5030 FT_BYTES, BASE_NONE, NULL, 0x00,
5033 /* Management TLV dataField */
5034 /* CLOCK_DESCRIPTION */
5035 { &hf_ptp_v2_mm_clockType,
5036 { "clockType", "ptp.v2.mm.clockType",
5037 FT_UINT16, BASE_HEX, NULL, 0x00,
5040 { &hf_ptp_v2_mm_clockType_ordinaryClock,
5041 { "The node implements an ordinary clock", "ptp.v2.mm.clockType.OC",
5042 FT_BOOLEAN, 16, NULL, CLOCKTYPE_ORDINARY_CLOCK,
5045 { &hf_ptp_v2_mm_clockType_boundaryClock,
5046 { "The node implements a boundary clock", "ptp.v2.mm.clockType.BC",
5047 FT_BOOLEAN, 16, NULL, CLOCKTYPE_BOUNDARY_CLOCK,
5050 { &hf_ptp_v2_mm_clockType_p2p_transparentClock,
5051 { "The node implements a peer-to-peer transparent clock", "ptp.v2.mm.clockType.p2p_TC",
5052 FT_BOOLEAN, 16, NULL, CLOCKTYPE_P2P_TC,
5055 { &hf_ptp_v2_mm_clockType_e2e_transparentClock,
5056 { "The node implements an end-to-end transparent clock", "ptp.v2.mm.clockType.e2e_TC",
5057 FT_BOOLEAN, 16, NULL, CLOCKTYPE_E2E_TC,
5060 { &hf_ptp_v2_mm_clockType_managementNode,
5061 { "The node implements a management node", "ptp.v2.mm.clockType.MM",
5062 FT_BOOLEAN, 16, NULL, CLOCKTYPE_MANAGEMENT_NODE,
5065 { &hf_ptp_v2_mm_clockType_reserved,
5066 { "Reserved", "ptp.v2.mm.clockType.reserved",
5067 FT_BOOLEAN, 16, NULL, CLOCKTYPE_RESERVED,
5070 { &hf_ptp_v2_mm_physicalLayerProtocol,
5071 { "physicalLayerProtocol", "ptp.v2.mm.physicalLayerProtocol",
5072 FT_STRING, BASE_NONE, NULL, 0x00,
5075 { &hf_ptp_v2_mm_physicalLayerProtocol_length,
5076 { "length", "ptp.v2.mm.physicalLayerProtocol.length",
5077 FT_UINT8, BASE_DEC, NULL, 0x00,
5080 { &hf_ptp_v2_mm_physicalAddressLength,
5081 { "physical address length", "ptp.v2.mm.physicalAddressLength",
5082 FT_UINT16, BASE_DEC, NULL, 0x00,
5085 { &hf_ptp_v2_mm_physicalAddress,
5086 { "physical address", "ptp.v2.mm.physicalAddress",
5087 FT_BYTES, BASE_NONE, NULL, 0x00,
5090 { &hf_ptp_v2_mm_protocolAddress,
5091 { "protocol address", "ptp.v2.mm.protocolAddress",
5092 FT_BYTES, BASE_NONE, NULL, 0x00,
5095 { &hf_ptp_v2_mm_protocolAddress_networkProtocol,
5096 { "network protocol", "ptp.v2.mm.networkProtocol",
5097 FT_UINT16, BASE_DEC, VALS(ptp2_networkProtocol_vals), 0x00,
5100 { &hf_ptp_v2_mm_protocolAddress_length,
5101 { "length", "ptp.v2.mm.protocolAddress.length",
5102 FT_UINT16, BASE_DEC, NULL, 0x00,
5105 { &hf_ptp_v2_mm_manufacturerIdentity,
5106 { "manufacturer identity", "ptp.v2.mm.manufacturerIdentity",
5107 FT_BYTES, BASE_NONE, NULL, 0x00,
5110 { &hf_ptp_v2_mm_reserved,
5111 { "reserved", "ptp.v2.mm.reserved",
5112 FT_BYTES, BASE_NONE, NULL, 0x00,
5115 { &hf_ptp_v2_mm_productDescription,
5116 { "product description", "ptp.v2.mm.productDescription",
5117 FT_STRING, BASE_NONE, NULL, 0x00,
5120 { &hf_ptp_v2_mm_productDescription_length,
5121 { "length", "ptp.v2.mm.productDescription.length",
5122 FT_UINT8, BASE_DEC, NULL, 0x00,
5125 { &hf_ptp_v2_mm_revisionData,
5126 { "revision data", "ptp.v2.mm.revisionData",
5127 FT_STRING, BASE_NONE, NULL, 0x00,
5130 { &hf_ptp_v2_mm_revisionData_length,
5131 { "length", "ptp.v2.mm.revisionData.length",
5132 FT_UINT8, BASE_DEC, NULL, 0x00,
5135 { &hf_ptp_v2_mm_userDescription,
5136 { "user description", "ptp.v2.mm.userDescription",
5137 FT_STRING, BASE_NONE, NULL, 0x00,
5140 { &hf_ptp_v2_mm_userDescription_length,
5141 { "length", "ptp.v2.mm.userDescription.length",
5142 FT_UINT8, BASE_DEC, NULL, 0x00,
5145 { &hf_ptp_v2_mm_profileIdentity,
5146 { "profileIdentity", "ptp.v2.mm.profileIdentity",
5147 FT_BYTES, BASE_NONE, NULL, 0x00,
5150 { &hf_ptp_v2_mm_pad,
5151 { "Pad", "ptp.v2.mm.pad",
5152 FT_BYTES, BASE_NONE, NULL, 0x0,
5155 { &hf_ptp_v2_mm_initializationKey,
5156 { "initialization key", "ptp.v2.mm.initializationKey",
5157 FT_UINT16, BASE_DEC, NULL, 0x00,
5160 { &hf_ptp_v2_mm_numberOfFaultRecords,
5161 { "number of fault records", "ptp.v2.mm.numberOfFaultRecords",
5162 FT_UINT16, BASE_DEC, NULL, 0x00,
5165 { &hf_ptp_v2_mm_faultRecord,
5166 { "fault record", "ptp.v2.mm.faultRecord",
5167 FT_BYTES, BASE_NONE, NULL, 0x00,
5170 { &hf_ptp_v2_mm_faultRecordLength,
5171 { "fault record length", "ptp.v2.mm.faultRecordLength",
5172 FT_UINT16, BASE_DEC, NULL, 0x00,
5175 { &hf_ptp_v2_mm_severityCode,
5176 { "severity code", "ptp.v2.mm.severityCode",
5177 FT_UINT8, BASE_DEC, VALS(ptp2_severityCode_vals), 0x00,
5180 { &hf_ptp_v2_mm_faultName,
5181 { "faultName", "ptp.v2.mm.faultName",
5182 FT_STRING, BASE_NONE, NULL, 0x00,
5185 { &hf_ptp_v2_mm_faultName_length,
5186 { "length", "ptp.v2.mm.faultName.length",
5187 FT_UINT8, BASE_DEC, NULL, 0x00,
5190 { &hf_ptp_v2_mm_faultValue,
5191 { "faultValue", "ptp.v2.mm.faultValue",
5192 FT_STRING, BASE_NONE, NULL, 0x00,
5195 { &hf_ptp_v2_mm_faultValue_length,
5196 { "length", "ptp.v2.mm.faultValue.length",
5197 FT_UINT8, BASE_DEC, NULL, 0x00,
5200 { &hf_ptp_v2_mm_faultDescription,
5201 { "faultDescription", "ptp.v2.mm.faultDescription",
5202 FT_STRING, BASE_NONE, NULL, 0x00,
5205 { &hf_ptp_v2_mm_faultDescription_length,
5206 { "length", "ptp.v2.mm.faultDescription.length",
5207 FT_UINT8, BASE_DEC, NULL, 0x00,
5210 { &hf_ptp_v2_mm_faultTime,
5211 { "Fault time", "ptp.v2.mm.faultTime",
5212 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
5215 { &hf_ptp_v2_mm_faultTime_s,
5216 { "Fault time (seconds)", "ptp.v2.mm.faultTime.seconds",
5217 FT_UINT64, BASE_DEC, NULL, 0x00,
5220 { &hf_ptp_v2_mm_faultTime_ns,
5221 { "Fault time (nanoseconds)", "ptp.v2.mm.faultTime.nanoseconds",
5222 FT_INT32, BASE_DEC, NULL, 0x00,
5225 { &hf_ptp_v2_mm_currentTime_s,
5226 { "current time (seconds)", "ptp.v2.mm.currentTime.seconds",
5227 FT_UINT64, BASE_DEC, NULL, 0x00,
5230 { &hf_ptp_v2_mm_currentTime_ns,
5231 { "current time (nanoseconds)", "ptp.v2.mm.currentTime.nanoseconds",
5232 FT_INT32, BASE_DEC, NULL, 0x00,
5235 { &hf_ptp_v2_mm_clockAccuracy,
5236 { "Clock accuracy", "ptp.v2.mm.clockaccuracy",
5237 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
5241 { &hf_ptp_v2_mm_priority1,
5242 { "priority1", "ptp.v2.mm.priority1",
5243 FT_UINT8, BASE_DEC, NULL, 0x00,
5246 { &hf_ptp_v2_mm_priority2,
5247 { "priority2", "ptp.v2.mm.priority2",
5248 FT_UINT8, BASE_DEC, NULL, 0x00,
5251 { &hf_ptp_v2_mm_dds_SO,
5252 { "Slave only", "ptp.v2.mm.SlavOnly",
5253 FT_BOOLEAN, 8, NULL, 0x02,
5256 { &hf_ptp_v2_mm_TSC,
5257 { "Two step", "ptp.v2.mm.twoStep",
5258 FT_BOOLEAN, 8, NULL, 0x01,
5261 { &hf_ptp_v2_mm_numberPorts,
5262 { "number of ports", "ptp.v2.mm.numberPorts",
5263 FT_UINT16, BASE_DEC, NULL, 0x00,
5266 { &hf_ptp_v2_mm_clockclass,
5267 { "Clock class", "ptp.v2.mm.clockclass",
5268 FT_UINT8, BASE_DEC, NULL, 0x00,
5271 { &hf_ptp_v2_mm_clockaccuracy,
5272 { "Clock accuracy", "ptp.v2.mm.clockaccuracy",
5273 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
5276 { &hf_ptp_v2_mm_clockvariance,
5277 { "Clock variance", "ptp.v2.mm.clockvariance",
5278 FT_UINT16, BASE_DEC, NULL, 0x00,
5281 { &hf_ptp_v2_mm_clockidentity,
5282 { "Clock identity", "ptp.v2.mm.clockidentity",
5283 FT_UINT64, BASE_HEX, NULL, 0x00,
5286 { &hf_ptp_v2_mm_domainNumber,
5287 { "domain number", "ptp.v2.mm.domainNumber",
5288 FT_UINT8, BASE_DEC, NULL , 0x00,
5292 { "Slave only", "ptp.v2.mm.SlavOnly",
5293 FT_BOOLEAN, 8, NULL, 0x01,
5296 { &hf_ptp_v2_mm_stepsRemoved,
5297 { "steps removed", "ptp.v2.mm.stepsRemoved",
5298 FT_INT16, BASE_DEC, NULL, 0x00,
5301 { &hf_ptp_v2_mm_parentIdentity,
5302 { "parent ClockIdentity", "ptp.v2.mm.parentclockidentity",
5303 FT_UINT64, BASE_HEX, NULL, 0x00,
5306 { &hf_ptp_v2_mm_parentPort,
5307 { "parent SourcePortID", "ptp.v2.mm.parentsourceportid",
5308 FT_UINT16, BASE_DEC, NULL, 0x00,
5311 { &hf_ptp_v2_mm_parentStats,
5312 { "parent stats", "ptp.v2.mm.parentstats",
5313 FT_BOOLEAN, 8, NULL, 0x01,
5316 { &hf_ptp_v2_mm_observedParentOffsetScaledLogVariance,
5317 { "observedParentOffsetScaledLogVariance", "ptp.v2.mm.observedParentOffsetScaledLogVariance",
5318 FT_UINT16, BASE_DEC, NULL, 0x00,
5321 { &hf_ptp_v2_mm_observedParentClockPhaseChangeRate,
5322 { "observedParentClockPhaseChangeRate", "ptp.v2.mm.observedParentClockPhaseChangeRate",
5323 FT_INT32, BASE_DEC, NULL, 0x00,
5326 { &hf_ptp_v2_mm_grandmasterPriority1,
5327 { "Grandmaster priority1", "ptp.v2.mm.grandmasterPriority1",
5328 FT_UINT8, BASE_DEC, NULL, 0x00,
5331 { &hf_ptp_v2_mm_grandmasterPriority2,
5332 { "Grandmaster priority2", "ptp.v2.mm.grandmasterPriority2",
5333 FT_UINT8, BASE_DEC, NULL, 0x00,
5336 { &hf_ptp_v2_mm_grandmasterclockclass,
5337 { "Grandmaster clock class", "ptp.v2.mm.grandmasterclockclass",
5338 FT_UINT8, BASE_DEC, NULL, 0x00,
5341 { &hf_ptp_v2_mm_grandmasterclockaccuracy,
5342 { "Grandmaster clock accuracy", "ptp.v2.mm.grandmasterclockaccuracy",
5343 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
5346 { &hf_ptp_v2_mm_grandmasterclockvariance,
5347 { "Grandmaster clock variance", "ptp.v2.mm.grandmasterclockvariance",
5348 FT_UINT16, BASE_DEC, NULL, 0x00,
5351 { &hf_ptp_v2_mm_grandmasterIdentity,
5352 { "Grandmaster clock identity", "ptp.v2.mm.grandmasterclockidentity",
5353 FT_UINT64, BASE_HEX, NULL, 0x00,
5356 { &hf_ptp_v2_mm_currentUtcOffset,
5357 { "CurrentUTCOffset", "ptp.v2.mm.currentutcoffset",
5358 FT_INT16, BASE_DEC, NULL, 0x00,
5361 { &hf_ptp_v2_mm_LI_61,
5362 { "leap 61", "ptp.v2.mm.li61",
5363 FT_BOOLEAN, 8, NULL, 0x01,
5366 { &hf_ptp_v2_mm_LI_59,
5367 { "leap 59", "ptp.v2.mm.li59",
5368 FT_BOOLEAN, 8, NULL, 0x02,
5371 { &hf_ptp_v2_mm_UTCV,
5372 { "CurrentUTCOffset valid", "ptp.v2.mm.CurrentUTCOffsetValid",
5373 FT_BOOLEAN, 8, NULL, 0x04,
5376 { &hf_ptp_v2_mm_PTP,
5377 { "PTP timescale", "ptp.v2.mm.ptptimescale",
5378 FT_BOOLEAN, 8, NULL, 0x08,
5381 { &hf_ptp_v2_mm_TTRA,
5382 { "Time traceable", "ptp.v2.mm.timeTraceable",
5383 FT_BOOLEAN, 8, NULL, 0x10,
5386 { &hf_ptp_v2_mm_FTRA,
5387 { "Frequency traceable", "ptp.v2.mm.frequencyTraceable",
5388 FT_BOOLEAN, 8, NULL, 0x20,
5391 { &hf_ptp_v2_mm_timesource,
5392 { "TimeSource", "ptp.v2.mm.timesource",
5393 FT_UINT8, BASE_HEX, VALS(ptp_v2_timesource_vals), 0x00,
5396 { &hf_ptp_v2_mm_offset_ns,
5397 { "correction", "ptp.v2.mm.offset.ns",
5398 FT_UINT64, BASE_DEC, NULL, 0x00,
5401 { &hf_ptp_v2_mm_offset_subns,
5402 { "SubNs", "ptp.v2.mm.offset.subns",
5403 FT_DOUBLE, BASE_NONE, NULL, 0x00,
5406 { &hf_ptp_v2_mm_pathDelay_ns,
5407 { "ns", "ptp.v2.mm.pathDelay.ns",
5408 FT_UINT64, BASE_DEC, NULL, 0x00,
5411 { &hf_ptp_v2_mm_pathDelay_subns,
5412 { "SubNs", "ptp.v2.mm.pathDelay.subns",
5413 FT_DOUBLE, BASE_NONE, NULL, 0x00,
5416 { &hf_ptp_v2_mm_PortNumber,
5417 { "PortNumber", "ptp.v2.mm.PortNumber",
5418 FT_UINT16, BASE_DEC, NULL, 0x00,
5421 { &hf_ptp_v2_mm_portState,
5422 { "Port state", "ptp.v2.mm.portState",
5423 FT_UINT8, BASE_DEC, VALS(ptp2_portState_vals), 0x00,
5426 { &hf_ptp_v2_mm_logMinDelayReqInterval,
5427 { "logMinDelayReqInterval", "ptp.v2.mm.logMinDelayReqInterval",
5428 FT_INT8, BASE_DEC, NULL, 0x00,
5431 { &hf_ptp_v2_mm_peerMeanPathDelay_ns,
5432 { "ns", "ptp.v2.mm.peerMeanPathDelay.ns",
5433 FT_UINT64, BASE_DEC, NULL, 0x00,
5436 { &hf_ptp_v2_mm_peerMeanPathDelay_subns,
5437 { "SubNs", "ptp.v2.mm.peerMeanPathDelay.subns",
5438 FT_DOUBLE, BASE_NONE, NULL, 0x00,
5441 { &hf_ptp_v2_mm_logAnnounceInterval,
5442 { "logAnnounceInterval", "ptp.v2.mm.logAnnounceInterval",
5443 FT_INT8, BASE_DEC, NULL, 0x00,
5446 { &hf_ptp_v2_mm_announceReceiptTimeout,
5447 { "announceReceiptTimeout", "ptp.v2.mm.announceReceiptTimeout",
5448 FT_UINT8, BASE_DEC, NULL, 0x00,
5451 { &hf_ptp_v2_mm_logSyncInterval,
5452 { "logSyncInterval", "ptp.v2.mm.logSyncInterval",
5453 FT_INT8, BASE_DEC, NULL, 0x00,
5456 { &hf_ptp_v2_mm_delayMechanism,
5457 { "Delay mechanism", "ptp.v2.mm.delayMechanism",
5458 FT_UINT8, BASE_DEC, VALS(ptp2_delayMechanism_vals), 0x00,
5461 { &hf_ptp_v2_mm_logMinPdelayReqInterval,
5462 { "logMinPdelayReqInterval", "ptp.v2.mm.logMinPdelayReqInterval",
5463 FT_INT8, BASE_DEC, NULL, 0x00,
5466 { &hf_ptp_v2_mm_versionNumber,
5467 { "versionNumber", "ptp.v2.mm.versionNumber",
5468 FT_UINT8, BASE_DEC, NULL, 0x0F,
5471 { &hf_ptp_v2_mm_primaryDomain,
5472 { "Primary domain number", "ptp.v2.mm.primaryDomain",
5473 FT_UINT8, BASE_DEC, NULL, 0x00,
5476 { &hf_ptp_v2_mm_faultyFlag,
5477 { "Faulty flag", "ptp.v2.mm.faultyFlag",
5478 FT_BOOLEAN, 8, NULL, 0x01,
5482 { &hf_ptp_v2_mm_managementErrorId,
5483 { "managementErrorId", "ptp.v2.mm.managementErrorId",
5484 FT_UINT16, BASE_DEC, VALS(ptp2_managementErrorId_vals), 0x00,
5487 { &hf_ptp_v2_mm_displayData,
5488 { "Display data", "ptp.v2.mm.displayData",
5489 FT_STRING, BASE_NONE, NULL, 0x00,
5492 { &hf_ptp_v2_mm_displayData_length,
5493 { "length", "ptp.v2.mm.displayData.length",
5494 FT_UINT8, BASE_DEC, NULL, 0x00,
5497 { &hf_ptp_v2_mm_ucEN,
5498 { "Enable unicast", "ptp.v2.mm.unicastEnable",
5499 FT_BOOLEAN, 8, NULL, 0x01,
5502 { &hf_ptp_v2_mm_ptEN,
5503 { "Path trace unicast", "ptp.v2.mm.pathTraceEnable",
5504 FT_BOOLEAN, 8, NULL, 0x01,
5507 { &hf_ptp_v2_mm_atEN,
5508 { "Path trace unicast", "ptp.v2.mm.pathTraceEnable",
5509 FT_BOOLEAN, 8, NULL, 0x01,
5512 { &hf_ptp_v2_mm_keyField,
5513 { "Key field", "ptp.v2.mm.keyField",
5514 FT_UINT8, BASE_DEC, NULL, 0x00,
5517 { &hf_ptp_v2_mm_displayName,
5518 { "Display name", "ptp.v2.mm.displayName",
5519 FT_STRING, BASE_NONE, NULL, 0x00,
5522 { &hf_ptp_v2_mm_displayName_length,
5523 { "length", "ptp.v2.mm.displayName.length",
5524 FT_UINT8, BASE_DEC, NULL, 0x00,
5527 { &hf_ptp_v2_mm_maxKey,
5528 { "Max key", "ptp.v2.mm.maxKey",
5529 FT_UINT8, BASE_DEC, NULL, 0x00,
5532 { &hf_ptp_v2_mm_currentOffset,
5533 { "Current offset", "ptp.v2.mm.currentOffset",
5534 FT_INT32, BASE_DEC, NULL, 0x00,
5537 { &hf_ptp_v2_mm_jumpSeconds,
5538 { "Jump seconds", "ptp.v2.mm.jumpSeconds",
5539 FT_INT32, BASE_DEC, NULL, 0x00,
5542 { &hf_ptp_v2_mm_numberOfAlternateMasters,
5543 { "Number of alternate masters", "ptp.v2.mm.numberOfAlternateMasters",
5544 FT_UINT8, BASE_DEC, NULL, 0x00,
5547 { &hf_ptp_v2_mm_logAlternateMulticastSyncInterval,
5548 { "Alternate multicast sync interval", "ptp.v2.mm.AlternateMulticastSyncInterval",
5549 FT_INT8, BASE_DEC, NULL, 0x00,
5552 { &hf_ptp_v2_mm_transmitAlternateMulticastSync,
5553 { "Transmit alternate multicast sync", "ptp.v2.mm.transmitAlternateMulticastSync",
5554 FT_BOOLEAN, 8, NULL, 0x01,
5560 /* Setup protocol subtree array */
5561 static gint *ett[] = {
5567 &ett_ptp_v2_transportspecific,
5569 &ett_ptp_v2_correction,
5572 &ett_ptp_v2_managementData,
5573 &ett_ptp_v2_clockType,
5574 &ett_ptp_v2_physicalLayerProtocol,
5575 &ett_ptp_v2_protocolAddress,
5576 &ett_ptp_v2_ptptext,
5577 &ett_ptp_v2_faultRecord,
5578 &ett_ptp_v2_timeInterval,
5580 &ett_ptp_as_sig_tlv_flags,
5583 /* Register the protocol name and description */
5584 proto_ptp = proto_register_protocol("Precision Time Protocol (IEEE1588)",
5587 /* Required function calls to register the header fields and subtrees used */
5588 proto_register_field_array(proto_ptp, hf, array_length(hf));
5589 proto_register_subtree_array(ett, array_length(ett));
5593 proto_reg_handoff_ptp(void)
5595 dissector_handle_t event_port_ptp_handle;
5596 dissector_handle_t general_port_ptp_handle;
5597 dissector_handle_t ethertype_ptp_handle;
5599 event_port_ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp);
5600 general_port_ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp);
5601 ethertype_ptp_handle = create_dissector_handle(dissect_ptp_oE, proto_ptp);
5603 dissector_add_uint("udp.port", EVENT_PORT_PTP, event_port_ptp_handle);
5604 dissector_add_uint("udp.port", GENERAL_PORT_PTP, general_port_ptp_handle);
5605 dissector_add_uint("ethertype", ETHERTYPE_PTP, ethertype_ptp_handle);