aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ptp.c
diff options
context:
space:
mode:
authorJoerg Mayer <jmayer@loplof.de>2019-02-14 06:27:47 +0100
committerJörg Mayer <jmayer@loplof.de>2019-02-14 05:29:00 +0000
commit465f02a61a1bf6fb96490d88aaa4f5943a9be404 (patch)
tree333a6aac467d1ea1565570437d0ab7fbb54abbcd /epan/dissectors/packet-ptp.c
parentc99882733a8eb13e57bcf63f6b98f32ed2573fb0 (diff)
packet-ptp.c: Add some reserved fields instead of skipping them
Change-Id: If8da7027d7eae1284123465bc992a94e10c37757 Reviewed-on: https://code.wireshark.org/review/32020 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Diffstat (limited to 'epan/dissectors/packet-ptp.c')
-rw-r--r--epan/dissectors/packet-ptp.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ptp.c b/epan/dissectors/packet-ptp.c
index 59d2820947..3d33ca7b31 100644
--- a/epan/dissectors/packet-ptp.c
+++ b/epan/dissectors/packet-ptp.c
@@ -687,12 +687,15 @@ static gint ett_ptp_time2 = -1;
/* 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_RESERVED1_OFFSET PTP_V2_VERSIONPTP_OFFSET
#define PTP_V2_MESSAGE_LENGTH_OFFSET 2
#define PTP_V2_DOMAIN_NUMBER_OFFSET 4
+#define PTP_V2_RESERVED2_OFFSET 5
#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_RESERVED3_OFFSET 16
#define PTP_V2_CLOCKIDENTITY_OFFSET 20
#define PTP_V2_SOURCEPORTID_OFFSET 28
#define PTP_V2_SEQUENCEID_OFFSET 30
@@ -1360,8 +1363,10 @@ 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_reserved1 = -1;
static int hf_ptp_v2_versionptp = -1;
static int hf_ptp_v2_messagelength = -1;
+static int hf_ptp_v2_reserved2 = -1;
static int hf_ptp_v2_domainnumber = -1;
static int hf_ptp_v2_flags = -1;
static int hf_ptp_v2_flags_alternatemaster = -1;
@@ -1378,6 +1383,7 @@ 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_correctionsubns = -1;
+static int hf_ptp_v2_reserved3 = -1;
static int hf_ptp_v2_clockidentity = -1;
static int hf_ptp_v2_sourceportid = -1;
static int hf_ptp_v2_sequenceid = -1;
@@ -2618,6 +2624,9 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean ptp
hf_ptp_v2_messageid, tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ptp_tree,
+ hf_ptp_v2_reserved1, tvb, PTP_V2_RESERVED1_OFFSET, 1, ENC_BIG_ENDIAN);
+
+ proto_tree_add_item(ptp_tree,
hf_ptp_v2_versionptp, tvb, PTP_V2_VERSIONPTP_OFFSET, 1, ENC_BIG_ENDIAN);
msg_len_item = proto_tree_add_item(ptp_tree,
@@ -2649,6 +2658,8 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean ptp
proto_tree_add_item(ptp_tree,
hf_ptp_v2_domainnumber, tvb, PTP_V2_DOMAIN_NUMBER_OFFSET, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ptp_tree,
+ hf_ptp_v2_reserved2, tvb, PTP_V2_RESERVED2_OFFSET, 1, ENC_BIG_ENDIAN);
flags_ti = proto_tree_add_item(ptp_tree,
hf_ptp_v2_flags, tvb, PTP_V2_FLAGS_OFFSET, 2, ENC_BIG_ENDIAN);
@@ -2696,6 +2707,9 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean ptp
dissect_ptp_v2_timeInterval(tvb, &temp, ptp_tree, "correction", hf_ptp_v2_correction, hf_ptp_v2_correctionsubns);
proto_tree_add_item(ptp_tree,
+ hf_ptp_v2_reserved3, tvb, PTP_V2_RESERVED3_OFFSET, 4, ENC_BIG_ENDIAN);
+
+ proto_tree_add_item(ptp_tree,
hf_ptp_v2_clockidentity, tvb, PTP_V2_CLOCKIDENTITY_OFFSET, 8, ENC_BIG_ENDIAN);
proto_tree_add_item(ptp_tree,
@@ -5235,6 +5249,11 @@ proto_register_ptp(void)
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &ptp_v2_messageid_vals_ext, 0x0F,
NULL, HFILL }
},
+ { &hf_ptp_v2_reserved1,
+ { "Reserved", "ptp.v2.reserved1",
+ FT_UINT8, BASE_DEC, NULL, 0xF0,
+ NULL, HFILL }
+ },
{ &hf_ptp_v2_versionptp,
{ "versionPTP", "ptp.v2.versionptp",
FT_UINT8, BASE_DEC, NULL, 0x0F,
@@ -5245,6 +5264,11 @@ proto_register_ptp(void)
FT_UINT16, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
+ { &hf_ptp_v2_reserved2,
+ { "Reserved", "ptp.v2.reserved2",
+ FT_UINT8, BASE_DEC, NULL, 0x00,
+ NULL, HFILL }
+ },
{ &hf_ptp_v2_domainnumber,
{ "subdomainNumber", "ptp.v2.subdomainnumber",
FT_UINT8, BASE_DEC, NULL, 0x00,
@@ -5315,6 +5339,11 @@ proto_register_ptp(void)
FT_BOOLEAN, 16, NULL, PTP_V2_FLAGS_FREQUENCY_TRACEABLE_BITMASK,
NULL, HFILL }
},
+ { &hf_ptp_v2_reserved3,
+ { "Reserved", "ptp.v2.reserved3",
+ FT_UINT32, BASE_DEC, NULL, 0x00,
+ NULL, HFILL }
+ },
{ &hf_ptp_v2_correction,
{ "correction", "ptp.v2.correction.ns",
FT_UINT64, BASE_DEC, NULL, 0x00,