ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] [PATCH] tipc: update link header according to spec

Date: Fri, 8 Mar 2013 09:22:39 +0100
From: Erik Hugne <erik.hugne@xxxxxxxxxxxx>

The bcastsequence gap have been removed, and the
sequence field is now 13 bits.

Signed-off-by: Erik Hugne <erik.hugne@xxxxxxxxxxxx>
---
 epan/dissectors/packet-tipc.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c
index bf8784e..8eebcb4 100644
--- a/epan/dissectors/packet-tipc.c
+++ b/epan/dissectors/packet-tipc.c
@@ -134,7 +134,6 @@ static int hf_tipcv2_port_name_instance = -1;
 static int hf_tipcv2_multicast_lower = -1;
 static int hf_tipcv2_multicast_upper = -1;
 
-static int hf_tipcv2_bcast_seq_gap = -1;
 static int hf_tipcv2_sequence_gap = -1;
 static int hf_tipcv2_next_sent_broadcast = -1;
 static int hf_tipcv2_fragment_number = -1;
@@ -791,7 +790,7 @@ tipc_v1_set_col_msgtype(packet_info *pinfo, guint8 user, guint8 msg_type)
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 w0:|vers |msg usr|hdr sz |n|resrv|            packet size          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-w1:|m typ|bcstsqgap| sequence gap  |       broadcast ack no        |
+w1:|m typ|      sequence gap       |       broadcast ack no        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 w2:|        link level ack no      |   broadcast/link level seq no |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -842,7 +841,6 @@ dissect_tipc_v2_internal_msg(tvbuff_t *tipc_tvb, proto_tree *tipc_tree, packet_i
 		case TIPCv2_BCAST_PROTOCOL:
 			/* W1 */
 			proto_tree_add_item(tipc_tree, hf_tipcv2_bcast_mtype, tipc_tvb, offset, 4, ENC_BIG_ENDIAN);
-			/* NO bcstsqgap */
 			/* NO sequence gap */
 			proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no, tipc_tvb, offset, 4, ENC_BIG_ENDIAN);
 			offset = offset + 4;
@@ -965,9 +963,7 @@ dissect_tipc_v2_internal_msg(tvbuff_t *tipc_tvb, proto_tree *tipc_tree, packet_i
 		case TIPCv2_LINK_PROTOCOL:
 			/* W1 */
 			proto_tree_add_item(tipc_tree, hf_tipcv2_link_mtype, tipc_tvb, offset, 4, ENC_BIG_ENDIAN);
-			/*  Broadcast Sequence Gap: 5 bits. */
-			proto_tree_add_item(tipc_tree, hf_tipcv2_bcast_seq_gap, tipc_tvb, offset, 4, ENC_BIG_ENDIAN);
-			/* Sequence Gap:  8 bits. */
+			/* Sequence Gap:  13 bits. */
 			proto_tree_add_item(tipc_tree, hf_tipcv2_sequence_gap, tipc_tvb, offset, 4, ENC_BIG_ENDIAN);
 			proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no, tipc_tvb, offset, 4, ENC_BIG_ENDIAN);
 			offset = offset + 4;
@@ -2502,7 +2498,7 @@ proto_register_tipc(void)
 		},
 		{ &hf_tipc_seq_gap,
 			{ "Sequence gap", "tipc.seq_gap",
-				FT_UINT32, BASE_DEC, NULL, 0x0fff0000,
+				FT_UINT32, BASE_DEC, NULL, 0x1fff0000,
 				"TIPC Sequence gap", HFILL }
 		},
 		{ &hf_tipc_nxt_snt_pkg,
@@ -2680,14 +2676,9 @@ proto_register_tipc(void)
 				FT_UINT32, BASE_DEC, NULL, 0xffffffff,
 				"Multicast port name instance upper bound", HFILL }
 		},
-		{ &hf_tipcv2_bcast_seq_gap,
-			{ "Broadcast Sequence Gap", "tipcv2.bcast_seq_gap",
-				FT_UINT32, BASE_DEC, NULL, 0x1F000000,
-				NULL, HFILL }
-		},
 		{ &hf_tipcv2_sequence_gap,
 			{ "Sequence Gap", "tipcv2.seq_gap",
-				FT_UINT32, BASE_DEC, NULL, 0x00FF0000,
+				FT_UINT32, BASE_DEC, NULL, 0x1FFF0000,
 				NULL, HFILL }
 		},
 		{ &hf_tipcv2_next_sent_broadcast,
-- 
1.7.5.4