forked from osmocom/wireshark
8ad0c82614
A new version of the IEEE1588/PTP dissector. This dissector now includes the coming version 2 of the standard. It supports both IP/UDP and pure ethernet frames. I've done some minor changes: LL suffix doesn't work on Win32, used G_GINT64_CONSTANT instead - as described in doc/readme.developer removed ETHERTYPE_PTP definition, already defined in etypes.h removed some duplicated "if (tree)" svn path=/trunk/; revision=22472
3272 lines
127 KiB
C
3272 lines
127 KiB
C
/* packet-ptp.c
|
||
* Routines for PTP (Precision Time Protocol) dissection
|
||
* Copyright 2004, Auges Tchouante <tchouante2001@yahoo.fr>
|
||
* Copyright 2004, Dominic Bechaz <bdo@zhwin.ch> , ZHW/InES
|
||
* Copyright 2004, Markus Seehofer <mseehofe@nt.hirschmann.de>
|
||
* Copyright 2006, Christian Schaer <scc@zhwin.ch>
|
||
* Copyright 2007, Markus Renz <Markus.Renz@hirschmann.de>
|
||
*
|
||
* Revisions:
|
||
* - Markus Seehofer 09.08.2005 <mseehofe@nt.hirschmann.de>
|
||
* - Included the "startingBoundaryHops" field in
|
||
* ptp_management messages.
|
||
* - Christian Schaer 07.07.2006 <scc@zhwin.ch>
|
||
* - Added support for PTP version 2
|
||
* - Markus Renz 2007-06-01
|
||
* updated support for PTPv2 - ToDo: Management and Signaling Messages
|
||
*
|
||
* $Id$
|
||
*
|
||
* Wireshark - Network traffic analyzer
|
||
* By Gerald Combs <gerald@wireshark.org>
|
||
* Copyright 1998 Gerald Combs
|
||
*
|
||
* This program is free software; you can redistribute it and/or
|
||
* modify it under the terms of the GNU General Public License
|
||
* as published by the Free Software Foundation; either version 2
|
||
* of the License, or (at your option) any later version.
|
||
*
|
||
* This program is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU General Public License
|
||
* along with this program; if not, write to the Free Software
|
||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||
*/
|
||
|
||
#ifdef HAVE_CONFIG_H
|
||
# include "config.h"
|
||
#endif
|
||
|
||
#include <stdio.h>
|
||
#include <stdlib.h>
|
||
#include <string.h>
|
||
#include <math.h>
|
||
|
||
|
||
#include <glib.h>
|
||
|
||
#ifdef NEED_SNPRINTF_H
|
||
# include "snprintf.h"
|
||
#endif
|
||
|
||
#include <epan/packet.h>
|
||
#include <epan/etypes.h>
|
||
|
||
|
||
/**********************************************************/
|
||
/* Port definition's for PTP */
|
||
/**********************************************************/
|
||
#define EVENT_PORT_PTP 319
|
||
#define GENERAL_PORT_PTP 320
|
||
|
||
/*END Port definition's for PTP*/
|
||
|
||
static int proto_ptp = -1;
|
||
|
||
/***********************************************************************************/
|
||
/* Definitions and fields for PTPv1 dissection. */
|
||
/***********************************************************************************/
|
||
|
||
|
||
/**********************************************************/
|
||
/* Offsets of fields within a PTPv1 packet. */
|
||
/**********************************************************/
|
||
|
||
/*Common offsets for all Messages (Synch, Delay_Req, Follow_Up, Delay_Resp ....)*/
|
||
#define PTP_VERSIONPTP_OFFSET 0
|
||
#define PTP_VERSIONNETWORK_OFFSET 2
|
||
#define PTP_SUBDOMAIN_OFFSET 4
|
||
#define PTP_MESSAGETYPE_OFFSET 20
|
||
#define PTP_SOURCECOMMUNICATIONTECHNOLOGY_OFFSET 21
|
||
#define PTP_SOURCEUUID_OFFSET 22
|
||
#define PTP_SOURCEPORTID_OFFSET 28
|
||
#define PTP_SEQUENCEID_OFFSET 30
|
||
#define PTP_CONTROL_OFFSET 32
|
||
#define PTP_FLAGS_OFFSET 34
|
||
#define PTP_FLAGS_LI61_OFFSET 34
|
||
#define PTP_FLAGS_LI59_OFFSET 34
|
||
#define PTP_FLAGS_BOUNDARY_CLOCK_OFFSET 34
|
||
#define PTP_FLAGS_ASSIST_OFFSET 34
|
||
#define PTP_FLAGS_EXT_SYNC_OFFSET 34
|
||
#define PTP_FLAGS_PARENT_STATS_OFFSET 34
|
||
#define PTP_FLAGS_SYNC_BURST_OFFSET 34
|
||
|
||
/*Offsets for PTP_Sync and Delay_Req (=SDR) messages*/
|
||
#define PTP_SDR_ORIGINTIMESTAMP_OFFSET 40
|
||
#define PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET 40
|
||
#define PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET 44
|
||
#define PTP_SDR_EPOCHNUMBER_OFFSET 48
|
||
#define PTP_SDR_CURRENTUTCOFFSET_OFFSET 50
|
||
#define PTP_SDR_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 53
|
||
#define PTP_SDR_GRANDMASTERCLOCKUUID_OFFSET 54
|
||
#define PTP_SDR_GRANDMASTERPORTID_OFFSET 60
|
||
#define PTP_SDR_GRANDMASTERSEQUENCEID_OFFSET 62
|
||
#define PTP_SDR_GRANDMASTERCLOCKSTRATUM_OFFSET 67
|
||
#define PTP_SDR_GRANDMASTERCLOCKIDENTIFIER_OFFSET 68
|
||
#define PTP_SDR_GRANDMASTERCLOCKVARIANCE_OFFSET 74
|
||
#define PTP_SDR_GRANDMASTERPREFERRED_OFFSET 77
|
||
#define PTP_SDR_GRANDMASTERISBOUNDARYCLOCK_OFFSET 79
|
||
#define PTP_SDR_SYNCINTERVAL_OFFSET 83
|
||
#define PTP_SDR_LOCALCLOCKVARIANCE_OFFSET 86
|
||
#define PTP_SDR_LOCALSTEPSREMOVED_OFFSET 90
|
||
#define PTP_SDR_LOCALCLOCKSTRATUM_OFFSET 95
|
||
#define PTP_SDR_LOCALCLOCKIDENTIFIER_OFFSET 96
|
||
#define PTP_SDR_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET 101
|
||
#define PTP_SDR_PARENTUUID_OFFSET 102
|
||
#define PTP_SDR_PARENTPORTFIELD_OFFSET 110
|
||
#define PTP_SDR_ESTIMATEDMASTERVARIANCE_OFFSET 114
|
||
#define PTP_SDR_ESTIMATEDMASTERDRIFT_OFFSET 116
|
||
#define PTP_SDR_UTCREASONABLE_OFFSET 123
|
||
|
||
/*Offsets for Follow_Up (=FU) messages*/
|
||
#define PTP_FU_ASSOCIATEDSEQUENCEID_OFFSET 42
|
||
#define PTP_FU_PRECISEORIGINTIMESTAMP_OFFSET 44
|
||
#define PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET 44
|
||
#define PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET 48
|
||
|
||
/*Offsets for Delay_Resp (=DR) messages*/
|
||
#define PTP_DR_DELAYRECEIPTTIMESTAMP_OFFSET 40
|
||
#define PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET 40
|
||
#define PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET 44
|
||
#define PTP_DR_REQUESTINGSOURCECOMMUNICATIONTECHNOLOGY_OFFSET 49
|
||
#define PTP_DR_REQUESTINGSOURCEUUID_OFFSET 50
|
||
#define PTP_DR_REQUESTINGSOURCEPORTID_OFFSET 56
|
||
#define PTP_DR_REQUESTINGSOURCESEQUENCEID_OFFSET 58
|
||
|
||
/*Offsets for Management (=MM) messages*/
|
||
#define PTP_MM_TARGETCOMMUNICATIONTECHNOLOGY_OFFSET 41
|
||
#define PTP_MM_TARGETUUID_OFFSET 42
|
||
#define PTP_MM_TARGETPORTID_OFFSET 48
|
||
#define PTP_MM_STARTINGBOUNDARYHOPS_OFFSET 50
|
||
#define PTP_MM_BOUNDARYHOPS_OFFSET 52
|
||
#define PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET 55
|
||
#define PTP_MM_PARAMETERLENGTH_OFFSET 58
|
||
/*PARAMETERLENGTH > 0*/
|
||
#define PTP_MM_MESSAGEPARAMETERS_OFFSET 60
|
||
/*PTP_MM_CLOCK_IDENTITY (PARAMETERLENGTH = 64)*/
|
||
#define PTP_MM_CLOCK_IDENTITY_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET 63
|
||
#define PTP_MM_CLOCK_IDENTITY_CLOCKUUIDFIELD_OFFSET 64
|
||
#define PTP_MM_CLOCK_IDENTITY_CLOCKPORTFIELD_OFFSET 74
|
||
#define PTP_MM_CLOCK_IDENTITY_MANUFACTURERIDENTITY_OFFSET 76
|
||
|
||
/*PTP_MM_INITIALIZE_CLOCK (PARAMETERLENGTH = 4)*/
|
||
#define PTP_MM_INITIALIZE_CLOCK_INITIALISATIONKEY_OFFSET 62
|
||
|
||
/*PTP_MM_SET_SUBDOMAIN (PARAMETERLENGTH = 16)*/
|
||
#define PTP_MM_SET_SUBDOMAIN_SUBDOMAINNAME_OFFSET 60
|
||
|
||
/*PTP_MM_DEFAULT_DATA_SET (PARAMETERLENGTH = 76)*/
|
||
#define PTP_MM_DEFAULT_DATA_SET_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET 63
|
||
#define PTP_MM_DEFAULT_DATA_SET_CLOCKUUIDFIELD_OFFSET 64
|
||
#define PTP_MM_DEFAULT_DATA_SET_CLOCKPORTFIELD_OFFSET 74
|
||
#define PTP_MM_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET 79
|
||
#define PTP_MM_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET 80
|
||
#define PTP_MM_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET 86
|
||
#define PTP_MM_DEFAULT_DATA_SET_CLOCKFOLLOWUPCAPABLE_OFFSET 89
|
||
#define PTP_MM_DEFAULT_DATA_SET_PREFERRED_OFFSET 95
|
||
#define PTP_MM_DEFAULT_DATA_SET_INITIALIZABLE_OFFSET 99
|
||
#define PTP_MM_DEFAULT_DATA_SET_EXTERNALTIMING_OFFSET 103
|
||
#define PTP_MM_DEFAULT_DATA_SET_ISBOUNDARYCLOCK_OFFSET 107
|
||
#define PTP_MM_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET 111
|
||
#define PTP_MM_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET 112
|
||
#define PTP_MM_DEFAULT_DATA_SET_NUMBERPORTS_OFFSET 130
|
||
#define PTP_MM_DEFAULT_DATA_SET_NUMBERFOREIGNRECORDS_OFFSET 134
|
||
|
||
/*PTP_MM_UPDATE_DEFAULT_DATA_SET (PARAMETERLENGTH = 36)*/
|
||
#define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET 63
|
||
#define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET 64
|
||
#define PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET 70
|
||
#define PTP_MM_UPDATE_DEFAULT_DATA_SET_PREFERRED_OFFSET 75
|
||
#define PTP_MM_UPDATE_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET 79
|
||
#define PTP_MM_UPDATE_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET 80
|
||
|
||
/*PTP_MM_CURRENT_DATA_SET (PARAMETERLENGTH = 20)*/
|
||
#define PTP_MM_CURRENT_DATA_SET_STEPSREMOVED_OFFSET 62
|
||
#define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTER_OFFSET 64
|
||
#define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET 64
|
||
#define PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET 68
|
||
#define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAY_OFFSET 72
|
||
#define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET 72
|
||
#define PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET 76
|
||
|
||
/*PTP_MM_PARENT_DATA_SET (PARAMETERLENGTH = 90)*/
|
||
#define PTP_MM_PARENT_DATA_SET_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET 63
|
||
#define PTP_MM_PARENT_DATA_SET_PARENTUUID_OFFSET 64
|
||
#define PTP_MM_PARENT_DATA_SET_PARENTPORTID_OFFSET 74
|
||
#define PTP_MM_PARENT_DATA_SET_PARENTLASTSYNCSEQUENCENUMBER_OFFSET 78
|
||
#define PTP_MM_PARENT_DATA_SET_PARENTFOLLOWUPCAPABLE_OFFSET 83
|
||
#define PTP_MM_PARENT_DATA_SET_PARENTEXTERNALTIMING_OFFSET 87
|
||
#define PTP_MM_PARENT_DATA_SET_PARENTVARIANCE_OFFSET 90
|
||
#define PTP_MM_PARENT_DATA_SET_PARENTSTATS_OFFSET 95
|
||
#define PTP_MM_PARENT_DATA_SET_OBSERVEDVARIANCE_OFFSET 98
|
||
#define PTP_MM_PARENT_DATA_SET_OBSERVEDDRIFT_OFFSET 100
|
||
#define PTP_MM_PARENT_DATA_SET_UTCREASONABLE_OFFSET 107
|
||
#define PTP_MM_PARENT_DATA_SET_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 111
|
||
#define PTP_MM_PARENT_DATA_SET_GRANDMASTERUUIDFIELD_OFFSET 112
|
||
#define PTP_MM_PARENT_DATA_SET_GRANDMASTERPORTIDFIELD_OFFSET 122
|
||
#define PTP_MM_PARENT_DATA_SET_GRANDMASTERSTRATUM_OFFSET 127
|
||
#define PTP_MM_PARENT_DATA_SET_GRANDMASTERIDENTIFIER_OFFSET 128
|
||
#define PTP_MM_PARENT_DATA_SET_GRANDMASTERVARIANCE_OFFSET 134
|
||
#define PTP_MM_PARENT_DATA_SET_GRANDMASTERPREFERRED_OFFSET 139
|
||
#define PTP_MM_PARENT_DATA_SET_GRANDMASTERISBOUNDARYCLOCK_OFFSET 143
|
||
#define PTP_MM_PARENT_DATA_SET_GRANDMASTERSEQUENCENUMBER_OFFSET 146
|
||
|
||
/*PTP_MM_PORT_DATA_SET (PARAMETERLENGTH = 52)*/
|
||
#define PTP_MM_PORT_DATA_SET_RETURNEDPORTNUMBER_OFFSET 62
|
||
#define PTP_MM_PORT_DATA_SET_PORTSTATE_OFFSET 67
|
||
#define PTP_MM_PORT_DATA_SET_LASTSYNCEVENTSEQUENCENUMBER_OFFSET 70
|
||
#define PTP_MM_PORT_DATA_SET_LASTGENERALEVENTSEQUENCENUMBER_OFFSET 74
|
||
#define PTP_MM_PORT_DATA_SET_PORTCOMMUNICATIONTECHNOLOGY_OFFSET 79
|
||
#define PTP_MM_PORT_DATA_SET_PORTUUIDFIELD_OFFSET 80
|
||
#define PTP_MM_PORT_DATA_SET_PORTIDFIELD_OFFSET 90
|
||
#define PTP_MM_PORT_DATA_SET_BURSTENABLED_OFFSET 95
|
||
#define PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESSOCTETS_OFFSET 97
|
||
#define PTP_MM_PORT_DATA_SET_EVENTPORTADDRESSOCTETS_OFFSET 98
|
||
#define PTP_MM_PORT_DATA_SET_GENERALPORTADDRESSOCTETS_OFFSET 99
|
||
#define PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESS_OFFSET 100
|
||
#define PTP_MM_PORT_DATA_SET_EVENTPORTADDRESS_OFFSET 106
|
||
#define PTP_MM_PORT_DATA_SET_GENERALPORTADDRESS_OFFSET 110
|
||
|
||
/*PTP_MM_GLOBAL_TIME_DATA_SET (PARAMETERLENGTH = 24)*/
|
||
#define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIME_OFFSET 60
|
||
#define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET 60
|
||
#define PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET 64
|
||
#define PTP_MM_GLOBAL_TIME_DATA_SET_CURRENTUTCOFFSET_OFFSET 70
|
||
#define PTP_MM_GLOBAL_TIME_DATA_SET_LEAP59_OFFSET 75
|
||
#define PTP_MM_GLOBAL_TIME_DATA_SET_LEAP61_OFFSET 79
|
||
#define PTP_MM_GLOBAL_TIME_DATA_SET_EPOCHNUMBER_OFFSET 82
|
||
|
||
/*PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES (PARAMETERLENGTH = 16)*/
|
||
#define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_CURRENTUTCOFFSET_OFFSET 62
|
||
#define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP59_OFFSET 67
|
||
#define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP61_OFFSET 71
|
||
#define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_EPOCHNUMBER_OFFSET 74
|
||
|
||
/*PTP_MM_GET_FOREIGN_DATA_SET (PARAMETERLENGTH = 4)*/
|
||
#define PTP_MM_GET_FOREIGN_DATA_SET_RECORDKEY_OFFSET 62
|
||
|
||
/*PTP_MM_FOREIGN_DATA_SET (PARAMETERLENGTH = 28)*/
|
||
#define PTP_MM_FOREIGN_DATA_SET_RETURNEDPORTNUMBER_OFFSET 62
|
||
#define PTP_MM_FOREIGN_DATA_SET_RETURNEDRECORDNUMBER_OFFSET 66
|
||
#define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERCOMMUNICATIONTECHNOLOGY_OFFSET 71
|
||
#define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERUUIDFIELD_OFFSET 72
|
||
#define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERPORTIDFIELD_OFFSET 82
|
||
#define PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERSYNCS_OFFSET 86
|
||
|
||
/*PTP_MM_SET_SYNC_INTERVAL (PARAMETERLENGTH = 4)*/
|
||
#define PTP_MM_SET_SYNC_INTERVAL_SYNCINTERVAL_OFFSET 62
|
||
|
||
/*PTP_MM_SET_TIME (PARAMETERLENGTH = 8)*/
|
||
#define PTP_MM_SET_TIME_LOCALTIME_OFFSET 60
|
||
#define PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET 60
|
||
#define PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET 64
|
||
|
||
/*END Offsets of fields within a PTP packet.*/
|
||
|
||
/**********************************************************/
|
||
/* flag-field-mask-definitions */
|
||
/**********************************************************/
|
||
#define PTP_FLAGS_LI61_BITMASK 0x01
|
||
#define PTP_FLAGS_LI59_BITMASK 0x02
|
||
#define PTP_FLAGS_BOUNDARY_CLOCK_BITMASK 0x04
|
||
#define PTP_FLAGS_ASSIST_BITMASK 0x08
|
||
#define PTP_FLAGS_EXT_SYNC_BITMASK 0x10
|
||
#define PTP_FLAGS_PARENT_STATS_BITMASK 0x20
|
||
#define PTP_FLAGS_SYNC_BURST_BITMASK 0x40
|
||
|
||
/*END flag-field-mask-definitions*/
|
||
|
||
/**********************************************************/
|
||
/* managementMessage definitions */
|
||
/**********************************************************/
|
||
#define PTP_MM_NULL 0
|
||
#define PTP_MM_OBTAIN_IDENTITY 1
|
||
#define PTP_MM_CLOCK_IDENTITY 2
|
||
#define PTP_MM_INITIALIZE_CLOCK 3
|
||
#define PTP_MM_SET_SUBDOMAIN 4
|
||
#define PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER 5
|
||
#define PTP_MM_SET_DESIGNATED_PREFERRED_MASTER 6
|
||
#define PTP_MM_GET_DEFAULT_DATA_SET 7
|
||
#define PTP_MM_DEFAULT_DATA_SET 8
|
||
#define PTP_MM_UPDATE_DEFAULT_DATA_SET 9
|
||
#define PTP_MM_GET_CURRENT_DATA_SET 10
|
||
#define PTP_MM_CURRENT_DATA_SET 11
|
||
#define PTP_MM_GET_PARENT_DATA_SET 12
|
||
#define PTP_MM_PARENT_DATA_SET 13
|
||
#define PTP_MM_GET_PORT_DATA_SET 14
|
||
#define PTP_MM_PORT_DATA_SET 15
|
||
#define PTP_MM_GET_GLOBAL_TIME_DATA_SET 16
|
||
#define PTP_MM_GLOBAL_TIME_DATA_SET 17
|
||
#define PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES 18
|
||
#define PTP_MM_GOTO_FAULTY_STATE 19
|
||
#define PTP_MM_GET_FOREIGN_DATA_SET 20
|
||
#define PTP_MM_FOREIGN_DATA_SET 21
|
||
#define PTP_MM_SET_SYNC_INTERVAL 22
|
||
#define PTP_MM_DISABLE_PORT 23
|
||
#define PTP_MM_ENABLE_PORT 24
|
||
#define PTP_MM_DISABLE_BURST 25
|
||
#define PTP_MM_ENABLE_BURST 26
|
||
#define PTP_MM_SET_TIME 27
|
||
|
||
static const value_string ptp_managementMessageKey_vals[] = {
|
||
{PTP_MM_NULL, "PTP_MM_NULL"},
|
||
{PTP_MM_OBTAIN_IDENTITY, "PTP_MM_OBTAIN_IDENTITY"},
|
||
{PTP_MM_CLOCK_IDENTITY, "PTP_MM_CLOCK_IDENTITY"},
|
||
{PTP_MM_INITIALIZE_CLOCK, "PTP_MM_INITIALIZE_CLOCK"},
|
||
{PTP_MM_SET_SUBDOMAIN, "PTP_MM_SET_SUBDOMAIN"},
|
||
{PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER, "PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER"},
|
||
{PTP_MM_SET_DESIGNATED_PREFERRED_MASTER, "PTP_MM_SET_DESIGNATED_PREFERRED_MASTER"},
|
||
{PTP_MM_GET_DEFAULT_DATA_SET, "PTP_MM_GET_DEFAULT_DATA_SET"},
|
||
{PTP_MM_DEFAULT_DATA_SET, "PTP_MM_DEFAULT_DATA_SET"},
|
||
{PTP_MM_UPDATE_DEFAULT_DATA_SET, "PTP_MM_UPDATE_DEFAULT_DATA_SET"},
|
||
{PTP_MM_GET_CURRENT_DATA_SET, "PTP_MM_GET_CURRENT_DATA_SET"},
|
||
{PTP_MM_CURRENT_DATA_SET, "PTP_MM_CURRENT_DATA_SET"},
|
||
{PTP_MM_GET_PARENT_DATA_SET, "PTP_MM_GET_PARENT_DATA_SET"},
|
||
{PTP_MM_PARENT_DATA_SET, "PTP_MM_PARENT_DATA_SET"},
|
||
{PTP_MM_GET_PORT_DATA_SET, "PTP_MM_GET_PORT_DATA_SET"},
|
||
{PTP_MM_PORT_DATA_SET, "PTP_MM_PORT_DATA_SET"},
|
||
{PTP_MM_GET_GLOBAL_TIME_DATA_SET, "PTP_MM_GET_GLOBAL_TIME_DATA_SET"},
|
||
{PTP_MM_GLOBAL_TIME_DATA_SET, "PTP_MM_GLOBAL_TIME_DATA_SET"},
|
||
{PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES, "PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES"},
|
||
{PTP_MM_GOTO_FAULTY_STATE, "PTP_MM_GOTO_FAULTY_STATE"},
|
||
{PTP_MM_GET_FOREIGN_DATA_SET, "PTP_MM_GET_FOREIGN_DATA_SET"},
|
||
{PTP_MM_FOREIGN_DATA_SET, "PTP_MM_FOREIGN_DATA_SET"},
|
||
{PTP_MM_SET_SYNC_INTERVAL, "PTP_MM_SET_SYNC_INTERVAL"},
|
||
{PTP_MM_DISABLE_PORT, "PTP_MM_DISABLE_PORT"},
|
||
{PTP_MM_ENABLE_PORT, "PTP_MM_ENABLE_PORT"},
|
||
{PTP_MM_DISABLE_BURST, "PTP_MM_DISABLE_BURST"},
|
||
{PTP_MM_ENABLE_BURST, "PTP_MM_ENABLE_BURST"},
|
||
{PTP_MM_SET_TIME, "PTP_MM_SET_TIME"},
|
||
{0, NULL } };
|
||
/*same again but better readable text for info column*/
|
||
static const value_string ptp_managementMessageKey_infocolumn_vals[] = {
|
||
{PTP_MM_NULL, "Null"},
|
||
{PTP_MM_OBTAIN_IDENTITY, "Obtain Identity"},
|
||
{PTP_MM_CLOCK_IDENTITY, "Clock Identity"},
|
||
{PTP_MM_INITIALIZE_CLOCK, "Initialize Clock"},
|
||
{PTP_MM_SET_SUBDOMAIN, "Set Subdomain"},
|
||
{PTP_MM_CLEAR_DESIGNATED_PREFERRED_MASTER, "Clear Designated Preferred Master"},
|
||
{PTP_MM_SET_DESIGNATED_PREFERRED_MASTER, "Set Designated Preferred Master"},
|
||
{PTP_MM_GET_DEFAULT_DATA_SET, "Get Default Data Set"},
|
||
{PTP_MM_DEFAULT_DATA_SET, "Default Data Set"},
|
||
{PTP_MM_UPDATE_DEFAULT_DATA_SET, "Update Default Data Set"},
|
||
{PTP_MM_GET_CURRENT_DATA_SET, "Get Current Data Set"},
|
||
{PTP_MM_CURRENT_DATA_SET, "Current Data Set"},
|
||
{PTP_MM_GET_PARENT_DATA_SET, "Get Parent Data Set"},
|
||
{PTP_MM_PARENT_DATA_SET, "Parent Data Set"},
|
||
{PTP_MM_GET_PORT_DATA_SET, "Get Port Data Set"},
|
||
{PTP_MM_PORT_DATA_SET, "Port Data Set"},
|
||
{PTP_MM_GET_GLOBAL_TIME_DATA_SET, "Get Global Time Data Set"},
|
||
{PTP_MM_GLOBAL_TIME_DATA_SET, "Global Time Data Set"},
|
||
{PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES, "Update Global Time Properties"},
|
||
{PTP_MM_GOTO_FAULTY_STATE, "Goto Faulty State"},
|
||
{PTP_MM_GET_FOREIGN_DATA_SET, "Get Foreign Data Set"},
|
||
{PTP_MM_FOREIGN_DATA_SET, "Foreign Data Set"},
|
||
{PTP_MM_SET_SYNC_INTERVAL, "Set Sync Interval"},
|
||
{PTP_MM_DISABLE_PORT, "Disable Port"},
|
||
{PTP_MM_ENABLE_PORT, "Enable Port"},
|
||
{PTP_MM_DISABLE_BURST, "Disable Burst"},
|
||
{PTP_MM_ENABLE_BURST, "Enable Burst"},
|
||
{PTP_MM_SET_TIME, "Set Time"},
|
||
{0, NULL } };
|
||
|
||
/*END managementMessage definitions*/
|
||
|
||
/**********************************************************/
|
||
/* CommunicationId definitions */
|
||
/**********************************************************/
|
||
#define PTP_CLOSED 0
|
||
#define PTP_ETHER 1
|
||
#define PTP_FFBUS 4
|
||
#define PTP_PROFIBUS 5
|
||
#define PTP_LON 6
|
||
#define PTP_DNET 7
|
||
#define PTP_SDS 8
|
||
#define PTP_CONTROLNET 9
|
||
#define PTP_CANOPEN 10
|
||
#define PTP_IEEE1394 243
|
||
#define PTP_IEEE802_11A 244
|
||
#define PTP_IEEE_WIRELESS 245
|
||
#define PTP_INFINIBAND 246
|
||
#define PTP_BLUETOOTH 247
|
||
#define PTP_IEEE802_15_1 248
|
||
#define PTP_IEEE1451_3 249
|
||
#define PTP_IEEE1451_5 250
|
||
#define PTP_USB 251
|
||
#define PTP_ISA 252
|
||
#define PTP_PCI 253
|
||
#define PTP_VXI 254
|
||
#define PTP_DEFAULT 255
|
||
|
||
static const value_string ptp_communicationid_vals[] = {
|
||
{PTP_CLOSED, "Closed system outside the scope of this standard."},
|
||
{PTP_ETHER, "IEEE 802.3 (Ethernet)"},
|
||
{PTP_FFBUS, "FoundationFieldbus"},
|
||
{PTP_PROFIBUS, "PROFIBUS"},
|
||
{PTP_LON, "LonTalk"},
|
||
{PTP_DNET, "DeviceNet"},
|
||
{PTP_SDS, "SmartDistributedSystem"},
|
||
{PTP_CONTROLNET, "ControlNet"},
|
||
{PTP_CANOPEN, "CANopen"},
|
||
{PTP_IEEE1394, "IEEE 1394"},
|
||
{PTP_IEEE802_11A, "IEEE 802.11a"},
|
||
{PTP_IEEE_WIRELESS, "IEEE 802.11b"},
|
||
{PTP_INFINIBAND, "InfiniBand"},
|
||
{PTP_BLUETOOTH, "Bluetooth wireless"},
|
||
{PTP_IEEE802_15_1, "IEEE 802.15.1"},
|
||
{PTP_IEEE1451_3, "IEEE 1451.3"},
|
||
{PTP_IEEE1451_5, "IEEE 1451.5"},
|
||
{PTP_USB, "USB bus"},
|
||
{PTP_ISA, "ISA bus"},
|
||
{PTP_PCI, "PCI bus"},
|
||
{PTP_VXI, "VXI bus"},
|
||
{PTP_DEFAULT, "Default value"},
|
||
{0, NULL } };
|
||
|
||
/*END CommunicationId definitions*/
|
||
|
||
/**********************************************************/
|
||
/* PTP message types (PTP_CONTROL field) */
|
||
/**********************************************************/
|
||
#define PTP_SYNC_MESSAGE 0x00
|
||
#define PTP_DELAY_REQ_MESSAGE 0x01
|
||
#define PTP_FOLLOWUP_MESSAGE 0x02
|
||
#define PTP_DELAY_RESP_MESSAGE 0x03
|
||
#define PTP_MANAGEMENT_MESSAGE 0x04
|
||
#define PTP_OTHER_MESSAGE 0x05
|
||
|
||
static const value_string ptp_control_vals[] = {
|
||
{PTP_SYNC_MESSAGE, "Sync Message"},
|
||
{PTP_DELAY_REQ_MESSAGE, "Delay_Req Message"},
|
||
{PTP_FOLLOWUP_MESSAGE, "Follow_Up Message"},
|
||
{PTP_DELAY_RESP_MESSAGE, "Delay_Resp Message"},
|
||
{PTP_MANAGEMENT_MESSAGE, "Management Message"},
|
||
{PTP_OTHER_MESSAGE, "Other Message"},
|
||
{0, NULL } };
|
||
|
||
/*END PTP message types*/
|
||
|
||
/**********************************************************/
|
||
/* Channel values for the PTP_MESSAGETYPE field */
|
||
/**********************************************************/
|
||
#define PTP_MESSAGETYPE_EVENT 0x01
|
||
#define PTP_MESSAGETYPE_GENERAL 0x02
|
||
|
||
static const value_string ptp_messagetype_vals[] = {
|
||
{PTP_MESSAGETYPE_EVENT, "Event Message"},
|
||
{PTP_MESSAGETYPE_GENERAL, "General Message"},
|
||
{0, NULL } };
|
||
|
||
/*END channel values for the PTP_MESSAGETYPE field*/
|
||
|
||
/* Channel values for boolean vals (FLAGS)*/
|
||
|
||
static const value_string ptp_bool_vals[] = {
|
||
{1, "True"},
|
||
{0, "False"},
|
||
{0, NULL }};
|
||
|
||
/**********************************************************/
|
||
/* Initialize the protocol and registered fields */
|
||
/**********************************************************/
|
||
|
||
static int hf_ptp_versionptp = -1;
|
||
static int hf_ptp_versionnetwork = -1;
|
||
static int hf_ptp_subdomain = -1;
|
||
static int hf_ptp_messagetype = -1;
|
||
static int hf_ptp_sourcecommunicationtechnology = -1;
|
||
static int hf_ptp_sourceuuid = -1;
|
||
static int hf_ptp_sourceportid = -1;
|
||
static int hf_ptp_sequenceid = -1;
|
||
static int hf_ptp_control = -1;
|
||
static int hf_ptp_flags = -1;
|
||
static int hf_ptp_flags_li61 = -1;
|
||
static int hf_ptp_flags_li59 = -1;
|
||
static int hf_ptp_flags_boundary_clock = -1;
|
||
static int hf_ptp_flags_assist = -1;
|
||
static int hf_ptp_flags_ext_sync = -1;
|
||
static int hf_ptp_flags_parent = -1;
|
||
static int hf_ptp_flags_sync_burst = -1;
|
||
|
||
/*Fields for ptp_sync and delay_req (=sdr) messages*/
|
||
static int hf_ptp_sdr_origintimestamp = -1; /*Field for seconds & nanoseconds*/
|
||
static int hf_ptp_sdr_origintimestamp_seconds = -1;
|
||
static int hf_ptp_sdr_origintimestamp_nanoseconds = -1;
|
||
static int hf_ptp_sdr_epochnumber = -1;
|
||
static int hf_ptp_sdr_currentutcoffset = -1;
|
||
static int hf_ptp_sdr_grandmastercommunicationtechnology = -1;
|
||
static int hf_ptp_sdr_grandmasterclockuuid = -1;
|
||
static int hf_ptp_sdr_grandmasterportid = -1;
|
||
static int hf_ptp_sdr_grandmastersequenceid = -1;
|
||
static int hf_ptp_sdr_grandmasterclockstratum = -1;
|
||
static int hf_ptp_sdr_grandmasterclockidentifier = -1;
|
||
static int hf_ptp_sdr_grandmasterclockvariance = -1;
|
||
static int hf_ptp_sdr_grandmasterpreferred = -1;
|
||
static int hf_ptp_sdr_grandmasterisboundaryclock = -1;
|
||
static int hf_ptp_sdr_syncinterval = -1;
|
||
static int hf_ptp_sdr_localclockvariance = -1;
|
||
static int hf_ptp_sdr_localstepsremoved = -1;
|
||
static int hf_ptp_sdr_localclockstratum = -1;
|
||
static int hf_ptp_sdr_localclockidentifier = -1;
|
||
static int hf_ptp_sdr_parentcommunicationtechnology = -1;
|
||
static int hf_ptp_sdr_parentuuid = -1;
|
||
static int hf_ptp_sdr_parentportfield = -1;
|
||
static int hf_ptp_sdr_estimatedmastervariance = -1;
|
||
static int hf_ptp_sdr_estimatedmasterdrift = -1;
|
||
static int hf_ptp_sdr_utcreasonable = -1;
|
||
|
||
/*Fields for follow_up (=fu) messages*/
|
||
static int hf_ptp_fu_associatedsequenceid = -1;
|
||
static int hf_ptp_fu_preciseorigintimestamp = -1;
|
||
static int hf_ptp_fu_preciseorigintimestamp_seconds = -1;
|
||
static int hf_ptp_fu_preciseorigintimestamp_nanoseconds = -1;
|
||
|
||
/*Fields for delay_resp (=dr) messages*/
|
||
static int hf_ptp_dr_delayreceipttimestamp = -1;
|
||
static int hf_ptp_dr_delayreceipttimestamp_seconds = -1;
|
||
static int hf_ptp_dr_delayreceipttimestamp_nanoseconds = -1;
|
||
static int hf_ptp_dr_requestingsourcecommunicationtechnology = -1;
|
||
static int hf_ptp_dr_requestingsourceuuid = -1;
|
||
static int hf_ptp_dr_requestingsourceportid = -1;
|
||
static int hf_ptp_dr_requestingsourcesequenceid = -1;
|
||
|
||
/*Fields for management (=mm) messages*/
|
||
static int hf_ptp_mm_targetcommunicationtechnology = -1;
|
||
static int hf_ptp_mm_targetuuid = -1;
|
||
static int hf_ptp_mm_targetportid = -1;
|
||
static int hf_ptp_mm_startingboundaryhops = -1;
|
||
static int hf_ptp_mm_boundaryhops = -1;
|
||
static int hf_ptp_mm_managementmessagekey = -1;
|
||
static int hf_ptp_mm_parameterlength = -1;
|
||
/*parameterlength > 0*/
|
||
static int hf_ptp_mm_messageparameters = -1;
|
||
/*ptp_mm_clock_identity (parameterlength = 64)*/
|
||
static int hf_ptp_mm_clock_identity_clockcommunicationtechnology = -1;
|
||
static int hf_ptp_mm_clock_identity_clockuuidfield = -1;
|
||
static int hf_ptp_mm_clock_identity_clockportfield = -1;
|
||
static int hf_ptp_mm_clock_identity_manufactureridentity = -1;
|
||
|
||
/*ptp_mm_initialize_clock (parameterlength = 4)*/
|
||
static int hf_ptp_mm_initialize_clock_initialisationkey = -1;
|
||
|
||
/*ptp_mm_set_subdomain (parameterlength = 16)*/
|
||
static int hf_ptp_mm_set_subdomain_subdomainname = -1;
|
||
|
||
/*ptp_mm_default_data_set (parameterlength = 76)*/
|
||
static int hf_ptp_mm_default_data_set_clockcommunicationtechnology = -1;
|
||
static int hf_ptp_mm_default_data_set_clockuuidfield = -1;
|
||
static int hf_ptp_mm_default_data_set_clockportfield = -1;
|
||
static int hf_ptp_mm_default_data_set_clockstratum = -1;
|
||
static int hf_ptp_mm_default_data_set_clockidentifier = -1;
|
||
static int hf_ptp_mm_default_data_set_clockvariance = -1;
|
||
static int hf_ptp_mm_default_data_set_clockfollowupcapable = -1;
|
||
static int hf_ptp_mm_default_data_set_preferred = -1;
|
||
static int hf_ptp_mm_default_data_set_initializable = -1;
|
||
static int hf_ptp_mm_default_data_set_externaltiming = -1;
|
||
static int hf_ptp_mm_default_data_set_isboundaryclock = -1;
|
||
static int hf_ptp_mm_default_data_set_syncinterval = -1;
|
||
static int hf_ptp_mm_default_data_set_subdomainname = -1;
|
||
static int hf_ptp_mm_default_data_set_numberports = -1;
|
||
static int hf_ptp_mm_default_data_set_numberforeignrecords = -1;
|
||
|
||
/*ptp_mm_update_default_data_set (parameterlength = 36)*/
|
||
static int hf_ptp_mm_update_default_data_set_clockstratum = -1;
|
||
static int hf_ptp_mm_update_default_data_set_clockidentifier = -1;
|
||
static int hf_ptp_mm_update_default_data_set_clockvariance = -1;
|
||
static int hf_ptp_mm_update_default_data_set_preferred = -1;
|
||
static int hf_ptp_mm_update_default_data_set_syncinterval = -1;
|
||
static int hf_ptp_mm_update_default_data_set_subdomainname = -1;
|
||
|
||
/*ptp_mm_current_data_set (parameterlength = 20)*/
|
||
static int hf_ptp_mm_current_data_set_stepsremoved = -1;
|
||
static int hf_ptp_mm_current_data_set_offsetfrommaster = -1;
|
||
static int hf_ptp_mm_current_data_set_offsetfrommasterseconds = -1;
|
||
static int hf_ptp_mm_current_data_set_offsetfrommasternanoseconds = -1;
|
||
static int hf_ptp_mm_current_data_set_onewaydelay = -1;
|
||
static int hf_ptp_mm_current_data_set_onewaydelayseconds = -1;
|
||
static int hf_ptp_mm_current_data_set_onewaydelaynanoseconds = -1;
|
||
|
||
/*ptp_mm_parent_data_set (parameterlength = 90)*/
|
||
static int hf_ptp_mm_parent_data_set_parentcommunicationtechnology = -1;
|
||
static int hf_ptp_mm_parent_data_set_parentuuid = -1;
|
||
static int hf_ptp_mm_parent_data_set_parentportid = -1;
|
||
static int hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber = -1;
|
||
static int hf_ptp_mm_parent_data_set_parentfollowupcapable = -1;
|
||
static int hf_ptp_mm_parent_data_set_parentexternaltiming = -1;
|
||
static int hf_ptp_mm_parent_data_set_parentvariance = -1;
|
||
static int hf_ptp_mm_parent_data_set_parentstats = -1;
|
||
static int hf_ptp_mm_parent_data_set_observedvariance = -1;
|
||
static int hf_ptp_mm_parent_data_set_observeddrift = -1;
|
||
static int hf_ptp_mm_parent_data_set_utcreasonable = -1;
|
||
static int hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology = -1;
|
||
static int hf_ptp_mm_parent_data_set_grandmasteruuidfield = -1;
|
||
static int hf_ptp_mm_parent_data_set_grandmasterportidfield = -1;
|
||
static int hf_ptp_mm_parent_data_set_grandmasterstratum = -1;
|
||
static int hf_ptp_mm_parent_data_set_grandmasteridentifier = -1;
|
||
static int hf_ptp_mm_parent_data_set_grandmastervariance = -1;
|
||
static int hf_ptp_mm_parent_data_set_grandmasterpreferred = -1;
|
||
static int hf_ptp_mm_parent_data_set_grandmasterisboundaryclock = -1;
|
||
static int hf_ptp_mm_parent_data_set_grandmastersequencenumber = -1;
|
||
|
||
/*ptp_mm_port_data_set (parameterlength = 52)*/
|
||
static int hf_ptp_mm_port_data_set_returnedportnumber = -1;
|
||
static int hf_ptp_mm_port_data_set_portstate = -1;
|
||
static int hf_ptp_mm_port_data_set_lastsynceventsequencenumber = -1;
|
||
static int hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber = -1;
|
||
static int hf_ptp_mm_port_data_set_portcommunicationtechnology = -1;
|
||
static int hf_ptp_mm_port_data_set_portuuidfield = -1;
|
||
static int hf_ptp_mm_port_data_set_portidfield = -1;
|
||
static int hf_ptp_mm_port_data_set_burstenabled = -1;
|
||
static int hf_ptp_mm_port_data_set_subdomainaddressoctets = -1;
|
||
static int hf_ptp_mm_port_data_set_eventportaddressoctets = -1;
|
||
static int hf_ptp_mm_port_data_set_generalportaddressoctets = -1;
|
||
static int hf_ptp_mm_port_data_set_subdomainaddress = -1;
|
||
static int hf_ptp_mm_port_data_set_eventportaddress = -1;
|
||
static int hf_ptp_mm_port_data_set_generalportaddress = -1;
|
||
|
||
/*ptp_mm_global_time_data_set (parameterlength = 24)*/
|
||
static int hf_ptp_mm_global_time_data_set_localtime = -1;
|
||
static int hf_ptp_mm_global_time_data_set_localtimeseconds = -1;
|
||
static int hf_ptp_mm_global_time_data_set_localtimenanoseconds = -1;
|
||
static int hf_ptp_mm_global_time_data_set_currentutcoffset = -1;
|
||
static int hf_ptp_mm_global_time_data_set_leap59 = -1;
|
||
static int hf_ptp_mm_global_time_data_set_leap61 = -1;
|
||
static int hf_ptp_mm_global_time_data_set_epochnumber = -1;
|
||
|
||
/*ptp_mm_update_global_time_properties (parameterlength = 16)*/
|
||
static int hf_ptp_mm_update_global_time_properties_currentutcoffset = -1;
|
||
static int hf_ptp_mm_update_global_time_properties_leap59 = -1;
|
||
static int hf_ptp_mm_update_global_time_properties_leap61 = -1;
|
||
static int hf_ptp_mm_update_global_time_properties_epochnumber = -1;
|
||
|
||
/*ptp_mm_get_foreign_data_set (parameterlength = 4)*/
|
||
static int hf_ptp_mm_get_foreign_data_set_recordkey = -1;
|
||
|
||
/*ptp_mm_foreign_data_set (parameterlength = 28)*/
|
||
static int hf_ptp_mm_foreign_data_set_returnedportnumber = -1;
|
||
static int hf_ptp_mm_foreign_data_set_returnedrecordnumber = -1;
|
||
static int hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology = -1;
|
||
static int hf_ptp_mm_foreign_data_set_foreignmasteruuidfield = -1;
|
||
static int hf_ptp_mm_foreign_data_set_foreignmasterportidfield = -1;
|
||
static int hf_ptp_mm_foreign_data_set_foreignmastersyncs = -1;
|
||
|
||
/*ptp_mm_set_sync_interval (parameterlength = 4)*/
|
||
static int hf_ptp_mm_set_sync_interval_syncinterval = -1;
|
||
|
||
/*ptp_mm_set_time (parameterlength = 8)*/
|
||
static int hf_ptp_mm_set_time_localtime = -1;
|
||
static int hf_ptp_mm_set_time_localtimeseconds = -1;
|
||
static int hf_ptp_mm_set_time_localtimenanoseconds = -1;
|
||
|
||
/*END Initialize the protocol and registered fields */
|
||
|
||
/* Initialize the subtree pointers */
|
||
static gint ett_ptp = -1;
|
||
static gint ett_ptp_flags = -1;
|
||
static gint ett_ptp_time = -1;
|
||
static gint ett_ptp_time2 = -1;
|
||
|
||
/* END Definitions and fields for PTPv1 dissection. */
|
||
|
||
|
||
|
||
|
||
|
||
/***********************************************************************************/
|
||
/* Definitions and fields for PTPv2 dissection. */
|
||
/***********************************************************************************/
|
||
|
||
|
||
/**********************************************************/
|
||
/* Offsets of fields within a PTPv2 packet. */
|
||
/**********************************************************/
|
||
|
||
/*Common offsets for all Messages (Sync, Delay_Req, Follow_Up, Delay_Resp ....)*/
|
||
#define PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET 0
|
||
#define PTP_V2_VERSIONPTP_OFFSET 1
|
||
#define PTP_V2_MESSAGE_LENGTH_OFFSET 2
|
||
#define PTP_V2_DOMAIN_NUMBER_OFFSET 4
|
||
#define PTP_V2_FLAGS_OFFSET 6
|
||
#define PTP_V2_CORRECTION_OFFSET 8
|
||
#define PTP_V2_CORRECTIONNS_OFFSET 8
|
||
#define PTP_V2_CORRECTIONSUBNS_OFFSET 14
|
||
#define PTP_V2_CLOCKIDENTITY_OFFSET 20 /*++*/
|
||
#define PTP_V2_SOURCEPORTID_OFFSET 28
|
||
#define PTP_V2_SEQUENCEID_OFFSET 30
|
||
#define PTP_V2_CONTROL_OFFSET 32
|
||
#define PTP_V2_LOGMESSAGEPERIOD_OFFSET 33
|
||
|
||
|
||
/*Offsets for PTP_Announce (=AN) messages*/
|
||
#define PTP_V2_AN_ORIGINTIMESTAMP_OFFSET 34
|
||
#define PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET 34
|
||
#define PTP_V2_AN_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
|
||
#define PTP_V2_AN_ORIGINCURRENTUTCOFFSET_OFFSET 44
|
||
#define PTP_V2_AN_TIMESOURCE_OFFSET 47
|
||
#define PTP_V2_AN_LOCALSTEPSREMOVED_OFFSET 48
|
||
#define PTP_V2_AN_GRANDMASTERCLOCKIDENTITY_OFFSET 50 /*++ bis ++*/
|
||
#define PTP_V2_AN_GRANDMASTERCLOCKCLASS_OFFSET 58
|
||
#define PTP_V2_AN_GRANDMASTERCLOCKACCURACY_OFFSET 59
|
||
#define PTP_V2_AN_GRANDMASTERCLOCKVARIANCE_OFFSET 60 /* ++ */
|
||
#define PTP_V2_AN_PRIORITY_1_OFFSET 62
|
||
#define PTP_V2_AN_PRIORITY_2_OFFSET 63
|
||
|
||
/*Offsets for PTP_Sync AND PTP_DelayRequest (=SDR) messages*/
|
||
#define PTP_V2_SDR_ORIGINTIMESTAMP_OFFSET 34
|
||
#define PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET 34
|
||
#define PTP_V2_SDR_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
|
||
|
||
|
||
/*Offsets for PTP_Follow_Up (=FU) messages*/
|
||
#define PTP_V2_FU_PRECISEORIGINTIMESTAMP_OFFSET 34
|
||
#define PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET 34
|
||
#define PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET 40
|
||
|
||
/*Offsets for PTP_DelayResponse (=DR) messages*/
|
||
#define PTP_V2_DR_RECEIVETIMESTAMP_OFFSET 34
|
||
#define PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET 34
|
||
#define PTP_V2_DR_RECEIVETIMESTAMPNANOSECONDS_OFFSET 40
|
||
#define PTP_V2_DR_REQUESTINGPORTIDENTITY_OFFSET 44 /* ++ */
|
||
#define PTP_V2_DR_REQUESTINGSOURCEPORTID_OFFSET 52
|
||
|
||
|
||
/*Offsets for PTP_PDelayRequest (=PDRQ) messages*/
|
||
#define PTP_V2_PDRQ_ORIGINTIMESTAMP_OFFSET 34
|
||
#define PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET 34
|
||
#define PTP_V2_PDRQ_ORIGINTIMESTAMPNANOSECONDS_OFFSET 40
|
||
#define PTP_V2_PDRQ_RESERVED_OFFSET 44
|
||
|
||
|
||
/*Offsets for PTP_PDelayResponse (=PDRS) messages*/
|
||
#define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMP_OFFSET 34
|
||
#define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET 34
|
||
#define PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPNANOSECONDS_OFFSET 40
|
||
#define PTP_V2_PDRS_REQUESTINGPORTIDENTITY_OFFSET 44 /* ++ */
|
||
#define PTP_V2_PDRS_REQUESTINGSOURCEPORTID_OFFSET 52 /* ++ */
|
||
|
||
|
||
/*Offsets for PTP_PDelayResponseFollowUp (=PDFU) messages*/
|
||
#define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMP_OFFSET 34
|
||
#define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET 34
|
||
#define PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPNANOSECONDS_OFFSET 40
|
||
#define PTP_V2_PDFU_REQUESTINGPORTIDENTITY_OFFSET 44 /* ++ */
|
||
#define PTP_V2_PDFU_REQUESTINGSOURCEPORTID_OFFSET 52
|
||
|
||
|
||
/*Offsets for PTP_Signalling (=SIG) messages*/
|
||
#define PTP_V2_SIG_TARGETPORTIDENTITY_OFFSET 34
|
||
#define PTP_V2_SIG_TARGETPORTID_OFFSET 42
|
||
|
||
|
||
/*Offsets for PTP_Management (=MM) messages*/
|
||
#define PTP_V2_MM_TARGETPORTIDENTITY_OFFSET 34 /* ++ */
|
||
#define PTP_V2_MM_TARGETPORTID_OFFSET 42
|
||
#define PTP_V2_MM_STARTINGBOUNDARYHOPS_OFFSET 44
|
||
#define PTP_V2_MM_BOUNDARYHOPS_OFFSET 45
|
||
#define PTP_V2_MM_ACTION_OFFSET 46 /* ++ */
|
||
#define PTP_V2_MM_RESERVED_OFFSET 47 /* ++ */
|
||
|
||
|
||
#define PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK 0x10
|
||
|
||
/**********************************************************/
|
||
/* flag-field-mask-definitions */
|
||
/**********************************************************/
|
||
#define PTP_V2_FLAGS_LI61_BITMASK 0x0001
|
||
#define PTP_V2_FLAGS_LI59_BITMASK 0x0002
|
||
#define PTP_V2_FLAGS_UTC_OFFSET_VALID_BITMASK 0x0004
|
||
#define PTP_V2_FLAGS_PTP_TIMESCALE_BITMASK 0x0008
|
||
#define PTP_V2_FLAGS_TIME_TRACEABLE_BITMASK 0x0010
|
||
#define PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK 0x0020
|
||
#define PTP_V2_FLAGS_ALTERNATE_BITMASK 0x0100
|
||
#define PTP_V2_FLAGS_TWO_STEP_BITMASK 0x0200
|
||
#define PTP_V2_FLAGS_UNICAST_BITMASK 0x0400
|
||
#define PTP_V2_FLAGS_SPECIFIC1_BITMASK 0x2000
|
||
#define PTP_V2_FLAGS_SPECIFIC2_BITMASK 0x4000
|
||
#define PTP_V2_FLAGS_SECURITY_BITMASK 0x8000
|
||
|
||
|
||
|
||
/**********************************************************/
|
||
/* PTP v2 message ids (ptp messageid field) */
|
||
/**********************************************************/
|
||
#define PTP_V2_SYNC_MESSAGE 0x00
|
||
#define PTP_V2_DELAY_REQ_MESSAGE 0x01
|
||
#define PTP_V2_PATH_DELAY_REQ_MESSAGE 0x02
|
||
#define PTP_V2_PATH_DELAY_RESP_MESSAGE 0x03
|
||
#define PTP_V2_FOLLOWUP_MESSAGE 0x08
|
||
#define PTP_V2_DELAY_RESP_MESSAGE 0x09
|
||
#define PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE 0x0A
|
||
#define PTP_V2_ANNOUNCE_MESSAGE 0x0B
|
||
#define PTP_V2_SIGNALLING_MESSAGE 0x0C
|
||
#define PTP_V2_MANAGEMENT_MESSAGE 0x0D
|
||
|
||
|
||
static const value_string ptp_v2_messageid_vals[] = {
|
||
{PTP_V2_SYNC_MESSAGE, "Sync Message"},
|
||
{PTP_V2_DELAY_REQ_MESSAGE, "Delay_Req Message"},
|
||
{PTP_V2_PATH_DELAY_REQ_MESSAGE, "Path_Delay_Req Message"},
|
||
{PTP_V2_PATH_DELAY_RESP_MESSAGE, "Path_Delay_Resp Message"},
|
||
{PTP_V2_FOLLOWUP_MESSAGE, "Follow_Up Message"},
|
||
{PTP_V2_DELAY_RESP_MESSAGE, "Delay_Resp Message"},
|
||
{PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE, "Path_Delay_Resp_Follow_Up Message"},
|
||
{PTP_V2_ANNOUNCE_MESSAGE, "Announce Message"},
|
||
{PTP_V2_SIGNALLING_MESSAGE, "Signalling Message"},
|
||
{PTP_V2_MANAGEMENT_MESSAGE, "Management Message"},
|
||
{0, NULL }
|
||
};
|
||
|
||
static const value_string ptp_v2_clockaccuracy_vals[] = {
|
||
{0x20, "The time is accurate to within 25 ns"},
|
||
{0x21, "The time is accurate to within 100 ns"},
|
||
{0x22, "The time is accurate to within 250 ns"},
|
||
{0x23, "The time is accurate to within 1 us"},
|
||
{0x24, "The time is accurate to within 2,5 us"},
|
||
{0x25, "The time is accurate to within 10 us"},
|
||
{0x26, "The time is accurate to within 25 us"},
|
||
{0x27, "The time is accurate to within 100 us"},
|
||
{0x28, "The time is accurate to within 250 us"},
|
||
{0x29, "The time is accurate to within 1 ms"},
|
||
{0x2A, "The time is accurate to within 2,5 ms"},
|
||
{0x2B, "The time is accurate to within 10 ms"},
|
||
{0x2C, "The time is accurate to within 25 ms"},
|
||
{0x2D, "The time is accurate to within 100 ms"},
|
||
{0x2E, "The time is accurate to within 250 ms"},
|
||
{0x2F, "The time is accurate to within 1 s"},
|
||
{0x30, "The time is accurate to within 10 s"},
|
||
{0xFE, "Accuracy Unknown"},
|
||
{0, NULL }
|
||
};
|
||
|
||
static const value_string ptp_v2_timesource_vals[] = {
|
||
{0x10, "ATOMIC_CLOCK"},
|
||
{0x20, "GPS"},
|
||
{0x30, "TERRESTRIAL_RADIO"},
|
||
{0x40, "PTP"},
|
||
{0x50, "NTP"},
|
||
{0x60, "HAND_SET"},
|
||
{0x90, "OTHER"},
|
||
{0xA0, "INTERNAL_OSCILLATOR"},
|
||
{0xFF, "reserved"},
|
||
{0, NULL }
|
||
};
|
||
|
||
static const value_string ptp_v2_mm_action_vals[] = {
|
||
{0x0, "GET"},
|
||
{0x1, "SET"},
|
||
{0x2, "RESPONSE"},
|
||
{0x3, "COMMAND"},
|
||
{0x4, "ACKNOWLEDGE"},
|
||
{0, NULL }
|
||
};
|
||
|
||
/**********************************************************/
|
||
/* Initialize the protocol and registered fields */
|
||
/**********************************************************/
|
||
|
||
static int hf_ptp_v2_transportspecific = -1;
|
||
static int hf_ptp_v2_transportspecific_v1_compatibility = -1; /* over UDP */
|
||
static int hf_ptp_v2_transportspecific_802as_conform = -1; /* over Ethernet */
|
||
static int hf_ptp_v2_messageid = -1;
|
||
static int hf_ptp_v2_versionptp = -1;
|
||
static int hf_ptp_v2_messagelength = -1;
|
||
static int hf_ptp_v2_domainnumber = -1;
|
||
static int hf_ptp_v2_flags = -1;
|
||
static int hf_ptp_v2_flags_alternatemaster = -1;
|
||
static int hf_ptp_v2_flags_twostep = -1;
|
||
static int hf_ptp_v2_flags_unicast = -1;
|
||
static int hf_ptp_v2_flags_specific1 = -1;
|
||
static int hf_ptp_v2_flags_specific2 = -1;
|
||
static int hf_ptp_v2_flags_security = -1;
|
||
static int hf_ptp_v2_flags_li61 = -1;
|
||
static int hf_ptp_v2_flags_li59 = -1;
|
||
static int hf_ptp_v2_flags_utcoffsetvalid = -1;
|
||
static int hf_ptp_v2_flags_ptptimescale = -1;
|
||
static int hf_ptp_v2_flags_timetraceable = -1;
|
||
static int hf_ptp_v2_flags_frequencytraceable = -1;
|
||
static int hf_ptp_v2_correction = -1;
|
||
static int hf_ptp_v2_correctionns = -1;
|
||
static int hf_ptp_v2_correctionsubns = -1;
|
||
static int hf_ptp_v2_clockidentity = -1;
|
||
static int hf_ptp_v2_sourceportid = -1;
|
||
static int hf_ptp_v2_sequenceid = -1;
|
||
static int hf_ptp_v2_control = -1;
|
||
static int hf_ptp_v2_logmessageperiod = -1;
|
||
|
||
|
||
/*Fields for PTP_Announce (=an) messages*/
|
||
static int hf_ptp_v2_an_origintimestamp = -1; /*Field for seconds & nanoseconds*/
|
||
static int hf_ptp_v2_an_origintimestamp_seconds = -1;
|
||
static int hf_ptp_v2_an_origintimestamp_nanoseconds = -1;
|
||
static int hf_ptp_v2_an_origincurrentutcoffset = -1;
|
||
static int hf_ptp_v2_an_timesource = -1;
|
||
static int hf_ptp_v2_an_localstepsremoved = -1;
|
||
static int hf_ptp_v2_an_grandmasterclockidentity = -1;
|
||
static int hf_ptp_v2_an_grandmasterclockclass = -1;
|
||
static int hf_ptp_v2_an_grandmasterclockaccuracy = -1;
|
||
static int hf_ptp_v2_an_grandmasterclockvariance = -1;
|
||
static int hf_ptp_v2_an_priority1 = -1;
|
||
static int hf_ptp_v2_an_priority2 = -1;
|
||
|
||
|
||
/*Fields for PTP_Sync AND PTP_DelayRequest (=sdr) messages*/
|
||
static int hf_ptp_v2_sdr_origintimestamp = -1; /*Field for seconds & nanoseconds*/
|
||
static int hf_ptp_v2_sdr_origintimestamp_seconds = -1;
|
||
static int hf_ptp_v2_sdr_origintimestamp_nanoseconds = -1;
|
||
|
||
|
||
/*Fields for PTP_Follow_Up (=fu) messages*/
|
||
static int hf_ptp_v2_fu_preciseorigintimestamp = -1; /*Field for seconds & nanoseconds*/
|
||
static int hf_ptp_v2_fu_preciseorigintimestamp_seconds = -1;
|
||
static int hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds = -1;
|
||
|
||
|
||
/*Fields for PTP_DelayResponse (=dr) messages*/
|
||
static int hf_ptp_v2_dr_receivetimestamp = -1; /*Field for seconds & nanoseconds*/
|
||
static int hf_ptp_v2_dr_receivetimestamp_seconds = -1;
|
||
static int hf_ptp_v2_dr_receivetimestamp_nanoseconds = -1;
|
||
static int hf_ptp_v2_dr_requestingportidentity = -1;
|
||
static int hf_ptp_v2_dr_requestingsourceportid = -1;
|
||
|
||
|
||
/*Fields for PTP_PDelayRequest (=pdrq) messages*/
|
||
static int hf_ptp_v2_pdrq_origintimestamp = -1; /*Field for seconds & nanoseconds*/
|
||
static int hf_ptp_v2_pdrq_origintimestamp_seconds = -1;
|
||
static int hf_ptp_v2_pdrq_origintimestamp_nanoseconds = -1;
|
||
|
||
|
||
/*Fields for PTP_PDelayResponse (=pdrs) messages*/
|
||
static int hf_ptp_v2_pdrs_requestreceipttimestamp = -1; /*Field for seconds & nanoseconds*/
|
||
static int hf_ptp_v2_pdrs_requestreceipttimestamp_seconds = -1;
|
||
static int hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds = -1;
|
||
static int hf_ptp_v2_pdrs_requestingportidentity = -1;
|
||
static int hf_ptp_v2_pdrs_requestingsourceportid = -1;
|
||
|
||
|
||
/*Fields for PTP_PDelayResponseFollowUp (=pdfu) messages*/
|
||
static int hf_ptp_v2_pdfu_responseorigintimestamp = -1; /*Field for seconds & nanoseconds*/
|
||
static int hf_ptp_v2_pdfu_responseorigintimestamp_seconds = -1;
|
||
static int hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds = -1;
|
||
static int hf_ptp_v2_pdfu_requestingportidentity = -1;
|
||
static int hf_ptp_v2_pdfu_requestingsourceportid = -1;
|
||
|
||
|
||
/*Fields for PTP_Signalling (=sig) messages*/
|
||
static int hf_ptp_v2_sig_targetportidentity = -1;
|
||
static int hf_ptp_v2_sig_targetportid = -1;
|
||
|
||
|
||
/*Fields for PTP_Management (=mm) messages*/
|
||
static int hf_ptp_v2_mm_targetportidentity = -1;
|
||
static int hf_ptp_v2_mm_targetportid = -1;
|
||
static int hf_ptp_v2_mm_startingboundaryhops = -1;
|
||
static int hf_ptp_v2_mm_boundaryhops = -1;
|
||
static int hf_ptp_v2_mm_action = -1;
|
||
|
||
|
||
/* Initialize the subtree pointers */
|
||
static gint ett_ptp_v2 = -1;
|
||
static gint ett_ptp_v2_flags = -1;
|
||
static gint ett_ptp_v2_correction = -1;
|
||
static gint ett_ptp_v2_time = -1;
|
||
static gint ett_ptp_v2_time2 = -1;
|
||
/* static gint ett_ptp_v2_timesource = -1;
|
||
static gint ett_ptp_v2_priority = -1; */
|
||
static gint ett_ptp_v2_transportspecific = -1;
|
||
|
||
/* For tronsport specific field Ethernet or UDP */
|
||
static gboolean ptpv2_oE = FALSE;
|
||
/* END Definitions and fields for PTPv2 dissection. */
|
||
|
||
|
||
/* forward declaration of local functions for v1 and v2 */
|
||
|
||
static void
|
||
dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
||
|
||
static int
|
||
is_ptp_v1(tvbuff_t *tvb);
|
||
|
||
static void
|
||
dissect_ptp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
||
|
||
static gboolean
|
||
is_ptp_v2(tvbuff_t *tvb);
|
||
|
||
static void
|
||
dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
||
|
||
/**********************************************************/
|
||
/* Implementation of the functions */
|
||
/**********************************************************/
|
||
|
||
|
||
/* Code to dissect the packet */
|
||
|
||
static void
|
||
dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||
{
|
||
ptpv2_oE = TRUE;
|
||
/* PTP over Ethernet only available with PTPv2 */
|
||
dissect_ptp_v2(tvb, pinfo, tree);
|
||
}
|
||
|
||
static void
|
||
dissect_ptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||
{
|
||
ptpv2_oE = FALSE;
|
||
if(is_ptp_v1(tvb))
|
||
dissect_ptp_v1(tvb, pinfo, tree);
|
||
else if(is_ptp_v2(tvb))
|
||
dissect_ptp_v2(tvb, pinfo, tree);
|
||
}
|
||
|
||
|
||
/* Code to check if packet is PTPv1 */
|
||
|
||
static gboolean
|
||
is_ptp_v1(tvbuff_t *tvb)
|
||
{
|
||
guint16 version_ptp;
|
||
|
||
version_ptp = tvb_get_ntohs(tvb, PTP_VERSIONPTP_OFFSET);
|
||
|
||
if( version_ptp == 1) return TRUE;
|
||
else return FALSE;
|
||
}
|
||
|
||
|
||
/* Code to check if packet is PTPv2 */
|
||
|
||
static gboolean
|
||
is_ptp_v2(tvbuff_t *tvb)
|
||
{
|
||
guint8 version_ptp;
|
||
|
||
version_ptp = 0x0F & tvb_get_guint8(tvb, PTP_V2_VERSIONPTP_OFFSET);
|
||
|
||
if( version_ptp == 2) return TRUE;
|
||
else return FALSE;
|
||
}
|
||
|
||
|
||
/* Code to actually dissect the PTPv1 packets */
|
||
|
||
static void
|
||
dissect_ptp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||
{
|
||
guint8 ptp_control, ptp_mm_messagekey = 0;
|
||
nstime_t ts; /*time structure with seconds and nanoseconds*/
|
||
|
||
/* Set up structures needed to add the protocol subtree and manage it */
|
||
proto_item *ti, *flags_ti, *time_ti, *time2_ti;
|
||
proto_tree *ptp_tree, *ptp_flags_tree, *ptp_time_tree, *ptp_time2_tree;
|
||
|
||
/* Make entries in Protocol column and Info column on summary display */
|
||
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PTPv1");
|
||
|
||
|
||
/* Get control field (what kind of message is this? (Sync, DelayReq, ...) */
|
||
|
||
ptp_control = tvb_get_guint8 (tvb, PTP_CONTROL_OFFSET);
|
||
/* MGMT packet? */
|
||
if ( ptp_control == PTP_MANAGEMENT_MESSAGE ){
|
||
/* Get the managementMessageKey */
|
||
ptp_mm_messagekey = tvb_get_guint8(tvb, PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET);
|
||
}
|
||
|
||
/* Create and set the string for "Info" column */
|
||
switch(ptp_control){
|
||
case PTP_SYNC_MESSAGE:{
|
||
if (check_col(pinfo->cinfo, COL_INFO))
|
||
col_set_str(pinfo->cinfo, COL_INFO, "Sync Message");
|
||
break;
|
||
}
|
||
case PTP_DELAY_REQ_MESSAGE:{
|
||
if (check_col(pinfo->cinfo, COL_INFO))
|
||
col_set_str(pinfo->cinfo, COL_INFO, "Delay_Request Message");
|
||
break;
|
||
}
|
||
case PTP_FOLLOWUP_MESSAGE:{
|
||
if (check_col(pinfo->cinfo, COL_INFO))
|
||
col_set_str(pinfo->cinfo, COL_INFO, "Follow_Up Message");
|
||
break;
|
||
}
|
||
case PTP_DELAY_RESP_MESSAGE:{
|
||
if (check_col(pinfo->cinfo, COL_INFO))
|
||
col_set_str(pinfo->cinfo, COL_INFO, "Delay_Response Message");
|
||
break;
|
||
}
|
||
case PTP_MANAGEMENT_MESSAGE:{
|
||
if (check_col(pinfo->cinfo, COL_INFO)){
|
||
col_add_fstr(pinfo->cinfo, COL_INFO, "Management Message (%s)",
|
||
val_to_str(ptp_mm_messagekey,
|
||
ptp_managementMessageKey_infocolumn_vals,
|
||
"Unknown message key %u"));
|
||
}
|
||
break;
|
||
}
|
||
default:{
|
||
if (check_col(pinfo->cinfo, COL_INFO))
|
||
col_add_str(pinfo->cinfo, COL_INFO, "Unknown Message");
|
||
break;
|
||
}
|
||
}
|
||
|
||
if (tree) {
|
||
|
||
/* create display subtree for the protocol */
|
||
ti = proto_tree_add_item(tree, proto_ptp, tvb, 0, -1, FALSE);
|
||
|
||
ptp_tree = proto_item_add_subtree(ti, ett_ptp);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_versionptp, tvb, PTP_VERSIONPTP_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_versionnetwork, tvb, PTP_VERSIONNETWORK_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_subdomain, tvb, PTP_SUBDOMAIN_OFFSET, 16, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_messagetype, tvb, PTP_MESSAGETYPE_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sourcecommunicationtechnology, tvb, PTP_SOURCECOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sourceuuid, tvb, PTP_SOURCEUUID_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sourceportid, tvb, PTP_SOURCEPORTID_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sequenceid, tvb, PTP_SEQUENCEID_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_control, tvb, PTP_CONTROL_OFFSET, 1, FALSE);
|
||
|
||
/*Subtree for the flag-field*/
|
||
if(tree){
|
||
flags_ti = proto_tree_add_item(ptp_tree,
|
||
hf_ptp_flags, tvb, PTP_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
ptp_flags_tree = proto_item_add_subtree(flags_ti, ett_ptp_flags);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_flags_li61, tvb, PTP_FLAGS_LI61_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_flags_li59, tvb, PTP_FLAGS_LI59_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_flags_boundary_clock, tvb, PTP_FLAGS_BOUNDARY_CLOCK_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_flags_assist, tvb, PTP_FLAGS_ASSIST_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_flags_ext_sync, tvb, PTP_FLAGS_EXT_SYNC_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_flags_parent, tvb, PTP_FLAGS_PARENT_STATS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_flags_sync_burst, tvb, PTP_FLAGS_SYNC_BURST_OFFSET, 2, FALSE);
|
||
}
|
||
|
||
/* The rest of the ptp-dissector depends on the control-field */
|
||
|
||
switch(ptp_control){
|
||
case PTP_SYNC_MESSAGE:
|
||
case PTP_DELAY_REQ_MESSAGE:{
|
||
|
||
/*Subtree for the timestamp-field*/
|
||
ts.secs = tvb_get_ntohl(tvb, PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET);
|
||
ts.nsecs = tvb_get_ntohl(tvb, PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET);
|
||
if(tree){
|
||
time_ti = proto_tree_add_time(ptp_tree,
|
||
hf_ptp_sdr_origintimestamp, tvb, PTP_SDR_ORIGINTIMESTAMP_OFFSET, 8, &ts);
|
||
|
||
ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
|
||
|
||
proto_tree_add_item(ptp_time_tree,
|
||
hf_ptp_sdr_origintimestamp_seconds, tvb,
|
||
PTP_SDR_ORIGINTIMESTAMP_SECONDS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_time_tree, hf_ptp_sdr_origintimestamp_nanoseconds, tvb,
|
||
PTP_SDR_ORIGINTIMESTAMP_NANOSECONDS_OFFSET, 4, FALSE);
|
||
}
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_epochnumber, tvb, PTP_SDR_EPOCHNUMBER_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_currentutcoffset, tvb, PTP_SDR_CURRENTUTCOFFSET_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmastercommunicationtechnology, tvb,
|
||
PTP_SDR_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_grandmasterclockuuid, tvb, PTP_SDR_GRANDMASTERCLOCKUUID_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_grandmasterportid, tvb, PTP_SDR_GRANDMASTERPORTID_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_grandmastersequenceid, tvb, PTP_SDR_GRANDMASTERSEQUENCEID_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_grandmasterclockstratum, tvb,
|
||
PTP_SDR_GRANDMASTERCLOCKSTRATUM_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmasterclockidentifier, tvb,
|
||
PTP_SDR_GRANDMASTERCLOCKIDENTIFIER_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_grandmasterclockvariance, tvb,
|
||
PTP_SDR_GRANDMASTERCLOCKVARIANCE_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_grandmasterpreferred, tvb, PTP_SDR_GRANDMASTERPREFERRED_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_sdr_grandmasterisboundaryclock, tvb,
|
||
PTP_SDR_GRANDMASTERISBOUNDARYCLOCK_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_syncinterval, tvb, PTP_SDR_SYNCINTERVAL_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_localclockvariance, tvb, PTP_SDR_LOCALCLOCKVARIANCE_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_localstepsremoved, tvb, PTP_SDR_LOCALSTEPSREMOVED_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_localclockstratum, tvb, PTP_SDR_LOCALCLOCKSTRATUM_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_localclockidentifier, tvb, PTP_SDR_LOCALCLOCKIDENTIFIER_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_sdr_parentcommunicationtechnology, tvb,
|
||
PTP_SDR_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_parentuuid, tvb, PTP_SDR_PARENTUUID_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_parentportfield, tvb, PTP_SDR_PARENTPORTFIELD_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_estimatedmastervariance, tvb,
|
||
PTP_SDR_ESTIMATEDMASTERVARIANCE_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_estimatedmasterdrift, tvb, PTP_SDR_ESTIMATEDMASTERDRIFT_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_sdr_utcreasonable, tvb, PTP_SDR_UTCREASONABLE_OFFSET, 1, FALSE);
|
||
break;
|
||
}
|
||
case PTP_FOLLOWUP_MESSAGE:{
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_fu_associatedsequenceid, tvb, PTP_FU_ASSOCIATEDSEQUENCEID_OFFSET, 2, FALSE);
|
||
|
||
/*Subtree for the timestamp-field*/
|
||
ts.secs = tvb_get_ntohl(tvb, PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET);
|
||
ts.nsecs = tvb_get_ntohl(tvb, PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET);
|
||
if(tree){
|
||
time_ti = proto_tree_add_time(ptp_tree,
|
||
hf_ptp_fu_preciseorigintimestamp, tvb,
|
||
PTP_FU_PRECISEORIGINTIMESTAMP_OFFSET, 8, &ts);
|
||
|
||
ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
|
||
|
||
proto_tree_add_item(ptp_time_tree, hf_ptp_fu_preciseorigintimestamp_seconds, tvb,
|
||
PTP_FU_PRECISEORIGINTIMESTAMP_SECONDS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_time_tree, hf_ptp_fu_preciseorigintimestamp_nanoseconds, tvb,
|
||
PTP_FU_PRECISEORIGINTIMESTAMP_NANOSECONDS_OFFSET, 4, FALSE);
|
||
}
|
||
break;
|
||
}
|
||
case PTP_DELAY_RESP_MESSAGE:{
|
||
/*Subtree for the timestamp-field*/
|
||
ts.secs = tvb_get_ntohl(tvb, PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET);
|
||
ts.nsecs = tvb_get_ntohl(tvb, PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET);
|
||
if(tree){
|
||
time_ti = proto_tree_add_time(ptp_tree,
|
||
hf_ptp_dr_delayreceipttimestamp, tvb,
|
||
PTP_DR_DELAYRECEIPTTIMESTAMP_OFFSET, 8, &ts);
|
||
|
||
ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
|
||
|
||
proto_tree_add_item(ptp_time_tree, hf_ptp_dr_delayreceipttimestamp_seconds, tvb,
|
||
PTP_DR_DELAYRECEIPTTIMESTAMP_SECONDS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_time_tree, hf_ptp_dr_delayreceipttimestamp_nanoseconds, tvb,
|
||
PTP_DR_DELAYRECEIPTTIMESTAMP_NANOSECONDS_OFFSET, 4, FALSE);
|
||
}
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_dr_requestingsourcecommunicationtechnology, tvb,
|
||
PTP_DR_REQUESTINGSOURCECOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_dr_requestingsourceuuid, tvb, PTP_DR_REQUESTINGSOURCEUUID_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_dr_requestingsourceportid, tvb, PTP_DR_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_dr_requestingsourcesequenceid, tvb,
|
||
PTP_DR_REQUESTINGSOURCESEQUENCEID_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MANAGEMENT_MESSAGE:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_targetcommunicationtechnology, tvb,
|
||
PTP_MM_TARGETCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_mm_targetuuid, tvb, PTP_MM_TARGETUUID_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_mm_targetportid, tvb, PTP_MM_TARGETPORTID_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_mm_startingboundaryhops, tvb, PTP_MM_STARTINGBOUNDARYHOPS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_mm_boundaryhops, tvb, PTP_MM_BOUNDARYHOPS_OFFSET, 2, FALSE);
|
||
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_mm_managementmessagekey, tvb, PTP_MM_MANAGEMENTMESSAGEKEY_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_mm_parameterlength, tvb, PTP_MM_PARAMETERLENGTH_OFFSET, 2, FALSE);
|
||
|
||
switch(ptp_mm_messagekey){
|
||
case PTP_MM_CLOCK_IDENTITY:{
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_mm_clock_identity_clockcommunicationtechnology, tvb,
|
||
PTP_MM_CLOCK_IDENTITY_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_clockuuidfield, tvb,
|
||
PTP_MM_CLOCK_IDENTITY_CLOCKUUIDFIELD_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_clockportfield, tvb,
|
||
PTP_MM_CLOCK_IDENTITY_CLOCKPORTFIELD_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_clock_identity_manufactureridentity, tvb,
|
||
PTP_MM_CLOCK_IDENTITY_MANUFACTURERIDENTITY_OFFSET, 48, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_INITIALIZE_CLOCK:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_initialize_clock_initialisationkey, tvb,
|
||
PTP_MM_INITIALIZE_CLOCK_INITIALISATIONKEY_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_SET_SUBDOMAIN:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_set_subdomain_subdomainname, tvb,
|
||
PTP_MM_SET_SUBDOMAIN_SUBDOMAINNAME_OFFSET, 16, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_DEFAULT_DATA_SET:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockcommunicationtechnology,
|
||
tvb, PTP_MM_DEFAULT_DATA_SET_CLOCKCOMMUNICATIONTECHNOLOGY_OFFSET,
|
||
1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockuuidfield, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_CLOCKUUIDFIELD_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockportfield, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_CLOCKPORTFIELD_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockstratum, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockidentifier, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockvariance, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_clockfollowupcapable, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_CLOCKFOLLOWUPCAPABLE_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_preferred, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_PREFERRED_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_initializable, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_INITIALIZABLE_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_externaltiming, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_EXTERNALTIMING_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_isboundaryclock, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_ISBOUNDARYCLOCK_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_syncinterval, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_subdomainname, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET, 16, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_numberports, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_NUMBERPORTS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_default_data_set_numberforeignrecords, tvb,
|
||
PTP_MM_DEFAULT_DATA_SET_NUMBERFOREIGNRECORDS_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_UPDATE_DEFAULT_DATA_SET:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockstratum, tvb,
|
||
PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKSTRATUM_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockidentifier, tvb,
|
||
PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKIDENTIFIER_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_clockvariance, tvb,
|
||
PTP_MM_UPDATE_DEFAULT_DATA_SET_CLOCKVARIANCE_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_preferred, tvb,
|
||
PTP_MM_UPDATE_DEFAULT_DATA_SET_PREFERRED_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_syncinterval, tvb,
|
||
PTP_MM_UPDATE_DEFAULT_DATA_SET_SYNCINTERVAL_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_update_default_data_set_subdomainname, tvb,
|
||
PTP_MM_UPDATE_DEFAULT_DATA_SET_SUBDOMAINNAME_OFFSET, 16, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_CURRENT_DATA_SET:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_current_data_set_stepsremoved, tvb,
|
||
PTP_MM_CURRENT_DATA_SET_STEPSREMOVED_OFFSET, 2, FALSE);
|
||
|
||
/* Subtree for offset from master*/
|
||
ts.secs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET);
|
||
|
||
ts.nsecs = tvb_get_ntohl(tvb,
|
||
PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET);
|
||
|
||
if (ts.nsecs & 0x80000000) ts.nsecs = ts.nsecs & 0x7FFFFFFF;
|
||
|
||
if(tree){
|
||
time_ti = proto_tree_add_time(ptp_tree,
|
||
hf_ptp_mm_current_data_set_offsetfrommaster, tvb,
|
||
PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTER_OFFSET, 8, &ts);
|
||
|
||
ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
|
||
|
||
proto_tree_add_item(ptp_time_tree,
|
||
hf_ptp_mm_current_data_set_offsetfrommasterseconds, tvb,
|
||
PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERSECONDS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_time_tree,
|
||
hf_ptp_mm_current_data_set_offsetfrommasternanoseconds, tvb,
|
||
PTP_MM_CURRENT_DATA_SET_OFFSETFROMMASTERNANOSECONDS_OFFSET, 4, FALSE);
|
||
}
|
||
|
||
/* Subtree for offset from master*/
|
||
ts.secs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET);
|
||
|
||
ts.nsecs = tvb_get_ntohl(tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET);
|
||
|
||
if(tree){
|
||
time2_ti = proto_tree_add_time(ptp_tree,
|
||
hf_ptp_mm_current_data_set_onewaydelay, tvb,
|
||
PTP_MM_CURRENT_DATA_SET_ONEWAYDELAY_OFFSET, 8, &ts);
|
||
|
||
ptp_time2_tree = proto_item_add_subtree(time2_ti, ett_ptp_time2);
|
||
|
||
proto_tree_add_item(ptp_time2_tree, hf_ptp_mm_current_data_set_onewaydelayseconds,
|
||
tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYSECONDS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_time2_tree,
|
||
hf_ptp_mm_current_data_set_onewaydelaynanoseconds,
|
||
tvb, PTP_MM_CURRENT_DATA_SET_ONEWAYDELAYNANOSECONDS_OFFSET, 4, FALSE);
|
||
}
|
||
break;
|
||
}
|
||
case PTP_MM_PARENT_DATA_SET:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentcommunicationtechnology,
|
||
tvb, PTP_MM_PARENT_DATA_SET_PARENTCOMMUNICATIONTECHNOLOGY_OFFSET,
|
||
1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentuuid, tvb,
|
||
PTP_MM_PARENT_DATA_SET_PARENTUUID_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentportid, tvb,
|
||
PTP_MM_PARENT_DATA_SET_PARENTPORTID_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber,
|
||
tvb, PTP_MM_PARENT_DATA_SET_PARENTLASTSYNCSEQUENCENUMBER_OFFSET,
|
||
2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentfollowupcapable, tvb,
|
||
PTP_MM_PARENT_DATA_SET_PARENTFOLLOWUPCAPABLE_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentexternaltiming, tvb,
|
||
PTP_MM_PARENT_DATA_SET_PARENTEXTERNALTIMING_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentvariance, tvb,
|
||
PTP_MM_PARENT_DATA_SET_PARENTVARIANCE_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_parentstats, tvb,
|
||
PTP_MM_PARENT_DATA_SET_PARENTSTATS_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_observedvariance, tvb,
|
||
PTP_MM_PARENT_DATA_SET_OBSERVEDVARIANCE_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_observeddrift, tvb,
|
||
PTP_MM_PARENT_DATA_SET_OBSERVEDDRIFT_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_utcreasonable, tvb,
|
||
PTP_MM_PARENT_DATA_SET_UTCREASONABLE_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology,
|
||
tvb, PTP_MM_PARENT_DATA_SET_GRANDMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1,
|
||
FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasteruuidfield, tvb,
|
||
PTP_MM_PARENT_DATA_SET_GRANDMASTERUUIDFIELD_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterportidfield, tvb,
|
||
PTP_MM_PARENT_DATA_SET_GRANDMASTERPORTIDFIELD_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterstratum, tvb,
|
||
PTP_MM_PARENT_DATA_SET_GRANDMASTERSTRATUM_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasteridentifier, tvb,
|
||
PTP_MM_PARENT_DATA_SET_GRANDMASTERIDENTIFIER_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmastervariance, tvb,
|
||
PTP_MM_PARENT_DATA_SET_GRANDMASTERVARIANCE_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterpreferred, tvb,
|
||
PTP_MM_PARENT_DATA_SET_GRANDMASTERPREFERRED_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmasterisboundaryclock, tvb,
|
||
PTP_MM_PARENT_DATA_SET_GRANDMASTERISBOUNDARYCLOCK_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_parent_data_set_grandmastersequencenumber, tvb,
|
||
PTP_MM_PARENT_DATA_SET_GRANDMASTERSEQUENCENUMBER_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_PORT_DATA_SET:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_returnedportnumber, tvb,
|
||
PTP_MM_PORT_DATA_SET_RETURNEDPORTNUMBER_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portstate, tvb,
|
||
PTP_MM_PORT_DATA_SET_PORTSTATE_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_lastsynceventsequencenumber, tvb,
|
||
PTP_MM_PORT_DATA_SET_LASTSYNCEVENTSEQUENCENUMBER_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber,
|
||
tvb, PTP_MM_PORT_DATA_SET_LASTGENERALEVENTSEQUENCENUMBER_OFFSET,
|
||
2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portcommunicationtechnology, tvb,
|
||
PTP_MM_PORT_DATA_SET_PORTCOMMUNICATIONTECHNOLOGY_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portuuidfield, tvb,
|
||
PTP_MM_PORT_DATA_SET_PORTUUIDFIELD_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_portidfield, tvb,
|
||
PTP_MM_PORT_DATA_SET_PORTIDFIELD_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_burstenabled, tvb,
|
||
PTP_MM_PORT_DATA_SET_BURSTENABLED_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_subdomainaddressoctets, tvb,
|
||
PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESSOCTETS_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_eventportaddressoctets, tvb,
|
||
PTP_MM_PORT_DATA_SET_EVENTPORTADDRESSOCTETS_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_generalportaddressoctets, tvb,
|
||
PTP_MM_PORT_DATA_SET_GENERALPORTADDRESSOCTETS_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_subdomainaddress, tvb,
|
||
PTP_MM_PORT_DATA_SET_SUBDOMAINADDRESS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_eventportaddress, tvb,
|
||
PTP_MM_PORT_DATA_SET_EVENTPORTADDRESS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_port_data_set_generalportaddress, tvb,
|
||
PTP_MM_PORT_DATA_SET_GENERALPORTADDRESS_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_GLOBAL_TIME_DATA_SET:{
|
||
/* Subtree for local time*/
|
||
ts.secs = tvb_get_ntohl(tvb, PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET);
|
||
|
||
ts.nsecs = tvb_get_ntohl(tvb,
|
||
PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET);
|
||
|
||
if(tree){
|
||
time_ti = proto_tree_add_time(ptp_tree,
|
||
hf_ptp_mm_global_time_data_set_localtime, tvb,
|
||
PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIME_OFFSET, 8, &ts);
|
||
|
||
ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
|
||
|
||
proto_tree_add_item(ptp_time_tree,
|
||
hf_ptp_mm_global_time_data_set_localtimeseconds, tvb,
|
||
PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMESECONDS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_time_tree,
|
||
hf_ptp_mm_global_time_data_set_localtimenanoseconds,
|
||
tvb, PTP_MM_GLOBAL_TIME_DATA_SET_LOCALTIMENANOSECONDS_OFFSET, 4, FALSE);
|
||
}
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_currentutcoffset, tvb,
|
||
PTP_MM_GLOBAL_TIME_DATA_SET_CURRENTUTCOFFSET_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_leap59, tvb,
|
||
PTP_MM_GLOBAL_TIME_DATA_SET_LEAP59_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_leap61, tvb,
|
||
PTP_MM_GLOBAL_TIME_DATA_SET_LEAP61_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_global_time_data_set_epochnumber, tvb,
|
||
PTP_MM_GLOBAL_TIME_DATA_SET_EPOCHNUMBER_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_currentutcoffset,
|
||
tvb, PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_CURRENTUTCOFFSET_OFFSET,
|
||
2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_leap59, tvb,
|
||
PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP59_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_update_global_time_properties_leap61, tvb,
|
||
PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_LEAP61_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_get_foreign_data_set_recordkey, tvb,
|
||
PTP_MM_UPDATE_GLOBAL_TIME_PROPERTIES_EPOCHNUMBER_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_GET_FOREIGN_DATA_SET:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_get_foreign_data_set_recordkey, tvb,
|
||
PTP_MM_GET_FOREIGN_DATA_SET_RECORDKEY_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_FOREIGN_DATA_SET:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_returnedportnumber, tvb,
|
||
PTP_MM_FOREIGN_DATA_SET_RETURNEDPORTNUMBER_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_returnedrecordnumber, tvb,
|
||
PTP_MM_FOREIGN_DATA_SET_RETURNEDRECORDNUMBER_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology,
|
||
tvb, PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERCOMMUNICATIONTECHNOLOGY_OFFSET, 1,
|
||
FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmasteruuidfield, tvb,
|
||
PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERUUIDFIELD_OFFSET, 6, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmasterportidfield, tvb,
|
||
PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERPORTIDFIELD_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_foreign_data_set_foreignmastersyncs, tvb,
|
||
PTP_MM_FOREIGN_DATA_SET_FOREIGNMASTERSYNCS_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_SET_SYNC_INTERVAL:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_mm_set_sync_interval_syncinterval, tvb,
|
||
PTP_MM_SET_SYNC_INTERVAL_SYNCINTERVAL_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
case PTP_MM_SET_TIME:{
|
||
/* Subtree for local time*/
|
||
ts.secs = tvb_get_ntohl(tvb, PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET);
|
||
|
||
ts.nsecs = tvb_get_ntohl(tvb, PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET);
|
||
|
||
if(tree){
|
||
time_ti = proto_tree_add_time(ptp_tree, hf_ptp_mm_set_time_localtime, tvb,
|
||
PTP_MM_SET_TIME_LOCALTIME_OFFSET, 8, &ts);
|
||
|
||
ptp_time_tree = proto_item_add_subtree(time_ti, ett_ptp_time);
|
||
|
||
proto_tree_add_item(ptp_time_tree, hf_ptp_mm_set_time_localtimeseconds, tvb,
|
||
PTP_MM_SET_TIME_LOCALTIMESECONDS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_time_tree, hf_ptp_mm_set_time_localtimenanoseconds,
|
||
tvb, PTP_MM_SET_TIME_LOCALTIMENANOSECONDS_OFFSET, 4, FALSE);
|
||
}
|
||
break;
|
||
}
|
||
default :{
|
||
/*- don't dissect any further. */
|
||
break;
|
||
}
|
||
}
|
||
break;
|
||
}
|
||
default :{
|
||
/* Not a valid MessageType - can't dissect. */
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
/* Code to actually dissect the PTPv2 packets */
|
||
|
||
void
|
||
dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||
{
|
||
guint8 ptp_v2_messageid;
|
||
guint64 timeStamp;
|
||
double cor;
|
||
gint64 temp_cor;
|
||
guint16 temp_cor_sub;
|
||
|
||
|
||
/* Set up structures needed to add the protocol subtree and manage it */
|
||
proto_item *ti, *transportspecific_ti, *flags_ti, *correction_ti;
|
||
proto_tree *ptp_tree, *ptp_transportspecific_tree, *ptp_flags_tree, *ptp_correction_tree;
|
||
|
||
/* Make entries in Protocol column and Info column on summary display */
|
||
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PTPv2");
|
||
|
||
|
||
/* Get control field (what kind of message is this? (Sync, DelayReq, ...) */
|
||
|
||
ptp_v2_messageid = 0x0F & tvb_get_guint8 (tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET);
|
||
|
||
/* Create and set the string for "Info" column */
|
||
if (check_col(pinfo->cinfo, COL_INFO))
|
||
{
|
||
col_set_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
|
||
}
|
||
|
||
|
||
if (tree) {
|
||
|
||
ti = proto_tree_add_item(tree, proto_ptp, tvb, 0, -1, FALSE);
|
||
|
||
ptp_tree = proto_item_add_subtree(ti, ett_ptp_v2);
|
||
|
||
transportspecific_ti = proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_transportspecific, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
|
||
|
||
ptp_transportspecific_tree = proto_item_add_subtree(transportspecific_ti, ett_ptp_v2_transportspecific);
|
||
|
||
if (ptpv2_oE == TRUE)
|
||
{
|
||
proto_tree_add_item(ptp_transportspecific_tree,
|
||
hf_ptp_v2_transportspecific_802as_conform, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
|
||
}
|
||
else
|
||
{
|
||
proto_tree_add_item(ptp_transportspecific_tree,
|
||
hf_ptp_v2_transportspecific_v1_compatibility, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
|
||
}
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_messageid, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_versionptp, tvb, PTP_V2_VERSIONPTP_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_messagelength, tvb, PTP_V2_MESSAGE_LENGTH_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_domainnumber, tvb, PTP_V2_DOMAIN_NUMBER_OFFSET, 1, FALSE);
|
||
|
||
|
||
flags_ti = proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_flags, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
ptp_flags_tree = proto_item_add_subtree(flags_ti, ett_ptp_v2_flags);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_security, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_specific2, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_specific1, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_unicast, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_twostep, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_alternatemaster, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_frequencytraceable, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_timetraceable, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_ptptimescale, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_utcoffsetvalid, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_li59, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_flags_tree,
|
||
hf_ptp_v2_flags_li61, tvb, PTP_V2_FLAGS_OFFSET, 2, FALSE);
|
||
|
||
temp_cor = tvb_get_ntohl(tvb, PTP_V2_CORRECTIONNS_OFFSET);
|
||
|
||
temp_cor_sub = tvb_get_ntohs(tvb, PTP_V2_CORRECTIONSUBNS_OFFSET);
|
||
|
||
temp_cor = temp_cor << 16;
|
||
|
||
if(temp_cor & 0x800000){
|
||
temp_cor = temp_cor | G_GINT64_CONSTANT(0xFFFFFFFFFF000000);
|
||
temp_cor = temp_cor | tvb_get_ntohs(tvb, PTP_V2_CORRECTIONNS_OFFSET+4);
|
||
|
||
cor = ((1.0*temp_cor) + (temp_cor_sub/65536.0));
|
||
}
|
||
else
|
||
{
|
||
temp_cor = temp_cor | tvb_get_ntohs(tvb, PTP_V2_CORRECTIONNS_OFFSET+4);
|
||
cor = temp_cor + (temp_cor_sub/65536.0);
|
||
}
|
||
|
||
|
||
correction_ti = proto_tree_add_double_format(ptp_tree,
|
||
hf_ptp_v2_correction, tvb, PTP_V2_CORRECTION_OFFSET, 8, cor, "correction: %f nanoseconds", cor);
|
||
|
||
ptp_correction_tree = proto_item_add_subtree(correction_ti, ett_ptp_v2_correction);
|
||
|
||
proto_tree_add_text(ptp_correction_tree, tvb, PTP_V2_CORRECTIONNS_OFFSET, 8,
|
||
"correctionNs: % "PRId64 " nanoseconds" , temp_cor);
|
||
|
||
proto_tree_add_double_format(ptp_correction_tree,
|
||
hf_ptp_v2_correctionsubns, tvb, PTP_V2_CORRECTION_OFFSET, 8, (temp_cor_sub/65536.0), "correctionSubNs: %f nanoseconds", (temp_cor_sub/65536.0));
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_clockidentity, tvb, PTP_V2_CLOCKIDENTITY_OFFSET, 8, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_sourceportid, tvb, PTP_V2_SOURCEPORTID_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_sequenceid, tvb, PTP_V2_SEQUENCEID_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_control, tvb, PTP_V2_CONTROL_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_logmessageperiod, tvb, PTP_V2_LOGMESSAGEPERIOD_OFFSET, 1, FALSE);
|
||
|
||
switch(ptp_v2_messageid){
|
||
case PTP_V2_ANNOUNCE_MESSAGE:{
|
||
timeStamp = tvb_get_ntohl(tvb, PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET);
|
||
timeStamp = timeStamp << 16;
|
||
timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET+4);
|
||
|
||
proto_tree_add_text(ptp_tree, tvb, PTP_V2_AN_ORIGINTIMESTAMPSECONDS_OFFSET, 6,
|
||
"originTimestamp (seconds): % "PRId64, timeStamp);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origintimestamp_nanoseconds, tvb,
|
||
PTP_V2_AN_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_an_origincurrentutcoffset, tvb,
|
||
PTP_V2_AN_ORIGINCURRENTUTCOFFSET_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree,
|
||
hf_ptp_v2_an_timesource, tvb, PTP_V2_AN_TIMESOURCE_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_an_localstepsremoved, tvb,
|
||
PTP_V2_AN_LOCALSTEPSREMOVED_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockidentity, tvb,
|
||
PTP_V2_AN_GRANDMASTERCLOCKIDENTITY_OFFSET, 8, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockclass, tvb,
|
||
PTP_V2_AN_GRANDMASTERCLOCKCLASS_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockaccuracy, tvb,
|
||
PTP_V2_AN_GRANDMASTERCLOCKACCURACY_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_an_grandmasterclockvariance, tvb,
|
||
PTP_V2_AN_GRANDMASTERCLOCKVARIANCE_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_an_priority1, tvb,
|
||
PTP_V2_AN_PRIORITY_1_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_an_priority2, tvb,
|
||
PTP_V2_AN_PRIORITY_2_OFFSET, 1, FALSE);
|
||
|
||
break;
|
||
}
|
||
|
||
case PTP_V2_SYNC_MESSAGE:
|
||
case PTP_V2_DELAY_REQ_MESSAGE:{
|
||
timeStamp = tvb_get_ntohl(tvb, PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET);
|
||
timeStamp = timeStamp << 16;
|
||
timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET+4);
|
||
|
||
proto_tree_add_text(ptp_tree, tvb, PTP_V2_SDR_ORIGINTIMESTAMPSECONDS_OFFSET, 6,
|
||
"originTimestamp (seconds): % "PRId64, timeStamp);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_sdr_origintimestamp_nanoseconds, tvb,
|
||
PTP_V2_SDR_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
|
||
|
||
break;
|
||
}
|
||
|
||
case PTP_V2_FOLLOWUP_MESSAGE:{
|
||
timeStamp = tvb_get_ntohl(tvb, PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET);
|
||
timeStamp = timeStamp << 16;
|
||
timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET+4);
|
||
|
||
proto_tree_add_text(ptp_tree, tvb, PTP_V2_FU_PRECISEORIGINTIMESTAMPSECONDS_OFFSET, 6,
|
||
"preciseOriginTimestamp (seconds): % "PRId64, timeStamp);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds, tvb,
|
||
PTP_V2_FU_PRECISEORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
|
||
|
||
break;
|
||
}
|
||
|
||
case PTP_V2_DELAY_RESP_MESSAGE:{
|
||
timeStamp = tvb_get_ntohl(tvb, PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET);
|
||
timeStamp = timeStamp << 16;
|
||
timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET+4);
|
||
|
||
proto_tree_add_text(ptp_tree, tvb, PTP_V2_DR_RECEIVETIMESTAMPSECONDS_OFFSET, 6,
|
||
"receiveTimestamp (seconds): % "PRId64, timeStamp);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_receivetimestamp_nanoseconds, tvb,
|
||
PTP_V2_DR_RECEIVETIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_requestingportidentity, tvb,
|
||
PTP_V2_DR_REQUESTINGPORTIDENTITY_OFFSET, 8, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_dr_requestingsourceportid, tvb,
|
||
PTP_V2_DR_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
|
||
|
||
break;
|
||
}
|
||
|
||
case PTP_V2_PATH_DELAY_REQ_MESSAGE:{
|
||
timeStamp = tvb_get_ntohl(tvb, PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET);
|
||
timeStamp = timeStamp << 16;
|
||
timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET+4);
|
||
|
||
proto_tree_add_text(ptp_tree, tvb, PTP_V2_PDRQ_ORIGINTIMESTAMPSECONDS_OFFSET, 6,
|
||
"originTimestamp (seconds): % "PRId64, timeStamp);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrq_origintimestamp_nanoseconds, tvb,
|
||
PTP_V2_PDRQ_ORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
|
||
|
||
break;
|
||
}
|
||
|
||
case PTP_V2_PATH_DELAY_RESP_MESSAGE:{
|
||
timeStamp = tvb_get_ntohl(tvb, PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET);
|
||
timeStamp = timeStamp << 16;
|
||
timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET+4);
|
||
|
||
proto_tree_add_text(ptp_tree, tvb, PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPSECONDS_OFFSET, 6,
|
||
"requestreceiptTimestamp (seconds): % "PRId64, timeStamp);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds, tvb,
|
||
PTP_V2_PDRS_REQUESTRECEIPTTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestingportidentity, tvb,
|
||
PTP_V2_PDRS_REQUESTINGPORTIDENTITY_OFFSET, 8, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_pdrs_requestingsourceportid, tvb,
|
||
PTP_V2_PDRS_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
|
||
|
||
break;
|
||
}
|
||
|
||
case PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE:{
|
||
timeStamp = tvb_get_ntohl(tvb, PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET);
|
||
timeStamp = timeStamp << 16;
|
||
timeStamp = timeStamp | tvb_get_ntohs(tvb, PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET+4);
|
||
|
||
proto_tree_add_text(ptp_tree, tvb, PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPSECONDS_OFFSET, 6,
|
||
"responseOriginTimestamp (seconds): % "PRId64, timeStamp);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds, tvb,
|
||
PTP_V2_PDFU_RESPONSEORIGINTIMESTAMPNANOSECONDS_OFFSET, 4, FALSE);
|
||
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_requestingportidentity, tvb,
|
||
PTP_V2_PDFU_REQUESTINGPORTIDENTITY_OFFSET, 8, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_pdfu_requestingsourceportid, tvb,
|
||
PTP_V2_PDFU_REQUESTINGSOURCEPORTID_OFFSET, 2, FALSE);
|
||
|
||
break;
|
||
}
|
||
|
||
case PTP_V2_SIGNALLING_MESSAGE:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_sig_targetportidentity, tvb,
|
||
PTP_V2_SIG_TARGETPORTIDENTITY_OFFSET, 8, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_sig_targetportid, tvb,
|
||
PTP_V2_SIG_TARGETPORTID_OFFSET, 2, FALSE);
|
||
break;
|
||
}
|
||
|
||
case PTP_V2_MANAGEMENT_MESSAGE:{
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_targetportidentity, tvb,
|
||
PTP_V2_MM_TARGETPORTIDENTITY_OFFSET, 8, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_targetportid, tvb,
|
||
PTP_V2_MM_TARGETPORTID_OFFSET, 2, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_startingboundaryhops, tvb,
|
||
PTP_V2_MM_STARTINGBOUNDARYHOPS_OFFSET, 1, FALSE);
|
||
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_boundaryhops, tvb,
|
||
PTP_V2_MM_BOUNDARYHOPS_OFFSET, 1, FALSE);
|
||
|
||
/* ToDo Enumeration4 aufl<66>sen in Subtree */
|
||
proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_action, tvb,
|
||
PTP_V2_MM_ACTION_OFFSET, 1, FALSE);
|
||
break;
|
||
}
|
||
default:{
|
||
|
||
break;
|
||
}
|
||
} /* switch */
|
||
|
||
} /* tree */
|
||
|
||
}
|
||
|
||
|
||
/* Register the protocol with Wireshark */
|
||
|
||
void
|
||
proto_register_ptp(void)
|
||
{
|
||
static hf_register_info hf[] = {
|
||
/* PTPv1 fields **********************************************************/
|
||
/*Common fields for all frames*/
|
||
{ &hf_ptp_versionptp,
|
||
{ "versionPTP", "ptp.versionptp",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_versionnetwork,
|
||
{ "versionNetwork", "ptp.versionnetwork",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_subdomain,
|
||
{ "subdomain", "ptp.subdomain",
|
||
FT_STRING, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_messagetype,
|
||
{ "messageType", "ptp.messagetype",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_messagetype_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sourcecommunicationtechnology,
|
||
{ "sourceCommunicationTechnology", "ptp.sourcecommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sourceuuid,
|
||
{ "sourceUuid", "ptp.sourceuuid",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sourceportid,
|
||
{ "sourcePortId", "ptp.sourceportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sequenceid,
|
||
{ "sequenceId", "ptp.sequenceid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_control,
|
||
{ "control", "ptp.control",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_control_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*THE FLAGS-FIELD*/
|
||
{ &hf_ptp_flags,
|
||
{ "flags", "ptp.flags",
|
||
FT_UINT16, BASE_HEX, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_flags_li61,
|
||
{ "PTP_LI61", "ptp.flags.li61",
|
||
FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_LI61_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_flags_li59,
|
||
{ "PTP_LI59", "ptp.flags.li59",
|
||
FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_LI59_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_flags_boundary_clock,
|
||
{ "PTP_BOUNDARY_CLOCK", "ptp.flags.boundary_clock",
|
||
FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_BOUNDARY_CLOCK_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_flags_assist,
|
||
{ "PTP_ASSIST", "ptp.flags.assist",
|
||
FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_ASSIST_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_flags_ext_sync,
|
||
{ "PTP_EXT_SYNC", "ptp.flags.ext_sync",
|
||
FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_EXT_SYNC_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_flags_parent,
|
||
{ "PTP_PARENT_STATS", "ptp.flags.parent_stats",
|
||
FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_PARENT_STATS_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_flags_sync_burst,
|
||
{ "PTP_SYNC_BURST", "ptp.flags.sync_burst",
|
||
FT_UINT16, BASE_DEC, VALS(ptp_bool_vals), PTP_FLAGS_SYNC_BURST_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
/*END OF THE FLAG-FIELD*/
|
||
|
||
/*offsets for ptp_sync and delay_req (=sdr) messages*/
|
||
{ &hf_ptp_sdr_origintimestamp,
|
||
{ "originTimestamp", "ptp.sdr.origintimestamp",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_origintimestamp_seconds,
|
||
{ "originTimestamp (seconds)", "ptp.sdr.origintimestamp_seconds",
|
||
FT_UINT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_origintimestamp_nanoseconds,
|
||
{ "originTimestamp (nanoseconds)", "ptp.sdr.origintimestamp_nanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_epochnumber,
|
||
{ "epochNumber", "ptp.sdr.epochnumber",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_currentutcoffset,
|
||
{ "currentUTCOffset", "ptp.sdr.currentutcoffset",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_grandmastercommunicationtechnology,
|
||
{ "grandmasterCommunicationTechnology", "ptp.sdr.grandmastercommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_grandmasterclockuuid,
|
||
{ "grandMasterClockUuid", "ptp.sdr.grandmasterclockuuid",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_grandmasterportid,
|
||
{ "grandmasterPortId", "ptp.sdr.grandmasterportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_grandmastersequenceid,
|
||
{ "grandmasterSequenceId", "ptp.sdr.grandmastersequenceid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_grandmasterclockstratum,
|
||
{ "grandmasterClockStratum", "ptp.sdr.grandmasterclockstratum",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_grandmasterclockidentifier,
|
||
{ "grandmasterClockIdentifier", "ptp.sdr.grandmasterclockidentifier",
|
||
FT_STRING, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_grandmasterclockvariance,
|
||
{ "grandmasterClockVariance", "ptp.sdr.grandmasterclockvariance",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_grandmasterpreferred,
|
||
{ "grandmasterPreferred", "ptp.sdr.grandmasterpreferred",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_grandmasterisboundaryclock,
|
||
{ "grandmasterIsBoundaryClock", "ptp.sdr.grandmasterisboundaryclock",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_syncinterval,
|
||
{ "syncInterval", "ptp.sdr.syncinterval",
|
||
FT_INT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_localclockvariance,
|
||
{ "localClockVariance", "ptp.sdr.localclockvariance",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_localstepsremoved,
|
||
{ "localStepsRemoved", "ptp.sdr.localstepsremoved",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_localclockstratum,
|
||
{ "localClockStratum", "ptp.sdr.localclockstratum",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_localclockidentifier,
|
||
{ "localClockIdentifier", "ptp.sdr.localclockidentifier",
|
||
FT_STRING, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_parentcommunicationtechnology,
|
||
{ "parentCommunicationTechnology", "ptp.sdr.parentcommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_parentuuid,
|
||
{ "parentUuid", "ptp.sdr.parentuuid",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_parentportfield,
|
||
{ "parentPortField", "ptp.sdr.parentportfield",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_estimatedmastervariance,
|
||
{ "estimatedMasterVariance", "ptp.sdr.estimatedmastervariance",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_estimatedmasterdrift,
|
||
{ "estimatedMasterDrift", "ptp.sdr.estimatedmasterdrift",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_sdr_utcreasonable,
|
||
{ "utcReasonable", "ptp.sdr.utcreasonable",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*offsets for follow_up (=fu) messages*/
|
||
{ &hf_ptp_fu_associatedsequenceid,
|
||
{ "associatedSequenceId", "ptp.fu.associatedsequenceid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_fu_preciseorigintimestamp,
|
||
{ "preciseOriginTimestamp", "ptp.fu.hf_ptp_fu_preciseorigintimestamp",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_fu_preciseorigintimestamp_seconds,
|
||
{ "preciseOriginTimestamp (seconds)", "ptp.fu.hf_ptp_fu_preciseorigintimestamp_seconds",
|
||
FT_UINT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_fu_preciseorigintimestamp_nanoseconds,
|
||
{ "preciseOriginTimestamp (nanoseconds)", "ptp.fu.preciseorigintimestamp_nanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*offsets for delay_resp (=dr) messages*/
|
||
{ &hf_ptp_dr_delayreceipttimestamp,
|
||
{ "delayReceiptTimestamp", "ptp.dr.delayreceipttimestamp",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_dr_delayreceipttimestamp_seconds,
|
||
{ "delayReceiptTimestamp (Seconds)", "ptp.dr.delayreceipttimestamp_seconds",
|
||
FT_UINT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_dr_delayreceipttimestamp_nanoseconds,
|
||
{ "delayReceiptTimestamp (nanoseconds)", "ptp.dr.delayreceipttimestamp_nanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_dr_requestingsourcecommunicationtechnology,
|
||
{ "requestingSourceCommunicationTechnology", "ptp.dr.requestingsourcecommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_dr_requestingsourceuuid,
|
||
{ "requestingSourceUuid", "ptp.dr.requestingsourceuuid",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_dr_requestingsourceportid,
|
||
{ "requestingSourcePortId", "ptp.dr.requestingsourceportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_dr_requestingsourcesequenceid,
|
||
{ "requestingSourceSequenceId", "ptp.dr.requestingsourcesequenceid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*offsets for management (=mm) messages*/
|
||
{ &hf_ptp_mm_targetcommunicationtechnology,
|
||
{ "targetCommunicationTechnology", "ptp.mm.targetcommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_targetuuid,
|
||
{ "targetUuid", "ptp.mm.targetuuid",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_targetportid,
|
||
{ "targetPortId", "ptp.mm.targetportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_startingboundaryhops,
|
||
{ "startingBoundaryHops", "ptp.mm.startingboundaryhops",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_boundaryhops,
|
||
{ "boundaryHops", "ptp.mm.boundaryhops",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_managementmessagekey,
|
||
{ "managementMessageKey", "ptp.mm.managementmessagekey",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_managementMessageKey_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parameterlength,
|
||
{ "parameterLength", "ptp.mm.parameterlength",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*parameterlength > 0*/
|
||
{ &hf_ptp_mm_messageparameters,
|
||
{ "messageParameters", "ptp.mm.messageparameters",
|
||
FT_BYTES, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_clock_identity (parameterlength = 64)*/
|
||
{ &hf_ptp_mm_clock_identity_clockcommunicationtechnology,
|
||
{ "clockCommunicationTechnology", "ptp.mm.clock.identity.clockcommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_clock_identity_clockuuidfield,
|
||
{ "clockUuidField", "ptp.mm.clock.identity.clockuuidfield",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_clock_identity_clockportfield,
|
||
{ "clockPortField", "ptp.mm.clock.identity.clockportfield",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_clock_identity_manufactureridentity,
|
||
{ "manufacturerIdentity", "ptp.mm.clock.identity.manufactureridentity",
|
||
FT_BYTES, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
|
||
/*ptp_mm_initialize_clock (parameterlength = 4)*/
|
||
{ &hf_ptp_mm_initialize_clock_initialisationkey,
|
||
{ "initialisationKey", "ptp.mm.initialize.clock.initialisationkey",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_set_subdomain (parameterlength = 16)*/
|
||
{ &hf_ptp_mm_set_subdomain_subdomainname,
|
||
{ "subdomainName", "ptp.mm.set.subdomain.subdomainname",
|
||
FT_STRING, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_default_data_set (parameterlength = 76)*/
|
||
{ &hf_ptp_mm_default_data_set_clockcommunicationtechnology,
|
||
{ "clockCommunicationTechnology", "ptp.mm.default.data.set.clockcommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_clockuuidfield,
|
||
{ "clockUuidField", "ptp.mm.default.data.set.clockuuidfield",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_clockportfield,
|
||
{ "clockPortField", "ptp.mm.default.data.set.clockportfield",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_clockstratum,
|
||
{ "clockStratum", "ptp.mm.default.data.set.clockstratum",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_clockidentifier,
|
||
{ "clockIdentifier", "ptp.mm.default.data.set.clockidentifier",
|
||
FT_BYTES, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_clockvariance,
|
||
{ "clockVariance", "ptp.mm.default.data.set.clockvariance",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_clockfollowupcapable,
|
||
{ "clockFollowupCapable", "ptp.mm.default.data.set.clockfollowupcapable",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_preferred,
|
||
{ "preferred", "ptp.mm.default.data.set.preferred",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_initializable,
|
||
{ "initializable", "ptp.mm.default.data.set.initializable",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_externaltiming,
|
||
{ "externalTiming", "ptp.mm.default.data.set.externaltiming",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_isboundaryclock,
|
||
{ "isBoundaryClock", "ptp.mm.default.data.set.isboundaryclock",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_syncinterval,
|
||
{ "syncInterval", "ptp.mm.default.data.set.syncinterval",
|
||
FT_INT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_subdomainname,
|
||
{ "subDomainName", "ptp.mm.default.data.set.subdomainname",
|
||
FT_STRING, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_numberports,
|
||
{ "numberPorts", "ptp.mm.default.data.set.numberports",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_default_data_set_numberforeignrecords,
|
||
{ "numberForeignRecords", "ptp.mm.default.data.set.numberforeignrecords",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_update_default_data_set (parameterlength = 36)*/
|
||
{ &hf_ptp_mm_update_default_data_set_clockstratum,
|
||
{ "clockStratum", "ptp.mm.update.default.data.set.clockstratum",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_update_default_data_set_clockidentifier,
|
||
{ "clockIdentifier", "ptp.mm.update.default.data.set.clockidentifier",
|
||
FT_BYTES, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_update_default_data_set_clockvariance,
|
||
{ "clockVariance", "ptp.mm.update.default.data.set.clockvariance",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_update_default_data_set_preferred,
|
||
{ "preferred", "ptp.mm.update.default.data.set.preferred",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_update_default_data_set_syncinterval,
|
||
{ "syncInterval", "ptp.mm.update.default.data.set.syncinterval",
|
||
FT_INT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_update_default_data_set_subdomainname,
|
||
{ "subdomainName", "ptp.mm.update.default.data.set.subdomainname",
|
||
FT_STRING, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_current_data_set (parameterlength = 20)*/
|
||
{ &hf_ptp_mm_current_data_set_stepsremoved,
|
||
{ "stepsRemoved", "ptp.mm.current.data.set.stepsremoved",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_current_data_set_offsetfrommaster,
|
||
{ "offsetFromMaster", "ptp.mm.current.data.set.offsetfrommaster",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_current_data_set_offsetfrommasterseconds,
|
||
{ "offsetFromMasterSeconds", "ptp.mm.current.data.set.offsetfrommasterseconds",
|
||
FT_UINT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_current_data_set_offsetfrommasternanoseconds,
|
||
{ "offsetFromMasterNanoseconds", "ptp.mm.current.data.set.offsetfrommasternanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_current_data_set_onewaydelay,
|
||
{ "oneWayDelay", "ptp.mm.current.data.set.onewaydelay",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_current_data_set_onewaydelayseconds,
|
||
{ "oneWayDelaySeconds", "ptp.mm.current.data.set.onewaydelayseconds",
|
||
FT_UINT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_current_data_set_onewaydelaynanoseconds,
|
||
{ "oneWayDelayNanoseconds", "ptp.mm.current.data.set.onewaydelaynanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_parent_data_set (parameterlength = 90)*/
|
||
{ &hf_ptp_mm_parent_data_set_parentcommunicationtechnology,
|
||
{ "parentCommunicationTechnology", "ptp.mm.parent.data.set.parentcommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_parentuuid,
|
||
{ "parentUuid", "ptp.mm.parent.data.set.parentuuid",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_parentportid,
|
||
{ "parentPortId", "ptp.mm.parent.data.set.parentportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_parentlastsyncsequencenumber,
|
||
{ "parentLastSyncSequenceNumber", "ptp.mm.parent.data.set.parentlastsyncsequencenumber",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_parentfollowupcapable,
|
||
{ "parentFollowupCapable", "ptp.mm.parent.data.set.parentfollowupcapable",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_parentexternaltiming,
|
||
{ "parentExternalTiming", "ptp.mm.parent.data.set.parentexternaltiming",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_parentvariance,
|
||
{ "parentVariance", "ptp.mm.parent.data.set.parentvariance",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_parentstats,
|
||
{ "parentStats", "ptp.mm.parent.data.set.parentstats",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_observedvariance,
|
||
{ "observedVariance", "ptp.mm.parent.data.set.observedvariance",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_observeddrift,
|
||
{ "observedDrift", "ptp.mm.parent.data.set.observeddrift",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_utcreasonable,
|
||
{ "utcReasonable", "ptp.mm.parent.data.set.utcreasonable",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_grandmastercommunicationtechnology,
|
||
{ "grandmasterCommunicationTechnology", "ptp.mm.parent.data.set.grandmastercommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_grandmasteruuidfield,
|
||
{ "grandmasterUuidField", "ptp.mm.parent.data.set.grandmasteruuidfield",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_grandmasterportidfield,
|
||
{ "grandmasterPortIdField", "ptp.mm.parent.data.set.grandmasterportidfield",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_grandmasterstratum,
|
||
{ "grandmasterStratum", "ptp.mm.parent.data.set.grandmasterstratum",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_grandmasteridentifier,
|
||
{ "grandmasterIdentifier", "ptp.mm.parent.data.set.grandmasteridentifier",
|
||
FT_BYTES, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_grandmastervariance,
|
||
{ "grandmasterVariance", "ptp.mm.parent.data.set.grandmastervariance",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_grandmasterpreferred,
|
||
{ "grandmasterPreferred", "ptp.mm.parent.data.set.grandmasterpreferred",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_grandmasterisboundaryclock,
|
||
{ "grandmasterIsBoundaryClock", "ptp.mm.parent.data.set.grandmasterisboundaryclock",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_parent_data_set_grandmastersequencenumber,
|
||
{ "grandmasterSequenceNumber", "ptp.mm.parent.data.set.grandmastersequencenumber",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_port_data_set (parameterlength = 52)*/
|
||
{ &hf_ptp_mm_port_data_set_returnedportnumber,
|
||
{ "returnedPortNumber", "ptp.mm.port.data.set.returnedportnumber",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_portstate,
|
||
{ "portState", "ptp.mm.port.data.set.portstate",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_lastsynceventsequencenumber,
|
||
{ "lastSyncEventSequenceNumber", "ptp.mm.port.data.set.lastsynceventsequencenumber",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_lastgeneraleventsequencenumber,
|
||
{ "lastGeneralEventSequenceNumber", "ptp.mm.port.data.set.lastgeneraleventsequencenumber",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_portcommunicationtechnology,
|
||
{ "portCommunicationTechnology", "ptp.mm.port.data.set.portcommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_portuuidfield,
|
||
{ "portUuidField", "ptp.mm.port.data.set.portuuidfield",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_portidfield,
|
||
{ "portIdField", "ptp.mm.port.data.set.portidfield",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_burstenabled,
|
||
{ "burstEnabled", "ptp.mm.port.data.set.burstenabled",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_subdomainaddressoctets,
|
||
{ "subdomainAddressOctets", "ptp.mm.port.data.set.subdomainaddressoctets",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_eventportaddressoctets,
|
||
{ "eventPortAddressOctets", "ptp.mm.port.data.set.eventportaddressoctets",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_generalportaddressoctets,
|
||
{ "generalPortAddressOctets", "ptp.mm.port.data.set.generalportaddressoctets",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_subdomainaddress,
|
||
{ "subdomainAddress", "ptp.mm.port.data.set.subdomainaddress",
|
||
FT_BYTES, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_eventportaddress,
|
||
{ "eventPortAddress", "ptp.mm.port.data.set.eventportaddress",
|
||
FT_BYTES, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_port_data_set_generalportaddress,
|
||
{ "generalPortAddress", "ptp.mm.port.data.set.generalportaddress",
|
||
FT_BYTES, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_global_time_data_set (parameterlength = 24)*/
|
||
{ &hf_ptp_mm_global_time_data_set_localtime,
|
||
{ "localTime", "ptp.mm.global.time.data.set.localtime",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_global_time_data_set_localtimeseconds,
|
||
{ "localTimeSeconds", "ptp.mm.global.time.data.set.localtimeseconds",
|
||
FT_UINT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_global_time_data_set_localtimenanoseconds,
|
||
{ "localTimeNanoseconds", "ptp.mm.global.time.data.set.localtimenanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_global_time_data_set_currentutcoffset,
|
||
{ "currentUtcOffset", "ptp.mm.global.time.data.set.currentutcoffset",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_global_time_data_set_leap59,
|
||
{ "leap59", "ptp.mm.global.time.data.set.leap59",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_global_time_data_set_leap61,
|
||
{ "leap61", "ptp.mm.global.time.data.set.leap61",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_global_time_data_set_epochnumber,
|
||
{ "epochNumber", "ptp.mm.global.time.data.set.epochnumber",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_update_global_time_properties (parameterlength = 16)*/
|
||
{ &hf_ptp_mm_update_global_time_properties_currentutcoffset,
|
||
{ "currentUtcOffset", "ptp.mm.update.global.time.properties.currentutcoffset",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_update_global_time_properties_leap59,
|
||
{ "leap59", "ptp.mm.update.global.time.properties.leap59",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_update_global_time_properties_leap61,
|
||
{ "leap61", "ptp.mm.update.global.time.properties.leap61",
|
||
FT_BOOLEAN, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_update_global_time_properties_epochnumber,
|
||
{ "epochNumber", "ptp.mm.update.global.time.properties.epochnumber",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_get_foreign_data_set (parameterlength = 4)*/
|
||
{ &hf_ptp_mm_get_foreign_data_set_recordkey,
|
||
{ "recordKey", "ptp.mm.get.foreign.data.set.recordkey",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_foreign_data_set (parameterlength = 28)*/
|
||
{ &hf_ptp_mm_foreign_data_set_returnedportnumber,
|
||
{ "returnedPortNumber", "ptp.mm.foreign.data.set.returnedportnumber",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_foreign_data_set_returnedrecordnumber,
|
||
{ "returnedRecordNumber", "ptp.mm.foreign.data.set.returnedrecordnumber",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_foreign_data_set_foreignmastercommunicationtechnology,
|
||
{ "foreignMasterCommunicationTechnology",
|
||
"ptp.mm.foreign.data.set.foreignmastercommunicationtechnology",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_communicationid_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_foreign_data_set_foreignmasteruuidfield,
|
||
{ "foreignMasterUuidField", "ptp.mm.foreign.data.set.foreignmasteruuidfield",
|
||
FT_ETHER, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_foreign_data_set_foreignmasterportidfield,
|
||
{ "foreignMasterPortIdField", "ptp.mm.foreign.data.set.foreignmasterportidfield",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_foreign_data_set_foreignmastersyncs,
|
||
{ "foreignMasterSyncs", "ptp.mm.foreign.data.set.foreignmastersyncs",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_set_sync_interval (parameterlength = 4)*/
|
||
{ &hf_ptp_mm_set_sync_interval_syncinterval,
|
||
{ "syncInterval", "ptp.mm.set.sync.interval.syncinterval",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
/*ptp_mm_set_time (parameterlength = 8)*/
|
||
{ &hf_ptp_mm_set_time_localtime,
|
||
{ "localtime", "ptp.mm.set.time.localtime",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_set_time_localtimeseconds,
|
||
{ "localtimeSeconds", "ptp.mm.set.time.localtimeseconds",
|
||
FT_UINT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_mm_set_time_localtimenanoseconds,
|
||
{ "localTimeNanoseconds", "ptp.mm.set.time.localtimenanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x0,
|
||
"", HFILL }
|
||
},
|
||
|
||
|
||
|
||
|
||
/* PTPv2 fields **********************************************************/
|
||
/*Common fields for all frames*/
|
||
{ &hf_ptp_v2_transportspecific,
|
||
{ "transportSpecific", "ptp.v2.transportspecific",
|
||
FT_UINT8, BASE_HEX, NULL, 0xF0,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_transportspecific_v1_compatibility,
|
||
{ "V1 Compatibility", "ptp.v2.transportspecific.v1compatibility",
|
||
FT_BOOLEAN, 8, NULL, PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_transportspecific_802as_conform,
|
||
{ "802.1as conform", "ptp.v2.transportspecific.802.1asconform",
|
||
FT_BOOLEAN, 8, NULL, PTP_V2_TRANSPORTSPECIFIC_V1COMPATIBILITY_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_messageid,
|
||
{ "messageId", "ptp.v2.messageid",
|
||
FT_UINT8, BASE_HEX, VALS(ptp_v2_messageid_vals), 0x0F,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_versionptp,
|
||
{ "versionPTP", "ptp.v2.versionptp",
|
||
FT_UINT8, BASE_DEC, NULL, 0x0F,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_messagelength,
|
||
{ "messageLength", "ptp.v2.messagelength",
|
||
FT_UINT16, BASE_DEC, NULL, 0x0,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_domainnumber,
|
||
{ "subdomainNumber", "ptp.v2.subdomainnumber",
|
||
FT_UINT8, BASE_DEC, NULL, 0x0,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags,
|
||
{ "flags", "ptp.v2.flags",
|
||
FT_UINT16, BASE_HEX, NULL, 0x0,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_alternatemaster,
|
||
{ "PTP_ALTERNATE_MASTER", "ptp.v2.flags.alternatemaster",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_ALTERNATE_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_twostep,
|
||
{ "PTP_TWO_STEP", "ptp.v2.flags.twostep",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_TWO_STEP_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_unicast,
|
||
{ "PTP_UNICAST", "ptp.v2.flags.unicast",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_UNICAST_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_specific1,
|
||
{ "PTP profile Specific 1", "ptp.v2.flags.specific1",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SPECIFIC1_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_specific2,
|
||
{ "PTP profile Specific 2", "ptp.v2.flags.specific2",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SPECIFIC2_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_security,
|
||
{ "PTP_SECURITY", "ptp.v2.flags.security",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_SECURITY_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_li61,
|
||
{ "PTP_LI_61", "ptp.v2.flags.li61",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_LI61_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_li59,
|
||
{ "PTP_LI_59", "ptp.v2.flags.li59",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_LI59_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_utcoffsetvalid,
|
||
{ "PTP_UTC_REASONABLE", "ptp.v2.flags.utcreasonable",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_UTC_OFFSET_VALID_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_ptptimescale,
|
||
{ "PTP_TIMESCALE", "ptp.v2.flags.timescale",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_PTP_TIMESCALE_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_timetraceable,
|
||
{ "TIME_TRACEABLE", "ptp.v2.flags.timetraceable",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_TIME_TRACEABLE_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_flags_frequencytraceable,
|
||
{ "FREQUENCY_TRACEABLE", "ptp.v2.flags.frequencytraceable",
|
||
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_correction,
|
||
{ "correction", "ptp.v2.correction",
|
||
FT_DOUBLE, BASE_NONE, NULL, 0x0,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_correctionns,
|
||
{ "correctionNs", "ptp.v2.correction.ns",
|
||
FT_INT64, BASE_DEC, NULL, 0x0,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_correctionsubns,
|
||
{ "correctionSubNs", "ptp.v2.correction.subns",
|
||
FT_DOUBLE, BASE_DEC, NULL, 0x0,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_clockidentity,
|
||
{ "ClockIdentity", "ptp.v2.clockidentity",
|
||
FT_INT64, BASE_HEX, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_sourceportid,
|
||
{ "SourcePortID", "ptp.v2.sourceportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_sequenceid,
|
||
{ "sequenceId", "ptp.v2.sequenceid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_control,
|
||
{ "control", "ptp.v2.control",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_control_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_logmessageperiod,
|
||
{ "logMessagePeriod", "ptp.v2.logmessageperiod",
|
||
FT_INT8, BASE_DEC, NULL, 0x0,
|
||
"", HFILL }
|
||
},
|
||
|
||
/*Fields for PTP_Announce (=an) messages*/
|
||
{ &hf_ptp_v2_an_origintimestamp,
|
||
{ "originTimestamp", "ptp.v2.an.origintimestamp",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_origintimestamp_seconds,
|
||
{ "originTimestamp (seconds)", "ptp.v2.an.origintimestamp.seconds",
|
||
FT_UINT64, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_origintimestamp_nanoseconds,
|
||
{ "originTimestamp (nanoseconds)", "ptp.v2.an.origintimestamp.nanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_origincurrentutcoffset,
|
||
{ "originCurrentUTCOffset", "ptp.v2.an.origincurrentutcoffset",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_timesource,
|
||
{ "TimeSource", "ptp.v2.timesource",
|
||
FT_UINT8, BASE_HEX, VALS(ptp_v2_timesource_vals), 0x0,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_localstepsremoved,
|
||
{ "localStepsRemoved", "ptp.v2.an.localstepsremoved",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_grandmasterclockidentity,
|
||
{ "grandmasterClockIdentity", "ptp.v2.an.grandmasterclockidentity",
|
||
FT_INT64, BASE_HEX, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_grandmasterclockclass,
|
||
{ "grandmasterClockClass", "ptp.v2.an.grandmasterclockclass",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_grandmasterclockaccuracy,
|
||
{ "grandmasterClockAccuracy", "ptp.v2.an.grandmasterclockaccuracy",
|
||
FT_UINT8, BASE_HEX, VALS(ptp_v2_clockaccuracy_vals), 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_grandmasterclockvariance,
|
||
{ "grandmasterClockVariance", "ptp.v2.an.grandmasterclockvariance",
|
||
FT_INT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_priority1,
|
||
{ "priority1", "ptp.v2.an.priority1",
|
||
FT_UINT8, BASE_DEC, NULL, 0x0,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_an_priority2,
|
||
{ "priority2", "ptp.v2.an.priority2",
|
||
FT_UINT8, BASE_DEC, NULL, 0x0,
|
||
"", HFILL }
|
||
},
|
||
|
||
/*Fields for PTP_Sync AND PTP_DelayRequest (=sdr) messages*/
|
||
{ &hf_ptp_v2_sdr_origintimestamp,
|
||
{ "originTimestamp", "ptp.v2.sdr.origintimestamp",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_sdr_origintimestamp_seconds,
|
||
{ "originTimestamp (seconds)", "ptp.v2.sdr.origintimestamp.seconds",
|
||
FT_UINT64, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_sdr_origintimestamp_nanoseconds,
|
||
{ "originTimestamp (nanoseconds)", "ptp.v2.sdr.origintimestamp.nanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
|
||
/*Fields for PTP_Follow_Up (=fu) messages*/
|
||
{ &hf_ptp_v2_fu_preciseorigintimestamp,
|
||
{ "preciseOriginTimestamp", "ptp.v2.fu.preciseorigintimestamp",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_fu_preciseorigintimestamp_seconds,
|
||
{ "preciseOriginTimestamp (seconds)", "ptp.v2.fu.preciseorigintimestamp.seconds",
|
||
FT_UINT64, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_fu_preciseorigintimestamp_nanoseconds,
|
||
{ "preciseOriginTimestamp (nanoseconds)", "ptp.v2.fu.preciseorigintimestamp.nanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
|
||
/*Fields for PTP_DelayResponse (=dr) messages*/
|
||
{ &hf_ptp_v2_dr_receivetimestamp,
|
||
{ "receiveTimestamp", "ptp.v2.dr.receivetimestamp",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_dr_receivetimestamp_seconds,
|
||
{ "receiveTimestamp (seconds)", "ptp.v2.dr.receivetimestamp.seconds",
|
||
FT_UINT64, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_dr_receivetimestamp_nanoseconds,
|
||
{ "receiveTimestamp (nanoseconds)", "ptp.v2.dr.receivetimestamp.nanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_dr_requestingportidentity,
|
||
{ "requestingSourcePortIdentity", "ptp.v2.dr.requestingsourceportidentity",
|
||
FT_INT64, BASE_HEX, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_dr_requestingsourceportid,
|
||
{ "requestingSourcePortId", "ptp.v2.dr.requestingsourceportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
|
||
/*Fields for PTP_PDelayRequest (=pdrq) messages*/
|
||
{ &hf_ptp_v2_pdrq_origintimestamp,
|
||
{ "originTimestamp", "ptp.v2.pdrq.origintimestamp",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_pdrq_origintimestamp_seconds,
|
||
{ "originTimestamp (seconds)", "ptp.v2.pdrq.origintimestamp.seconds",
|
||
FT_UINT64, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_pdrq_origintimestamp_nanoseconds,
|
||
{ "originTimestamp (nanoseconds)", "ptp.v2.pdrq.origintimestamp.nanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
|
||
/*Fields for PTP_PDelayResponse (=pdrs) messages*/
|
||
{ &hf_ptp_v2_pdrs_requestreceipttimestamp,
|
||
{ "requestreceiptTimestamp", "ptp.v2.pdrs.requestreceipttimestamp",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_pdrs_requestreceipttimestamp_seconds,
|
||
{ "requestreceiptTimestamp (seconds)", "ptp.v2.pdrs.requestreceipttimestamp.seconds",
|
||
FT_UINT64, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_pdrs_requestreceipttimestamp_nanoseconds,
|
||
{ "requestreceiptTimestamp (nanoseconds)", "ptp.v2.pdrs.requestreceipttimestamp.nanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_pdrs_requestingportidentity,
|
||
{ "requestingSourcePortIdentity", "ptp.v2.pdrs.requestingportidentity",
|
||
FT_INT64, BASE_HEX, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_pdrs_requestingsourceportid,
|
||
{ "requestingSourcePortId", "ptp.v2.pdrs.requestingsourceportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
|
||
/*Fields for PTP_PDelayResponseFollowUp (=pdfu) messages*/
|
||
{ &hf_ptp_v2_pdfu_responseorigintimestamp,
|
||
{ "responseOriginTimestamp", "ptp.v2.pdfu.responseorigintimestamp",
|
||
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_pdfu_responseorigintimestamp_seconds,
|
||
{ "responseOriginTimestamp (seconds)", "ptp.v2.pdfu.responseorigintimestamp.seconds",
|
||
FT_UINT64, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_pdfu_responseorigintimestamp_nanoseconds,
|
||
{ "responseOriginTimestamp (nanoseconds)", "ptp.v2.pdfu.responseorigintimestamp.nanoseconds",
|
||
FT_INT32, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_pdfu_requestingportidentity,
|
||
{ "requestingSourcePortIdentity", "ptp.v2.pdfu.requestingportidentity",
|
||
FT_INT64, BASE_HEX, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_pdfu_requestingsourceportid,
|
||
{ "requestingSourcePortId", "ptp.v2.pdfu.requestingsourceportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
|
||
/*Fields for PTP_Signalling (=sig) messages*/
|
||
{ &hf_ptp_v2_sig_targetportidentity,
|
||
{ "targetPortIdentity", "ptp.v2.sig.targetportidentity",
|
||
FT_INT64, BASE_HEX, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_sig_targetportid,
|
||
{ "targetPortId", "ptp.v2.sig.targetportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
|
||
/*Fields for PTP_Management (=mm) messages*/
|
||
{ &hf_ptp_v2_mm_targetportidentity,
|
||
{ "targetPortIdentity", "ptp.v2.mm.targetportidentity",
|
||
FT_INT64, BASE_HEX, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_mm_targetportid,
|
||
{ "targetPortId", "ptp.v2.mm.targetportid",
|
||
FT_UINT16, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_mm_startingboundaryhops,
|
||
{ "startingBoundaryHops", "ptp.v2.mm.startingboundaryhops",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_mm_boundaryhops,
|
||
{ "boundaryHops", "ptp.v2.mm.boundaryhops",
|
||
FT_UINT8, BASE_DEC, NULL, 0x00,
|
||
"", HFILL }
|
||
},
|
||
{ &hf_ptp_v2_mm_action,
|
||
{ "action", "ptp.v2.mm.action",
|
||
FT_UINT8, BASE_DEC, VALS(ptp_v2_mm_action_vals), 0x0F,
|
||
"", HFILL }
|
||
},
|
||
|
||
};
|
||
|
||
/* Setup protocol subtree array */
|
||
static gint *ett[] = {
|
||
&ett_ptp,
|
||
&ett_ptp_flags,
|
||
&ett_ptp_time,
|
||
&ett_ptp_time2,
|
||
&ett_ptp_v2,
|
||
&ett_ptp_v2_transportspecific,
|
||
&ett_ptp_v2_flags,
|
||
&ett_ptp_v2_correction,
|
||
&ett_ptp_v2_time,
|
||
&ett_ptp_v2_time2,
|
||
};
|
||
|
||
/* Register the protocol name and description */
|
||
proto_ptp = proto_register_protocol("Precision Time Protocol (IEEE1588)",
|
||
"PTP", "ptp");
|
||
|
||
/* Required function calls to register the header fields and subtrees used */
|
||
proto_register_field_array(proto_ptp, hf, array_length(hf));
|
||
proto_register_subtree_array(ett, array_length(ett));
|
||
}
|
||
|
||
void
|
||
proto_reg_handoff_ptp(void)
|
||
{
|
||
dissector_handle_t event_port_ptp_handle;
|
||
dissector_handle_t general_port_ptp_handle;
|
||
dissector_handle_t ethertype_ptp_handle;
|
||
|
||
event_port_ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp);
|
||
general_port_ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp);
|
||
ethertype_ptp_handle = create_dissector_handle(dissect_ptp_oE, proto_ptp);
|
||
|
||
dissector_add("udp.port", EVENT_PORT_PTP, event_port_ptp_handle);
|
||
dissector_add("udp.port", GENERAL_PORT_PTP, general_port_ptp_handle);
|
||
dissector_add("ethertype", ETHERTYPE_PTP, ethertype_ptp_handle);
|
||
}
|
||
|
||
|