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>
10 * - Markus Seehofer 09.08.2005 <mseehofe@nt.hirschmann.de>
11 * - Included the "startingBoundaryHops" field in
12 * ptp_management messages.
13 * - Christian Schaer 07.07.2006 <scc@zhwin.ch>
14 * - Added support for PTP version 2
15 * - Markus Renz 2007-06-01
16 * updated support for PTPv2
17 * - Markus Renz added Management for PTPv2, update to Draft 2.2
21 * Wireshark - Network traffic analyzer
22 * By Gerald Combs <gerald@wireshark.org>
23 * Copyright 1998 Gerald Combs
25 * This program is free software; you can redistribute it and/or
26 * modify it under the terms of the GNU General Public License
27 * as published by the Free Software Foundation; either version 2
28 * of the License, or (at your option) any later version.
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
35 * You should have received a copy of the GNU General Public License
36 * along with this program; if not, write to the Free Software
37 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
52 #include <epan/packet.h>
53 #include <epan/etypes.h>
56 /**********************************************************/
57 /* Port definition's for PTP */
58 /**********************************************************/
59 #define EVENT_PORT_PTP 319
60 #define GENERAL_PORT_PTP 320
62 /*END Port definition's for PTP*/
64 static int proto_ptp = -1;
66 /***********************************************************************************/
67 /* Definitions and fields for PTPv1 dissection. */
68 /***********************************************************************************/
71 /**********************************************************/
72 /* Offsets of fields within a PTPv1 packet. */
73 /**********************************************************/
75 /*Common offsets for all Messages (Synch, Delay_Req, Follow_Up, Delay_Resp ....)*/
76 #define PTP_VERSIONPTP_OFFSET 0
77 #define PTP_VERSIONNETWORK_OFFSET 2
78 #define PTP_SUBDOMAIN_OFFSET 4
79 #define PTP_MESSAGETYPE_OFFSET 20
80 #define PTP_SOURCECOMMUNICATIONTECHNOLOGY_OFFSET 21
81 #define PTP_SOURCEUUID_OFFSET 22
82 #define PTP_SOURCEPORTID_OFFSET 28
83 #define PTP_SEQUENCEID_OFFSET 30
84 #define PTP_CONTROL_OFFSET 32
85 #define PTP_FLAGS_OFFSET 34
86 #define PTP_FLAGS_LI61_OFFSET 34
87 #define PTP_FLAGS_LI59_OFFSET 34
88 #define PTP_FLAGS_BOUNDARY_CLOCK_OFFSET 34
89 #define PTP_FLAGS_ASSIST_OFFSET 34
90 #define PTP_FLAGS_EXT_SYNC_OFFSET 34
91 #define PTP_FLAGS_PARENT_STATS_OFFSET 34
92 #define PTP_FLAGS_SYNC_BURST_OFFSET 34
94 /*Offsets for PTP_Sync and Delay_Req (=SDR) messages*/
95 #define PTP_SDR_ORIGINTIMESTAMP_OFFSET 40
96 #define PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET 40
97 #define PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET 44
98 #define PTP_SDR_EPOCHNUMBER_OFFSET 48
99 #define PTP_SDR_CURRENTUTCOFFSET_OFFSET 50
100 #define PTP_SDR_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 53
101 #define PTP_SDR_GRANDMASTERCLOCKUUID_OFFSET 54
102 #define PTP_SDR_GRANDMASTERPORTID_OFFSET 60
103 #define PTP_SDR_GRANDMASTERSEQUENCEID_OFFSET 62
104 #define PTP_SDR_GRANDMASTERCLOCKSTRATUM_OFFSET 67
105 #define PTP_SDR_GRANDMASTERCLOCKIDENTIFIER_OFFSET 68
106 #define PTP_SDR_GRANDMASTERCLOCKVARIANCE_OFFSET 74
107 #define PTP_SDR_GRANDMASTERPREFERRED_OFFSET 77
108 #define PTP_SDR_GRANDMASTERISBOUNDARYCLOCK_OFFSET 79
109 #define PTP_SDR_SYNCINTERVAL_OFFSET 83
110 #define PTP_SDR_LOCALCLOCKVARIANCE_OFFSET 86
111 #define PTP_SDR_LOCALSTEPSREMOVED_OFFSET 90
112 #define PTP_SDR_LOCALCLOCKSTRATUM_OFFSET 95
113 #define PTP_SDR_LOCALCLOCKIDENTIFIER_OFFSET 96
114 #define PTP_SDR_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET 101
115 #define PTP_SDR_PARENTUUID_OFFSET 102
116 #define PTP_SDR_PARENTPORTFIELD_OFFSET 110
117 #define PTP_SDR_ESTIMATEDMASTERVARIANCE_OFFSET 114
118 #define PTP_SDR_ESTIMATEDMASTERDRIFT_OFFSET 116
119 #define PTP_SDR_UTCREASONABLE_OFFSET 123
121 /*Offsets for Follow_Up (=FU) messages*/
122 #define PTP_FU_ASSOCIATEDSEQUENCEID_OFFSET 42
123 #define PTP_FU_PRECISEORIGINTIMESTAMP_OFFSET 44
124 #define PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET 44
125 #define PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET 48
127 /*Offsets for Delay_Resp (=DR) messages*/
128 #define PTP_DR_DELAYRECEIPTTIMESTAMP_OFFSET 40
129 #define PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET 40
130 #define PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET 44
131 #define PTP_DR_REQUESTINGSOURCECOMMUNICATIONTECHNOLOGY_OFFSET 49
132 #define PTP_DR_REQUESTINGSOURCEUUID_OFFSET 50
133 #define PTP_DR_REQUESTINGSOURCEPORTID_OFFSET 56
134 #define PTP_DR_REQUESTINGSOURCESEQUENCEID_OFFSET 58
136 /*Offsets for Management (=MM) messages*/
137 #define PTP_MM_TARGETCOMMUNICATIONTECHNOLOGY_OFFSET 41
138 #define PTP_MM_TARGETUUID_OFFSET 42
139 #define PTP_MM_TARGETPORTID_OFFSET 48
140 #define PTP_MM_STARTINGBOUNDARYHOPS_OFFSET 50
141 #define PTP_MM_BOUNDARYHOPS_OFFSET 52
142 #define PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET 55
143 #define PTP_MM_PARAMETERLENGTH_OFFSET 58
144 /*PARAMETERLENGTH > 0*/
145 #define PTP_MM_MESSAGEPARAMETERS_OFFSET 60
146 /*PTP_MM_CLOCK_IDENTITY (PARAMETERLENGTH = 64)*/
147 #define PTP_MM_CLOCK_IDENTITY_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET 63
148 #define PTP_MM_CLOCK_IDENTITY_CLOCKUUIDFIELD_OFFSET 64
149 #define PTP_MM_CLOCK_IDENTITY_CLOCKPORTFIELD_OFFSET 74
150 #define PTP_MM_CLOCK_IDENTITY_MANUFACTURERIDENTITY_OFFSET 76
152 /*PTP_MM_INITIALIZE_CLOCK (PARAMETERLENGTH = 4)*/
153 #define PTP_MM_INITIALIZE_CLOCK_INITIALISATIONKEY_OFFSET 62
155 /*PTP_MM_SET_SUBDOMAIN (PARAMETERLENGTH = 16)*/
156 #define PTP_MM_SET_SUBDOMAIN_SUBDOMAINNAME_OFFSET 60
158 /*PTP_MM_DEFAULT_DATA_SET (PARAMETERLENGTH = 76)*/
159 #define PTP_MM_DEFAULT_DATA_SET_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET 63
160 #define PTP_MM_DEFAULT_DATA_SET_CLOCKUUIDFIELD_OFFSET 64
161 #define PTP_MM_DEFAULT_DATA_SET_CLOCKPORTFIELD_OFFSET 74
162 #define PTP_MM_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET 79
163 #define PTP_MM_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET 80
164 #define PTP_MM_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET 86
165 #define PTP_MM_DEFAULT_DATA_SET_CLOCKFOLLOWUPCAPABLE_OFFSET 89
166 #define PTP_MM_DEFAULT_DATA_SET_PREFERRED_OFFSET 95
167 #define PTP_MM_DEFAULT_DATA_SET_INITIALIZABLE_OFFSET 99
168 #define PTP_MM_DEFAULT_DATA_SET_EXTERNALTIMING_OFFSET 103
169 #define PTP_MM_DEFAULT_DATA_SET_ISBOUNDARYCLOCK_OFFSET 107
170 #define PTP_MM_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET 111
171 #define PTP_MM_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET 112
172 #define PTP_MM_DEFAULT_DATA_SET_NUMBERPORTS_OFFSET 130
173 #define PTP_MM_DEFAULT_DATA_SET_NUMBERFOREIGNRECORDS_OFFSET 134
175 /*PTP_MM_UPDATE_DEFAULT_DATA_SET (PARAMETERLENGTH = 36)*/
176 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET 63
177 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET 64
178 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET 70
179 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_PREFERRED_OFFSET 75
180 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET 79
181 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET 80
183 /*PTP_MM_CURRENT_DATA_SET (PARAMETERLENGTH = 20)*/
184 #define PTP_MM_CURRENT_DATA_SET_STEPSREMOVED_OFFSET 62
185 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTER_OFFSET 64
186 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET 64
187 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET 68
188 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAY_OFFSET 72
189 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET 72
190 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET 76
192 /*PTP_MM_PARENT_DATA_SET (PARAMETERLENGTH = 90)*/
193 #define PTP_MM_PARENT_DATA_SET_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET 63
194 #define PTP_MM_PARENT_DATA_SET_PARENTUUID_OFFSET 64
195 #define PTP_MM_PARENT_DATA_SET_PARENTPORTID_OFFSET 74
196 #define PTP_MM_PARENT_DATA_SET_PARENTLASTSYNCSEQUENCENUMBER_OFFSET 78
197 #define PTP_MM_PARENT_DATA_SET_PARENTFOLLOWUPCAPABLE_OFFSET 83
198 #define PTP_MM_PARENT_DATA_SET_PARENTEXTERNALTIMING_OFFSET 87
199 #define PTP_MM_PARENT_DATA_SET_PARENTVARIANCE_OFFSET 90
200 #define PTP_MM_PARENT_DATA_SET_PARENTSTATS_OFFSET 95
201 #define PTP_MM_PARENT_DATA_SET_OBSERVEDVARIANCE_OFFSET 98
202 #define PTP_MM_PARENT_DATA_SET_OBSERVEDDRIFT_OFFSET 100
203 #define PTP_MM_PARENT_DATA_SET_UTCREASONABLE_OFFSET 107
204 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 111
205 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERUUIDFIELD_OFFSET 112
206 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERPORTIDFIELD_OFFSET 122
207 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERSTRATUM_OFFSET 127
208 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERIDENTIFIER_OFFSET 128
209 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERVARIANCE_OFFSET 134
210 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERPREFERRED_OFFSET 139
211 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERISBOUNDARYCLOCK_OFFSET 143
212 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERSEQUENCENUMBER_OFFSET 146
214 /*PTP_MM_PORT_DATA_SET (PARAMETERLENGTH = 52)*/
215 #define PTP_MM_PORT_DATA_SET_RETURNEDPORTNUMBER_OFFSET 62
216 #define PTP_MM_PORT_DATA_SET_PORTSTATE_OFFSET 67
217 #define PTP_MM_PORT_DATA_SET_LASTSYNCEVENTSEQUENCENUMBER_OFFSET 70
218 #define PTP_MM_PORT_DATA_SET_LASTGENERALEVENTSEQUENCENUMBER_OFFSET 74
219 #define PTP_MM_PORT_DATA_SET_PORTCOMMUNICATIONTECHNOLOGY_OFFSET 79
220 #define PTP_MM_PORT_DATA_SET_PORTUUIDFIELD_OFFSET 80
221 #define PTP_MM_PORT_DATA_SET_PORTIDFIELD_OFFSET 90
222 #define PTP_MM_PORT_DATA_SET_BURSTENABLED_OFFSET 95
223 #define PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESSOCTETS_OFFSET 97
224 #define PTP_MM_PORT_DATA_SET_EVENTPORTADDRESSOCTETS_OFFSET 98
225 #define PTP_MM_PORT_DATA_SET_GENERALPORTADDRESSOCTETS_OFFSET 99
226 #define PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESS_OFFSET 100
227 #define PTP_MM_PORT_DATA_SET_EVENTPORTADDRESS_OFFSET 106
228 #define PTP_MM_PORT_DATA_SET_GENERALPORTADDRESS_OFFSET 110
230 /*PTP_MM_GLOBAL_TIME_DATA_SET (PARAMETERLENGTH = 24)*/
231 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIME_OFFSET 60
232 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET 60
233 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET 64
234 #define PTP_MM_GLOBAL_TIME_DATA_SET_CURRENTUTCOFFSET_OFFSET 70
235 #define PTP_MM_GLOBAL_TIME_DATA_SET_LEAP59_OFFSET 75
236 #define PTP_MM_GLOBAL_TIME_DATA_SET_LEAP61_OFFSET 79
237 #define PTP_MM_GLOBAL_TIME_DATA_SET_EPOCHNUMBER_OFFSET 82
239 /*PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES (PARAMETERLENGTH = 16)*/
240 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_CURRENTUTCOFFSET_OFFSET 62
241 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP59_OFFSET 67
242 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP61_OFFSET 71
243 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_EPOCHNUMBER_OFFSET 74
245 /*PTP_MM_GET_FOREIGN_DATA_SET (PARAMETERLENGTH = 4)*/
246 #define PTP_MM_GET_FOREIGN_DATA_SET_RECORDKEY_OFFSET 62
248 /*PTP_MM_FOREIGN_DATA_SET (PARAMETERLENGTH = 28)*/
249 #define PTP_MM_FOREIGN_DATA_SET_RETURNEDPORTNUMBER_OFFSET 62
250 #define PTP_MM_FOREIGN_DATA_SET_RETURNEDRECORDNUMBER_OFFSET 66
251 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 71
252 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERUUIDFIELD_OFFSET 72
253 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERPORTIDFIELD_OFFSET 82
254 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERSYNCS_OFFSET 86
256 /*PTP_MM_SET_SYNC_INTERVAL (PARAMETERLENGTH = 4)*/
257 #define PTP_MM_SET_SYNC_INTERVAL_SYNCINTERVAL_OFFSET 62
259 /*PTP_MM_SET_TIME (PARAMETERLENGTH = 8)*/
260 #define PTP_MM_SET_TIME_LOCALTIME_OFFSET 60
261 #define PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET 60
262 #define PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET 64
264 /*END Offsets of fields within a PTP packet.*/
266 /**********************************************************/
267 /* flag-field-mask-definitions */
268 /**********************************************************/
269 #define PTP_FLAGS_LI61_BITMASK 0x01
270 #define PTP_FLAGS_LI59_BITMASK 0x02
271 #define PTP_FLAGS_BOUNDARY_CLOCK_BITMASK 0x04
272 #define PTP_FLAGS_ASSIST_BITMASK 0x08
273 #define PTP_FLAGS_EXT_SYNC_BITMASK 0x10
274 #define PTP_FLAGS_PARENT_STATS_BITMASK 0x20
275 #define PTP_FLAGS_SYNC_BURST_BITMASK 0x40
277 /*END flag-field-mask-definitions*/
279 /**********************************************************/
280 /* managementMessage definitions */
281 /**********************************************************/
282 #define PTP_MM_NULL 0
283 #define PTP_MM_OBTAIN_IDENTITY 1
284 #define PTP_MM_CLOCK_IDENTITY 2
285 #define PTP_MM_INITIALIZE_CLOCK 3
286 #define PTP_MM_SET_SUBDOMAIN 4
287 #define PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER 5
288 #define PTP_MM_SET_DESIGNATED_PREFERRED_MASTER 6
289 #define PTP_MM_GET_DEFAULT_DATA_SET 7
290 #define PTP_MM_DEFAULT_DATA_SET 8
291 #define PTP_MM_UPDATE_DEFAULT_DATA_SET 9
292 #define PTP_MM_GET_CURRENT_DATA_SET 10
293 #define PTP_MM_CURRENT_DATA_SET 11
294 #define PTP_MM_GET_PARENT_DATA_SET 12
295 #define PTP_MM_PARENT_DATA_SET 13
296 #define PTP_MM_GET_PORT_DATA_SET 14
297 #define PTP_MM_PORT_DATA_SET 15
298 #define PTP_MM_GET_GLOBAL_TIME_DATA_SET 16
299 #define PTP_MM_GLOBAL_TIME_DATA_SET 17
300 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES 18
301 #define PTP_MM_GOTO_FAULTY_STATE 19
302 #define PTP_MM_GET_FOREIGN_DATA_SET 20
303 #define PTP_MM_FOREIGN_DATA_SET 21
304 #define PTP_MM_SET_SYNC_INTERVAL 22
305 #define PTP_MM_DISABLE_PORT 23
306 #define PTP_MM_ENABLE_PORT 24
307 #define PTP_MM_DISABLE_BURST 25
308 #define PTP_MM_ENABLE_BURST 26
309 #define PTP_MM_SET_TIME 27
311 static const value_string ptp_managementMessageKey_vals[] = {
312 {PTP_MM_NULL, "PTP_MM_NULL"},
313 {PTP_MM_OBTAIN_IDENTITY, "PTP_MM_OBTAIN_IDENTITY"},
314 {PTP_MM_CLOCK_IDENTITY, "PTP_MM_CLOCK_IDENTITY"},
315 {PTP_MM_INITIALIZE_CLOCK, "PTP_MM_INITIALIZE_CLOCK"},
316 {PTP_MM_SET_SUBDOMAIN, "PTP_MM_SET_SUBDOMAIN"},
317 {PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER, "PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER"},
318 {PTP_MM_SET_DESIGNATED_PREFERRED_MASTER, "PTP_MM_SET_DESIGNATED_PREFERRED_MASTER"},
319 {PTP_MM_GET_DEFAULT_DATA_SET, "PTP_MM_GET_DEFAULT_DATA_SET"},
320 {PTP_MM_DEFAULT_DATA_SET, "PTP_MM_DEFAULT_DATA_SET"},
321 {PTP_MM_UPDATE_DEFAULT_DATA_SET, "PTP_MM_UPDATE_DEFAULT_DATA_SET"},
322 {PTP_MM_GET_CURRENT_DATA_SET, "PTP_MM_GET_CURRENT_DATA_SET"},
323 {PTP_MM_CURRENT_DATA_SET, "PTP_MM_CURRENT_DATA_SET"},
324 {PTP_MM_GET_PARENT_DATA_SET, "PTP_MM_GET_PARENT_DATA_SET"},
325 {PTP_MM_PARENT_DATA_SET, "PTP_MM_PARENT_DATA_SET"},
326 {PTP_MM_GET_PORT_DATA_SET, "PTP_MM_GET_PORT_DATA_SET"},
327 {PTP_MM_PORT_DATA_SET, "PTP_MM_PORT_DATA_SET"},
328 {PTP_MM_GET_GLOBAL_TIME_DATA_SET, "PTP_MM_GET_GLOBAL_TIME_DATA_SET"},
329 {PTP_MM_GLOBAL_TIME_DATA_SET, "PTP_MM_GLOBAL_TIME_DATA_SET"},
330 {PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES, "PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES"},
331 {PTP_MM_GOTO_FAULTY_STATE, "PTP_MM_GOTO_FAULTY_STATE"},
332 {PTP_MM_GET_FOREIGN_DATA_SET, "PTP_MM_GET_FOREIGN_DATA_SET"},
333 {PTP_MM_FOREIGN_DATA_SET, "PTP_MM_FOREIGN_DATA_SET"},
334 {PTP_MM_SET_SYNC_INTERVAL, "PTP_MM_SET_SYNC_INTERVAL"},
335 {PTP_MM_DISABLE_PORT, "PTP_MM_DISABLE_PORT"},
336 {PTP_MM_ENABLE_PORT, "PTP_MM_ENABLE_PORT"},
337 {PTP_MM_DISABLE_BURST, "PTP_MM_DISABLE_BURST"},
338 {PTP_MM_ENABLE_BURST, "PTP_MM_ENABLE_BURST"},
339 {PTP_MM_SET_TIME, "PTP_MM_SET_TIME"},
341 /*same again but better readable text for info column*/
342 static const value_string ptp_managementMessageKey_infocolumn_vals[] = {
343 {PTP_MM_NULL, "Null"},
344 {PTP_MM_OBTAIN_IDENTITY, "Obtain Identity"},
345 {PTP_MM_CLOCK_IDENTITY, "Clock Identity"},
346 {PTP_MM_INITIALIZE_CLOCK, "Initialize Clock"},
347 {PTP_MM_SET_SUBDOMAIN, "Set Subdomain"},
348 {PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER, "Clear Designated Preferred Master"},
349 {PTP_MM_SET_DESIGNATED_PREFERRED_MASTER, "Set Designated Preferred Master"},
350 {PTP_MM_GET_DEFAULT_DATA_SET, "Get Default Data Set"},
351 {PTP_MM_DEFAULT_DATA_SET, "Default Data Set"},
352 {PTP_MM_UPDATE_DEFAULT_DATA_SET, "Update Default Data Set"},
353 {PTP_MM_GET_CURRENT_DATA_SET, "Get Current Data Set"},
354 {PTP_MM_CURRENT_DATA_SET, "Current Data Set"},
355 {PTP_MM_GET_PARENT_DATA_SET, "Get Parent Data Set"},
356 {PTP_MM_PARENT_DATA_SET, "Parent Data Set"},
357 {PTP_MM_GET_PORT_DATA_SET, "Get Port Data Set"},
358 {PTP_MM_PORT_DATA_SET, "Port Data Set"},
359 {PTP_MM_GET_GLOBAL_TIME_DATA_SET, "Get Global Time Data Set"},
360 {PTP_MM_GLOBAL_TIME_DATA_SET, "Global Time Data Set"},
361 {PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES, "Update Global Time Properties"},
362 {PTP_MM_GOTO_FAULTY_STATE, "Goto Faulty State"},
363 {PTP_MM_GET_FOREIGN_DATA_SET, "Get Foreign Data Set"},
364 {PTP_MM_FOREIGN_DATA_SET, "Foreign Data Set"},
365 {PTP_MM_SET_SYNC_INTERVAL, "Set Sync Interval"},
366 {PTP_MM_DISABLE_PORT, "Disable Port"},
367 {PTP_MM_ENABLE_PORT, "Enable Port"},
368 {PTP_MM_DISABLE_BURST, "Disable Burst"},
369 {PTP_MM_ENABLE_BURST, "Enable Burst"},
370 {PTP_MM_SET_TIME, "Set Time"},
373 /*END managementMessage definitions*/
375 /**********************************************************/
376 /* CommunicationId definitions */
377 /**********************************************************/
381 #define PTP_PROFIBUS 5
385 #define PTP_CONTROLNET 9
386 #define PTP_CANOPEN 10
387 #define PTP_IEEE1394 243
388 #define PTP_IEEE802_11A 244
389 #define PTP_IEEE_WIRELESS 245
390 #define PTP_INFINIBAND 246
391 #define PTP_BLUETOOTH 247
392 #define PTP_IEEE802_15_1 248
393 #define PTP_IEEE1451_3 249
394 #define PTP_IEEE1451_5 250
399 #define PTP_DEFAULT 255
401 static const value_string ptp_communicationid_vals[] = {
402 {PTP_CLOSED, "Closed system outside the scope of this standard."},
403 {PTP_ETHER, "IEEE 802.3 (Ethernet)"},
404 {PTP_FFBUS, "FOUNDATION Fieldbus"},
405 {PTP_PROFIBUS, "PROFIBUS"},
406 {PTP_LON, "LonTalk"},
407 {PTP_DNET, "DeviceNet"},
408 {PTP_SDS, "SmartDistributedSystem"},
409 {PTP_CONTROLNET, "ControlNet"},
410 {PTP_CANOPEN, "CANopen"},
411 {PTP_IEEE1394, "IEEE 1394"},
412 {PTP_IEEE802_11A, "IEEE 802.11a"},
413 {PTP_IEEE_WIRELESS, "IEEE 802.11b"},
414 {PTP_INFINIBAND, "InfiniBand"},
415 {PTP_BLUETOOTH, "Bluetooth wireless"},
416 {PTP_IEEE802_15_1, "IEEE 802.15.1"},
417 {PTP_IEEE1451_3, "IEEE 1451.3"},
418 {PTP_IEEE1451_5, "IEEE 1451.5"},
419 {PTP_USB, "USB bus"},
420 {PTP_ISA, "ISA bus"},
421 {PTP_PCI, "PCI bus"},
422 {PTP_VXI, "VXI bus"},
423 {PTP_DEFAULT, "Default value"},
426 /*END CommunicationId definitions*/
428 /**********************************************************/
429 /* PTP message types (PTP_CONTROL field) */
430 /**********************************************************/
431 #define PTP_SYNC_MESSAGE 0x00
432 #define PTP_DELAY_REQ_MESSAGE 0x01
433 #define PTP_FOLLOWUP_MESSAGE 0x02
434 #define PTP_DELAY_RESP_MESSAGE 0x03
435 #define PTP_MANAGEMENT_MESSAGE 0x04
436 #define PTP_OTHER_MESSAGE 0x05
438 static const value_string ptp_control_vals[] = {
439 {PTP_SYNC_MESSAGE, "Sync Message"},
440 {PTP_DELAY_REQ_MESSAGE, "Delay_Req Message"},
441 {PTP_FOLLOWUP_MESSAGE, "Follow_Up Message"},
442 {PTP_DELAY_RESP_MESSAGE, "Delay_Resp Message"},
443 {PTP_MANAGEMENT_MESSAGE, "Management Message"},
444 {PTP_OTHER_MESSAGE, "Other Message"},
447 /*END PTP message types*/
449 /**********************************************************/
450 /* Channel values for the PTP_MESSAGETYPE field */
451 /**********************************************************/
452 #define PTP_MESSAGETYPE_EVENT 0x01
453 #define PTP_MESSAGETYPE_GENERAL 0x02
455 static const value_string ptp_messagetype_vals[] = {
456 {PTP_MESSAGETYPE_EVENT, "Event Message"},
457 {PTP_MESSAGETYPE_GENERAL, "General Message"},
460 /*END channel values for the PTP_MESSAGETYPE field*/
462 /* Channel values for boolean vals (FLAGS)*/
464 static const value_string ptp_bool_vals[] = {
469 /**********************************************************/
470 /* Initialize the protocol and registered fields */
471 /**********************************************************/
473 static int hf_ptp_versionptp = -1;
474 static int hf_ptp_versionnetwork = -1;
475 static int hf_ptp_subdomain = -1;
476 static int hf_ptp_messagetype = -1;
477 static int hf_ptp_sourcecommunicationtechnology = -1;
478 static int hf_ptp_sourceuuid = -1;
479 static int hf_ptp_sourceportid = -1;
480 static int hf_ptp_sequenceid = -1;
481 static int hf_ptp_control = -1;
482 static int hf_ptp_flags = -1;
483 static int hf_ptp_flags_li61 = -1;
484 static int hf_ptp_flags_li59 = -1;
485 static int hf_ptp_flags_boundary_clock = -1;
486 static int hf_ptp_flags_assist = -1;
487 static int hf_ptp_flags_ext_sync = -1;
488 static int hf_ptp_flags_parent = -1;
489 static int hf_ptp_flags_sync_burst = -1;
491 /*Fields for ptp_sync and delay_req (=sdr) messages*/
492 static int hf_ptp_sdr_origintimestamp = -1; /*Field for seconds & nanoseconds*/
493 static int hf_ptp_sdr_origintimestamp_seconds = -1;
494 static int hf_ptp_sdr_origintimestamp_nanoseconds = -1;
495 static int hf_ptp_sdr_epochnumber = -1;
496 static int hf_ptp_sdr_currentutcoffset = -1;
497 static int hf_ptp_sdr_grandmastercommunicationtechnology = -1;
498 static int hf_ptp_sdr_grandmasterclockuuid = -1;
499 static int hf_ptp_sdr_grandmasterportid = -1;
500 static int hf_ptp_sdr_grandmastersequenceid = -1;
501 static int hf_ptp_sdr_grandmasterclockstratum = -1;
502 static int hf_ptp_sdr_grandmasterclockidentifier = -1;
503 static int hf_ptp_sdr_grandmasterclockvariance = -1;
504 static int hf_ptp_sdr_grandmasterpreferred = -1;
505 static int hf_ptp_sdr_grandmasterisboundaryclock = -1;
506 static int hf_ptp_sdr_syncinterval = -1;
507 static int hf_ptp_sdr_localclockvariance = -1;
508 static int hf_ptp_sdr_localstepsremoved = -1;
509 static int hf_ptp_sdr_localclockstratum = -1;
510 static int hf_ptp_sdr_localclockidentifier = -1;
511 static int hf_ptp_sdr_parentcommunicationtechnology = -1;
512 static int hf_ptp_sdr_parentuuid = -1;
513 static int hf_ptp_sdr_parentportfield = -1;
514 static int hf_ptp_sdr_estimatedmastervariance = -1;
515 static int hf_ptp_sdr_estimatedmasterdrift = -1;
516 static int hf_ptp_sdr_utcreasonable = -1;
518 /*Fields for follow_up (=fu) messages*/
519 static int hf_ptp_fu_associatedsequenceid = -1;
520 static int hf_ptp_fu_preciseorigintimestamp = -1;
521 static int hf_ptp_fu_preciseorigintimestamp_seconds = -1;
522 static int hf_ptp_fu_preciseorigintimestamp_nanoseconds = -1;
524 /*Fields for delay_resp (=dr) messages*/
525 static int hf_ptp_dr_delayreceipttimestamp = -1;
526 static int hf_ptp_dr_delayreceipttimestamp_seconds = -1;
527 static int hf_ptp_dr_delayreceipttimestamp_nanoseconds = -1;
528 static int hf_ptp_dr_requestingsourcecommunicationtechnology = -1;
529 static int hf_ptp_dr_requestingsourceuuid = -1;
530 static int hf_ptp_dr_requestingsourceportid = -1;
531 static int hf_ptp_dr_requestingsourcesequenceid = -1;
533 /*Fields for management (=mm) messages*/
534 static int hf_ptp_mm_targetcommunicationtechnology = -1;
535 static int hf_ptp_mm_targetuuid = -1;
536 static int hf_ptp_mm_targetportid = -1;
537 static int hf_ptp_mm_startingboundaryhops = -1;
538 static int hf_ptp_mm_boundaryhops = -1;
539 static int hf_ptp_mm_managementmessagekey = -1;
540 static int hf_ptp_mm_parameterlength = -1;
541 /*parameterlength > 0*/
542 static int hf_ptp_mm_messageparameters = -1;
543 /*ptp_mm_clock_identity (parameterlength = 64)*/
544 static int hf_ptp_mm_clock_identity_clockcommunicationtechnology = -1;
545 static int hf_ptp_mm_clock_identity_clockuuidfield = -1;
546 static int hf_ptp_mm_clock_identity_clockportfield = -1;
547 static int hf_ptp_mm_clock_identity_manufactureridentity = -1;
549 /*ptp_mm_initialize_clock (parameterlength = 4)*/
550 static int hf_ptp_mm_initialize_clock_initialisationkey = -1;
552 /*ptp_mm_set_subdomain (parameterlength = 16)*/
553 static int hf_ptp_mm_set_subdomain_subdomainname = -1;
555 /*ptp_mm_default_data_set (parameterlength = 76)*/
556 static int hf_ptp_mm_default_data_set_clockcommunicationtechnology = -1;
557 static int hf_ptp_mm_default_data_set_clockuuidfield = -1;
558 static int hf_ptp_mm_default_data_set_clockportfield = -1;
559 static int hf_ptp_mm_default_data_set_clockstratum = -1;
560 static int hf_ptp_mm_default_data_set_clockidentifier = -1;
561 static int hf_ptp_mm_default_data_set_clockvariance = -1;
562 static int hf_ptp_mm_default_data_set_clockfollowupcapable = -1;
563 static int hf_ptp_mm_default_data_set_preferred = -1;
564 static int hf_ptp_mm_default_data_set_initializable = -1;
565 static int hf_ptp_mm_default_data_set_externaltiming = -1;
566 static int hf_ptp_mm_default_data_set_isboundaryclock = -1;
567 static int hf_ptp_mm_default_data_set_syncinterval = -1;
568 static int hf_ptp_mm_default_data_set_subdomainname = -1;
569 static int hf_ptp_mm_default_data_set_numberports = -1;
570 static int hf_ptp_mm_default_data_set_numberforeignrecords = -1;
572 /*ptp_mm_update_default_data_set (parameterlength = 36)*/
573 static int hf_ptp_mm_update_default_data_set_clockstratum = -1;
574 static int hf_ptp_mm_update_default_data_set_clockidentifier = -1;
575 static int hf_ptp_mm_update_default_data_set_clockvariance = -1;
576 static int hf_ptp_mm_update_default_data_set_preferred = -1;
577 static int hf_ptp_mm_update_default_data_set_syncinterval = -1;
578 static int hf_ptp_mm_update_default_data_set_subdomainname = -1;
580 /*ptp_mm_current_data_set (parameterlength = 20)*/
581 static int hf_ptp_mm_current_data_set_stepsremoved = -1;
582 static int hf_ptp_mm_current_data_set_offsetfrommaster = -1;
583 static int hf_ptp_mm_current_data_set_offsetfrommasterseconds = -1;
584 static int hf_ptp_mm_current_data_set_offsetfrommasternanoseconds = -1;
585 static int hf_ptp_mm_current_data_set_onewaydelay = -1;
586 static int hf_ptp_mm_current_data_set_onewaydelayseconds = -1;
587 static int hf_ptp_mm_current_data_set_onewaydelaynanoseconds = -1;
589 /*ptp_mm_parent_data_set (parameterlength = 90)*/
590 static int hf_ptp_mm_parent_data_set_parentcommunicationtechnology = -1;
591 static int hf_ptp_mm_parent_data_set_parentuuid = -1;
592 static int hf_ptp_mm_parent_data_set_parentportid = -1;
593 static int hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber = -1;
594 static int hf_ptp_mm_parent_data_set_parentfollowupcapable = -1;
595 static int hf_ptp_mm_parent_data_set_parentexternaltiming = -1;
596 static int hf_ptp_mm_parent_data_set_parentvariance = -1;
597 static int hf_ptp_mm_parent_data_set_parentstats = -1;
598 static int hf_ptp_mm_parent_data_set_observedvariance = -1;
599 static int hf_ptp_mm_parent_data_set_observeddrift = -1;
600 static int hf_ptp_mm_parent_data_set_utcreasonable = -1;
601 static int hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology = -1;
602 static int hf_ptp_mm_parent_data_set_grandmasteruuidfield = -1;
603 static int hf_ptp_mm_parent_data_set_grandmasterportidfield = -1;
604 static int hf_ptp_mm_parent_data_set_grandmasterstratum = -1;
605 static int hf_ptp_mm_parent_data_set_grandmasteridentifier = -1;
606 static int hf_ptp_mm_parent_data_set_grandmastervariance = -1;
607 static int hf_ptp_mm_parent_data_set_grandmasterpreferred = -1;
608 static int hf_ptp_mm_parent_data_set_grandmasterisboundaryclock = -1;
609 static int hf_ptp_mm_parent_data_set_grandmastersequencenumber = -1;
611 /*ptp_mm_port_data_set (parameterlength = 52)*/
612 static int hf_ptp_mm_port_data_set_returnedportnumber = -1;
613 static int hf_ptp_mm_port_data_set_portstate = -1;
614 static int hf_ptp_mm_port_data_set_lastsynceventsequencenumber = -1;
615 static int hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber = -1;
616 static int hf_ptp_mm_port_data_set_portcommunicationtechnology = -1;
617 static int hf_ptp_mm_port_data_set_portuuidfield = -1;
618 static int hf_ptp_mm_port_data_set_portidfield = -1;
619 static int hf_ptp_mm_port_data_set_burstenabled = -1;
620 static int hf_ptp_mm_port_data_set_subdomainaddressoctets = -1;
621 static int hf_ptp_mm_port_data_set_eventportaddressoctets = -1;
622 static int hf_ptp_mm_port_data_set_generalportaddressoctets = -1;
623 static int hf_ptp_mm_port_data_set_subdomainaddress = -1;
624 static int hf_ptp_mm_port_data_set_eventportaddress = -1;
625 static int hf_ptp_mm_port_data_set_generalportaddress = -1;
627 /*ptp_mm_global_time_data_set (parameterlength = 24)*/
628 static int hf_ptp_mm_global_time_data_set_localtime = -1;
629 static int hf_ptp_mm_global_time_data_set_localtimeseconds = -1;
630 static int hf_ptp_mm_global_time_data_set_localtimenanoseconds = -1;
631 static int hf_ptp_mm_global_time_data_set_currentutcoffset = -1;
632 static int hf_ptp_mm_global_time_data_set_leap59 = -1;
633 static int hf_ptp_mm_global_time_data_set_leap61 = -1;
634 static int hf_ptp_mm_global_time_data_set_epochnumber = -1;
636 /*ptp_mm_update_global_time_properties (parameterlength = 16)*/
637 static int hf_ptp_mm_update_global_time_properties_currentutcoffset = -1;
638 static int hf_ptp_mm_update_global_time_properties_leap59 = -1;
639 static int hf_ptp_mm_update_global_time_properties_leap61 = -1;
640 static int hf_ptp_mm_update_global_time_properties_epochnumber = -1;
642 /*ptp_mm_get_foreign_data_set (parameterlength = 4)*/
643 static int hf_ptp_mm_get_foreign_data_set_recordkey = -1;
645 /*ptp_mm_foreign_data_set (parameterlength = 28)*/
646 static int hf_ptp_mm_foreign_data_set_returnedportnumber = -1;
647 static int hf_ptp_mm_foreign_data_set_returnedrecordnumber = -1;
648 static int hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology = -1;
649 static int hf_ptp_mm_foreign_data_set_foreignmasteruuidfield = -1;
650 static int hf_ptp_mm_foreign_data_set_foreignmasterportidfield = -1;
651 static int hf_ptp_mm_foreign_data_set_foreignmastersyncs = -1;
653 /*ptp_mm_set_sync_interval (parameterlength = 4)*/
654 static int hf_ptp_mm_set_sync_interval_syncinterval = -1;
656 /*ptp_mm_set_time (parameterlength = 8)*/
657 static int hf_ptp_mm_set_time_localtime = -1;
658 static int hf_ptp_mm_set_time_localtimeseconds = -1;
659 static int hf_ptp_mm_set_time_localtimenanoseconds = -1;
661 /*END Initialize the protocol and registered fields */
663 /* Initialize the subtree pointers */
664 static gint ett_ptp = -1;
665 static gint ett_ptp_flags = -1;
666 static gint ett_ptp_time = -1;
667 static gint ett_ptp_time2 = -1;
669 /* END Definitions and fields for PTPv1 dissection. */
675 /***********************************************************************************/
676 /* Definitions and fields for PTPv2 dissection. */
677 /***********************************************************************************/
680 /**********************************************************/
681 /* Offsets of fields within a PTPv2 packet. */
682 /**********************************************************/
684 /*Common offsets for all Messages (Sync, Delay_Req, Follow_Up, Delay_Resp ....)*/
685 #define PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET 0
686 #define PTP_V2_VERSIONPTP_OFFSET 1
687 #define PTP_V2_MESSAGE_LENGTH_OFFSET 2
688 #define PTP_V2_DOMAIN_NUMBER_OFFSET 4
689 #define PTP_V2_FLAGS_OFFSET 6
690 #define PTP_V2_CORRECTION_OFFSET 8
691 #define PTP_V2_CORRECTIONNS_OFFSET 8
692 #define PTP_V2_CORRECTIONSUBNS_OFFSET 14
693 #define PTP_V2_CLOCKIDENTITY_OFFSET 20
694 #define PTP_V2_SOURCEPORTID_OFFSET 28
695 #define PTP_V2_SEQUENCEID_OFFSET 30
696 #define PTP_V2_CONTROL_OFFSET 32
697 #define PTP_V2_LOGMESSAGEPERIOD_OFFSET 33
700 /*Offsets for PTP_Announce (=AN) messages*/
701 #define PTP_V2_AN_ORIGINTIMESTAMP_OFFSET 34
702 #define PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET 34
703 #define PTP_V2_AN_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
704 #define PTP_V2_AN_ORIGINCURRENTUTCOFFSET_OFFSET 44
705 #define PTP_V2_AN_PRIORITY_1_OFFSET 47
706 #define PTP_V2_AN_GRANDMASTERCLOCKCLASS_OFFSET 48
707 #define PTP_V2_AN_GRANDMASTERCLOCKACCURACY_OFFSET 49
708 #define PTP_V2_AN_GRANDMASTERCLOCKVARIANCE_OFFSET 50
709 #define PTP_V2_AN_PRIORITY_2_OFFSET 52
710 #define PTP_V2_AN_GRANDMASTERCLOCKIDENTITY_OFFSET 53
711 #define PTP_V2_AN_LOCALSTEPSREMOVED_OFFSET 61
712 #define PTP_V2_AN_TIMESOURCE_OFFSET 63
713 #define PTP_V2_AN_TLV_OFFSET 64
714 /* Announce TLV field offsets */
715 #define PTP_V2_AN_TLV_TYPE_OFFSET 0
716 #define PTP_V2_AN_TLV_LENGTHFIELD_OFFSET 2
717 /* PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR field offsets */
718 #define PTP_V2_AN_TLV_ATOI_KEYFIELD_OFFSET 4
719 #define PTP_V2_AN_TLV_ATOI_CURRENTOFFSET_OFFSET 5
720 #define PTP_V2_AN_TLV_ATOI_JUMPSECONDS_OFFSET 9
721 #define PTP_V2_AN_TLV_ATOI_TIMEOFNEXTJUMP_OFFSET 13
722 #define PTP_V2_AN_TLV_ATOI_DISPLAYNAME_OFFSET 19
723 /* Undissected TLV field offset */
724 #define PTP_V2_AN_TLV_DATA_OFFSET 4
726 /*Offsets for PTP_Sync AND PTP_DelayRequest (=SDR) messages*/
727 #define PTP_V2_SDR_ORIGINTIMESTAMP_OFFSET 34
728 #define PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET 34
729 #define PTP_V2_SDR_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
732 /*Offsets for PTP_Follow_Up (=FU) messages*/
733 #define PTP_V2_FU_PRECISEORIGINTIMESTAMP_OFFSET 34
734 #define PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET 34
735 #define PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET 40
737 /*Offsets for PTP_DelayResponse (=DR) messages*/
738 #define PTP_V2_DR_RECEIVETIMESTAMP_OFFSET 34
739 #define PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET 34
740 #define PTP_V2_DR_RECEIVETIMESTAMPNANOSECONDS_OFFSET 40
741 #define PTP_V2_DR_REQUESTINGPORTIDENTITY_OFFSET 44
742 #define PTP_V2_DR_REQUESTINGSOURCEPORTID_OFFSET 52
745 /*Offsets for PTP_PDelayRequest (=PDRQ) messages*/
746 #define PTP_V2_PDRQ_ORIGINTIMESTAMP_OFFSET 34
747 #define PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET 34
748 #define PTP_V2_PDRQ_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
749 #define PTP_V2_PDRQ_RESERVED_OFFSET 44
752 /*Offsets for PTP_PDelayResponse (=PDRS) messages*/
753 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMP_OFFSET 34
754 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET 34
755 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPNANOSECONDS_OFFSET 40
756 #define PTP_V2_PDRS_REQUESTINGPORTIDENTITY_OFFSET 44 /* ++ */
757 #define PTP_V2_PDRS_REQUESTINGSOURCEPORTID_OFFSET 52 /* ++ */
760 /*Offsets for PTP_PDelayResponseFollowUp (=PDFU) messages*/
761 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMP_OFFSET 34
762 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET 34
763 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPNANOSECONDS_OFFSET 40
764 #define PTP_V2_PDFU_REQUESTINGPORTIDENTITY_OFFSET 44 /* ++ */
765 #define PTP_V2_PDFU_REQUESTINGSOURCEPORTID_OFFSET 52
768 /*Offsets for PTP_Signalling (=SIG) messages*/
769 #define PTP_V2_SIG_TARGETPORTIDENTITY_OFFSET 34
770 #define PTP_V2_SIG_TARGETPORTID_OFFSET 42
773 /*Offsets for PTP_V2_Management (=MM) messages*/
774 #define PTP_V2_MM_TARGETPORTIDENTITY_OFFSET 34
775 #define PTP_V2_MM_TARGETPORTID_OFFSET 42
776 #define PTP_V2_MM_STARTINGBOUNDARYHOPS_OFFSET 44
777 #define PTP_V2_MM_BOUNDARYHOPS_OFFSET 45
778 #define PTP_V2_MM_ACTION_OFFSET 46
779 #define PTP_V2_MM_RESERVED_OFFSET 47
781 #define PTP_V2_MM_MANAGEMENTTLV_OFFSET 48
783 #define PTP_V2_MM_TLV_TYPE_OFFSET 48
784 #define PTP_V2_MM_TLV_LENGTHFIELD_OFFSET 50
785 #define PTP_V2_MM_TLV_MANAGEMENTID_OFFSET 52
786 #define PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET 52
787 #define PTP_V2_MM_TLV_DATAFIELD_OFFSET 54
790 #define PTP_V2_TLV_TYPE_RESERVED 0x0000
791 #define PTP_V2_TLV_TYPE_MANAGEMENT 0x0001
792 #define PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS 0x0002
793 #define PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION 0x0003
794 #define PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION 0x0004
795 #define PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION 0x0005
796 #define PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION 0x0006
797 #define PTP_V2_TLV_TYPE_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION 0x0007
798 #define PTP_V2_TLV_TYPE_PATH_TRACE 0x0008
799 #define PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR 0x0009
800 #define PTP_V2_TLV_TYPE_AUTHENTICATION 0x2000
801 #define PTP_V2_TLV_TYPE_AUTHENTICATION_CHALLENGE 0x2001
802 #define PTP_V2_TLV_TYPE_SECURITY_ASSOCIATION_UPDATE 0x2002
803 #define PTP_V2_TLV_TYPE_CUM_FREQ_SCALE_FACTOR_OFFSET 0x2003
805 /* PTPv2 Management clockType Boolean[16] Bits mask */
806 #define CLOCKTYPE_ORDINARY_CLOCK 0x8000
807 #define CLOCKTYPE_BOUNDARY_CLOCK 0x4000
808 #define CLOCKTYPE_P2P_TC 0x2000
809 #define CLOCKTYPE_E2E_TC 0x1000
810 #define CLOCKTYPE_MANAGEMENT_NODE 0x0800
811 #define CLOCKTYPE_RESERVED 0x07FF
813 /* PTPv2 Management IDs */
814 #define PTP_V2_MM_ID_NULL_MANAGEMENT 0x0000
815 #define PTP_V2_MM_ID_CLOCK_DESCRIPTION 0x0001
816 #define PTP_V2_MM_ID_USER_DESCRIPTION 0x0002
817 #define PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE 0x0003
818 #define PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE 0x0004
819 #define PTP_V2_MM_ID_INITIALIZE 0x0005
820 #define PTP_V2_MM_ID_FAULT_LOG 0x0006
821 #define PTP_V2_MM_ID_FAULT_LOG_RESET 0x0007
822 #define PTP_V2_MM_ID_DEFAULT_DATA_SET 0x2000
823 #define PTP_V2_MM_ID_CURRENT_DATA_SET 0x2001
824 #define PTP_V2_MM_ID_PARENT_DATA_SET 0x2002
825 #define PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET 0x2003
826 #define PTP_V2_MM_ID_PORT_DATA_SET 0x2004
827 #define PTP_V2_MM_ID_PRIORITY1 0x2005
828 #define PTP_V2_MM_ID_PRIORITY2 0x2006
829 #define PTP_V2_MM_ID_DOMAIN 0x2007
830 #define PTP_V2_MM_ID_SLAVE_ONLY 0x2008
831 #define PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL 0x2009
832 #define PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT 0x200A
833 #define PTP_V2_MM_ID_LOG_SYNC_INTERVAL 0x200B
834 #define PTP_V2_MM_ID_VERSION_NUMBER 0x200C
835 #define PTP_V2_MM_ID_ENABLE_PORT 0x200D
836 #define PTP_V2_MM_ID_DISABLE_PORT 0x200E
837 #define PTP_V2_MM_ID_TIME 0x200F
838 #define PTP_V2_MM_ID_CLOCK_ACCURACY 0x2010
839 #define PTP_V2_MM_ID_UTC_PROPERTIES 0x2011
840 #define PTP_V2_MM_ID_TRACEABILITY_PROPERTIES 0x2012
841 #define PTP_V2_MM_ID_TIMESCALE_PROPERTIES 0x2013
842 #define PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE 0x2014
843 #define PTP_V2_MM_ID_PATH_TRACE_LIST 0x2015
844 #define PTP_V2_MM_ID_PATH_TRACE_ENABLE 0x2016
845 #define PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE 0x2017
846 #define PTP_V2_MM_ID_UNICAST_MASTER_TABLE 0x2018
847 #define PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE 0x2019
848 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE 0x201A
849 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED 0x201B
850 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE 0x201C
851 #define PTP_V2_MM_ID_ALTERNATE_MASTER 0x201D
852 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE 0x201E
853 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME 0x201F
854 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY 0x2020
855 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES 0x2021
856 #define PTP_V2_MM_ID_TC_DEFAULT_DATA_SET 0x4000
857 #define PTP_V2_MM_ID_TC_PORT_DATA_SET 0x4001
858 #define PTP_V2_MM_ID_PRIMARY_DOMAIN 0x4002
859 #define PTP_V2_MM_ID_DELAY_MECHANISM 0x6000
860 #define PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL 0x6001
862 /* Management DataField for DefaultDS */
863 #define PTP_V2_MM_RESERVED1 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 1
864 #define PTP_V2_MM_NUMBERPORTS PTP_V2_MM_TLV_DATAFIELD_OFFSET + 2
865 #define PTP_V2_MM_PRIORITY1 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 4
866 #define PTP_V2_MM_CLOCKQUALITY PTP_V2_MM_TLV_DATAFIELD_OFFSET + 5
867 #define PTP_V2_MM_PRIORITY2 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 9
868 #define PTP_V2_MM_CLOCKIDENTITY PTP_V2_MM_TLV_DATAFIELD_OFFSET + 10
869 #define PTP_V2_MM_DOMAINNUMBER PTP_V2_MM_TLV_DATAFIELD_OFFSET + 18
870 #define PTP_V2_MM_RESERVED2 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 19
872 #define PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK 0x10
876 /**********************************************************/
877 /* flag-field-mask-definitions */
878 /**********************************************************/
879 #define PTP_V2_FLAGS_LI61_BITMASK 0x0001
880 #define PTP_V2_FLAGS_LI59_BITMASK 0x0002
881 #define PTP_V2_FLAGS_UTC_OFFSET_VALID_BITMASK 0x0004
882 #define PTP_V2_FLAGS_PTP_TIMESCALE_BITMASK 0x0008
883 #define PTP_V2_FLAGS_TIME_TRACEABLE_BITMASK 0x0010
884 #define PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK 0x0020
885 #define PTP_V2_FLAGS_ALTERNATE_BITMASK 0x0100
886 #define PTP_V2_FLAGS_TWO_STEP_BITMASK 0x0200
887 #define PTP_V2_FLAGS_UNICAST_BITMASK 0x0400
888 #define PTP_V2_FLAGS_SPECIFIC1_BITMASK 0x2000
889 #define PTP_V2_FLAGS_SPECIFIC2_BITMASK 0x4000
890 #define PTP_V2_FLAGS_SECURITY_BITMASK 0x8000
894 /**********************************************************/
895 /* PTP v2 message ids (ptp messageid field) */
896 /**********************************************************/
897 #define PTP_V2_SYNC_MESSAGE 0x00
898 #define PTP_V2_DELAY_REQ_MESSAGE 0x01
899 #define PTP_V2_PATH_DELAY_REQ_MESSAGE 0x02
900 #define PTP_V2_PATH_DELAY_RESP_MESSAGE 0x03
901 #define PTP_V2_FOLLOWUP_MESSAGE 0x08
902 #define PTP_V2_DELAY_RESP_MESSAGE 0x09
903 #define PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE 0x0A
904 #define PTP_V2_ANNOUNCE_MESSAGE 0x0B
905 #define PTP_V2_SIGNALLING_MESSAGE 0x0C
906 #define PTP_V2_MANAGEMENT_MESSAGE 0x0D
909 static const value_string ptp_v2_managementID_vals[] = {
910 {PTP_V2_MM_ID_NULL_MANAGEMENT ,"NULL_MANAGEMENT"},
911 {PTP_V2_MM_ID_CLOCK_DESCRIPTION ,"CLOCK_DESCRIPTION"},
912 {PTP_V2_MM_ID_USER_DESCRIPTION ,"USER_DESCRIPTION"},
913 {PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE ,"SAVE_IN_NON_VOLATILE_STORAGE"},
914 {PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE ,"RESET_NON_VOLATILE_STORAGE"},
915 {PTP_V2_MM_ID_INITIALIZE ,"INITIALIZE"},
916 {PTP_V2_MM_ID_FAULT_LOG ,"FAULT_LOG"},
917 {PTP_V2_MM_ID_FAULT_LOG_RESET ,"FAULT_LOG_RESET"},
918 {PTP_V2_MM_ID_DEFAULT_DATA_SET ,"DEFAULT_DATA_SET"},
919 {PTP_V2_MM_ID_CURRENT_DATA_SET ,"CURRENT_DATA_SET"},
920 {PTP_V2_MM_ID_PARENT_DATA_SET ,"PARENT_DATA_SET"},
921 {PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET ,"TIME_PROPERTIES_DATA_SET"},
922 {PTP_V2_MM_ID_PORT_DATA_SET ,"PORT_DATA_SET"},
923 {PTP_V2_MM_ID_PRIORITY1 ,"PRIORITY1"},
924 {PTP_V2_MM_ID_PRIORITY2 ,"PRIORITY2"},
925 {PTP_V2_MM_ID_DOMAIN ,"DOMAIN"},
926 {PTP_V2_MM_ID_SLAVE_ONLY ,"SLAVE_ONLY"},
927 {PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL ,"LOG_ANNOUNCE_INTERVAL"},
928 {PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT ,"ANNOUNCE_RECEIPT_TIMEOUT"},
929 {PTP_V2_MM_ID_LOG_SYNC_INTERVAL ,"LOG_SYNC_INTERVAL"},
930 {PTP_V2_MM_ID_VERSION_NUMBER ,"VERSION_NUMBER"},
931 {PTP_V2_MM_ID_ENABLE_PORT ,"ENABLE_PORT"},
932 {PTP_V2_MM_ID_DISABLE_PORT ,"DISABLE_PORT"},
933 {PTP_V2_MM_ID_TIME ,"TIME"},
934 {PTP_V2_MM_ID_CLOCK_ACCURACY ,"CLOCK_ACCURACY"},
935 {PTP_V2_MM_ID_UTC_PROPERTIES ,"UTC_PROPERTIES"},
936 {PTP_V2_MM_ID_TRACEABILITY_PROPERTIES ,"TRACEABILITY_PROPERTIES"},
937 {PTP_V2_MM_ID_TIMESCALE_PROPERTIES ,"TIMESCALE_PROPERTIES"},
938 {PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE ,"UNICAST_NEGOTIATION_ENABLE"},
939 {PTP_V2_MM_ID_PATH_TRACE_LIST ,"PATH_TRACE_LIST"},
940 {PTP_V2_MM_ID_PATH_TRACE_ENABLE ,"PATH_TRACE_ENABLE"},
941 {PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE ,"GRANDMASTER_CLUSTER_TABLE"},
942 {PTP_V2_MM_ID_UNICAST_MASTER_TABLE ,"UNICAST_MASTER_TABLE"},
943 {PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE ,"UNICAST_MASTER_MAX_TABLE_SIZE"},
944 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE ,"ACCEPTABLE_MASTER_TABLE"},
945 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED ,"ACCEPTABLE_MASTER_TABLE_ENABLED"},
946 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE ,"ACCEPTABLE_MASTER_MAX_TABLE_SIZE"},
947 {PTP_V2_MM_ID_ALTERNATE_MASTER ,"ALTERNATE_MASTER"},
948 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE ,"ALTERNATE_TIME_OFFSET_ENABLE"},
949 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME ,"ALTERNATE_TIME_OFFSET_NAME"},
950 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY ,"ALTERNATE_TIME_OFFSET_MAX_KEY"},
951 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES ,"ALTERNATE_TIME_OFFSET_PROPERTIES"},
952 {PTP_V2_MM_ID_TC_DEFAULT_DATA_SET ,"TC_DEFAULT_DATA_SET"},
953 {PTP_V2_MM_ID_TC_PORT_DATA_SET ,"TC_PORT_DATA_SET"},
954 {PTP_V2_MM_ID_PRIMARY_DOMAIN ,"PRIMARY_DOMAIN"},
955 {PTP_V2_MM_ID_DELAY_MECHANISM ,"DELAY_MECHANISM"},
956 {PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL ,"LOG_MIN_PDELAY_REQ_INTERVAL"},
959 /*same again but better readable text for info column*/
960 static const value_string ptp_v2_managementID_infocolumn_vals[] = {
961 {PTP_V2_MM_ID_NULL_MANAGEMENT ,"Null management"},
962 {PTP_V2_MM_ID_CLOCK_DESCRIPTION ,"Clock description"},
963 {PTP_V2_MM_ID_USER_DESCRIPTION ,"User description"},
964 {PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE ,"Save in non volatile storage"},
965 {PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE ,"Reset non volatile storage"},
966 {PTP_V2_MM_ID_INITIALIZE ,"Initialize"},
967 {PTP_V2_MM_ID_FAULT_LOG ,"Fault log"},
968 {PTP_V2_MM_ID_FAULT_LOG_RESET ,"Fault log reset"},
969 {PTP_V2_MM_ID_DEFAULT_DATA_SET ,"Default dataset"},
970 {PTP_V2_MM_ID_CURRENT_DATA_SET ,"Current dataset"},
971 {PTP_V2_MM_ID_PARENT_DATA_SET ,"Parent dataset"},
972 {PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET ,"Time properties dataset"},
973 {PTP_V2_MM_ID_PORT_DATA_SET ,"Port dataset"},
974 {PTP_V2_MM_ID_PRIORITY1 ,"Priority 1"},
975 {PTP_V2_MM_ID_PRIORITY2 ,"Priority 2"},
976 {PTP_V2_MM_ID_DOMAIN ,"Domain"},
977 {PTP_V2_MM_ID_SLAVE_ONLY ,"Slave only"},
978 {PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL ,"Log announce interval"},
979 {PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT ,"Announce receipt timeout"},
980 {PTP_V2_MM_ID_LOG_SYNC_INTERVAL ,"Log sync interval"},
981 {PTP_V2_MM_ID_VERSION_NUMBER ,"Version number"},
982 {PTP_V2_MM_ID_ENABLE_PORT ,"Enable port"},
983 {PTP_V2_MM_ID_DISABLE_PORT ,"Disable port"},
984 {PTP_V2_MM_ID_TIME ,"Time"},
985 {PTP_V2_MM_ID_CLOCK_ACCURACY ,"Clock accuracy"},
986 {PTP_V2_MM_ID_UTC_PROPERTIES ,"UTC properties"},
987 {PTP_V2_MM_ID_TRACEABILITY_PROPERTIES ,"Traceability properties"},
988 {PTP_V2_MM_ID_TIMESCALE_PROPERTIES ,"Timescale properties"},
989 {PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE ,"Unicast negotiation enable"},
990 {PTP_V2_MM_ID_PATH_TRACE_LIST ,"Path trace list"},
991 {PTP_V2_MM_ID_PATH_TRACE_ENABLE ,"Path trace enable"},
992 {PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE ,"Grandmaster cluster table"},
993 {PTP_V2_MM_ID_UNICAST_MASTER_TABLE ,"Unicast master table"},
994 {PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE ,"Unicast master max table size"},
995 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE ,"Acceptable master table"},
996 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED ,"Acceptable master table enabled"},
997 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE ,"Acceptable master max table size"},
998 {PTP_V2_MM_ID_ALTERNATE_MASTER ,"Alternate master"},
999 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE ,"Alternate time offset enable"},
1000 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME ,"Alternate time offset name"},
1001 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY ,"Alternate time offset max key"},
1002 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES ,"Alternate time offset properties"},
1003 {PTP_V2_MM_ID_TC_DEFAULT_DATA_SET ,"Transparent clock default dataset"},
1004 {PTP_V2_MM_ID_TC_PORT_DATA_SET ,"Transparent clock port dataset"},
1005 {PTP_V2_MM_ID_PRIMARY_DOMAIN ,"Primary domain"},
1006 {PTP_V2_MM_ID_DELAY_MECHANISM ,"Delay mechanism"},
1007 {PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL ,"Log min pdelay req. interval"},
1010 static const value_string ptp_v2_TLV_type_vals[] = {
1011 {PTP_V2_TLV_TYPE_RESERVED ,"Reserved"},
1012 {PTP_V2_TLV_TYPE_MANAGEMENT ,"Management"},
1013 {PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS ,"Management error status"},
1014 {PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION ,"Organization extension"},
1015 {PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION ,"Request unicast transmission"},
1016 {PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION ,"Grant unicast transmission"},
1017 {PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION ,"Cancel unicast transmission"},
1018 {PTP_V2_TLV_TYPE_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION ,"Acknowledge cancel unicast transmission"},
1019 {PTP_V2_TLV_TYPE_PATH_TRACE ,"Path trace"},
1020 {PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR,"Alternate time offset indicator"},
1021 {PTP_V2_TLV_TYPE_AUTHENTICATION ,"Authentication"},
1022 {PTP_V2_TLV_TYPE_AUTHENTICATION_CHALLENGE ,"Authentication challenge"},
1023 {PTP_V2_TLV_TYPE_SECURITY_ASSOCIATION_UPDATE ,"Security association update"},
1024 {PTP_V2_TLV_TYPE_CUM_FREQ_SCALE_FACTOR_OFFSET ,"Cum. freq. scale factor offset"},
1028 static const value_string ptp2_networkProtocol_vals[] = {
1029 {0x0000, "Reserved"},
1030 {0x0001, "UDP/IPv4"},
1031 {0x0002, "UDP/IPv6"},
1032 {0x0003, "IEEE 802.3"},
1033 {0x0004, "DeviceNet"},
1034 {0x0005, "ControlNet"},
1035 {0x0006, "PROFINET"},
1036 {0x0007, "Reserved"},
1037 {0xFFFE, "Unknown Protocol"},
1038 {0xFFFF, "Reserved"},
1042 static const value_string ptp_v2_messageid_vals[] = {
1043 {PTP_V2_SYNC_MESSAGE, "Sync Message"},
1044 {PTP_V2_DELAY_REQ_MESSAGE, "Delay_Req Message"},
1045 {PTP_V2_PATH_DELAY_REQ_MESSAGE, "Path_Delay_Req Message"},
1046 {PTP_V2_PATH_DELAY_RESP_MESSAGE, "Path_Delay_Resp Message"},
1047 {PTP_V2_FOLLOWUP_MESSAGE, "Follow_Up Message"},
1048 {PTP_V2_DELAY_RESP_MESSAGE, "Delay_Resp Message"},
1049 {PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE,"Path_Delay_Resp_Follow_Up Message"},
1050 {PTP_V2_ANNOUNCE_MESSAGE, "Announce Message"},
1051 {PTP_V2_SIGNALLING_MESSAGE, "Signalling Message"},
1052 {PTP_V2_MANAGEMENT_MESSAGE, "Management Message"},
1056 static const value_string ptp_v2_clockaccuracy_vals[] = {
1057 {0x20, "The time is accurate to within 25 ns"},
1058 {0x21, "The time is accurate to within 100 ns"},
1059 {0x22, "The time is accurate to within 250 ns"},
1060 {0x23, "The time is accurate to within 1 us"},
1061 {0x24, "The time is accurate to within 2,5 us"},
1062 {0x25, "The time is accurate to within 10 us"},
1063 {0x26, "The time is accurate to within 25 us"},
1064 {0x27, "The time is accurate to within 100 us"},
1065 {0x28, "The time is accurate to within 250 us"},
1066 {0x29, "The time is accurate to within 1 ms"},
1067 {0x2A, "The time is accurate to within 2,5 ms"},
1068 {0x2B, "The time is accurate to within 10 ms"},
1069 {0x2C, "The time is accurate to within 25 ms"},
1070 {0x2D, "The time is accurate to within 100 ms"},
1071 {0x2E, "The time is accurate to within 250 ms"},
1072 {0x2F, "The time is accurate to within 1 s"},
1073 {0x30, "The time is accurate to within 10 s"},
1074 {0x31, "The time is accurate to >10 s"},
1076 {0x80, "For use by alternate PTP profiles"},
1077 {0xFE, "Accuracy Unknown"},
1082 static const value_string ptp_v2_timesource_vals[] = {
1083 {0x10, "ATOMIC_CLOCK"},
1085 {0x30, "TERRESTRIAL_RADIO"},
1090 {0xA0, "INTERNAL_OSCILLATOR"},
1095 static const value_string ptp_v2_mm_action_vals[] = {
1100 {0x4, "ACKNOWLEDGE"},
1104 static const value_string ptp2_severityCode_vals[] = {
1105 {0x00, "Emergency: system is unusable"},
1106 {0x01, "Alert: immediate action needed"},
1107 {0x02, "Critical: critical conditions"},
1108 {0x03, "Error: error conditions"},
1109 {0x04, "Warning: warning conditions"},
1110 {0x05, "Notice: normal but significant condition"},
1111 {0x06, "Informational: informational messages"},
1112 {0x07, "Debug: debug-level messages"},
1118 static const value_string ptp2_portState_vals[] = {
1119 {0x01, "INITIALIZING"},
1122 {0x04, "LISTENING"},
1123 {0x05, "PRE_MASTER"},
1126 {0x08, "UNCALIBRATED"},
1131 static const value_string ptp2_delayMechanism_vals[] = {
1138 static const value_string ptp2_managementErrorId_vals[] = {
1139 {0x0000, "Reserved"},
1140 {0x0001, "RESPONSE_TOO_BIG"},
1141 {0x0002, "NO_SUCH_ID"},
1142 {0x0003, "WRONG_LENGTH"},
1143 {0x0004, "WRONG_VALUE"},
1144 {0x0005, "NOT_SETABLE"},
1145 {0x0006, "NOT_SUPPORTED"},
1146 {0x0007, "Reserved"},
1147 {0xFFFE, "GENERAL_ERROR"},
1148 {0xFFFF, "Reserved"},
1152 /**********************************************************/
1153 /* Initialize the protocol and registered fields */
1154 /**********************************************************/
1156 static int hf_ptp_v2_transportspecific = -1;
1157 static int hf_ptp_v2_transportspecific_v1_compatibility = -1; /* over UDP */
1158 static int hf_ptp_v2_transportspecific_802as_conform = -1; /* over Ethernet */
1159 static int hf_ptp_v2_messageid = -1;
1160 static int hf_ptp_v2_versionptp = -1;
1161 static int hf_ptp_v2_messagelength = -1;
1162 static int hf_ptp_v2_domainnumber = -1;
1163 static int hf_ptp_v2_flags = -1;
1164 static int hf_ptp_v2_flags_alternatemaster = -1;
1165 static int hf_ptp_v2_flags_twostep = -1;
1166 static int hf_ptp_v2_flags_unicast = -1;
1167 static int hf_ptp_v2_flags_specific1 = -1;
1168 static int hf_ptp_v2_flags_specific2 = -1;
1169 static int hf_ptp_v2_flags_security = -1;
1170 static int hf_ptp_v2_flags_li61 = -1;
1171 static int hf_ptp_v2_flags_li59 = -1;
1172 static int hf_ptp_v2_flags_utcoffsetvalid = -1;
1173 static int hf_ptp_v2_flags_ptptimescale = -1;
1174 static int hf_ptp_v2_flags_timetraceable = -1;
1175 static int hf_ptp_v2_flags_frequencytraceable = -1;
1176 static int hf_ptp_v2_correction = -1;
1177 static int hf_ptp_v2_correctionsubns = -1;
1178 static int hf_ptp_v2_clockidentity = -1;
1179 static int hf_ptp_v2_sourceportid = -1;
1180 static int hf_ptp_v2_sequenceid = -1;
1181 static int hf_ptp_v2_control = -1;
1182 static int hf_ptp_v2_logmessageperiod = -1;
1185 /*Fields for PTP_Announce (=an) messages*/
1186 static int hf_ptp_v2_an_origintimestamp = -1; /*Field for seconds & nanoseconds*/
1187 static int hf_ptp_v2_an_origintimestamp_seconds = -1;
1188 static int hf_ptp_v2_an_origintimestamp_nanoseconds = -1;
1189 static int hf_ptp_v2_an_origincurrentutcoffset = -1;
1190 static int hf_ptp_v2_an_timesource = -1;
1191 static int hf_ptp_v2_an_localstepsremoved = -1;
1192 static int hf_ptp_v2_an_grandmasterclockidentity = -1;
1193 static int hf_ptp_v2_an_grandmasterclockclass = -1;
1194 static int hf_ptp_v2_an_grandmasterclockaccuracy = -1;
1195 static int hf_ptp_v2_an_grandmasterclockvariance = -1;
1196 static int hf_ptp_v2_an_priority1 = -1;
1197 static int hf_ptp_v2_an_priority2 = -1;
1199 /* Fields for PTP_Announce TLVs */
1200 static int hf_ptp_v2_an_tlv_tlvtype = -1;
1201 static int hf_ptp_v2_an_tlv_lengthfield = -1;
1202 /* Fields for the ALTERNATE_TIME_OFFSET_INDICATOR TLV */
1203 static int hf_ptp_v2_atoi_tlv_keyfield = -1;
1204 static int hf_ptp_v2_atoi_tlv_currentoffset = -1;
1205 static int hf_ptp_v2_atoi_tlv_jumpseconds = -1;
1206 static int hf_ptp_v2_atoi_tlv_timeofnextjump = -1;
1207 static int hf_ptp_v2_atoi_tlv_displayname = -1;
1208 static int hf_ptp_v2_atoi_tlv_displayname_length = -1;
1210 /* Fields for an undissected TLV */
1211 static int hf_ptp_v2_an_tlv_data = -1;
1213 /*Fields for PTP_Sync AND PTP_DelayRequest (=sdr) messages*/
1214 static int hf_ptp_v2_sdr_origintimestamp = -1; /*Field for seconds & nanoseconds*/
1215 static int hf_ptp_v2_sdr_origintimestamp_seconds = -1;
1216 static int hf_ptp_v2_sdr_origintimestamp_nanoseconds = -1;
1219 /*Fields for PTP_Follow_Up (=fu) messages*/
1220 static int hf_ptp_v2_fu_preciseorigintimestamp = -1; /*Field for seconds & nanoseconds*/
1221 static int hf_ptp_v2_fu_preciseorigintimestamp_seconds = -1;
1222 static int hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds = -1;
1225 /*Fields for PTP_DelayResponse (=dr) messages*/
1226 static int hf_ptp_v2_dr_receivetimestamp = -1; /*Field for seconds & nanoseconds*/
1227 static int hf_ptp_v2_dr_receivetimestamp_seconds = -1;
1228 static int hf_ptp_v2_dr_receivetimestamp_nanoseconds = -1;
1229 static int hf_ptp_v2_dr_requestingportidentity = -1;
1230 static int hf_ptp_v2_dr_requestingsourceportid = -1;
1233 /*Fields for PTP_PDelayRequest (=pdrq) messages*/
1234 static int hf_ptp_v2_pdrq_origintimestamp = -1; /*Field for seconds & nanoseconds*/
1235 static int hf_ptp_v2_pdrq_origintimestamp_seconds = -1;
1236 static int hf_ptp_v2_pdrq_origintimestamp_nanoseconds = -1;
1239 /*Fields for PTP_PDelayResponse (=pdrs) messages*/
1240 static int hf_ptp_v2_pdrs_requestreceipttimestamp = -1; /*Field for seconds & nanoseconds*/
1241 static int hf_ptp_v2_pdrs_requestreceipttimestamp_seconds = -1;
1242 static int hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds = -1;
1243 static int hf_ptp_v2_pdrs_requestingportidentity = -1;
1244 static int hf_ptp_v2_pdrs_requestingsourceportid = -1;
1247 /*Fields for PTP_PDelayResponseFollowUp (=pdfu) messages*/
1248 static int hf_ptp_v2_pdfu_responseorigintimestamp = -1; /*Field for seconds & nanoseconds*/
1249 static int hf_ptp_v2_pdfu_responseorigintimestamp_seconds = -1;
1250 static int hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds = -1;
1251 static int hf_ptp_v2_pdfu_requestingportidentity = -1;
1252 static int hf_ptp_v2_pdfu_requestingsourceportid = -1;
1255 /*Fields for PTP_Signalling (=sig) messages*/
1256 static int hf_ptp_v2_sig_targetportidentity = -1;
1257 static int hf_ptp_v2_sig_targetportid = -1;
1260 /*Fields for PTP_Management (=mm) messages*/
1261 static int hf_ptp_v2_mm_targetportidentity = -1;
1262 static int hf_ptp_v2_mm_targetportid = -1;
1263 static int hf_ptp_v2_mm_startingboundaryhops = -1;
1264 static int hf_ptp_v2_mm_boundaryhops = -1;
1265 static int hf_ptp_v2_mm_action = -1;
1267 /* management TLV */
1268 static int hf_ptp_v2_mm_tlvType = -1;
1269 static int hf_ptp_v2_mm_lengthField = -1;
1270 static int hf_ptp_v2_mm_managementId = -1;
1271 static int hf_ptp_v2_mm_data = -1;
1272 /* Management dataField */
1274 static int hf_ptp_v2_mm_clockType = -1;
1275 static int hf_ptp_v2_mm_clockType_ordinaryClock = -1;
1276 static int hf_ptp_v2_mm_clockType_boundaryClock = -1;
1277 static int hf_ptp_v2_mm_clockType_p2p_transparentClock = -1;
1278 static int hf_ptp_v2_mm_clockType_e2e_transparentClock = -1;
1279 static int hf_ptp_v2_mm_clockType_managementNode = -1;
1280 static int hf_ptp_v2_mm_clockType_reserved = -1;
1281 static int hf_ptp_v2_mm_physicalLayerProtocol = -1;
1282 static int hf_ptp_v2_mm_physicalLayerProtocol_length = -1;
1283 static int hf_ptp_v2_mm_physicalAddressLength = -1;
1284 static int hf_ptp_v2_mm_physicalAddress = -1;
1285 static int hf_ptp_v2_mm_protocolAddress = -1;
1286 static int hf_ptp_v2_mm_protocolAddress_networkProtocol = -1;
1287 static int hf_ptp_v2_mm_protocolAddress_length = -1;
1288 static int hf_ptp_v2_mm_manufacturerIdentity = -1;
1290 static int hf_ptp_v2_mm_reserved = -1;
1291 static int hf_ptp_v2_mm_productDescription = -1;
1292 static int hf_ptp_v2_mm_productDescription_length = -1;
1293 static int hf_ptp_v2_mm_revisionData = -1;
1294 static int hf_ptp_v2_mm_revisionData_length = -1;
1295 static int hf_ptp_v2_mm_userDescription = -1;
1296 static int hf_ptp_v2_mm_userDescription_length = -1;
1297 static int hf_ptp_v2_mm_profileIdentity = -1;
1298 static int hf_ptp_v2_mm_pad = -1;
1300 static int hf_ptp_v2_mm_numberOfFaultRecords = -1;
1301 static int hf_ptp_v2_mm_faultRecord = -1;
1303 static int hf_ptp_v2_mm_initializationKey = -1;
1304 static int hf_ptp_v2_mm_severityCode = -1;
1305 static int hf_ptp_v2_mm_faultRecordLength = -1;
1306 static int hf_ptp_v2_mm_faultTime = -1;
1307 static int hf_ptp_v2_mm_faultTime_s = -1;
1308 static int hf_ptp_v2_mm_faultTime_ns = -1;
1309 static int hf_ptp_v2_mm_faultValue = -1;
1310 static int hf_ptp_v2_mm_faultName = -1;
1311 static int hf_ptp_v2_mm_faultName_length = -1;
1312 static int hf_ptp_v2_mm_faultValue_length = -1;
1313 static int hf_ptp_v2_mm_faultDescription = -1;
1314 static int hf_ptp_v2_mm_faultDescription_length = -1;
1315 static int hf_ptp_v2_mm_currentTime_s = -1;
1316 static int hf_ptp_v2_mm_currentTime_ns = -1;
1317 static int hf_ptp_v2_mm_clockAccuracy = -1;
1318 static int hf_ptp_v2_mm_priority1 = -1;
1319 static int hf_ptp_v2_mm_priority2 = -1;
1320 static int hf_ptp_v2_mm_dds_SO = -1;
1321 static int hf_ptp_v2_mm_TSC = -1;
1322 static int hf_ptp_v2_mm_numberPorts = -1;
1323 static int hf_ptp_v2_mm_clockclass = -1;
1324 static int hf_ptp_v2_mm_clockaccuracy = -1;
1325 static int hf_ptp_v2_mm_clockvariance = -1;
1326 static int hf_ptp_v2_mm_clockidentity = -1;
1327 static int hf_ptp_v2_mm_domainNumber = -1;
1328 static int hf_ptp_v2_mm_SO = -1;
1329 static int hf_ptp_v2_mm_stepsRemoved = -1;
1330 static int hf_ptp_v2_mm_parentIdentity = -1;
1331 static int hf_ptp_v2_mm_parentPort = -1;
1332 static int hf_ptp_v2_mm_parentStats = -1;
1333 static int hf_ptp_v2_mm_observedParentOffsetScaledLogVariance = -1;
1334 static int hf_ptp_v2_mm_observedParentClockPhaseChangeRate = -1;
1335 static int hf_ptp_v2_mm_grandmasterPriority1 = -1;
1336 static int hf_ptp_v2_mm_grandmasterPriority2 = -1;
1337 static int hf_ptp_v2_mm_grandmasterclockclass = -1;
1338 static int hf_ptp_v2_mm_grandmasterclockaccuracy = -1;
1339 static int hf_ptp_v2_mm_grandmasterclockvariance = -1;
1340 static int hf_ptp_v2_mm_grandmasterIdentity = -1;
1341 static int hf_ptp_v2_mm_currentUtcOffset = -1;
1342 static int hf_ptp_v2_mm_LI_61 = -1;
1343 static int hf_ptp_v2_mm_LI_59 = -1;
1344 static int hf_ptp_v2_mm_UTCV = -1;
1345 static int hf_ptp_v2_mm_PTP = -1;
1346 static int hf_ptp_v2_mm_TTRA = -1;
1347 static int hf_ptp_v2_mm_FTRA = -1;
1348 static int hf_ptp_v2_mm_timesource = -1;
1349 static int hf_ptp_v2_mm_offset_ns = -1;
1350 static int hf_ptp_v2_mm_pathDelay_ns = -1;
1351 static int hf_ptp_v2_mm_offset_subns = -1;
1352 static int hf_ptp_v2_mm_pathDelay_subns = -1;
1353 static int hf_ptp_v2_mm_PortNumber = -1;
1354 static int hf_ptp_v2_mm_portState = -1;
1355 static int hf_ptp_v2_mm_logMinDelayReqInterval = -1;
1356 static int hf_ptp_v2_mm_peerMeanPathDelay_ns = -1;
1357 static int hf_ptp_v2_mm_peerMeanPathDelay_subns = -1;
1358 static int hf_ptp_v2_mm_logAnnounceInterval = -1;
1359 static int hf_ptp_v2_mm_announceReceiptTimeout = -1;
1360 static int hf_ptp_v2_mm_logSyncInterval = -1;
1361 static int hf_ptp_v2_mm_delayMechanism = -1;
1362 static int hf_ptp_v2_mm_logMinPdelayReqInterval = -1;
1363 static int hf_ptp_v2_mm_versionNumber = -1;
1364 static int hf_ptp_v2_mm_primaryDomain = -1;
1365 static int hf_ptp_v2_mm_faultyFlag = -1;
1366 static int hf_ptp_v2_mm_managementErrorId = -1;
1367 static int hf_ptp_v2_mm_displayData = -1;
1368 static int hf_ptp_v2_mm_displayData_length = -1;
1369 static int hf_ptp_v2_mm_ucEN = -1;
1370 static int hf_ptp_v2_mm_ptEN = -1;
1371 static int hf_ptp_v2_mm_atEN = -1;
1372 static int hf_ptp_v2_mm_keyField = -1;
1373 static int hf_ptp_v2_mm_displayName = -1;
1374 static int hf_ptp_v2_mm_displayName_length = -1;
1375 static int hf_ptp_v2_mm_maxKey = -1;
1376 static int hf_ptp_v2_mm_currentOffset = -1;
1377 static int hf_ptp_v2_mm_jumpSeconds = -1;
1378 static int hf_ptp_v2_mm_logAlternateMulticastSyncInterval = -1;
1379 static int hf_ptp_v2_mm_numberOfAlternateMasters = -1;
1380 static int hf_ptp_v2_mm_transmitAlternateMulticastSync = -1;
1382 /* Initialize the subtree pointers */
1383 static gint ett_ptp_v2 = -1;
1384 static gint ett_ptp_v2_flags = -1;
1385 static gint ett_ptp_v2_correction = -1;
1386 static gint ett_ptp_v2_time = -1;
1387 static gint ett_ptp_v2_time2 = -1;
1388 static gint ett_ptp_v2_managementData = -1;
1389 static gint ett_ptp_v2_clockType = -1;
1390 static gint ett_ptp_v2_physicalLayerProtocol = -1;
1391 static gint ett_ptp_v2_protocolAddress = -1;
1392 static gint ett_ptp_v2_faultRecord = -1;
1393 static gint ett_ptp_v2_ptptext = -1;
1394 static gint ett_ptp_v2_timeInterval = -1;
1395 static gint ett_ptp_v2_tlv = -1;
1397 /* static gint ett_ptp_v2_timesource = -1;
1398 static gint ett_ptp_v2_priority = -1; */
1399 static gint ett_ptp_v2_transportspecific = -1;
1401 /* For tronsport specific field Ethernet or UDP */
1402 static gboolean ptpv2_oE = FALSE;
1403 /* END Definitions and fields for PTPv2 dissection. */
1406 /* forward declaration of local functions for v1 and v2 */
1409 dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1412 is_ptp_v1(tvbuff_t *tvb);
1415 dissect_ptp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1418 is_ptp_v2(tvbuff_t *tvb);
1421 dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1423 /**********************************************************/
1424 /* Implementation of the functions */
1425 /**********************************************************/
1428 /* Code to dissect the packet */
1431 dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1434 /* PTP over Ethernet only available with PTPv2 */
1435 dissect_ptp_v2(tvb, pinfo, tree);
1439 dissect_ptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1443 dissect_ptp_v1(tvb, pinfo, tree);
1444 else if(is_ptp_v2(tvb))
1445 dissect_ptp_v2(tvb, pinfo, tree);
1449 /* Code to check if packet is PTPv1 */
1452 is_ptp_v1(tvbuff_t *tvb)
1454 guint16 version_ptp;
1456 version_ptp = tvb_get_ntohs(tvb, PTP_VERSIONPTP_OFFSET);
1458 if( version_ptp == 1) return TRUE;
1463 /* Code to check if packet is PTPv2 */
1466 is_ptp_v2(tvbuff_t *tvb)
1470 version_ptp = 0x0F & tvb_get_guint8(tvb, PTP_V2_VERSIONPTP_OFFSET);
1472 if( version_ptp == 2) return TRUE;
1477 /* Code to actually dissect the PTPv1 packets */
1480 dissect_ptp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1482 guint8 ptp_control, ptp_mm_messagekey = 0;
1483 nstime_t ts; /*time structure with seconds and nanoseconds*/
1485 /* Set up structures needed to add the protocol subtree and manage it */
1486 proto_item *ti, *flags_ti, *time_ti, *time2_ti;
1487 proto_tree *ptp_tree, *ptp_flags_tree, *ptp_time_tree, *ptp_time2_tree;
1489 /* Make entries in Protocol column and Info column on summary display */
1490 if (check_col(pinfo->cinfo, COL_PROTOCOL))
1491 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PTPv1");
1494 /* Get control field (what kind of message is this? (Sync, DelayReq, ...) */
1496 ptp_control = tvb_get_guint8 (tvb, PTP_CONTROL_OFFSET);
1498 if ( ptp_control == PTP_MANAGEMENT_MESSAGE ){
1499 /* Get the managementMessageKey */
1500 ptp_mm_messagekey = tvb_get_guint8(tvb, PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET);
1503 /* Create and set the string for "Info" column */
1504 switch(ptp_control){
1505 case PTP_SYNC_MESSAGE:{
1506 if (check_col(pinfo->cinfo, COL_INFO))
1507 col_set_str(pinfo->cinfo, COL_INFO, "Sync Message");
1510 case PTP_DELAY_REQ_MESSAGE:{
1511 if (check_col(pinfo->cinfo, COL_INFO))
1512 col_set_str(pinfo->cinfo, COL_INFO, "Delay_Request Message");
1515 case PTP_FOLLOWUP_MESSAGE:{
1516 if (check_col(pinfo->cinfo, COL_INFO))
1517 col_set_str(pinfo->cinfo, COL_INFO, "Follow_Up Message");
1520 case PTP_DELAY_RESP_MESSAGE:{
1521 if (check_col(pinfo->cinfo, COL_INFO))
1522 col_set_str(pinfo->cinfo, COL_INFO, "Delay_Response Message");
1525 case PTP_MANAGEMENT_MESSAGE:{
1526 if (check_col(pinfo->cinfo, COL_INFO)){
1527 col_add_fstr(pinfo->cinfo, COL_INFO, "Management Message (%s)",
1528 val_to_str(ptp_mm_messagekey,
1529 ptp_managementMessageKey_infocolumn_vals,
1530 "Unknown message key %u"));
1535 if (check_col(pinfo->cinfo, COL_INFO))
1536 col_set_str(pinfo->cinfo, COL_INFO, "Unknown Message");
1543 /* create display subtree for the protocol */
1544 ti = proto_tree_add_item(tree, proto_ptp, tvb, 0, -1, FALSE);
1546 ptp_tree = proto_item_add_subtree(ti, ett_ptp);
1548 proto_tree_add_item(ptp_tree,
1549 hf_ptp_versionptp, tvb, PTP_VERSIONPTP_OFFSET, 2, FALSE);
1551 proto_tree_add_item(ptp_tree,
1552 hf_ptp_versionnetwork, tvb, PTP_VERSIONNETWORK_OFFSET, 2, FALSE);
1554 proto_tree_add_item(ptp_tree,
1555 hf_ptp_subdomain, tvb, PTP_SUBDOMAIN_OFFSET, 16, FALSE);
1557 proto_tree_add_item(ptp_tree,
1558 hf_ptp_messagetype, tvb, PTP_MESSAGETYPE_OFFSET, 1, FALSE);
1560 proto_tree_add_item(ptp_tree,
1561 hf_ptp_sourcecommunicationtechnology, tvb, PTP_SOURCECOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1563 proto_tree_add_item(ptp_tree,
1564 hf_ptp_sourceuuid, tvb, PTP_SOURCEUUID_OFFSET, 6, FALSE);
1566 proto_tree_add_item(ptp_tree,
1567 hf_ptp_sourceportid, tvb, PTP_SOURCEPORTID_OFFSET, 2, FALSE);
1569 proto_tree_add_item(ptp_tree,
1570 hf_ptp_sequenceid, tvb, PTP_SEQUENCEID_OFFSET, 2, FALSE);
1572 proto_tree_add_item(ptp_tree,
1573 hf_ptp_control, tvb, PTP_CONTROL_OFFSET, 1, FALSE);
1575 /*Subtree for the flag-field*/
1577 flags_ti = proto_tree_add_item(ptp_tree,
1578 hf_ptp_flags, tvb, PTP_FLAGS_OFFSET, 2, FALSE);
1580 ptp_flags_tree = proto_item_add_subtree(flags_ti, ett_ptp_flags);
1582 proto_tree_add_item(ptp_flags_tree,
1583 hf_ptp_flags_li61, tvb, PTP_FLAGS_LI61_OFFSET, 2, FALSE);
1585 proto_tree_add_item(ptp_flags_tree,
1586 hf_ptp_flags_li59, tvb, PTP_FLAGS_LI59_OFFSET, 2, FALSE);
1588 proto_tree_add_item(ptp_flags_tree,
1589 hf_ptp_flags_boundary_clock, tvb, PTP_FLAGS_BOUNDARY_CLOCK_OFFSET, 2, FALSE);
1591 proto_tree_add_item(ptp_flags_tree,
1592 hf_ptp_flags_assist, tvb, PTP_FLAGS_ASSIST_OFFSET, 2, FALSE);
1594 proto_tree_add_item(ptp_flags_tree,
1595 hf_ptp_flags_ext_sync, tvb, PTP_FLAGS_EXT_SYNC_OFFSET, 2, FALSE);
1597 proto_tree_add_item(ptp_flags_tree,
1598 hf_ptp_flags_parent, tvb, PTP_FLAGS_PARENT_STATS_OFFSET, 2, FALSE);
1600 proto_tree_add_item(ptp_flags_tree,
1601 hf_ptp_flags_sync_burst, tvb, PTP_FLAGS_SYNC_BURST_OFFSET, 2, FALSE);
1604 /* The rest of the ptp-dissector depends on the control-field */
1606 switch(ptp_control){
1607 case PTP_SYNC_MESSAGE:
1608 case PTP_DELAY_REQ_MESSAGE:{
1610 /*Subtree for the timestamp-field*/
1611 ts.secs = tvb_get_ntohl(tvb, PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET);
1612 ts.nsecs = tvb_get_ntohl(tvb, PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET);
1614 time_ti = proto_tree_add_time(ptp_tree,
1615 hf_ptp_sdr_origintimestamp, tvb, PTP_SDR_ORIGINTIMESTAMP_OFFSET, 8, &ts);
1617 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1619 proto_tree_add_item(ptp_time_tree,
1620 hf_ptp_sdr_origintimestamp_seconds, tvb,
1621 PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET, 4, FALSE);
1623 proto_tree_add_item(ptp_time_tree, hf_ptp_sdr_origintimestamp_nanoseconds, tvb,
1624 PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET, 4, FALSE);
1627 proto_tree_add_item(ptp_tree,
1628 hf_ptp_sdr_epochnumber, tvb, PTP_SDR_EPOCHNUMBER_OFFSET, 2, FALSE);
1630 proto_tree_add_item(ptp_tree,
1631 hf_ptp_sdr_currentutcoffset, tvb, PTP_SDR_CURRENTUTCOFFSET_OFFSET, 2, FALSE);
1633 proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmastercommunicationtechnology, tvb,
1634 PTP_SDR_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1636 proto_tree_add_item(ptp_tree,
1637 hf_ptp_sdr_grandmasterclockuuid, tvb, PTP_SDR_GRANDMASTERCLOCKUUID_OFFSET, 6, FALSE);
1639 proto_tree_add_item(ptp_tree,
1640 hf_ptp_sdr_grandmasterportid, tvb, PTP_SDR_GRANDMASTERPORTID_OFFSET, 2, FALSE);
1642 proto_tree_add_item(ptp_tree,
1643 hf_ptp_sdr_grandmastersequenceid, tvb, PTP_SDR_GRANDMASTERSEQUENCEID_OFFSET, 2, FALSE);
1645 proto_tree_add_item(ptp_tree,
1646 hf_ptp_sdr_grandmasterclockstratum, tvb,
1647 PTP_SDR_GRANDMASTERCLOCKSTRATUM_OFFSET, 1, FALSE);
1649 proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmasterclockidentifier, tvb,
1650 PTP_SDR_GRANDMASTERCLOCKIDENTIFIER_OFFSET, 4, FALSE);
1652 proto_tree_add_item(ptp_tree,
1653 hf_ptp_sdr_grandmasterclockvariance, tvb,
1654 PTP_SDR_GRANDMASTERCLOCKVARIANCE_OFFSET, 2, FALSE);
1656 proto_tree_add_item(ptp_tree,
1657 hf_ptp_sdr_grandmasterpreferred, tvb, PTP_SDR_GRANDMASTERPREFERRED_OFFSET, 1, FALSE);
1659 proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmasterisboundaryclock, tvb,
1660 PTP_SDR_GRANDMASTERISBOUNDARYCLOCK_OFFSET, 1, FALSE);
1662 proto_tree_add_item(ptp_tree,
1663 hf_ptp_sdr_syncinterval, tvb, PTP_SDR_SYNCINTERVAL_OFFSET, 1, FALSE);
1665 proto_tree_add_item(ptp_tree,
1666 hf_ptp_sdr_localclockvariance, tvb, PTP_SDR_LOCALCLOCKVARIANCE_OFFSET, 2, FALSE);
1668 proto_tree_add_item(ptp_tree,
1669 hf_ptp_sdr_localstepsremoved, tvb, PTP_SDR_LOCALSTEPSREMOVED_OFFSET, 2, FALSE);
1671 proto_tree_add_item(ptp_tree,
1672 hf_ptp_sdr_localclockstratum, tvb, PTP_SDR_LOCALCLOCKSTRATUM_OFFSET, 1, FALSE);
1674 proto_tree_add_item(ptp_tree,
1675 hf_ptp_sdr_localclockidentifier, tvb, PTP_SDR_LOCALCLOCKIDENTIFIER_OFFSET, 4, FALSE);
1677 proto_tree_add_item(ptp_tree, hf_ptp_sdr_parentcommunicationtechnology, tvb,
1678 PTP_SDR_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1680 proto_tree_add_item(ptp_tree,
1681 hf_ptp_sdr_parentuuid, tvb, PTP_SDR_PARENTUUID_OFFSET, 6, FALSE);
1683 proto_tree_add_item(ptp_tree,
1684 hf_ptp_sdr_parentportfield, tvb, PTP_SDR_PARENTPORTFIELD_OFFSET, 2, FALSE);
1686 proto_tree_add_item(ptp_tree,
1687 hf_ptp_sdr_estimatedmastervariance, tvb,
1688 PTP_SDR_ESTIMATEDMASTERVARIANCE_OFFSET, 2, FALSE);
1690 proto_tree_add_item(ptp_tree,
1691 hf_ptp_sdr_estimatedmasterdrift, tvb, PTP_SDR_ESTIMATEDMASTERDRIFT_OFFSET, 4, FALSE);
1693 proto_tree_add_item(ptp_tree,
1694 hf_ptp_sdr_utcreasonable, tvb, PTP_SDR_UTCREASONABLE_OFFSET, 1, FALSE);
1697 case PTP_FOLLOWUP_MESSAGE:{
1698 proto_tree_add_item(ptp_tree,
1699 hf_ptp_fu_associatedsequenceid, tvb, PTP_FU_ASSOCIATEDSEQUENCEID_OFFSET, 2, FALSE);
1701 /*Subtree for the timestamp-field*/
1702 ts.secs = tvb_get_ntohl(tvb, PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET);
1703 ts.nsecs = tvb_get_ntohl(tvb, PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET);
1705 time_ti = proto_tree_add_time(ptp_tree,
1706 hf_ptp_fu_preciseorigintimestamp, tvb,
1707 PTP_FU_PRECISEORIGINTIMESTAMP_OFFSET, 8, &ts);
1709 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1711 proto_tree_add_item(ptp_time_tree, hf_ptp_fu_preciseorigintimestamp_seconds, tvb,
1712 PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET, 4, FALSE);
1714 proto_tree_add_item(ptp_time_tree, hf_ptp_fu_preciseorigintimestamp_nanoseconds, tvb,
1715 PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET, 4, FALSE);
1719 case PTP_DELAY_RESP_MESSAGE:{
1720 /*Subtree for the timestamp-field*/
1721 ts.secs = tvb_get_ntohl(tvb, PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET);
1722 ts.nsecs = tvb_get_ntohl(tvb, PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET);
1724 time_ti = proto_tree_add_time(ptp_tree,
1725 hf_ptp_dr_delayreceipttimestamp, tvb,
1726 PTP_DR_DELAYRECEIPTTIMESTAMP_OFFSET, 8, &ts);
1728 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1730 proto_tree_add_item(ptp_time_tree, hf_ptp_dr_delayreceipttimestamp_seconds, tvb,
1731 PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET, 4, FALSE);
1733 proto_tree_add_item(ptp_time_tree, hf_ptp_dr_delayreceipttimestamp_nanoseconds, tvb,
1734 PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET, 4, FALSE);
1737 proto_tree_add_item(ptp_tree, hf_ptp_dr_requestingsourcecommunicationtechnology, tvb,
1738 PTP_DR_REQUESTINGSOURCECOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1740 proto_tree_add_item(ptp_tree,
1741 hf_ptp_dr_requestingsourceuuid, tvb, PTP_DR_REQUESTINGSOURCEUUID_OFFSET, 6, FALSE);
1743 proto_tree_add_item(ptp_tree,
1744 hf_ptp_dr_requestingsourceportid, tvb, PTP_DR_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
1746 proto_tree_add_item(ptp_tree,
1747 hf_ptp_dr_requestingsourcesequenceid, tvb,
1748 PTP_DR_REQUESTINGSOURCESEQUENCEID_OFFSET, 2, FALSE);
1751 case PTP_MANAGEMENT_MESSAGE:{
1752 proto_tree_add_item(ptp_tree, hf_ptp_mm_targetcommunicationtechnology, tvb,
1753 PTP_MM_TARGETCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1755 proto_tree_add_item(ptp_tree,
1756 hf_ptp_mm_targetuuid, tvb, PTP_MM_TARGETUUID_OFFSET, 6, FALSE);
1758 proto_tree_add_item(ptp_tree,
1759 hf_ptp_mm_targetportid, tvb, PTP_MM_TARGETPORTID_OFFSET, 2, FALSE);
1761 proto_tree_add_item(ptp_tree,
1762 hf_ptp_mm_startingboundaryhops, tvb, PTP_MM_STARTINGBOUNDARYHOPS_OFFSET, 2, FALSE);
1764 proto_tree_add_item(ptp_tree,
1765 hf_ptp_mm_boundaryhops, tvb, PTP_MM_BOUNDARYHOPS_OFFSET, 2, FALSE);
1768 proto_tree_add_item(ptp_tree,
1769 hf_ptp_mm_managementmessagekey, tvb, PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET, 1, FALSE);
1771 proto_tree_add_item(ptp_tree,
1772 hf_ptp_mm_parameterlength, tvb, PTP_MM_PARAMETERLENGTH_OFFSET, 2, FALSE);
1774 switch(ptp_mm_messagekey){
1775 case PTP_MM_CLOCK_IDENTITY:{
1776 proto_tree_add_item(ptp_tree,
1777 hf_ptp_mm_clock_identity_clockcommunicationtechnology, tvb,
1778 PTP_MM_CLOCK_IDENTITY_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
1780 proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_clockuuidfield, tvb,
1781 PTP_MM_CLOCK_IDENTITY_CLOCKUUIDFIELD_OFFSET, 6, FALSE);
1783 proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_clockportfield, tvb,
1784 PTP_MM_CLOCK_IDENTITY_CLOCKPORTFIELD_OFFSET, 2, FALSE);
1786 proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_manufactureridentity, tvb,
1787 PTP_MM_CLOCK_IDENTITY_MANUFACTURERIDENTITY_OFFSET, 48, FALSE);
1790 case PTP_MM_INITIALIZE_CLOCK:{
1791 proto_tree_add_item(ptp_tree, hf_ptp_mm_initialize_clock_initialisationkey, tvb,
1792 PTP_MM_INITIALIZE_CLOCK_INITIALISATIONKEY_OFFSET, 2, FALSE);
1795 case PTP_MM_SET_SUBDOMAIN:{
1796 proto_tree_add_item(ptp_tree, hf_ptp_mm_set_subdomain_subdomainname, tvb,
1797 PTP_MM_SET_SUBDOMAIN_SUBDOMAINNAME_OFFSET, 16, FALSE);
1800 case PTP_MM_DEFAULT_DATA_SET:{
1801 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockcommunicationtechnology,
1802 tvb, PTP_MM_DEFAULT_DATA_SET_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET,
1805 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockuuidfield, tvb,
1806 PTP_MM_DEFAULT_DATA_SET_CLOCKUUIDFIELD_OFFSET, 6, FALSE);
1808 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockportfield, tvb,
1809 PTP_MM_DEFAULT_DATA_SET_CLOCKPORTFIELD_OFFSET, 2, FALSE);
1811 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockstratum, tvb,
1812 PTP_MM_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET, 1, FALSE);
1814 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockidentifier, tvb,
1815 PTP_MM_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET, 4, FALSE);
1817 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockvariance, tvb,
1818 PTP_MM_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET, 2, FALSE);
1820 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockfollowupcapable, tvb,
1821 PTP_MM_DEFAULT_DATA_SET_CLOCKFOLLOWUPCAPABLE_OFFSET, 1, FALSE);
1823 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_preferred, tvb,
1824 PTP_MM_DEFAULT_DATA_SET_PREFERRED_OFFSET, 1, FALSE);
1826 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_initializable, tvb,
1827 PTP_MM_DEFAULT_DATA_SET_INITIALIZABLE_OFFSET, 1, FALSE);
1829 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_externaltiming, tvb,
1830 PTP_MM_DEFAULT_DATA_SET_EXTERNALTIMING_OFFSET, 1, FALSE);
1832 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_isboundaryclock, tvb,
1833 PTP_MM_DEFAULT_DATA_SET_ISBOUNDARYCLOCK_OFFSET, 1, FALSE);
1835 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_syncinterval, tvb,
1836 PTP_MM_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET, 1, FALSE);
1838 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_subdomainname, tvb,
1839 PTP_MM_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET, 16, FALSE);
1841 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_numberports, tvb,
1842 PTP_MM_DEFAULT_DATA_SET_NUMBERPORTS_OFFSET, 2, FALSE);
1844 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_numberforeignrecords, tvb,
1845 PTP_MM_DEFAULT_DATA_SET_NUMBERFOREIGNRECORDS_OFFSET, 2, FALSE);
1848 case PTP_MM_UPDATE_DEFAULT_DATA_SET:{
1849 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockstratum, tvb,
1850 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET, 1, FALSE);
1852 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockidentifier, tvb,
1853 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET, 4, FALSE);
1855 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockvariance, tvb,
1856 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET, 2, FALSE);
1858 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_preferred, tvb,
1859 PTP_MM_UPDATE_DEFAULT_DATA_SET_PREFERRED_OFFSET, 1, FALSE);
1861 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_syncinterval, tvb,
1862 PTP_MM_UPDATE_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET, 1, FALSE);
1864 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_subdomainname, tvb,
1865 PTP_MM_UPDATE_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET, 16, FALSE);
1868 case PTP_MM_CURRENT_DATA_SET:{
1869 proto_tree_add_item(ptp_tree, hf_ptp_mm_current_data_set_stepsremoved, tvb,
1870 PTP_MM_CURRENT_DATA_SET_STEPSREMOVED_OFFSET, 2, FALSE);
1872 /* Subtree for offset from master*/
1873 ts.secs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET);
1875 ts.nsecs = tvb_get_ntohl(tvb,
1876 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET);
1878 if (ts.nsecs & 0x80000000) ts.nsecs = ts.nsecs & 0x7FFFFFFF;
1881 time_ti = proto_tree_add_time(ptp_tree,
1882 hf_ptp_mm_current_data_set_offsetfrommaster, tvb,
1883 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTER_OFFSET, 8, &ts);
1885 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1887 proto_tree_add_item(ptp_time_tree,
1888 hf_ptp_mm_current_data_set_offsetfrommasterseconds, tvb,
1889 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET, 4, FALSE);
1891 proto_tree_add_item(ptp_time_tree,
1892 hf_ptp_mm_current_data_set_offsetfrommasternanoseconds, tvb,
1893 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET, 4, FALSE);
1896 /* Subtree for offset from master*/
1897 ts.secs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET);
1899 ts.nsecs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET);
1902 time2_ti = proto_tree_add_time(ptp_tree,
1903 hf_ptp_mm_current_data_set_onewaydelay, tvb,
1904 PTP_MM_CURRENT_DATA_SET_ONEWAYDELAY_OFFSET, 8, &ts);
1906 ptp_time2_tree = proto_item_add_subtree(time2_ti, ett_ptp_time2);
1908 proto_tree_add_item(ptp_time2_tree, hf_ptp_mm_current_data_set_onewaydelayseconds,
1909 tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET, 4, FALSE);
1911 proto_tree_add_item(ptp_time2_tree,
1912 hf_ptp_mm_current_data_set_onewaydelaynanoseconds,
1913 tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET, 4, FALSE);
1917 case PTP_MM_PARENT_DATA_SET:{
1918 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentcommunicationtechnology,
1919 tvb, PTP_MM_PARENT_DATA_SET_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET,
1922 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentuuid, tvb,
1923 PTP_MM_PARENT_DATA_SET_PARENTUUID_OFFSET, 6, FALSE);
1925 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentportid, tvb,
1926 PTP_MM_PARENT_DATA_SET_PARENTPORTID_OFFSET, 2, FALSE);
1928 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber,
1929 tvb, PTP_MM_PARENT_DATA_SET_PARENTLASTSYNCSEQUENCENUMBER_OFFSET,
1932 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentfollowupcapable, tvb,
1933 PTP_MM_PARENT_DATA_SET_PARENTFOLLOWUPCAPABLE_OFFSET, 1, FALSE);
1935 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentexternaltiming, tvb,
1936 PTP_MM_PARENT_DATA_SET_PARENTEXTERNALTIMING_OFFSET, 1, FALSE);
1938 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentvariance, tvb,
1939 PTP_MM_PARENT_DATA_SET_PARENTVARIANCE_OFFSET, 2, FALSE);
1941 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentstats, tvb,
1942 PTP_MM_PARENT_DATA_SET_PARENTSTATS_OFFSET, 1, FALSE);
1944 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_observedvariance, tvb,
1945 PTP_MM_PARENT_DATA_SET_OBSERVEDVARIANCE_OFFSET, 2, FALSE);
1947 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_observeddrift, tvb,
1948 PTP_MM_PARENT_DATA_SET_OBSERVEDDRIFT_OFFSET, 4, FALSE);
1950 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_utcreasonable, tvb,
1951 PTP_MM_PARENT_DATA_SET_UTCREASONABLE_OFFSET, 1, FALSE);
1953 proto_tree_add_item(ptp_tree,
1954 hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology,
1955 tvb, PTP_MM_PARENT_DATA_SET_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1,
1958 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasteruuidfield, tvb,
1959 PTP_MM_PARENT_DATA_SET_GRANDMASTERUUIDFIELD_OFFSET, 6, FALSE);
1961 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterportidfield, tvb,
1962 PTP_MM_PARENT_DATA_SET_GRANDMASTERPORTIDFIELD_OFFSET, 2, FALSE);
1964 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterstratum, tvb,
1965 PTP_MM_PARENT_DATA_SET_GRANDMASTERSTRATUM_OFFSET, 1, FALSE);
1967 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasteridentifier, tvb,
1968 PTP_MM_PARENT_DATA_SET_GRANDMASTERIDENTIFIER_OFFSET, 4, FALSE);
1970 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmastervariance, tvb,
1971 PTP_MM_PARENT_DATA_SET_GRANDMASTERVARIANCE_OFFSET, 2, FALSE);
1973 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterpreferred, tvb,
1974 PTP_MM_PARENT_DATA_SET_GRANDMASTERPREFERRED_OFFSET, 1, FALSE);
1976 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterisboundaryclock, tvb,
1977 PTP_MM_PARENT_DATA_SET_GRANDMASTERISBOUNDARYCLOCK_OFFSET, 1, FALSE);
1979 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmastersequencenumber, tvb,
1980 PTP_MM_PARENT_DATA_SET_GRANDMASTERSEQUENCENUMBER_OFFSET, 2, FALSE);
1983 case PTP_MM_PORT_DATA_SET:{
1984 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_returnedportnumber, tvb,
1985 PTP_MM_PORT_DATA_SET_RETURNEDPORTNUMBER_OFFSET, 2, FALSE);
1987 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portstate, tvb,
1988 PTP_MM_PORT_DATA_SET_PORTSTATE_OFFSET, 1, FALSE);
1990 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_lastsynceventsequencenumber, tvb,
1991 PTP_MM_PORT_DATA_SET_LASTSYNCEVENTSEQUENCENUMBER_OFFSET, 2, FALSE);
1993 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber,
1994 tvb, PTP_MM_PORT_DATA_SET_LASTGENERALEVENTSEQUENCENUMBER_OFFSET,
1997 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portcommunicationtechnology, tvb,
1998 PTP_MM_PORT_DATA_SET_PORTCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
2000 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portuuidfield, tvb,
2001 PTP_MM_PORT_DATA_SET_PORTUUIDFIELD_OFFSET, 6, FALSE);
2003 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portidfield, tvb,
2004 PTP_MM_PORT_DATA_SET_PORTIDFIELD_OFFSET, 2, FALSE);
2006 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_burstenabled, tvb,
2007 PTP_MM_PORT_DATA_SET_BURSTENABLED_OFFSET, 1, FALSE);
2009 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_subdomainaddressoctets, tvb,
2010 PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESSOCTETS_OFFSET, 1, FALSE);
2012 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_eventportaddressoctets, tvb,
2013 PTP_MM_PORT_DATA_SET_EVENTPORTADDRESSOCTETS_OFFSET, 1, FALSE);
2015 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_generalportaddressoctets, tvb,
2016 PTP_MM_PORT_DATA_SET_GENERALPORTADDRESSOCTETS_OFFSET, 1, FALSE);
2018 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_subdomainaddress, tvb,
2019 PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESS_OFFSET, 4, FALSE);
2021 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_eventportaddress, tvb,
2022 PTP_MM_PORT_DATA_SET_EVENTPORTADDRESS_OFFSET, 2, FALSE);
2024 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_generalportaddress, tvb,
2025 PTP_MM_PORT_DATA_SET_GENERALPORTADDRESS_OFFSET, 2, FALSE);
2028 case PTP_MM_GLOBAL_TIME_DATA_SET:{
2029 /* Subtree for local time*/
2030 ts.secs = tvb_get_ntohl(tvb, PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET);
2032 ts.nsecs = tvb_get_ntohl(tvb,
2033 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET);
2036 time_ti = proto_tree_add_time(ptp_tree,
2037 hf_ptp_mm_global_time_data_set_localtime, tvb,
2038 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIME_OFFSET, 8, &ts);
2040 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
2042 proto_tree_add_item(ptp_time_tree,
2043 hf_ptp_mm_global_time_data_set_localtimeseconds, tvb,
2044 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET, 4, FALSE);
2046 proto_tree_add_item(ptp_time_tree,
2047 hf_ptp_mm_global_time_data_set_localtimenanoseconds,
2048 tvb, PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET, 4, FALSE);
2051 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_currentutcoffset, tvb,
2052 PTP_MM_GLOBAL_TIME_DATA_SET_CURRENTUTCOFFSET_OFFSET, 2, FALSE);
2054 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_leap59, tvb,
2055 PTP_MM_GLOBAL_TIME_DATA_SET_LEAP59_OFFSET, 1, FALSE);
2057 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_leap61, tvb,
2058 PTP_MM_GLOBAL_TIME_DATA_SET_LEAP61_OFFSET, 1, FALSE);
2060 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_epochnumber, tvb,
2061 PTP_MM_GLOBAL_TIME_DATA_SET_EPOCHNUMBER_OFFSET, 2, FALSE);
2064 case PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES:{
2065 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_currentutcoffset,
2066 tvb, PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_CURRENTUTCOFFSET_OFFSET,
2069 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_leap59, tvb,
2070 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP59_OFFSET, 1, FALSE);
2072 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_leap61, tvb,
2073 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP61_OFFSET, 1, FALSE);
2075 proto_tree_add_item(ptp_tree, hf_ptp_mm_get_foreign_data_set_recordkey, tvb,
2076 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_EPOCHNUMBER_OFFSET, 2, FALSE);
2079 case PTP_MM_GET_FOREIGN_DATA_SET:{
2080 proto_tree_add_item(ptp_tree, hf_ptp_mm_get_foreign_data_set_recordkey, tvb,
2081 PTP_MM_GET_FOREIGN_DATA_SET_RECORDKEY_OFFSET, 2, FALSE);
2084 case PTP_MM_FOREIGN_DATA_SET:{
2085 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_returnedportnumber, tvb,
2086 PTP_MM_FOREIGN_DATA_SET_RETURNEDPORTNUMBER_OFFSET, 2, FALSE);
2088 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_returnedrecordnumber, tvb,
2089 PTP_MM_FOREIGN_DATA_SET_RETURNEDRECORDNUMBER_OFFSET, 2, FALSE);
2091 proto_tree_add_item(ptp_tree,
2092 hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology,
2093 tvb, PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1,
2096 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmasteruuidfield, tvb,
2097 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERUUIDFIELD_OFFSET, 6, FALSE);
2099 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmasterportidfield, tvb,
2100 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERPORTIDFIELD_OFFSET, 2, FALSE);
2102 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmastersyncs, tvb,
2103 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERSYNCS_OFFSET, 2, FALSE);
2106 case PTP_MM_SET_SYNC_INTERVAL:{
2107 proto_tree_add_item(ptp_tree, hf_ptp_mm_set_sync_interval_syncinterval, tvb,
2108 PTP_MM_SET_SYNC_INTERVAL_SYNCINTERVAL_OFFSET, 2, FALSE);
2111 case PTP_MM_SET_TIME:{
2112 /* Subtree for local time*/
2113 ts.secs = tvb_get_ntohl(tvb, PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET);
2115 ts.nsecs = tvb_get_ntohl(tvb, PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET);
2118 time_ti = proto_tree_add_time(ptp_tree, hf_ptp_mm_set_time_localtime, tvb,
2119 PTP_MM_SET_TIME_LOCALTIME_OFFSET, 8, &ts);
2121 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
2123 proto_tree_add_item(ptp_time_tree, hf_ptp_mm_set_time_localtimeseconds, tvb,
2124 PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET, 4, FALSE);
2126 proto_tree_add_item(ptp_time_tree, hf_ptp_mm_set_time_localtimenanoseconds,
2127 tvb, PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET, 4, FALSE);
2132 /*- don't dissect any further. */
2139 /* Not a valid MessageType - can't dissect. */
2147 /* Code to dissect PTPText */
2149 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)
2152 proto_item *ptptext_ti;
2153 proto_tree *ptptext_subtree;
2155 length = tvb_get_guint8 (tvb, *cur_offset);
2159 ptptext_ti = proto_tree_add_item(tree, hf_ptp_v2_mm_ptptext, tvb,
2160 *cur_offset+1, length, FALSE);
2162 ptptext_subtree = proto_item_add_subtree(ptptext_ti, ett_ptp_v2_ptptext);
2164 proto_tree_add_item(ptptext_subtree, hf_ptp_v2_mm_ptptext_length, tvb,
2165 *cur_offset, 1, FALSE);
2166 proto_tree_add_item(ptptext_subtree, hf_ptp_v2_mm_ptptext, tvb,
2167 *cur_offset+1, length, FALSE);
2169 *cur_offset = *cur_offset + length + 1;
2174 dissect_ptp_v2_timeInterval(tvbuff_t *tvb, guint16 *cur_offset, proto_tree *tree, char* name, int hf_ptp_v2_timeInterval_ns, int hf_ptp_v2_timeInterval_subns)
2180 proto_item *ptptimeInterval_ti;
2181 proto_tree *ptptimeInterval_subtree;
2183 time_ns = tvb_get_ntohl(tvb, *cur_offset);
2185 time_subns = tvb_get_ntohs(tvb, *cur_offset+6);
2187 time_ns = time_ns << 16;
2189 if(time_ns & 0x800000){
2190 time_ns = time_ns | G_GINT64_CONSTANT(0xFFFFFFFFFF000000);
2191 time_ns = time_ns | tvb_get_ntohs(tvb, *cur_offset+4);
2193 time = ((1.0*time_ns) + (time_subns/65536.0));
2197 time_ns = time_ns | tvb_get_ntohs(tvb, *cur_offset+4);
2198 time = time_ns + (time_subns/65536.0);
2201 ptptimeInterval_ti = proto_tree_add_text(tree, tvb, *cur_offset, 8,
2202 "%s: %f nanoseconds", name, time);
2204 ptptimeInterval_subtree = proto_item_add_subtree(ptptimeInterval_ti, ett_ptp_v2_timeInterval);
2206 proto_tree_add_uint64_format_value(ptptimeInterval_subtree,
2207 hf_ptp_v2_timeInterval_ns, tvb, *cur_offset, 6, time_ns, "Ns: %" G_GINT64_MODIFIER "d nanoseconds", time_ns);
2209 proto_tree_add_double_format(ptptimeInterval_subtree,
2210 hf_ptp_v2_timeInterval_subns, tvb, *cur_offset+6, 2, (time_subns/65536.0),
2211 "SubNs: %f nanoseconds", (time_subns/65536.0));
2213 *cur_offset = *cur_offset + 8;
2216 /* Code to actually dissect the PTPv2 packets */
2219 dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2221 guint8 ptp_v2_messageid = 0;
2222 guint16 ptp_v2_mm_managementId = 0;
2223 guint8 ptp_v2_management_action = 0;
2228 /* Set up structures needed to add the protocol subtree and manage it */
2229 proto_item *ti, *transportspecific_ti, *flags_ti, *managementData_ti, *clockType_ti, *protocolAddress_ti;
2230 proto_tree *ptp_tree, *ptp_transportspecific_tree, *ptp_flags_tree, *ptp_managementData_tree,
2231 *ptp_clockType_tree, *ptp_protocolAddress_tree;
2233 /* Make entries in Protocol column and Info column on summary display */
2234 if (check_col(pinfo->cinfo, COL_PROTOCOL))
2235 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PTPv2");
2237 /* Get control field (what kind of message is this? (Sync, DelayReq, ...) */
2239 ptp_v2_messageid = 0x0F & tvb_get_guint8 (tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET);
2241 /* Extend Info column with managementId */
2242 if (check_col(pinfo->cinfo, COL_INFO))
2244 /* Create and set the string for "Info" column */
2245 if ( ptp_v2_messageid == PTP_V2_MANAGEMENT_MESSAGE )
2249 tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
2250 /* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
2253 case PTP_V2_TLV_TYPE_MANAGEMENT:
2254 /* Get the managementId */
2255 ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET);
2256 ptp_v2_management_action = 0x0F & tvb_get_guint8(tvb, PTP_V2_MM_ACTION_OFFSET);
2257 col_add_fstr(pinfo->cinfo, COL_INFO, "Management (%s) %s",
2258 val_to_str(ptp_v2_mm_managementId, ptp_v2_managementID_infocolumn_vals, "Unknown management Id %u"),
2259 val_to_str(ptp_v2_management_action, ptp_v2_mm_action_vals, "Unknown Action %u"));
2261 case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS:
2262 /* Get the managementErrorId */
2263 ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET);
2264 col_add_fstr(pinfo->cinfo, COL_INFO, "Management Error Message (%s)", val_to_str(ptp_v2_mm_managementId,
2265 ptp2_managementErrorId_vals, "Unknown Error Id %u"));
2268 col_set_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
2274 col_set_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
2280 ti = proto_tree_add_item(tree, proto_ptp, tvb, 0, -1, FALSE);
2282 ptp_tree = proto_item_add_subtree(ti, ett_ptp_v2);
2284 transportspecific_ti = proto_tree_add_item(ptp_tree,
2285 hf_ptp_v2_transportspecific, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
2287 ptp_transportspecific_tree = proto_item_add_subtree(transportspecific_ti, ett_ptp_v2_transportspecific);
2289 if (ptpv2_oE == TRUE)
2291 proto_tree_add_item(ptp_transportspecific_tree,
2292 hf_ptp_v2_transportspecific_802as_conform, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
2296 proto_tree_add_item(ptp_transportspecific_tree,
2297 hf_ptp_v2_transportspecific_v1_compatibility, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
2300 proto_tree_add_item(ptp_tree,
2301 hf_ptp_v2_messageid, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
2303 proto_tree_add_item(ptp_tree,
2304 hf_ptp_v2_versionptp, tvb, PTP_V2_VERSIONPTP_OFFSET, 1, FALSE);
2306 proto_tree_add_item(ptp_tree,
2307 hf_ptp_v2_messagelength, tvb, PTP_V2_MESSAGE_LENGTH_OFFSET, 2, FALSE);
2309 proto_tree_add_item(ptp_tree,
2310 hf_ptp_v2_domainnumber, tvb, PTP_V2_DOMAIN_NUMBER_OFFSET, 1, FALSE);
2313 flags_ti = proto_tree_add_item(ptp_tree,
2314 hf_ptp_v2_flags, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2316 ptp_flags_tree = proto_item_add_subtree(flags_ti, ett_ptp_v2_flags);
2318 proto_tree_add_item(ptp_flags_tree,
2319 hf_ptp_v2_flags_security, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2321 proto_tree_add_item(ptp_flags_tree,
2322 hf_ptp_v2_flags_specific2, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2324 proto_tree_add_item(ptp_flags_tree,
2325 hf_ptp_v2_flags_specific1, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2327 proto_tree_add_item(ptp_flags_tree,
2328 hf_ptp_v2_flags_unicast, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2330 proto_tree_add_item(ptp_flags_tree,
2331 hf_ptp_v2_flags_twostep, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2333 proto_tree_add_item(ptp_flags_tree,
2334 hf_ptp_v2_flags_alternatemaster, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2336 proto_tree_add_item(ptp_flags_tree,
2337 hf_ptp_v2_flags_frequencytraceable, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2339 proto_tree_add_item(ptp_flags_tree,
2340 hf_ptp_v2_flags_timetraceable, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2342 proto_tree_add_item(ptp_flags_tree,
2343 hf_ptp_v2_flags_ptptimescale, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2345 proto_tree_add_item(ptp_flags_tree,
2346 hf_ptp_v2_flags_utcoffsetvalid, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2348 proto_tree_add_item(ptp_flags_tree,
2349 hf_ptp_v2_flags_li59, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2351 proto_tree_add_item(ptp_flags_tree,
2352 hf_ptp_v2_flags_li61, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
2354 temp = PTP_V2_CORRECTIONNS_OFFSET;
2356 dissect_ptp_v2_timeInterval(tvb, &temp, ptp_tree, "correction", hf_ptp_v2_correction, hf_ptp_v2_correctionsubns);
2358 proto_tree_add_item(ptp_tree,
2359 hf_ptp_v2_clockidentity, tvb, PTP_V2_CLOCKIDENTITY_OFFSET, 8, FALSE);
2361 proto_tree_add_item(ptp_tree,
2362 hf_ptp_v2_sourceportid, tvb, PTP_V2_SOURCEPORTID_OFFSET, 2, FALSE);
2364 proto_tree_add_item(ptp_tree,
2365 hf_ptp_v2_sequenceid, tvb, PTP_V2_SEQUENCEID_OFFSET, 2, FALSE);
2367 proto_tree_add_item(ptp_tree,
2368 hf_ptp_v2_control, tvb, PTP_V2_CONTROL_OFFSET, 1, FALSE);
2370 proto_tree_add_item(ptp_tree,
2371 hf_ptp_v2_logmessageperiod, tvb, PTP_V2_LOGMESSAGEPERIOD_OFFSET, 1, FALSE);
2373 switch(ptp_v2_messageid){
2374 case PTP_V2_ANNOUNCE_MESSAGE:{
2378 guint16 tlv_total_length;
2380 proto_tree *ptp_tlv_tree;
2382 timeStamp = tvb_get_ntohl(tvb, PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET);
2383 timeStamp = timeStamp << 16;
2384 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET+4);
2386 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origintimestamp_seconds, tvb,
2387 PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2389 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origintimestamp_nanoseconds, tvb,
2390 PTP_V2_AN_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2392 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origincurrentutcoffset, tvb,
2393 PTP_V2_AN_ORIGINCURRENTUTCOFFSET_OFFSET, 2, FALSE);
2395 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_priority1, tvb,
2396 PTP_V2_AN_PRIORITY_1_OFFSET, 1, FALSE);
2398 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockclass, tvb,
2399 PTP_V2_AN_GRANDMASTERCLOCKCLASS_OFFSET, 1, FALSE);
2401 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockaccuracy, tvb,
2402 PTP_V2_AN_GRANDMASTERCLOCKACCURACY_OFFSET, 1, FALSE);
2404 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockvariance, tvb,
2405 PTP_V2_AN_GRANDMASTERCLOCKVARIANCE_OFFSET, 2, FALSE);
2407 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_priority2, tvb,
2408 PTP_V2_AN_PRIORITY_2_OFFSET, 1, FALSE);
2410 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockidentity, tvb,
2411 PTP_V2_AN_GRANDMASTERCLOCKIDENTITY_OFFSET, 8, FALSE);
2413 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_localstepsremoved, tvb,
2414 PTP_V2_AN_LOCALSTEPSREMOVED_OFFSET, 2, FALSE);
2416 proto_tree_add_item(ptp_tree,
2417 hf_ptp_v2_an_timesource, tvb, PTP_V2_AN_TIMESOURCE_OFFSET, 1, FALSE);
2419 tlv_total_length = 0;
2420 while (tvb_reported_length_remaining(tvb, PTP_V2_AN_TLV_OFFSET + tlv_total_length) >= 2)
2422 /* There are TLV's to be processed */
2423 tlv_type = tvb_get_ntohs (tvb, PTP_V2_AN_TLV_OFFSET+tlv_total_length+PTP_V2_AN_TLV_TYPE_OFFSET);
2424 tlv_length = tvb_get_ntohs (tvb, PTP_V2_AN_TLV_OFFSET+tlv_total_length+PTP_V2_AN_TLV_LENGTHFIELD_OFFSET);
2426 tlv_ti = proto_tree_add_text(
2429 PTP_V2_AN_TLV_OFFSET + tlv_total_length,
2430 tlv_length + PTP_V2_AN_TLV_DATA_OFFSET,
2432 val_to_str(tlv_type,
2433 ptp_v2_TLV_type_vals,
2436 ptp_tlv_tree = proto_item_add_subtree(tlv_ti, ett_ptp_v2_tlv);
2438 proto_tree_add_item(ptp_tlv_tree,
2439 hf_ptp_v2_an_tlv_tlvtype,
2441 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_TYPE_OFFSET,
2445 proto_tree_add_item(ptp_tlv_tree,
2446 hf_ptp_v2_an_tlv_lengthfield,
2448 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_LENGTHFIELD_OFFSET,
2454 case PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR:
2456 proto_tree_add_item(ptp_tlv_tree,
2457 hf_ptp_v2_atoi_tlv_keyfield,
2459 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_KEYFIELD_OFFSET,
2463 proto_tree_add_item(ptp_tlv_tree,
2464 hf_ptp_v2_atoi_tlv_currentoffset,
2466 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_CURRENTOFFSET_OFFSET,
2470 proto_tree_add_item(ptp_tlv_tree,
2471 hf_ptp_v2_atoi_tlv_jumpseconds,
2473 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_JUMPSECONDS_OFFSET,
2477 proto_tree_add_item(ptp_tlv_tree,
2478 hf_ptp_v2_atoi_tlv_timeofnextjump,
2480 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_TIMEOFNEXTJUMP_OFFSET,
2484 Offset = PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_DISPLAYNAME_OFFSET;
2485 dissect_ptp_v2_text(tvb,
2488 hf_ptp_v2_atoi_tlv_displayname,
2489 hf_ptp_v2_atoi_tlv_displayname_length);
2495 proto_tree_add_item(ptp_tlv_tree,
2496 hf_ptp_v2_an_tlv_data,
2498 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_DATA_OFFSET,
2505 tlv_total_length += (tlv_length + PTP_V2_AN_TLV_DATA_OFFSET);
2511 case PTP_V2_SYNC_MESSAGE:
2512 case PTP_V2_DELAY_REQ_MESSAGE:{
2513 timeStamp = tvb_get_ntohl(tvb, PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET);
2514 timeStamp = timeStamp << 16;
2515 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET+4);
2517 proto_tree_add_item(ptp_tree, hf_ptp_v2_sdr_origintimestamp_seconds, tvb,
2518 PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2520 proto_tree_add_item(ptp_tree, hf_ptp_v2_sdr_origintimestamp_nanoseconds, tvb,
2521 PTP_V2_SDR_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2526 case PTP_V2_FOLLOWUP_MESSAGE:{
2527 timeStamp = tvb_get_ntohl(tvb, PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET);
2528 timeStamp = timeStamp << 16;
2529 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET+4);
2531 proto_tree_add_item(ptp_tree, hf_ptp_v2_fu_preciseorigintimestamp_seconds, tvb,
2532 PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2534 proto_tree_add_item(ptp_tree, hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds, tvb,
2535 PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2540 case PTP_V2_DELAY_RESP_MESSAGE:{
2541 timeStamp = tvb_get_ntohl(tvb, PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET);
2542 timeStamp = timeStamp << 16;
2543 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET+4);
2545 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_receivetimestamp_seconds, tvb,
2546 PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET, 6, FALSE);
2548 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_receivetimestamp_nanoseconds, tvb,
2549 PTP_V2_DR_RECEIVETIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2551 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_requestingportidentity, tvb,
2552 PTP_V2_DR_REQUESTINGPORTIDENTITY_OFFSET, 8, FALSE);
2554 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_requestingsourceportid, tvb,
2555 PTP_V2_DR_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
2560 case PTP_V2_PATH_DELAY_REQ_MESSAGE:{
2561 timeStamp = tvb_get_ntohl(tvb, PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET);
2562 timeStamp = timeStamp << 16;
2563 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET+4);
2565 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrq_origintimestamp_seconds, tvb,
2566 PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2568 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrq_origintimestamp_nanoseconds, tvb,
2569 PTP_V2_PDRQ_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2574 case PTP_V2_PATH_DELAY_RESP_MESSAGE:{
2575 timeStamp = tvb_get_ntohl(tvb, PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET);
2576 timeStamp = timeStamp << 16;
2577 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET+4);
2579 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestreceipttimestamp_seconds, tvb,
2580 PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2582 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds, tvb,
2583 PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2585 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestingportidentity, tvb,
2586 PTP_V2_PDRS_REQUESTINGPORTIDENTITY_OFFSET, 8, FALSE);
2588 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestingsourceportid, tvb,
2589 PTP_V2_PDRS_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
2594 case PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE:{
2595 timeStamp = tvb_get_ntohl(tvb, PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET);
2596 timeStamp = timeStamp << 16;
2597 timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET+4);
2599 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_responseorigintimestamp_seconds, tvb,
2600 PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET, 6, FALSE);
2602 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds, tvb,
2603 PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
2606 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_requestingportidentity, tvb,
2607 PTP_V2_PDFU_REQUESTINGPORTIDENTITY_OFFSET, 8, FALSE);
2609 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_requestingsourceportid, tvb,
2610 PTP_V2_PDFU_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
2615 case PTP_V2_SIGNALLING_MESSAGE:{
2617 guint16 tlv_type, tlv_length;
2619 proto_tree_add_item(ptp_tree, hf_ptp_v2_sig_targetportidentity, tvb,
2620 PTP_V2_SIG_TARGETPORTIDENTITY_OFFSET, 8, FALSE);
2622 proto_tree_add_item(ptp_tree, hf_ptp_v2_sig_targetportid, tvb,
2623 PTP_V2_SIG_TARGETPORTID_OFFSET, 2, FALSE);
2625 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_tlvType, tvb,
2626 PTP_V2_SIG_TARGETPORTID_OFFSET+2, 2, FALSE);
2628 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_lengthField, tvb,
2629 PTP_V2_SIG_TARGETPORTID_OFFSET+4, 2, FALSE);
2631 tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
2632 tlv_length = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_LENGTHFIELD_OFFSET);
2634 if (tlv_length <= 2)
2639 /* ToDO: Add dissector for TLVs and allow multiple TLVs */
2640 proto_tree_add_text(ptp_tree, tvb, PTP_V2_SIG_TARGETPORTID_OFFSET+6, tlv_length, "Data");
2644 case PTP_V2_MANAGEMENT_MESSAGE:
2646 guint16 tlv_type, tlv_length;
2648 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_targetportidentity, tvb,
2649 PTP_V2_MM_TARGETPORTIDENTITY_OFFSET, 8, FALSE);
2651 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_targetportid, tvb,
2652 PTP_V2_MM_TARGETPORTID_OFFSET, 2, FALSE);
2654 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_startingboundaryhops, tvb,
2655 PTP_V2_MM_STARTINGBOUNDARYHOPS_OFFSET, 1, FALSE);
2657 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_boundaryhops, tvb,
2658 PTP_V2_MM_BOUNDARYHOPS_OFFSET, 1, FALSE);
2660 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_action, tvb,
2661 PTP_V2_MM_ACTION_OFFSET, 1, FALSE);
2663 /* management TLV */
2664 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_tlvType, tvb,
2665 PTP_V2_MM_TLV_TYPE_OFFSET, 2, FALSE);
2667 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_lengthField, tvb,
2668 PTP_V2_MM_TLV_LENGTHFIELD_OFFSET, 2, FALSE);
2670 tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
2671 tlv_length = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_LENGTHFIELD_OFFSET);
2673 /* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
2675 case PTP_V2_TLV_TYPE_MANAGEMENT:
2677 guint16 ptp_v2_managementId;
2678 guint16 Offset = PTP_V2_MM_TLV_DATAFIELD_OFFSET;
2680 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_managementId, tvb,
2681 PTP_V2_MM_TLV_MANAGEMENTID_OFFSET, 2, FALSE);
2683 ptp_v2_managementId = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET);
2685 if (tlv_length <= 2)
2691 managementData_ti = proto_tree_add_text(ptp_tree, tvb, Offset, tlv_length, "Data");
2693 /* data field of the management message (subtree)*/
2694 ptp_managementData_tree = proto_item_add_subtree(managementData_ti, ett_ptp_v2_managementData);
2696 switch(ptp_v2_managementId) {
2697 case PTP_V2_MM_ID_NULL_MANAGEMENT:
2699 /* no data in NULL management */
2702 case PTP_V2_MM_ID_CLOCK_DESCRIPTION:
2704 guint16 N = 0, S = 0;
2705 clockType_ti = proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockType, tvb,
2708 ptp_clockType_tree = proto_item_add_subtree(clockType_ti, ett_ptp_v2_clockType);
2709 /* ClockType Subtree */
2710 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_ordinaryClock, tvb,
2713 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_boundaryClock, tvb,
2716 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_p2p_transparentClock, tvb,
2719 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_e2e_transparentClock, tvb,
2722 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_managementNode, tvb,
2725 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_reserved, tvb,
2729 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
2730 hf_ptp_v2_mm_physicalLayerProtocol, hf_ptp_v2_mm_physicalLayerProtocol_length);
2732 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_physicalAddressLength, tvb,
2735 S = tvb_get_ntohs (tvb, Offset);
2738 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_physicalAddress, tvb,
2742 N = tvb_get_ntohs (tvb, Offset+2);
2744 protocolAddress_ti = proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_protocolAddress, tvb,
2745 Offset+4, N, FALSE);
2747 ptp_protocolAddress_tree = proto_item_add_subtree(protocolAddress_ti, ett_ptp_v2_protocolAddress);
2748 /* physicalLayerProtocol subtree */
2749 proto_tree_add_item(ptp_protocolAddress_tree, hf_ptp_v2_mm_protocolAddress_networkProtocol, tvb,
2752 proto_tree_add_item(ptp_protocolAddress_tree, hf_ptp_v2_mm_protocolAddress_length, tvb,
2753 Offset+2, 2, FALSE);
2755 proto_tree_add_item(ptp_protocolAddress_tree, hf_ptp_v2_mm_protocolAddress, tvb,
2756 Offset+4, N, FALSE);
2760 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_manufacturerIdentity, tvb,
2765 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
2769 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
2770 hf_ptp_v2_mm_productDescription, hf_ptp_v2_mm_productDescription_length);
2771 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
2772 hf_ptp_v2_mm_revisionData, hf_ptp_v2_mm_revisionData_length);
2773 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
2774 hf_ptp_v2_mm_userDescription, hf_ptp_v2_mm_userDescription_length);
2776 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_profileIdentity, tvb,
2780 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
2781 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
2783 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
2788 case PTP_V2_MM_ID_USER_DESCRIPTION:
2791 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
2792 hf_ptp_v2_mm_userDescription, hf_ptp_v2_mm_userDescription_length);
2794 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
2795 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
2797 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
2802 case PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE:
2807 case PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE:
2812 case PTP_V2_MM_ID_INITIALIZE:
2814 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_initializationKey, tvb,
2818 case PTP_V2_MM_ID_FAULT_LOG:
2821 proto_item *ptpError_ti;
2822 proto_tree *ptpError_subtree;
2824 num = tvb_get_ntohs (tvb, Offset);
2826 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberOfFaultRecords, tvb,
2830 for (i = 1; i <= num; i++)
2832 ptpError_ti = proto_tree_add_text(ptp_managementData_tree, tvb, Offset, tvb_get_ntohs (tvb, Offset), "Fault record");
2835 ptpError_subtree = proto_item_add_subtree(ptpError_ti, ett_ptp_v2_faultRecord);
2837 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_faultRecordLength, tvb,
2841 timeStamp = tvb_get_ntohl(tvb, Offset);
2842 timeStamp = timeStamp << 16;
2843 timeStamp = timeStamp | tvb_get_ntohs(tvb, Offset+4);
2845 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_faultTime_s, tvb,
2849 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_faultTime_ns, tvb,
2852 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_severityCode, tvb,
2856 dissect_ptp_v2_text (tvb, &Offset, ptpError_subtree,
2857 hf_ptp_v2_mm_faultName, hf_ptp_v2_mm_faultName_length);
2859 dissect_ptp_v2_text (tvb, &Offset, ptpError_subtree,
2860 hf_ptp_v2_mm_faultValue, hf_ptp_v2_mm_faultValue_length);
2862 dissect_ptp_v2_text (tvb, &Offset, ptpError_subtree,
2863 hf_ptp_v2_mm_faultDescription, hf_ptp_v2_mm_faultDescription_length);
2866 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
2867 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
2869 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
2874 case PTP_V2_MM_ID_FAULT_LOG_RESET:
2879 case PTP_V2_MM_ID_DEFAULT_DATA_SET:
2881 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_TSC, tvb,
2882 PTP_V2_MM_TLV_DATAFIELD_OFFSET, 1, FALSE);
2884 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_dds_SO, tvb,
2885 PTP_V2_MM_TLV_DATAFIELD_OFFSET, 1, FALSE);
2887 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
2888 PTP_V2_MM_RESERVED1, 1, FALSE);
2890 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberPorts, tvb,
2891 PTP_V2_MM_NUMBERPORTS, 2, FALSE);
2893 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority1, tvb,
2894 PTP_V2_MM_PRIORITY1, 1, FALSE);
2896 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockclass, tvb,
2897 PTP_V2_MM_CLOCKQUALITY, 1, FALSE);
2899 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockaccuracy, tvb,
2900 PTP_V2_MM_CLOCKQUALITY+1, 1, FALSE);
2902 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockvariance, tvb,
2903 PTP_V2_MM_CLOCKQUALITY+2, 2, FALSE);
2905 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority2, tvb,
2906 PTP_V2_MM_PRIORITY2, 1, FALSE);
2908 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
2909 PTP_V2_MM_CLOCKIDENTITY, 8, FALSE);
2911 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_domainNumber, tvb,
2912 PTP_V2_MM_DOMAINNUMBER, 1, FALSE);
2914 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
2915 PTP_V2_MM_RESERVED2, 1, FALSE);
2918 case PTP_V2_MM_ID_CURRENT_DATA_SET:
2920 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_stepsRemoved, tvb,
2924 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
2925 "Offset from Master", hf_ptp_v2_mm_offset_ns, hf_ptp_v2_mm_offset_subns);
2926 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
2927 "Mean path delay", hf_ptp_v2_mm_pathDelay_ns, hf_ptp_v2_mm_pathDelay_subns);
2930 case PTP_V2_MM_ID_PARENT_DATA_SET:
2932 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_parentIdentity, tvb,
2935 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_parentPort, tvb,
2936 Offset+8, 2, FALSE);
2939 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_parentStats, tvb,
2943 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
2947 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_observedParentOffsetScaledLogVariance, tvb,
2951 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_observedParentClockPhaseChangeRate, tvb,
2955 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterPriority1, tvb,
2959 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterclockclass, tvb,
2962 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterclockaccuracy, tvb,
2963 Offset+1, 1, FALSE);
2965 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterclockvariance, tvb,
2966 Offset+2, 2, FALSE);
2969 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterPriority2, tvb,
2973 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterIdentity, tvb,
2978 case PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET:
2980 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentUtcOffset, tvb,
2984 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_61, tvb,
2986 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_59, tvb,
2988 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_UTCV, tvb,
2990 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PTP, tvb,
2992 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_TTRA, tvb,
2994 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_FTRA, tvb,
2998 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_timesource, tvb,
3003 case PTP_V2_MM_ID_PORT_DATA_SET:
3005 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3009 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PortNumber, tvb,
3013 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_portState, tvb,
3017 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinDelayReqInterval, tvb,
3021 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
3022 "Peer mean path delay", hf_ptp_v2_mm_peerMeanPathDelay_ns, hf_ptp_v2_mm_peerMeanPathDelay_subns);
3024 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logAnnounceInterval, tvb,
3028 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_announceReceiptTimeout, tvb,
3032 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logSyncInterval, tvb,
3036 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_delayMechanism, tvb,
3040 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinPdelayReqInterval, tvb,
3044 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_versionNumber, tvb,
3050 case PTP_V2_MM_ID_PRIORITY1:
3052 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority1, tvb,
3054 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3055 Offset+1, 1, FALSE);
3058 case PTP_V2_MM_ID_PRIORITY2:
3060 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority2, tvb,
3062 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3063 Offset+1, 1, FALSE);
3066 case PTP_V2_MM_ID_DOMAIN:
3068 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_domainNumber, tvb,
3070 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3071 Offset+1, 1, FALSE);
3074 case PTP_V2_MM_ID_SLAVE_ONLY:
3076 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_SO, tvb,
3078 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3079 Offset+1, 1, FALSE);
3082 case PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL:
3084 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logAnnounceInterval, tvb,
3087 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3088 Offset+1, 1, FALSE);
3091 case PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT:
3093 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_announceReceiptTimeout, tvb,
3096 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3097 Offset+1, 1, FALSE);
3100 case PTP_V2_MM_ID_LOG_SYNC_INTERVAL:
3102 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logSyncInterval, tvb,
3105 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3106 Offset+1, 1, FALSE);
3109 case PTP_V2_MM_ID_VERSION_NUMBER:
3111 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_versionNumber, tvb,
3114 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3115 Offset+1, 1, FALSE);
3118 case PTP_V2_MM_ID_ENABLE_PORT:
3123 case PTP_V2_MM_ID_DISABLE_PORT:
3128 case PTP_V2_MM_ID_TIME:
3130 timeStamp = tvb_get_ntohl(tvb, Offset);
3131 timeStamp = timeStamp << 16;
3132 timeStamp = timeStamp | tvb_get_ntohs(tvb, Offset+4);
3134 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentTime_s, tvb,
3138 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentTime_ns, tvb,
3142 case PTP_V2_MM_ID_CLOCK_ACCURACY:
3144 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockAccuracy, tvb,
3146 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3147 Offset+1, 1, FALSE);
3150 case PTP_V2_MM_ID_UTC_PROPERTIES:
3152 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentUtcOffset, tvb,
3156 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_61, tvb,
3158 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_59, tvb,
3160 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_UTCV, tvb,
3164 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3168 case PTP_V2_MM_ID_TRACEABILITY_PROPERTIES:
3170 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_TTRA, tvb,
3172 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_FTRA, tvb,
3176 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3181 case PTP_V2_MM_ID_TIMESCALE_PROPERTIES:
3183 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PTP, tvb,
3187 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_timesource, tvb,
3192 case PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE:
3194 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_ucEN, tvb,
3198 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3202 case PTP_V2_MM_ID_PATH_TRACE_LIST:
3205 /* one or more ClockIdentity */
3206 for (i = 1; i <= (tlv_length / 8); i++)
3208 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3214 case PTP_V2_MM_ID_PATH_TRACE_ENABLE:
3216 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_ptEN, tvb,
3220 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3225 case PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE:
3230 case PTP_V2_MM_ID_UNICAST_MASTER_TABLE:
3235 case PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE:
3240 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE:
3245 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED:
3250 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE:
3255 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE:
3257 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_keyField, tvb,
3261 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_atEN, tvb,
3267 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME:
3269 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_keyField, tvb,
3273 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3274 hf_ptp_v2_mm_displayName, hf_ptp_v2_mm_displayName_length);
3276 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3277 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
3279 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
3284 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY:
3286 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_maxKey, tvb,
3290 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3295 case PTP_V2_MM_ID_ALTERNATE_MASTER:
3297 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_transmitAlternateMulticastSync, tvb,
3301 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberOfAlternateMasters, tvb,
3305 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logAlternateMulticastSyncInterval, tvb,
3309 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3313 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES:
3315 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_keyField, tvb,
3319 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentOffset, tvb,
3323 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_jumpSeconds, tvb,
3327 timeStamp = tvb_get_ntohl(tvb, Offset);
3328 timeStamp = timeStamp << 16;
3329 timeStamp = timeStamp | tvb_get_ntohs(tvb, Offset+4);
3331 proto_tree_add_text(ptp_managementData_tree, tvb, Offset, 6,
3332 "Time of next jump (seconds): %" G_GINT64_MODIFIER "u", timeStamp);
3335 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3339 case PTP_V2_MM_ID_TC_DEFAULT_DATA_SET:
3341 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3345 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberPorts, tvb,
3349 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_delayMechanism, tvb,
3353 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_primaryDomain, tvb,
3358 case PTP_V2_MM_ID_TC_PORT_DATA_SET:
3360 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3364 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PortNumber, tvb,
3368 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_faultyFlag, tvb,
3372 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinPdelayReqInterval, tvb,
3376 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
3377 "Peer mean path delay", hf_ptp_v2_mm_peerMeanPathDelay_ns, hf_ptp_v2_mm_peerMeanPathDelay_subns);
3380 case PTP_V2_MM_ID_PRIMARY_DOMAIN:
3382 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_primaryDomain, tvb,
3385 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3386 Offset+1, 1, FALSE);
3389 case PTP_V2_MM_ID_DELAY_MECHANISM:
3391 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_delayMechanism, tvb,
3394 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3395 Offset+1, 1, FALSE);
3398 case PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL:
3400 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinPdelayReqInterval, tvb,
3403 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3404 Offset+1, 1, FALSE);
3412 } /* switch(ptp_v2_managementId) */
3415 case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS:
3417 /* there is only one error TLV */
3418 guint16 Offset = PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET;
3420 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_managementErrorId, tvb,
3424 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_managementId, tvb,
3428 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_reserved, tvb,
3432 /* optional Field! */
3433 if (Offset - PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET + 2 < tlv_length)
3435 dissect_ptp_v2_text (tvb, &Offset, ptp_tree,
3436 hf_ptp_v2_mm_displayData, hf_ptp_v2_mm_displayData_length);
3439 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3440 if ( (Offset - PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET) % 2 )
3442 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_pad, tvb,
3451 } /* switch TLV Type */
3452 } /* case Management Message */
3453 } /* switch message ID*/
3458 /* Register the protocol with Wireshark */
3461 proto_register_ptp(void)
3463 static hf_register_info hf[] = {
3464 /* PTPv1 fields **********************************************************/
3465 /*Common fields for all frames*/
3466 { &hf_ptp_versionptp,
3467 { "versionPTP", "ptp.versionptp",
3468 FT_UINT16, BASE_DEC, NULL, 0x00,
3471 { &hf_ptp_versionnetwork,
3472 { "versionNetwork", "ptp.versionnetwork",
3473 FT_UINT16, BASE_DEC, NULL, 0x00,
3476 { &hf_ptp_subdomain,
3477 { "subdomain", "ptp.subdomain",
3478 FT_STRING, BASE_DEC, NULL, 0x00,
3481 { &hf_ptp_messagetype,
3482 { "messageType", "ptp.messagetype",
3483 FT_UINT8, BASE_DEC, VALS(ptp_messagetype_vals), 0x00,
3486 { &hf_ptp_sourcecommunicationtechnology,
3487 { "sourceCommunicationTechnology", "ptp.sourcecommunicationtechnology",
3488 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3491 { &hf_ptp_sourceuuid,
3492 { "sourceUuid", "ptp.sourceuuid",
3493 FT_ETHER, BASE_DEC, NULL, 0x00,
3496 { &hf_ptp_sourceportid,
3497 { "sourcePortId", "ptp.sourceportid",
3498 FT_UINT16, BASE_DEC, NULL, 0x00,
3501 { &hf_ptp_sequenceid,
3502 { "sequenceId", "ptp.sequenceid",
3503 FT_UINT16, BASE_DEC, NULL, 0x00,
3507 { "control", "ptp.control",
3508 FT_UINT8, BASE_DEC, VALS(ptp_control_vals), 0x00,
3513 { "flags", "ptp.flags",
3514 FT_UINT16, BASE_HEX, NULL, 0x00,
3517 { &hf_ptp_flags_li61,
3518 { "PTP_LI61", "ptp.flags.li61",
3519 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_LI61_BITMASK,
3522 { &hf_ptp_flags_li59,
3523 { "PTP_LI59", "ptp.flags.li59",
3524 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_LI59_BITMASK,
3527 { &hf_ptp_flags_boundary_clock,
3528 { "PTP_BOUNDARY_CLOCK", "ptp.flags.boundary_clock",
3529 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_BOUNDARY_CLOCK_BITMASK,
3532 { &hf_ptp_flags_assist,
3533 { "PTP_ASSIST", "ptp.flags.assist",
3534 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_ASSIST_BITMASK,
3537 { &hf_ptp_flags_ext_sync,
3538 { "PTP_EXT_SYNC", "ptp.flags.ext_sync",
3539 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_EXT_SYNC_BITMASK,
3542 { &hf_ptp_flags_parent,
3543 { "PTP_PARENT_STATS", "ptp.flags.parent_stats",
3544 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_PARENT_STATS_BITMASK,
3547 { &hf_ptp_flags_sync_burst,
3548 { "PTP_SYNC_BURST", "ptp.flags.sync_burst",
3549 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_SYNC_BURST_BITMASK,
3552 /*END OF THE FLAG-FIELD*/
3554 /*offsets for ptp_sync and delay_req (=sdr) messages*/
3555 { &hf_ptp_sdr_origintimestamp,
3556 { "originTimestamp", "ptp.sdr.origintimestamp",
3557 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
3560 { &hf_ptp_sdr_origintimestamp_seconds,
3561 { "originTimestamp (seconds)", "ptp.sdr.origintimestamp_seconds",
3562 FT_UINT32, BASE_DEC, NULL, 0x00,
3565 { &hf_ptp_sdr_origintimestamp_nanoseconds,
3566 { "originTimestamp (nanoseconds)", "ptp.sdr.origintimestamp_nanoseconds",
3567 FT_INT32, BASE_DEC, NULL, 0x00,
3570 { &hf_ptp_sdr_epochnumber,
3571 { "epochNumber", "ptp.sdr.epochnumber",
3572 FT_UINT16, BASE_DEC, NULL, 0x00,
3575 { &hf_ptp_sdr_currentutcoffset,
3576 { "currentUTCOffset", "ptp.sdr.currentutcoffset",
3577 FT_INT16, BASE_DEC, NULL, 0x00,
3580 { &hf_ptp_sdr_grandmastercommunicationtechnology,
3581 { "grandmasterCommunicationTechnology", "ptp.sdr.grandmastercommunicationtechnology",
3582 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3585 { &hf_ptp_sdr_grandmasterclockuuid,
3586 { "grandMasterClockUuid", "ptp.sdr.grandmasterclockuuid",
3587 FT_ETHER, BASE_DEC, NULL, 0x00,
3590 { &hf_ptp_sdr_grandmasterportid,
3591 { "grandmasterPortId", "ptp.sdr.grandmasterportid",
3592 FT_UINT16, BASE_DEC, NULL, 0x00,
3595 { &hf_ptp_sdr_grandmastersequenceid,
3596 { "grandmasterSequenceId", "ptp.sdr.grandmastersequenceid",
3597 FT_UINT16, BASE_DEC, NULL, 0x00,
3600 { &hf_ptp_sdr_grandmasterclockstratum,
3601 { "grandmasterClockStratum", "ptp.sdr.grandmasterclockstratum",
3602 FT_UINT8, BASE_DEC, NULL, 0x00,
3605 { &hf_ptp_sdr_grandmasterclockidentifier,
3606 { "grandmasterClockIdentifier", "ptp.sdr.grandmasterclockidentifier",
3607 FT_STRING, BASE_DEC, NULL, 0x00,
3610 { &hf_ptp_sdr_grandmasterclockvariance,
3611 { "grandmasterClockVariance", "ptp.sdr.grandmasterclockvariance",
3612 FT_INT16, BASE_DEC, NULL, 0x00,
3615 { &hf_ptp_sdr_grandmasterpreferred,
3616 { "grandmasterPreferred", "ptp.sdr.grandmasterpreferred",
3617 FT_UINT8, BASE_DEC, NULL, 0x00,
3620 { &hf_ptp_sdr_grandmasterisboundaryclock,
3621 { "grandmasterIsBoundaryClock", "ptp.sdr.grandmasterisboundaryclock",
3622 FT_UINT8, BASE_DEC, NULL, 0x00,
3625 { &hf_ptp_sdr_syncinterval,
3626 { "syncInterval", "ptp.sdr.syncinterval",
3627 FT_INT8, BASE_DEC, NULL, 0x00,
3630 { &hf_ptp_sdr_localclockvariance,
3631 { "localClockVariance", "ptp.sdr.localclockvariance",
3632 FT_INT16, BASE_DEC, NULL, 0x00,
3635 { &hf_ptp_sdr_localstepsremoved,
3636 { "localStepsRemoved", "ptp.sdr.localstepsremoved",
3637 FT_UINT16, BASE_DEC, NULL, 0x00,
3640 { &hf_ptp_sdr_localclockstratum,
3641 { "localClockStratum", "ptp.sdr.localclockstratum",
3642 FT_UINT8, BASE_DEC, NULL, 0x00,
3645 { &hf_ptp_sdr_localclockidentifier,
3646 { "localClockIdentifier", "ptp.sdr.localclockidentifier",
3647 FT_STRING, BASE_DEC, NULL, 0x00,
3650 { &hf_ptp_sdr_parentcommunicationtechnology,
3651 { "parentCommunicationTechnology", "ptp.sdr.parentcommunicationtechnology",
3652 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3655 { &hf_ptp_sdr_parentuuid,
3656 { "parentUuid", "ptp.sdr.parentuuid",
3657 FT_ETHER, BASE_DEC, NULL, 0x00,
3660 { &hf_ptp_sdr_parentportfield,
3661 { "parentPortField", "ptp.sdr.parentportfield",
3662 FT_UINT16, BASE_DEC, NULL, 0x00,
3665 { &hf_ptp_sdr_estimatedmastervariance,
3666 { "estimatedMasterVariance", "ptp.sdr.estimatedmastervariance",
3667 FT_INT16, BASE_DEC, NULL, 0x00,
3670 { &hf_ptp_sdr_estimatedmasterdrift,
3671 { "estimatedMasterDrift", "ptp.sdr.estimatedmasterdrift",
3672 FT_INT32, BASE_DEC, NULL, 0x00,
3675 { &hf_ptp_sdr_utcreasonable,
3676 { "utcReasonable", "ptp.sdr.utcreasonable",
3677 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
3680 /*offsets for follow_up (=fu) messages*/
3681 { &hf_ptp_fu_associatedsequenceid,
3682 { "associatedSequenceId", "ptp.fu.associatedsequenceid",
3683 FT_UINT16, BASE_DEC, NULL, 0x00,
3686 { &hf_ptp_fu_preciseorigintimestamp,
3687 { "preciseOriginTimestamp", "ptp.fu.hf_ptp_fu_preciseorigintimestamp",
3688 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
3691 { &hf_ptp_fu_preciseorigintimestamp_seconds,
3692 { "preciseOriginTimestamp (seconds)", "ptp.fu.hf_ptp_fu_preciseorigintimestamp_seconds",
3693 FT_UINT32, BASE_DEC, NULL, 0x00,
3696 { &hf_ptp_fu_preciseorigintimestamp_nanoseconds,
3697 { "preciseOriginTimestamp (nanoseconds)", "ptp.fu.preciseorigintimestamp_nanoseconds",
3698 FT_INT32, BASE_DEC, NULL, 0x00,
3701 /*offsets for delay_resp (=dr) messages*/
3702 { &hf_ptp_dr_delayreceipttimestamp,
3703 { "delayReceiptTimestamp", "ptp.dr.delayreceipttimestamp",
3704 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
3707 { &hf_ptp_dr_delayreceipttimestamp_seconds,
3708 { "delayReceiptTimestamp (Seconds)", "ptp.dr.delayreceipttimestamp_seconds",
3709 FT_UINT32, BASE_DEC, NULL, 0x00,
3712 { &hf_ptp_dr_delayreceipttimestamp_nanoseconds,
3713 { "delayReceiptTimestamp (nanoseconds)", "ptp.dr.delayreceipttimestamp_nanoseconds",
3714 FT_INT32, BASE_DEC, NULL, 0x00,
3717 { &hf_ptp_dr_requestingsourcecommunicationtechnology,
3718 { "requestingSourceCommunicationTechnology", "ptp.dr.requestingsourcecommunicationtechnology",
3719 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3722 { &hf_ptp_dr_requestingsourceuuid,
3723 { "requestingSourceUuid", "ptp.dr.requestingsourceuuid",
3724 FT_ETHER, BASE_DEC, NULL, 0x00,
3727 { &hf_ptp_dr_requestingsourceportid,
3728 { "requestingSourcePortId", "ptp.dr.requestingsourceportid",
3729 FT_UINT16, BASE_DEC, NULL, 0x00,
3732 { &hf_ptp_dr_requestingsourcesequenceid,
3733 { "requestingSourceSequenceId", "ptp.dr.requestingsourcesequenceid",
3734 FT_UINT16, BASE_DEC, NULL, 0x00,
3737 /*offsets for management (=mm) messages*/
3738 { &hf_ptp_mm_targetcommunicationtechnology,
3739 { "targetCommunicationTechnology", "ptp.mm.targetcommunicationtechnology",
3740 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3743 { &hf_ptp_mm_targetuuid,
3744 { "targetUuid", "ptp.mm.targetuuid",
3745 FT_ETHER, BASE_DEC, NULL, 0x00,
3748 { &hf_ptp_mm_targetportid,
3749 { "targetPortId", "ptp.mm.targetportid",
3750 FT_UINT16, BASE_DEC, NULL, 0x00,
3753 { &hf_ptp_mm_startingboundaryhops,
3754 { "startingBoundaryHops", "ptp.mm.startingboundaryhops",
3755 FT_INT16, BASE_DEC, NULL, 0x00,
3758 { &hf_ptp_mm_boundaryhops,
3759 { "boundaryHops", "ptp.mm.boundaryhops",
3760 FT_INT16, BASE_DEC, NULL, 0x00,
3763 { &hf_ptp_mm_managementmessagekey,
3764 { "managementMessageKey", "ptp.mm.managementmessagekey",
3765 FT_UINT8, BASE_DEC, VALS(ptp_managementMessageKey_vals), 0x00,
3768 { &hf_ptp_mm_parameterlength,
3769 { "parameterLength", "ptp.mm.parameterlength",
3770 FT_UINT16, BASE_DEC, NULL, 0x00,
3773 /*parameterlength > 0*/
3774 { &hf_ptp_mm_messageparameters,
3775 { "messageParameters", "ptp.mm.messageparameters",
3776 FT_BYTES, BASE_DEC, NULL, 0x00,
3779 /*ptp_mm_clock_identity (parameterlength = 64)*/
3780 { &hf_ptp_mm_clock_identity_clockcommunicationtechnology,
3781 { "clockCommunicationTechnology", "ptp.mm.clock.identity.clockcommunicationtechnology",
3782 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3785 { &hf_ptp_mm_clock_identity_clockuuidfield,
3786 { "clockUuidField", "ptp.mm.clock.identity.clockuuidfield",
3787 FT_ETHER, BASE_DEC, NULL, 0x00,
3790 { &hf_ptp_mm_clock_identity_clockportfield,
3791 { "clockPortField", "ptp.mm.clock.identity.clockportfield",
3792 FT_UINT16, BASE_DEC, NULL, 0x00,
3795 { &hf_ptp_mm_clock_identity_manufactureridentity,
3796 { "manufacturerIdentity", "ptp.mm.clock.identity.manufactureridentity",
3797 FT_BYTES, BASE_DEC, NULL, 0x00,
3801 /*ptp_mm_initialize_clock (parameterlength = 4)*/
3802 { &hf_ptp_mm_initialize_clock_initialisationkey,
3803 { "initialisationKey", "ptp.mm.initialize.clock.initialisationkey",
3804 FT_UINT16, BASE_DEC, NULL, 0x00,
3807 /*ptp_mm_set_subdomain (parameterlength = 16)*/
3808 { &hf_ptp_mm_set_subdomain_subdomainname,
3809 { "subdomainName", "ptp.mm.set.subdomain.subdomainname",
3810 FT_STRING, BASE_DEC, NULL, 0x00,
3813 /*ptp_mm_default_data_set (parameterlength = 76)*/
3814 { &hf_ptp_mm_default_data_set_clockcommunicationtechnology,
3815 { "clockCommunicationTechnology", "ptp.mm.default.data.set.clockcommunicationtechnology",
3816 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3819 { &hf_ptp_mm_default_data_set_clockuuidfield,
3820 { "clockUuidField", "ptp.mm.default.data.set.clockuuidfield",
3821 FT_ETHER, BASE_DEC, NULL, 0x00,
3824 { &hf_ptp_mm_default_data_set_clockportfield,
3825 { "clockPortField", "ptp.mm.default.data.set.clockportfield",
3826 FT_UINT16, BASE_DEC, NULL, 0x00,
3829 { &hf_ptp_mm_default_data_set_clockstratum,
3830 { "clockStratum", "ptp.mm.default.data.set.clockstratum",
3831 FT_UINT8, BASE_DEC, NULL, 0x00,
3834 { &hf_ptp_mm_default_data_set_clockidentifier,
3835 { "clockIdentifier", "ptp.mm.default.data.set.clockidentifier",
3836 FT_BYTES, BASE_DEC, NULL, 0x00,
3839 { &hf_ptp_mm_default_data_set_clockvariance,
3840 { "clockVariance", "ptp.mm.default.data.set.clockvariance",
3841 FT_UINT16, BASE_DEC, NULL, 0x00,
3844 { &hf_ptp_mm_default_data_set_clockfollowupcapable,
3845 { "clockFollowupCapable", "ptp.mm.default.data.set.clockfollowupcapable",
3846 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
3849 { &hf_ptp_mm_default_data_set_preferred,
3850 { "preferred", "ptp.mm.default.data.set.preferred",
3851 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
3854 { &hf_ptp_mm_default_data_set_initializable,
3855 { "initializable", "ptp.mm.default.data.set.initializable",
3856 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
3859 { &hf_ptp_mm_default_data_set_externaltiming,
3860 { "externalTiming", "ptp.mm.default.data.set.externaltiming",
3861 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
3864 { &hf_ptp_mm_default_data_set_isboundaryclock,
3865 { "isBoundaryClock", "ptp.mm.default.data.set.isboundaryclock",
3866 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
3869 { &hf_ptp_mm_default_data_set_syncinterval,
3870 { "syncInterval", "ptp.mm.default.data.set.syncinterval",
3871 FT_INT8, BASE_DEC, NULL, 0x00,
3874 { &hf_ptp_mm_default_data_set_subdomainname,
3875 { "subDomainName", "ptp.mm.default.data.set.subdomainname",
3876 FT_STRING, BASE_DEC, NULL, 0x00,
3879 { &hf_ptp_mm_default_data_set_numberports,
3880 { "numberPorts", "ptp.mm.default.data.set.numberports",
3881 FT_UINT16, BASE_DEC, NULL, 0x00,
3884 { &hf_ptp_mm_default_data_set_numberforeignrecords,
3885 { "numberForeignRecords", "ptp.mm.default.data.set.numberforeignrecords",
3886 FT_UINT16, BASE_DEC, NULL, 0x00,
3889 /*ptp_mm_update_default_data_set (parameterlength = 36)*/
3890 { &hf_ptp_mm_update_default_data_set_clockstratum,
3891 { "clockStratum", "ptp.mm.update.default.data.set.clockstratum",
3892 FT_UINT8, BASE_DEC, NULL, 0x00,
3895 { &hf_ptp_mm_update_default_data_set_clockidentifier,
3896 { "clockIdentifier", "ptp.mm.update.default.data.set.clockidentifier",
3897 FT_BYTES, BASE_DEC, NULL, 0x00,
3900 { &hf_ptp_mm_update_default_data_set_clockvariance,
3901 { "clockVariance", "ptp.mm.update.default.data.set.clockvariance",
3902 FT_UINT16, BASE_DEC, NULL, 0x00,
3905 { &hf_ptp_mm_update_default_data_set_preferred,
3906 { "preferred", "ptp.mm.update.default.data.set.preferred",
3907 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
3910 { &hf_ptp_mm_update_default_data_set_syncinterval,
3911 { "syncInterval", "ptp.mm.update.default.data.set.syncinterval",
3912 FT_INT8, BASE_DEC, NULL, 0x00,
3915 { &hf_ptp_mm_update_default_data_set_subdomainname,
3916 { "subdomainName", "ptp.mm.update.default.data.set.subdomainname",
3917 FT_STRING, BASE_DEC, NULL, 0x00,
3920 /*ptp_mm_current_data_set (parameterlength = 20)*/
3921 { &hf_ptp_mm_current_data_set_stepsremoved,
3922 { "stepsRemoved", "ptp.mm.current.data.set.stepsremoved",
3923 FT_UINT16, BASE_DEC, NULL, 0x00,
3926 { &hf_ptp_mm_current_data_set_offsetfrommaster,
3927 { "offsetFromMaster", "ptp.mm.current.data.set.offsetfrommaster",
3928 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
3931 { &hf_ptp_mm_current_data_set_offsetfrommasterseconds,
3932 { "offsetFromMasterSeconds", "ptp.mm.current.data.set.offsetfrommasterseconds",
3933 FT_UINT32, BASE_DEC, NULL, 0x00,
3936 { &hf_ptp_mm_current_data_set_offsetfrommasternanoseconds,
3937 { "offsetFromMasterNanoseconds", "ptp.mm.current.data.set.offsetfrommasternanoseconds",
3938 FT_INT32, BASE_DEC, NULL, 0x00,
3941 { &hf_ptp_mm_current_data_set_onewaydelay,
3942 { "oneWayDelay", "ptp.mm.current.data.set.onewaydelay",
3943 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
3946 { &hf_ptp_mm_current_data_set_onewaydelayseconds,
3947 { "oneWayDelaySeconds", "ptp.mm.current.data.set.onewaydelayseconds",
3948 FT_UINT32, BASE_DEC, NULL, 0x00,
3951 { &hf_ptp_mm_current_data_set_onewaydelaynanoseconds,
3952 { "oneWayDelayNanoseconds", "ptp.mm.current.data.set.onewaydelaynanoseconds",
3953 FT_INT32, BASE_DEC, NULL, 0x00,
3956 /*ptp_mm_parent_data_set (parameterlength = 90)*/
3957 { &hf_ptp_mm_parent_data_set_parentcommunicationtechnology,
3958 { "parentCommunicationTechnology", "ptp.mm.parent.data.set.parentcommunicationtechnology",
3959 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3962 { &hf_ptp_mm_parent_data_set_parentuuid,
3963 { "parentUuid", "ptp.mm.parent.data.set.parentuuid",
3964 FT_ETHER, BASE_DEC, NULL, 0x00,
3967 { &hf_ptp_mm_parent_data_set_parentportid,
3968 { "parentPortId", "ptp.mm.parent.data.set.parentportid",
3969 FT_UINT16, BASE_DEC, NULL, 0x00,
3972 { &hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber,
3973 { "parentLastSyncSequenceNumber", "ptp.mm.parent.data.set.parentlastsyncsequencenumber",
3974 FT_UINT16, BASE_DEC, NULL, 0x00,
3977 { &hf_ptp_mm_parent_data_set_parentfollowupcapable,
3978 { "parentFollowupCapable", "ptp.mm.parent.data.set.parentfollowupcapable",
3979 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
3982 { &hf_ptp_mm_parent_data_set_parentexternaltiming,
3983 { "parentExternalTiming", "ptp.mm.parent.data.set.parentexternaltiming",
3984 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
3987 { &hf_ptp_mm_parent_data_set_parentvariance,
3988 { "parentVariance", "ptp.mm.parent.data.set.parentvariance",
3989 FT_UINT16, BASE_DEC, NULL, 0x00,
3992 { &hf_ptp_mm_parent_data_set_parentstats,
3993 { "parentStats", "ptp.mm.parent.data.set.parentstats",
3994 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
3997 { &hf_ptp_mm_parent_data_set_observedvariance,
3998 { "observedVariance", "ptp.mm.parent.data.set.observedvariance",
3999 FT_INT16, BASE_DEC, NULL, 0x00,
4002 { &hf_ptp_mm_parent_data_set_observeddrift,
4003 { "observedDrift", "ptp.mm.parent.data.set.observeddrift",
4004 FT_INT32, BASE_DEC, NULL, 0x00,
4007 { &hf_ptp_mm_parent_data_set_utcreasonable,
4008 { "utcReasonable", "ptp.mm.parent.data.set.utcreasonable",
4009 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4012 { &hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology,
4013 { "grandmasterCommunicationTechnology", "ptp.mm.parent.data.set.grandmastercommunicationtechnology",
4014 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4017 { &hf_ptp_mm_parent_data_set_grandmasteruuidfield,
4018 { "grandmasterUuidField", "ptp.mm.parent.data.set.grandmasteruuidfield",
4019 FT_ETHER, BASE_DEC, NULL, 0x00,
4022 { &hf_ptp_mm_parent_data_set_grandmasterportidfield,
4023 { "grandmasterPortIdField", "ptp.mm.parent.data.set.grandmasterportidfield",
4024 FT_UINT16, BASE_DEC, NULL, 0x00,
4027 { &hf_ptp_mm_parent_data_set_grandmasterstratum,
4028 { "grandmasterStratum", "ptp.mm.parent.data.set.grandmasterstratum",
4029 FT_UINT8, BASE_DEC, NULL, 0x00,
4032 { &hf_ptp_mm_parent_data_set_grandmasteridentifier,
4033 { "grandmasterIdentifier", "ptp.mm.parent.data.set.grandmasteridentifier",
4034 FT_BYTES, BASE_DEC, NULL, 0x00,
4037 { &hf_ptp_mm_parent_data_set_grandmastervariance,
4038 { "grandmasterVariance", "ptp.mm.parent.data.set.grandmastervariance",
4039 FT_INT16, BASE_DEC, NULL, 0x00,
4042 { &hf_ptp_mm_parent_data_set_grandmasterpreferred,
4043 { "grandmasterPreferred", "ptp.mm.parent.data.set.grandmasterpreferred",
4044 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4047 { &hf_ptp_mm_parent_data_set_grandmasterisboundaryclock,
4048 { "grandmasterIsBoundaryClock", "ptp.mm.parent.data.set.grandmasterisboundaryclock",
4049 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4052 { &hf_ptp_mm_parent_data_set_grandmastersequencenumber,
4053 { "grandmasterSequenceNumber", "ptp.mm.parent.data.set.grandmastersequencenumber",
4054 FT_UINT16, BASE_DEC, NULL, 0x00,
4057 /*ptp_mm_port_data_set (parameterlength = 52)*/
4058 { &hf_ptp_mm_port_data_set_returnedportnumber,
4059 { "returnedPortNumber", "ptp.mm.port.data.set.returnedportnumber",
4060 FT_UINT16, BASE_DEC, NULL, 0x00,
4063 { &hf_ptp_mm_port_data_set_portstate,
4064 { "portState", "ptp.mm.port.data.set.portstate",
4065 FT_UINT8, BASE_DEC, NULL, 0x00,
4068 { &hf_ptp_mm_port_data_set_lastsynceventsequencenumber,
4069 { "lastSyncEventSequenceNumber", "ptp.mm.port.data.set.lastsynceventsequencenumber",
4070 FT_UINT16, BASE_DEC, NULL, 0x00,
4073 { &hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber,
4074 { "lastGeneralEventSequenceNumber", "ptp.mm.port.data.set.lastgeneraleventsequencenumber",
4075 FT_UINT16, BASE_DEC, NULL, 0x00,
4078 { &hf_ptp_mm_port_data_set_portcommunicationtechnology,
4079 { "portCommunicationTechnology", "ptp.mm.port.data.set.portcommunicationtechnology",
4080 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4083 { &hf_ptp_mm_port_data_set_portuuidfield,
4084 { "portUuidField", "ptp.mm.port.data.set.portuuidfield",
4085 FT_ETHER, BASE_DEC, NULL, 0x00,
4088 { &hf_ptp_mm_port_data_set_portidfield,
4089 { "portIdField", "ptp.mm.port.data.set.portidfield",
4090 FT_UINT16, BASE_DEC, NULL, 0x00,
4093 { &hf_ptp_mm_port_data_set_burstenabled,
4094 { "burstEnabled", "ptp.mm.port.data.set.burstenabled",
4095 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4098 { &hf_ptp_mm_port_data_set_subdomainaddressoctets,
4099 { "subdomainAddressOctets", "ptp.mm.port.data.set.subdomainaddressoctets",
4100 FT_UINT8, BASE_DEC, NULL, 0x00,
4103 { &hf_ptp_mm_port_data_set_eventportaddressoctets,
4104 { "eventPortAddressOctets", "ptp.mm.port.data.set.eventportaddressoctets",
4105 FT_UINT8, BASE_DEC, NULL, 0x00,
4108 { &hf_ptp_mm_port_data_set_generalportaddressoctets,
4109 { "generalPortAddressOctets", "ptp.mm.port.data.set.generalportaddressoctets",
4110 FT_UINT8, BASE_DEC, NULL, 0x00,
4113 { &hf_ptp_mm_port_data_set_subdomainaddress,
4114 { "subdomainAddress", "ptp.mm.port.data.set.subdomainaddress",
4115 FT_BYTES, BASE_DEC, NULL, 0x00,
4118 { &hf_ptp_mm_port_data_set_eventportaddress,
4119 { "eventPortAddress", "ptp.mm.port.data.set.eventportaddress",
4120 FT_BYTES, BASE_DEC, NULL, 0x00,
4123 { &hf_ptp_mm_port_data_set_generalportaddress,
4124 { "generalPortAddress", "ptp.mm.port.data.set.generalportaddress",
4125 FT_BYTES, BASE_DEC, NULL, 0x00,
4128 /*ptp_mm_global_time_data_set (parameterlength = 24)*/
4129 { &hf_ptp_mm_global_time_data_set_localtime,
4130 { "localTime", "ptp.mm.global.time.data.set.localtime",
4131 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4134 { &hf_ptp_mm_global_time_data_set_localtimeseconds,
4135 { "localTimeSeconds", "ptp.mm.global.time.data.set.localtimeseconds",
4136 FT_UINT32, BASE_DEC, NULL, 0x00,
4139 { &hf_ptp_mm_global_time_data_set_localtimenanoseconds,
4140 { "localTimeNanoseconds", "ptp.mm.global.time.data.set.localtimenanoseconds",
4141 FT_INT32, BASE_DEC, NULL, 0x00,
4144 { &hf_ptp_mm_global_time_data_set_currentutcoffset,
4145 { "currentUtcOffset", "ptp.mm.global.time.data.set.currentutcoffset",
4146 FT_INT16, BASE_DEC, NULL, 0x00,
4149 { &hf_ptp_mm_global_time_data_set_leap59,
4150 { "leap59", "ptp.mm.global.time.data.set.leap59",
4151 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4154 { &hf_ptp_mm_global_time_data_set_leap61,
4155 { "leap61", "ptp.mm.global.time.data.set.leap61",
4156 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4159 { &hf_ptp_mm_global_time_data_set_epochnumber,
4160 { "epochNumber", "ptp.mm.global.time.data.set.epochnumber",
4161 FT_UINT16, BASE_DEC, NULL, 0x00,
4164 /*ptp_mm_update_global_time_properties (parameterlength = 16)*/
4165 { &hf_ptp_mm_update_global_time_properties_currentutcoffset,
4166 { "currentUtcOffset", "ptp.mm.update.global.time.properties.currentutcoffset",
4167 FT_UINT16, BASE_DEC, NULL, 0x00,
4170 { &hf_ptp_mm_update_global_time_properties_leap59,
4171 { "leap59", "ptp.mm.update.global.time.properties.leap59",
4172 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4175 { &hf_ptp_mm_update_global_time_properties_leap61,
4176 { "leap61", "ptp.mm.update.global.time.properties.leap61",
4177 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4180 { &hf_ptp_mm_update_global_time_properties_epochnumber,
4181 { "epochNumber", "ptp.mm.update.global.time.properties.epochnumber",
4182 FT_UINT16, BASE_DEC, NULL, 0x00,
4185 /*ptp_mm_get_foreign_data_set (parameterlength = 4)*/
4186 { &hf_ptp_mm_get_foreign_data_set_recordkey,
4187 { "recordKey", "ptp.mm.get.foreign.data.set.recordkey",
4188 FT_UINT16, BASE_DEC, NULL, 0x00,
4191 /*ptp_mm_foreign_data_set (parameterlength = 28)*/
4192 { &hf_ptp_mm_foreign_data_set_returnedportnumber,
4193 { "returnedPortNumber", "ptp.mm.foreign.data.set.returnedportnumber",
4194 FT_UINT16, BASE_DEC, NULL, 0x00,
4197 { &hf_ptp_mm_foreign_data_set_returnedrecordnumber,
4198 { "returnedRecordNumber", "ptp.mm.foreign.data.set.returnedrecordnumber",
4199 FT_UINT16, BASE_DEC, NULL, 0x00,
4202 { &hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology,
4203 { "foreignMasterCommunicationTechnology",
4204 "ptp.mm.foreign.data.set.foreignmastercommunicationtechnology",
4205 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4208 { &hf_ptp_mm_foreign_data_set_foreignmasteruuidfield,
4209 { "foreignMasterUuidField", "ptp.mm.foreign.data.set.foreignmasteruuidfield",
4210 FT_ETHER, BASE_DEC, NULL, 0x00,
4213 { &hf_ptp_mm_foreign_data_set_foreignmasterportidfield,
4214 { "foreignMasterPortIdField", "ptp.mm.foreign.data.set.foreignmasterportidfield",
4215 FT_UINT16, BASE_DEC, NULL, 0x00,
4218 { &hf_ptp_mm_foreign_data_set_foreignmastersyncs,
4219 { "foreignMasterSyncs", "ptp.mm.foreign.data.set.foreignmastersyncs",
4220 FT_UINT16, BASE_DEC, NULL, 0x00,
4223 /*ptp_mm_set_sync_interval (parameterlength = 4)*/
4224 { &hf_ptp_mm_set_sync_interval_syncinterval,
4225 { "syncInterval", "ptp.mm.set.sync.interval.syncinterval",
4226 FT_UINT16, BASE_DEC, NULL, 0x00,
4229 /*ptp_mm_set_time (parameterlength = 8)*/
4230 { &hf_ptp_mm_set_time_localtime,
4231 { "localtime", "ptp.mm.set.time.localtime",
4232 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4235 { &hf_ptp_mm_set_time_localtimeseconds,
4236 { "localtimeSeconds", "ptp.mm.set.time.localtimeseconds",
4237 FT_UINT32, BASE_DEC, NULL, 0x00,
4240 { &hf_ptp_mm_set_time_localtimenanoseconds,
4241 { "localTimeNanoseconds", "ptp.mm.set.time.localtimenanoseconds",
4242 FT_INT32, BASE_DEC, NULL, 0x0,
4249 /* PTPv2 fields **********************************************************/
4250 /*Common fields for all frames*/
4251 { &hf_ptp_v2_transportspecific,
4252 { "transportSpecific", "ptp.v2.transportspecific",
4253 FT_UINT8, BASE_HEX, NULL, 0xF0,
4256 { &hf_ptp_v2_transportspecific_v1_compatibility,
4257 { "V1 Compatibility", "ptp.v2.transportspecific.v1compatibility",
4258 FT_BOOLEAN, 8, NULL, PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK,
4261 { &hf_ptp_v2_transportspecific_802as_conform,
4262 { "802.1as conform", "ptp.v2.transportspecific.802.1asconform",
4263 FT_BOOLEAN, 8, NULL, PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK,
4266 { &hf_ptp_v2_messageid,
4267 { "messageId", "ptp.v2.messageid",
4268 FT_UINT8, BASE_HEX, VALS(ptp_v2_messageid_vals), 0x0F,
4271 { &hf_ptp_v2_versionptp,
4272 { "versionPTP", "ptp.v2.versionptp",
4273 FT_UINT8, BASE_DEC, NULL, 0x0F,
4276 { &hf_ptp_v2_messagelength,
4277 { "messageLength", "ptp.v2.messagelength",
4278 FT_UINT16, BASE_DEC, NULL, 0x00,
4281 { &hf_ptp_v2_domainnumber,
4282 { "subdomainNumber", "ptp.v2.subdomainnumber",
4283 FT_UINT8, BASE_DEC, NULL, 0x00,
4287 { "flags", "ptp.v2.flags",
4288 FT_UINT16, BASE_HEX, NULL, 0x00,
4291 { &hf_ptp_v2_flags_alternatemaster,
4292 { "PTP_ALTERNATE_MASTER", "ptp.v2.flags.alternatemaster",
4293 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_ALTERNATE_BITMASK,
4296 { &hf_ptp_v2_flags_twostep,
4297 { "PTP_TWO_STEP", "ptp.v2.flags.twostep",
4298 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_TWO_STEP_BITMASK,
4301 { &hf_ptp_v2_flags_unicast,
4302 { "PTP_UNICAST", "ptp.v2.flags.unicast",
4303 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_UNICAST_BITMASK,
4306 { &hf_ptp_v2_flags_specific1,
4307 { "PTP profile Specific 1", "ptp.v2.flags.specific1",
4308 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SPECIFIC1_BITMASK,
4311 { &hf_ptp_v2_flags_specific2,
4312 { "PTP profile Specific 2", "ptp.v2.flags.specific2",
4313 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SPECIFIC2_BITMASK,
4316 { &hf_ptp_v2_flags_security,
4317 { "PTP_SECURITY", "ptp.v2.flags.security",
4318 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SECURITY_BITMASK,
4321 { &hf_ptp_v2_flags_li61,
4322 { "PTP_LI_61", "ptp.v2.flags.li61",
4323 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_LI61_BITMASK,
4326 { &hf_ptp_v2_flags_li59,
4327 { "PTP_LI_59", "ptp.v2.flags.li59",
4328 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_LI59_BITMASK,
4331 { &hf_ptp_v2_flags_utcoffsetvalid,
4332 { "PTP_UTC_REASONABLE", "ptp.v2.flags.utcreasonable",
4333 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_UTC_OFFSET_VALID_BITMASK,
4336 { &hf_ptp_v2_flags_ptptimescale,
4337 { "PTP_TIMESCALE", "ptp.v2.flags.timescale",
4338 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_PTP_TIMESCALE_BITMASK,
4341 { &hf_ptp_v2_flags_timetraceable,
4342 { "TIME_TRACEABLE", "ptp.v2.flags.timetraceable",
4343 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_TIME_TRACEABLE_BITMASK,
4346 { &hf_ptp_v2_flags_frequencytraceable,
4347 { "FREQUENCY_TRACEABLE", "ptp.v2.flags.frequencytraceable",
4348 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK,
4351 { &hf_ptp_v2_correction,
4352 { "correction", "ptp.v2.correction.ns",
4353 FT_UINT64, BASE_DEC, NULL, 0x00,
4356 { &hf_ptp_v2_correctionsubns,
4357 { "correctionSubNs", "ptp.v2.correction.subns",
4358 FT_DOUBLE, BASE_DEC, NULL, 0x00,
4361 { &hf_ptp_v2_clockidentity,
4362 { "ClockIdentity", "ptp.v2.clockidentity",
4363 FT_UINT64, BASE_HEX, NULL, 0x00,
4366 { &hf_ptp_v2_sourceportid,
4367 { "SourcePortID", "ptp.v2.sourceportid",
4368 FT_UINT16, BASE_DEC, NULL, 0x00,
4371 { &hf_ptp_v2_sequenceid,
4372 { "sequenceId", "ptp.v2.sequenceid",
4373 FT_UINT16, BASE_DEC, NULL, 0x00,
4376 { &hf_ptp_v2_control,
4377 { "control", "ptp.v2.control",
4378 FT_UINT8, BASE_DEC, VALS(ptp_control_vals), 0x00,
4381 { &hf_ptp_v2_logmessageperiod,
4382 { "logMessagePeriod", "ptp.v2.logmessageperiod",
4383 FT_INT8, BASE_DEC, NULL, 0x00,
4387 /*Fields for PTP_Announce (=an) messages*/
4388 { &hf_ptp_v2_an_origintimestamp,
4389 { "originTimestamp", "ptp.v2.an.origintimestamp",
4390 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4393 { &hf_ptp_v2_an_origintimestamp_seconds,
4394 { "originTimestamp (seconds)", "ptp.v2.an.origintimestamp.seconds",
4395 FT_UINT64, BASE_DEC, NULL, 0x00,
4398 { &hf_ptp_v2_an_origintimestamp_nanoseconds,
4399 { "originTimestamp (nanoseconds)", "ptp.v2.an.origintimestamp.nanoseconds",
4400 FT_INT32, BASE_DEC, NULL, 0x00,
4403 { &hf_ptp_v2_an_origincurrentutcoffset,
4404 { "originCurrentUTCOffset", "ptp.v2.an.origincurrentutcoffset",
4405 FT_INT16, BASE_DEC, NULL, 0x00,
4408 { &hf_ptp_v2_an_timesource,
4409 { "TimeSource", "ptp.v2.timesource",
4410 FT_UINT8, BASE_HEX, VALS(ptp_v2_timesource_vals), 0x00,
4413 { &hf_ptp_v2_an_localstepsremoved,
4414 { "localStepsRemoved", "ptp.v2.an.localstepsremoved",
4415 FT_UINT16, BASE_DEC, NULL, 0x00,
4418 { &hf_ptp_v2_an_grandmasterclockidentity,
4419 { "grandmasterClockIdentity", "ptp.v2.an.grandmasterclockidentity",
4420 FT_UINT64, BASE_HEX, NULL, 0x00,
4423 { &hf_ptp_v2_an_grandmasterclockclass,
4424 { "grandmasterClockClass", "ptp.v2.an.grandmasterclockclass",
4425 FT_UINT8, BASE_DEC, NULL, 0x00,
4428 { &hf_ptp_v2_an_grandmasterclockaccuracy,
4429 { "grandmasterClockAccuracy", "ptp.v2.an.grandmasterclockaccuracy",
4430 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
4433 { &hf_ptp_v2_an_grandmasterclockvariance,
4434 { "grandmasterClockVariance", "ptp.v2.an.grandmasterclockvariance",
4435 FT_UINT16, BASE_DEC, NULL, 0x00,
4438 { &hf_ptp_v2_an_priority1,
4439 { "priority1", "ptp.v2.an.priority1",
4440 FT_UINT8, BASE_DEC, NULL, 0x00,
4443 { &hf_ptp_v2_an_priority2,
4444 { "priority2", "ptp.v2.an.priority2",
4445 FT_UINT8, BASE_DEC, NULL, 0x00,
4449 /*Fields for PTP_Announce TLVs */
4450 { &hf_ptp_v2_an_tlv_tlvtype,
4451 { "tlvType", "ptp.v2.an.tlvType",
4452 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
4455 { &hf_ptp_v2_an_tlv_lengthfield,
4456 { "lengthField", "ptp.v2.an.lengthField",
4457 FT_UINT16, BASE_DEC, NULL, 0x00,
4460 /*Fields for ALTERNATE_TIME_OFFSET_INDICATOR TLV */
4461 { &hf_ptp_v2_atoi_tlv_keyfield,
4462 { "keyField", "ptp.v2.an.atoi.keyField",
4463 FT_UINT8, BASE_DEC, NULL, 0x00,
4466 { &hf_ptp_v2_atoi_tlv_currentoffset,
4467 { "currentOffset", "ptp.v2.an.atoi.currentOffset",
4468 FT_INT32, BASE_DEC, NULL, 0x00,
4471 { &hf_ptp_v2_atoi_tlv_jumpseconds,
4472 { "jumpSeconds", "ptp.v2.an.atoi.jumpSeconds",
4473 FT_INT32, BASE_DEC, NULL, 0x00,
4476 { &hf_ptp_v2_atoi_tlv_timeofnextjump,
4477 { "timeOfNextJump", "ptp.v2.an.atoi.timeOfNextJump",
4478 FT_BYTES, BASE_NONE, NULL, 0x00,
4481 { &hf_ptp_v2_atoi_tlv_displayname,
4482 { "displayName", "ptp.v2.an.atoi.dislpayName",
4483 FT_STRING, BASE_NONE, NULL, 0x00,
4486 { &hf_ptp_v2_atoi_tlv_displayname_length,
4487 { "length", "ptp.v2.an.atoi.dislpayName.length",
4488 FT_UINT8, BASE_DEC, NULL, 0x00,
4492 /* Fields for undissected TLV */
4493 { &hf_ptp_v2_an_tlv_data,
4494 { "data", "ptp.v2.an.tlv.data",
4495 FT_BYTES, BASE_NONE, NULL, 0x00,
4499 /*Fields for PTP_Sync AND PTP_DelayRequest (=sdr) messages*/
4500 { &hf_ptp_v2_sdr_origintimestamp,
4501 { "originTimestamp", "ptp.v2.sdr.origintimestamp",
4502 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4505 { &hf_ptp_v2_sdr_origintimestamp_seconds,
4506 { "originTimestamp (seconds)", "ptp.v2.sdr.origintimestamp.seconds",
4507 FT_UINT64, BASE_DEC, NULL, 0x00,
4510 { &hf_ptp_v2_sdr_origintimestamp_nanoseconds,
4511 { "originTimestamp (nanoseconds)", "ptp.v2.sdr.origintimestamp.nanoseconds",
4512 FT_INT32, BASE_DEC, NULL, 0x00,
4516 /*Fields for PTP_Follow_Up (=fu) messages*/
4517 { &hf_ptp_v2_fu_preciseorigintimestamp,
4518 { "preciseOriginTimestamp", "ptp.v2.fu.preciseorigintimestamp",
4519 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4522 { &hf_ptp_v2_fu_preciseorigintimestamp_seconds,
4523 { "preciseOriginTimestamp (seconds)", "ptp.v2.fu.preciseorigintimestamp.seconds",
4524 FT_UINT64, BASE_DEC, NULL, 0x00,
4527 { &hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds,
4528 { "preciseOriginTimestamp (nanoseconds)", "ptp.v2.fu.preciseorigintimestamp.nanoseconds",
4529 FT_INT32, BASE_DEC, NULL, 0x00,
4533 /*Fields for PTP_DelayResponse (=dr) messages*/
4534 { &hf_ptp_v2_dr_receivetimestamp,
4535 { "receiveTimestamp", "ptp.v2.dr.receivetimestamp",
4536 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4539 { &hf_ptp_v2_dr_receivetimestamp_seconds,
4540 { "receiveTimestamp (seconds)", "ptp.v2.dr.receivetimestamp.seconds",
4541 FT_UINT64, BASE_DEC, NULL, 0x00,
4544 { &hf_ptp_v2_dr_receivetimestamp_nanoseconds,
4545 { "receiveTimestamp (nanoseconds)", "ptp.v2.dr.receivetimestamp.nanoseconds",
4546 FT_INT32, BASE_DEC, NULL, 0x00,
4549 { &hf_ptp_v2_dr_requestingportidentity,
4550 { "requestingSourcePortIdentity", "ptp.v2.dr.requestingsourceportidentity",
4551 FT_UINT64, BASE_HEX, NULL, 0x00,
4554 { &hf_ptp_v2_dr_requestingsourceportid,
4555 { "requestingSourcePortId", "ptp.v2.dr.requestingsourceportid",
4556 FT_UINT16, BASE_DEC, NULL, 0x00,
4560 /*Fields for PTP_PDelayRequest (=pdrq) messages*/
4561 { &hf_ptp_v2_pdrq_origintimestamp,
4562 { "originTimestamp", "ptp.v2.pdrq.origintimestamp",
4563 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4566 { &hf_ptp_v2_pdrq_origintimestamp_seconds,
4567 { "originTimestamp (seconds)", "ptp.v2.pdrq.origintimestamp.seconds",
4568 FT_UINT64, BASE_DEC, NULL, 0x00,
4571 { &hf_ptp_v2_pdrq_origintimestamp_nanoseconds,
4572 { "originTimestamp (nanoseconds)", "ptp.v2.pdrq.origintimestamp.nanoseconds",
4573 FT_INT32, BASE_DEC, NULL, 0x00,
4577 /*Fields for PTP_PDelayResponse (=pdrs) messages*/
4578 { &hf_ptp_v2_pdrs_requestreceipttimestamp,
4579 { "requestreceiptTimestamp", "ptp.v2.pdrs.requestreceipttimestamp",
4580 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4583 { &hf_ptp_v2_pdrs_requestreceipttimestamp_seconds,
4584 { "requestreceiptTimestamp (seconds)", "ptp.v2.pdrs.requestreceipttimestamp.seconds",
4585 FT_UINT64, BASE_DEC, NULL, 0x00,
4588 { &hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds,
4589 { "requestreceiptTimestamp (nanoseconds)", "ptp.v2.pdrs.requestreceipttimestamp.nanoseconds",
4590 FT_INT32, BASE_DEC, NULL, 0x00,
4593 { &hf_ptp_v2_pdrs_requestingportidentity,
4594 { "requestingSourcePortIdentity", "ptp.v2.pdrs.requestingportidentity",
4595 FT_UINT64, BASE_HEX, NULL, 0x00,
4598 { &hf_ptp_v2_pdrs_requestingsourceportid,
4599 { "requestingSourcePortId", "ptp.v2.pdrs.requestingsourceportid",
4600 FT_UINT16, BASE_DEC, NULL, 0x00,
4604 /*Fields for PTP_PDelayResponseFollowUp (=pdfu) messages*/
4605 { &hf_ptp_v2_pdfu_responseorigintimestamp,
4606 { "responseOriginTimestamp", "ptp.v2.pdfu.responseorigintimestamp",
4607 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4610 { &hf_ptp_v2_pdfu_responseorigintimestamp_seconds,
4611 { "responseOriginTimestamp (seconds)", "ptp.v2.pdfu.responseorigintimestamp.seconds",
4612 FT_UINT64, BASE_DEC, NULL, 0x00,
4615 { &hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds,
4616 { "responseOriginTimestamp (nanoseconds)", "ptp.v2.pdfu.responseorigintimestamp.nanoseconds",
4617 FT_INT32, BASE_DEC, NULL, 0x00,
4620 { &hf_ptp_v2_pdfu_requestingportidentity,
4621 { "requestingSourcePortIdentity", "ptp.v2.pdfu.requestingportidentity",
4622 FT_UINT64, BASE_HEX, NULL, 0x00,
4625 { &hf_ptp_v2_pdfu_requestingsourceportid,
4626 { "requestingSourcePortId", "ptp.v2.pdfu.requestingsourceportid",
4627 FT_UINT16, BASE_DEC, NULL, 0x00,
4631 /*Fields for PTP_Signalling (=sig) messages*/
4632 { &hf_ptp_v2_sig_targetportidentity,
4633 { "targetPortIdentity", "ptp.v2.sig.targetportidentity",
4634 FT_UINT64, BASE_HEX, NULL, 0x00,
4637 { &hf_ptp_v2_sig_targetportid,
4638 { "targetPortId", "ptp.v2.sig.targetportid",
4639 FT_UINT16, BASE_DEC, NULL, 0x00,
4643 /*Fields for PTP_Management (=mm) messages*/
4644 { &hf_ptp_v2_mm_targetportidentity,
4645 { "targetPortIdentity", "ptp.v2.mm.targetportidentity",
4646 FT_UINT64, BASE_HEX, NULL, 0x00,
4649 { &hf_ptp_v2_mm_targetportid,
4650 { "targetPortId", "ptp.v2.mm.targetportid",
4651 FT_UINT16, BASE_DEC, NULL, 0x00,
4654 { &hf_ptp_v2_mm_startingboundaryhops,
4655 { "startingBoundaryHops", "ptp.v2.mm.startingboundaryhops",
4656 FT_UINT8, BASE_DEC, NULL, 0x00,
4659 { &hf_ptp_v2_mm_boundaryhops,
4660 { "boundaryHops", "ptp.v2.mm.boundaryhops",
4661 FT_UINT8, BASE_DEC, NULL, 0x00,
4664 { &hf_ptp_v2_mm_action,
4665 { "action", "ptp.v2.mm.action",
4666 FT_UINT8, BASE_DEC, VALS(ptp_v2_mm_action_vals), 0x0F,
4669 /* Management TLV */
4670 { &hf_ptp_v2_mm_tlvType,
4671 { "tlvType", "ptp.v2.mm.tlvType",
4672 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
4675 { &hf_ptp_v2_mm_lengthField,
4676 { "lengthField", "ptp.v2.mm.lengthField",
4677 FT_UINT16, BASE_DEC, NULL, 0x00,
4680 { &hf_ptp_v2_mm_managementId,
4681 { "managementId", "ptp.v2.mm.managementId",
4682 FT_UINT16, BASE_DEC, VALS(ptp_v2_managementID_vals), 0x00,
4685 { &hf_ptp_v2_mm_data,
4686 { "data", "ptp.v2.mm.data",
4687 FT_BYTES, BASE_HEX, NULL, 0x00,
4690 /* Management TLV dataField */
4691 /* CLOCK_DESCRIPTION */
4692 { &hf_ptp_v2_mm_clockType,
4693 { "clockType", "ptp.v2.mm.clockType",
4694 FT_UINT16, BASE_HEX, NULL, 0x00,
4697 { &hf_ptp_v2_mm_clockType_ordinaryClock,
4698 { "The node implements an ordinary clock", "ptp.v2.mm.clockType.OC",
4699 FT_BOOLEAN, 16, NULL, CLOCKTYPE_ORDINARY_CLOCK,
4702 { &hf_ptp_v2_mm_clockType_boundaryClock,
4703 { "The node implements a boundary clock", "ptp.v2.mm.clockType.BC",
4704 FT_BOOLEAN, 16, NULL, CLOCKTYPE_BOUNDARY_CLOCK,
4707 { &hf_ptp_v2_mm_clockType_p2p_transparentClock,
4708 { "The node implements a peer-to-peer transparent clock", "ptp.v2.mm.clockType.p2p_TC",
4709 FT_BOOLEAN, 16, NULL, CLOCKTYPE_P2P_TC,
4712 { &hf_ptp_v2_mm_clockType_e2e_transparentClock,
4713 { "The node implements an end-to-end transparent clock", "ptp.v2.mm.clockType.e2e_TC",
4714 FT_BOOLEAN, 16, NULL, CLOCKTYPE_E2E_TC,
4717 { &hf_ptp_v2_mm_clockType_managementNode,
4718 { "The node implements a management node", "ptp.v2.mm.clockType.MM",
4719 FT_BOOLEAN, 16, NULL, CLOCKTYPE_MANAGEMENT_NODE,
4722 { &hf_ptp_v2_mm_clockType_reserved,
4723 { "Reserved", "ptp.v2.mm.clockType.reserved",
4724 FT_BOOLEAN, 16, NULL, CLOCKTYPE_RESERVED,
4727 { &hf_ptp_v2_mm_physicalLayerProtocol,
4728 { "physicalLayerProtocol", "ptp.v2.mm.physicalLayerProtocol",
4729 FT_STRING, BASE_DEC, NULL, 0x00,
4732 { &hf_ptp_v2_mm_physicalLayerProtocol_length,
4733 { "length", "ptp.v2.mm.physicalLayerProtocol.length",
4734 FT_UINT8, BASE_DEC, NULL, 0x00,
4737 { &hf_ptp_v2_mm_physicalAddressLength,
4738 { "physical address length", "ptp.v2.mm.physicalAddressLength",
4739 FT_UINT16, BASE_DEC, NULL, 0x00,
4742 { &hf_ptp_v2_mm_physicalAddress,
4743 { "physical address", "ptp.v2.mm.physicalAddress",
4744 FT_BYTES, BASE_HEX, NULL, 0x00,
4747 { &hf_ptp_v2_mm_protocolAddress,
4748 { "protocol address", "ptp.v2.mm.protocolAddress",
4749 FT_BYTES, BASE_HEX, NULL, 0x00,
4752 { &hf_ptp_v2_mm_protocolAddress_networkProtocol,
4753 { "network protocol", "ptp.v2.mm.networkProtocol",
4754 FT_UINT16, BASE_DEC, VALS(ptp2_networkProtocol_vals), 0x00,
4757 { &hf_ptp_v2_mm_protocolAddress_length,
4758 { "length", "ptp.v2.mm.protocolAddress.length",
4759 FT_UINT16, BASE_DEC, NULL, 0x00,
4762 { &hf_ptp_v2_mm_manufacturerIdentity,
4763 { "manufacturer identity", "ptp.v2.mm.manufacturerIdentity",
4764 FT_BYTES, BASE_HEX, NULL, 0x00,
4767 { &hf_ptp_v2_mm_reserved,
4768 { "reserved", "ptp.v2.mm.reserved",
4769 FT_BYTES, BASE_HEX, NULL, 0x00,
4772 { &hf_ptp_v2_mm_productDescription,
4773 { "product description", "ptp.v2.mm.productDescription",
4774 FT_STRING, BASE_DEC, NULL, 0x00,
4777 { &hf_ptp_v2_mm_productDescription_length,
4778 { "length", "ptp.v2.mm.productDescription.length",
4779 FT_UINT8, BASE_DEC, NULL, 0x00,
4782 { &hf_ptp_v2_mm_revisionData,
4783 { "revision data", "ptp.v2.mm.revisionData",
4784 FT_STRING, BASE_DEC, NULL, 0x00,
4787 { &hf_ptp_v2_mm_revisionData_length,
4788 { "length", "ptp.v2.mm.revisionData.length",
4789 FT_UINT8, BASE_DEC, NULL, 0x00,
4792 { &hf_ptp_v2_mm_userDescription,
4793 { "user description", "ptp.v2.mm.userDescription",
4794 FT_STRING, BASE_DEC, NULL, 0x00,
4797 { &hf_ptp_v2_mm_userDescription_length,
4798 { "length", "ptp.v2.mm.userDescription.length",
4799 FT_UINT8, BASE_DEC, NULL, 0x00,
4802 { &hf_ptp_v2_mm_profileIdentity,
4803 { "profileIdentity", "ptp.v2.mm.profileIdentity",
4804 FT_BYTES, BASE_HEX, NULL, 0x00,
4807 { &hf_ptp_v2_mm_pad,
4808 { "Pad", "ptp.v2.mm.pad",
4809 FT_BYTES, BASE_HEX, NULL, 0x01,
4812 { &hf_ptp_v2_mm_initializationKey,
4813 { "initialization key", "ptp.v2.mm.initializationKey",
4814 FT_UINT16, BASE_DEC, NULL, 0x00,
4817 { &hf_ptp_v2_mm_numberOfFaultRecords,
4818 { "number of fault records", "ptp.v2.mm.numberOfFaultRecords",
4819 FT_UINT16, BASE_DEC, NULL, 0x00,
4822 { &hf_ptp_v2_mm_faultRecord,
4823 { "fault record", "ptp.v2.mm.faultRecord",
4824 FT_BYTES, BASE_HEX, NULL, 0x00,
4827 { &hf_ptp_v2_mm_faultRecordLength,
4828 { "fault record length", "ptp.v2.mm.faultRecordLength",
4829 FT_UINT16, BASE_DEC, NULL, 0x00,
4832 { &hf_ptp_v2_mm_severityCode,
4833 { "severity code", "ptp.v2.mm.severityCode",
4834 FT_UINT8, BASE_DEC, VALS(ptp2_severityCode_vals), 0x00,
4837 { &hf_ptp_v2_mm_faultName,
4838 { "faultName", "ptp.v2.mm.faultName",
4839 FT_STRING, BASE_DEC, NULL, 0x00,
4842 { &hf_ptp_v2_mm_faultName_length,
4843 { "length", "ptp.v2.mm.faultName.length",
4844 FT_UINT8, BASE_DEC, NULL, 0x00,
4847 { &hf_ptp_v2_mm_faultValue,
4848 { "faultValue", "ptp.v2.mm.faultValue",
4849 FT_STRING, BASE_DEC, NULL, 0x00,
4852 { &hf_ptp_v2_mm_faultValue_length,
4853 { "length", "ptp.v2.mm.faultValue.length",
4854 FT_UINT8, BASE_DEC, NULL, 0x00,
4857 { &hf_ptp_v2_mm_faultDescription,
4858 { "faultDescription", "ptp.v2.mm.faultDescription",
4859 FT_STRING, BASE_DEC, NULL, 0x00,
4862 { &hf_ptp_v2_mm_faultDescription_length,
4863 { "length", "ptp.v2.mm.faultDescription.length",
4864 FT_UINT8, BASE_DEC, NULL, 0x00,
4867 { &hf_ptp_v2_mm_faultTime,
4868 { "Fault time", "ptp.v2.mm.faultTime",
4869 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4872 { &hf_ptp_v2_mm_faultTime_s,
4873 { "Fault time (seconds)", "ptp.v2.mm.faultTime.seconds",
4874 FT_UINT64, BASE_DEC, NULL, 0x00,
4877 { &hf_ptp_v2_mm_faultTime_ns,
4878 { "Fault time (nanoseconds)", "ptp.v2.mm.faultTime.nanoseconds",
4879 FT_INT32, BASE_DEC, NULL, 0x00,
4882 { &hf_ptp_v2_mm_currentTime_s,
4883 { "current time (seconds)", "ptp.v2.mm.currentTime.seconds",
4884 FT_UINT64, BASE_DEC, NULL, 0x00,
4887 { &hf_ptp_v2_mm_currentTime_ns,
4888 { "current time (nanoseconds)", "ptp.v2.mm.currentTime.nanoseconds",
4889 FT_INT32, BASE_DEC, NULL, 0x00,
4892 { &hf_ptp_v2_mm_clockAccuracy,
4893 { "Clock accuracy", "ptp.v2.mm.clockaccuracy",
4894 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
4898 { &hf_ptp_v2_mm_priority1,
4899 { "priority1", "ptp.v2.mm.priority1",
4900 FT_UINT8, BASE_DEC, NULL, 0x00,
4903 { &hf_ptp_v2_mm_priority2,
4904 { "priority2", "ptp.v2.mm.priority2",
4905 FT_UINT8, BASE_DEC, NULL, 0x00,
4908 { &hf_ptp_v2_mm_dds_SO,
4909 { "Slave only", "ptp.v2.mm.SlavOnly",
4910 FT_BOOLEAN, 8, NULL, 0x02,
4913 { &hf_ptp_v2_mm_TSC,
4914 { "Two step", "ptp.v2.mm.twoStep",
4915 FT_BOOLEAN, 8, NULL, 0x01,
4918 { &hf_ptp_v2_mm_numberPorts,
4919 { "number of ports", "ptp.v2.mm.numberPorts",
4920 FT_UINT16, BASE_DEC, NULL, 0x00,
4923 { &hf_ptp_v2_mm_clockclass,
4924 { "Clock class", "ptp.v2.mm.clockclass",
4925 FT_UINT8, BASE_DEC, NULL, 0x00,
4928 { &hf_ptp_v2_mm_clockaccuracy,
4929 { "Clock accuracy", "ptp.v2.mm.clockaccuracy",
4930 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
4933 { &hf_ptp_v2_mm_clockvariance,
4934 { "Clock variance", "ptp.v2.mm.clockvariance",
4935 FT_UINT16, BASE_DEC, NULL, 0x00,
4938 { &hf_ptp_v2_mm_clockidentity,
4939 { "Clock identity", "ptp.v2.mm.clockidentity",
4940 FT_UINT64, BASE_HEX, NULL, 0x00,
4943 { &hf_ptp_v2_mm_domainNumber,
4944 { "domain number", "ptp.v2.mm.domainNumber",
4945 FT_UINT8, BASE_DEC, NULL , 0x00,
4949 { "Slave only", "ptp.v2.mm.SlavOnly",
4950 FT_BOOLEAN, 8, NULL, 0x01,
4953 { &hf_ptp_v2_mm_stepsRemoved,
4954 { "steps removed", "ptp.v2.mm.stepsRemoved",
4955 FT_INT16, BASE_DEC, NULL, 0x00,
4958 { &hf_ptp_v2_mm_parentIdentity,
4959 { "parent ClockIdentity", "ptp.v2.mm.parentclockidentity",
4960 FT_UINT64, BASE_HEX, NULL, 0x00,
4963 { &hf_ptp_v2_mm_parentPort,
4964 { "parent SourcePortID", "ptp.v2.mm.parentsourceportid",
4965 FT_UINT16, BASE_DEC, NULL, 0x00,
4968 { &hf_ptp_v2_mm_parentStats,
4969 { "parent stats", "ptp.v2.mm.parentstats",
4970 FT_BOOLEAN, 8, NULL, 0x01,
4973 { &hf_ptp_v2_mm_observedParentOffsetScaledLogVariance,
4974 { "observedParentOffsetScaledLogVariance", "ptp.v2.mm.observedParentOffsetScaledLogVariance",
4975 FT_UINT16, BASE_DEC, NULL, 0x00,
4978 { &hf_ptp_v2_mm_observedParentClockPhaseChangeRate,
4979 { "observedParentClockPhaseChangeRate", "ptp.v2.mm.observedParentClockPhaseChangeRate",
4980 FT_INT32, BASE_DEC, NULL, 0x00,
4983 { &hf_ptp_v2_mm_grandmasterPriority1,
4984 { "Grandmaster priority1", "ptp.v2.mm.grandmasterPriority1",
4985 FT_UINT8, BASE_DEC, NULL, 0x00,
4988 { &hf_ptp_v2_mm_grandmasterPriority2,
4989 { "Grandmaster priority2", "ptp.v2.mm.grandmasterPriority2",
4990 FT_UINT8, BASE_DEC, NULL, 0x00,
4993 { &hf_ptp_v2_mm_grandmasterclockclass,
4994 { "Grandmaster clock class", "ptp.v2.mm.grandmasterclockclass",
4995 FT_UINT8, BASE_DEC, NULL, 0x00,
4998 { &hf_ptp_v2_mm_grandmasterclockaccuracy,
4999 { "Grandmaster clock accuracy", "ptp.v2.mm.grandmasterclockaccuracy",
5000 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
5003 { &hf_ptp_v2_mm_grandmasterclockvariance,
5004 { "Grandmaster clock variance", "ptp.v2.mm.grandmasterclockvariance",
5005 FT_UINT16, BASE_DEC, NULL, 0x00,
5008 { &hf_ptp_v2_mm_grandmasterIdentity,
5009 { "Grandmaster clock identity", "ptp.v2.mm.grandmasterclockidentity",
5010 FT_UINT64, BASE_HEX, NULL, 0x00,
5013 { &hf_ptp_v2_mm_currentUtcOffset,
5014 { "CurrentUTCOffset", "ptp.v2.mm.currentutcoffset",
5015 FT_INT16, BASE_DEC, NULL, 0x00,
5018 { &hf_ptp_v2_mm_LI_61,
5019 { "leap 61", "ptp.v2.mm.li61",
5020 FT_BOOLEAN, 8, NULL, 0x01,
5023 { &hf_ptp_v2_mm_LI_59,
5024 { "leap 59", "ptp.v2.mm.li59",
5025 FT_BOOLEAN, 8, NULL, 0x02,
5028 { &hf_ptp_v2_mm_UTCV,
5029 { "CurrentUTCOffset valid", "ptp.v2.mm.CurrentUTCOffsetValid",
5030 FT_BOOLEAN, 8, NULL, 0x04,
5033 { &hf_ptp_v2_mm_PTP,
5034 { "PTP timescale", "ptp.v2.mm.ptptimescale",
5035 FT_BOOLEAN, 8, NULL, 0x08,
5038 { &hf_ptp_v2_mm_TTRA,
5039 { "Time traceable", "ptp.v2.mm.timeTraceable",
5040 FT_BOOLEAN, 8, NULL, 0x10,
5043 { &hf_ptp_v2_mm_FTRA,
5044 { "Frequency traceable", "ptp.v2.mm.frequencyTraceable",
5045 FT_BOOLEAN, 8, NULL, 0x20,
5048 { &hf_ptp_v2_mm_timesource,
5049 { "TimeSource", "ptp.v2.mm.timesource",
5050 FT_UINT8, BASE_HEX, VALS(ptp_v2_timesource_vals), 0x00,
5053 { &hf_ptp_v2_mm_offset_ns,
5054 { "correction", "ptp.v2.mm.offset.ns",
5055 FT_UINT64, BASE_DEC, NULL, 0x00,
5058 { &hf_ptp_v2_mm_offset_subns,
5059 { "SubNs", "ptp.v2.mm.offset.subns",
5060 FT_DOUBLE, BASE_DEC, NULL, 0x00,
5063 { &hf_ptp_v2_mm_pathDelay_ns,
5064 { "ns", "ptp.v2.mm.pathDelay.ns",
5065 FT_UINT64, BASE_DEC, NULL, 0x00,
5068 { &hf_ptp_v2_mm_pathDelay_subns,
5069 { "SubNs", "ptp.v2.mm.pathDelay.subns",
5070 FT_DOUBLE, BASE_DEC, NULL, 0x00,
5073 { &hf_ptp_v2_mm_PortNumber,
5074 { "PortNumber", "ptp.v2.mm.PortNumber",
5075 FT_UINT16, BASE_DEC, NULL, 0x00,
5078 { &hf_ptp_v2_mm_portState,
5079 { "Port state", "ptp.v2.mm.portState",
5080 FT_UINT8, BASE_DEC, VALS(ptp2_portState_vals), 0x00,
5083 { &hf_ptp_v2_mm_logMinDelayReqInterval,
5084 { "logMinDelayReqInterval", "ptp.v2.mm.logMinDelayReqInterval",
5085 FT_INT8, BASE_DEC, NULL, 0x00,
5088 { &hf_ptp_v2_mm_peerMeanPathDelay_ns,
5089 { "ns", "ptp.v2.mm.peerMeanPathDelay.ns",
5090 FT_UINT64, BASE_DEC, NULL, 0x00,
5093 { &hf_ptp_v2_mm_peerMeanPathDelay_subns,
5094 { "SubNs", "ptp.v2.mm.peerMeanPathDelay.subns",
5095 FT_DOUBLE, BASE_DEC, NULL, 0x00,
5098 { &hf_ptp_v2_mm_logAnnounceInterval,
5099 { "logAnnounceInterval", "ptp.v2.mm.logAnnounceInterval",
5100 FT_INT8, BASE_DEC, NULL, 0x00,
5103 { &hf_ptp_v2_mm_announceReceiptTimeout,
5104 { "announceReceiptTimeout", "ptp.v2.mm.announceReceiptTimeout",
5105 FT_UINT8, BASE_DEC, NULL, 0x00,
5108 { &hf_ptp_v2_mm_logSyncInterval,
5109 { "logSyncInterval", "ptp.v2.mm.logSyncInterval",
5110 FT_INT8, BASE_DEC, NULL, 0x00,
5113 { &hf_ptp_v2_mm_delayMechanism,
5114 { "Delay mechanism", "ptp.v2.mm.delayMechanism",
5115 FT_UINT8, BASE_DEC, VALS(ptp2_delayMechanism_vals), 0x00,
5118 { &hf_ptp_v2_mm_logMinPdelayReqInterval,
5119 { "logMinPdelayReqInterval", "ptp.v2.mm.logMinPdelayReqInterval",
5120 FT_INT8, BASE_DEC, NULL, 0x00,
5123 { &hf_ptp_v2_mm_versionNumber,
5124 { "versionNumber", "ptp.v2.mm.versionNumber",
5125 FT_UINT8, BASE_DEC, NULL, 0x0F,
5128 { &hf_ptp_v2_mm_primaryDomain,
5129 { "Primary domain number", "ptp.v2.mm.primaryDomain",
5130 FT_UINT8, BASE_DEC, NULL, 0x00,
5133 { &hf_ptp_v2_mm_faultyFlag,
5134 { "Faulty flag", "ptp.v2.mm.faultyFlag",
5135 FT_BOOLEAN, 8, NULL, 0x01,
5139 { &hf_ptp_v2_mm_managementErrorId,
5140 { "managementErrorId", "ptp.v2.mm.managementErrorId",
5141 FT_UINT16, BASE_DEC, VALS(ptp2_managementErrorId_vals), 0x00,
5144 { &hf_ptp_v2_mm_displayData,
5145 { "Display data", "ptp.v2.mm.displayData",
5146 FT_STRING, BASE_DEC, NULL, 0x00,
5149 { &hf_ptp_v2_mm_displayData_length,
5150 { "length", "ptp.v2.mm.displayData.length",
5151 FT_UINT8, BASE_DEC, NULL, 0x00,
5154 { &hf_ptp_v2_mm_ucEN,
5155 { "Enable unicast", "ptp.v2.mm.unicastEnable",
5156 FT_BOOLEAN, 8, NULL, 0x01,
5159 { &hf_ptp_v2_mm_ptEN,
5160 { "Path trace unicast", "ptp.v2.mm.pathTraceEnable",
5161 FT_BOOLEAN, 8, NULL, 0x01,
5164 { &hf_ptp_v2_mm_atEN,
5165 { "Path trace unicast", "ptp.v2.mm.pathTraceEnable",
5166 FT_BOOLEAN, 8, NULL, 0x01,
5169 { &hf_ptp_v2_mm_keyField,
5170 { "Key field", "ptp.v2.mm.keyField",
5171 FT_UINT8, BASE_DEC, NULL, 0x00,
5174 { &hf_ptp_v2_mm_displayName,
5175 { "Display name", "ptp.v2.mm.displayName",
5176 FT_STRING, BASE_DEC, NULL, 0x00,
5179 { &hf_ptp_v2_mm_displayName_length,
5180 { "length", "ptp.v2.mm.displayName.length",
5181 FT_UINT8, BASE_DEC, NULL, 0x00,
5184 { &hf_ptp_v2_mm_maxKey,
5185 { "Max key", "ptp.v2.mm.maxKey",
5186 FT_UINT8, BASE_DEC, NULL, 0x00,
5189 { &hf_ptp_v2_mm_currentOffset,
5190 { "Current offset", "ptp.v2.mm.currentOffset",
5191 FT_INT32, BASE_DEC, NULL, 0x00,
5194 { &hf_ptp_v2_mm_jumpSeconds,
5195 { "Jump seconds", "ptp.v2.mm.jumpSeconds",
5196 FT_INT32, BASE_DEC, NULL, 0x00,
5199 { &hf_ptp_v2_mm_numberOfAlternateMasters,
5200 { "Number of alternate masters", "ptp.v2.mm.numberOfAlternateMasters",
5201 FT_UINT8, BASE_DEC, NULL, 0x00,
5204 { &hf_ptp_v2_mm_logAlternateMulticastSyncInterval,
5205 { "Alternate multicast sync interval", "ptp.v2.mm.AlternateMulticastSyncInterval",
5206 FT_INT8, BASE_DEC, NULL, 0x00,
5209 { &hf_ptp_v2_mm_transmitAlternateMulticastSync,
5210 { "Transmit alternate multicast sync", "ptp.v2.mm.transmitAlternateMulticastSync",
5211 FT_BOOLEAN, 8, NULL, 0x01,
5217 /* Setup protocol subtree array */
5218 static gint *ett[] = {
5224 &ett_ptp_v2_transportspecific,
5226 &ett_ptp_v2_correction,
5229 &ett_ptp_v2_managementData,
5230 &ett_ptp_v2_clockType,
5231 &ett_ptp_v2_physicalLayerProtocol,
5232 &ett_ptp_v2_protocolAddress,
5233 &ett_ptp_v2_ptptext,
5234 &ett_ptp_v2_faultRecord,
5235 &ett_ptp_v2_timeInterval,
5239 /* Register the protocol name and description */
5240 proto_ptp = proto_register_protocol("Precision Time Protocol (IEEE1588)",
5243 /* Required function calls to register the header fields and subtrees used */
5244 proto_register_field_array(proto_ptp, hf, array_length(hf));
5245 proto_register_subtree_array(ett, array_length(ett));
5249 proto_reg_handoff_ptp(void)
5251 dissector_handle_t event_port_ptp_handle;
5252 dissector_handle_t general_port_ptp_handle;
5253 dissector_handle_t ethertype_ptp_handle;
5255 event_port_ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp);
5256 general_port_ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp);
5257 ethertype_ptp_handle = create_dissector_handle(dissect_ptp_oE, proto_ptp);
5259 dissector_add("udp.port", EVENT_PORT_PTP, event_port_ptp_handle);
5260 dissector_add("udp.port", GENERAL_PORT_PTP, general_port_ptp_handle);
5261 dissector_add("ethertype", ETHERTYPE_PTP, ethertype_ptp_handle);