HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-ptp.c
blob3c3f25e39f4a4a284d5ae46aa7d2a7ea60317891
1 /* packet-ptp.c
2 * Routines for PTP (Precision Time Protocol) dissection
3 * Copyright 2004, Auges Tchouante <tchouante2001@yahoo.fr>
4 * Copyright 2004, Dominic Bechaz <bdo@zhwin.ch> , ZHW/InES
5 * Copyright 2004, Markus Seehofer <mseehofe@nt.hirschmann.de>
6 * Copyright 2006, Christian Schaer <scc@zhwin.ch>
7 * Copyright 2007, Markus Renz <Markus.Renz@hirschmann.de>
8 * Copyright 2010, Torrey Atcitty <torrey.atcitty@harman.com>
9 * Dave Olsen <dave.olsen@harman.com>
10 * Copyright 2013, Andreas Bachmann <bacr@zhaw.ch>, ZHAW/InES
12 * Revisions:
13 * - Markus Seehofer 09.08.2005 <mseehofe@nt.hirschmann.de>
14 * - Included the "startingBoundaryHops" field in
15 * ptp_management messages.
16 * - Christian Schaer 07.07.2006 <scc@zhwin.ch>
17 * - Added support for PTP version 2
18 * - Markus Renz 2007-06-01
19 * - updated support for PTPv2
20 * - Markus Renz added Management for PTPv2, update to Draft 2.2
21 * - Torrey Atcitty & Dave Olsen 05.14.2010
22 * - Added support for 802.1AS D7.0
23 * - Andreas Bachmann 08.07.2013 <bacr@zhaw.ch>
24 * - allow multiple TLVs
25 * - bugfix in logInterMessagePeriod guint8 -> gint8
27 * $Id$
29 * Wireshark - Network traffic analyzer
30 * By Gerald Combs <gerald@wireshark.org>
31 * Copyright 1998 Gerald Combs
33 * This program is free software; you can redistribute it and/or
34 * modify it under the terms of the GNU General Public License
35 * as published by the Free Software Foundation; either version 2
36 * of the License, or (at your option) any later version.
38 * This program is distributed in the hope that it will be useful,
39 * but WITHOUT ANY WARRANTY; without even the implied warranty of
40 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 * GNU General Public License for more details.
43 * You should have received a copy of the GNU General Public License
44 * along with this program; if not, write to the Free Software
45 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
48 #include "config.h"
50 #include <math.h>
52 #include <glib.h>
54 #include <epan/packet.h>
55 #include <epan/etypes.h>
58 /**********************************************************/
59 /* Port definition's for PTP */
60 /**********************************************************/
61 #define EVENT_PORT_PTP 319
62 #define GENERAL_PORT_PTP 320
64 /*END Port definition's for PTP*/
66 static int proto_ptp = -1;
68 /***********************************************************************************/
69 /* Definitions and fields for PTPv1 dissection. */
70 /***********************************************************************************/
73 /**********************************************************/
74 /* Offsets of fields within a PTPv1 packet. */
75 /**********************************************************/
77 /*Common offsets for all Messages (Synch, Delay_Req, Follow_Up, Delay_Resp ....)*/
78 #define PTP_VERSIONPTP_OFFSET 0
79 #define PTP_VERSIONNETWORK_OFFSET 2
80 #define PTP_SUBDOMAIN_OFFSET 4
81 #define PTP_MESSAGETYPE_OFFSET 20
82 #define PTP_SOURCECOMMUNICATIONTECHNOLOGY_OFFSET 21
83 #define PTP_SOURCEUUID_OFFSET 22
84 #define PTP_SOURCEPORTID_OFFSET 28
85 #define PTP_SEQUENCEID_OFFSET 30
86 #define PTP_CONTROL_OFFSET 32
87 #define PTP_FLAGS_OFFSET 34
88 #define PTP_FLAGS_LI61_OFFSET 34
89 #define PTP_FLAGS_LI59_OFFSET 34
90 #define PTP_FLAGS_BOUNDARY_CLOCK_OFFSET 34
91 #define PTP_FLAGS_ASSIST_OFFSET 34
92 #define PTP_FLAGS_EXT_SYNC_OFFSET 34
93 #define PTP_FLAGS_PARENT_STATS_OFFSET 34
94 #define PTP_FLAGS_SYNC_BURST_OFFSET 34
96 /*Offsets for PTP_Sync and Delay_Req (=SDR) messages*/
97 #define PTP_SDR_ORIGINTIMESTAMP_OFFSET 40
98 #define PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET 40
99 #define PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET 44
100 #define PTP_SDR_EPOCHNUMBER_OFFSET 48
101 #define PTP_SDR_CURRENTUTCOFFSET_OFFSET 50
102 #define PTP_SDR_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 53
103 #define PTP_SDR_GRANDMASTERCLOCKUUID_OFFSET 54
104 #define PTP_SDR_GRANDMASTERPORTID_OFFSET 60
105 #define PTP_SDR_GRANDMASTERSEQUENCEID_OFFSET 62
106 #define PTP_SDR_GRANDMASTERCLOCKSTRATUM_OFFSET 67
107 #define PTP_SDR_GRANDMASTERCLOCKIDENTIFIER_OFFSET 68
108 #define PTP_SDR_GRANDMASTERCLOCKVARIANCE_OFFSET 74
109 #define PTP_SDR_GRANDMASTERPREFERRED_OFFSET 77
110 #define PTP_SDR_GRANDMASTERISBOUNDARYCLOCK_OFFSET 79
111 #define PTP_SDR_SYNCINTERVAL_OFFSET 83
112 #define PTP_SDR_LOCALCLOCKVARIANCE_OFFSET 86
113 #define PTP_SDR_LOCALSTEPSREMOVED_OFFSET 90
114 #define PTP_SDR_LOCALCLOCKSTRATUM_OFFSET 95
115 #define PTP_SDR_LOCALCLOCKIDENTIFIER_OFFSET 96
116 #define PTP_SDR_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET 101
117 #define PTP_SDR_PARENTUUID_OFFSET 102
118 #define PTP_SDR_PARENTPORTFIELD_OFFSET 110
119 #define PTP_SDR_ESTIMATEDMASTERVARIANCE_OFFSET 114
120 #define PTP_SDR_ESTIMATEDMASTERDRIFT_OFFSET 116
121 #define PTP_SDR_UTCREASONABLE_OFFSET 123
123 /*Offsets for Follow_Up (=FU) messages*/
124 #define PTP_FU_ASSOCIATEDSEQUENCEID_OFFSET 42
125 #define PTP_FU_PRECISEORIGINTIMESTAMP_OFFSET 44
126 #define PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET 44
127 #define PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET 48
129 /*Offsets for Delay_Resp (=DR) messages*/
130 #define PTP_DR_DELAYRECEIPTTIMESTAMP_OFFSET 40
131 #define PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET 40
132 #define PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET 44
133 #define PTP_DR_REQUESTINGSOURCECOMMUNICATIONTECHNOLOGY_OFFSET 49
134 #define PTP_DR_REQUESTINGSOURCEUUID_OFFSET 50
135 #define PTP_DR_REQUESTINGSOURCEPORTID_OFFSET 56
136 #define PTP_DR_REQUESTINGSOURCESEQUENCEID_OFFSET 58
138 /*Offsets for Management (=MM) messages*/
139 #define PTP_MM_TARGETCOMMUNICATIONTECHNOLOGY_OFFSET 41
140 #define PTP_MM_TARGETUUID_OFFSET 42
141 #define PTP_MM_TARGETPORTID_OFFSET 48
142 #define PTP_MM_STARTINGBOUNDARYHOPS_OFFSET 50
143 #define PTP_MM_BOUNDARYHOPS_OFFSET 52
144 #define PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET 55
145 #define PTP_MM_PARAMETERLENGTH_OFFSET 58
147 /*PARAMETERLENGTH > 0*/
148 #define PTP_MM_MESSAGEPARAMETERS_OFFSET 60
150 /*PTP_MM_CLOCK_IDENTITY (PARAMETERLENGTH = 64)*/
151 #define PTP_MM_CLOCK_IDENTITY_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET 63
152 #define PTP_MM_CLOCK_IDENTITY_CLOCKUUIDFIELD_OFFSET 64
153 #define PTP_MM_CLOCK_IDENTITY_CLOCKPORTFIELD_OFFSET 74
154 #define PTP_MM_CLOCK_IDENTITY_MANUFACTURERIDENTITY_OFFSET 76
156 /*PTP_MM_INITIALIZE_CLOCK (PARAMETERLENGTH = 4)*/
157 #define PTP_MM_INITIALIZE_CLOCK_INITIALISATIONKEY_OFFSET 62
159 /*PTP_MM_SET_SUBDOMAIN (PARAMETERLENGTH = 16)*/
160 #define PTP_MM_SET_SUBDOMAIN_SUBDOMAINNAME_OFFSET 60
162 /*PTP_MM_DEFAULT_DATA_SET (PARAMETERLENGTH = 76)*/
163 #define PTP_MM_DEFAULT_DATA_SET_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET 63
164 #define PTP_MM_DEFAULT_DATA_SET_CLOCKUUIDFIELD_OFFSET 64
165 #define PTP_MM_DEFAULT_DATA_SET_CLOCKPORTFIELD_OFFSET 74
166 #define PTP_MM_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET 79
167 #define PTP_MM_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET 80
168 #define PTP_MM_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET 86
169 #define PTP_MM_DEFAULT_DATA_SET_CLOCKFOLLOWUPCAPABLE_OFFSET 89
170 #define PTP_MM_DEFAULT_DATA_SET_PREFERRED_OFFSET 95
171 #define PTP_MM_DEFAULT_DATA_SET_INITIALIZABLE_OFFSET 99
172 #define PTP_MM_DEFAULT_DATA_SET_EXTERNALTIMING_OFFSET 103
173 #define PTP_MM_DEFAULT_DATA_SET_ISBOUNDARYCLOCK_OFFSET 107
174 #define PTP_MM_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET 111
175 #define PTP_MM_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET 112
176 #define PTP_MM_DEFAULT_DATA_SET_NUMBERPORTS_OFFSET 130
177 #define PTP_MM_DEFAULT_DATA_SET_NUMBERFOREIGNRECORDS_OFFSET 134
179 /*PTP_MM_UPDATE_DEFAULT_DATA_SET (PARAMETERLENGTH = 36)*/
180 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET 63
181 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET 64
182 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET 70
183 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_PREFERRED_OFFSET 75
184 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET 79
185 #define PTP_MM_UPDATE_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET 80
187 /*PTP_MM_CURRENT_DATA_SET (PARAMETERLENGTH = 20)*/
188 #define PTP_MM_CURRENT_DATA_SET_STEPSREMOVED_OFFSET 62
189 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTER_OFFSET 64
190 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET 64
191 #define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET 68
192 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAY_OFFSET 72
193 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET 72
194 #define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET 76
196 /*PTP_MM_PARENT_DATA_SET (PARAMETERLENGTH = 90)*/
197 #define PTP_MM_PARENT_DATA_SET_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET 63
198 #define PTP_MM_PARENT_DATA_SET_PARENTUUID_OFFSET 64
199 #define PTP_MM_PARENT_DATA_SET_PARENTPORTID_OFFSET 74
200 #define PTP_MM_PARENT_DATA_SET_PARENTLASTSYNCSEQUENCENUMBER_OFFSET 78
201 #define PTP_MM_PARENT_DATA_SET_PARENTFOLLOWUPCAPABLE_OFFSET 83
202 #define PTP_MM_PARENT_DATA_SET_PARENTEXTERNALTIMING_OFFSET 87
203 #define PTP_MM_PARENT_DATA_SET_PARENTVARIANCE_OFFSET 90
204 #define PTP_MM_PARENT_DATA_SET_PARENTSTATS_OFFSET 95
205 #define PTP_MM_PARENT_DATA_SET_OBSERVEDVARIANCE_OFFSET 98
206 #define PTP_MM_PARENT_DATA_SET_OBSERVEDDRIFT_OFFSET 100
207 #define PTP_MM_PARENT_DATA_SET_UTCREASONABLE_OFFSET 107
208 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 111
209 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERUUIDFIELD_OFFSET 112
210 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERPORTIDFIELD_OFFSET 122
211 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERSTRATUM_OFFSET 127
212 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERIDENTIFIER_OFFSET 128
213 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERVARIANCE_OFFSET 134
214 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERPREFERRED_OFFSET 139
215 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERISBOUNDARYCLOCK_OFFSET 143
216 #define PTP_MM_PARENT_DATA_SET_GRANDMASTERSEQUENCENUMBER_OFFSET 146
218 /*PTP_MM_PORT_DATA_SET (PARAMETERLENGTH = 52)*/
219 #define PTP_MM_PORT_DATA_SET_RETURNEDPORTNUMBER_OFFSET 62
220 #define PTP_MM_PORT_DATA_SET_PORTSTATE_OFFSET 67
221 #define PTP_MM_PORT_DATA_SET_LASTSYNCEVENTSEQUENCENUMBER_OFFSET 70
222 #define PTP_MM_PORT_DATA_SET_LASTGENERALEVENTSEQUENCENUMBER_OFFSET 74
223 #define PTP_MM_PORT_DATA_SET_PORTCOMMUNICATIONTECHNOLOGY_OFFSET 79
224 #define PTP_MM_PORT_DATA_SET_PORTUUIDFIELD_OFFSET 80
225 #define PTP_MM_PORT_DATA_SET_PORTIDFIELD_OFFSET 90
226 #define PTP_MM_PORT_DATA_SET_BURSTENABLED_OFFSET 95
227 #define PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESSOCTETS_OFFSET 97
228 #define PTP_MM_PORT_DATA_SET_EVENTPORTADDRESSOCTETS_OFFSET 98
229 #define PTP_MM_PORT_DATA_SET_GENERALPORTADDRESSOCTETS_OFFSET 99
230 #define PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESS_OFFSET 100
231 #define PTP_MM_PORT_DATA_SET_EVENTPORTADDRESS_OFFSET 106
232 #define PTP_MM_PORT_DATA_SET_GENERALPORTADDRESS_OFFSET 110
234 /*PTP_MM_GLOBAL_TIME_DATA_SET (PARAMETERLENGTH = 24)*/
235 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIME_OFFSET 60
236 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET 60
237 #define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET 64
238 #define PTP_MM_GLOBAL_TIME_DATA_SET_CURRENTUTCOFFSET_OFFSET 70
239 #define PTP_MM_GLOBAL_TIME_DATA_SET_LEAP59_OFFSET 75
240 #define PTP_MM_GLOBAL_TIME_DATA_SET_LEAP61_OFFSET 79
241 #define PTP_MM_GLOBAL_TIME_DATA_SET_EPOCHNUMBER_OFFSET 82
243 /*PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES (PARAMETERLENGTH = 16)*/
244 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_CURRENTUTCOFFSET_OFFSET 62
245 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP59_OFFSET 67
246 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP61_OFFSET 71
247 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_EPOCHNUMBER_OFFSET 74
249 /*PTP_MM_GET_FOREIGN_DATA_SET (PARAMETERLENGTH = 4)*/
250 #define PTP_MM_GET_FOREIGN_DATA_SET_RECORDKEY_OFFSET 62
252 /*PTP_MM_FOREIGN_DATA_SET (PARAMETERLENGTH = 28)*/
253 #define PTP_MM_FOREIGN_DATA_SET_RETURNEDPORTNUMBER_OFFSET 62
254 #define PTP_MM_FOREIGN_DATA_SET_RETURNEDRECORDNUMBER_OFFSET 66
255 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 71
256 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERUUIDFIELD_OFFSET 72
257 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERPORTIDFIELD_OFFSET 82
258 #define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERSYNCS_OFFSET 86
260 /*PTP_MM_SET_SYNC_INTERVAL (PARAMETERLENGTH = 4)*/
261 #define PTP_MM_SET_SYNC_INTERVAL_SYNCINTERVAL_OFFSET 62
263 /*PTP_MM_SET_TIME (PARAMETERLENGTH = 8)*/
264 #define PTP_MM_SET_TIME_LOCALTIME_OFFSET 60
265 #define PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET 60
266 #define PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET 64
268 /*END Offsets of fields within a PTP packet.*/
270 /**********************************************************/
271 /* flag-field-mask-definitions */
272 /**********************************************************/
273 #define PTP_FLAGS_LI61_BITMASK 0x01
274 #define PTP_FLAGS_LI59_BITMASK 0x02
275 #define PTP_FLAGS_BOUNDARY_CLOCK_BITMASK 0x04
276 #define PTP_FLAGS_ASSIST_BITMASK 0x08
277 #define PTP_FLAGS_EXT_SYNC_BITMASK 0x10
278 #define PTP_FLAGS_PARENT_STATS_BITMASK 0x20
279 #define PTP_FLAGS_SYNC_BURST_BITMASK 0x40
281 /*END flag-field-mask-definitions*/
283 /**********************************************************/
284 /* managementMessage definitions */
285 /**********************************************************/
286 #define PTP_MM_NULL 0
287 #define PTP_MM_OBTAIN_IDENTITY 1
288 #define PTP_MM_CLOCK_IDENTITY 2
289 #define PTP_MM_INITIALIZE_CLOCK 3
290 #define PTP_MM_SET_SUBDOMAIN 4
291 #define PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER 5
292 #define PTP_MM_SET_DESIGNATED_PREFERRED_MASTER 6
293 #define PTP_MM_GET_DEFAULT_DATA_SET 7
294 #define PTP_MM_DEFAULT_DATA_SET 8
295 #define PTP_MM_UPDATE_DEFAULT_DATA_SET 9
296 #define PTP_MM_GET_CURRENT_DATA_SET 10
297 #define PTP_MM_CURRENT_DATA_SET 11
298 #define PTP_MM_GET_PARENT_DATA_SET 12
299 #define PTP_MM_PARENT_DATA_SET 13
300 #define PTP_MM_GET_PORT_DATA_SET 14
301 #define PTP_MM_PORT_DATA_SET 15
302 #define PTP_MM_GET_GLOBAL_TIME_DATA_SET 16
303 #define PTP_MM_GLOBAL_TIME_DATA_SET 17
304 #define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES 18
305 #define PTP_MM_GOTO_FAULTY_STATE 19
306 #define PTP_MM_GET_FOREIGN_DATA_SET 20
307 #define PTP_MM_FOREIGN_DATA_SET 21
308 #define PTP_MM_SET_SYNC_INTERVAL 22
309 #define PTP_MM_DISABLE_PORT 23
310 #define PTP_MM_ENABLE_PORT 24
311 #define PTP_MM_DISABLE_BURST 25
312 #define PTP_MM_ENABLE_BURST 26
313 #define PTP_MM_SET_TIME 27
315 static const value_string ptp_managementMessageKey_vals[] = {
316 {PTP_MM_NULL , "PTP_MM_NULL"},
317 {PTP_MM_OBTAIN_IDENTITY , "PTP_MM_OBTAIN_IDENTITY"},
318 {PTP_MM_CLOCK_IDENTITY , "PTP_MM_CLOCK_IDENTITY"},
319 {PTP_MM_INITIALIZE_CLOCK , "PTP_MM_INITIALIZE_CLOCK"},
320 {PTP_MM_SET_SUBDOMAIN , "PTP_MM_SET_SUBDOMAIN"},
321 {PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER , "PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER"},
322 {PTP_MM_SET_DESIGNATED_PREFERRED_MASTER , "PTP_MM_SET_DESIGNATED_PREFERRED_MASTER"},
323 {PTP_MM_GET_DEFAULT_DATA_SET , "PTP_MM_GET_DEFAULT_DATA_SET"},
324 {PTP_MM_DEFAULT_DATA_SET , "PTP_MM_DEFAULT_DATA_SET"},
325 {PTP_MM_UPDATE_DEFAULT_DATA_SET , "PTP_MM_UPDATE_DEFAULT_DATA_SET"},
326 {PTP_MM_GET_CURRENT_DATA_SET , "PTP_MM_GET_CURRENT_DATA_SET"},
327 {PTP_MM_CURRENT_DATA_SET , "PTP_MM_CURRENT_DATA_SET"},
328 {PTP_MM_GET_PARENT_DATA_SET , "PTP_MM_GET_PARENT_DATA_SET"},
329 {PTP_MM_PARENT_DATA_SET , "PTP_MM_PARENT_DATA_SET"},
330 {PTP_MM_GET_PORT_DATA_SET , "PTP_MM_GET_PORT_DATA_SET"},
331 {PTP_MM_PORT_DATA_SET , "PTP_MM_PORT_DATA_SET"},
332 {PTP_MM_GET_GLOBAL_TIME_DATA_SET , "PTP_MM_GET_GLOBAL_TIME_DATA_SET"},
333 {PTP_MM_GLOBAL_TIME_DATA_SET , "PTP_MM_GLOBAL_TIME_DATA_SET"},
334 {PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES , "PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES"},
335 {PTP_MM_GOTO_FAULTY_STATE , "PTP_MM_GOTO_FAULTY_STATE"},
336 {PTP_MM_GET_FOREIGN_DATA_SET , "PTP_MM_GET_FOREIGN_DATA_SET"},
337 {PTP_MM_FOREIGN_DATA_SET , "PTP_MM_FOREIGN_DATA_SET"},
338 {PTP_MM_SET_SYNC_INTERVAL , "PTP_MM_SET_SYNC_INTERVAL"},
339 {PTP_MM_DISABLE_PORT , "PTP_MM_DISABLE_PORT"},
340 {PTP_MM_ENABLE_PORT , "PTP_MM_ENABLE_PORT"},
341 {PTP_MM_DISABLE_BURST , "PTP_MM_DISABLE_BURST"},
342 {PTP_MM_ENABLE_BURST , "PTP_MM_ENABLE_BURST"},
343 {PTP_MM_SET_TIME , "PTP_MM_SET_TIME"},
344 {0, NULL } };
346 /*same again but better readable text for info column*/
347 static const value_string ptp_managementMessageKey_infocolumn_vals[] = {
348 {PTP_MM_NULL , "Null"},
349 {PTP_MM_OBTAIN_IDENTITY , "Obtain Identity"},
350 {PTP_MM_CLOCK_IDENTITY , "Clock Identity"},
351 {PTP_MM_INITIALIZE_CLOCK , "Initialize Clock"},
352 {PTP_MM_SET_SUBDOMAIN , "Set Subdomain"},
353 {PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER , "Clear Designated Preferred Master"},
354 {PTP_MM_SET_DESIGNATED_PREFERRED_MASTER , "Set Designated Preferred Master"},
355 {PTP_MM_GET_DEFAULT_DATA_SET , "Get Default Data Set"},
356 {PTP_MM_DEFAULT_DATA_SET , "Default Data Set"},
357 {PTP_MM_UPDATE_DEFAULT_DATA_SET , "Update Default Data Set"},
358 {PTP_MM_GET_CURRENT_DATA_SET , "Get Current Data Set"},
359 {PTP_MM_CURRENT_DATA_SET , "Current Data Set"},
360 {PTP_MM_GET_PARENT_DATA_SET , "Get Parent Data Set"},
361 {PTP_MM_PARENT_DATA_SET , "Parent Data Set"},
362 {PTP_MM_GET_PORT_DATA_SET , "Get Port Data Set"},
363 {PTP_MM_PORT_DATA_SET , "Port Data Set"},
364 {PTP_MM_GET_GLOBAL_TIME_DATA_SET , "Get Global Time Data Set"},
365 {PTP_MM_GLOBAL_TIME_DATA_SET , "Global Time Data Set"},
366 {PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES , "Update Global Time Properties"},
367 {PTP_MM_GOTO_FAULTY_STATE , "Goto Faulty State"},
368 {PTP_MM_GET_FOREIGN_DATA_SET , "Get Foreign Data Set"},
369 {PTP_MM_FOREIGN_DATA_SET , "Foreign Data Set"},
370 {PTP_MM_SET_SYNC_INTERVAL , "Set Sync Interval"},
371 {PTP_MM_DISABLE_PORT , "Disable Port"},
372 {PTP_MM_ENABLE_PORT , "Enable Port"},
373 {PTP_MM_DISABLE_BURST , "Disable Burst"},
374 {PTP_MM_ENABLE_BURST , "Enable Burst"},
375 {PTP_MM_SET_TIME , "Set Time"},
376 {0, NULL } };
378 /*END managementMessage definitions*/
380 /**********************************************************/
381 /* CommunicationId definitions */
382 /**********************************************************/
383 #define PTP_CLOSED 0
384 #define PTP_ETHER 1
385 #define PTP_FFBUS 4
386 #define PTP_PROFIBUS 5
387 #define PTP_LON 6
388 #define PTP_DNET 7
389 #define PTP_SDS 8
390 #define PTP_CONTROLNET 9
391 #define PTP_CANOPEN 10
392 #define PTP_IEEE1394 243
393 #define PTP_IEEE802_11A 244
394 #define PTP_IEEE_WIRELESS 245
395 #define PTP_INFINIBAND 246
396 #define PTP_BLUETOOTH 247
397 #define PTP_IEEE802_15_1 248
398 #define PTP_IEEE1451_3 249
399 #define PTP_IEEE1451_5 250
400 #define PTP_USB 251
401 #define PTP_ISA 252
402 #define PTP_PCI 253
403 #define PTP_VXI 254
404 #define PTP_DEFAULT 255
406 static const value_string ptp_communicationid_vals[] = {
407 {PTP_CLOSED , "Closed system outside the scope of this standard."},
408 {PTP_ETHER , "IEEE 802.3 (Ethernet)"},
409 {PTP_FFBUS , "FOUNDATION Fieldbus"},
410 {PTP_PROFIBUS , "PROFIBUS"},
411 {PTP_LON , "LonTalk"},
412 {PTP_DNET , "DeviceNet"},
413 {PTP_SDS , "SmartDistributedSystem"},
414 {PTP_CONTROLNET , "ControlNet"},
415 {PTP_CANOPEN , "CANopen"},
416 {PTP_IEEE1394 , "IEEE 1394"},
417 {PTP_IEEE802_11A , "IEEE 802.11a"},
418 {PTP_IEEE_WIRELESS , "IEEE 802.11b"},
419 {PTP_INFINIBAND , "InfiniBand"},
420 {PTP_BLUETOOTH , "Bluetooth wireless"},
421 {PTP_IEEE802_15_1 , "IEEE 802.15.1"},
422 {PTP_IEEE1451_3 , "IEEE 1451.3"},
423 {PTP_IEEE1451_5 , "IEEE 1451.5"},
424 {PTP_USB , "USB bus"},
425 {PTP_ISA , "ISA bus"},
426 {PTP_PCI , "PCI bus"},
427 {PTP_VXI , "VXI bus"},
428 {PTP_DEFAULT , "Default value"},
429 {0, NULL } };
431 /*END CommunicationId definitions*/
433 /**********************************************************/
434 /* PTP message types (PTP_CONTROL field) */
435 /**********************************************************/
436 #define PTP_SYNC_MESSAGE 0x00
437 #define PTP_DELAY_REQ_MESSAGE 0x01
438 #define PTP_FOLLOWUP_MESSAGE 0x02
439 #define PTP_DELAY_RESP_MESSAGE 0x03
440 #define PTP_MANAGEMENT_MESSAGE 0x04
441 #define PTP_OTHER_MESSAGE 0x05
443 static const value_string ptp_control_vals[] = {
444 {PTP_SYNC_MESSAGE , "Sync Message"},
445 {PTP_DELAY_REQ_MESSAGE , "Delay_Req Message"},
446 {PTP_FOLLOWUP_MESSAGE , "Follow_Up Message"},
447 {PTP_DELAY_RESP_MESSAGE , "Delay_Resp Message"},
448 {PTP_MANAGEMENT_MESSAGE , "Management Message"},
449 {PTP_OTHER_MESSAGE , "Other Message"},
450 {0, NULL } };
452 /*END PTP message types*/
454 /**********************************************************/
455 /* Channel values for the PTP_MESSAGETYPE field */
456 /**********************************************************/
457 #define PTP_MESSAGETYPE_EVENT 0x01
458 #define PTP_MESSAGETYPE_GENERAL 0x02
460 static const value_string ptp_messagetype_vals[] = {
461 {PTP_MESSAGETYPE_EVENT , "Event Message"},
462 {PTP_MESSAGETYPE_GENERAL , "General Message"},
463 {0, NULL } };
465 /*END channel values for the PTP_MESSAGETYPE field*/
467 /* Channel values for boolean vals (FLAGS)*/
469 static const value_string ptp_bool_vals[] = {
470 {1, "True"},
471 {0, "False"},
472 {0, NULL }};
474 /**********************************************************/
475 /* Initialize the protocol and registered fields */
476 /**********************************************************/
478 static int hf_ptp_versionptp = -1;
479 static int hf_ptp_versionnetwork = -1;
480 static int hf_ptp_subdomain = -1;
481 static int hf_ptp_messagetype = -1;
482 static int hf_ptp_sourcecommunicationtechnology = -1;
483 static int hf_ptp_sourceuuid = -1;
484 static int hf_ptp_sourceportid = -1;
485 static int hf_ptp_sequenceid = -1;
486 static int hf_ptp_control = -1;
487 static int hf_ptp_flags = -1;
488 static int hf_ptp_flags_li61 = -1;
489 static int hf_ptp_flags_li59 = -1;
490 static int hf_ptp_flags_boundary_clock = -1;
491 static int hf_ptp_flags_assist = -1;
492 static int hf_ptp_flags_ext_sync = -1;
493 static int hf_ptp_flags_parent = -1;
494 static int hf_ptp_flags_sync_burst = -1;
496 /*Fields for ptp_sync and delay_req (=sdr) messages*/
497 static int hf_ptp_sdr_origintimestamp = -1; /*Field for seconds & nanoseconds*/
498 static int hf_ptp_sdr_origintimestamp_seconds = -1;
499 static int hf_ptp_sdr_origintimestamp_nanoseconds = -1;
500 static int hf_ptp_sdr_epochnumber = -1;
501 static int hf_ptp_sdr_currentutcoffset = -1;
502 static int hf_ptp_sdr_grandmastercommunicationtechnology = -1;
503 static int hf_ptp_sdr_grandmasterclockuuid = -1;
504 static int hf_ptp_sdr_grandmasterportid = -1;
505 static int hf_ptp_sdr_grandmastersequenceid = -1;
506 static int hf_ptp_sdr_grandmasterclockstratum = -1;
507 static int hf_ptp_sdr_grandmasterclockidentifier = -1;
508 static int hf_ptp_sdr_grandmasterclockvariance = -1;
509 static int hf_ptp_sdr_grandmasterpreferred = -1;
510 static int hf_ptp_sdr_grandmasterisboundaryclock = -1;
511 static int hf_ptp_sdr_syncinterval = -1;
512 static int hf_ptp_sdr_localclockvariance = -1;
513 static int hf_ptp_sdr_localstepsremoved = -1;
514 static int hf_ptp_sdr_localclockstratum = -1;
515 static int hf_ptp_sdr_localclockidentifier = -1;
516 static int hf_ptp_sdr_parentcommunicationtechnology = -1;
517 static int hf_ptp_sdr_parentuuid = -1;
518 static int hf_ptp_sdr_parentportfield = -1;
519 static int hf_ptp_sdr_estimatedmastervariance = -1;
520 static int hf_ptp_sdr_estimatedmasterdrift = -1;
521 static int hf_ptp_sdr_utcreasonable = -1;
523 /*Fields for follow_up (=fu) messages*/
524 static int hf_ptp_fu_associatedsequenceid = -1;
525 static int hf_ptp_fu_preciseorigintimestamp = -1;
526 static int hf_ptp_fu_preciseorigintimestamp_seconds = -1;
527 static int hf_ptp_fu_preciseorigintimestamp_nanoseconds = -1;
529 /*Fields for delay_resp (=dr) messages*/
530 static int hf_ptp_dr_delayreceipttimestamp = -1;
531 static int hf_ptp_dr_delayreceipttimestamp_seconds = -1;
532 static int hf_ptp_dr_delayreceipttimestamp_nanoseconds = -1;
533 static int hf_ptp_dr_requestingsourcecommunicationtechnology = -1;
534 static int hf_ptp_dr_requestingsourceuuid = -1;
535 static int hf_ptp_dr_requestingsourceportid = -1;
536 static int hf_ptp_dr_requestingsourcesequenceid = -1;
538 /*Fields for management (=mm) messages*/
539 static int hf_ptp_mm_targetcommunicationtechnology = -1;
540 static int hf_ptp_mm_targetuuid = -1;
541 static int hf_ptp_mm_targetportid = -1;
542 static int hf_ptp_mm_startingboundaryhops = -1;
543 static int hf_ptp_mm_boundaryhops = -1;
544 static int hf_ptp_mm_managementmessagekey = -1;
545 static int hf_ptp_mm_parameterlength = -1;
546 /*parameterlength > 0*/
547 /* static int hf_ptp_mm_messageparameters = -1; */
548 /*ptp_mm_clock_identity (parameterlength = 64)*/
549 static int hf_ptp_mm_clock_identity_clockcommunicationtechnology = -1;
550 static int hf_ptp_mm_clock_identity_clockuuidfield = -1;
551 static int hf_ptp_mm_clock_identity_clockportfield = -1;
552 static int hf_ptp_mm_clock_identity_manufactureridentity = -1;
554 /*ptp_mm_initialize_clock (parameterlength = 4)*/
555 static int hf_ptp_mm_initialize_clock_initialisationkey = -1;
557 /*ptp_mm_set_subdomain (parameterlength = 16)*/
558 static int hf_ptp_mm_set_subdomain_subdomainname = -1;
560 /*ptp_mm_default_data_set (parameterlength = 76)*/
561 static int hf_ptp_mm_default_data_set_clockcommunicationtechnology = -1;
562 static int hf_ptp_mm_default_data_set_clockuuidfield = -1;
563 static int hf_ptp_mm_default_data_set_clockportfield = -1;
564 static int hf_ptp_mm_default_data_set_clockstratum = -1;
565 static int hf_ptp_mm_default_data_set_clockidentifier = -1;
566 static int hf_ptp_mm_default_data_set_clockvariance = -1;
567 static int hf_ptp_mm_default_data_set_clockfollowupcapable = -1;
568 static int hf_ptp_mm_default_data_set_preferred = -1;
569 static int hf_ptp_mm_default_data_set_initializable = -1;
570 static int hf_ptp_mm_default_data_set_externaltiming = -1;
571 static int hf_ptp_mm_default_data_set_isboundaryclock = -1;
572 static int hf_ptp_mm_default_data_set_syncinterval = -1;
573 static int hf_ptp_mm_default_data_set_subdomainname = -1;
574 static int hf_ptp_mm_default_data_set_numberports = -1;
575 static int hf_ptp_mm_default_data_set_numberforeignrecords = -1;
577 /*ptp_mm_update_default_data_set (parameterlength = 36)*/
578 static int hf_ptp_mm_update_default_data_set_clockstratum = -1;
579 static int hf_ptp_mm_update_default_data_set_clockidentifier = -1;
580 static int hf_ptp_mm_update_default_data_set_clockvariance = -1;
581 static int hf_ptp_mm_update_default_data_set_preferred = -1;
582 static int hf_ptp_mm_update_default_data_set_syncinterval = -1;
583 static int hf_ptp_mm_update_default_data_set_subdomainname = -1;
585 /*ptp_mm_current_data_set (parameterlength = 20)*/
586 static int hf_ptp_mm_current_data_set_stepsremoved = -1;
587 static int hf_ptp_mm_current_data_set_offsetfrommaster = -1;
588 static int hf_ptp_mm_current_data_set_offsetfrommasterseconds = -1;
589 static int hf_ptp_mm_current_data_set_offsetfrommasternanoseconds = -1;
590 static int hf_ptp_mm_current_data_set_onewaydelay = -1;
591 static int hf_ptp_mm_current_data_set_onewaydelayseconds = -1;
592 static int hf_ptp_mm_current_data_set_onewaydelaynanoseconds = -1;
594 /*ptp_mm_parent_data_set (parameterlength = 90)*/
595 static int hf_ptp_mm_parent_data_set_parentcommunicationtechnology = -1;
596 static int hf_ptp_mm_parent_data_set_parentuuid = -1;
597 static int hf_ptp_mm_parent_data_set_parentportid = -1;
598 static int hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber = -1;
599 static int hf_ptp_mm_parent_data_set_parentfollowupcapable = -1;
600 static int hf_ptp_mm_parent_data_set_parentexternaltiming = -1;
601 static int hf_ptp_mm_parent_data_set_parentvariance = -1;
602 static int hf_ptp_mm_parent_data_set_parentstats = -1;
603 static int hf_ptp_mm_parent_data_set_observedvariance = -1;
604 static int hf_ptp_mm_parent_data_set_observeddrift = -1;
605 static int hf_ptp_mm_parent_data_set_utcreasonable = -1;
606 static int hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology = -1;
607 static int hf_ptp_mm_parent_data_set_grandmasteruuidfield = -1;
608 static int hf_ptp_mm_parent_data_set_grandmasterportidfield = -1;
609 static int hf_ptp_mm_parent_data_set_grandmasterstratum = -1;
610 static int hf_ptp_mm_parent_data_set_grandmasteridentifier = -1;
611 static int hf_ptp_mm_parent_data_set_grandmastervariance = -1;
612 static int hf_ptp_mm_parent_data_set_grandmasterpreferred = -1;
613 static int hf_ptp_mm_parent_data_set_grandmasterisboundaryclock = -1;
614 static int hf_ptp_mm_parent_data_set_grandmastersequencenumber = -1;
616 /*ptp_mm_port_data_set (parameterlength = 52)*/
617 static int hf_ptp_mm_port_data_set_returnedportnumber = -1;
618 static int hf_ptp_mm_port_data_set_portstate = -1;
619 static int hf_ptp_mm_port_data_set_lastsynceventsequencenumber = -1;
620 static int hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber = -1;
621 static int hf_ptp_mm_port_data_set_portcommunicationtechnology = -1;
622 static int hf_ptp_mm_port_data_set_portuuidfield = -1;
623 static int hf_ptp_mm_port_data_set_portidfield = -1;
624 static int hf_ptp_mm_port_data_set_burstenabled = -1;
625 static int hf_ptp_mm_port_data_set_subdomainaddressoctets = -1;
626 static int hf_ptp_mm_port_data_set_eventportaddressoctets = -1;
627 static int hf_ptp_mm_port_data_set_generalportaddressoctets = -1;
628 static int hf_ptp_mm_port_data_set_subdomainaddress = -1;
629 static int hf_ptp_mm_port_data_set_eventportaddress = -1;
630 static int hf_ptp_mm_port_data_set_generalportaddress = -1;
632 /*ptp_mm_global_time_data_set (parameterlength = 24)*/
633 static int hf_ptp_mm_global_time_data_set_localtime = -1;
634 static int hf_ptp_mm_global_time_data_set_localtimeseconds = -1;
635 static int hf_ptp_mm_global_time_data_set_localtimenanoseconds = -1;
636 static int hf_ptp_mm_global_time_data_set_currentutcoffset = -1;
637 static int hf_ptp_mm_global_time_data_set_leap59 = -1;
638 static int hf_ptp_mm_global_time_data_set_leap61 = -1;
639 static int hf_ptp_mm_global_time_data_set_epochnumber = -1;
641 /*ptp_mm_update_global_time_properties (parameterlength = 16)*/
642 static int hf_ptp_mm_update_global_time_properties_currentutcoffset = -1;
643 static int hf_ptp_mm_update_global_time_properties_leap59 = -1;
644 static int hf_ptp_mm_update_global_time_properties_leap61 = -1;
645 /* static int hf_ptp_mm_update_global_time_properties_epochnumber = -1; */
647 /*ptp_mm_get_foreign_data_set (parameterlength = 4)*/
648 static int hf_ptp_mm_get_foreign_data_set_recordkey = -1;
650 /*ptp_mm_foreign_data_set (parameterlength = 28)*/
651 static int hf_ptp_mm_foreign_data_set_returnedportnumber = -1;
652 static int hf_ptp_mm_foreign_data_set_returnedrecordnumber = -1;
653 static int hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology = -1;
654 static int hf_ptp_mm_foreign_data_set_foreignmasteruuidfield = -1;
655 static int hf_ptp_mm_foreign_data_set_foreignmasterportidfield = -1;
656 static int hf_ptp_mm_foreign_data_set_foreignmastersyncs = -1;
658 /*ptp_mm_set_sync_interval (parameterlength = 4)*/
659 static int hf_ptp_mm_set_sync_interval_syncinterval = -1;
661 /*ptp_mm_set_time (parameterlength = 8)*/
662 static int hf_ptp_mm_set_time_localtime = -1;
663 static int hf_ptp_mm_set_time_localtimeseconds = -1;
664 static int hf_ptp_mm_set_time_localtimenanoseconds = -1;
666 /*END Initialize the protocol and registered fields */
668 /* Initialize the subtree pointers */
669 static gint ett_ptp = -1;
670 static gint ett_ptp_flags = -1;
671 static gint ett_ptp_time = -1;
672 static gint ett_ptp_time2 = -1;
674 /* END Definitions and fields for PTPv1 dissection. */
680 /***********************************************************************************/
681 /* Definitions and fields for PTPv2 dissection. */
682 /***********************************************************************************/
685 /**********************************************************/
686 /* Offsets of fields within a PTPv2 packet. */
687 /**********************************************************/
689 /*Common offsets for all Messages (Sync, Delay_Req, Follow_Up, Delay_Resp ....)*/
690 #define PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET 0
691 #define PTP_V2_VERSIONPTP_OFFSET 1
692 #define PTP_V2_MESSAGE_LENGTH_OFFSET 2
693 #define PTP_V2_DOMAIN_NUMBER_OFFSET 4
694 #define PTP_V2_FLAGS_OFFSET 6
695 #define PTP_V2_CORRECTION_OFFSET 8
696 #define PTP_V2_CORRECTIONNS_OFFSET 8
697 #define PTP_V2_CORRECTIONSUBNS_OFFSET 14
698 #define PTP_V2_CLOCKIDENTITY_OFFSET 20
699 #define PTP_V2_SOURCEPORTID_OFFSET 28
700 #define PTP_V2_SEQUENCEID_OFFSET 30
701 #define PTP_V2_CONTROL_OFFSET 32
702 #define PTP_V2_LOGMESSAGEPERIOD_OFFSET 33
705 /*Offsets for PTP_Announce (=AN) messages*/
706 #define PTP_V2_AN_ORIGINTIMESTAMP_OFFSET 34
707 #define PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET 34
708 #define PTP_V2_AN_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
709 #define PTP_V2_AN_ORIGINCURRENTUTCOFFSET_OFFSET 44
710 #define PTP_V2_AN_PRIORITY_1_OFFSET 47
711 #define PTP_V2_AN_GRANDMASTERCLOCKCLASS_OFFSET 48
712 #define PTP_V2_AN_GRANDMASTERCLOCKACCURACY_OFFSET 49
713 #define PTP_V2_AN_GRANDMASTERCLOCKVARIANCE_OFFSET 50
714 #define PTP_V2_AN_PRIORITY_2_OFFSET 52
715 #define PTP_V2_AN_GRANDMASTERCLOCKIDENTITY_OFFSET 53
716 #define PTP_V2_AN_LOCALSTEPSREMOVED_OFFSET 61
717 #define PTP_V2_AN_TIMESOURCE_OFFSET 63
718 #define PTP_V2_AN_TLV_OFFSET 64
720 /* Announce TLV field offsets */
721 #define PTP_V2_AN_TLV_TYPE_OFFSET 0
722 #define PTP_V2_AN_TLV_LENGTHFIELD_OFFSET 2
724 /* PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION field offsets */
725 #define PTP_V2_AN_TLV_OE_ORGANIZATIONID_OFFSET 4
726 #define PTP_V2_AN_TLV_OE_ORGANIZATIONSUBTYPE_OFFSET 7
727 #define PTP_V2_AN_TLV_OE_DATAFIELD_OFFSET 10
729 /* PTPv2 IEEE_C37_238 TLV (organization extension subtype) field offsets */
730 #define PTP_V2_AN_TLV_OE_IEEEC37238TLV_GMID_OFFSET 10
731 #define PTP_V2_AN_TLV_OE_IEEEC37238TLV_GMINACCURACY_OFFSET 12
732 #define PTP_V2_AN_TLV_OE_IEEEC37238TLV_NWINACCURACY_OFFSET 16
733 #define PTP_V2_AN_TLV_OE_IEEEC37238TLV_RESERVED_OFFSET 20
735 /* PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR field offsets */
736 #define PTP_V2_AN_TLV_ATOI_KEYFIELD_OFFSET 4
737 #define PTP_V2_AN_TLV_ATOI_CURRENTOFFSET_OFFSET 5
738 #define PTP_V2_AN_TLV_ATOI_JUMPSECONDS_OFFSET 9
739 #define PTP_V2_AN_TLV_ATOI_TIMEOFNEXTJUMP_OFFSET 13
740 #define PTP_V2_AN_TLV_ATOI_DISPLAYNAME_OFFSET 19
742 /* Undissected TLV field offset */
743 #define PTP_V2_AN_TLV_DATA_OFFSET 4
745 /* 802.1AS Path Sequence Offset */
746 #define PTP_AS_AN_TLV_PATH_TRACE_OFFSET 4
748 /*Offsets for PTP_Sync AND PTP_DelayRequest (=SDR) messages*/
749 #define PTP_V2_SDR_ORIGINTIMESTAMP_OFFSET 34
750 #define PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET 34
751 #define PTP_V2_SDR_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
753 /*Offsets for PTP_Follow_Up (=FU) messages*/
754 #define PTP_V2_FU_PRECISEORIGINTIMESTAMP_OFFSET 34
755 #define PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET 34
756 #define PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET 40
758 /* 802.1AS Follow_Up information TLV */
759 #define PTP_AS_FU_TLV_INFORMATION_OFFSET 44
761 /* 802.1AS Follow_Up TLV field offsets */
762 #define PTP_AS_FU_TLV_TYPE_OFFSET 0
763 #define PTP_AS_FU_TLV_LENGTHFIELD_OFFSET 2
764 #define PTP_AS_FU_TLV_ORGANIZATIONID_OFFSET 4
765 #define PTP_AS_FU_TLV_ORGANIZATIONSUBTYPE_OFFSET 7
766 #define PTP_AS_FU_TLV_CUMULATIVESCALEDRATEOFFSET_OFFSET 10
767 #define PTP_AS_FU_TLV_GMTIMEBASEINDICATOR_OFFSET 14
768 #define PTP_AS_FU_TLV_LASTGMPHASECHANGE_OFFSET 16
769 #define PTP_AS_FU_TLV_SCALEDLASTGMFREQCHANGE_OFFSET 28
771 /*Offsets for PTP_DelayResponse (=DR) messages*/
772 #define PTP_V2_DR_RECEIVETIMESTAMP_OFFSET 34
773 #define PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET 34
774 #define PTP_V2_DR_RECEIVETIMESTAMPNANOSECONDS_OFFSET 40
775 #define PTP_V2_DR_REQUESTINGPORTIDENTITY_OFFSET 44
776 #define PTP_V2_DR_REQUESTINGSOURCEPORTID_OFFSET 52
778 /*Offsets for PTP_PDelayRequest (=PDRQ) messages*/
779 #define PTP_V2_PDRQ_ORIGINTIMESTAMP_OFFSET 34
780 #define PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET 34
781 #define PTP_V2_PDRQ_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
782 #define PTP_V2_PDRQ_RESERVED_OFFSET 44
784 /*Offsets for PTP_PDelayResponse (=PDRS) messages*/
785 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMP_OFFSET 34
786 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET 34
787 #define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPNANOSECONDS_OFFSET 40
788 #define PTP_V2_PDRS_REQUESTINGPORTIDENTITY_OFFSET 44 /* ++ */
789 #define PTP_V2_PDRS_REQUESTINGSOURCEPORTID_OFFSET 52 /* ++ */
792 /*Offsets for PTP_PDelayResponseFollowUp (=PDFU) messages*/
793 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMP_OFFSET 34
794 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET 34
795 #define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPNANOSECONDS_OFFSET 40
796 #define PTP_V2_PDFU_REQUESTINGPORTIDENTITY_OFFSET 44 /* ++ */
797 #define PTP_V2_PDFU_REQUESTINGSOURCEPORTID_OFFSET 52
800 /*Offsets for PTP_Signalling (=SIG) messages*/
801 #define PTP_V2_SIG_TARGETPORTIDENTITY_OFFSET 34
802 #define PTP_V2_SIG_TARGETPORTID_OFFSET 42
803 #define PTP_V2_SIG_TLV_START 44
805 /*Offset for PTP Signaling messages (relative to tlvOffset!) */
806 #define PTP_V2_SIG_TLV_TYPE_OFFSET 0
807 #define PTP_V2_SIG_TLV_LENGTH_OFFSET 2
808 #define PTP_V2_SIG_TLV_VALUE_OFFSET 4
809 #define PTP_V2_SIG_TLV_MESSAGE_TYPE_OFFSET 4
810 #define PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_OFFSET 5
811 #define PTP_V2_SIG_TLV_DURATION_FIELD_OFFSET 6
812 #define PTP_V2_SIG_TLV_RENEWAL_INVITED_OFFSET 11
814 #define PTP_V2_SIG_TLV_TYPE_LEN 2
815 #define PTP_V2_SIG_TLV_LENGTH_LEN 2
816 #define PTP_V2_SIG_TLV_MESSAGE_TYPE_LEN 1
817 #define PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_LEN 1
818 #define PTP_V2_SIG_TLV_DURATION_FIELD_LEN 4
819 #define PTP_V2_SIG_TLV_RENEWAL_INVITED_LEN 1
821 /* 802.1AS Signalling Message Interval Request TLV */
822 #define PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET 44
824 /* 802.1AS Signalling TLV field offsets */
825 #define PTP_AS_SIG_TLV_TYPE_OFFSET 0
826 #define PTP_AS_SIG_TLV_LENGTHFIELD_OFFSET 2
827 #define PTP_AS_SIG_TLV_ORGANIZATIONID_OFFSET 4
828 #define PTP_AS_SIG_TLV_ORGANIZATIONSUBTYPE_OFFSET 7
829 #define PTP_AS_SIG_TLV_LINKDELAYINTERVAL_OFFSET 10
830 #define PTP_AS_SIG_TLV_TIMESYNCINTERVAL_OFFSET 11
831 #define PTP_AS_SIG_TLV_ANNOUNCEINTERVAL_OFFSET 12
832 #define PTP_AS_SIG_TLV_FLAGS_OFFSET 13
834 /**********************************************************/
835 /* Message Interval Request flag-field-mask-definitions */
836 /**********************************************************/
837 #define PTP_AS_FLAGS_COMP_NEIGHBOR_RATE_RATIO_BITMASK 0x0002
838 #define PTP_AS_FLAGS_COMP_NEIGHBOR_PROP_DELAY_BITMASK 0x0004
840 /*Offsets for PTP_V2_Management (=MM) messages*/
841 #define PTP_V2_MM_TARGETPORTIDENTITY_OFFSET 34
842 #define PTP_V2_MM_TARGETPORTID_OFFSET 42
843 #define PTP_V2_MM_STARTINGBOUNDARYHOPS_OFFSET 44
844 #define PTP_V2_MM_BOUNDARYHOPS_OFFSET 45
845 #define PTP_V2_MM_ACTION_OFFSET 46
846 #define PTP_V2_MM_RESERVED_OFFSET 47
848 #define PTP_V2_MM_MANAGEMENTTLV_OFFSET 48
849 /* Management TLV */
850 #define PTP_V2_MM_TLV_TYPE_OFFSET 48
851 #define PTP_V2_MM_TLV_LENGTHFIELD_OFFSET 50
852 #define PTP_V2_MM_TLV_MANAGEMENTID_OFFSET 52
853 #define PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET 52
854 #define PTP_V2_MM_TLV_DATAFIELD_OFFSET 54
856 /* TLV Types */
857 #define PTP_V2_TLV_TYPE_RESERVED 0x0000
858 #define PTP_V2_TLV_TYPE_MANAGEMENT 0x0001
859 #define PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS 0x0002
860 #define PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION 0x0003
861 #define PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION 0x0004
862 #define PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION 0x0005
863 #define PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION 0x0006
864 #define PTP_V2_TLV_TYPE_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION 0x0007
865 #define PTP_V2_TLV_TYPE_PATH_TRACE 0x0008
866 #define PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR 0x0009
867 #define PTP_V2_TLV_TYPE_AUTHENTICATION 0x2000
868 #define PTP_V2_TLV_TYPE_AUTHENTICATION_CHALLENGE 0x2001
869 #define PTP_V2_TLV_TYPE_SECURITY_ASSOCIATION_UPDATE 0x2002
870 #define PTP_V2_TLV_TYPE_CUM_FREQ_SCALE_FACTOR_OFFSET 0x2003
872 /* Signalling TLV Object IDs */
873 #define PTP_AS_TLV_OID_TYPE_802 0x0080C2
875 /* PTPv2 Management clockType Boolean[16] Bits mask */
876 #define CLOCKTYPE_ORDINARY_CLOCK 0x8000
877 #define CLOCKTYPE_BOUNDARY_CLOCK 0x4000
878 #define CLOCKTYPE_P2P_TC 0x2000
879 #define CLOCKTYPE_E2E_TC 0x1000
880 #define CLOCKTYPE_MANAGEMENT_NODE 0x0800
881 #define CLOCKTYPE_RESERVED 0x07FF
883 /* PTPv2 Management IDs */
884 #define PTP_V2_MM_ID_NULL_MANAGEMENT 0x0000
885 #define PTP_V2_MM_ID_CLOCK_DESCRIPTION 0x0001
886 #define PTP_V2_MM_ID_USER_DESCRIPTION 0x0002
887 #define PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE 0x0003
888 #define PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE 0x0004
889 #define PTP_V2_MM_ID_INITIALIZE 0x0005
890 #define PTP_V2_MM_ID_FAULT_LOG 0x0006
891 #define PTP_V2_MM_ID_FAULT_LOG_RESET 0x0007
892 #define PTP_V2_MM_ID_DEFAULT_DATA_SET 0x2000
893 #define PTP_V2_MM_ID_CURRENT_DATA_SET 0x2001
894 #define PTP_V2_MM_ID_PARENT_DATA_SET 0x2002
895 #define PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET 0x2003
896 #define PTP_V2_MM_ID_PORT_DATA_SET 0x2004
897 #define PTP_V2_MM_ID_PRIORITY1 0x2005
898 #define PTP_V2_MM_ID_PRIORITY2 0x2006
899 #define PTP_V2_MM_ID_DOMAIN 0x2007
900 #define PTP_V2_MM_ID_SLAVE_ONLY 0x2008
901 #define PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL 0x2009
902 #define PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT 0x200A
903 #define PTP_V2_MM_ID_LOG_SYNC_INTERVAL 0x200B
904 #define PTP_V2_MM_ID_VERSION_NUMBER 0x200C
905 #define PTP_V2_MM_ID_ENABLE_PORT 0x200D
906 #define PTP_V2_MM_ID_DISABLE_PORT 0x200E
907 #define PTP_V2_MM_ID_TIME 0x200F
908 #define PTP_V2_MM_ID_CLOCK_ACCURACY 0x2010
909 #define PTP_V2_MM_ID_UTC_PROPERTIES 0x2011
910 #define PTP_V2_MM_ID_TRACEABILITY_PROPERTIES 0x2012
911 #define PTP_V2_MM_ID_TIMESCALE_PROPERTIES 0x2013
912 #define PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE 0x2014
913 #define PTP_V2_MM_ID_PATH_TRACE_LIST 0x2015
914 #define PTP_V2_MM_ID_PATH_TRACE_ENABLE 0x2016
915 #define PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE 0x2017
916 #define PTP_V2_MM_ID_UNICAST_MASTER_TABLE 0x2018
917 #define PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE 0x2019
918 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE 0x201A
919 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED 0x201B
920 #define PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE 0x201C
921 #define PTP_V2_MM_ID_ALTERNATE_MASTER 0x201D
922 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE 0x201E
923 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME 0x201F
924 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY 0x2020
925 #define PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES 0x2021
926 #define PTP_V2_MM_ID_TC_DEFAULT_DATA_SET 0x4000
927 #define PTP_V2_MM_ID_TC_PORT_DATA_SET 0x4001
928 #define PTP_V2_MM_ID_PRIMARY_DOMAIN 0x4002
929 #define PTP_V2_MM_ID_DELAY_MECHANISM 0x6000
930 #define PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL 0x6001
932 /* Management DataField for DefaultDS */
933 #define PTP_V2_MM_RESERVED1 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 1
934 #define PTP_V2_MM_NUMBERPORTS PTP_V2_MM_TLV_DATAFIELD_OFFSET + 2
935 #define PTP_V2_MM_PRIORITY1 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 4
936 #define PTP_V2_MM_CLOCKQUALITY PTP_V2_MM_TLV_DATAFIELD_OFFSET + 5
937 #define PTP_V2_MM_PRIORITY2 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 9
938 #define PTP_V2_MM_CLOCKIDENTITY PTP_V2_MM_TLV_DATAFIELD_OFFSET + 10
939 #define PTP_V2_MM_DOMAINNUMBER PTP_V2_MM_TLV_DATAFIELD_OFFSET + 18
940 #define PTP_V2_MM_RESERVED2 PTP_V2_MM_TLV_DATAFIELD_OFFSET + 19
942 /* Organization IDs for PTPv2 Organization Extension */
943 #define PTP_V2_OE_ORG_ID_IEEE_C37_238 0x1C129D /* Defined in IEEE Std C37.238-2011 */
945 /* Subtypes for the PTP_V2_OE_ORG_ID_IEEE_C37_238 organization ID */
946 #define PTP_V2_OE_ORG_IEEE_C37_238_SUBTYPE_C37238TLV 1 /* Defined in IEEE Std C37.238-2011 */
948 #define PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK 0x10
950 #define PTP_V2_TRANSPORTSPECIFIC_ASPACKET_BITMASK 0x10
953 /**********************************************************/
954 /* flag-field-mask-definitions */
955 /**********************************************************/
956 #define PTP_V2_FLAGS_LI61_BITMASK 0x0001
957 #define PTP_V2_FLAGS_LI59_BITMASK 0x0002
958 #define PTP_V2_FLAGS_UTC_OFFSET_VALID_BITMASK 0x0004
959 #define PTP_V2_FLAGS_PTP_TIMESCALE_BITMASK 0x0008
960 #define PTP_V2_FLAGS_TIME_TRACEABLE_BITMASK 0x0010
961 #define PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK 0x0020
962 #define PTP_V2_FLAGS_ALTERNATE_BITMASK 0x0100
963 #define PTP_V2_FLAGS_TWO_STEP_BITMASK 0x0200
964 #define PTP_V2_FLAGS_UNICAST_BITMASK 0x0400
965 #define PTP_V2_FLAGS_SPECIFIC1_BITMASK 0x2000
966 #define PTP_V2_FLAGS_SPECIFIC2_BITMASK 0x4000
967 #define PTP_V2_FLAGS_SECURITY_BITMASK 0x8000
971 /**********************************************************/
972 /* PTP v2 message ids (ptp messageid field) */
973 /**********************************************************/
974 #define PTP_V2_SYNC_MESSAGE 0x00
975 #define PTP_V2_DELAY_REQ_MESSAGE 0x01
976 #define PTP_V2_PATH_DELAY_REQ_MESSAGE 0x02
977 #define PTP_V2_PATH_DELAY_RESP_MESSAGE 0x03
978 #define PTP_V2_FOLLOWUP_MESSAGE 0x08
979 #define PTP_V2_DELAY_RESP_MESSAGE 0x09
980 #define PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE 0x0A
981 #define PTP_V2_ANNOUNCE_MESSAGE 0x0B
982 #define PTP_V2_SIGNALLING_MESSAGE 0x0C
983 #define PTP_V2_MANAGEMENT_MESSAGE 0x0D
986 static const value_string ptp_v2_managementID_vals[] = {
987 {PTP_V2_MM_ID_NULL_MANAGEMENT ,"NULL_MANAGEMENT"},
988 {PTP_V2_MM_ID_CLOCK_DESCRIPTION ,"CLOCK_DESCRIPTION"},
989 {PTP_V2_MM_ID_USER_DESCRIPTION ,"USER_DESCRIPTION"},
990 {PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE ,"SAVE_IN_NON_VOLATILE_STORAGE"},
991 {PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE ,"RESET_NON_VOLATILE_STORAGE"},
992 {PTP_V2_MM_ID_INITIALIZE ,"INITIALIZE"},
993 {PTP_V2_MM_ID_FAULT_LOG ,"FAULT_LOG"},
994 {PTP_V2_MM_ID_FAULT_LOG_RESET ,"FAULT_LOG_RESET"},
995 {PTP_V2_MM_ID_DEFAULT_DATA_SET ,"DEFAULT_DATA_SET"},
996 {PTP_V2_MM_ID_CURRENT_DATA_SET ,"CURRENT_DATA_SET"},
997 {PTP_V2_MM_ID_PARENT_DATA_SET ,"PARENT_DATA_SET"},
998 {PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET ,"TIME_PROPERTIES_DATA_SET"},
999 {PTP_V2_MM_ID_PORT_DATA_SET ,"PORT_DATA_SET"},
1000 {PTP_V2_MM_ID_PRIORITY1 ,"PRIORITY1"},
1001 {PTP_V2_MM_ID_PRIORITY2 ,"PRIORITY2"},
1002 {PTP_V2_MM_ID_DOMAIN ,"DOMAIN"},
1003 {PTP_V2_MM_ID_SLAVE_ONLY ,"SLAVE_ONLY"},
1004 {PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL ,"LOG_ANNOUNCE_INTERVAL"},
1005 {PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT ,"ANNOUNCE_RECEIPT_TIMEOUT"},
1006 {PTP_V2_MM_ID_LOG_SYNC_INTERVAL ,"LOG_SYNC_INTERVAL"},
1007 {PTP_V2_MM_ID_VERSION_NUMBER ,"VERSION_NUMBER"},
1008 {PTP_V2_MM_ID_ENABLE_PORT ,"ENABLE_PORT"},
1009 {PTP_V2_MM_ID_DISABLE_PORT ,"DISABLE_PORT"},
1010 {PTP_V2_MM_ID_TIME ,"TIME"},
1011 {PTP_V2_MM_ID_CLOCK_ACCURACY ,"CLOCK_ACCURACY"},
1012 {PTP_V2_MM_ID_UTC_PROPERTIES ,"UTC_PROPERTIES"},
1013 {PTP_V2_MM_ID_TRACEABILITY_PROPERTIES ,"TRACEABILITY_PROPERTIES"},
1014 {PTP_V2_MM_ID_TIMESCALE_PROPERTIES ,"TIMESCALE_PROPERTIES"},
1015 {PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE ,"UNICAST_NEGOTIATION_ENABLE"},
1016 {PTP_V2_MM_ID_PATH_TRACE_LIST ,"PATH_TRACE_LIST"},
1017 {PTP_V2_MM_ID_PATH_TRACE_ENABLE ,"PATH_TRACE_ENABLE"},
1018 {PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE ,"GRANDMASTER_CLUSTER_TABLE"},
1019 {PTP_V2_MM_ID_UNICAST_MASTER_TABLE ,"UNICAST_MASTER_TABLE"},
1020 {PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE ,"UNICAST_MASTER_MAX_TABLE_SIZE"},
1021 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE ,"ACCEPTABLE_MASTER_TABLE"},
1022 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED ,"ACCEPTABLE_MASTER_TABLE_ENABLED"},
1023 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE ,"ACCEPTABLE_MASTER_MAX_TABLE_SIZE"},
1024 {PTP_V2_MM_ID_ALTERNATE_MASTER ,"ALTERNATE_MASTER"},
1025 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE ,"ALTERNATE_TIME_OFFSET_ENABLE"},
1026 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME ,"ALTERNATE_TIME_OFFSET_NAME"},
1027 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY ,"ALTERNATE_TIME_OFFSET_MAX_KEY"},
1028 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES ,"ALTERNATE_TIME_OFFSET_PROPERTIES"},
1029 {PTP_V2_MM_ID_TC_DEFAULT_DATA_SET ,"TC_DEFAULT_DATA_SET"},
1030 {PTP_V2_MM_ID_TC_PORT_DATA_SET ,"TC_PORT_DATA_SET"},
1031 {PTP_V2_MM_ID_PRIMARY_DOMAIN ,"PRIMARY_DOMAIN"},
1032 {PTP_V2_MM_ID_DELAY_MECHANISM ,"DELAY_MECHANISM"},
1033 {PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL ,"LOG_MIN_PDELAY_REQ_INTERVAL"},
1034 {0 ,NULL} };
1036 /*same again but better readable text for info column*/
1037 static const value_string ptp_v2_managementID_infocolumn_vals[] = {
1038 {PTP_V2_MM_ID_NULL_MANAGEMENT ,"Null management"},
1039 {PTP_V2_MM_ID_CLOCK_DESCRIPTION ,"Clock description"},
1040 {PTP_V2_MM_ID_USER_DESCRIPTION ,"User description"},
1041 {PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE ,"Save in non volatile storage"},
1042 {PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE ,"Reset non volatile storage"},
1043 {PTP_V2_MM_ID_INITIALIZE ,"Initialize"},
1044 {PTP_V2_MM_ID_FAULT_LOG ,"Fault log"},
1045 {PTP_V2_MM_ID_FAULT_LOG_RESET ,"Fault log reset"},
1046 {PTP_V2_MM_ID_DEFAULT_DATA_SET ,"Default dataset"},
1047 {PTP_V2_MM_ID_CURRENT_DATA_SET ,"Current dataset"},
1048 {PTP_V2_MM_ID_PARENT_DATA_SET ,"Parent dataset"},
1049 {PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET ,"Time properties dataset"},
1050 {PTP_V2_MM_ID_PORT_DATA_SET ,"Port dataset"},
1051 {PTP_V2_MM_ID_PRIORITY1 ,"Priority 1"},
1052 {PTP_V2_MM_ID_PRIORITY2 ,"Priority 2"},
1053 {PTP_V2_MM_ID_DOMAIN ,"Domain"},
1054 {PTP_V2_MM_ID_SLAVE_ONLY ,"Slave only"},
1055 {PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL ,"Log announce interval"},
1056 {PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT ,"Announce receipt timeout"},
1057 {PTP_V2_MM_ID_LOG_SYNC_INTERVAL ,"Log sync interval"},
1058 {PTP_V2_MM_ID_VERSION_NUMBER ,"Version number"},
1059 {PTP_V2_MM_ID_ENABLE_PORT ,"Enable port"},
1060 {PTP_V2_MM_ID_DISABLE_PORT ,"Disable port"},
1061 {PTP_V2_MM_ID_TIME ,"Time"},
1062 {PTP_V2_MM_ID_CLOCK_ACCURACY ,"Clock accuracy"},
1063 {PTP_V2_MM_ID_UTC_PROPERTIES ,"UTC properties"},
1064 {PTP_V2_MM_ID_TRACEABILITY_PROPERTIES ,"Traceability properties"},
1065 {PTP_V2_MM_ID_TIMESCALE_PROPERTIES ,"Timescale properties"},
1066 {PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE ,"Unicast negotiation enable"},
1067 {PTP_V2_MM_ID_PATH_TRACE_LIST ,"Path trace list"},
1068 {PTP_V2_MM_ID_PATH_TRACE_ENABLE ,"Path trace enable"},
1069 {PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE ,"Grandmaster cluster table"},
1070 {PTP_V2_MM_ID_UNICAST_MASTER_TABLE ,"Unicast master table"},
1071 {PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE ,"Unicast master max table size"},
1072 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE ,"Acceptable master table"},
1073 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED ,"Acceptable master table enabled"},
1074 {PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE ,"Acceptable master max table size"},
1075 {PTP_V2_MM_ID_ALTERNATE_MASTER ,"Alternate master"},
1076 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE ,"Alternate time offset enable"},
1077 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME ,"Alternate time offset name"},
1078 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY ,"Alternate time offset max key"},
1079 {PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES ,"Alternate time offset properties"},
1080 {PTP_V2_MM_ID_TC_DEFAULT_DATA_SET ,"Transparent clock default dataset"},
1081 {PTP_V2_MM_ID_TC_PORT_DATA_SET ,"Transparent clock port dataset"},
1082 {PTP_V2_MM_ID_PRIMARY_DOMAIN ,"Primary domain"},
1083 {PTP_V2_MM_ID_DELAY_MECHANISM ,"Delay mechanism"},
1084 {PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL ,"Log min pdelay req. interval"},
1085 {0 , NULL} };
1087 static const value_string ptp_v2_TLV_type_vals[] = {
1088 {PTP_V2_TLV_TYPE_RESERVED ,"Reserved"},
1089 {PTP_V2_TLV_TYPE_MANAGEMENT ,"Management"},
1090 {PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS ,"Management error status"},
1091 {PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION ,"Organization extension"},
1092 {PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION ,"Request unicast transmission"},
1093 {PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION ,"Grant unicast transmission"},
1094 {PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION ,"Cancel unicast transmission"},
1095 {PTP_V2_TLV_TYPE_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION ,"Acknowledge cancel unicast transmission"},
1096 {PTP_V2_TLV_TYPE_PATH_TRACE ,"Path trace"},
1097 {PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR,"Alternate time offset indicator"},
1098 {PTP_V2_TLV_TYPE_AUTHENTICATION ,"Authentication"},
1099 {PTP_V2_TLV_TYPE_AUTHENTICATION_CHALLENGE ,"Authentication challenge"},
1100 {PTP_V2_TLV_TYPE_SECURITY_ASSOCIATION_UPDATE ,"Security association update"},
1101 {PTP_V2_TLV_TYPE_CUM_FREQ_SCALE_FACTOR_OFFSET ,"Cum. freq. scale factor offset"},
1102 {0 , NULL} };
1104 static const value_string ptp_as_TLV_oid_vals[] = {
1105 {PTP_AS_TLV_OID_TYPE_802 ,"IEEE 802"},
1106 {0 , NULL} };
1108 static const value_string ptp2_networkProtocol_vals[] = {
1109 {0x0000, "Reserved"},
1110 {0x0001, "UDP/IPv4"},
1111 {0x0002, "UDP/IPv6"},
1112 {0x0003, "IEEE 802.3"},
1113 {0x0004, "DeviceNet"},
1114 {0x0005, "ControlNet"},
1115 {0x0006, "PROFINET"},
1116 {0x0007, "Reserved"},
1117 {0xFFFE, "Unknown Protocol"},
1118 {0xFFFF, "Reserved"},
1119 {0, NULL } };
1122 static const value_string ptp_v2_messageid_vals[] = {
1123 {PTP_V2_SYNC_MESSAGE, "Sync Message"},
1124 {PTP_V2_DELAY_REQ_MESSAGE, "Delay_Req Message"},
1125 {PTP_V2_PATH_DELAY_REQ_MESSAGE, "Path_Delay_Req Message"},
1126 {PTP_V2_PATH_DELAY_RESP_MESSAGE, "Path_Delay_Resp Message"},
1127 {PTP_V2_FOLLOWUP_MESSAGE, "Follow_Up Message"},
1128 {PTP_V2_DELAY_RESP_MESSAGE, "Delay_Resp Message"},
1129 {PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE,"Path_Delay_Resp_Follow_Up Message"},
1130 {PTP_V2_ANNOUNCE_MESSAGE, "Announce Message"},
1131 {PTP_V2_SIGNALLING_MESSAGE, "Signalling Message"},
1132 {PTP_V2_MANAGEMENT_MESSAGE, "Management Message"},
1133 {0, NULL }
1136 static const value_string ptp_v2_clockaccuracy_vals[] = {
1137 {0x20, "The time is accurate to within 25 ns"},
1138 {0x21, "The time is accurate to within 100 ns"},
1139 {0x22, "The time is accurate to within 250 ns"},
1140 {0x23, "The time is accurate to within 1 us"},
1141 {0x24, "The time is accurate to within 2,5 us"},
1142 {0x25, "The time is accurate to within 10 us"},
1143 {0x26, "The time is accurate to within 25 us"},
1144 {0x27, "The time is accurate to within 100 us"},
1145 {0x28, "The time is accurate to within 250 us"},
1146 {0x29, "The time is accurate to within 1 ms"},
1147 {0x2A, "The time is accurate to within 2,5 ms"},
1148 {0x2B, "The time is accurate to within 10 ms"},
1149 {0x2C, "The time is accurate to within 25 ms"},
1150 {0x2D, "The time is accurate to within 100 ms"},
1151 {0x2E, "The time is accurate to within 250 ms"},
1152 {0x2F, "The time is accurate to within 1 s"},
1153 {0x30, "The time is accurate to within 10 s"},
1154 {0x31, "The time is accurate to >10 s"},
1155 {0x32, "reserved"},
1156 {0x80, "For use by alternate PTP profiles"},
1157 {0xFE, "Accuracy Unknown"},
1158 {0xFF, "reserved"},
1159 {0, NULL }
1162 static const value_string ptp_v2_timesource_vals[] = {
1163 {0x10, "ATOMIC_CLOCK"},
1164 {0x20, "GPS"},
1165 {0x30, "TERRESTRIAL_RADIO"},
1166 {0x40, "PTP"},
1167 {0x50, "NTP"},
1168 {0x60, "HAND_SET"},
1169 {0x90, "OTHER"},
1170 {0xA0, "INTERNAL_OSCILLATOR"},
1171 {0xFF, "reserved"},
1172 {0, NULL }
1175 static const value_string ptp_v2_mm_action_vals[] = {
1176 {0x0, "GET"},
1177 {0x1, "SET"},
1178 {0x2, "RESPONSE"},
1179 {0x3, "COMMAND"},
1180 {0x4, "ACKNOWLEDGE"},
1181 {0, NULL }
1184 static const value_string ptp2_severityCode_vals[] = {
1185 {0x00, "Emergency: system is unusable"},
1186 {0x01, "Alert: immediate action needed"},
1187 {0x02, "Critical: critical conditions"},
1188 {0x03, "Error: error conditions"},
1189 {0x04, "Warning: warning conditions"},
1190 {0x05, "Notice: normal but significant condition"},
1191 {0x06, "Informational: informational messages"},
1192 {0x07, "Debug: debug-level messages"},
1193 {0x08, "Reserved"},
1194 {0xFF, "Reserved"},
1195 {0, NULL}
1198 static const value_string ptp2_portState_vals[] = {
1199 {0x01, "INITIALIZING"},
1200 {0x02, "FAULTY"},
1201 {0x03, "DISABLED"},
1202 {0x04, "LISTENING"},
1203 {0x05, "PRE_MASTER"},
1204 {0x06, "MASTER"},
1205 {0x07, "PASSIVE"},
1206 {0x08, "UNCALIBRATED"},
1207 {0x09, "SLAVE"},
1208 {0, NULL}
1211 static const value_string ptp2_delayMechanism_vals[] = {
1212 {0x01, "E2E"},
1213 {0x02, "P2P"},
1214 {0xFE, "DISABLED"},
1215 {0, NULL}
1218 static const value_string ptp2_managementErrorId_vals[] = {
1219 {0x0000, "Reserved"},
1220 {0x0001, "RESPONSE_TOO_BIG"},
1221 {0x0002, "NO_SUCH_ID"},
1222 {0x0003, "WRONG_LENGTH"},
1223 {0x0004, "WRONG_VALUE"},
1224 {0x0005, "NOT_SETABLE"},
1225 {0x0006, "NOT_SUPPORTED"},
1226 {0x0007, "Reserved"},
1227 {0xFFFE, "GENERAL_ERROR"},
1228 {0xFFFF, "Reserved"},
1229 {0, NULL}
1232 static const value_string ptp2_organizationExtensionOrgId_vals[] = {
1233 {PTP_V2_OE_ORG_ID_IEEE_C37_238, "IEEE C37.238"},
1234 {0, NULL}
1237 static const value_string ptp2_org_iee_c37_238_subtype_vals[] = {
1238 {PTP_V2_OE_ORG_IEEE_C37_238_SUBTYPE_C37238TLV, "IEEE_C37_238 TLV"},
1239 {0, NULL}
1242 /**********************************************************/
1243 /* Initialize the protocol and registered fields */
1244 /**********************************************************/
1246 static int hf_ptp_v2_transportspecific = -1;
1247 static int hf_ptp_v2_transportspecific_v1_compatibility = -1; /* over UDP */
1248 static int hf_ptp_v2_transportspecific_802as_conform = -1; /* over Ethernet */
1249 static int hf_ptp_v2_messageid = -1;
1250 static int hf_ptp_v2_versionptp = -1;
1251 static int hf_ptp_v2_messagelength = -1;
1252 static int hf_ptp_v2_domainnumber = -1;
1253 static int hf_ptp_v2_flags = -1;
1254 static int hf_ptp_v2_flags_alternatemaster = -1;
1255 static int hf_ptp_v2_flags_twostep = -1;
1256 static int hf_ptp_v2_flags_unicast = -1;
1257 static int hf_ptp_v2_flags_specific1 = -1;
1258 static int hf_ptp_v2_flags_specific2 = -1;
1259 static int hf_ptp_v2_flags_security = -1;
1260 static int hf_ptp_v2_flags_li61 = -1;
1261 static int hf_ptp_v2_flags_li59 = -1;
1262 static int hf_ptp_v2_flags_utcoffsetvalid = -1;
1263 static int hf_ptp_v2_flags_ptptimescale = -1;
1264 static int hf_ptp_v2_flags_timetraceable = -1;
1265 static int hf_ptp_v2_flags_frequencytraceable = -1;
1266 static int hf_ptp_v2_correction = -1;
1267 static int hf_ptp_v2_correctionsubns = -1;
1268 static int hf_ptp_v2_clockidentity = -1;
1269 static int hf_ptp_v2_sourceportid = -1;
1270 static int hf_ptp_v2_sequenceid = -1;
1271 static int hf_ptp_v2_control = -1;
1272 static int hf_ptp_v2_logmessageperiod = -1;
1275 /*Fields for PTP_Announce (=an) messages*/
1276 /* static int hf_ptp_v2_an_origintimestamp = -1; */ /*Field for seconds & nanoseconds*/
1277 static int hf_ptp_v2_an_origintimestamp_seconds = -1;
1278 static int hf_ptp_v2_an_origintimestamp_nanoseconds = -1;
1279 static int hf_ptp_v2_an_origincurrentutcoffset = -1;
1280 static int hf_ptp_v2_an_timesource = -1;
1281 static int hf_ptp_v2_an_localstepsremoved = -1;
1282 static int hf_ptp_v2_an_grandmasterclockidentity = -1;
1283 static int hf_ptp_v2_an_grandmasterclockclass = -1;
1284 static int hf_ptp_v2_an_grandmasterclockaccuracy = -1;
1285 static int hf_ptp_v2_an_grandmasterclockvariance = -1;
1286 static int hf_ptp_v2_an_priority1 = -1;
1287 static int hf_ptp_v2_an_priority2 = -1;
1289 /* Fields for PTP_Announce TLVs */
1290 static int hf_ptp_v2_an_tlv_tlvtype = -1;
1291 static int hf_ptp_v2_an_tlv_lengthfield = -1;
1292 /* Fields for the ORGANIZATION_EXTENSION TLV */
1293 static int hf_ptp_v2_oe_tlv_organizationid = -1;
1294 static int hf_ptp_v2_oe_tlv_organizationsubtype = -1;
1295 static int hf_ptp_v2_oe_tlv_datafield = -1;
1296 /* Fields for IEEE_C37_238 TLV (OE TLV subtype) */
1297 static int hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmasterid = -1;
1298 static int hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmastertimeinaccuracy = -1;
1299 static int hf_ptp_v2_oe_tlv_subtype_c37238tlv_networktimeinaccuracy = -1;
1300 static int hf_ptp_v2_oe_tlv_subtype_c37238tlv_reserved = -1;
1301 /* Fields for the ALTERNATE_TIME_OFFSET_INDICATOR TLV */
1302 static int hf_ptp_v2_atoi_tlv_keyfield = -1;
1303 static int hf_ptp_v2_atoi_tlv_currentoffset = -1;
1304 static int hf_ptp_v2_atoi_tlv_jumpseconds = -1;
1305 static int hf_ptp_v2_atoi_tlv_timeofnextjump = -1;
1306 static int hf_ptp_v2_atoi_tlv_displayname = -1;
1307 static int hf_ptp_v2_atoi_tlv_displayname_length = -1;
1308 /* Field for the PATH TRACE TLV */
1309 static int hf_ptp_v2_an_tlv_pathsequence = -1;
1311 /* Fields for an undissected TLV */
1312 static int hf_ptp_v2_an_tlv_data = -1;
1314 /*Fields for PTP_Sync AND PTP_DelayRequest (=sdr) messages*/
1315 /* static int hf_ptp_v2_sdr_origintimestamp = -1; */ /*Field for seconds & nanoseconds*/
1316 static int hf_ptp_v2_sdr_origintimestamp_seconds = -1;
1317 static int hf_ptp_v2_sdr_origintimestamp_nanoseconds = -1;
1320 /*Fields for PTP_Follow_Up (=fu) messages*/
1321 /* static int hf_ptp_v2_fu_preciseorigintimestamp = -1; */ /*Field for seconds & nanoseconds*/
1322 static int hf_ptp_v2_fu_preciseorigintimestamp_seconds = -1;
1323 static int hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds = -1;
1324 /* Fields for the Follow_Up Information TLV */
1325 static int hf_ptp_as_fu_tlv_tlvtype = -1;
1326 static int hf_ptp_as_fu_tlv_lengthfield = -1;
1327 static int hf_ptp_as_fu_tlv_organization_id = -1;
1328 static int hf_ptp_as_fu_tlv_organization_subtype = -1;
1329 static int hf_ptp_as_fu_tlv_cumulative_offset = -1;
1330 static int hf_ptp_as_fu_tlv_gm_base_indicator = -1;
1331 static int hf_ptp_as_fu_tlv_last_gm_phase_change = -1;
1332 static int hf_ptp_as_fu_tlv_scaled_last_gm_phase_change = -1;
1334 /*Fields for PTP_DelayResponse (=dr) messages*/
1335 /* static int hf_ptp_v2_dr_receivetimestamp = -1; */ /*Field for seconds & nanoseconds*/
1336 static int hf_ptp_v2_dr_receivetimestamp_seconds = -1;
1337 static int hf_ptp_v2_dr_receivetimestamp_nanoseconds = -1;
1338 static int hf_ptp_v2_dr_requestingportidentity = -1;
1339 static int hf_ptp_v2_dr_requestingsourceportid = -1;
1342 /*Fields for PTP_PDelayRequest (=pdrq) messages*/
1343 /* static int hf_ptp_v2_pdrq_origintimestamp = -1; */ /*Field for seconds & nanoseconds*/
1344 static int hf_ptp_v2_pdrq_origintimestamp_seconds = -1;
1345 static int hf_ptp_v2_pdrq_origintimestamp_nanoseconds = -1;
1348 /*Fields for PTP_PDelayResponse (=pdrs) messages*/
1349 /* static int hf_ptp_v2_pdrs_requestreceipttimestamp = -1; */ /*Field for seconds & nanoseconds*/
1350 static int hf_ptp_v2_pdrs_requestreceipttimestamp_seconds = -1;
1351 static int hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds = -1;
1352 static int hf_ptp_v2_pdrs_requestingportidentity = -1;
1353 static int hf_ptp_v2_pdrs_requestingsourceportid = -1;
1356 /*Fields for PTP_PDelayResponseFollowUp (=pdfu) messages*/
1357 /* static int hf_ptp_v2_pdfu_responseorigintimestamp = -1; */ /*Field for seconds & nanoseconds*/
1358 static int hf_ptp_v2_pdfu_responseorigintimestamp_seconds = -1;
1359 static int hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds = -1;
1360 static int hf_ptp_v2_pdfu_requestingportidentity = -1;
1361 static int hf_ptp_v2_pdfu_requestingsourceportid = -1;
1364 /*Fields for PTP_Signalling (=sig) messages*/
1365 static int hf_ptp_v2_sig_targetportidentity = -1;
1366 static int hf_ptp_v2_sig_targetportid = -1;
1367 static int hf_ptp_v2_sig_tlv_tlvType = -1;
1368 static int hf_ptp_v2_sig_tlv_lengthField = -1;
1369 static int hf_ptp_v2_sig_tlv_data = -1;
1370 static int hf_ptp_v2_sig_tlv_messageType = -1;
1371 static int hf_ptp_v2_sig_tlv_logInterMessagePeriod = -1;
1372 static int hf_ptp_v2_sig_tlv_logInterMessagePeriod_period = -1;
1373 static int hf_ptp_v2_sig_tlv_logInterMessagePeriod_rate = -1;
1374 static int hf_ptp_v2_sig_tlv_durationField = -1;
1375 static int hf_ptp_v2_sig_tlv_renewalInvited = -1;
1377 /* Fields for the Message Interval Request TLV */
1378 static int hf_ptp_as_sig_tlv_tlvtype = -1;
1379 static int hf_ptp_as_sig_tlv_lengthfield = -1;
1380 static int hf_ptp_as_sig_tlv_organization_id = -1;
1381 static int hf_ptp_as_sig_tlv_organization_subtype = -1;
1382 static int hf_ptp_as_sig_tlv_link_delay_interval = -1;
1383 static int hf_ptp_as_sig_tlv_time_sync_interval = -1;
1384 static int hf_ptp_as_sig_tlv_announce_interval = -1;
1385 static int hf_ptp_as_sig_tlv_flags = -1;
1386 static int hf_ptp_as_sig_tlv_flags_comp_rate_ratio = -1;
1387 static int hf_ptp_as_sig_tlv_flags_comp_prop_delay = -1;
1389 /*Fields for PTP_Management (=mm) messages*/
1390 static int hf_ptp_v2_mm_targetportidentity = -1;
1391 static int hf_ptp_v2_mm_targetportid = -1;
1392 static int hf_ptp_v2_mm_startingboundaryhops = -1;
1393 static int hf_ptp_v2_mm_boundaryhops = -1;
1394 static int hf_ptp_v2_mm_action = -1;
1396 /* management TLV */
1397 static int hf_ptp_v2_mm_tlvType = -1;
1398 static int hf_ptp_v2_mm_lengthField = -1;
1399 static int hf_ptp_v2_mm_managementId = -1;
1400 static int hf_ptp_v2_mm_data = -1;
1401 /* Management dataField */
1403 static int hf_ptp_v2_mm_clockType = -1;
1404 static int hf_ptp_v2_mm_clockType_ordinaryClock = -1;
1405 static int hf_ptp_v2_mm_clockType_boundaryClock = -1;
1406 static int hf_ptp_v2_mm_clockType_p2p_transparentClock = -1;
1407 static int hf_ptp_v2_mm_clockType_e2e_transparentClock = -1;
1408 static int hf_ptp_v2_mm_clockType_managementNode = -1;
1409 static int hf_ptp_v2_mm_clockType_reserved = -1;
1410 static int hf_ptp_v2_mm_physicalLayerProtocol = -1;
1411 static int hf_ptp_v2_mm_physicalLayerProtocol_length = -1;
1412 static int hf_ptp_v2_mm_physicalAddressLength = -1;
1413 static int hf_ptp_v2_mm_physicalAddress = -1;
1414 static int hf_ptp_v2_mm_protocolAddress = -1;
1415 static int hf_ptp_v2_mm_protocolAddress_networkProtocol = -1;
1416 static int hf_ptp_v2_mm_protocolAddress_length = -1;
1417 static int hf_ptp_v2_mm_manufacturerIdentity = -1;
1419 static int hf_ptp_v2_mm_reserved = -1;
1420 static int hf_ptp_v2_mm_productDescription = -1;
1421 static int hf_ptp_v2_mm_productDescription_length = -1;
1422 static int hf_ptp_v2_mm_revisionData = -1;
1423 static int hf_ptp_v2_mm_revisionData_length = -1;
1424 static int hf_ptp_v2_mm_userDescription = -1;
1425 static int hf_ptp_v2_mm_userDescription_length = -1;
1426 static int hf_ptp_v2_mm_profileIdentity = -1;
1427 static int hf_ptp_v2_mm_pad = -1;
1429 static int hf_ptp_v2_mm_numberOfFaultRecords = -1;
1430 /* static int hf_ptp_v2_mm_faultRecord = -1; */
1432 static int hf_ptp_v2_mm_initializationKey = -1;
1433 static int hf_ptp_v2_mm_severityCode = -1;
1434 static int hf_ptp_v2_mm_faultRecordLength = -1;
1435 /* static int hf_ptp_v2_mm_faultTime = -1; */
1436 static int hf_ptp_v2_mm_faultTime_s = -1;
1437 static int hf_ptp_v2_mm_faultTime_ns = -1;
1438 static int hf_ptp_v2_mm_faultValue = -1;
1439 static int hf_ptp_v2_mm_faultName = -1;
1440 static int hf_ptp_v2_mm_faultName_length = -1;
1441 static int hf_ptp_v2_mm_faultValue_length = -1;
1442 static int hf_ptp_v2_mm_faultDescription = -1;
1443 static int hf_ptp_v2_mm_faultDescription_length = -1;
1444 static int hf_ptp_v2_mm_currentTime_s = -1;
1445 static int hf_ptp_v2_mm_currentTime_ns = -1;
1446 static int hf_ptp_v2_mm_clockAccuracy = -1;
1447 static int hf_ptp_v2_mm_priority1 = -1;
1448 static int hf_ptp_v2_mm_priority2 = -1;
1449 static int hf_ptp_v2_mm_dds_SO = -1;
1450 static int hf_ptp_v2_mm_TSC = -1;
1451 static int hf_ptp_v2_mm_numberPorts = -1;
1452 static int hf_ptp_v2_mm_clockclass = -1;
1453 static int hf_ptp_v2_mm_clockaccuracy = -1;
1454 static int hf_ptp_v2_mm_clockvariance = -1;
1455 static int hf_ptp_v2_mm_clockidentity = -1;
1456 static int hf_ptp_v2_mm_domainNumber = -1;
1457 static int hf_ptp_v2_mm_SO = -1;
1458 static int hf_ptp_v2_mm_stepsRemoved = -1;
1459 static int hf_ptp_v2_mm_parentIdentity = -1;
1460 static int hf_ptp_v2_mm_parentPort = -1;
1461 static int hf_ptp_v2_mm_parentStats = -1;
1462 static int hf_ptp_v2_mm_observedParentOffsetScaledLogVariance = -1;
1463 static int hf_ptp_v2_mm_observedParentClockPhaseChangeRate = -1;
1464 static int hf_ptp_v2_mm_grandmasterPriority1 = -1;
1465 static int hf_ptp_v2_mm_grandmasterPriority2 = -1;
1466 static int hf_ptp_v2_mm_grandmasterclockclass = -1;
1467 static int hf_ptp_v2_mm_grandmasterclockaccuracy = -1;
1468 static int hf_ptp_v2_mm_grandmasterclockvariance = -1;
1469 static int hf_ptp_v2_mm_grandmasterIdentity = -1;
1470 static int hf_ptp_v2_mm_currentUtcOffset = -1;
1471 static int hf_ptp_v2_mm_LI_61 = -1;
1472 static int hf_ptp_v2_mm_LI_59 = -1;
1473 static int hf_ptp_v2_mm_UTCV = -1;
1474 static int hf_ptp_v2_mm_PTP = -1;
1475 static int hf_ptp_v2_mm_TTRA = -1;
1476 static int hf_ptp_v2_mm_FTRA = -1;
1477 static int hf_ptp_v2_mm_timesource = -1;
1478 static int hf_ptp_v2_mm_offset_ns = -1;
1479 static int hf_ptp_v2_mm_pathDelay_ns = -1;
1480 static int hf_ptp_v2_mm_offset_subns = -1;
1481 static int hf_ptp_v2_mm_pathDelay_subns = -1;
1482 static int hf_ptp_v2_mm_PortNumber = -1;
1483 static int hf_ptp_v2_mm_portState = -1;
1484 static int hf_ptp_v2_mm_logMinDelayReqInterval = -1;
1485 static int hf_ptp_v2_mm_peerMeanPathDelay_ns = -1;
1486 static int hf_ptp_v2_mm_peerMeanPathDelay_subns = -1;
1487 static int hf_ptp_v2_mm_logAnnounceInterval = -1;
1488 static int hf_ptp_v2_mm_announceReceiptTimeout = -1;
1489 static int hf_ptp_v2_mm_logSyncInterval = -1;
1490 static int hf_ptp_v2_mm_delayMechanism = -1;
1491 static int hf_ptp_v2_mm_logMinPdelayReqInterval = -1;
1492 static int hf_ptp_v2_mm_versionNumber = -1;
1493 static int hf_ptp_v2_mm_primaryDomain = -1;
1494 static int hf_ptp_v2_mm_faultyFlag = -1;
1495 static int hf_ptp_v2_mm_managementErrorId = -1;
1496 static int hf_ptp_v2_mm_displayData = -1;
1497 static int hf_ptp_v2_mm_displayData_length = -1;
1498 static int hf_ptp_v2_mm_ucEN = -1;
1499 static int hf_ptp_v2_mm_ptEN = -1;
1500 static int hf_ptp_v2_mm_atEN = -1;
1501 static int hf_ptp_v2_mm_keyField = -1;
1502 static int hf_ptp_v2_mm_displayName = -1;
1503 static int hf_ptp_v2_mm_displayName_length = -1;
1504 static int hf_ptp_v2_mm_maxKey = -1;
1505 static int hf_ptp_v2_mm_currentOffset = -1;
1506 static int hf_ptp_v2_mm_jumpSeconds = -1;
1507 static int hf_ptp_v2_mm_logAlternateMulticastSyncInterval = -1;
1508 static int hf_ptp_v2_mm_numberOfAlternateMasters = -1;
1509 static int hf_ptp_v2_mm_transmitAlternateMulticastSync = -1;
1511 /* Initialize the subtree pointers */
1512 static gint ett_ptp_v2 = -1;
1513 static gint ett_ptp_v2_flags = -1;
1514 static gint ett_ptp_v2_correction = -1;
1515 static gint ett_ptp_v2_time = -1;
1516 static gint ett_ptp_v2_time2 = -1;
1517 static gint ett_ptp_v2_managementData = -1;
1518 static gint ett_ptp_v2_clockType = -1;
1519 static gint ett_ptp_v2_physicalLayerProtocol = -1;
1520 static gint ett_ptp_v2_protocolAddress = -1;
1521 static gint ett_ptp_v2_faultRecord = -1;
1522 static gint ett_ptp_v2_ptptext = -1;
1523 static gint ett_ptp_v2_timeInterval = -1;
1524 static gint ett_ptp_v2_tlv = -1;
1525 static gint ett_ptp_v2_tlv_log_period = -1;
1526 static gint ett_ptp_as_sig_tlv_flags = -1;
1528 /* static gint ett_ptp_v2_timesource = -1;
1529 static gint ett_ptp_v2_priority = -1; */
1530 static gint ett_ptp_v2_transportspecific = -1;
1532 /* For transport specific field Ethernet or UDP */
1533 static gboolean ptpv2_oE = FALSE;
1534 /* END Definitions and fields for PTPv2 dissection. */
1537 /* forward declaration of local functions for v1 and v2 */
1539 static void
1540 dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1542 static int
1543 is_ptp_v1(tvbuff_t *tvb);
1545 static void
1546 dissect_ptp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1548 static gboolean
1549 is_ptp_v2(tvbuff_t *tvb);
1551 static void
1552 dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1554 /**********************************************************/
1555 /* Implementation of the functions */
1556 /**********************************************************/
1559 /* Code to dissect the packet */
1561 static void
1562 dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1564 ptpv2_oE = TRUE;
1565 /* PTP over Ethernet only available with PTPv2 */
1566 dissect_ptp_v2(tvb, pinfo, tree);
1569 static void
1570 dissect_ptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1572 ptpv2_oE = FALSE;
1573 if(is_ptp_v1(tvb))
1574 dissect_ptp_v1(tvb, pinfo, tree);
1575 else if(is_ptp_v2(tvb))
1576 dissect_ptp_v2(tvb, pinfo, tree);
1580 /* Code to check if packet is PTPv1 */
1582 static gboolean
1583 is_ptp_v1(tvbuff_t *tvb)
1585 guint16 version_ptp;
1587 version_ptp = tvb_get_ntohs(tvb, PTP_VERSIONPTP_OFFSET);
1589 if( version_ptp == 1) return TRUE;
1590 else return FALSE;
1594 /* Code to check if packet is PTPv2 */
1596 static gboolean
1597 is_ptp_v2(tvbuff_t *tvb)
1599 guint8 version_ptp;
1601 version_ptp = 0x0F & tvb_get_guint8(tvb, PTP_V2_VERSIONPTP_OFFSET);
1603 if( version_ptp == 2) return TRUE;
1604 else return FALSE;
1608 /* Code to actually dissect the PTPv1 packets */
1610 static void
1611 dissect_ptp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1613 guint8 ptp_control, ptp_mm_messagekey = 0;
1614 nstime_t ts; /*time structure with seconds and nanoseconds*/
1616 /* Set up structures needed to add the protocol subtree and manage it */
1617 proto_item *ti, *flags_ti, *time_ti, *time2_ti;
1618 proto_tree *ptp_tree, *ptp_flags_tree, *ptp_time_tree, *ptp_time2_tree;
1620 /* Make entries in Protocol column and Info column on summary display */
1621 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PTPv1");
1624 /* Get control field (what kind of message is this? (Sync, DelayReq, ...) */
1626 ptp_control = tvb_get_guint8 (tvb, PTP_CONTROL_OFFSET);
1627 /* MGMT packet? */
1628 if ( ptp_control == PTP_MANAGEMENT_MESSAGE ){
1629 /* Get the managementMessageKey */
1630 ptp_mm_messagekey = tvb_get_guint8(tvb, PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET);
1633 /* Create and set the string for "Info" column */
1634 switch(ptp_control){
1635 case PTP_SYNC_MESSAGE:{
1636 col_set_str(pinfo->cinfo, COL_INFO, "Sync Message");
1637 break;
1639 case PTP_DELAY_REQ_MESSAGE:{
1640 col_set_str(pinfo->cinfo, COL_INFO, "Delay_Request Message");
1641 break;
1643 case PTP_FOLLOWUP_MESSAGE:{
1644 col_set_str(pinfo->cinfo, COL_INFO, "Follow_Up Message");
1645 break;
1647 case PTP_DELAY_RESP_MESSAGE:{
1648 col_set_str(pinfo->cinfo, COL_INFO, "Delay_Response Message");
1649 break;
1651 case PTP_MANAGEMENT_MESSAGE:{
1652 col_add_fstr(pinfo->cinfo, COL_INFO, "Management Message (%s)",
1653 val_to_str(ptp_mm_messagekey,
1654 ptp_managementMessageKey_infocolumn_vals,
1655 "Unknown message key %u"));
1656 break;
1658 default:{
1659 col_set_str(pinfo->cinfo, COL_INFO, "Unknown Message");
1660 break;
1664 if (tree) {
1666 /* create display subtree for the protocol */
1667 ti = proto_tree_add_item(tree, proto_ptp, tvb, 0, -1, ENC_NA);
1669 ptp_tree = proto_item_add_subtree(ti, ett_ptp);
1671 proto_tree_add_item(ptp_tree,
1672 hf_ptp_versionptp, tvb, PTP_VERSIONPTP_OFFSET, 2, ENC_BIG_ENDIAN);
1674 proto_tree_add_item(ptp_tree,
1675 hf_ptp_versionnetwork, tvb, PTP_VERSIONNETWORK_OFFSET, 2, ENC_BIG_ENDIAN);
1677 proto_tree_add_item(ptp_tree,
1678 hf_ptp_subdomain, tvb, PTP_SUBDOMAIN_OFFSET, 16, ENC_ASCII|ENC_NA);
1680 proto_tree_add_item(ptp_tree,
1681 hf_ptp_messagetype, tvb, PTP_MESSAGETYPE_OFFSET, 1, ENC_BIG_ENDIAN);
1683 proto_tree_add_item(ptp_tree,
1684 hf_ptp_sourcecommunicationtechnology, tvb, PTP_SOURCECOMMUNICATIONTECHNOLOGY_OFFSET, 1, ENC_BIG_ENDIAN);
1686 proto_tree_add_item(ptp_tree,
1687 hf_ptp_sourceuuid, tvb, PTP_SOURCEUUID_OFFSET, 6, ENC_NA);
1689 proto_tree_add_item(ptp_tree,
1690 hf_ptp_sourceportid, tvb, PTP_SOURCEPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
1692 proto_tree_add_item(ptp_tree,
1693 hf_ptp_sequenceid, tvb, PTP_SEQUENCEID_OFFSET, 2, ENC_BIG_ENDIAN);
1695 proto_tree_add_item(ptp_tree,
1696 hf_ptp_control, tvb, PTP_CONTROL_OFFSET, 1, ENC_BIG_ENDIAN);
1698 /*Subtree for the flag-field*/
1699 if(tree){
1700 flags_ti = proto_tree_add_item(ptp_tree,
1701 hf_ptp_flags, tvb, PTP_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
1703 ptp_flags_tree = proto_item_add_subtree(flags_ti, ett_ptp_flags);
1705 proto_tree_add_item(ptp_flags_tree,
1706 hf_ptp_flags_li61, tvb, PTP_FLAGS_LI61_OFFSET, 2, ENC_BIG_ENDIAN);
1708 proto_tree_add_item(ptp_flags_tree,
1709 hf_ptp_flags_li59, tvb, PTP_FLAGS_LI59_OFFSET, 2, ENC_BIG_ENDIAN);
1711 proto_tree_add_item(ptp_flags_tree,
1712 hf_ptp_flags_boundary_clock, tvb, PTP_FLAGS_BOUNDARY_CLOCK_OFFSET, 2, ENC_BIG_ENDIAN);
1714 proto_tree_add_item(ptp_flags_tree,
1715 hf_ptp_flags_assist, tvb, PTP_FLAGS_ASSIST_OFFSET, 2, ENC_BIG_ENDIAN);
1717 proto_tree_add_item(ptp_flags_tree,
1718 hf_ptp_flags_ext_sync, tvb, PTP_FLAGS_EXT_SYNC_OFFSET, 2, ENC_BIG_ENDIAN);
1720 proto_tree_add_item(ptp_flags_tree,
1721 hf_ptp_flags_parent, tvb, PTP_FLAGS_PARENT_STATS_OFFSET, 2, ENC_BIG_ENDIAN);
1723 proto_tree_add_item(ptp_flags_tree,
1724 hf_ptp_flags_sync_burst, tvb, PTP_FLAGS_SYNC_BURST_OFFSET, 2, ENC_BIG_ENDIAN);
1727 /* The rest of the ptp-dissector depends on the control-field */
1729 switch(ptp_control){
1730 case PTP_SYNC_MESSAGE:
1731 case PTP_DELAY_REQ_MESSAGE:{
1733 /*Subtree for the timestamp-field*/
1734 ts.secs = tvb_get_ntohl(tvb, PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET);
1735 ts.nsecs = tvb_get_ntohl(tvb, PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET);
1736 if(tree){
1737 time_ti = proto_tree_add_time(ptp_tree,
1738 hf_ptp_sdr_origintimestamp, tvb, PTP_SDR_ORIGINTIMESTAMP_OFFSET, 8, &ts);
1740 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1742 proto_tree_add_item(ptp_time_tree,
1743 hf_ptp_sdr_origintimestamp_seconds, tvb,
1744 PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
1746 proto_tree_add_item(ptp_time_tree, hf_ptp_sdr_origintimestamp_nanoseconds, tvb,
1747 PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
1750 proto_tree_add_item(ptp_tree,
1751 hf_ptp_sdr_epochnumber, tvb, PTP_SDR_EPOCHNUMBER_OFFSET, 2, ENC_BIG_ENDIAN);
1753 proto_tree_add_item(ptp_tree,
1754 hf_ptp_sdr_currentutcoffset, tvb, PTP_SDR_CURRENTUTCOFFSET_OFFSET, 2, ENC_BIG_ENDIAN);
1756 proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmastercommunicationtechnology, tvb,
1757 PTP_SDR_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1, ENC_BIG_ENDIAN);
1759 proto_tree_add_item(ptp_tree,
1760 hf_ptp_sdr_grandmasterclockuuid, tvb, PTP_SDR_GRANDMASTERCLOCKUUID_OFFSET, 6, ENC_NA);
1762 proto_tree_add_item(ptp_tree,
1763 hf_ptp_sdr_grandmasterportid, tvb, PTP_SDR_GRANDMASTERPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
1765 proto_tree_add_item(ptp_tree,
1766 hf_ptp_sdr_grandmastersequenceid, tvb, PTP_SDR_GRANDMASTERSEQUENCEID_OFFSET, 2, ENC_BIG_ENDIAN);
1768 proto_tree_add_item(ptp_tree,
1769 hf_ptp_sdr_grandmasterclockstratum, tvb,
1770 PTP_SDR_GRANDMASTERCLOCKSTRATUM_OFFSET, 1, ENC_BIG_ENDIAN);
1772 proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmasterclockidentifier, tvb,
1773 PTP_SDR_GRANDMASTERCLOCKIDENTIFIER_OFFSET, 4, ENC_ASCII|ENC_NA);
1775 proto_tree_add_item(ptp_tree,
1776 hf_ptp_sdr_grandmasterclockvariance, tvb,
1777 PTP_SDR_GRANDMASTERCLOCKVARIANCE_OFFSET, 2, ENC_BIG_ENDIAN);
1779 proto_tree_add_item(ptp_tree,
1780 hf_ptp_sdr_grandmasterpreferred, tvb, PTP_SDR_GRANDMASTERPREFERRED_OFFSET, 1, ENC_BIG_ENDIAN);
1782 proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmasterisboundaryclock, tvb,
1783 PTP_SDR_GRANDMASTERISBOUNDARYCLOCK_OFFSET, 1, ENC_BIG_ENDIAN);
1785 proto_tree_add_item(ptp_tree,
1786 hf_ptp_sdr_syncinterval, tvb, PTP_SDR_SYNCINTERVAL_OFFSET, 1, ENC_BIG_ENDIAN);
1788 proto_tree_add_item(ptp_tree,
1789 hf_ptp_sdr_localclockvariance, tvb, PTP_SDR_LOCALCLOCKVARIANCE_OFFSET, 2, ENC_BIG_ENDIAN);
1791 proto_tree_add_item(ptp_tree,
1792 hf_ptp_sdr_localstepsremoved, tvb, PTP_SDR_LOCALSTEPSREMOVED_OFFSET, 2, ENC_BIG_ENDIAN);
1794 proto_tree_add_item(ptp_tree,
1795 hf_ptp_sdr_localclockstratum, tvb, PTP_SDR_LOCALCLOCKSTRATUM_OFFSET, 1, ENC_BIG_ENDIAN);
1797 proto_tree_add_item(ptp_tree,
1798 hf_ptp_sdr_localclockidentifier, tvb, PTP_SDR_LOCALCLOCKIDENTIFIER_OFFSET, 4, ENC_ASCII|ENC_NA);
1800 proto_tree_add_item(ptp_tree, hf_ptp_sdr_parentcommunicationtechnology, tvb,
1801 PTP_SDR_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET, 1, ENC_BIG_ENDIAN);
1803 proto_tree_add_item(ptp_tree,
1804 hf_ptp_sdr_parentuuid, tvb, PTP_SDR_PARENTUUID_OFFSET, 6, ENC_NA);
1806 proto_tree_add_item(ptp_tree,
1807 hf_ptp_sdr_parentportfield, tvb, PTP_SDR_PARENTPORTFIELD_OFFSET, 2, ENC_BIG_ENDIAN);
1809 proto_tree_add_item(ptp_tree,
1810 hf_ptp_sdr_estimatedmastervariance, tvb,
1811 PTP_SDR_ESTIMATEDMASTERVARIANCE_OFFSET, 2, ENC_BIG_ENDIAN);
1813 proto_tree_add_item(ptp_tree,
1814 hf_ptp_sdr_estimatedmasterdrift, tvb, PTP_SDR_ESTIMATEDMASTERDRIFT_OFFSET, 4, ENC_BIG_ENDIAN);
1816 proto_tree_add_item(ptp_tree,
1817 hf_ptp_sdr_utcreasonable, tvb, PTP_SDR_UTCREASONABLE_OFFSET, 1, ENC_BIG_ENDIAN);
1818 break;
1820 case PTP_FOLLOWUP_MESSAGE:{
1821 proto_tree_add_item(ptp_tree,
1822 hf_ptp_fu_associatedsequenceid, tvb, PTP_FU_ASSOCIATEDSEQUENCEID_OFFSET, 2, ENC_BIG_ENDIAN);
1824 /*Subtree for the timestamp-field*/
1825 ts.secs = tvb_get_ntohl(tvb, PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET);
1826 ts.nsecs = tvb_get_ntohl(tvb, PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET);
1827 if(tree){
1828 time_ti = proto_tree_add_time(ptp_tree,
1829 hf_ptp_fu_preciseorigintimestamp, tvb,
1830 PTP_FU_PRECISEORIGINTIMESTAMP_OFFSET, 8, &ts);
1832 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1834 proto_tree_add_item(ptp_time_tree, hf_ptp_fu_preciseorigintimestamp_seconds, tvb,
1835 PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
1837 proto_tree_add_item(ptp_time_tree, hf_ptp_fu_preciseorigintimestamp_nanoseconds, tvb,
1838 PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
1840 break;
1842 case PTP_DELAY_RESP_MESSAGE:{
1843 /*Subtree for the timestamp-field*/
1844 ts.secs = tvb_get_ntohl(tvb, PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET);
1845 ts.nsecs = tvb_get_ntohl(tvb, PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET);
1846 if(tree){
1847 time_ti = proto_tree_add_time(ptp_tree,
1848 hf_ptp_dr_delayreceipttimestamp, tvb,
1849 PTP_DR_DELAYRECEIPTTIMESTAMP_OFFSET, 8, &ts);
1851 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
1853 proto_tree_add_item(ptp_time_tree, hf_ptp_dr_delayreceipttimestamp_seconds, tvb,
1854 PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
1856 proto_tree_add_item(ptp_time_tree, hf_ptp_dr_delayreceipttimestamp_nanoseconds, tvb,
1857 PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
1860 proto_tree_add_item(ptp_tree, hf_ptp_dr_requestingsourcecommunicationtechnology, tvb,
1861 PTP_DR_REQUESTINGSOURCECOMMUNICATIONTECHNOLOGY_OFFSET, 1, ENC_BIG_ENDIAN);
1863 proto_tree_add_item(ptp_tree,
1864 hf_ptp_dr_requestingsourceuuid, tvb, PTP_DR_REQUESTINGSOURCEUUID_OFFSET, 6, ENC_NA);
1866 proto_tree_add_item(ptp_tree,
1867 hf_ptp_dr_requestingsourceportid, tvb, PTP_DR_REQUESTINGSOURCEPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
1869 proto_tree_add_item(ptp_tree,
1870 hf_ptp_dr_requestingsourcesequenceid, tvb,
1871 PTP_DR_REQUESTINGSOURCESEQUENCEID_OFFSET, 2, ENC_BIG_ENDIAN);
1872 break;
1874 case PTP_MANAGEMENT_MESSAGE:{
1875 proto_tree_add_item(ptp_tree, hf_ptp_mm_targetcommunicationtechnology, tvb,
1876 PTP_MM_TARGETCOMMUNICATIONTECHNOLOGY_OFFSET, 1, ENC_BIG_ENDIAN);
1878 proto_tree_add_item(ptp_tree,
1879 hf_ptp_mm_targetuuid, tvb, PTP_MM_TARGETUUID_OFFSET, 6, ENC_NA);
1881 proto_tree_add_item(ptp_tree,
1882 hf_ptp_mm_targetportid, tvb, PTP_MM_TARGETPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
1884 proto_tree_add_item(ptp_tree,
1885 hf_ptp_mm_startingboundaryhops, tvb, PTP_MM_STARTINGBOUNDARYHOPS_OFFSET, 2, ENC_BIG_ENDIAN);
1887 proto_tree_add_item(ptp_tree,
1888 hf_ptp_mm_boundaryhops, tvb, PTP_MM_BOUNDARYHOPS_OFFSET, 2, ENC_BIG_ENDIAN);
1891 proto_tree_add_item(ptp_tree,
1892 hf_ptp_mm_managementmessagekey, tvb, PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET, 1, ENC_BIG_ENDIAN);
1894 proto_tree_add_item(ptp_tree,
1895 hf_ptp_mm_parameterlength, tvb, PTP_MM_PARAMETERLENGTH_OFFSET, 2, ENC_BIG_ENDIAN);
1897 switch(ptp_mm_messagekey){
1898 case PTP_MM_CLOCK_IDENTITY:{
1899 proto_tree_add_item(ptp_tree,
1900 hf_ptp_mm_clock_identity_clockcommunicationtechnology, tvb,
1901 PTP_MM_CLOCK_IDENTITY_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET, 1, ENC_BIG_ENDIAN);
1903 proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_clockuuidfield, tvb,
1904 PTP_MM_CLOCK_IDENTITY_CLOCKUUIDFIELD_OFFSET, 6, ENC_NA);
1906 proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_clockportfield, tvb,
1907 PTP_MM_CLOCK_IDENTITY_CLOCKPORTFIELD_OFFSET, 2, ENC_BIG_ENDIAN);
1909 proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_manufactureridentity, tvb,
1910 PTP_MM_CLOCK_IDENTITY_MANUFACTURERIDENTITY_OFFSET, 48, ENC_NA);
1911 break;
1913 case PTP_MM_INITIALIZE_CLOCK:{
1914 proto_tree_add_item(ptp_tree, hf_ptp_mm_initialize_clock_initialisationkey, tvb,
1915 PTP_MM_INITIALIZE_CLOCK_INITIALISATIONKEY_OFFSET, 2, ENC_BIG_ENDIAN);
1916 break;
1918 case PTP_MM_SET_SUBDOMAIN:{
1919 proto_tree_add_item(ptp_tree, hf_ptp_mm_set_subdomain_subdomainname, tvb,
1920 PTP_MM_SET_SUBDOMAIN_SUBDOMAINNAME_OFFSET, 16, ENC_ASCII|ENC_NA);
1921 break;
1923 case PTP_MM_DEFAULT_DATA_SET:{
1924 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockcommunicationtechnology,
1925 tvb, PTP_MM_DEFAULT_DATA_SET_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET,
1926 1, ENC_BIG_ENDIAN);
1928 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockuuidfield, tvb,
1929 PTP_MM_DEFAULT_DATA_SET_CLOCKUUIDFIELD_OFFSET, 6, ENC_NA);
1931 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockportfield, tvb,
1932 PTP_MM_DEFAULT_DATA_SET_CLOCKPORTFIELD_OFFSET, 2, ENC_BIG_ENDIAN);
1934 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockstratum, tvb,
1935 PTP_MM_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET, 1, ENC_BIG_ENDIAN);
1937 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockidentifier, tvb,
1938 PTP_MM_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET, 4, ENC_NA);
1940 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockvariance, tvb,
1941 PTP_MM_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET, 2, ENC_BIG_ENDIAN);
1943 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockfollowupcapable, tvb,
1944 PTP_MM_DEFAULT_DATA_SET_CLOCKFOLLOWUPCAPABLE_OFFSET, 1, ENC_BIG_ENDIAN);
1946 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_preferred, tvb,
1947 PTP_MM_DEFAULT_DATA_SET_PREFERRED_OFFSET, 1, ENC_BIG_ENDIAN);
1949 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_initializable, tvb,
1950 PTP_MM_DEFAULT_DATA_SET_INITIALIZABLE_OFFSET, 1, ENC_BIG_ENDIAN);
1952 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_externaltiming, tvb,
1953 PTP_MM_DEFAULT_DATA_SET_EXTERNALTIMING_OFFSET, 1, ENC_BIG_ENDIAN);
1955 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_isboundaryclock, tvb,
1956 PTP_MM_DEFAULT_DATA_SET_ISBOUNDARYCLOCK_OFFSET, 1, ENC_BIG_ENDIAN);
1958 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_syncinterval, tvb,
1959 PTP_MM_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET, 1, ENC_BIG_ENDIAN);
1961 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_subdomainname, tvb,
1962 PTP_MM_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET, 16, ENC_ASCII|ENC_NA);
1964 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_numberports, tvb,
1965 PTP_MM_DEFAULT_DATA_SET_NUMBERPORTS_OFFSET, 2, ENC_BIG_ENDIAN);
1967 proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_numberforeignrecords, tvb,
1968 PTP_MM_DEFAULT_DATA_SET_NUMBERFOREIGNRECORDS_OFFSET, 2, ENC_BIG_ENDIAN);
1969 break;
1971 case PTP_MM_UPDATE_DEFAULT_DATA_SET:{
1972 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockstratum, tvb,
1973 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET, 1, ENC_BIG_ENDIAN);
1975 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockidentifier, tvb,
1976 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET, 4, ENC_NA);
1978 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockvariance, tvb,
1979 PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET, 2, ENC_BIG_ENDIAN);
1981 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_preferred, tvb,
1982 PTP_MM_UPDATE_DEFAULT_DATA_SET_PREFERRED_OFFSET, 1, ENC_BIG_ENDIAN);
1984 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_syncinterval, tvb,
1985 PTP_MM_UPDATE_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET, 1, ENC_BIG_ENDIAN);
1987 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_subdomainname, tvb,
1988 PTP_MM_UPDATE_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET, 16, ENC_ASCII|ENC_NA);
1989 break;
1991 case PTP_MM_CURRENT_DATA_SET:{
1992 proto_tree_add_item(ptp_tree, hf_ptp_mm_current_data_set_stepsremoved, tvb,
1993 PTP_MM_CURRENT_DATA_SET_STEPSREMOVED_OFFSET, 2, ENC_BIG_ENDIAN);
1995 /* Subtree for offset from master*/
1996 ts.secs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET);
1998 ts.nsecs = tvb_get_ntohl(tvb,
1999 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET);
2001 if (ts.nsecs & 0x80000000) ts.nsecs = ts.nsecs & 0x7FFFFFFF;
2003 if(tree){
2004 time_ti = proto_tree_add_time(ptp_tree,
2005 hf_ptp_mm_current_data_set_offsetfrommaster, tvb,
2006 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTER_OFFSET, 8, &ts);
2008 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
2010 proto_tree_add_item(ptp_time_tree,
2011 hf_ptp_mm_current_data_set_offsetfrommasterseconds, tvb,
2012 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2014 proto_tree_add_item(ptp_time_tree,
2015 hf_ptp_mm_current_data_set_offsetfrommasternanoseconds, tvb,
2016 PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2019 /* Subtree for offset from master*/
2020 ts.secs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET);
2022 ts.nsecs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET);
2024 if(tree){
2025 time2_ti = proto_tree_add_time(ptp_tree,
2026 hf_ptp_mm_current_data_set_onewaydelay, tvb,
2027 PTP_MM_CURRENT_DATA_SET_ONEWAYDELAY_OFFSET, 8, &ts);
2029 ptp_time2_tree = proto_item_add_subtree(time2_ti, ett_ptp_time2);
2031 proto_tree_add_item(ptp_time2_tree, hf_ptp_mm_current_data_set_onewaydelayseconds,
2032 tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2034 proto_tree_add_item(ptp_time2_tree,
2035 hf_ptp_mm_current_data_set_onewaydelaynanoseconds,
2036 tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2038 break;
2040 case PTP_MM_PARENT_DATA_SET:{
2041 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentcommunicationtechnology,
2042 tvb, PTP_MM_PARENT_DATA_SET_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET,
2043 1, ENC_BIG_ENDIAN);
2045 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentuuid, tvb,
2046 PTP_MM_PARENT_DATA_SET_PARENTUUID_OFFSET, 6, ENC_NA);
2048 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentportid, tvb,
2049 PTP_MM_PARENT_DATA_SET_PARENTPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
2051 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber,
2052 tvb, PTP_MM_PARENT_DATA_SET_PARENTLASTSYNCSEQUENCENUMBER_OFFSET,
2053 2, ENC_BIG_ENDIAN);
2055 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentfollowupcapable, tvb,
2056 PTP_MM_PARENT_DATA_SET_PARENTFOLLOWUPCAPABLE_OFFSET, 1, ENC_BIG_ENDIAN);
2058 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentexternaltiming, tvb,
2059 PTP_MM_PARENT_DATA_SET_PARENTEXTERNALTIMING_OFFSET, 1, ENC_BIG_ENDIAN);
2061 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentvariance, tvb,
2062 PTP_MM_PARENT_DATA_SET_PARENTVARIANCE_OFFSET, 2, ENC_BIG_ENDIAN);
2064 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentstats, tvb,
2065 PTP_MM_PARENT_DATA_SET_PARENTSTATS_OFFSET, 1, ENC_BIG_ENDIAN);
2067 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_observedvariance, tvb,
2068 PTP_MM_PARENT_DATA_SET_OBSERVEDVARIANCE_OFFSET, 2, ENC_BIG_ENDIAN);
2070 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_observeddrift, tvb,
2071 PTP_MM_PARENT_DATA_SET_OBSERVEDDRIFT_OFFSET, 4, ENC_BIG_ENDIAN);
2073 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_utcreasonable, tvb,
2074 PTP_MM_PARENT_DATA_SET_UTCREASONABLE_OFFSET, 1, ENC_BIG_ENDIAN);
2076 proto_tree_add_item(ptp_tree,
2077 hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology,
2078 tvb, PTP_MM_PARENT_DATA_SET_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1,
2079 ENC_BIG_ENDIAN);
2081 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasteruuidfield, tvb,
2082 PTP_MM_PARENT_DATA_SET_GRANDMASTERUUIDFIELD_OFFSET, 6, ENC_NA);
2084 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterportidfield, tvb,
2085 PTP_MM_PARENT_DATA_SET_GRANDMASTERPORTIDFIELD_OFFSET, 2, ENC_BIG_ENDIAN);
2087 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterstratum, tvb,
2088 PTP_MM_PARENT_DATA_SET_GRANDMASTERSTRATUM_OFFSET, 1, ENC_BIG_ENDIAN);
2090 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasteridentifier, tvb,
2091 PTP_MM_PARENT_DATA_SET_GRANDMASTERIDENTIFIER_OFFSET, 4, ENC_NA);
2093 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmastervariance, tvb,
2094 PTP_MM_PARENT_DATA_SET_GRANDMASTERVARIANCE_OFFSET, 2, ENC_BIG_ENDIAN);
2096 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterpreferred, tvb,
2097 PTP_MM_PARENT_DATA_SET_GRANDMASTERPREFERRED_OFFSET, 1, ENC_BIG_ENDIAN);
2099 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterisboundaryclock, tvb,
2100 PTP_MM_PARENT_DATA_SET_GRANDMASTERISBOUNDARYCLOCK_OFFSET, 1, ENC_BIG_ENDIAN);
2102 proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmastersequencenumber, tvb,
2103 PTP_MM_PARENT_DATA_SET_GRANDMASTERSEQUENCENUMBER_OFFSET, 2, ENC_BIG_ENDIAN);
2104 break;
2106 case PTP_MM_PORT_DATA_SET:{
2107 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_returnedportnumber, tvb,
2108 PTP_MM_PORT_DATA_SET_RETURNEDPORTNUMBER_OFFSET, 2, ENC_BIG_ENDIAN);
2110 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portstate, tvb,
2111 PTP_MM_PORT_DATA_SET_PORTSTATE_OFFSET, 1, ENC_BIG_ENDIAN);
2113 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_lastsynceventsequencenumber, tvb,
2114 PTP_MM_PORT_DATA_SET_LASTSYNCEVENTSEQUENCENUMBER_OFFSET, 2, ENC_BIG_ENDIAN);
2116 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber,
2117 tvb, PTP_MM_PORT_DATA_SET_LASTGENERALEVENTSEQUENCENUMBER_OFFSET,
2118 2, ENC_BIG_ENDIAN);
2120 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portcommunicationtechnology, tvb,
2121 PTP_MM_PORT_DATA_SET_PORTCOMMUNICATIONTECHNOLOGY_OFFSET, 1, ENC_BIG_ENDIAN);
2123 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portuuidfield, tvb,
2124 PTP_MM_PORT_DATA_SET_PORTUUIDFIELD_OFFSET, 6, ENC_NA);
2126 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portidfield, tvb,
2127 PTP_MM_PORT_DATA_SET_PORTIDFIELD_OFFSET, 2, ENC_BIG_ENDIAN);
2129 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_burstenabled, tvb,
2130 PTP_MM_PORT_DATA_SET_BURSTENABLED_OFFSET, 1, ENC_BIG_ENDIAN);
2132 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_subdomainaddressoctets, tvb,
2133 PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESSOCTETS_OFFSET, 1, ENC_BIG_ENDIAN);
2135 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_eventportaddressoctets, tvb,
2136 PTP_MM_PORT_DATA_SET_EVENTPORTADDRESSOCTETS_OFFSET, 1, ENC_BIG_ENDIAN);
2138 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_generalportaddressoctets, tvb,
2139 PTP_MM_PORT_DATA_SET_GENERALPORTADDRESSOCTETS_OFFSET, 1, ENC_BIG_ENDIAN);
2141 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_subdomainaddress, tvb,
2142 PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESS_OFFSET, 4, ENC_NA);
2144 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_eventportaddress, tvb,
2145 PTP_MM_PORT_DATA_SET_EVENTPORTADDRESS_OFFSET, 2, ENC_NA);
2147 proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_generalportaddress, tvb,
2148 PTP_MM_PORT_DATA_SET_GENERALPORTADDRESS_OFFSET, 2, ENC_NA);
2149 break;
2151 case PTP_MM_GLOBAL_TIME_DATA_SET:{
2152 /* Subtree for local time*/
2153 ts.secs = tvb_get_ntohl(tvb, PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET);
2155 ts.nsecs = tvb_get_ntohl(tvb,
2156 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET);
2158 if(tree){
2159 time_ti = proto_tree_add_time(ptp_tree,
2160 hf_ptp_mm_global_time_data_set_localtime, tvb,
2161 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIME_OFFSET, 8, &ts);
2163 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
2165 proto_tree_add_item(ptp_time_tree,
2166 hf_ptp_mm_global_time_data_set_localtimeseconds, tvb,
2167 PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2169 proto_tree_add_item(ptp_time_tree,
2170 hf_ptp_mm_global_time_data_set_localtimenanoseconds,
2171 tvb, PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2174 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_currentutcoffset, tvb,
2175 PTP_MM_GLOBAL_TIME_DATA_SET_CURRENTUTCOFFSET_OFFSET, 2, ENC_BIG_ENDIAN);
2177 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_leap59, tvb,
2178 PTP_MM_GLOBAL_TIME_DATA_SET_LEAP59_OFFSET, 1, ENC_BIG_ENDIAN);
2180 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_leap61, tvb,
2181 PTP_MM_GLOBAL_TIME_DATA_SET_LEAP61_OFFSET, 1, ENC_BIG_ENDIAN);
2183 proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_epochnumber, tvb,
2184 PTP_MM_GLOBAL_TIME_DATA_SET_EPOCHNUMBER_OFFSET, 2, ENC_BIG_ENDIAN);
2185 break;
2187 case PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES:{
2188 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_currentutcoffset,
2189 tvb, PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_CURRENTUTCOFFSET_OFFSET,
2190 2, ENC_BIG_ENDIAN);
2192 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_leap59, tvb,
2193 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP59_OFFSET, 1, ENC_BIG_ENDIAN);
2195 proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_leap61, tvb,
2196 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP61_OFFSET, 1, ENC_BIG_ENDIAN);
2198 proto_tree_add_item(ptp_tree, hf_ptp_mm_get_foreign_data_set_recordkey, tvb,
2199 PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_EPOCHNUMBER_OFFSET, 2, ENC_BIG_ENDIAN);
2200 break;
2202 case PTP_MM_GET_FOREIGN_DATA_SET:{
2203 proto_tree_add_item(ptp_tree, hf_ptp_mm_get_foreign_data_set_recordkey, tvb,
2204 PTP_MM_GET_FOREIGN_DATA_SET_RECORDKEY_OFFSET, 2, ENC_BIG_ENDIAN);
2205 break;
2207 case PTP_MM_FOREIGN_DATA_SET:{
2208 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_returnedportnumber, tvb,
2209 PTP_MM_FOREIGN_DATA_SET_RETURNEDPORTNUMBER_OFFSET, 2, ENC_BIG_ENDIAN);
2211 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_returnedrecordnumber, tvb,
2212 PTP_MM_FOREIGN_DATA_SET_RETURNEDRECORDNUMBER_OFFSET, 2, ENC_BIG_ENDIAN);
2214 proto_tree_add_item(ptp_tree,
2215 hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology,
2216 tvb, PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1,
2217 ENC_BIG_ENDIAN);
2219 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmasteruuidfield, tvb,
2220 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERUUIDFIELD_OFFSET, 6, ENC_NA);
2222 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmasterportidfield, tvb,
2223 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERPORTIDFIELD_OFFSET, 2, ENC_BIG_ENDIAN);
2225 proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmastersyncs, tvb,
2226 PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERSYNCS_OFFSET, 2, ENC_BIG_ENDIAN);
2227 break;
2229 case PTP_MM_SET_SYNC_INTERVAL:{
2230 proto_tree_add_item(ptp_tree, hf_ptp_mm_set_sync_interval_syncinterval, tvb,
2231 PTP_MM_SET_SYNC_INTERVAL_SYNCINTERVAL_OFFSET, 2, ENC_BIG_ENDIAN);
2232 break;
2234 case PTP_MM_SET_TIME:{
2235 /* Subtree for local time*/
2236 ts.secs = tvb_get_ntohl(tvb, PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET);
2238 ts.nsecs = tvb_get_ntohl(tvb, PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET);
2240 if(tree){
2241 time_ti = proto_tree_add_time(ptp_tree, hf_ptp_mm_set_time_localtime, tvb,
2242 PTP_MM_SET_TIME_LOCALTIME_OFFSET, 8, &ts);
2244 ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
2246 proto_tree_add_item(ptp_time_tree, hf_ptp_mm_set_time_localtimeseconds, tvb,
2247 PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2249 proto_tree_add_item(ptp_time_tree, hf_ptp_mm_set_time_localtimenanoseconds,
2250 tvb, PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2252 break;
2254 default :{
2255 /*- don't dissect any further. */
2256 break;
2259 break;
2261 default :{
2262 /* Not a valid MessageType - can't dissect. */
2263 break;
2270 /* Code to dissect PTPText */
2271 static void
2272 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)
2274 guint8 length = 0;
2275 proto_item *ptptext_ti;
2276 proto_tree *ptptext_subtree;
2278 length = tvb_get_guint8 (tvb, *cur_offset);
2280 if (tree)
2282 ptptext_ti = proto_tree_add_item(tree, hf_ptp_v2_mm_ptptext, tvb,
2283 *cur_offset+1, length, ENC_BIG_ENDIAN);
2285 ptptext_subtree = proto_item_add_subtree(ptptext_ti, ett_ptp_v2_ptptext);
2286 /* subtree */
2287 proto_tree_add_item(ptptext_subtree, hf_ptp_v2_mm_ptptext_length, tvb,
2288 *cur_offset, 1, ENC_BIG_ENDIAN);
2289 proto_tree_add_item(ptptext_subtree, hf_ptp_v2_mm_ptptext, tvb,
2290 *cur_offset+1, length, ENC_ASCII|ENC_NA);
2292 *cur_offset = *cur_offset + length + 1;
2296 static void
2297 dissect_ptp_v2_timeInterval(tvbuff_t *tvb, guint16 *cur_offset, proto_tree *tree, const char* name, int hf_ptp_v2_timeInterval_ns, int hf_ptp_v2_timeInterval_subns)
2300 double time_double;
2301 gint64 time_ns;
2302 guint16 time_subns;
2303 proto_item *ptptimeInterval_ti;
2304 proto_tree *ptptimeInterval_subtree;
2306 time_ns = tvb_get_ntoh64(tvb, *cur_offset);
2307 time_double = (1.0*time_ns) / 65536.0;
2308 time_ns = time_ns >> 16;
2309 time_subns = tvb_get_ntohs(tvb, *cur_offset+6);
2311 ptptimeInterval_ti = proto_tree_add_text(tree, tvb, *cur_offset, 8,
2312 "%s: %f nanoseconds", name, time_double);
2314 ptptimeInterval_subtree = proto_item_add_subtree(ptptimeInterval_ti, ett_ptp_v2_timeInterval);
2316 proto_tree_add_uint64_format_value(ptptimeInterval_subtree,
2317 hf_ptp_v2_timeInterval_ns, tvb, *cur_offset, 6, time_ns, "Ns: %" G_GINT64_MODIFIER "d nanoseconds", time_ns);
2319 proto_tree_add_double_format_value(ptptimeInterval_subtree,
2320 hf_ptp_v2_timeInterval_subns, tvb, *cur_offset+6, 2, (time_subns/65536.0),
2321 "%f nanoseconds", (time_subns/65536.0));
2323 *cur_offset = *cur_offset + 8;
2326 /* Code to actually dissect the PTPv2 packets */
2328 static void
2329 dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2331 guint8 ptp_v2_transport_specific = 0;
2332 guint8 ptp_v2_messageid = 0;
2333 guint16 ptp_v2_mm_managementId = 0;
2334 guint8 ptp_v2_management_action = 0;
2335 guint64 timeStamp;
2336 guint16 temp;
2339 /* Set up structures needed to add the protocol subtree and manage it */
2340 proto_item *ti, *transportspecific_ti, *flags_ti, *managementData_ti, *clockType_ti, *protocolAddress_ti;
2341 proto_tree *ptp_tree, *ptp_transportspecific_tree, *ptp_flags_tree, *ptp_managementData_tree,
2342 *ptp_clockType_tree, *ptp_protocolAddress_tree;
2344 /* Make entries in Protocol column and Info column on summary display */
2345 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PTPv2");
2347 /* Get transport specific bit to determine whether this is an AS packet or not */
2348 ptp_v2_transport_specific = 0xF0 & tvb_get_guint8 (tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET);
2350 /* Get control field (what kind of message is this? (Sync, DelayReq, ...) */
2351 ptp_v2_messageid = 0x0F & tvb_get_guint8 (tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET);
2353 /* Extend Info column with managementId */
2354 /* Create and set the string for "Info" column */
2355 if ( ptp_v2_messageid == PTP_V2_MANAGEMENT_MESSAGE )
2357 guint16 tlv_type;
2358 /* Get TLV Type */
2359 tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
2360 /* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
2361 switch(tlv_type)
2363 case PTP_V2_TLV_TYPE_MANAGEMENT:
2364 /* Get the managementId */
2365 ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET);
2366 ptp_v2_management_action = 0x0F & tvb_get_guint8(tvb, PTP_V2_MM_ACTION_OFFSET);
2367 col_add_fstr(pinfo->cinfo, COL_INFO, "Management (%s) %s",
2368 val_to_str(ptp_v2_mm_managementId, ptp_v2_managementID_infocolumn_vals, "Unknown management Id %u"),
2369 val_to_str(ptp_v2_management_action, ptp_v2_mm_action_vals, "Unknown Action %u"));
2370 break;
2371 case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS:
2372 /* Get the managementErrorId */
2373 ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET);
2374 col_add_fstr(pinfo->cinfo, COL_INFO, "Management Error Message (%s)", val_to_str(ptp_v2_mm_managementId,
2375 ptp2_managementErrorId_vals, "Unknown Error Id %u"));
2376 break;
2377 default:
2378 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
2379 break;
2382 else
2384 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
2387 if (tree) {
2389 ti = proto_tree_add_item(tree, proto_ptp, tvb, 0, -1, ENC_NA);
2391 ptp_tree = proto_item_add_subtree(ti, ett_ptp_v2);
2393 transportspecific_ti = proto_tree_add_item(ptp_tree,
2394 hf_ptp_v2_transportspecific, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, ENC_BIG_ENDIAN);
2396 ptp_transportspecific_tree = proto_item_add_subtree(transportspecific_ti, ett_ptp_v2_transportspecific);
2398 if (ptpv2_oE == TRUE)
2400 proto_tree_add_item(ptp_transportspecific_tree,
2401 hf_ptp_v2_transportspecific_802as_conform, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, ENC_BIG_ENDIAN);
2403 else
2405 proto_tree_add_item(ptp_transportspecific_tree,
2406 hf_ptp_v2_transportspecific_v1_compatibility, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, ENC_BIG_ENDIAN);
2409 proto_tree_add_item(ptp_tree,
2410 hf_ptp_v2_messageid, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, ENC_BIG_ENDIAN);
2412 proto_tree_add_item(ptp_tree,
2413 hf_ptp_v2_versionptp, tvb, PTP_V2_VERSIONPTP_OFFSET, 1, ENC_BIG_ENDIAN);
2415 proto_tree_add_item(ptp_tree,
2416 hf_ptp_v2_messagelength, tvb, PTP_V2_MESSAGE_LENGTH_OFFSET, 2, ENC_BIG_ENDIAN);
2418 proto_tree_add_item(ptp_tree,
2419 hf_ptp_v2_domainnumber, tvb, PTP_V2_DOMAIN_NUMBER_OFFSET, 1, ENC_BIG_ENDIAN);
2422 flags_ti = proto_tree_add_item(ptp_tree,
2423 hf_ptp_v2_flags, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2425 ptp_flags_tree = proto_item_add_subtree(flags_ti, ett_ptp_v2_flags);
2427 proto_tree_add_item(ptp_flags_tree,
2428 hf_ptp_v2_flags_security, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2430 proto_tree_add_item(ptp_flags_tree,
2431 hf_ptp_v2_flags_specific2, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2433 proto_tree_add_item(ptp_flags_tree,
2434 hf_ptp_v2_flags_specific1, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2436 proto_tree_add_item(ptp_flags_tree,
2437 hf_ptp_v2_flags_unicast, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2439 proto_tree_add_item(ptp_flags_tree,
2440 hf_ptp_v2_flags_twostep, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2442 proto_tree_add_item(ptp_flags_tree,
2443 hf_ptp_v2_flags_alternatemaster, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2445 proto_tree_add_item(ptp_flags_tree,
2446 hf_ptp_v2_flags_frequencytraceable, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2448 proto_tree_add_item(ptp_flags_tree,
2449 hf_ptp_v2_flags_timetraceable, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2451 proto_tree_add_item(ptp_flags_tree,
2452 hf_ptp_v2_flags_ptptimescale, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2454 proto_tree_add_item(ptp_flags_tree,
2455 hf_ptp_v2_flags_utcoffsetvalid, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2457 proto_tree_add_item(ptp_flags_tree,
2458 hf_ptp_v2_flags_li59, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2460 proto_tree_add_item(ptp_flags_tree,
2461 hf_ptp_v2_flags_li61, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
2463 temp = PTP_V2_CORRECTIONNS_OFFSET;
2465 dissect_ptp_v2_timeInterval(tvb, &temp, ptp_tree, "correction", hf_ptp_v2_correction, hf_ptp_v2_correctionsubns);
2467 proto_tree_add_item(ptp_tree,
2468 hf_ptp_v2_clockidentity, tvb, PTP_V2_CLOCKIDENTITY_OFFSET, 8, ENC_BIG_ENDIAN);
2470 proto_tree_add_item(ptp_tree,
2471 hf_ptp_v2_sourceportid, tvb, PTP_V2_SOURCEPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
2473 proto_tree_add_item(ptp_tree,
2474 hf_ptp_v2_sequenceid, tvb, PTP_V2_SEQUENCEID_OFFSET, 2, ENC_BIG_ENDIAN);
2476 proto_tree_add_item(ptp_tree,
2477 hf_ptp_v2_control, tvb, PTP_V2_CONTROL_OFFSET, 1, ENC_BIG_ENDIAN);
2479 proto_tree_add_item(ptp_tree,
2480 hf_ptp_v2_logmessageperiod, tvb, PTP_V2_LOGMESSAGEPERIOD_OFFSET, 1, ENC_BIG_ENDIAN);
2482 switch(ptp_v2_messageid){
2483 case PTP_V2_ANNOUNCE_MESSAGE:{
2484 guint16 Offset;
2485 guint16 tlv_type;
2486 guint16 tlv_length;
2487 guint16 tlv_total_length;
2488 proto_item *tlv_ti;
2489 proto_tree *ptp_tlv_tree;
2491 /* In 802.1AS there is no origin timestamp in an Announce Message */
2492 if(!(ptp_v2_transport_specific & PTP_V2_TRANSPORTSPECIFIC_ASPACKET_BITMASK)){
2494 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origintimestamp_seconds, tvb,
2495 PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET, 6, ENC_BIG_ENDIAN);
2497 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origintimestamp_nanoseconds, tvb,
2498 PTP_V2_AN_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2501 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origincurrentutcoffset, tvb,
2502 PTP_V2_AN_ORIGINCURRENTUTCOFFSET_OFFSET, 2, ENC_BIG_ENDIAN);
2504 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_priority1, tvb,
2505 PTP_V2_AN_PRIORITY_1_OFFSET, 1, ENC_BIG_ENDIAN);
2507 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockclass, tvb,
2508 PTP_V2_AN_GRANDMASTERCLOCKCLASS_OFFSET, 1, ENC_BIG_ENDIAN);
2510 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockaccuracy, tvb,
2511 PTP_V2_AN_GRANDMASTERCLOCKACCURACY_OFFSET, 1, ENC_BIG_ENDIAN);
2513 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockvariance, tvb,
2514 PTP_V2_AN_GRANDMASTERCLOCKVARIANCE_OFFSET, 2, ENC_BIG_ENDIAN);
2516 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_priority2, tvb,
2517 PTP_V2_AN_PRIORITY_2_OFFSET, 1, ENC_BIG_ENDIAN);
2519 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockidentity, tvb,
2520 PTP_V2_AN_GRANDMASTERCLOCKIDENTITY_OFFSET, 8, ENC_BIG_ENDIAN);
2522 proto_tree_add_item(ptp_tree, hf_ptp_v2_an_localstepsremoved, tvb,
2523 PTP_V2_AN_LOCALSTEPSREMOVED_OFFSET, 2, ENC_BIG_ENDIAN);
2525 proto_tree_add_item(ptp_tree,
2526 hf_ptp_v2_an_timesource, tvb, PTP_V2_AN_TIMESOURCE_OFFSET, 1, ENC_BIG_ENDIAN);
2528 tlv_total_length = 0;
2529 /* XXX It seems like at least 4 bytes must reamain to have a tlv_type and tlv_length */
2530 while (tvb_reported_length_remaining(tvb, PTP_V2_AN_TLV_OFFSET + tlv_total_length) >= 4)
2532 /* There are TLV's to be processed */
2533 tlv_type = tvb_get_ntohs (tvb, PTP_V2_AN_TLV_OFFSET+tlv_total_length+PTP_V2_AN_TLV_TYPE_OFFSET);
2534 tlv_length = tvb_get_ntohs (tvb, PTP_V2_AN_TLV_OFFSET+tlv_total_length+PTP_V2_AN_TLV_LENGTHFIELD_OFFSET);
2536 tlv_ti = proto_tree_add_text(
2537 ptp_tree,
2538 tvb,
2539 PTP_V2_AN_TLV_OFFSET + tlv_total_length,
2540 tlv_length + PTP_V2_AN_TLV_DATA_OFFSET,
2541 "%s TLV",
2542 val_to_str(tlv_type,
2543 ptp_v2_TLV_type_vals,
2544 "Unknown (%u)"));
2546 ptp_tlv_tree = proto_item_add_subtree(tlv_ti, ett_ptp_v2_tlv);
2548 proto_tree_add_item(ptp_tlv_tree,
2549 hf_ptp_v2_an_tlv_tlvtype,
2550 tvb,
2551 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_TYPE_OFFSET,
2553 ENC_BIG_ENDIAN);
2555 proto_tree_add_item(ptp_tlv_tree,
2556 hf_ptp_v2_an_tlv_lengthfield,
2557 tvb,
2558 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_LENGTHFIELD_OFFSET,
2560 ENC_BIG_ENDIAN);
2562 switch (tlv_type)
2564 case PTP_V2_TLV_TYPE_ORGANIZATION_EXTENSION:
2566 guint32 org_id;
2567 guint32 subtype;
2569 proto_tree_add_item(ptp_tlv_tree,
2570 hf_ptp_v2_oe_tlv_organizationid,
2571 tvb,
2572 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_ORGANIZATIONID_OFFSET,
2574 ENC_BIG_ENDIAN);
2576 org_id = tvb_get_ntoh24(tvb, PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_ORGANIZATIONID_OFFSET);
2577 subtype = tvb_get_ntoh24(tvb, PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_ORGANIZATIONSUBTYPE_OFFSET);
2579 switch (org_id)
2581 case PTP_V2_OE_ORG_ID_IEEE_C37_238:
2583 proto_tree_add_item(ptp_tlv_tree,
2584 hf_ptp_v2_oe_tlv_organizationsubtype,
2585 tvb,
2586 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_ORGANIZATIONSUBTYPE_OFFSET,
2588 ENC_BIG_ENDIAN);
2590 switch (subtype)
2592 case PTP_V2_OE_ORG_IEEE_C37_238_SUBTYPE_C37238TLV:
2594 proto_tree_add_item(ptp_tlv_tree,
2595 hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmasterid,
2596 tvb,
2597 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_IEEEC37238TLV_GMID_OFFSET,
2599 ENC_BIG_ENDIAN);
2600 proto_tree_add_item(ptp_tlv_tree,
2601 hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmastertimeinaccuracy,
2602 tvb,
2603 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_IEEEC37238TLV_GMINACCURACY_OFFSET,
2605 ENC_BIG_ENDIAN);
2606 proto_tree_add_item(ptp_tlv_tree,
2607 hf_ptp_v2_oe_tlv_subtype_c37238tlv_networktimeinaccuracy,
2608 tvb,
2609 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_IEEEC37238TLV_NWINACCURACY_OFFSET,
2611 ENC_BIG_ENDIAN);
2612 proto_tree_add_item(ptp_tlv_tree,
2613 hf_ptp_v2_oe_tlv_subtype_c37238tlv_reserved,
2614 tvb,
2615 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_IEEEC37238TLV_RESERVED_OFFSET,
2617 ENC_NA);
2618 break;
2620 default:
2622 proto_tree_add_item(ptp_tlv_tree,
2623 hf_ptp_v2_oe_tlv_datafield,
2624 tvb,
2625 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_DATAFIELD_OFFSET,
2626 tlv_length - 6,
2627 ENC_NA);
2628 break;
2631 break;
2633 default:
2635 proto_tree_add_item(ptp_tlv_tree,
2636 hf_ptp_v2_oe_tlv_organizationsubtype,
2637 tvb,
2638 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_ORGANIZATIONSUBTYPE_OFFSET,
2640 ENC_BIG_ENDIAN);
2642 proto_tree_add_item(ptp_tlv_tree,
2643 hf_ptp_v2_oe_tlv_datafield,
2644 tvb,
2645 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_OE_DATAFIELD_OFFSET,
2646 tlv_length - 6,
2647 ENC_NA);
2648 break;
2651 break;
2653 case PTP_V2_TLV_TYPE_ALTERNATE_TIME_OFFSET_INDICATOR:
2655 proto_tree_add_item(ptp_tlv_tree,
2656 hf_ptp_v2_atoi_tlv_keyfield,
2657 tvb,
2658 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_KEYFIELD_OFFSET,
2660 ENC_BIG_ENDIAN);
2662 proto_tree_add_item(ptp_tlv_tree,
2663 hf_ptp_v2_atoi_tlv_currentoffset,
2664 tvb,
2665 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_CURRENTOFFSET_OFFSET,
2667 ENC_BIG_ENDIAN);
2669 proto_tree_add_item(ptp_tlv_tree,
2670 hf_ptp_v2_atoi_tlv_jumpseconds,
2671 tvb,
2672 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_JUMPSECONDS_OFFSET,
2674 ENC_BIG_ENDIAN);
2676 proto_tree_add_item(ptp_tlv_tree,
2677 hf_ptp_v2_atoi_tlv_timeofnextjump,
2678 tvb,
2679 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_TIMEOFNEXTJUMP_OFFSET,
2681 ENC_NA);
2683 Offset = PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_ATOI_DISPLAYNAME_OFFSET;
2684 dissect_ptp_v2_text(tvb,
2685 &Offset,
2686 ptp_tlv_tree,
2687 hf_ptp_v2_atoi_tlv_displayname,
2688 hf_ptp_v2_atoi_tlv_displayname_length);
2690 break;
2692 case PTP_V2_TLV_TYPE_PATH_TRACE:
2694 guint16 path_seq_total_length;
2696 for(path_seq_total_length = 0; path_seq_total_length < tlv_length; path_seq_total_length+=8)
2698 proto_tree_add_item(ptp_tlv_tree, hf_ptp_v2_an_tlv_pathsequence, tvb,
2699 PTP_V2_AN_TLV_OFFSET + PTP_AS_AN_TLV_PATH_TRACE_OFFSET + path_seq_total_length,
2700 8, ENC_BIG_ENDIAN);
2703 break;
2705 default:
2707 proto_tree_add_item(ptp_tlv_tree,
2708 hf_ptp_v2_an_tlv_data,
2709 tvb,
2710 PTP_V2_AN_TLV_OFFSET + tlv_total_length + PTP_V2_AN_TLV_DATA_OFFSET,
2711 tlv_length,
2712 ENC_NA);
2713 break;
2717 tlv_total_length += (tlv_length + PTP_V2_AN_TLV_DATA_OFFSET);
2720 break;
2723 case PTP_V2_SYNC_MESSAGE:
2724 case PTP_V2_DELAY_REQ_MESSAGE:{
2726 proto_tree_add_item(ptp_tree, hf_ptp_v2_sdr_origintimestamp_seconds, tvb,
2727 PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET, 6, ENC_BIG_ENDIAN);
2729 proto_tree_add_item(ptp_tree, hf_ptp_v2_sdr_origintimestamp_nanoseconds, tvb,
2730 PTP_V2_SDR_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2732 break;
2735 case PTP_V2_FOLLOWUP_MESSAGE:{
2736 guint16 tlv_length;
2737 proto_item *tlv_ti;
2738 proto_tree *ptp_tlv_tree;
2740 proto_tree_add_item(ptp_tree, hf_ptp_v2_fu_preciseorigintimestamp_seconds, tvb,
2741 PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET, 6, ENC_BIG_ENDIAN);
2743 proto_tree_add_item(ptp_tree, hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds, tvb,
2744 PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2746 /* In 802.1AS there is a Follow_UP information TLV in the Follow Up Message */
2747 if(ptp_v2_transport_specific & PTP_V2_TRANSPORTSPECIFIC_ASPACKET_BITMASK){
2749 /* There are TLV's to be processed */
2750 tlv_length = tvb_get_ntohs (tvb, PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_LENGTHFIELD_OFFSET);
2752 tlv_ti = proto_tree_add_text(
2753 ptp_tree,
2754 tvb,
2755 PTP_AS_FU_TLV_INFORMATION_OFFSET,
2756 tlv_length + PTP_AS_FU_TLV_ORGANIZATIONID_OFFSET,
2757 "%s TLV",
2758 "Follow Up information");
2760 ptp_tlv_tree = proto_item_add_subtree(tlv_ti, ett_ptp_v2_tlv);
2762 proto_tree_add_item(ptp_tlv_tree,
2763 hf_ptp_as_fu_tlv_tlvtype,
2764 tvb,
2765 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_TYPE_OFFSET,
2767 ENC_BIG_ENDIAN);
2769 proto_tree_add_item(ptp_tlv_tree,
2770 hf_ptp_as_fu_tlv_lengthfield,
2771 tvb,
2772 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_LENGTHFIELD_OFFSET,
2774 ENC_BIG_ENDIAN);
2776 proto_tree_add_item(ptp_tlv_tree,
2777 hf_ptp_as_fu_tlv_organization_id,
2778 tvb,
2779 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_ORGANIZATIONID_OFFSET,
2781 ENC_BIG_ENDIAN);
2783 proto_tree_add_item(ptp_tlv_tree,
2784 hf_ptp_as_fu_tlv_organization_subtype,
2785 tvb,
2786 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_ORGANIZATIONSUBTYPE_OFFSET,
2788 ENC_BIG_ENDIAN);
2790 proto_tree_add_item(ptp_tlv_tree,
2791 hf_ptp_as_fu_tlv_cumulative_offset,
2792 tvb,
2793 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_CUMULATIVESCALEDRATEOFFSET_OFFSET,
2795 ENC_BIG_ENDIAN);
2797 proto_tree_add_item(ptp_tlv_tree,
2798 hf_ptp_as_fu_tlv_gm_base_indicator,
2799 tvb,
2800 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_GMTIMEBASEINDICATOR_OFFSET,
2802 ENC_BIG_ENDIAN);
2804 proto_tree_add_item(ptp_tlv_tree,
2805 hf_ptp_as_fu_tlv_last_gm_phase_change,
2806 tvb,
2807 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_LASTGMPHASECHANGE_OFFSET,
2809 ENC_NA);
2811 proto_tree_add_item(ptp_tlv_tree,
2812 hf_ptp_as_fu_tlv_scaled_last_gm_phase_change,
2813 tvb,
2814 PTP_AS_FU_TLV_INFORMATION_OFFSET + PTP_AS_FU_TLV_SCALEDLASTGMFREQCHANGE_OFFSET,
2816 ENC_BIG_ENDIAN);
2820 break;
2823 case PTP_V2_DELAY_RESP_MESSAGE:{
2825 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_receivetimestamp_seconds, tvb,
2826 PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET, 6, ENC_BIG_ENDIAN);
2828 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_receivetimestamp_nanoseconds, tvb,
2829 PTP_V2_DR_RECEIVETIMESTAMPNANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2831 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_requestingportidentity, tvb,
2832 PTP_V2_DR_REQUESTINGPORTIDENTITY_OFFSET, 8, ENC_BIG_ENDIAN);
2834 proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_requestingsourceportid, tvb,
2835 PTP_V2_DR_REQUESTINGSOURCEPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
2837 break;
2840 case PTP_V2_PATH_DELAY_REQ_MESSAGE:{
2841 /* In 802.1AS there is no origin timestamp in a Pdelay_Req Message */
2842 if(!(ptp_v2_transport_specific & PTP_V2_TRANSPORTSPECIFIC_ASPACKET_BITMASK)){
2844 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrq_origintimestamp_seconds, tvb,
2845 PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET, 6, ENC_BIG_ENDIAN);
2847 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrq_origintimestamp_nanoseconds, tvb,
2848 PTP_V2_PDRQ_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2851 break;
2854 case PTP_V2_PATH_DELAY_RESP_MESSAGE:{
2856 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestreceipttimestamp_seconds, tvb,
2857 PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET, 6, ENC_BIG_ENDIAN);
2859 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds, tvb,
2860 PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPNANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2862 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestingportidentity, tvb,
2863 PTP_V2_PDRS_REQUESTINGPORTIDENTITY_OFFSET, 8, ENC_BIG_ENDIAN);
2865 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestingsourceportid, tvb,
2866 PTP_V2_PDRS_REQUESTINGSOURCEPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
2868 break;
2871 case PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE:{
2873 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_responseorigintimestamp_seconds, tvb,
2874 PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET, 6, ENC_BIG_ENDIAN);
2876 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds, tvb,
2877 PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, ENC_BIG_ENDIAN);
2880 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_requestingportidentity, tvb,
2881 PTP_V2_PDFU_REQUESTINGPORTIDENTITY_OFFSET, 8, ENC_BIG_ENDIAN);
2883 proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_requestingsourceportid, tvb,
2884 PTP_V2_PDFU_REQUESTINGSOURCEPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
2886 break;
2889 case PTP_V2_SIGNALLING_MESSAGE:{
2890 guint16 tlv_length;
2891 proto_item *tlv_ti, *sig_tlv_flags_ti;
2892 proto_tree *ptp_tlv_tree, *sig_tlv_flags_tree;
2894 proto_tree_add_item(ptp_tree, hf_ptp_v2_sig_targetportidentity, tvb,
2895 PTP_V2_SIG_TARGETPORTIDENTITY_OFFSET, 8, ENC_BIG_ENDIAN);
2897 proto_tree_add_item(ptp_tree, hf_ptp_v2_sig_targetportid, tvb,
2898 PTP_V2_SIG_TARGETPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
2900 /* In 802.1AS there is a Message Interval Request TLV in the Signalling Message */
2901 if(ptp_v2_transport_specific & PTP_V2_TRANSPORTSPECIFIC_ASPACKET_BITMASK){
2903 /* There are TLV's to be processed */
2904 tlv_length = tvb_get_ntohs (tvb, PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_LENGTHFIELD_OFFSET);
2906 tlv_ti = proto_tree_add_text(
2907 ptp_tree,
2908 tvb,
2909 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET,
2910 tlv_length + PTP_AS_SIG_TLV_ORGANIZATIONID_OFFSET,
2911 "%s TLV",
2912 "Message Interval Request");
2914 ptp_tlv_tree = proto_item_add_subtree(tlv_ti, ett_ptp_v2_tlv);
2916 proto_tree_add_item(ptp_tlv_tree,
2917 hf_ptp_as_sig_tlv_tlvtype,
2918 tvb,
2919 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_TYPE_OFFSET,
2921 ENC_BIG_ENDIAN);
2923 proto_tree_add_item(ptp_tlv_tree,
2924 hf_ptp_as_sig_tlv_lengthfield,
2925 tvb,
2926 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_LENGTHFIELD_OFFSET,
2928 ENC_BIG_ENDIAN);
2930 proto_tree_add_item(ptp_tlv_tree,
2931 hf_ptp_as_sig_tlv_organization_id,
2932 tvb,
2933 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_ORGANIZATIONID_OFFSET,
2935 ENC_BIG_ENDIAN);
2937 proto_tree_add_item(ptp_tlv_tree,
2938 hf_ptp_as_sig_tlv_organization_subtype,
2939 tvb,
2940 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_ORGANIZATIONSUBTYPE_OFFSET,
2942 ENC_BIG_ENDIAN);
2944 proto_tree_add_item(ptp_tlv_tree,
2945 hf_ptp_as_sig_tlv_link_delay_interval,
2946 tvb,
2947 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_LINKDELAYINTERVAL_OFFSET,
2949 ENC_BIG_ENDIAN);
2951 proto_tree_add_item(ptp_tlv_tree,
2952 hf_ptp_as_sig_tlv_time_sync_interval,
2953 tvb,
2954 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_TIMESYNCINTERVAL_OFFSET,
2956 ENC_BIG_ENDIAN);
2958 proto_tree_add_item(ptp_tlv_tree,
2959 hf_ptp_as_sig_tlv_announce_interval,
2960 tvb,
2961 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_ANNOUNCEINTERVAL_OFFSET,
2963 ENC_BIG_ENDIAN);
2965 sig_tlv_flags_ti = proto_tree_add_item(ptp_tlv_tree,
2966 hf_ptp_as_sig_tlv_flags,
2967 tvb,
2968 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_FLAGS_OFFSET,
2970 ENC_BIG_ENDIAN);
2972 sig_tlv_flags_tree = proto_item_add_subtree(sig_tlv_flags_ti, ett_ptp_as_sig_tlv_flags);
2974 proto_tree_add_item(sig_tlv_flags_tree,
2975 hf_ptp_as_sig_tlv_flags_comp_rate_ratio,
2976 tvb,
2977 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_FLAGS_OFFSET,
2979 ENC_BIG_ENDIAN);
2981 proto_tree_add_item(sig_tlv_flags_tree,
2982 hf_ptp_as_sig_tlv_flags_comp_prop_delay,
2983 tvb,
2984 PTP_AS_SIG_TLV_MESSAGEINTERVALREQUEST_OFFSET + PTP_AS_SIG_TLV_FLAGS_OFFSET,
2986 ENC_BIG_ENDIAN);
2988 } else {
2989 guint proto_len;
2990 guint32 tlv_offset;
2991 guint16 tlv_type;
2992 gint8 log_inter_message_period;
2993 gdouble period = 0.0f;
2994 gdouble rate = 0.0f;
2995 guint32 duration_field;
2997 proto_item *ptp_tlv_period;
2998 proto_tree *ptp_tlv_period_tree;
3000 proto_len = tvb_length(tvb);
3001 tlv_offset = PTP_V2_SIG_TLV_START;
3003 while (tlv_offset < proto_len) {
3005 /* 14.1.1 tlvType */
3006 tlv_type = tvb_get_ntohs(tvb, tlv_offset + PTP_V2_SIG_TLV_TYPE_OFFSET);
3007 tlv_ti = proto_tree_add_item(ptp_tree, hf_ptp_v2_sig_tlv_tlvType, tvb,
3008 tlv_offset + PTP_V2_SIG_TLV_TYPE_OFFSET, PTP_V2_SIG_TLV_TYPE_LEN, ENC_BIG_ENDIAN);
3010 ptp_tlv_tree = proto_item_add_subtree(tlv_ti, ett_ptp_v2_tlv);
3012 /* 14.1.2 lengthField */
3013 tlv_length = tvb_get_ntohs(tvb, tlv_offset + PTP_V2_SIG_TLV_LENGTH_OFFSET);
3014 proto_tree_add_uint(ptp_tlv_tree, hf_ptp_v2_sig_tlv_lengthField, tvb,
3015 tlv_offset + PTP_V2_SIG_TLV_LENGTH_OFFSET, PTP_V2_SIG_TLV_LENGTH_LEN, tlv_length);
3017 switch (tlv_type) {
3019 /* Request Unicast Transmission */
3020 case PTP_V2_TLV_TYPE_REQUEST_UNICAST_TRANSMISSION:
3022 /* 16.1.4.1.3 messageType */
3023 proto_tree_add_item(ptp_tlv_tree, hf_ptp_v2_sig_tlv_messageType, tvb,
3024 tlv_offset + PTP_V2_SIG_TLV_MESSAGE_TYPE_OFFSET, PTP_V2_SIG_TLV_MESSAGE_TYPE_LEN, ENC_BIG_ENDIAN);
3026 /* 16.1.4.1.4 logInterMessagePeriod */
3027 log_inter_message_period = tvb_get_guint8(tvb, tlv_offset + PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_OFFSET);
3028 period = pow(2, log_inter_message_period);
3029 rate = 1/period;
3031 ptp_tlv_period = proto_tree_add_item(ptp_tlv_tree, hf_ptp_v2_sig_tlv_logInterMessagePeriod, tvb,
3032 tlv_offset + PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_OFFSET, PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_LEN, ENC_BIG_ENDIAN);
3034 ptp_tlv_period_tree = proto_item_add_subtree(ptp_tlv_period, ett_ptp_v2_tlv_log_period);
3036 proto_tree_add_int_format_value(ptp_tlv_period_tree, hf_ptp_v2_sig_tlv_logInterMessagePeriod_period, tvb,
3037 tlv_offset + PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_OFFSET, PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_LEN, log_inter_message_period, "every %lg seconds", period);
3039 proto_tree_add_int_format_value(ptp_tlv_period_tree, hf_ptp_v2_sig_tlv_logInterMessagePeriod_rate, tvb,
3040 tlv_offset + PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_OFFSET, PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_LEN, log_inter_message_period, "%lg packets/sec", rate);
3042 /* 16.1.4.1.5 durationField */
3043 duration_field = tvb_get_ntohl(tvb, tlv_offset + PTP_V2_SIG_TLV_DURATION_FIELD_OFFSET);
3045 proto_tree_add_uint_format_value(ptp_tlv_tree, hf_ptp_v2_sig_tlv_durationField, tvb,
3046 tlv_offset + PTP_V2_SIG_TLV_DURATION_FIELD_OFFSET, PTP_V2_SIG_TLV_DURATION_FIELD_LEN, duration_field, "%u seconds", duration_field);
3048 break;
3050 /* Grant Unicast Transmission */
3051 case PTP_V2_TLV_TYPE_GRANT_UNICAST_TRANSMISSION:
3053 /* 16.1.4.2.3 messageType */
3054 proto_tree_add_item(ptp_tlv_tree, hf_ptp_v2_sig_tlv_messageType, tvb,
3055 tlv_offset + PTP_V2_SIG_TLV_MESSAGE_TYPE_OFFSET, PTP_V2_SIG_TLV_MESSAGE_TYPE_LEN, ENC_BIG_ENDIAN);
3057 /* 16.1.4.2.4 logInterMessagePeriod */
3058 log_inter_message_period = tvb_get_guint8(tvb, tlv_offset + PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_OFFSET);
3059 period = pow(2, log_inter_message_period);
3060 rate = 1/period;
3062 ptp_tlv_period = proto_tree_add_item(ptp_tlv_tree, hf_ptp_v2_sig_tlv_logInterMessagePeriod, tvb,
3063 tlv_offset + PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_OFFSET, PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_LEN, ENC_BIG_ENDIAN);
3065 ptp_tlv_period_tree = proto_item_add_subtree(ptp_tlv_period, ett_ptp_v2_tlv_log_period);
3067 proto_tree_add_int_format_value(ptp_tlv_period_tree, hf_ptp_v2_sig_tlv_logInterMessagePeriod_period, tvb,
3068 tlv_offset + PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_OFFSET, PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_LEN, log_inter_message_period, "every %lg seconds", period);
3070 proto_tree_add_int_format_value(ptp_tlv_period_tree, hf_ptp_v2_sig_tlv_logInterMessagePeriod_rate, tvb,
3071 tlv_offset + PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_OFFSET, PTP_V2_SIG_TLV_LOG_INTER_MESSAGE_PERIOD_LEN, log_inter_message_period, "%lg packets/sec", rate);
3073 /* 16.1.4.2.5 durationField */
3074 duration_field = tvb_get_ntohl(tvb, tlv_offset + PTP_V2_SIG_TLV_DURATION_FIELD_OFFSET);
3076 proto_tree_add_uint_format_value(ptp_tlv_tree, hf_ptp_v2_sig_tlv_durationField, tvb,
3077 tlv_offset + PTP_V2_SIG_TLV_DURATION_FIELD_OFFSET, PTP_V2_SIG_TLV_DURATION_FIELD_LEN, duration_field, "%u seconds", duration_field);
3079 /* 16.1.4.2.6 renewalInvited */
3080 proto_tree_add_item(ptp_tlv_tree, hf_ptp_v2_sig_tlv_renewalInvited, tvb,
3081 tlv_offset + PTP_V2_SIG_TLV_RENEWAL_INVITED_OFFSET, PTP_V2_SIG_TLV_RENEWAL_INVITED_LEN, ENC_BIG_ENDIAN);
3083 break;
3085 /* Cancel Unicast Transmission */
3086 case PTP_V2_TLV_TYPE_CANCEL_UNICAST_TRANSMISSION:
3088 /* 16.1.4.3.3 messageType */
3089 proto_tree_add_item(ptp_tlv_tree, hf_ptp_v2_sig_tlv_messageType, tvb,
3090 tlv_offset + PTP_V2_SIG_TLV_MESSAGE_TYPE_OFFSET, PTP_V2_SIG_TLV_MESSAGE_TYPE_LEN, ENC_BIG_ENDIAN);
3092 break;
3094 /* Acknowledge Cancel Unicast Transmission */
3095 case PTP_V2_TLV_TYPE_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION:
3097 /* 16.1.4.4.3 messageType */
3098 proto_tree_add_item(ptp_tlv_tree, hf_ptp_v2_sig_tlv_messageType, tvb,
3099 tlv_offset + PTP_V2_SIG_TLV_MESSAGE_TYPE_OFFSET, PTP_V2_SIG_TLV_MESSAGE_TYPE_LEN, ENC_BIG_ENDIAN);
3101 break;
3103 default:
3104 /* TODO: Add dissector for other TLVs */
3105 proto_tree_add_item(ptp_tlv_tree, hf_ptp_v2_sig_tlv_data, tvb,
3106 tlv_offset + PTP_V2_SIG_TLV_VALUE_OFFSET, tlv_length, ENC_NA);
3109 tlv_offset += PTP_V2_SIG_TLV_TYPE_LEN +
3110 PTP_V2_SIG_TLV_LENGTH_LEN +
3111 tlv_length;
3114 break;
3117 case PTP_V2_MANAGEMENT_MESSAGE:
3119 guint16 tlv_type, tlv_length;
3121 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_targetportidentity, tvb,
3122 PTP_V2_MM_TARGETPORTIDENTITY_OFFSET, 8, ENC_BIG_ENDIAN);
3124 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_targetportid, tvb,
3125 PTP_V2_MM_TARGETPORTID_OFFSET, 2, ENC_BIG_ENDIAN);
3127 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_startingboundaryhops, tvb,
3128 PTP_V2_MM_STARTINGBOUNDARYHOPS_OFFSET, 1, ENC_BIG_ENDIAN);
3130 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_boundaryhops, tvb,
3131 PTP_V2_MM_BOUNDARYHOPS_OFFSET, 1, ENC_BIG_ENDIAN);
3133 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_action, tvb,
3134 PTP_V2_MM_ACTION_OFFSET, 1, ENC_BIG_ENDIAN);
3136 /* management TLV */
3137 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_tlvType, tvb,
3138 PTP_V2_MM_TLV_TYPE_OFFSET, 2, ENC_BIG_ENDIAN);
3140 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_lengthField, tvb,
3141 PTP_V2_MM_TLV_LENGTHFIELD_OFFSET, 2, ENC_BIG_ENDIAN);
3143 tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
3144 tlv_length = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_LENGTHFIELD_OFFSET);
3146 /* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
3147 switch(tlv_type) {
3148 case PTP_V2_TLV_TYPE_MANAGEMENT:
3150 guint16 ptp_v2_managementId;
3151 guint16 Offset = PTP_V2_MM_TLV_DATAFIELD_OFFSET;
3153 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_managementId, tvb,
3154 PTP_V2_MM_TLV_MANAGEMENTID_OFFSET, 2, ENC_BIG_ENDIAN);
3156 ptp_v2_managementId = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET);
3158 if (tlv_length <= 2)
3160 /* no data */
3161 break;
3164 managementData_ti = proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_data, tvb, Offset, tlv_length - 2, ENC_NA);
3166 /* data field of the management message (subtree)*/
3167 ptp_managementData_tree = proto_item_add_subtree(managementData_ti, ett_ptp_v2_managementData);
3169 switch(ptp_v2_managementId) {
3170 case PTP_V2_MM_ID_NULL_MANAGEMENT:
3172 /* no data in NULL management */
3173 break;
3175 case PTP_V2_MM_ID_CLOCK_DESCRIPTION:
3177 guint16 N = 0, S = 0;
3178 clockType_ti = proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockType, tvb,
3179 Offset, 2, ENC_BIG_ENDIAN);
3181 ptp_clockType_tree = proto_item_add_subtree(clockType_ti, ett_ptp_v2_clockType);
3182 /* ClockType Subtree */
3183 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_ordinaryClock, tvb,
3184 Offset, 2, ENC_BIG_ENDIAN);
3186 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_boundaryClock, tvb,
3187 Offset, 2, ENC_BIG_ENDIAN);
3189 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_p2p_transparentClock, tvb,
3190 Offset, 2, ENC_BIG_ENDIAN);
3192 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_e2e_transparentClock, tvb,
3193 Offset, 2, ENC_BIG_ENDIAN);
3195 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_managementNode, tvb,
3196 Offset, 2, ENC_BIG_ENDIAN);
3198 proto_tree_add_item(ptp_clockType_tree, hf_ptp_v2_mm_clockType_reserved, tvb,
3199 Offset, 2, ENC_BIG_ENDIAN);
3200 Offset +=2;
3202 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3203 hf_ptp_v2_mm_physicalLayerProtocol, hf_ptp_v2_mm_physicalLayerProtocol_length);
3205 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_physicalAddressLength, tvb,
3206 Offset, 2, ENC_BIG_ENDIAN);
3208 S = tvb_get_ntohs (tvb, Offset);
3209 Offset +=2;
3211 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_physicalAddress, tvb,
3212 Offset, S, ENC_NA);
3213 Offset += S;
3215 N = tvb_get_ntohs (tvb, Offset+2);
3217 protocolAddress_ti = proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_protocolAddress, tvb,
3218 Offset+4, N, ENC_NA);
3220 ptp_protocolAddress_tree = proto_item_add_subtree(protocolAddress_ti, ett_ptp_v2_protocolAddress);
3221 /* physicalLayerProtocol subtree */
3222 proto_tree_add_item(ptp_protocolAddress_tree, hf_ptp_v2_mm_protocolAddress_networkProtocol, tvb,
3223 Offset, 2, ENC_BIG_ENDIAN);
3225 proto_tree_add_item(ptp_protocolAddress_tree, hf_ptp_v2_mm_protocolAddress_length, tvb,
3226 Offset+2, 2, ENC_BIG_ENDIAN);
3228 proto_tree_add_item(ptp_protocolAddress_tree, hf_ptp_v2_mm_protocolAddress, tvb,
3229 Offset+4, N, ENC_NA);
3230 N = N + 4;
3231 Offset += N;
3233 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_manufacturerIdentity, tvb,
3234 Offset, 3, ENC_NA);
3236 Offset += 3;
3238 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3239 Offset, 1, ENC_NA);
3240 Offset += 1;
3242 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3243 hf_ptp_v2_mm_productDescription, hf_ptp_v2_mm_productDescription_length);
3244 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3245 hf_ptp_v2_mm_revisionData, hf_ptp_v2_mm_revisionData_length);
3246 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3247 hf_ptp_v2_mm_userDescription, hf_ptp_v2_mm_userDescription_length);
3249 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_profileIdentity, tvb,
3250 Offset, 6, ENC_NA);
3251 Offset += 6;
3253 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3254 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
3256 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
3257 Offset, 1, ENC_NA);
3259 break;
3261 case PTP_V2_MM_ID_USER_DESCRIPTION:
3264 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3265 hf_ptp_v2_mm_userDescription, hf_ptp_v2_mm_userDescription_length);
3267 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3268 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
3270 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
3271 Offset, 1, ENC_NA);
3273 break;
3275 case PTP_V2_MM_ID_SAVE_IN_NON_VOLATILE_STORAGE:
3277 /* no data */
3278 break;
3280 case PTP_V2_MM_ID_RESET_NON_VOLATILE_STORAGE:
3282 /* no data */
3283 break;
3285 case PTP_V2_MM_ID_INITIALIZE:
3287 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_initializationKey, tvb,
3288 Offset, 2, ENC_BIG_ENDIAN);
3289 break;
3291 case PTP_V2_MM_ID_FAULT_LOG:
3293 guint16 ii, num = 0;
3294 proto_item *ptpError_ti;
3295 proto_tree *ptpError_subtree;
3297 num = tvb_get_ntohs (tvb, Offset);
3299 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberOfFaultRecords, tvb,
3300 Offset, 2, ENC_BIG_ENDIAN);
3301 Offset +=2;
3303 for (ii = 0; ii < num; ii++)
3305 ptpError_ti = proto_tree_add_text(ptp_managementData_tree, tvb, Offset, tvb_get_ntohs (tvb, Offset), "Fault record");
3307 /* (subtree)*/
3308 ptpError_subtree = proto_item_add_subtree(ptpError_ti, ett_ptp_v2_faultRecord);
3310 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_faultRecordLength, tvb,
3311 Offset, 2, ENC_BIG_ENDIAN);
3312 Offset +=2;
3314 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_faultTime_s, tvb,
3315 Offset, 6, ENC_BIG_ENDIAN);
3317 Offset +=6;
3318 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_faultTime_ns, tvb,
3319 Offset, 4, ENC_BIG_ENDIAN);
3320 Offset +=4;
3321 proto_tree_add_item(ptpError_subtree, hf_ptp_v2_mm_severityCode, tvb,
3322 Offset, 1, ENC_BIG_ENDIAN);
3323 Offset +=1;
3325 dissect_ptp_v2_text (tvb, &Offset, ptpError_subtree,
3326 hf_ptp_v2_mm_faultName, hf_ptp_v2_mm_faultName_length);
3328 dissect_ptp_v2_text (tvb, &Offset, ptpError_subtree,
3329 hf_ptp_v2_mm_faultValue, hf_ptp_v2_mm_faultValue_length);
3331 dissect_ptp_v2_text (tvb, &Offset, ptpError_subtree,
3332 hf_ptp_v2_mm_faultDescription, hf_ptp_v2_mm_faultDescription_length);
3335 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3336 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
3338 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
3339 Offset, 1, ENC_NA);
3341 break;
3343 case PTP_V2_MM_ID_FAULT_LOG_RESET:
3345 /* no data */
3346 break;
3348 case PTP_V2_MM_ID_DEFAULT_DATA_SET:
3350 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_TSC, tvb,
3351 PTP_V2_MM_TLV_DATAFIELD_OFFSET, 1, ENC_BIG_ENDIAN);
3353 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_dds_SO, tvb,
3354 PTP_V2_MM_TLV_DATAFIELD_OFFSET, 1, ENC_BIG_ENDIAN);
3356 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3357 PTP_V2_MM_RESERVED1, 1, ENC_NA);
3359 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberPorts, tvb,
3360 PTP_V2_MM_NUMBERPORTS, 2, ENC_BIG_ENDIAN);
3362 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority1, tvb,
3363 PTP_V2_MM_PRIORITY1, 1, ENC_BIG_ENDIAN);
3365 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockclass, tvb,
3366 PTP_V2_MM_CLOCKQUALITY, 1, ENC_BIG_ENDIAN);
3368 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockaccuracy, tvb,
3369 PTP_V2_MM_CLOCKQUALITY+1, 1, ENC_BIG_ENDIAN);
3371 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockvariance, tvb,
3372 PTP_V2_MM_CLOCKQUALITY+2, 2, ENC_BIG_ENDIAN);
3374 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority2, tvb,
3375 PTP_V2_MM_PRIORITY2, 1, ENC_BIG_ENDIAN);
3377 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3378 PTP_V2_MM_CLOCKIDENTITY, 8, ENC_BIG_ENDIAN);
3380 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_domainNumber, tvb,
3381 PTP_V2_MM_DOMAINNUMBER, 1, ENC_BIG_ENDIAN);
3383 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3384 PTP_V2_MM_RESERVED2, 1, ENC_NA);
3385 break;
3387 case PTP_V2_MM_ID_CURRENT_DATA_SET:
3389 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_stepsRemoved, tvb,
3390 Offset, 2, ENC_BIG_ENDIAN);
3391 Offset +=2;
3393 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
3394 "Offset from Master", hf_ptp_v2_mm_offset_ns, hf_ptp_v2_mm_offset_subns);
3395 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
3396 "Mean path delay", hf_ptp_v2_mm_pathDelay_ns, hf_ptp_v2_mm_pathDelay_subns);
3397 break;
3399 case PTP_V2_MM_ID_PARENT_DATA_SET:
3401 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_parentIdentity, tvb,
3402 Offset, 8, ENC_BIG_ENDIAN);
3404 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_parentPort, tvb,
3405 Offset+8, 2, ENC_BIG_ENDIAN);
3406 Offset +=10;
3408 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_parentStats, tvb,
3409 Offset, 1, ENC_BIG_ENDIAN);
3410 Offset +=1;
3412 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3413 Offset, 1, ENC_NA);
3414 Offset +=1;
3416 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_observedParentOffsetScaledLogVariance, tvb,
3417 Offset, 2, ENC_BIG_ENDIAN);
3418 Offset +=2;
3420 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_observedParentClockPhaseChangeRate, tvb,
3421 Offset, 4, ENC_BIG_ENDIAN);
3422 Offset +=4;
3424 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterPriority1, tvb,
3425 Offset, 1, ENC_BIG_ENDIAN);
3426 Offset +=1;
3428 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterclockclass, tvb,
3429 Offset, 1, ENC_BIG_ENDIAN);
3431 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterclockaccuracy, tvb,
3432 Offset+1, 1, ENC_BIG_ENDIAN);
3434 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterclockvariance, tvb,
3435 Offset+2, 2, ENC_BIG_ENDIAN);
3436 Offset += 4;
3438 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterPriority2, tvb,
3439 Offset, 1, ENC_BIG_ENDIAN);
3440 Offset +=1;
3442 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_grandmasterIdentity, tvb,
3443 Offset, 8, ENC_BIG_ENDIAN);
3445 break;
3447 case PTP_V2_MM_ID_TIME_PROPERTIES_DATA_SET:
3449 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentUtcOffset, tvb,
3450 Offset, 2, ENC_BIG_ENDIAN);
3451 Offset +=2;
3453 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_61, tvb,
3454 Offset, 1, ENC_BIG_ENDIAN);
3455 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_59, tvb,
3456 Offset, 1, ENC_BIG_ENDIAN);
3457 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_UTCV, tvb,
3458 Offset, 1, ENC_BIG_ENDIAN);
3459 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PTP, tvb,
3460 Offset, 1, ENC_BIG_ENDIAN);
3461 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_TTRA, tvb,
3462 Offset, 1, ENC_BIG_ENDIAN);
3463 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_FTRA, tvb,
3464 Offset, 1, ENC_BIG_ENDIAN);
3465 Offset +=1;
3467 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_timesource, tvb,
3468 Offset, 1, ENC_BIG_ENDIAN);
3470 break;
3472 case PTP_V2_MM_ID_PORT_DATA_SET:
3474 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3475 Offset, 8, ENC_BIG_ENDIAN);
3476 Offset +=8;
3478 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PortNumber, tvb,
3479 Offset, 2, ENC_BIG_ENDIAN);
3480 Offset +=2;
3482 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_portState, tvb,
3483 Offset, 1, ENC_BIG_ENDIAN);
3484 Offset +=1;
3486 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinDelayReqInterval, tvb,
3487 Offset, 1, ENC_BIG_ENDIAN);
3488 Offset +=1;
3490 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
3491 "Peer mean path delay", hf_ptp_v2_mm_peerMeanPathDelay_ns, hf_ptp_v2_mm_peerMeanPathDelay_subns);
3493 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logAnnounceInterval, tvb,
3494 Offset, 1, ENC_BIG_ENDIAN);
3495 Offset +=1;
3497 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_announceReceiptTimeout, tvb,
3498 Offset, 1, ENC_BIG_ENDIAN);
3499 Offset +=1;
3501 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logSyncInterval, tvb,
3502 Offset, 1, ENC_BIG_ENDIAN);
3503 Offset +=1;
3505 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_delayMechanism, tvb,
3506 Offset, 1, ENC_BIG_ENDIAN);
3507 Offset +=1;
3509 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinPdelayReqInterval, tvb,
3510 Offset, 1, ENC_BIG_ENDIAN);
3511 Offset +=1;
3513 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_versionNumber, tvb,
3514 Offset, 1, ENC_BIG_ENDIAN);
3515 Offset +=1;
3517 break;
3519 case PTP_V2_MM_ID_PRIORITY1:
3521 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority1, tvb,
3522 Offset, 1, ENC_BIG_ENDIAN);
3523 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3524 Offset+1, 1, ENC_NA);
3525 break;
3527 case PTP_V2_MM_ID_PRIORITY2:
3529 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_priority2, tvb,
3530 Offset, 1, ENC_BIG_ENDIAN);
3531 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3532 Offset+1, 1, ENC_NA);
3533 break;
3535 case PTP_V2_MM_ID_DOMAIN:
3537 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_domainNumber, tvb,
3538 Offset, 1, ENC_BIG_ENDIAN);
3539 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3540 Offset+1, 1, ENC_NA);
3541 break;
3543 case PTP_V2_MM_ID_SLAVE_ONLY:
3545 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_SO, tvb,
3546 Offset, 1, ENC_BIG_ENDIAN);
3547 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3548 Offset+1, 1, ENC_NA);
3549 break;
3551 case PTP_V2_MM_ID_LOG_ANNOUNCE_INTERVAL:
3553 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logAnnounceInterval, tvb,
3554 Offset, 1, ENC_BIG_ENDIAN);
3556 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3557 Offset+1, 1, ENC_NA);
3558 break;
3560 case PTP_V2_MM_ID_ANNOUNCE_RECEIPT_TIMEOUT:
3562 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_announceReceiptTimeout, tvb,
3563 Offset, 1, ENC_BIG_ENDIAN);
3565 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3566 Offset+1, 1, ENC_NA);
3567 break;
3569 case PTP_V2_MM_ID_LOG_SYNC_INTERVAL:
3571 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logSyncInterval, tvb,
3572 Offset, 1, ENC_BIG_ENDIAN);
3574 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3575 Offset+1, 1, ENC_NA);
3576 break;
3578 case PTP_V2_MM_ID_VERSION_NUMBER:
3580 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_versionNumber, tvb,
3581 Offset, 1, ENC_BIG_ENDIAN);
3583 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3584 Offset+1, 1, ENC_NA);
3585 break;
3587 case PTP_V2_MM_ID_ENABLE_PORT:
3589 /* no data */
3590 break;
3592 case PTP_V2_MM_ID_DISABLE_PORT:
3594 /* no data */
3595 break;
3597 case PTP_V2_MM_ID_TIME:
3600 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentTime_s, tvb,
3601 Offset, 6, ENC_BIG_ENDIAN);
3603 Offset +=6;
3604 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentTime_ns, tvb,
3605 Offset, 4, ENC_BIG_ENDIAN);
3606 break;
3608 case PTP_V2_MM_ID_CLOCK_ACCURACY:
3610 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockAccuracy, tvb,
3611 Offset, 1, ENC_BIG_ENDIAN);
3612 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3613 Offset+1, 1, ENC_NA);
3614 break;
3616 case PTP_V2_MM_ID_UTC_PROPERTIES:
3618 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentUtcOffset, tvb,
3619 Offset, 2, ENC_BIG_ENDIAN);
3620 Offset +=2;
3622 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_61, tvb,
3623 Offset, 1, ENC_BIG_ENDIAN);
3624 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_LI_59, tvb,
3625 Offset, 1, ENC_BIG_ENDIAN);
3626 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_UTCV, tvb,
3627 Offset, 1, ENC_BIG_ENDIAN);
3628 Offset +=1;
3630 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3631 Offset, 1, ENC_NA);
3632 break;
3634 case PTP_V2_MM_ID_TRACEABILITY_PROPERTIES:
3636 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_TTRA, tvb,
3637 Offset, 1, ENC_BIG_ENDIAN);
3638 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_FTRA, tvb,
3639 Offset, 1, ENC_BIG_ENDIAN);
3640 Offset +=1;
3642 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3643 Offset, 1, ENC_NA);
3645 break;
3647 case PTP_V2_MM_ID_TIMESCALE_PROPERTIES:
3649 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PTP, tvb,
3650 Offset, 1, ENC_BIG_ENDIAN);
3651 Offset +=1;
3653 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_timesource, tvb,
3654 Offset, 1, ENC_BIG_ENDIAN);
3656 break;
3658 case PTP_V2_MM_ID_UNICAST_NEGOTIATION_ENABLE:
3660 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_ucEN, tvb,
3661 Offset, 1, ENC_BIG_ENDIAN);
3662 Offset +=1;
3664 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3665 Offset, 1, ENC_NA);
3666 break;
3668 case PTP_V2_MM_ID_PATH_TRACE_LIST:
3670 guint16 i = 0;
3671 /* one or more ClockIdentity */
3672 for (i = 0; i < (tlv_length / 8); i++)
3674 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3675 Offset, 8, ENC_BIG_ENDIAN);
3678 break;
3680 case PTP_V2_MM_ID_PATH_TRACE_ENABLE:
3682 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_ptEN, tvb,
3683 Offset, 1, ENC_BIG_ENDIAN);
3684 Offset +=1;
3686 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3687 Offset, 1, ENC_NA);
3689 break;
3691 case PTP_V2_MM_ID_GRANDMASTER_CLUSTER_TABLE:
3693 /* ToDo */
3694 break;
3696 case PTP_V2_MM_ID_UNICAST_MASTER_TABLE:
3698 /* ToDo */
3699 break;
3701 case PTP_V2_MM_ID_UNICAST_MASTER_MAX_TABLE_SIZE:
3703 /* ToDo */
3704 break;
3706 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE:
3708 /* ToDo */
3709 break;
3711 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_TABLE_ENABLED:
3713 /* ToDo */
3714 break;
3716 case PTP_V2_MM_ID_ACCEPTABLE_MASTER_MAX_TABLE_SIZE:
3718 /* ToDo */
3719 break;
3721 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_ENABLE:
3723 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_keyField, tvb,
3724 Offset, 1, ENC_BIG_ENDIAN);
3725 Offset +=1;
3727 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_atEN, tvb,
3728 Offset, 1, ENC_BIG_ENDIAN);
3729 Offset +=1;
3731 break;
3733 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_NAME:
3735 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_keyField, tvb,
3736 Offset, 1, ENC_BIG_ENDIAN);
3737 Offset +=1;
3739 dissect_ptp_v2_text (tvb, &Offset, ptp_managementData_tree,
3740 hf_ptp_v2_mm_displayName, hf_ptp_v2_mm_displayName_length);
3742 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3743 if ( (Offset - PTP_V2_MM_TLV_DATAFIELD_OFFSET) % 2 )
3745 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_pad, tvb,
3746 Offset, 1, ENC_NA);
3748 break;
3750 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_MAX_KEY:
3752 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_maxKey, tvb,
3753 Offset, 1, ENC_BIG_ENDIAN);
3754 Offset +=1;
3756 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3757 Offset, 1, ENC_NA);
3759 break;
3761 case PTP_V2_MM_ID_ALTERNATE_MASTER:
3763 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_transmitAlternateMulticastSync, tvb,
3764 Offset, 1, ENC_BIG_ENDIAN);
3765 Offset +=1;
3767 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberOfAlternateMasters, tvb,
3768 Offset, 1, ENC_BIG_ENDIAN);
3769 Offset +=1;
3771 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logAlternateMulticastSyncInterval, tvb,
3772 Offset, 1, ENC_BIG_ENDIAN);
3773 Offset +=1;
3775 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3776 Offset, 1, ENC_NA);
3777 break;
3779 case PTP_V2_MM_ID_ALTERNATE_TIME_OFFSET_PROPERTIES:
3781 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_keyField, tvb,
3782 Offset, 1, ENC_BIG_ENDIAN);
3783 Offset +=1;
3785 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_currentOffset, tvb,
3786 Offset, 4, ENC_BIG_ENDIAN);
3787 Offset +=4;
3789 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_jumpSeconds, tvb,
3790 Offset, 4, ENC_BIG_ENDIAN);
3791 Offset +=4;
3793 timeStamp = tvb_get_ntohl(tvb, Offset);
3794 timeStamp = timeStamp << 16;
3795 timeStamp = timeStamp | tvb_get_ntohs(tvb, Offset+4);
3797 proto_tree_add_text(ptp_managementData_tree, tvb, Offset, 6,
3798 "Time of next jump (seconds): %" G_GINT64_MODIFIER "u", timeStamp);
3799 Offset +=6;
3801 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3802 Offset, 1, ENC_NA);
3803 break;
3805 case PTP_V2_MM_ID_TC_DEFAULT_DATA_SET:
3807 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3808 Offset, 8, ENC_BIG_ENDIAN);
3809 Offset +=8;
3811 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_numberPorts, tvb,
3812 Offset, 2, ENC_BIG_ENDIAN);
3813 Offset +=2;
3815 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_delayMechanism, tvb,
3816 Offset, 1, ENC_BIG_ENDIAN);
3817 Offset +=1;
3819 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_primaryDomain, tvb,
3820 Offset, 1, ENC_BIG_ENDIAN);
3822 break;
3824 case PTP_V2_MM_ID_TC_PORT_DATA_SET:
3826 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_clockidentity, tvb,
3827 Offset, 8, ENC_BIG_ENDIAN);
3828 Offset +=8;
3830 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_PortNumber, tvb,
3831 Offset, 2, ENC_BIG_ENDIAN);
3832 Offset +=2;
3834 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_faultyFlag, tvb,
3835 Offset, 1, ENC_BIG_ENDIAN);
3836 Offset +=1;
3838 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinPdelayReqInterval, tvb,
3839 Offset, 1, ENC_BIG_ENDIAN);
3840 Offset +=1;
3842 dissect_ptp_v2_timeInterval(tvb, &Offset, ptp_managementData_tree,
3843 "Peer mean path delay", hf_ptp_v2_mm_peerMeanPathDelay_ns, hf_ptp_v2_mm_peerMeanPathDelay_subns);
3844 break;
3846 case PTP_V2_MM_ID_PRIMARY_DOMAIN:
3848 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_primaryDomain, tvb,
3849 Offset, 1, ENC_BIG_ENDIAN);
3851 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3852 Offset+1, 1, ENC_NA);
3853 break;
3855 case PTP_V2_MM_ID_DELAY_MECHANISM:
3857 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_delayMechanism, tvb,
3858 Offset, 1, ENC_BIG_ENDIAN);
3860 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3861 Offset+1, 1, ENC_NA);
3862 break;
3864 case PTP_V2_MM_ID_LOG_MIN_PDELAY_REQ_INTERVAL:
3866 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_logMinPdelayReqInterval, tvb,
3867 Offset, 1, ENC_BIG_ENDIAN);
3869 proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb,
3870 Offset+1, 1, ENC_NA);
3871 break;
3873 default:
3875 /* no data */
3876 break;
3878 } /* switch(ptp_v2_managementId) */
3879 break;
3881 case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS:
3883 /* there is only one error TLV */
3884 guint16 Offset = PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET;
3886 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_managementErrorId, tvb,
3887 Offset, 2, ENC_BIG_ENDIAN);
3888 Offset +=2;
3890 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_managementId, tvb,
3891 Offset, 2, ENC_BIG_ENDIAN);
3892 Offset +=2;
3894 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_reserved, tvb,
3895 Offset, 4, ENC_NA);
3896 Offset +=4;
3898 /* optional Field! */
3899 if (Offset - PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET + 2 < tlv_length)
3901 dissect_ptp_v2_text (tvb, &Offset, ptp_tree,
3902 hf_ptp_v2_mm_displayData, hf_ptp_v2_mm_displayData_length);
3905 /* Wenn Offset nicht gerade folgt noch ein pad Bit */
3906 if ( (Offset - PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET) % 2 )
3908 proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_pad, tvb,
3909 Offset, 1, ENC_NA);
3911 break;
3913 default:
3915 break;
3917 } /* switch TLV Type */
3918 } /* case Management Message */
3919 } /* switch message ID*/
3920 } /* tree */
3924 /* Register the protocol with Wireshark */
3926 void
3927 proto_register_ptp(void)
3929 static hf_register_info hf[] = {
3930 /* PTPv1 fields **********************************************************/
3931 /*Common fields for all frames*/
3932 { &hf_ptp_versionptp,
3933 { "versionPTP", "ptp.versionptp",
3934 FT_UINT16, BASE_DEC, NULL, 0x00,
3935 NULL, HFILL }
3937 { &hf_ptp_versionnetwork,
3938 { "versionNetwork", "ptp.versionnetwork",
3939 FT_UINT16, BASE_DEC, NULL, 0x00,
3940 NULL, HFILL }
3942 { &hf_ptp_subdomain,
3943 { "subdomain", "ptp.subdomain",
3944 FT_STRING, BASE_NONE, NULL, 0x00,
3945 NULL, HFILL }
3947 { &hf_ptp_messagetype,
3948 { "messageType", "ptp.messagetype",
3949 FT_UINT8, BASE_DEC, VALS(ptp_messagetype_vals), 0x00,
3950 NULL, HFILL }
3952 { &hf_ptp_sourcecommunicationtechnology,
3953 { "sourceCommunicationTechnology", "ptp.sourcecommunicationtechnology",
3954 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
3955 NULL, HFILL }
3957 { &hf_ptp_sourceuuid,
3958 { "sourceUuid", "ptp.sourceuuid",
3959 FT_ETHER, BASE_NONE, NULL, 0x00,
3960 NULL, HFILL }
3962 { &hf_ptp_sourceportid,
3963 { "sourcePortId", "ptp.sourceportid",
3964 FT_UINT16, BASE_DEC, NULL, 0x00,
3965 NULL, HFILL }
3967 { &hf_ptp_sequenceid,
3968 { "sequenceId", "ptp.sequenceid",
3969 FT_UINT16, BASE_DEC, NULL, 0x00,
3970 NULL, HFILL }
3972 { &hf_ptp_control,
3973 { "control", "ptp.control",
3974 FT_UINT8, BASE_DEC, VALS(ptp_control_vals), 0x00,
3975 NULL, HFILL }
3977 /*THE FLAGS-FIELD*/
3978 { &hf_ptp_flags,
3979 { "flags", "ptp.flags",
3980 FT_UINT16, BASE_HEX, NULL, 0x00,
3981 NULL, HFILL }
3983 { &hf_ptp_flags_li61,
3984 { "PTP_LI61", "ptp.flags.li61",
3985 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_LI61_BITMASK,
3986 NULL, HFILL }
3988 { &hf_ptp_flags_li59,
3989 { "PTP_LI59", "ptp.flags.li59",
3990 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_LI59_BITMASK,
3991 NULL, HFILL }
3993 { &hf_ptp_flags_boundary_clock,
3994 { "PTP_BOUNDARY_CLOCK", "ptp.flags.boundary_clock",
3995 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_BOUNDARY_CLOCK_BITMASK,
3996 NULL, HFILL }
3998 { &hf_ptp_flags_assist,
3999 { "PTP_ASSIST", "ptp.flags.assist",
4000 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_ASSIST_BITMASK,
4001 NULL, HFILL }
4003 { &hf_ptp_flags_ext_sync,
4004 { "PTP_EXT_SYNC", "ptp.flags.ext_sync",
4005 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_EXT_SYNC_BITMASK,
4006 NULL, HFILL }
4008 { &hf_ptp_flags_parent,
4009 { "PTP_PARENT_STATS", "ptp.flags.parent_stats",
4010 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_PARENT_STATS_BITMASK,
4011 NULL, HFILL }
4013 { &hf_ptp_flags_sync_burst,
4014 { "PTP_SYNC_BURST", "ptp.flags.sync_burst",
4015 FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_SYNC_BURST_BITMASK,
4016 NULL, HFILL }
4018 /*END OF THE FLAG-FIELD*/
4020 /*offsets for ptp_sync and delay_req (=sdr) messages*/
4021 { &hf_ptp_sdr_origintimestamp,
4022 { "originTimestamp", "ptp.sdr.origintimestamp",
4023 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4024 NULL, HFILL }
4026 { &hf_ptp_sdr_origintimestamp_seconds,
4027 { "originTimestamp (seconds)", "ptp.sdr.origintimestamp_seconds",
4028 FT_UINT32, BASE_DEC, NULL, 0x00,
4029 NULL, HFILL }
4031 { &hf_ptp_sdr_origintimestamp_nanoseconds,
4032 { "originTimestamp (nanoseconds)", "ptp.sdr.origintimestamp_nanoseconds",
4033 FT_INT32, BASE_DEC, NULL, 0x00,
4034 NULL, HFILL }
4036 { &hf_ptp_sdr_epochnumber,
4037 { "epochNumber", "ptp.sdr.epochnumber",
4038 FT_UINT16, BASE_DEC, NULL, 0x00,
4039 NULL, HFILL }
4041 { &hf_ptp_sdr_currentutcoffset,
4042 { "currentUTCOffset", "ptp.sdr.currentutcoffset",
4043 FT_INT16, BASE_DEC, NULL, 0x00,
4044 NULL, HFILL }
4046 { &hf_ptp_sdr_grandmastercommunicationtechnology,
4047 { "grandmasterCommunicationTechnology", "ptp.sdr.grandmastercommunicationtechnology",
4048 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4049 NULL, HFILL }
4051 { &hf_ptp_sdr_grandmasterclockuuid,
4052 { "grandMasterClockUuid", "ptp.sdr.grandmasterclockuuid",
4053 FT_ETHER, BASE_NONE, NULL, 0x00,
4054 NULL, HFILL }
4056 { &hf_ptp_sdr_grandmasterportid,
4057 { "grandmasterPortId", "ptp.sdr.grandmasterportid",
4058 FT_UINT16, BASE_DEC, NULL, 0x00,
4059 NULL, HFILL }
4061 { &hf_ptp_sdr_grandmastersequenceid,
4062 { "grandmasterSequenceId", "ptp.sdr.grandmastersequenceid",
4063 FT_UINT16, BASE_DEC, NULL, 0x00,
4064 NULL, HFILL }
4066 { &hf_ptp_sdr_grandmasterclockstratum,
4067 { "grandmasterClockStratum", "ptp.sdr.grandmasterclockstratum",
4068 FT_UINT8, BASE_DEC, NULL, 0x00,
4069 NULL, HFILL }
4071 { &hf_ptp_sdr_grandmasterclockidentifier,
4072 { "grandmasterClockIdentifier", "ptp.sdr.grandmasterclockidentifier",
4073 FT_STRING, BASE_NONE, NULL, 0x00,
4074 NULL, HFILL }
4076 { &hf_ptp_sdr_grandmasterclockvariance,
4077 { "grandmasterClockVariance", "ptp.sdr.grandmasterclockvariance",
4078 FT_INT16, BASE_DEC, NULL, 0x00,
4079 NULL, HFILL }
4081 { &hf_ptp_sdr_grandmasterpreferred,
4082 { "grandmasterPreferred", "ptp.sdr.grandmasterpreferred",
4083 FT_UINT8, BASE_DEC, NULL, 0x00,
4084 NULL, HFILL }
4086 { &hf_ptp_sdr_grandmasterisboundaryclock,
4087 { "grandmasterIsBoundaryClock", "ptp.sdr.grandmasterisboundaryclock",
4088 FT_UINT8, BASE_DEC, NULL, 0x00,
4089 NULL, HFILL }
4091 { &hf_ptp_sdr_syncinterval,
4092 { "syncInterval", "ptp.sdr.syncinterval",
4093 FT_INT8, BASE_DEC, NULL, 0x00,
4094 NULL, HFILL }
4096 { &hf_ptp_sdr_localclockvariance,
4097 { "localClockVariance", "ptp.sdr.localclockvariance",
4098 FT_INT16, BASE_DEC, NULL, 0x00,
4099 NULL, HFILL }
4101 { &hf_ptp_sdr_localstepsremoved,
4102 { "localStepsRemoved", "ptp.sdr.localstepsremoved",
4103 FT_UINT16, BASE_DEC, NULL, 0x00,
4104 NULL, HFILL }
4106 { &hf_ptp_sdr_localclockstratum,
4107 { "localClockStratum", "ptp.sdr.localclockstratum",
4108 FT_UINT8, BASE_DEC, NULL, 0x00,
4109 NULL, HFILL }
4111 { &hf_ptp_sdr_localclockidentifier,
4112 { "localClockIdentifier", "ptp.sdr.localclockidentifier",
4113 FT_STRING, BASE_NONE, NULL, 0x00,
4114 NULL, HFILL }
4116 { &hf_ptp_sdr_parentcommunicationtechnology,
4117 { "parentCommunicationTechnology", "ptp.sdr.parentcommunicationtechnology",
4118 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4119 NULL, HFILL }
4121 { &hf_ptp_sdr_parentuuid,
4122 { "parentUuid", "ptp.sdr.parentuuid",
4123 FT_ETHER, BASE_NONE, NULL, 0x00,
4124 NULL, HFILL }
4126 { &hf_ptp_sdr_parentportfield,
4127 { "parentPortField", "ptp.sdr.parentportfield",
4128 FT_UINT16, BASE_DEC, NULL, 0x00,
4129 NULL, HFILL }
4131 { &hf_ptp_sdr_estimatedmastervariance,
4132 { "estimatedMasterVariance", "ptp.sdr.estimatedmastervariance",
4133 FT_INT16, BASE_DEC, NULL, 0x00,
4134 NULL, HFILL }
4136 { &hf_ptp_sdr_estimatedmasterdrift,
4137 { "estimatedMasterDrift", "ptp.sdr.estimatedmasterdrift",
4138 FT_INT32, BASE_DEC, NULL, 0x00,
4139 NULL, HFILL }
4141 { &hf_ptp_sdr_utcreasonable,
4142 { "utcReasonable", "ptp.sdr.utcreasonable",
4143 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4144 NULL, HFILL }
4146 /*offsets for follow_up (=fu) messages*/
4147 { &hf_ptp_fu_associatedsequenceid,
4148 { "associatedSequenceId", "ptp.fu.associatedsequenceid",
4149 FT_UINT16, BASE_DEC, NULL, 0x00,
4150 NULL, HFILL }
4152 { &hf_ptp_fu_preciseorigintimestamp,
4153 { "preciseOriginTimestamp", "ptp.fu.preciseorigintimestamp",
4154 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4155 NULL, HFILL }
4157 { &hf_ptp_fu_preciseorigintimestamp_seconds,
4158 { "preciseOriginTimestamp (seconds)", "ptp.fu.preciseorigintimestamp_seconds",
4159 FT_UINT32, BASE_DEC, NULL, 0x00,
4160 NULL, HFILL }
4162 { &hf_ptp_fu_preciseorigintimestamp_nanoseconds,
4163 { "preciseOriginTimestamp (nanoseconds)", "ptp.fu.preciseorigintimestamp_nanoseconds",
4164 FT_INT32, BASE_DEC, NULL, 0x00,
4165 NULL, HFILL }
4167 /*offsets for delay_resp (=dr) messages*/
4168 { &hf_ptp_dr_delayreceipttimestamp,
4169 { "delayReceiptTimestamp", "ptp.dr.delayreceipttimestamp",
4170 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4171 NULL, HFILL }
4173 { &hf_ptp_dr_delayreceipttimestamp_seconds,
4174 { "delayReceiptTimestamp (Seconds)", "ptp.dr.delayreceipttimestamp_seconds",
4175 FT_UINT32, BASE_DEC, NULL, 0x00,
4176 NULL, HFILL }
4178 { &hf_ptp_dr_delayreceipttimestamp_nanoseconds,
4179 { "delayReceiptTimestamp (nanoseconds)", "ptp.dr.delayreceipttimestamp_nanoseconds",
4180 FT_INT32, BASE_DEC, NULL, 0x00,
4181 NULL, HFILL }
4183 { &hf_ptp_dr_requestingsourcecommunicationtechnology,
4184 { "requestingSourceCommunicationTechnology", "ptp.dr.requestingsourcecommunicationtechnology",
4185 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4186 NULL, HFILL }
4188 { &hf_ptp_dr_requestingsourceuuid,
4189 { "requestingSourceUuid", "ptp.dr.requestingsourceuuid",
4190 FT_ETHER, BASE_NONE, NULL, 0x00,
4191 NULL, HFILL }
4193 { &hf_ptp_dr_requestingsourceportid,
4194 { "requestingSourcePortId", "ptp.dr.requestingsourceportid",
4195 FT_UINT16, BASE_DEC, NULL, 0x00,
4196 NULL, HFILL }
4198 { &hf_ptp_dr_requestingsourcesequenceid,
4199 { "requestingSourceSequenceId", "ptp.dr.requestingsourcesequenceid",
4200 FT_UINT16, BASE_DEC, NULL, 0x00,
4201 NULL, HFILL }
4203 /*offsets for management (=mm) messages*/
4204 { &hf_ptp_mm_targetcommunicationtechnology,
4205 { "targetCommunicationTechnology", "ptp.mm.targetcommunicationtechnology",
4206 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4207 NULL, HFILL }
4209 { &hf_ptp_mm_targetuuid,
4210 { "targetUuid", "ptp.mm.targetuuid",
4211 FT_ETHER, BASE_NONE, NULL, 0x00,
4212 NULL, HFILL }
4214 { &hf_ptp_mm_targetportid,
4215 { "targetPortId", "ptp.mm.targetportid",
4216 FT_UINT16, BASE_DEC, NULL, 0x00,
4217 NULL, HFILL }
4219 { &hf_ptp_mm_startingboundaryhops,
4220 { "startingBoundaryHops", "ptp.mm.startingboundaryhops",
4221 FT_INT16, BASE_DEC, NULL, 0x00,
4222 NULL, HFILL }
4224 { &hf_ptp_mm_boundaryhops,
4225 { "boundaryHops", "ptp.mm.boundaryhops",
4226 FT_INT16, BASE_DEC, NULL, 0x00,
4227 NULL, HFILL }
4229 { &hf_ptp_mm_managementmessagekey,
4230 { "managementMessageKey", "ptp.mm.managementmessagekey",
4231 FT_UINT8, BASE_DEC, VALS(ptp_managementMessageKey_vals), 0x00,
4232 NULL, HFILL }
4234 { &hf_ptp_mm_parameterlength,
4235 { "parameterLength", "ptp.mm.parameterlength",
4236 FT_UINT16, BASE_DEC, NULL, 0x00,
4237 NULL, HFILL }
4239 /*parameterlength > 0*/
4240 #if 0
4241 { &hf_ptp_mm_messageparameters,
4242 { "messageParameters", "ptp.mm.messageparameters",
4243 FT_BYTES, BASE_NONE, NULL, 0x00,
4244 NULL, HFILL }
4246 #endif
4247 /*ptp_mm_clock_identity (parameterlength = 64)*/
4248 { &hf_ptp_mm_clock_identity_clockcommunicationtechnology,
4249 { "clockCommunicationTechnology", "ptp.mm.clock.identity.clockcommunicationtechnology",
4250 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4251 NULL, HFILL }
4253 { &hf_ptp_mm_clock_identity_clockuuidfield,
4254 { "clockUuidField", "ptp.mm.clock.identity.clockuuidfield",
4255 FT_ETHER, BASE_NONE, NULL, 0x00,
4256 NULL, HFILL }
4258 { &hf_ptp_mm_clock_identity_clockportfield,
4259 { "clockPortField", "ptp.mm.clock.identity.clockportfield",
4260 FT_UINT16, BASE_DEC, NULL, 0x00,
4261 NULL, HFILL }
4263 { &hf_ptp_mm_clock_identity_manufactureridentity,
4264 { "manufacturerIdentity", "ptp.mm.clock.identity.manufactureridentity",
4265 FT_BYTES, BASE_NONE, NULL, 0x00,
4266 NULL, HFILL }
4269 /*ptp_mm_initialize_clock (parameterlength = 4)*/
4270 { &hf_ptp_mm_initialize_clock_initialisationkey,
4271 { "initialisationKey", "ptp.mm.initialize.clock.initialisationkey",
4272 FT_UINT16, BASE_DEC, NULL, 0x00,
4273 NULL, HFILL }
4275 /*ptp_mm_set_subdomain (parameterlength = 16)*/
4276 { &hf_ptp_mm_set_subdomain_subdomainname,
4277 { "subdomainName", "ptp.mm.set.subdomain.subdomainname",
4278 FT_STRING, BASE_NONE, NULL, 0x00,
4279 NULL, HFILL }
4281 /*ptp_mm_default_data_set (parameterlength = 76)*/
4282 { &hf_ptp_mm_default_data_set_clockcommunicationtechnology,
4283 { "clockCommunicationTechnology", "ptp.mm.default.data.set.clockcommunicationtechnology",
4284 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4285 NULL, HFILL }
4287 { &hf_ptp_mm_default_data_set_clockuuidfield,
4288 { "clockUuidField", "ptp.mm.default.data.set.clockuuidfield",
4289 FT_ETHER, BASE_NONE, NULL, 0x00,
4290 NULL, HFILL }
4292 { &hf_ptp_mm_default_data_set_clockportfield,
4293 { "clockPortField", "ptp.mm.default.data.set.clockportfield",
4294 FT_UINT16, BASE_DEC, NULL, 0x00,
4295 NULL, HFILL }
4297 { &hf_ptp_mm_default_data_set_clockstratum,
4298 { "clockStratum", "ptp.mm.default.data.set.clockstratum",
4299 FT_UINT8, BASE_DEC, NULL, 0x00,
4300 NULL, HFILL }
4302 { &hf_ptp_mm_default_data_set_clockidentifier,
4303 { "clockIdentifier", "ptp.mm.default.data.set.clockidentifier",
4304 FT_BYTES, BASE_NONE, NULL, 0x00,
4305 NULL, HFILL }
4307 { &hf_ptp_mm_default_data_set_clockvariance,
4308 { "clockVariance", "ptp.mm.default.data.set.clockvariance",
4309 FT_UINT16, BASE_DEC, NULL, 0x00,
4310 NULL, HFILL }
4312 { &hf_ptp_mm_default_data_set_clockfollowupcapable,
4313 { "clockFollowupCapable", "ptp.mm.default.data.set.clockfollowupcapable",
4314 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4315 NULL, HFILL }
4317 { &hf_ptp_mm_default_data_set_preferred,
4318 { "preferred", "ptp.mm.default.data.set.preferred",
4319 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4320 NULL, HFILL }
4322 { &hf_ptp_mm_default_data_set_initializable,
4323 { "initializable", "ptp.mm.default.data.set.initializable",
4324 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4325 NULL, HFILL }
4327 { &hf_ptp_mm_default_data_set_externaltiming,
4328 { "externalTiming", "ptp.mm.default.data.set.externaltiming",
4329 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4330 NULL, HFILL }
4332 { &hf_ptp_mm_default_data_set_isboundaryclock,
4333 { "isBoundaryClock", "ptp.mm.default.data.set.isboundaryclock",
4334 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4335 NULL, HFILL }
4337 { &hf_ptp_mm_default_data_set_syncinterval,
4338 { "syncInterval", "ptp.mm.default.data.set.syncinterval",
4339 FT_INT8, BASE_DEC, NULL, 0x00,
4340 NULL, HFILL }
4342 { &hf_ptp_mm_default_data_set_subdomainname,
4343 { "subDomainName", "ptp.mm.default.data.set.subdomainname",
4344 FT_STRING, BASE_NONE, NULL, 0x00,
4345 NULL, HFILL }
4347 { &hf_ptp_mm_default_data_set_numberports,
4348 { "numberPorts", "ptp.mm.default.data.set.numberports",
4349 FT_UINT16, BASE_DEC, NULL, 0x00,
4350 NULL, HFILL }
4352 { &hf_ptp_mm_default_data_set_numberforeignrecords,
4353 { "numberForeignRecords", "ptp.mm.default.data.set.numberforeignrecords",
4354 FT_UINT16, BASE_DEC, NULL, 0x00,
4355 NULL, HFILL }
4357 /*ptp_mm_update_default_data_set (parameterlength = 36)*/
4358 { &hf_ptp_mm_update_default_data_set_clockstratum,
4359 { "clockStratum", "ptp.mm.update.default.data.set.clockstratum",
4360 FT_UINT8, BASE_DEC, NULL, 0x00,
4361 NULL, HFILL }
4363 { &hf_ptp_mm_update_default_data_set_clockidentifier,
4364 { "clockIdentifier", "ptp.mm.update.default.data.set.clockidentifier",
4365 FT_BYTES, BASE_NONE, NULL, 0x00,
4366 NULL, HFILL }
4368 { &hf_ptp_mm_update_default_data_set_clockvariance,
4369 { "clockVariance", "ptp.mm.update.default.data.set.clockvariance",
4370 FT_UINT16, BASE_DEC, NULL, 0x00,
4371 NULL, HFILL }
4373 { &hf_ptp_mm_update_default_data_set_preferred,
4374 { "preferred", "ptp.mm.update.default.data.set.preferred",
4375 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4376 NULL, HFILL }
4378 { &hf_ptp_mm_update_default_data_set_syncinterval,
4379 { "syncInterval", "ptp.mm.update.default.data.set.syncinterval",
4380 FT_INT8, BASE_DEC, NULL, 0x00,
4381 NULL, HFILL }
4383 { &hf_ptp_mm_update_default_data_set_subdomainname,
4384 { "subdomainName", "ptp.mm.update.default.data.set.subdomainname",
4385 FT_STRING, BASE_NONE, NULL, 0x00,
4386 NULL, HFILL }
4388 /*ptp_mm_current_data_set (parameterlength = 20)*/
4389 { &hf_ptp_mm_current_data_set_stepsremoved,
4390 { "stepsRemoved", "ptp.mm.current.data.set.stepsremoved",
4391 FT_UINT16, BASE_DEC, NULL, 0x00,
4392 NULL, HFILL }
4394 { &hf_ptp_mm_current_data_set_offsetfrommaster,
4395 { "offsetFromMaster", "ptp.mm.current.data.set.offsetfrommaster",
4396 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4397 NULL, HFILL }
4399 { &hf_ptp_mm_current_data_set_offsetfrommasterseconds,
4400 { "offsetFromMasterSeconds", "ptp.mm.current.data.set.offsetfrommasterseconds",
4401 FT_UINT32, BASE_DEC, NULL, 0x00,
4402 NULL, HFILL }
4404 { &hf_ptp_mm_current_data_set_offsetfrommasternanoseconds,
4405 { "offsetFromMasterNanoseconds", "ptp.mm.current.data.set.offsetfrommasternanoseconds",
4406 FT_INT32, BASE_DEC, NULL, 0x00,
4407 NULL, HFILL }
4409 { &hf_ptp_mm_current_data_set_onewaydelay,
4410 { "oneWayDelay", "ptp.mm.current.data.set.onewaydelay",
4411 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4412 NULL, HFILL }
4414 { &hf_ptp_mm_current_data_set_onewaydelayseconds,
4415 { "oneWayDelaySeconds", "ptp.mm.current.data.set.onewaydelayseconds",
4416 FT_UINT32, BASE_DEC, NULL, 0x00,
4417 NULL, HFILL }
4419 { &hf_ptp_mm_current_data_set_onewaydelaynanoseconds,
4420 { "oneWayDelayNanoseconds", "ptp.mm.current.data.set.onewaydelaynanoseconds",
4421 FT_INT32, BASE_DEC, NULL, 0x00,
4422 NULL, HFILL }
4424 /*ptp_mm_parent_data_set (parameterlength = 90)*/
4425 { &hf_ptp_mm_parent_data_set_parentcommunicationtechnology,
4426 { "parentCommunicationTechnology", "ptp.mm.parent.data.set.parentcommunicationtechnology",
4427 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4428 NULL, HFILL }
4430 { &hf_ptp_mm_parent_data_set_parentuuid,
4431 { "parentUuid", "ptp.mm.parent.data.set.parentuuid",
4432 FT_ETHER, BASE_NONE, NULL, 0x00,
4433 NULL, HFILL }
4435 { &hf_ptp_mm_parent_data_set_parentportid,
4436 { "parentPortId", "ptp.mm.parent.data.set.parentportid",
4437 FT_UINT16, BASE_DEC, NULL, 0x00,
4438 NULL, HFILL }
4440 { &hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber,
4441 { "parentLastSyncSequenceNumber", "ptp.mm.parent.data.set.parentlastsyncsequencenumber",
4442 FT_UINT16, BASE_DEC, NULL, 0x00,
4443 NULL, HFILL }
4445 { &hf_ptp_mm_parent_data_set_parentfollowupcapable,
4446 { "parentFollowupCapable", "ptp.mm.parent.data.set.parentfollowupcapable",
4447 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4448 NULL, HFILL }
4450 { &hf_ptp_mm_parent_data_set_parentexternaltiming,
4451 { "parentExternalTiming", "ptp.mm.parent.data.set.parentexternaltiming",
4452 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4453 NULL, HFILL }
4455 { &hf_ptp_mm_parent_data_set_parentvariance,
4456 { "parentVariance", "ptp.mm.parent.data.set.parentvariance",
4457 FT_UINT16, BASE_DEC, NULL, 0x00,
4458 NULL, HFILL }
4460 { &hf_ptp_mm_parent_data_set_parentstats,
4461 { "parentStats", "ptp.mm.parent.data.set.parentstats",
4462 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4463 NULL, HFILL }
4465 { &hf_ptp_mm_parent_data_set_observedvariance,
4466 { "observedVariance", "ptp.mm.parent.data.set.observedvariance",
4467 FT_INT16, BASE_DEC, NULL, 0x00,
4468 NULL, HFILL }
4470 { &hf_ptp_mm_parent_data_set_observeddrift,
4471 { "observedDrift", "ptp.mm.parent.data.set.observeddrift",
4472 FT_INT32, BASE_DEC, NULL, 0x00,
4473 NULL, HFILL }
4475 { &hf_ptp_mm_parent_data_set_utcreasonable,
4476 { "utcReasonable", "ptp.mm.parent.data.set.utcreasonable",
4477 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4478 NULL, HFILL }
4480 { &hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology,
4481 { "grandmasterCommunicationTechnology", "ptp.mm.parent.data.set.grandmastercommunicationtechnology",
4482 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4483 NULL, HFILL }
4485 { &hf_ptp_mm_parent_data_set_grandmasteruuidfield,
4486 { "grandmasterUuidField", "ptp.mm.parent.data.set.grandmasteruuidfield",
4487 FT_ETHER, BASE_NONE, NULL, 0x00,
4488 NULL, HFILL }
4490 { &hf_ptp_mm_parent_data_set_grandmasterportidfield,
4491 { "grandmasterPortIdField", "ptp.mm.parent.data.set.grandmasterportidfield",
4492 FT_UINT16, BASE_DEC, NULL, 0x00,
4493 NULL, HFILL }
4495 { &hf_ptp_mm_parent_data_set_grandmasterstratum,
4496 { "grandmasterStratum", "ptp.mm.parent.data.set.grandmasterstratum",
4497 FT_UINT8, BASE_DEC, NULL, 0x00,
4498 NULL, HFILL }
4500 { &hf_ptp_mm_parent_data_set_grandmasteridentifier,
4501 { "grandmasterIdentifier", "ptp.mm.parent.data.set.grandmasteridentifier",
4502 FT_BYTES, BASE_NONE, NULL, 0x00,
4503 NULL, HFILL }
4505 { &hf_ptp_mm_parent_data_set_grandmastervariance,
4506 { "grandmasterVariance", "ptp.mm.parent.data.set.grandmastervariance",
4507 FT_INT16, BASE_DEC, NULL, 0x00,
4508 NULL, HFILL }
4510 { &hf_ptp_mm_parent_data_set_grandmasterpreferred,
4511 { "grandmasterPreferred", "ptp.mm.parent.data.set.grandmasterpreferred",
4512 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4513 NULL, HFILL }
4515 { &hf_ptp_mm_parent_data_set_grandmasterisboundaryclock,
4516 { "grandmasterIsBoundaryClock", "ptp.mm.parent.data.set.grandmasterisboundaryclock",
4517 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4518 NULL, HFILL }
4520 { &hf_ptp_mm_parent_data_set_grandmastersequencenumber,
4521 { "grandmasterSequenceNumber", "ptp.mm.parent.data.set.grandmastersequencenumber",
4522 FT_UINT16, BASE_DEC, NULL, 0x00,
4523 NULL, HFILL }
4525 /*ptp_mm_port_data_set (parameterlength = 52)*/
4526 { &hf_ptp_mm_port_data_set_returnedportnumber,
4527 { "returnedPortNumber", "ptp.mm.port.data.set.returnedportnumber",
4528 FT_UINT16, BASE_DEC, NULL, 0x00,
4529 NULL, HFILL }
4531 { &hf_ptp_mm_port_data_set_portstate,
4532 { "portState", "ptp.mm.port.data.set.portstate",
4533 FT_UINT8, BASE_DEC, NULL, 0x00,
4534 NULL, HFILL }
4536 { &hf_ptp_mm_port_data_set_lastsynceventsequencenumber,
4537 { "lastSyncEventSequenceNumber", "ptp.mm.port.data.set.lastsynceventsequencenumber",
4538 FT_UINT16, BASE_DEC, NULL, 0x00,
4539 NULL, HFILL }
4541 { &hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber,
4542 { "lastGeneralEventSequenceNumber", "ptp.mm.port.data.set.lastgeneraleventsequencenumber",
4543 FT_UINT16, BASE_DEC, NULL, 0x00,
4544 NULL, HFILL }
4546 { &hf_ptp_mm_port_data_set_portcommunicationtechnology,
4547 { "portCommunicationTechnology", "ptp.mm.port.data.set.portcommunicationtechnology",
4548 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4549 NULL, HFILL }
4551 { &hf_ptp_mm_port_data_set_portuuidfield,
4552 { "portUuidField", "ptp.mm.port.data.set.portuuidfield",
4553 FT_ETHER, BASE_NONE, NULL, 0x00,
4554 NULL, HFILL }
4556 { &hf_ptp_mm_port_data_set_portidfield,
4557 { "portIdField", "ptp.mm.port.data.set.portidfield",
4558 FT_UINT16, BASE_DEC, NULL, 0x00,
4559 NULL, HFILL }
4561 { &hf_ptp_mm_port_data_set_burstenabled,
4562 { "burstEnabled", "ptp.mm.port.data.set.burstenabled",
4563 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4564 NULL, HFILL }
4566 { &hf_ptp_mm_port_data_set_subdomainaddressoctets,
4567 { "subdomainAddressOctets", "ptp.mm.port.data.set.subdomainaddressoctets",
4568 FT_UINT8, BASE_DEC, NULL, 0x00,
4569 NULL, HFILL }
4571 { &hf_ptp_mm_port_data_set_eventportaddressoctets,
4572 { "eventPortAddressOctets", "ptp.mm.port.data.set.eventportaddressoctets",
4573 FT_UINT8, BASE_DEC, NULL, 0x00,
4574 NULL, HFILL }
4576 { &hf_ptp_mm_port_data_set_generalportaddressoctets,
4577 { "generalPortAddressOctets", "ptp.mm.port.data.set.generalportaddressoctets",
4578 FT_UINT8, BASE_DEC, NULL, 0x00,
4579 NULL, HFILL }
4581 { &hf_ptp_mm_port_data_set_subdomainaddress,
4582 { "subdomainAddress", "ptp.mm.port.data.set.subdomainaddress",
4583 FT_BYTES, BASE_NONE, NULL, 0x00,
4584 NULL, HFILL }
4586 { &hf_ptp_mm_port_data_set_eventportaddress,
4587 { "eventPortAddress", "ptp.mm.port.data.set.eventportaddress",
4588 FT_BYTES, BASE_NONE, NULL, 0x00,
4589 NULL, HFILL }
4591 { &hf_ptp_mm_port_data_set_generalportaddress,
4592 { "generalPortAddress", "ptp.mm.port.data.set.generalportaddress",
4593 FT_BYTES, BASE_NONE, NULL, 0x00,
4594 NULL, HFILL }
4596 /*ptp_mm_global_time_data_set (parameterlength = 24)*/
4597 { &hf_ptp_mm_global_time_data_set_localtime,
4598 { "localTime", "ptp.mm.global.time.data.set.localtime",
4599 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4600 NULL, HFILL }
4602 { &hf_ptp_mm_global_time_data_set_localtimeseconds,
4603 { "localTimeSeconds", "ptp.mm.global.time.data.set.localtimeseconds",
4604 FT_UINT32, BASE_DEC, NULL, 0x00,
4605 NULL, HFILL }
4607 { &hf_ptp_mm_global_time_data_set_localtimenanoseconds,
4608 { "localTimeNanoseconds", "ptp.mm.global.time.data.set.localtimenanoseconds",
4609 FT_INT32, BASE_DEC, NULL, 0x00,
4610 NULL, HFILL }
4612 { &hf_ptp_mm_global_time_data_set_currentutcoffset,
4613 { "currentUtcOffset", "ptp.mm.global.time.data.set.currentutcoffset",
4614 FT_INT16, BASE_DEC, NULL, 0x00,
4615 NULL, HFILL }
4617 { &hf_ptp_mm_global_time_data_set_leap59,
4618 { "leap59", "ptp.mm.global.time.data.set.leap59",
4619 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4620 NULL, HFILL }
4622 { &hf_ptp_mm_global_time_data_set_leap61,
4623 { "leap61", "ptp.mm.global.time.data.set.leap61",
4624 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4625 NULL, HFILL }
4627 { &hf_ptp_mm_global_time_data_set_epochnumber,
4628 { "epochNumber", "ptp.mm.global.time.data.set.epochnumber",
4629 FT_UINT16, BASE_DEC, NULL, 0x00,
4630 NULL, HFILL }
4632 /*ptp_mm_update_global_time_properties (parameterlength = 16)*/
4633 { &hf_ptp_mm_update_global_time_properties_currentutcoffset,
4634 { "currentUtcOffset", "ptp.mm.update.global.time.properties.currentutcoffset",
4635 FT_UINT16, BASE_DEC, NULL, 0x00,
4636 NULL, HFILL }
4638 { &hf_ptp_mm_update_global_time_properties_leap59,
4639 { "leap59", "ptp.mm.update.global.time.properties.leap59",
4640 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4641 NULL, HFILL }
4643 { &hf_ptp_mm_update_global_time_properties_leap61,
4644 { "leap61", "ptp.mm.update.global.time.properties.leap61",
4645 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4646 NULL, HFILL }
4648 #if 0
4649 { &hf_ptp_mm_update_global_time_properties_epochnumber,
4650 { "epochNumber", "ptp.mm.update.global.time.properties.epochnumber",
4651 FT_UINT16, BASE_DEC, NULL, 0x00,
4652 NULL, HFILL }
4654 #endif
4655 /*ptp_mm_get_foreign_data_set (parameterlength = 4)*/
4656 { &hf_ptp_mm_get_foreign_data_set_recordkey,
4657 { "recordKey", "ptp.mm.get.foreign.data.set.recordkey",
4658 FT_UINT16, BASE_DEC, NULL, 0x00,
4659 NULL, HFILL }
4661 /*ptp_mm_foreign_data_set (parameterlength = 28)*/
4662 { &hf_ptp_mm_foreign_data_set_returnedportnumber,
4663 { "returnedPortNumber", "ptp.mm.foreign.data.set.returnedportnumber",
4664 FT_UINT16, BASE_DEC, NULL, 0x00,
4665 NULL, HFILL }
4667 { &hf_ptp_mm_foreign_data_set_returnedrecordnumber,
4668 { "returnedRecordNumber", "ptp.mm.foreign.data.set.returnedrecordnumber",
4669 FT_UINT16, BASE_DEC, NULL, 0x00,
4670 NULL, HFILL }
4672 { &hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology,
4673 { "foreignMasterCommunicationTechnology",
4674 "ptp.mm.foreign.data.set.foreignmastercommunicationtechnology",
4675 FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
4676 NULL, HFILL }
4678 { &hf_ptp_mm_foreign_data_set_foreignmasteruuidfield,
4679 { "foreignMasterUuidField", "ptp.mm.foreign.data.set.foreignmasteruuidfield",
4680 FT_ETHER, BASE_NONE, NULL, 0x00,
4681 NULL, HFILL }
4683 { &hf_ptp_mm_foreign_data_set_foreignmasterportidfield,
4684 { "foreignMasterPortIdField", "ptp.mm.foreign.data.set.foreignmasterportidfield",
4685 FT_UINT16, BASE_DEC, NULL, 0x00,
4686 NULL, HFILL }
4688 { &hf_ptp_mm_foreign_data_set_foreignmastersyncs,
4689 { "foreignMasterSyncs", "ptp.mm.foreign.data.set.foreignmastersyncs",
4690 FT_UINT16, BASE_DEC, NULL, 0x00,
4691 NULL, HFILL }
4693 /*ptp_mm_set_sync_interval (parameterlength = 4)*/
4694 { &hf_ptp_mm_set_sync_interval_syncinterval,
4695 { "syncInterval", "ptp.mm.set.sync.interval.syncinterval",
4696 FT_UINT16, BASE_DEC, NULL, 0x00,
4697 NULL, HFILL }
4699 /*ptp_mm_set_time (parameterlength = 8)*/
4700 { &hf_ptp_mm_set_time_localtime,
4701 { "localtime", "ptp.mm.set.time.localtime",
4702 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4703 NULL, HFILL }
4705 { &hf_ptp_mm_set_time_localtimeseconds,
4706 { "localtimeSeconds", "ptp.mm.set.time.localtimeseconds",
4707 FT_UINT32, BASE_DEC, NULL, 0x00,
4708 NULL, HFILL }
4710 { &hf_ptp_mm_set_time_localtimenanoseconds,
4711 { "localTimeNanoseconds", "ptp.mm.set.time.localtimenanoseconds",
4712 FT_INT32, BASE_DEC, NULL, 0x0,
4713 NULL, HFILL }
4719 /* PTPv2 fields **********************************************************/
4720 /*Common fields for all frames*/
4721 { &hf_ptp_v2_transportspecific,
4722 { "transportSpecific", "ptp.v2.transportspecific",
4723 FT_UINT8, BASE_HEX, NULL, 0xF0,
4724 NULL, HFILL }
4726 { &hf_ptp_v2_transportspecific_v1_compatibility,
4727 { "V1 Compatibility", "ptp.v2.transportspecific.v1compatibility",
4728 FT_BOOLEAN, 8, NULL, PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK,
4729 NULL, HFILL }
4731 { &hf_ptp_v2_transportspecific_802as_conform,
4732 { "802.1as conform", "ptp.v2.transportspecific.802.1asconform",
4733 FT_BOOLEAN, 8, NULL, PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK,
4734 NULL, HFILL }
4736 { &hf_ptp_v2_messageid,
4737 { "messageId", "ptp.v2.messageid",
4738 FT_UINT8, BASE_HEX, VALS(ptp_v2_messageid_vals), 0x0F,
4739 NULL, HFILL }
4741 { &hf_ptp_v2_versionptp,
4742 { "versionPTP", "ptp.v2.versionptp",
4743 FT_UINT8, BASE_DEC, NULL, 0x0F,
4744 NULL, HFILL }
4746 { &hf_ptp_v2_messagelength,
4747 { "messageLength", "ptp.v2.messagelength",
4748 FT_UINT16, BASE_DEC, NULL, 0x00,
4749 NULL, HFILL }
4751 { &hf_ptp_v2_domainnumber,
4752 { "subdomainNumber", "ptp.v2.subdomainnumber",
4753 FT_UINT8, BASE_DEC, NULL, 0x00,
4754 NULL, HFILL }
4756 { &hf_ptp_v2_flags,
4757 { "flags", "ptp.v2.flags",
4758 FT_UINT16, BASE_HEX, NULL, 0x00,
4759 NULL, HFILL }
4761 { &hf_ptp_v2_flags_alternatemaster,
4762 { "PTP_ALTERNATE_MASTER", "ptp.v2.flags.alternatemaster",
4763 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_ALTERNATE_BITMASK,
4764 NULL, HFILL }
4766 { &hf_ptp_v2_flags_twostep,
4767 { "PTP_TWO_STEP", "ptp.v2.flags.twostep",
4768 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_TWO_STEP_BITMASK,
4769 NULL, HFILL }
4771 { &hf_ptp_v2_flags_unicast,
4772 { "PTP_UNICAST", "ptp.v2.flags.unicast",
4773 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_UNICAST_BITMASK,
4774 NULL, HFILL }
4776 { &hf_ptp_v2_flags_specific1,
4777 { "PTP profile Specific 1", "ptp.v2.flags.specific1",
4778 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SPECIFIC1_BITMASK,
4779 NULL, HFILL }
4781 { &hf_ptp_v2_flags_specific2,
4782 { "PTP profile Specific 2", "ptp.v2.flags.specific2",
4783 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SPECIFIC2_BITMASK,
4784 NULL, HFILL }
4786 { &hf_ptp_v2_flags_security,
4787 { "PTP_SECURITY", "ptp.v2.flags.security",
4788 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SECURITY_BITMASK,
4789 NULL, HFILL }
4791 { &hf_ptp_v2_flags_li61,
4792 { "PTP_LI_61", "ptp.v2.flags.li61",
4793 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_LI61_BITMASK,
4794 NULL, HFILL }
4796 { &hf_ptp_v2_flags_li59,
4797 { "PTP_LI_59", "ptp.v2.flags.li59",
4798 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_LI59_BITMASK,
4799 NULL, HFILL }
4801 { &hf_ptp_v2_flags_utcoffsetvalid,
4802 { "PTP_UTC_REASONABLE", "ptp.v2.flags.utcreasonable",
4803 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_UTC_OFFSET_VALID_BITMASK,
4804 NULL, HFILL }
4806 { &hf_ptp_v2_flags_ptptimescale,
4807 { "PTP_TIMESCALE", "ptp.v2.flags.timescale",
4808 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_PTP_TIMESCALE_BITMASK,
4809 NULL, HFILL }
4811 { &hf_ptp_v2_flags_timetraceable,
4812 { "TIME_TRACEABLE", "ptp.v2.flags.timetraceable",
4813 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_TIME_TRACEABLE_BITMASK,
4814 NULL, HFILL }
4816 { &hf_ptp_v2_flags_frequencytraceable,
4817 { "FREQUENCY_TRACEABLE", "ptp.v2.flags.frequencytraceable",
4818 FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK,
4819 NULL, HFILL }
4821 { &hf_ptp_v2_correction,
4822 { "correction", "ptp.v2.correction.ns",
4823 FT_UINT64, BASE_DEC, NULL, 0x00,
4824 NULL, HFILL }
4826 { &hf_ptp_v2_correctionsubns,
4827 { "correctionSubNs", "ptp.v2.correction.subns",
4828 FT_DOUBLE, BASE_NONE, NULL, 0x00,
4829 NULL, HFILL }
4831 { &hf_ptp_v2_clockidentity,
4832 { "ClockIdentity", "ptp.v2.clockidentity",
4833 FT_UINT64, BASE_HEX, NULL, 0x00,
4834 NULL, HFILL }
4836 { &hf_ptp_v2_sourceportid,
4837 { "SourcePortID", "ptp.v2.sourceportid",
4838 FT_UINT16, BASE_DEC, NULL, 0x00,
4839 NULL, HFILL }
4841 { &hf_ptp_v2_sequenceid,
4842 { "sequenceId", "ptp.v2.sequenceid",
4843 FT_UINT16, BASE_DEC, NULL, 0x00,
4844 NULL, HFILL }
4846 { &hf_ptp_v2_control,
4847 { "control", "ptp.v2.control",
4848 FT_UINT8, BASE_DEC, VALS(ptp_control_vals), 0x00,
4849 NULL, HFILL }
4851 { &hf_ptp_v2_logmessageperiod,
4852 { "logMessagePeriod", "ptp.v2.logmessageperiod",
4853 FT_INT8, BASE_DEC, NULL, 0x00,
4854 NULL, HFILL }
4857 /*Fields for PTP_Announce (=an) messages*/
4858 #if 0
4859 { &hf_ptp_v2_an_origintimestamp,
4860 { "originTimestamp", "ptp.v2.an.origintimestamp",
4861 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
4862 NULL, HFILL }
4864 #endif
4865 { &hf_ptp_v2_an_origintimestamp_seconds,
4866 { "originTimestamp (seconds)", "ptp.v2.an.origintimestamp.seconds",
4867 FT_UINT64, BASE_DEC, NULL, 0x00,
4868 NULL, HFILL }
4870 { &hf_ptp_v2_an_origintimestamp_nanoseconds,
4871 { "originTimestamp (nanoseconds)", "ptp.v2.an.origintimestamp.nanoseconds",
4872 FT_INT32, BASE_DEC, NULL, 0x00,
4873 NULL, HFILL }
4875 { &hf_ptp_v2_an_origincurrentutcoffset,
4876 { "originCurrentUTCOffset", "ptp.v2.an.origincurrentutcoffset",
4877 FT_INT16, BASE_DEC, NULL, 0x00,
4878 NULL, HFILL }
4880 { &hf_ptp_v2_an_timesource,
4881 { "TimeSource", "ptp.v2.timesource",
4882 FT_UINT8, BASE_HEX, VALS(ptp_v2_timesource_vals), 0x00,
4883 NULL, HFILL }
4885 { &hf_ptp_v2_an_localstepsremoved,
4886 { "localStepsRemoved", "ptp.v2.an.localstepsremoved",
4887 FT_UINT16, BASE_DEC, NULL, 0x00,
4888 NULL, HFILL }
4890 { &hf_ptp_v2_an_grandmasterclockidentity,
4891 { "grandmasterClockIdentity", "ptp.v2.an.grandmasterclockidentity",
4892 FT_UINT64, BASE_HEX, NULL, 0x00,
4893 NULL, HFILL }
4895 { &hf_ptp_v2_an_grandmasterclockclass,
4896 { "grandmasterClockClass", "ptp.v2.an.grandmasterclockclass",
4897 FT_UINT8, BASE_DEC, NULL, 0x00,
4898 NULL, HFILL }
4900 { &hf_ptp_v2_an_grandmasterclockaccuracy,
4901 { "grandmasterClockAccuracy", "ptp.v2.an.grandmasterclockaccuracy",
4902 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
4903 NULL, HFILL }
4905 { &hf_ptp_v2_an_grandmasterclockvariance,
4906 { "grandmasterClockVariance", "ptp.v2.an.grandmasterclockvariance",
4907 FT_UINT16, BASE_DEC, NULL, 0x00,
4908 NULL, HFILL }
4910 { &hf_ptp_v2_an_priority1,
4911 { "priority1", "ptp.v2.an.priority1",
4912 FT_UINT8, BASE_DEC, NULL, 0x00,
4913 NULL, HFILL }
4915 { &hf_ptp_v2_an_priority2,
4916 { "priority2", "ptp.v2.an.priority2",
4917 FT_UINT8, BASE_DEC, NULL, 0x00,
4918 NULL, HFILL }
4921 /*Fields for PTP_Announce TLVs */
4922 { &hf_ptp_v2_an_tlv_tlvtype,
4923 { "tlvType", "ptp.v2.an.tlvType",
4924 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
4925 NULL, HFILL }
4927 { &hf_ptp_v2_an_tlv_lengthfield,
4928 { "lengthField", "ptp.v2.an.lengthField",
4929 FT_UINT16, BASE_DEC, NULL, 0x00,
4930 NULL, HFILL }
4932 /*Fields for ORGANIZATION_EXTENSION TLV */
4933 { &hf_ptp_v2_oe_tlv_organizationid,
4934 { "organizationId", "ptp.v2.an.oe.organizationId",
4935 FT_UINT24, BASE_HEX, VALS(ptp2_organizationExtensionOrgId_vals), 0x00,
4936 NULL, HFILL }
4938 { &hf_ptp_v2_oe_tlv_organizationsubtype,
4939 { "organizationSubType", "ptp.v2.an.oe.organizationSubType",
4940 FT_UINT24, BASE_HEX, VALS(ptp2_org_iee_c37_238_subtype_vals), 0x00,
4941 NULL, HFILL }
4943 { &hf_ptp_v2_oe_tlv_datafield,
4944 { "dataField", "ptp.v2.an.oe.dataField",
4945 FT_BYTES, BASE_NONE, NULL, 0x00,
4946 NULL, HFILL }
4948 /*Fields for IEEE_C37_238 TLV (OE TLV subtype) */
4949 { &hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmasterid,
4950 { "grandmasterID", "ptp.v2.an.oe.grandmasterID",
4951 FT_UINT16, BASE_DEC, NULL, 0x00,
4952 NULL, HFILL }
4954 { &hf_ptp_v2_oe_tlv_subtype_c37238tlv_grandmastertimeinaccuracy,
4955 { "grandmasterTimeInaccuracy (nanoseconds)", "ptp.v2.an.oe.grandmasterTimeInaccuracy",
4956 FT_UINT32, BASE_DEC, NULL, 0x00,
4957 NULL, HFILL }
4959 { &hf_ptp_v2_oe_tlv_subtype_c37238tlv_networktimeinaccuracy,
4960 { "networkTimeInaccuracy (nanoseconds)", "ptp.v2.an.oe.networkTimeInaccuracy",
4961 FT_UINT32, BASE_DEC, NULL, 0x00,
4962 NULL, HFILL }
4964 { &hf_ptp_v2_oe_tlv_subtype_c37238tlv_reserved,
4965 { "reserved", "ptp.v2.an.oe.reserved",
4966 FT_UINT16, BASE_HEX, NULL, 0x00,
4967 NULL, HFILL }
4969 /*Fields for ALTERNATE_TIME_OFFSET_INDICATOR TLV */
4970 { &hf_ptp_v2_atoi_tlv_keyfield,
4971 { "keyField", "ptp.v2.an.atoi.keyField",
4972 FT_UINT8, BASE_DEC, NULL, 0x00,
4973 NULL, HFILL }
4975 { &hf_ptp_v2_atoi_tlv_currentoffset,
4976 { "currentOffset", "ptp.v2.an.atoi.currentOffset",
4977 FT_INT32, BASE_DEC, NULL, 0x00,
4978 NULL, HFILL }
4980 { &hf_ptp_v2_atoi_tlv_jumpseconds,
4981 { "jumpSeconds", "ptp.v2.an.atoi.jumpSeconds",
4982 FT_INT32, BASE_DEC, NULL, 0x00,
4983 NULL, HFILL }
4985 { &hf_ptp_v2_atoi_tlv_timeofnextjump,
4986 { "timeOfNextJump", "ptp.v2.an.atoi.timeOfNextJump",
4987 FT_BYTES, BASE_NONE, NULL, 0x00,
4988 NULL, HFILL }
4990 { &hf_ptp_v2_atoi_tlv_displayname,
4991 { "displayName", "ptp.v2.an.atoi.dislpayName",
4992 FT_STRING, BASE_NONE, NULL, 0x00,
4993 NULL, HFILL }
4995 { &hf_ptp_v2_atoi_tlv_displayname_length,
4996 { "length", "ptp.v2.an.atoi.dislpayName.length",
4997 FT_UINT8, BASE_DEC, NULL, 0x00,
4998 NULL, HFILL }
5000 /* Field for Path Trace TLV */
5001 { &hf_ptp_v2_an_tlv_pathsequence,
5002 { "PathSequence", "ptp.v2.an.pathsequence",
5003 FT_UINT64, BASE_HEX, NULL, 0x00,
5004 NULL, HFILL }
5007 /* Fields for undissected TLV */
5008 { &hf_ptp_v2_an_tlv_data,
5009 { "data", "ptp.v2.an.tlv.data",
5010 FT_BYTES, BASE_NONE, NULL, 0x00,
5011 NULL, HFILL }
5014 /*Fields for PTP_Sync AND PTP_DelayRequest (=sdr) messages*/
5015 #if 0
5016 { &hf_ptp_v2_sdr_origintimestamp,
5017 { "originTimestamp", "ptp.v2.sdr.origintimestamp",
5018 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
5019 NULL, HFILL }
5021 #endif
5022 { &hf_ptp_v2_sdr_origintimestamp_seconds,
5023 { "originTimestamp (seconds)", "ptp.v2.sdr.origintimestamp.seconds",
5024 FT_UINT64, BASE_DEC, NULL, 0x00,
5025 NULL, HFILL }
5027 { &hf_ptp_v2_sdr_origintimestamp_nanoseconds,
5028 { "originTimestamp (nanoseconds)", "ptp.v2.sdr.origintimestamp.nanoseconds",
5029 FT_INT32, BASE_DEC, NULL, 0x00,
5030 NULL, HFILL }
5033 /*Fields for PTP_Follow_Up (=fu) messages*/
5034 #if 0
5035 { &hf_ptp_v2_fu_preciseorigintimestamp,
5036 { "preciseOriginTimestamp", "ptp.v2.fu.preciseorigintimestamp",
5037 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
5038 NULL, HFILL }
5040 #endif
5041 { &hf_ptp_v2_fu_preciseorigintimestamp_seconds,
5042 { "preciseOriginTimestamp (seconds)", "ptp.v2.fu.preciseorigintimestamp.seconds",
5043 FT_UINT64, BASE_DEC, NULL, 0x00,
5044 NULL, HFILL }
5046 { &hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds,
5047 { "preciseOriginTimestamp (nanoseconds)", "ptp.v2.fu.preciseorigintimestamp.nanoseconds",
5048 FT_INT32, BASE_DEC, NULL, 0x00,
5049 NULL, HFILL }
5051 /*Fields for PTP_Follow_up TLVs */
5052 { &hf_ptp_as_fu_tlv_tlvtype,
5053 { "tlvType", "ptp.as.fu.tlvType",
5054 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
5055 NULL, HFILL }
5057 { &hf_ptp_as_fu_tlv_lengthfield,
5058 { "lengthField", "ptp.as.fu.lengthField",
5059 FT_UINT16, BASE_DEC, NULL, 0x00,
5060 NULL, HFILL }
5062 { &hf_ptp_as_fu_tlv_organization_id,
5063 { "organizationId", "ptp.as.fu.organizationId",
5064 FT_UINT24, BASE_DEC, NULL, 0x00,
5065 NULL, HFILL }
5067 { &hf_ptp_as_fu_tlv_organization_subtype,
5068 { "OrganizationSubType", "ptp.as.fu.organizationSubType",
5069 FT_INT24, BASE_DEC, NULL, 0x00,
5070 NULL, HFILL }
5072 { &hf_ptp_as_fu_tlv_cumulative_offset,
5073 { "cumulativeScaledRateOffset", "ptp.as.fu.cumulativeScaledRateOffset",
5074 FT_UINT32, BASE_DEC, NULL, 0x00,
5075 NULL, HFILL }
5077 { &hf_ptp_as_fu_tlv_gm_base_indicator,
5078 { "gmTimeBaseIndicator", "ptp.as.fu.gmTimeBaseIndicator",
5079 FT_UINT16, BASE_DEC, NULL, 0x00,
5080 NULL, HFILL }
5082 { &hf_ptp_as_fu_tlv_last_gm_phase_change,
5083 { "lastGMPhaseChange", "ptp.as.fu.lastGmPhaseChange",
5084 FT_BYTES, BASE_NONE, NULL, 0x00,
5085 NULL, HFILL }
5087 { &hf_ptp_as_fu_tlv_scaled_last_gm_phase_change,
5088 { "scaledLastGMPhaseChange", "ptp.as.fu.scaledLastGmPhaseChange",
5089 FT_INT32, BASE_DEC, NULL, 0x00,
5090 NULL, HFILL }
5093 /*Fields for PTP_DelayResponse (=dr) messages*/
5094 #if 0
5095 { &hf_ptp_v2_dr_receivetimestamp,
5096 { "receiveTimestamp", "ptp.v2.dr.receivetimestamp",
5097 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
5098 NULL, HFILL }
5100 #endif
5101 { &hf_ptp_v2_dr_receivetimestamp_seconds,
5102 { "receiveTimestamp (seconds)", "ptp.v2.dr.receivetimestamp.seconds",
5103 FT_UINT64, BASE_DEC, NULL, 0x00,
5104 NULL, HFILL }
5106 { &hf_ptp_v2_dr_receivetimestamp_nanoseconds,
5107 { "receiveTimestamp (nanoseconds)", "ptp.v2.dr.receivetimestamp.nanoseconds",
5108 FT_INT32, BASE_DEC, NULL, 0x00,
5109 NULL, HFILL }
5111 { &hf_ptp_v2_dr_requestingportidentity,
5112 { "requestingSourcePortIdentity", "ptp.v2.dr.requestingsourceportidentity",
5113 FT_UINT64, BASE_HEX, NULL, 0x00,
5114 NULL, HFILL }
5116 { &hf_ptp_v2_dr_requestingsourceportid,
5117 { "requestingSourcePortId", "ptp.v2.dr.requestingsourceportid",
5118 FT_UINT16, BASE_DEC, NULL, 0x00,
5119 NULL, HFILL }
5122 /*Fields for PTP_PDelayRequest (=pdrq) messages*/
5123 #if 0
5124 { &hf_ptp_v2_pdrq_origintimestamp,
5125 { "originTimestamp", "ptp.v2.pdrq.origintimestamp",
5126 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
5127 NULL, HFILL }
5129 #endif
5130 { &hf_ptp_v2_pdrq_origintimestamp_seconds,
5131 { "originTimestamp (seconds)", "ptp.v2.pdrq.origintimestamp.seconds",
5132 FT_UINT64, BASE_DEC, NULL, 0x00,
5133 NULL, HFILL }
5135 { &hf_ptp_v2_pdrq_origintimestamp_nanoseconds,
5136 { "originTimestamp (nanoseconds)", "ptp.v2.pdrq.origintimestamp.nanoseconds",
5137 FT_INT32, BASE_DEC, NULL, 0x00,
5138 NULL, HFILL }
5141 /*Fields for PTP_PDelayResponse (=pdrs) messages*/
5142 #if 0
5143 { &hf_ptp_v2_pdrs_requestreceipttimestamp,
5144 { "requestreceiptTimestamp", "ptp.v2.pdrs.requestreceipttimestamp",
5145 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
5146 NULL, HFILL }
5148 #endif
5149 { &hf_ptp_v2_pdrs_requestreceipttimestamp_seconds,
5150 { "requestreceiptTimestamp (seconds)", "ptp.v2.pdrs.requestreceipttimestamp.seconds",
5151 FT_UINT64, BASE_DEC, NULL, 0x00,
5152 NULL, HFILL }
5154 { &hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds,
5155 { "requestreceiptTimestamp (nanoseconds)", "ptp.v2.pdrs.requestreceipttimestamp.nanoseconds",
5156 FT_INT32, BASE_DEC, NULL, 0x00,
5157 NULL, HFILL }
5159 { &hf_ptp_v2_pdrs_requestingportidentity,
5160 { "requestingSourcePortIdentity", "ptp.v2.pdrs.requestingportidentity",
5161 FT_UINT64, BASE_HEX, NULL, 0x00,
5162 NULL, HFILL }
5164 { &hf_ptp_v2_pdrs_requestingsourceportid,
5165 { "requestingSourcePortId", "ptp.v2.pdrs.requestingsourceportid",
5166 FT_UINT16, BASE_DEC, NULL, 0x00,
5167 NULL, HFILL }
5170 /*Fields for PTP_PDelayResponseFollowUp (=pdfu) messages*/
5171 #if 0
5172 { &hf_ptp_v2_pdfu_responseorigintimestamp,
5173 { "responseOriginTimestamp", "ptp.v2.pdfu.responseorigintimestamp",
5174 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
5175 NULL, HFILL }
5177 #endif
5178 { &hf_ptp_v2_pdfu_responseorigintimestamp_seconds,
5179 { "responseOriginTimestamp (seconds)", "ptp.v2.pdfu.responseorigintimestamp.seconds",
5180 FT_UINT64, BASE_DEC, NULL, 0x00,
5181 NULL, HFILL }
5183 { &hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds,
5184 { "responseOriginTimestamp (nanoseconds)", "ptp.v2.pdfu.responseorigintimestamp.nanoseconds",
5185 FT_INT32, BASE_DEC, NULL, 0x00,
5186 NULL, HFILL }
5188 { &hf_ptp_v2_pdfu_requestingportidentity,
5189 { "requestingSourcePortIdentity", "ptp.v2.pdfu.requestingportidentity",
5190 FT_UINT64, BASE_HEX, NULL, 0x00,
5191 NULL, HFILL }
5193 { &hf_ptp_v2_pdfu_requestingsourceportid,
5194 { "requestingSourcePortId", "ptp.v2.pdfu.requestingsourceportid",
5195 FT_UINT16, BASE_DEC, NULL, 0x00,
5196 NULL, HFILL }
5199 /*Fields for PTP_Signalling (=sig) messages*/
5200 { &hf_ptp_v2_sig_targetportidentity,
5201 { "targetPortIdentity", "ptp.v2.sig.targetportidentity",
5202 FT_UINT64, BASE_HEX, NULL, 0x00,
5203 NULL, HFILL }
5205 { &hf_ptp_v2_sig_targetportid,
5206 { "targetPortId", "ptp.v2.sig.targetportid",
5207 FT_UINT16, BASE_DEC, NULL, 0x00,
5208 NULL, HFILL }
5210 { &hf_ptp_v2_sig_tlv_tlvType,
5211 { "tlvType", "ptp.v2.sig.tlv.tlvType",
5212 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
5213 NULL, HFILL }
5215 { &hf_ptp_v2_sig_tlv_lengthField,
5216 { "lengthField", "ptp.v2.sig.tlv.lengthField",
5217 FT_UINT16, BASE_DEC, NULL, 0x00,
5218 NULL, HFILL }
5220 { &hf_ptp_v2_sig_tlv_data,
5221 { "data", "ptp.v2.sig.tlv.data",
5222 FT_BYTES, BASE_NONE, NULL, 0x00,
5223 NULL, HFILL }
5225 { &hf_ptp_v2_sig_tlv_messageType,
5226 { "messageType", "ptp.v2.sig.tlv.messageType",
5227 FT_UINT8, BASE_HEX, VALS(ptp_v2_messageid_vals), 0xF0,
5228 NULL, HFILL }
5230 { &hf_ptp_v2_sig_tlv_logInterMessagePeriod,
5231 { "logInterMessagePeriod", "ptp.v2.sig.tlv.logInterMessagePeriod",
5232 FT_INT8, BASE_DEC, NULL, 0x00,
5233 NULL, HFILL }
5235 { &hf_ptp_v2_sig_tlv_logInterMessagePeriod_period,
5236 { "period", "ptp.v2.sig.tlv.logInterMessagePeriod.period",
5237 FT_INT8, BASE_DEC, NULL, 0x00,
5238 NULL, HFILL }
5240 { &hf_ptp_v2_sig_tlv_logInterMessagePeriod_rate,
5241 { "rate", "ptp.v2.sig.tlv.logInterMessagePeriod.rate",
5242 FT_INT8, BASE_DEC, NULL, 0x00,
5243 NULL, HFILL }
5245 { &hf_ptp_v2_sig_tlv_durationField,
5246 { "durationField", "ptp.v2.sig.tlv.durationField",
5247 FT_UINT32, BASE_DEC, NULL, 0x00,
5248 NULL, HFILL }
5250 { &hf_ptp_v2_sig_tlv_renewalInvited,
5251 { "renewalInvited", "ptp.v2.sig.tlv.renewalInvited",
5252 FT_BOOLEAN, 8, NULL, 0x01,
5253 NULL, HFILL }
5256 /*Fields for PTP_Signalling (=sig) TLVs */
5257 { &hf_ptp_as_sig_tlv_tlvtype,
5258 { "tlvType", "ptp.as.sig.tlvType",
5259 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
5260 NULL, HFILL }
5262 { &hf_ptp_as_sig_tlv_lengthfield,
5263 { "lengthField", "ptp.as.sig.lengthField",
5264 FT_UINT16, BASE_DEC, NULL, 0x00,
5265 NULL, HFILL }
5267 { &hf_ptp_as_sig_tlv_organization_id,
5268 { "organizationId", "ptp.as.sig.tlv.organizationId",
5269 FT_UINT24, BASE_HEX, VALS(ptp_as_TLV_oid_vals), 0x00,
5270 NULL, HFILL }
5272 { &hf_ptp_as_sig_tlv_organization_subtype,
5273 { "OrganizationSubType", "ptp.as.sig.tlv.organizationSubType",
5274 FT_INT24, BASE_DEC, NULL, 0x00,
5275 NULL, HFILL }
5277 { &hf_ptp_as_sig_tlv_link_delay_interval,
5278 { "linkDelayInterval", "ptp.as.sig.tlv.linkdelayinterval",
5279 FT_INT8, BASE_DEC, NULL, 0x00,
5280 NULL, HFILL }
5282 { &hf_ptp_as_sig_tlv_time_sync_interval,
5283 { "timeSyncInterval", "ptp.as.sig.tlv.timesyncinterval",
5284 FT_INT8, BASE_DEC, NULL, 0x00,
5285 NULL, HFILL }
5287 { &hf_ptp_as_sig_tlv_announce_interval,
5288 { "announceInterval", "ptp.as.sig.tlv.announceinterval",
5289 FT_INT8, BASE_DEC, NULL, 0x00,
5290 NULL, HFILL }
5292 { &hf_ptp_as_sig_tlv_flags,
5293 { "flags", "ptp.as.sig.tvl.flags",
5294 FT_UINT8, BASE_HEX, NULL, 0x00,
5295 NULL, HFILL }
5297 { &hf_ptp_as_sig_tlv_flags_comp_rate_ratio,
5298 { "computeNeighborRateRatio", "ptp.as.sig.tlv.flags.rateratio",
5299 FT_BOOLEAN, 8, NULL, PTP_AS_FLAGS_COMP_NEIGHBOR_RATE_RATIO_BITMASK,
5300 NULL, HFILL }
5302 { &hf_ptp_as_sig_tlv_flags_comp_prop_delay,
5303 { "computeNeighborPropDelay", "ptp.as.sig.tlv.flags.propdelay",
5304 FT_BOOLEAN, 8, NULL, PTP_AS_FLAGS_COMP_NEIGHBOR_PROP_DELAY_BITMASK,
5305 NULL, HFILL }
5308 /*Fields for PTP_Management (=mm) messages*/
5309 { &hf_ptp_v2_mm_targetportidentity,
5310 { "targetPortIdentity", "ptp.v2.mm.targetportidentity",
5311 FT_UINT64, BASE_HEX, NULL, 0x00,
5312 NULL, HFILL }
5314 { &hf_ptp_v2_mm_targetportid,
5315 { "targetPortId", "ptp.v2.mm.targetportid",
5316 FT_UINT16, BASE_DEC, NULL, 0x00,
5317 NULL, HFILL }
5319 { &hf_ptp_v2_mm_startingboundaryhops,
5320 { "startingBoundaryHops", "ptp.v2.mm.startingboundaryhops",
5321 FT_UINT8, BASE_DEC, NULL, 0x00,
5322 NULL, HFILL }
5324 { &hf_ptp_v2_mm_boundaryhops,
5325 { "boundaryHops", "ptp.v2.mm.boundaryhops",
5326 FT_UINT8, BASE_DEC, NULL, 0x00,
5327 NULL, HFILL }
5329 { &hf_ptp_v2_mm_action,
5330 { "action", "ptp.v2.mm.action",
5331 FT_UINT8, BASE_DEC, VALS(ptp_v2_mm_action_vals), 0x0F,
5332 NULL, HFILL }
5334 /* Management TLV */
5335 { &hf_ptp_v2_mm_tlvType,
5336 { "tlvType", "ptp.v2.mm.tlvType",
5337 FT_UINT16, BASE_DEC, VALS(ptp_v2_TLV_type_vals), 0x00,
5338 NULL, HFILL }
5340 { &hf_ptp_v2_mm_lengthField,
5341 { "lengthField", "ptp.v2.mm.lengthField",
5342 FT_UINT16, BASE_DEC, NULL, 0x00,
5343 NULL, HFILL }
5345 { &hf_ptp_v2_mm_managementId,
5346 { "managementId", "ptp.v2.mm.managementId",
5347 FT_UINT16, BASE_DEC, VALS(ptp_v2_managementID_vals), 0x00,
5348 NULL, HFILL }
5350 { &hf_ptp_v2_mm_data,
5351 { "data", "ptp.v2.mm.data",
5352 FT_BYTES, BASE_NONE, NULL, 0x00,
5353 NULL, HFILL }
5355 /* Management TLV dataField */
5356 /* CLOCK_DESCRIPTION */
5357 { &hf_ptp_v2_mm_clockType,
5358 { "clockType", "ptp.v2.mm.clockType",
5359 FT_UINT16, BASE_HEX, NULL, 0x00,
5360 NULL, HFILL }
5362 { &hf_ptp_v2_mm_clockType_ordinaryClock,
5363 { "The node implements an ordinary clock", "ptp.v2.mm.clockType.OC",
5364 FT_BOOLEAN, 16, NULL, CLOCKTYPE_ORDINARY_CLOCK,
5365 NULL, HFILL }
5367 { &hf_ptp_v2_mm_clockType_boundaryClock,
5368 { "The node implements a boundary clock", "ptp.v2.mm.clockType.BC",
5369 FT_BOOLEAN, 16, NULL, CLOCKTYPE_BOUNDARY_CLOCK,
5370 NULL, HFILL }
5372 { &hf_ptp_v2_mm_clockType_p2p_transparentClock,
5373 { "The node implements a peer-to-peer transparent clock", "ptp.v2.mm.clockType.p2p_TC",
5374 FT_BOOLEAN, 16, NULL, CLOCKTYPE_P2P_TC,
5375 NULL, HFILL }
5377 { &hf_ptp_v2_mm_clockType_e2e_transparentClock,
5378 { "The node implements an end-to-end transparent clock", "ptp.v2.mm.clockType.e2e_TC",
5379 FT_BOOLEAN, 16, NULL, CLOCKTYPE_E2E_TC,
5380 NULL, HFILL }
5382 { &hf_ptp_v2_mm_clockType_managementNode,
5383 { "The node implements a management node", "ptp.v2.mm.clockType.MM",
5384 FT_BOOLEAN, 16, NULL, CLOCKTYPE_MANAGEMENT_NODE,
5385 NULL, HFILL }
5387 { &hf_ptp_v2_mm_clockType_reserved,
5388 { "Reserved", "ptp.v2.mm.clockType.reserved",
5389 FT_BOOLEAN, 16, NULL, CLOCKTYPE_RESERVED,
5390 NULL, HFILL }
5392 { &hf_ptp_v2_mm_physicalLayerProtocol,
5393 { "physicalLayerProtocol", "ptp.v2.mm.physicalLayerProtocol",
5394 FT_STRING, BASE_NONE, NULL, 0x00,
5395 NULL, HFILL }
5397 { &hf_ptp_v2_mm_physicalLayerProtocol_length,
5398 { "length", "ptp.v2.mm.physicalLayerProtocol.length",
5399 FT_UINT8, BASE_DEC, NULL, 0x00,
5400 NULL, HFILL }
5402 { &hf_ptp_v2_mm_physicalAddressLength,
5403 { "physical address length", "ptp.v2.mm.physicalAddressLength",
5404 FT_UINT16, BASE_DEC, NULL, 0x00,
5405 NULL, HFILL }
5407 { &hf_ptp_v2_mm_physicalAddress,
5408 { "physical address", "ptp.v2.mm.physicalAddress",
5409 FT_BYTES, BASE_NONE, NULL, 0x00,
5410 NULL, HFILL }
5412 { &hf_ptp_v2_mm_protocolAddress,
5413 { "protocol address", "ptp.v2.mm.protocolAddress",
5414 FT_BYTES, BASE_NONE, NULL, 0x00,
5415 NULL, HFILL }
5417 { &hf_ptp_v2_mm_protocolAddress_networkProtocol,
5418 { "network protocol", "ptp.v2.mm.networkProtocol",
5419 FT_UINT16, BASE_DEC, VALS(ptp2_networkProtocol_vals), 0x00,
5420 NULL, HFILL }
5422 { &hf_ptp_v2_mm_protocolAddress_length,
5423 { "length", "ptp.v2.mm.protocolAddress.length",
5424 FT_UINT16, BASE_DEC, NULL, 0x00,
5425 NULL, HFILL }
5427 { &hf_ptp_v2_mm_manufacturerIdentity,
5428 { "manufacturer identity", "ptp.v2.mm.manufacturerIdentity",
5429 FT_BYTES, BASE_NONE, NULL, 0x00,
5430 NULL, HFILL }
5432 { &hf_ptp_v2_mm_reserved,
5433 { "reserved", "ptp.v2.mm.reserved",
5434 FT_BYTES, BASE_NONE, NULL, 0x00,
5435 NULL, HFILL }
5437 { &hf_ptp_v2_mm_productDescription,
5438 { "product description", "ptp.v2.mm.productDescription",
5439 FT_STRING, BASE_NONE, NULL, 0x00,
5440 NULL, HFILL }
5442 { &hf_ptp_v2_mm_productDescription_length,
5443 { "length", "ptp.v2.mm.productDescription.length",
5444 FT_UINT8, BASE_DEC, NULL, 0x00,
5445 NULL, HFILL }
5447 { &hf_ptp_v2_mm_revisionData,
5448 { "revision data", "ptp.v2.mm.revisionData",
5449 FT_STRING, BASE_NONE, NULL, 0x00,
5450 NULL, HFILL }
5452 { &hf_ptp_v2_mm_revisionData_length,
5453 { "length", "ptp.v2.mm.revisionData.length",
5454 FT_UINT8, BASE_DEC, NULL, 0x00,
5455 NULL, HFILL }
5457 { &hf_ptp_v2_mm_userDescription,
5458 { "user description", "ptp.v2.mm.userDescription",
5459 FT_STRING, BASE_NONE, NULL, 0x00,
5460 NULL, HFILL }
5462 { &hf_ptp_v2_mm_userDescription_length,
5463 { "length", "ptp.v2.mm.userDescription.length",
5464 FT_UINT8, BASE_DEC, NULL, 0x00,
5465 NULL, HFILL }
5467 { &hf_ptp_v2_mm_profileIdentity,
5468 { "profileIdentity", "ptp.v2.mm.profileIdentity",
5469 FT_BYTES, BASE_NONE, NULL, 0x00,
5470 NULL, HFILL }
5472 { &hf_ptp_v2_mm_pad,
5473 { "Pad", "ptp.v2.mm.pad",
5474 FT_BYTES, BASE_NONE, NULL, 0x0,
5475 NULL, HFILL }
5477 { &hf_ptp_v2_mm_initializationKey,
5478 { "initialization key", "ptp.v2.mm.initializationKey",
5479 FT_UINT16, BASE_DEC, NULL, 0x00,
5480 NULL, HFILL }
5482 { &hf_ptp_v2_mm_numberOfFaultRecords,
5483 { "number of fault records", "ptp.v2.mm.numberOfFaultRecords",
5484 FT_UINT16, BASE_DEC, NULL, 0x00,
5485 NULL, HFILL }
5487 #if 0
5488 { &hf_ptp_v2_mm_faultRecord,
5489 { "fault record", "ptp.v2.mm.faultRecord",
5490 FT_BYTES, BASE_NONE, NULL, 0x00,
5491 NULL, HFILL }
5493 #endif
5494 { &hf_ptp_v2_mm_faultRecordLength,
5495 { "fault record length", "ptp.v2.mm.faultRecordLength",
5496 FT_UINT16, BASE_DEC, NULL, 0x00,
5497 NULL, HFILL }
5499 { &hf_ptp_v2_mm_severityCode,
5500 { "severity code", "ptp.v2.mm.severityCode",
5501 FT_UINT8, BASE_DEC, VALS(ptp2_severityCode_vals), 0x00,
5502 NULL, HFILL }
5504 { &hf_ptp_v2_mm_faultName,
5505 { "faultName", "ptp.v2.mm.faultName",
5506 FT_STRING, BASE_NONE, NULL, 0x00,
5507 NULL, HFILL }
5509 { &hf_ptp_v2_mm_faultName_length,
5510 { "length", "ptp.v2.mm.faultName.length",
5511 FT_UINT8, BASE_DEC, NULL, 0x00,
5512 NULL, HFILL }
5514 { &hf_ptp_v2_mm_faultValue,
5515 { "faultValue", "ptp.v2.mm.faultValue",
5516 FT_STRING, BASE_NONE, NULL, 0x00,
5517 NULL, HFILL }
5519 { &hf_ptp_v2_mm_faultValue_length,
5520 { "length", "ptp.v2.mm.faultValue.length",
5521 FT_UINT8, BASE_DEC, NULL, 0x00,
5522 NULL, HFILL }
5524 { &hf_ptp_v2_mm_faultDescription,
5525 { "faultDescription", "ptp.v2.mm.faultDescription",
5526 FT_STRING, BASE_NONE, NULL, 0x00,
5527 NULL, HFILL }
5529 { &hf_ptp_v2_mm_faultDescription_length,
5530 { "length", "ptp.v2.mm.faultDescription.length",
5531 FT_UINT8, BASE_DEC, NULL, 0x00,
5532 NULL, HFILL }
5534 #if 0
5535 { &hf_ptp_v2_mm_faultTime,
5536 { "Fault time", "ptp.v2.mm.faultTime",
5537 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
5538 NULL, HFILL }
5540 #endif
5541 { &hf_ptp_v2_mm_faultTime_s,
5542 { "Fault time (seconds)", "ptp.v2.mm.faultTime.seconds",
5543 FT_UINT64, BASE_DEC, NULL, 0x00,
5544 NULL, HFILL }
5546 { &hf_ptp_v2_mm_faultTime_ns,
5547 { "Fault time (nanoseconds)", "ptp.v2.mm.faultTime.nanoseconds",
5548 FT_INT32, BASE_DEC, NULL, 0x00,
5549 NULL, HFILL }
5551 { &hf_ptp_v2_mm_currentTime_s,
5552 { "current time (seconds)", "ptp.v2.mm.currentTime.seconds",
5553 FT_UINT64, BASE_DEC, NULL, 0x00,
5554 NULL, HFILL }
5556 { &hf_ptp_v2_mm_currentTime_ns,
5557 { "current time (nanoseconds)", "ptp.v2.mm.currentTime.nanoseconds",
5558 FT_INT32, BASE_DEC, NULL, 0x00,
5559 NULL, HFILL }
5561 { &hf_ptp_v2_mm_clockAccuracy,
5562 { "Clock accuracy", "ptp.v2.mm.clockaccuracy",
5563 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
5564 NULL, HFILL }
5567 { &hf_ptp_v2_mm_priority1,
5568 { "priority1", "ptp.v2.mm.priority1",
5569 FT_UINT8, BASE_DEC, NULL, 0x00,
5570 NULL, HFILL }
5572 { &hf_ptp_v2_mm_priority2,
5573 { "priority2", "ptp.v2.mm.priority2",
5574 FT_UINT8, BASE_DEC, NULL, 0x00,
5575 NULL, HFILL }
5577 { &hf_ptp_v2_mm_dds_SO,
5578 { "Slave only", "ptp.v2.mm.SlavOnly",
5579 FT_BOOLEAN, 8, NULL, 0x02,
5580 NULL, HFILL }
5582 { &hf_ptp_v2_mm_TSC,
5583 { "Two step", "ptp.v2.mm.twoStep",
5584 FT_BOOLEAN, 8, NULL, 0x01,
5585 NULL, HFILL }
5587 { &hf_ptp_v2_mm_numberPorts,
5588 { "number of ports", "ptp.v2.mm.numberPorts",
5589 FT_UINT16, BASE_DEC, NULL, 0x00,
5590 NULL, HFILL }
5592 { &hf_ptp_v2_mm_clockclass,
5593 { "Clock class", "ptp.v2.mm.clockclass",
5594 FT_UINT8, BASE_DEC, NULL, 0x00,
5595 NULL, HFILL }
5597 { &hf_ptp_v2_mm_clockaccuracy,
5598 { "Clock accuracy", "ptp.v2.mm.clockaccuracy",
5599 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
5600 NULL, HFILL }
5602 { &hf_ptp_v2_mm_clockvariance,
5603 { "Clock variance", "ptp.v2.mm.clockvariance",
5604 FT_UINT16, BASE_DEC, NULL, 0x00,
5605 NULL, HFILL }
5607 { &hf_ptp_v2_mm_clockidentity,
5608 { "Clock identity", "ptp.v2.mm.clockidentity",
5609 FT_UINT64, BASE_HEX, NULL, 0x00,
5610 NULL, HFILL }
5612 { &hf_ptp_v2_mm_domainNumber,
5613 { "domain number", "ptp.v2.mm.domainNumber",
5614 FT_UINT8, BASE_DEC, NULL , 0x00,
5615 NULL, HFILL }
5617 { &hf_ptp_v2_mm_SO,
5618 { "Slave only", "ptp.v2.mm.SlavOnly",
5619 FT_BOOLEAN, 8, NULL, 0x01,
5620 NULL, HFILL }
5622 { &hf_ptp_v2_mm_stepsRemoved,
5623 { "steps removed", "ptp.v2.mm.stepsRemoved",
5624 FT_INT16, BASE_DEC, NULL, 0x00,
5625 NULL, HFILL }
5627 { &hf_ptp_v2_mm_parentIdentity,
5628 { "parent ClockIdentity", "ptp.v2.mm.parentclockidentity",
5629 FT_UINT64, BASE_HEX, NULL, 0x00,
5630 NULL, HFILL }
5632 { &hf_ptp_v2_mm_parentPort,
5633 { "parent SourcePortID", "ptp.v2.mm.parentsourceportid",
5634 FT_UINT16, BASE_DEC, NULL, 0x00,
5635 NULL, HFILL }
5637 { &hf_ptp_v2_mm_parentStats,
5638 { "parent stats", "ptp.v2.mm.parentstats",
5639 FT_BOOLEAN, 8, NULL, 0x01,
5640 NULL, HFILL }
5642 { &hf_ptp_v2_mm_observedParentOffsetScaledLogVariance,
5643 { "observedParentOffsetScaledLogVariance", "ptp.v2.mm.observedParentOffsetScaledLogVariance",
5644 FT_UINT16, BASE_DEC, NULL, 0x00,
5645 NULL, HFILL }
5647 { &hf_ptp_v2_mm_observedParentClockPhaseChangeRate,
5648 { "observedParentClockPhaseChangeRate", "ptp.v2.mm.observedParentClockPhaseChangeRate",
5649 FT_INT32, BASE_DEC, NULL, 0x00,
5650 NULL, HFILL }
5652 { &hf_ptp_v2_mm_grandmasterPriority1,
5653 { "Grandmaster priority1", "ptp.v2.mm.grandmasterPriority1",
5654 FT_UINT8, BASE_DEC, NULL, 0x00,
5655 NULL, HFILL }
5657 { &hf_ptp_v2_mm_grandmasterPriority2,
5658 { "Grandmaster priority2", "ptp.v2.mm.grandmasterPriority2",
5659 FT_UINT8, BASE_DEC, NULL, 0x00,
5660 NULL, HFILL }
5662 { &hf_ptp_v2_mm_grandmasterclockclass,
5663 { "Grandmaster clock class", "ptp.v2.mm.grandmasterclockclass",
5664 FT_UINT8, BASE_DEC, NULL, 0x00,
5665 NULL, HFILL }
5667 { &hf_ptp_v2_mm_grandmasterclockaccuracy,
5668 { "Grandmaster clock accuracy", "ptp.v2.mm.grandmasterclockaccuracy",
5669 FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
5670 NULL, HFILL }
5672 { &hf_ptp_v2_mm_grandmasterclockvariance,
5673 { "Grandmaster clock variance", "ptp.v2.mm.grandmasterclockvariance",
5674 FT_UINT16, BASE_DEC, NULL, 0x00,
5675 NULL, HFILL }
5677 { &hf_ptp_v2_mm_grandmasterIdentity,
5678 { "Grandmaster clock identity", "ptp.v2.mm.grandmasterclockidentity",
5679 FT_UINT64, BASE_HEX, NULL, 0x00,
5680 NULL, HFILL }
5682 { &hf_ptp_v2_mm_currentUtcOffset,
5683 { "CurrentUTCOffset", "ptp.v2.mm.currentutcoffset",
5684 FT_INT16, BASE_DEC, NULL, 0x00,
5685 NULL, HFILL }
5687 { &hf_ptp_v2_mm_LI_61,
5688 { "leap 61", "ptp.v2.mm.li61",
5689 FT_BOOLEAN, 8, NULL, 0x01,
5690 NULL, HFILL }
5692 { &hf_ptp_v2_mm_LI_59,
5693 { "leap 59", "ptp.v2.mm.li59",
5694 FT_BOOLEAN, 8, NULL, 0x02,
5695 NULL, HFILL }
5697 { &hf_ptp_v2_mm_UTCV,
5698 { "CurrentUTCOffset valid", "ptp.v2.mm.CurrentUTCOffsetValid",
5699 FT_BOOLEAN, 8, NULL, 0x04,
5700 NULL, HFILL }
5702 { &hf_ptp_v2_mm_PTP,
5703 { "PTP timescale", "ptp.v2.mm.ptptimescale",
5704 FT_BOOLEAN, 8, NULL, 0x08,
5705 NULL, HFILL }
5707 { &hf_ptp_v2_mm_TTRA,
5708 { "Time traceable", "ptp.v2.mm.timeTraceable",
5709 FT_BOOLEAN, 8, NULL, 0x10,
5710 NULL, HFILL }
5712 { &hf_ptp_v2_mm_FTRA,
5713 { "Frequency traceable", "ptp.v2.mm.frequencyTraceable",
5714 FT_BOOLEAN, 8, NULL, 0x20,
5715 NULL, HFILL }
5717 { &hf_ptp_v2_mm_timesource,
5718 { "TimeSource", "ptp.v2.mm.timesource",
5719 FT_UINT8, BASE_HEX, VALS(ptp_v2_timesource_vals), 0x00,
5720 NULL, HFILL }
5722 { &hf_ptp_v2_mm_offset_ns,
5723 { "correction", "ptp.v2.mm.offset.ns",
5724 FT_UINT64, BASE_DEC, NULL, 0x00,
5725 NULL, HFILL }
5727 { &hf_ptp_v2_mm_offset_subns,
5728 { "SubNs", "ptp.v2.mm.offset.subns",
5729 FT_DOUBLE, BASE_NONE, NULL, 0x00,
5730 NULL, HFILL }
5732 { &hf_ptp_v2_mm_pathDelay_ns,
5733 { "ns", "ptp.v2.mm.pathDelay.ns",
5734 FT_UINT64, BASE_DEC, NULL, 0x00,
5735 NULL, HFILL }
5737 { &hf_ptp_v2_mm_pathDelay_subns,
5738 { "SubNs", "ptp.v2.mm.pathDelay.subns",
5739 FT_DOUBLE, BASE_NONE, NULL, 0x00,
5740 NULL, HFILL }
5742 { &hf_ptp_v2_mm_PortNumber,
5743 { "PortNumber", "ptp.v2.mm.PortNumber",
5744 FT_UINT16, BASE_DEC, NULL, 0x00,
5745 NULL, HFILL }
5747 { &hf_ptp_v2_mm_portState,
5748 { "Port state", "ptp.v2.mm.portState",
5749 FT_UINT8, BASE_DEC, VALS(ptp2_portState_vals), 0x00,
5750 NULL, HFILL }
5752 { &hf_ptp_v2_mm_logMinDelayReqInterval,
5753 { "logMinDelayReqInterval", "ptp.v2.mm.logMinDelayReqInterval",
5754 FT_INT8, BASE_DEC, NULL, 0x00,
5755 NULL, HFILL }
5757 { &hf_ptp_v2_mm_peerMeanPathDelay_ns,
5758 { "ns", "ptp.v2.mm.peerMeanPathDelay.ns",
5759 FT_UINT64, BASE_DEC, NULL, 0x00,
5760 NULL, HFILL }
5762 { &hf_ptp_v2_mm_peerMeanPathDelay_subns,
5763 { "SubNs", "ptp.v2.mm.peerMeanPathDelay.subns",
5764 FT_DOUBLE, BASE_NONE, NULL, 0x00,
5765 NULL, HFILL }
5767 { &hf_ptp_v2_mm_logAnnounceInterval,
5768 { "logAnnounceInterval", "ptp.v2.mm.logAnnounceInterval",
5769 FT_INT8, BASE_DEC, NULL, 0x00,
5770 NULL, HFILL }
5772 { &hf_ptp_v2_mm_announceReceiptTimeout,
5773 { "announceReceiptTimeout", "ptp.v2.mm.announceReceiptTimeout",
5774 FT_UINT8, BASE_DEC, NULL, 0x00,
5775 NULL, HFILL }
5777 { &hf_ptp_v2_mm_logSyncInterval,
5778 { "logSyncInterval", "ptp.v2.mm.logSyncInterval",
5779 FT_INT8, BASE_DEC, NULL, 0x00,
5780 NULL, HFILL }
5782 { &hf_ptp_v2_mm_delayMechanism,
5783 { "Delay mechanism", "ptp.v2.mm.delayMechanism",
5784 FT_UINT8, BASE_DEC, VALS(ptp2_delayMechanism_vals), 0x00,
5785 NULL, HFILL }
5787 { &hf_ptp_v2_mm_logMinPdelayReqInterval,
5788 { "logMinPdelayReqInterval", "ptp.v2.mm.logMinPdelayReqInterval",
5789 FT_INT8, BASE_DEC, NULL, 0x00,
5790 NULL, HFILL }
5792 { &hf_ptp_v2_mm_versionNumber,
5793 { "versionNumber", "ptp.v2.mm.versionNumber",
5794 FT_UINT8, BASE_DEC, NULL, 0x0F,
5795 NULL, HFILL }
5797 { &hf_ptp_v2_mm_primaryDomain,
5798 { "Primary domain number", "ptp.v2.mm.primaryDomain",
5799 FT_UINT8, BASE_DEC, NULL, 0x00,
5800 NULL, HFILL }
5802 { &hf_ptp_v2_mm_faultyFlag,
5803 { "Faulty flag", "ptp.v2.mm.faultyFlag",
5804 FT_BOOLEAN, 8, NULL, 0x01,
5805 NULL, HFILL }
5808 { &hf_ptp_v2_mm_managementErrorId,
5809 { "managementErrorId", "ptp.v2.mm.managementErrorId",
5810 FT_UINT16, BASE_DEC, VALS(ptp2_managementErrorId_vals), 0x00,
5811 NULL, HFILL }
5813 { &hf_ptp_v2_mm_displayData,
5814 { "Display data", "ptp.v2.mm.displayData",
5815 FT_STRING, BASE_NONE, NULL, 0x00,
5816 NULL, HFILL }
5818 { &hf_ptp_v2_mm_displayData_length,
5819 { "length", "ptp.v2.mm.displayData.length",
5820 FT_UINT8, BASE_DEC, NULL, 0x00,
5821 NULL, HFILL }
5823 { &hf_ptp_v2_mm_ucEN,
5824 { "Enable unicast", "ptp.v2.mm.unicastEnable",
5825 FT_BOOLEAN, 8, NULL, 0x01,
5826 NULL, HFILL }
5828 { &hf_ptp_v2_mm_ptEN,
5829 { "Path trace unicast", "ptp.v2.mm.pathTraceEnable",
5830 FT_BOOLEAN, 8, NULL, 0x01,
5831 NULL, HFILL }
5833 { &hf_ptp_v2_mm_atEN,
5834 { "Path trace unicast", "ptp.v2.mm.pathTraceEnable",
5835 FT_BOOLEAN, 8, NULL, 0x01,
5836 NULL, HFILL }
5838 { &hf_ptp_v2_mm_keyField,
5839 { "Key field", "ptp.v2.mm.keyField",
5840 FT_UINT8, BASE_DEC, NULL, 0x00,
5841 NULL, HFILL }
5843 { &hf_ptp_v2_mm_displayName,
5844 { "Display name", "ptp.v2.mm.displayName",
5845 FT_STRING, BASE_NONE, NULL, 0x00,
5846 NULL, HFILL }
5848 { &hf_ptp_v2_mm_displayName_length,
5849 { "length", "ptp.v2.mm.displayName.length",
5850 FT_UINT8, BASE_DEC, NULL, 0x00,
5851 NULL, HFILL }
5853 { &hf_ptp_v2_mm_maxKey,
5854 { "Max key", "ptp.v2.mm.maxKey",
5855 FT_UINT8, BASE_DEC, NULL, 0x00,
5856 NULL, HFILL }
5858 { &hf_ptp_v2_mm_currentOffset,
5859 { "Current offset", "ptp.v2.mm.currentOffset",
5860 FT_INT32, BASE_DEC, NULL, 0x00,
5861 NULL, HFILL }
5863 { &hf_ptp_v2_mm_jumpSeconds,
5864 { "Jump seconds", "ptp.v2.mm.jumpSeconds",
5865 FT_INT32, BASE_DEC, NULL, 0x00,
5866 NULL, HFILL }
5868 { &hf_ptp_v2_mm_numberOfAlternateMasters,
5869 { "Number of alternate masters", "ptp.v2.mm.numberOfAlternateMasters",
5870 FT_UINT8, BASE_DEC, NULL, 0x00,
5871 NULL, HFILL }
5873 { &hf_ptp_v2_mm_logAlternateMulticastSyncInterval,
5874 { "Alternate multicast sync interval", "ptp.v2.mm.AlternateMulticastSyncInterval",
5875 FT_INT8, BASE_DEC, NULL, 0x00,
5876 NULL, HFILL }
5878 { &hf_ptp_v2_mm_transmitAlternateMulticastSync,
5879 { "Transmit alternate multicast sync", "ptp.v2.mm.transmitAlternateMulticastSync",
5880 FT_BOOLEAN, 8, NULL, 0x01,
5881 NULL, HFILL }
5886 /* Setup protocol subtree array */
5887 static gint *ett[] = {
5888 &ett_ptp,
5889 &ett_ptp_flags,
5890 &ett_ptp_time,
5891 &ett_ptp_time2,
5892 &ett_ptp_v2,
5893 &ett_ptp_v2_transportspecific,
5894 &ett_ptp_v2_flags,
5895 &ett_ptp_v2_correction,
5896 &ett_ptp_v2_time,
5897 &ett_ptp_v2_time2,
5898 &ett_ptp_v2_managementData,
5899 &ett_ptp_v2_clockType,
5900 &ett_ptp_v2_physicalLayerProtocol,
5901 &ett_ptp_v2_protocolAddress,
5902 &ett_ptp_v2_ptptext,
5903 &ett_ptp_v2_faultRecord,
5904 &ett_ptp_v2_timeInterval,
5905 &ett_ptp_v2_tlv,
5906 &ett_ptp_v2_tlv_log_period,
5907 &ett_ptp_as_sig_tlv_flags,
5910 /* Register the protocol name and description */
5911 proto_ptp = proto_register_protocol("Precision Time Protocol (IEEE1588)",
5912 "PTP", "ptp");
5914 /* Required function calls to register the header fields and subtrees used */
5915 proto_register_field_array(proto_ptp, hf, array_length(hf));
5916 proto_register_subtree_array(ett, array_length(ett));
5919 void
5920 proto_reg_handoff_ptp(void)
5922 dissector_handle_t event_port_ptp_handle;
5923 dissector_handle_t general_port_ptp_handle;
5924 dissector_handle_t ethertype_ptp_handle;
5926 event_port_ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp);
5927 general_port_ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp);
5928 ethertype_ptp_handle = create_dissector_handle(dissect_ptp_oE, proto_ptp);
5930 dissector_add_uint("udp.port", EVENT_PORT_PTP, event_port_ptp_handle);
5931 dissector_add_uint("udp.port", GENERAL_PORT_PTP, general_port_ptp_handle);
5932 dissector_add_uint("ethertype", ETHERTYPE_PTP, ethertype_ptp_handle);