aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2015-11-28 16:05:22 +0100
committerMichael Mann <mmann78@netscape.net>2015-11-28 19:07:04 +0000
commit2f5849cc8c6347b3c1a4a16887d40fead6a841c3 (patch)
treef3cc9cc352024f2fc5dcfe0100b4180944756ad5 /epan/dissectors
parentd3e40e499aa50dd6da057b2162a658b7fe76f9f4 (diff)
IS-IS: Add Instance ID TLV (RFC 6822)
Bug:11649 Change-Id: I852b0f93797ba9e67c2772f482182b1f0d753a43 Reviewed-on: https://code.wireshark.org/review/12254 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-isis-clv.c37
-rw-r--r--epan/dissectors/packet-isis-clv.h4
-rw-r--r--epan/dissectors/packet-isis-hello.c48
-rw-r--r--epan/dissectors/packet-isis-lsp.c49
-rw-r--r--epan/dissectors/packet-isis-snp.c58
5 files changed, 195 insertions, 1 deletions
diff --git a/epan/dissectors/packet-isis-clv.c b/epan/dissectors/packet-isis-clv.c
index c7e9cf4a90..c919357d86 100644
--- a/epan/dissectors/packet-isis-clv.c
+++ b/epan/dissectors/packet-isis-clv.c
@@ -93,6 +93,43 @@ isis_dissect_area_address_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tv
}
}
+/*
+ * Name: isis_dissect_instance_identifier_clv()
+ *
+ *
+ * Input:
+ * tvbuff_t * : tvbuffer for packet data
+ * proto_tree * : protocol display tree to fill out. May be NULL
+ * int : offset into packet data where we are.
+ * int : length of clv we are decoding
+ *
+ * Output:
+ * void, but we will add to proto tree if !NULL.
+ */
+void
+isis_dissect_instance_identifier_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb,
+ expert_field* expert, int hf_iid, int hf_supported_itid, int offset, int length)
+{
+
+ length--;
+ if (length<=0) {
+ proto_tree_add_expert_format(tree, pinfo, expert, tvb, offset, -1,
+ "short address (no length for payload)");
+ return;
+ }
+
+ proto_tree_add_item(tree, hf_iid, tvb, offset, 2, ENC_BIG_ENDIAN);
+ offset += 2;
+ length -= 2;
+
+ while ( length > 0 ) {
+
+ proto_tree_add_item(tree, hf_supported_itid, tvb, offset, 2, ENC_BIG_ENDIAN);
+ offset += 2;
+ length -= 2;
+
+ }
+}
/*
* Name: isis_dissect_authentication_clv()
diff --git a/epan/dissectors/packet-isis-clv.h b/epan/dissectors/packet-isis-clv.h
index 11253d6a44..e2dd805763 100644
--- a/epan/dissectors/packet-isis-clv.h
+++ b/epan/dissectors/packet-isis-clv.h
@@ -42,7 +42,7 @@
#define ISIS_CLV_PARTITION_DIS 4 /* iso10589 */
#define ISIS_CLV_PREFIX_NEIGHBORS 5 /* iso10589 */
#define ISIS_CLV_IS_NEIGHBORS 6 /* iso10589 */
-#define ISIS_CLV_IS_NEIGHBORS_VARLEN 7 /* iso10589 */
+#define ISIS_CLV_INSTANCE_IDENTIFIER 7 /* rfc6822 */
#define ISIS_CLV_PADDING 8 /* iso10589 */
#define ISIS_CLV_LSP_ENTRIES 9 /* iso10589 */
#define ISIS_CLV_AUTHENTICATION 10 /* iso10589, rfc3567 */
@@ -112,6 +112,8 @@ extern void isis_dissect_authentication_clv(proto_tree *tree, packet_info* pinfo
int hf_auth_bytes, expert_field* auth_expert, int offset, int length);
extern void isis_dissect_area_address_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb,
expert_field* expert, int hf_area, int offset, int length);
+extern void isis_dissect_instance_identifier_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb,
+ expert_field* expert, int hf_iid, int hf_supported_itid, int offset, int length);
extern void isis_dissect_metric(tvbuff_t *tvb, proto_tree *tree, int offset,
guint8 value, char *pstr, int force_supported);
diff --git a/epan/dissectors/packet-isis-hello.c b/epan/dissectors/packet-isis-hello.c
index fa24319eea..d6d7497158 100644
--- a/epan/dissectors/packet-isis-hello.c
+++ b/epan/dissectors/packet-isis-hello.c
@@ -95,6 +95,8 @@ static int hf_isis_hello_bvid = -1;
static int hf_isis_hello_bvid_u = -1;
static int hf_isis_hello_bvid_m = -1;
static int hf_isis_hello_area_address = -1;
+static int hf_isis_hello_instance_identifier = -1;
+static int hf_isis_hello_supported_itid = -1;
static int hf_isis_hello_clv_nlpid = -1;
static int hf_isis_hello_clv_ip_authentication = -1;
static int hf_isis_hello_authentication = -1;
@@ -136,6 +138,7 @@ static int hf_isis_hello_trill_unassigned_2 = -1;
static gint ett_isis_hello = -1;
static gint ett_isis_hello_clv_area_addr = -1;
+static gint ett_isis_hello_clv_instance_identifier = -1;
static gint ett_isis_hello_clv_is_neighbors = -1;
static gint ett_isis_hello_clv_padding = -1;
static gint ett_isis_hello_clv_unknown = -1;
@@ -814,6 +817,30 @@ dissect_hello_area_address_clv(tvbuff_t *tvb, packet_info* pinfo _U_,
isis_dissect_area_address_clv(tree, pinfo, tvb, &ei_isis_hello_short_packet, hf_isis_hello_area_address, offset, length);
}
+/*
+ * Name: dissect_hello_instance_identifier_clv()
+ *
+ * Description:
+ * Decode for a hello packets Instance Identifier clv.
+ * Calls into the CLV common one.
+ *
+ * Input:
+ * tvbuff_t * : tvbuffer for packet data
+ * proto_tree * : proto tree to build on (may be null)
+ * int : current offset into packet data
+ * int : length of IDs in packet.
+ * int : length of this clv
+ *
+ * Output:
+ * void, will modify proto_tree if not null.
+ */
+static void
+dissect_hello_instance_identifier_clv(tvbuff_t *tvb, packet_info* pinfo _U_,
+ proto_tree *tree, int offset, int id_length _U_, int length)
+{
+ isis_dissect_instance_identifier_clv(tree, pinfo, tvb, &ei_isis_hello_short_packet, hf_isis_hello_instance_identifier, hf_isis_hello_supported_itid, offset, length);
+}
+
static const value_string adj_state_vals[] = {
{ 0, "Up" },
{ 1, "Initializing" },
@@ -926,6 +953,12 @@ static const isis_clv_handle_t clv_l1_hello_opts[] = {
dissect_hello_is_neighbors_clv
},
{
+ ISIS_CLV_INSTANCE_IDENTIFIER,
+ "Instance Identifier",
+ &ett_isis_hello_clv_instance_identifier,
+ dissect_hello_instance_identifier_clv
+ },
+ {
ISIS_CLV_PADDING,
"Padding",
&ett_isis_hello_clv_padding,
@@ -1013,6 +1046,12 @@ static const isis_clv_handle_t clv_l2_hello_opts[] = {
dissect_hello_is_neighbors_clv
},
{
+ ISIS_CLV_INSTANCE_IDENTIFIER,
+ "Instance Identifier",
+ &ett_isis_hello_clv_instance_identifier,
+ dissect_hello_instance_identifier_clv
+ },
+ {
ISIS_CLV_PADDING,
"Padding",
&ett_isis_hello_clv_padding,
@@ -1082,6 +1121,12 @@ static const isis_clv_handle_t clv_ptp_hello_opts[] = {
dissect_hello_area_address_clv
},
{
+ ISIS_CLV_INSTANCE_IDENTIFIER,
+ "Instance Identifier",
+ &ett_isis_hello_clv_instance_identifier,
+ dissect_hello_instance_identifier_clv
+ },
+ {
ISIS_CLV_PADDING,
"Padding",
&ett_isis_hello_clv_padding,
@@ -1369,6 +1414,8 @@ proto_register_isis_hello(void)
{ &hf_isis_hello_bvid_u, { "U", "isis.hello.bvid.u", FT_UINT16, BASE_HEX_DEC, NULL, 0x0008, NULL, HFILL }},
{ &hf_isis_hello_bvid_m, { "M", "isis.hello.bvid.m", FT_UINT16, BASE_HEX_DEC, NULL, 0x0004, NULL, HFILL }},
{ &hf_isis_hello_area_address, { "Area address", "isis.hello.area_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_isis_hello_instance_identifier, { "Instance Identifier", "isis.hello.iid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_isis_hello_supported_itid, { "Supported ITID", "isis.hello.supported_itid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_isis_hello_clv_nlpid, { "NLPID", "isis.hello.clv_nlpid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_isis_hello_clv_ip_authentication, { "NLPID", "isis.hello.clv_ip_authentication", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_isis_hello_authentication, { "Authentication", "isis.hello.clv_authentication", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
@@ -1412,6 +1459,7 @@ proto_register_isis_hello(void)
static gint *ett[] = {
&ett_isis_hello,
&ett_isis_hello_clv_area_addr,
+ &ett_isis_hello_clv_instance_identifier,
&ett_isis_hello_clv_is_neighbors,
&ett_isis_hello_clv_padding,
&ett_isis_hello_clv_unknown,
diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c
index 08e8508405..cc89ba28ec 100644
--- a/epan/dissectors/packet-isis-lsp.c
+++ b/epan/dissectors/packet-isis-lsp.c
@@ -378,6 +378,8 @@ static int hf_isis_lsp_clv_sr_cap_sid = -1;
static int hf_isis_lsp_clv_sr_cap_label = -1;
static int hf_isis_lsp_clv_sr_alg = -1;
static int hf_isis_lsp_area_address = -1;
+static int hf_isis_lsp_instance_identifier = -1;
+static int hf_isis_lsp_supported_itid = -1;
static int hf_isis_lsp_clv_nlpid = -1;
static int hf_isis_lsp_ip_authentication = -1;
static int hf_isis_lsp_authentication = -1;
@@ -399,6 +401,7 @@ static gint ett_isis_lsp_att = -1;
static gint ett_isis_lsp_cksum = -1;
static gint ett_isis_lsp_clv_area_addr = -1;
static gint ett_isis_lsp_clv_is_neighbors = -1;
+static gint ett_isis_lsp_clv_instance_identifier = -1;
static gint ett_isis_lsp_clv_ext_is_reachability = -1; /* CLV 22 */
static gint ett_isis_lsp_part_of_clv_ext_is_reachability = -1;
static gint ett_isis_lsp_part_of_clv_ext_is_reachability_subtlv = -1;
@@ -2359,6 +2362,29 @@ dissect_lsp_l2_is_neighbors_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *t
length, id_length, FALSE, FALSE);
}
+/*
+ * Name: dissect_lsp_instance_identifier_clv()
+ *
+ * Description:
+ * Decode for a lsp packets Instance Identifier clv.
+ * Calls into the CLV common one.
+ *
+ * Input:
+ * tvbuff_t * : tvbuffer for packet data
+ * proto_tree * : proto tree to build on (may be null)
+ * int : current offset into packet data
+ * int : length of IDs in packet.
+ * int : length of this clv
+ *
+ * Output:
+ * void, will modify proto_tree if not null.
+ */
+static void
+dissect_lsp_instance_identifier_clv(tvbuff_t *tvb, packet_info* pinfo _U_,
+ proto_tree *tree, int offset, int id_length _U_, int length)
+{
+ isis_dissect_instance_identifier_clv(tree, pinfo, tvb, &ei_isis_lsp_short_packet, hf_isis_lsp_instance_identifier, hf_isis_lsp_supported_itid, offset, length);
+}
/*
* Name: dissect_subclv_admin_group ()
@@ -3115,6 +3141,12 @@ static const isis_clv_handle_t clv_l1_lsp_opts[] = {
dissect_lsp_l1_es_neighbors_clv
},
{
+ ISIS_CLV_INSTANCE_IDENTIFIER,
+ "Instance Identifier",
+ &ett_isis_lsp_clv_instance_identifier,
+ dissect_lsp_instance_identifier_clv
+ },
+ {
ISIS_CLV_LSP_BUFFERSIZE,
"Originating neighbor buffer size",
&ett_isis_lsp_clv_originating_buff_size,
@@ -3280,6 +3312,12 @@ static const isis_clv_handle_t clv_l2_lsp_opts[] = {
dissect_lsp_prefix_neighbors_clv
},
{
+ ISIS_CLV_INSTANCE_IDENTIFIER,
+ "Instance Identifier",
+ &ett_isis_lsp_clv_instance_identifier,
+ dissect_lsp_instance_identifier_clv
+ },
+ {
ISIS_CLV_LSP_BUFFERSIZE,
"Originating neighbor buffer size",
&ett_isis_lsp_clv_originating_buff_size,
@@ -4766,6 +4804,16 @@ proto_register_isis_lsp(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
+ { &hf_isis_lsp_instance_identifier,
+ { "Instance Identifier", "isis.lsp.iid",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_isis_lsp_supported_itid,
+ { "Supported ITID", "isis.lsp.supported_itid",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }
+ },
{ &hf_isis_lsp_clv_nlpid,
{ "NLPID", "isis.lsp.clv_nlpid",
FT_BYTES, BASE_NONE, NULL, 0x0,
@@ -4844,6 +4892,7 @@ proto_register_isis_lsp(void)
&ett_isis_lsp_cksum,
&ett_isis_lsp_clv_area_addr,
&ett_isis_lsp_clv_is_neighbors,
+ &ett_isis_lsp_clv_instance_identifier,
&ett_isis_lsp_clv_ext_is_reachability, /* CLV 22 */
&ett_isis_lsp_part_of_clv_ext_is_reachability,
&ett_isis_lsp_part_of_clv_ext_is_reachability_subtlv,
diff --git a/epan/dissectors/packet-isis-snp.c b/epan/dissectors/packet-isis-snp.c
index 2bb19e0748..9587e003f2 100644
--- a/epan/dissectors/packet-isis-snp.c
+++ b/epan/dissectors/packet-isis-snp.c
@@ -56,11 +56,14 @@ static int hf_isis_csnp_clv_type = -1;
static int hf_isis_csnp_clv_length = -1;
static int hf_isis_csnp_ip_authentication = -1;
static int hf_isis_csnp_authentication = -1;
+static int hf_isis_csnp_instance_identifier = -1;
+static int hf_isis_csnp_supported_itid = -1;
static gint ett_isis_csnp = -1;
static gint ett_isis_csnp_clv_lsp_entries = -1;
static gint ett_isis_csnp_lsp_entry = -1;
static gint ett_isis_csnp_clv_authentication = -1;
static gint ett_isis_csnp_clv_ip_authentication = -1;
+static gint ett_isis_csnp_clv_instance_identifier = -1;
static gint ett_isis_csnp_clv_checksum = -1;
static gint ett_isis_csnp_clv_unknown = -1;
@@ -200,8 +203,38 @@ dissect_snp_lsp_entries_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree,
}
+/*
+ * Name: dissect_snp_instance_identifier_clv()
+ *
+ * Description:
+ * Decode for a snp packets Instance Identifier clv.
+ * Calls into the CLV common one.
+ *
+ * Input:
+ * tvbuff_t * : tvbuffer for packet data
+ * proto_tree * : proto tree to build on (may be null)
+ * int : current offset into packet data
+ * int : length of IDs in packet.
+ * int : length of this clv
+ *
+ * Output:
+ * void, will modify proto_tree if not null.
+ */
+static void
+dissect_snp_instance_identifier_clv(tvbuff_t *tvb, packet_info* pinfo _U_,
+ proto_tree *tree, int offset, int id_length _U_, int length)
+{
+ isis_dissect_instance_identifier_clv(tree, pinfo, tvb, &ei_isis_csnp_short_packet, hf_isis_csnp_instance_identifier, hf_isis_csnp_supported_itid, offset, length);
+}
+
static const isis_clv_handle_t clv_l1_csnp_opts[] = {
{
+ ISIS_CLV_INSTANCE_IDENTIFIER,
+ "Instance Identifier",
+ &ett_isis_csnp_clv_instance_identifier,
+ dissect_snp_instance_identifier_clv
+ },
+ {
ISIS_CLV_LSP_ENTRIES,
"LSP entries",
&ett_isis_csnp_clv_lsp_entries,
@@ -232,6 +265,12 @@ static const isis_clv_handle_t clv_l1_csnp_opts[] = {
static const isis_clv_handle_t clv_l2_csnp_opts[] = {
{
+ ISIS_CLV_INSTANCE_IDENTIFIER,
+ "Instance Identifier",
+ &ett_isis_csnp_clv_instance_identifier,
+ dissect_snp_instance_identifier_clv
+ },
+ {
ISIS_CLV_LSP_ENTRIES,
"LSP entries",
&ett_isis_csnp_clv_lsp_entries,
@@ -262,6 +301,12 @@ static const isis_clv_handle_t clv_l2_csnp_opts[] = {
static const isis_clv_handle_t clv_l1_psnp_opts[] = {
{
+ ISIS_CLV_INSTANCE_IDENTIFIER,
+ "Instance Identifier",
+ &ett_isis_csnp_clv_instance_identifier,
+ dissect_snp_instance_identifier_clv
+ },
+ {
ISIS_CLV_LSP_ENTRIES,
"LSP entries",
&ett_isis_psnp_clv_lsp_entries,
@@ -292,6 +337,12 @@ static const isis_clv_handle_t clv_l1_psnp_opts[] = {
static const isis_clv_handle_t clv_l2_psnp_opts[] = {
{
+ ISIS_CLV_INSTANCE_IDENTIFIER,
+ "Instance Identifier",
+ &ett_isis_csnp_clv_instance_identifier,
+ dissect_snp_instance_identifier_clv
+ },
+ {
ISIS_CLV_LSP_ENTRIES,
"LSP entries",
&ett_isis_psnp_clv_lsp_entries,
@@ -479,6 +530,12 @@ proto_register_isis_csnp(void)
{ &hf_isis_csnp_authentication,
{ "Authentication", "isis.csnp.authentication", FT_BYTES,
BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_isis_csnp_instance_identifier,
+ { "Instance Identifier", "isis.csnp.iid", FT_UINT16,
+ BASE_DEC, NULL, 0x0, NULL, HFILL } },
+ { &hf_isis_csnp_supported_itid,
+ { "Supported ITID", "isis.csnp.supported_itid", FT_UINT16,
+ BASE_DEC, NULL, 0x0, NULL, HFILL }},
};
static gint *ett[] = {
@@ -487,6 +544,7 @@ proto_register_isis_csnp(void)
&ett_isis_csnp_lsp_entry,
&ett_isis_csnp_clv_authentication,
&ett_isis_csnp_clv_ip_authentication,
+ &ett_isis_csnp_clv_instance_identifier,
&ett_isis_csnp_clv_checksum,
&ett_isis_csnp_clv_unknown,
};