diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-08-06 22:22:17 +0200 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-08-08 13:19:23 +0000 |
commit | 143cdf12d39246003fb272a4001c2698b1f5362d (patch) | |
tree | 78cf9998f47b800211eb37dc63f6b497303481ab /epan | |
parent | 6fd6955a2412b5c5cbcb0472d620df29bd1e49a8 (diff) |
ISIS: Add type and length to CLV
Change-Id: If6dc8e3a9328571ccdb106b0aabc617889c434c7
Reviewed-on: https://code.wireshark.org/review/3465
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-isis-clv.c | 9 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-clv.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-hello.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-lsp.c | 14 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-snp.c | 20 |
5 files changed, 49 insertions, 8 deletions
diff --git a/epan/dissectors/packet-isis-clv.c b/epan/dissectors/packet-isis-clv.c index c26550ef17..27875d9574 100644 --- a/epan/dissectors/packet-isis-clv.c +++ b/epan/dissectors/packet-isis-clv.c @@ -512,7 +512,7 @@ isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length) void isis_dissect_clvs(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, const isis_clv_handle_t *opts, expert_field* expert_short_len, int len, int id_length, - int unknown_tree_id _U_) + int unknown_tree_id _U_, int tree_type, int tree_length) { guint8 code; guint8 length; @@ -545,8 +545,11 @@ isis_dissect_clvs(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offse if ( opts[q].dissect ) { /* adjust by 2 for code/len octets */ clv_tree = proto_tree_add_subtree_format(tree, tvb, offset - 2, - length + 2, *opts[q].tree_id, NULL, "%s (%u)", - opts[q].tree_text, length ); + length + 2, *opts[q].tree_id, NULL, "%s (t=%u, l=%u)", + opts[q].tree_text, opts[q].optcode, length); + + proto_tree_add_item(clv_tree, tree_type, tvb, offset - 2, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(clv_tree, tree_length, tvb, offset - 1, 1, ENC_BIG_ENDIAN); opts[q].dissect(tvb, pinfo, clv_tree, offset, id_length, length); } else { diff --git a/epan/dissectors/packet-isis-clv.h b/epan/dissectors/packet-isis-clv.h index 2c66f95dd1..a0abf86539 100644 --- a/epan/dissectors/packet-isis-clv.h +++ b/epan/dissectors/packet-isis-clv.h @@ -94,7 +94,7 @@ typedef struct { */ extern void isis_dissect_clvs(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, const isis_clv_handle_t *opts, expert_field* expert_short_len, int len, int id_length, - int unknown_tree_id); + int unknown_tree_id, int tree_type, int tree_length); extern void isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length); diff --git a/epan/dissectors/packet-isis-hello.c b/epan/dissectors/packet-isis-hello.c index 45dc0c7608..e5d0c55c41 100644 --- a/epan/dissectors/packet-isis-hello.c +++ b/epan/dissectors/packet-isis-hello.c @@ -82,6 +82,8 @@ static int hf_isis_hello_pdu_length = -1; static int hf_isis_hello_priority = -1; static int hf_isis_hello_priority_reserved = -1; static int hf_isis_hello_lan_id = -1; +static int hf_isis_hello_clv_type = -1; +static int hf_isis_hello_clv_length = -1; static int hf_isis_hello_local_circuit_id = -1; static int hf_isis_hello_clv_ipv4_int_addr = -1; static int hf_isis_hello_clv_ipv6_int_addr = -1; @@ -998,7 +1000,7 @@ dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offs */ isis_dissect_clvs(tvb, pinfo, hello_tree, offset, opts, &ei_isis_hello_short_packet, pdu_length, id_length, - ett_isis_hello_clv_unknown); + ett_isis_hello_clv_unknown, hf_isis_hello_clv_type, hf_isis_hello_clv_length); } @@ -1077,6 +1079,14 @@ proto_register_isis_hello(void) { "SystemID {Designated IS}", "isis.hello.lan_id", FT_SYSTEM_ID, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_hello_clv_type, + { "Type", "isis.hello.clv.type", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + + { &hf_isis_hello_clv_length, + { "Type", "isis.hello.clv.length", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_hello_local_circuit_id, { "Local circuit ID", "isis.hello.local_circuit_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c index b90f8d818e..af3426e478 100644 --- a/epan/dissectors/packet-isis-lsp.c +++ b/epan/dissectors/packet-isis-lsp.c @@ -126,6 +126,8 @@ static int hf_isis_lsp_p = -1; static int hf_isis_lsp_att = -1; static int hf_isis_lsp_hippity = -1; static int hf_isis_lsp_is_type = -1; +static int hf_isis_lsp_clv_type = -1; +static int hf_isis_lsp_clv_length = -1; static int hf_isis_lsp_root_id = -1; static int hf_isis_lsp_spb_link_metric = -1; static int hf_isis_lsp_spb_port_count = -1; @@ -2663,7 +2665,7 @@ dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset * our list of valid ones! */ isis_dissect_clvs(tvb, pinfo, lsp_tree, offset, - opts, &ei_isis_lsp_short_packet, len, id_length, ett_isis_lsp_clv_unknown ); + opts, &ei_isis_lsp_short_packet, len, id_length, ett_isis_lsp_clv_unknown, hf_isis_lsp_clv_type, hf_isis_lsp_clv_length ); } static int @@ -2760,6 +2762,16 @@ proto_register_isis_lsp(void) VALS(isis_lsp_istype_vals), ISIS_LSP_IS_TYPE_MASK, NULL, HFILL }}, + { &hf_isis_lsp_clv_type, + { "Type", "isis.lsp.clv.type", FT_UINT8, BASE_DEC, + NULL, 0x0, + NULL, HFILL }}, + + { &hf_isis_lsp_clv_length, + { "Length", "isis.lsp.clv.length", FT_UINT8, BASE_DEC, + NULL, 0x0, + NULL, HFILL }}, + { &hf_isis_lsp_spb_link_metric, { "SPB Link Metric", "isis.lsp.spb.link_metric", FT_UINT24, BASE_HEX_DEC, NULL, 0, NULL, HFILL }}, diff --git a/epan/dissectors/packet-isis-snp.c b/epan/dissectors/packet-isis-snp.c index 40f9b094c5..f68866caa5 100644 --- a/epan/dissectors/packet-isis-snp.c +++ b/epan/dissectors/packet-isis-snp.c @@ -53,6 +53,8 @@ static int hf_isis_csnp_lsp_seq_num = -1; static int hf_isis_csnp_lsp_remain_life = -1; static int hf_isis_csnp_lsp_checksum = -1; static int hf_isis_csnp_checksum = -1; +static int hf_isis_csnp_clv_type = -1; +static int hf_isis_csnp_clv_length = -1; static gint ett_isis_csnp = -1; static gint ett_isis_csnp_clv_lsp_entries = -1; static gint ett_isis_csnp_lsp_entry = -1; @@ -68,6 +70,8 @@ static expert_field ei_isis_csnp_authentication = EI_INIT; /* psnp packets */ static int hf_isis_psnp_pdu_length = -1; static int hf_isis_psnp_source_id = -1; +static int hf_isis_psnp_clv_type = -1; +static int hf_isis_psnp_clv_length = -1; static gint ett_isis_psnp = -1; static gint ett_isis_psnp_clv_lsp_entries = -1; static gint ett_isis_psnp_lsp_entry = -1; @@ -342,7 +346,7 @@ dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offse } isis_dissect_clvs(tvb, pinfo, csnp_tree, offset, - opts, &ei_isis_csnp_short_packet, len, id_length, ett_isis_csnp_clv_unknown ); + opts, &ei_isis_csnp_short_packet, len, id_length, ett_isis_csnp_clv_unknown, hf_isis_csnp_clv_type, hf_isis_csnp_clv_length ); } @@ -396,7 +400,7 @@ dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offse } /* Call into payload dissector */ isis_dissect_clvs(tvb, pinfo, psnp_tree, offset, - opts, &ei_isis_psnp_short_packet, len, id_length, ett_isis_psnp_clv_unknown ); + opts, &ei_isis_psnp_short_packet, len, id_length, ett_isis_psnp_clv_unknown, hf_isis_psnp_clv_type, hf_isis_psnp_clv_length); } static int @@ -448,6 +452,12 @@ proto_register_isis_csnp(void) { &hf_isis_csnp_checksum, { "Checksum", "isis.csnp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_csnp_clv_type, + { "Type", "isis.csnp.clv.type", FT_UINT8, + BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_csnp_clv_length, + { "Length", "isis.csnp.clv.length", FT_UINT8, + BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { @@ -493,6 +503,12 @@ proto_register_isis_psnp(void) { &hf_isis_psnp_source_id, { "Source-ID", "isis.psnp.source_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_psnp_clv_type, + { "Type", "isis.psnp.clv.type", FT_UINT8, + BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_psnp_clv_length, + { "Length", "isis.psnp.clv.length", FT_UINT8, + BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { |