diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-04-07 23:39:00 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-04-07 23:39:00 +0000 |
commit | b212a49bd76784a805e73eee29143214971f420c (patch) | |
tree | 0ccb7de4c007f2f2b7bf3ff52505d755bbb8af0b | |
parent | 5a89b3b96570bedd8761c48b3b68e664a8643488 (diff) | |
download | wireshark-b212a49bd76784a805e73eee29143214971f420c.tar.gz wireshark-b212a49bd76784a805e73eee29143214971f420c.tar.bz2 wireshark-b212a49bd76784a805e73eee29143214971f420c.zip |
Get rid of the unused hf_ value "hf_isis_hello_clv_restart".
Use the "tree_id" argument to "isis_dissect_mt_clv()" for the 2-byte MT
IDs, and arrange that the two hf_ values passed as that argument
actually be defined for protocol fields.
Fix the loop in "isis_dissect_mt_clv()" so that it actually catches an
odd byte at the end (i.e., loop until there is data at all, not until
there is 1 or fewer bytes), and put that odd byte, if it exists, into
the tree as a 1-byte text item, not a 2-byte text item.
svn path=/trunk/; revision=5113
-rw-r--r-- | packet-isis-clv.c | 82 | ||||
-rw-r--r-- | packet-isis-hello.c | 6 | ||||
-rw-r--r-- | packet-isis-lsp.c | 6 |
3 files changed, 50 insertions, 44 deletions
diff --git a/packet-isis-clv.c b/packet-isis-clv.c index 0d3c17cb5c..1c07eee5c3 100644 --- a/packet-isis-clv.c +++ b/packet-isis-clv.c @@ -1,7 +1,7 @@ /* packet-isis-clv.c * Common CLV decode routines. * - * $Id: packet-isis-clv.c,v 1.18 2002/04/07 22:36:55 guy Exp $ + * $Id: packet-isis-clv.c,v 1.19 2002/04/07 23:39:00 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -225,51 +225,51 @@ void isis_dissect_mt_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length, int tree_id) { - guint16 mt_block; - char mt_desc[60]; - - while (length>1) { - /* length can only be a multiple of 2, otherwise there is - something broken -> so decode down until length is 1 */ - if (length!=1) - { - /* fetch two bytes */ - mt_block=tvb_get_ntohs(tvb, offset); - - /* mask out the lower 12 bits */ - switch(mt_block&0x0fff) { - case 0: - strcpy(mt_desc,"IPv4 unicast"); - break; - case 1: - strcpy(mt_desc,"In-Band Management"); - break; - case 2: - strcpy(mt_desc,"IPv6 unicast"); - break; - case 3: - strcpy(mt_desc,"Multicast"); - break; - case 4095: - strcpy(mt_desc,"Development, Experimental or Proprietary"); - break; - default: - strcpy(mt_desc,"Reserved for IETF Consensus"); - } - proto_tree_add_text ( tree, tvb, offset, 2 , - "%s Topology (0x%03x)%s%s", + guint16 mt_block; + char mt_desc[60]; + + while (length>0) { + /* length can only be a multiple of 2, otherwise there is + something broken -> so decode down until length is 1 */ + if (length!=1) { + /* fetch two bytes */ + mt_block=tvb_get_ntohs(tvb, offset); + + /* mask out the lower 12 bits */ + switch(mt_block&0x0fff) { + case 0: + strcpy(mt_desc,"IPv4 unicast"); + break; + case 1: + strcpy(mt_desc,"In-Band Management"); + break; + case 2: + strcpy(mt_desc,"IPv6 unicast"); + break; + case 3: + strcpy(mt_desc,"Multicast"); + break; + case 4095: + strcpy(mt_desc,"Development, Experimental or Proprietary"); + break; + default: + strcpy(mt_desc,"Reserved for IETF Consensus"); + break; + } + proto_tree_add_uint_format ( tree, tree_id, tvb, offset, 2, + mt_block, + "%s Topology (0x%03x)%s%s", mt_desc, mt_block&0xfff, (mt_block&0x8000) ? "" : ", no sub-TLVs present", (mt_block&0x4000) ? ", ATT bit set" : "" ); + } else { + proto_tree_add_text ( tree, tvb, offset, 1, + "malformed MT-ID"); + break; } - else { - proto_tree_add_text ( tree, tvb, offset, 2 , - "malformed MT-ID"); - break; - } - length=length-2; - offset=offset+2; + length=length-2; + offset=offset+2; } } diff --git a/packet-isis-hello.c b/packet-isis-hello.c index 1ffae4527c..aa3b7d45ce 100644 --- a/packet-isis-hello.c +++ b/packet-isis-hello.c @@ -1,7 +1,7 @@ /* packet-isis-hello.c * Routines for decoding isis hello packets and their CLVs * - * $Id: packet-isis-hello.c,v 1.28 2002/04/07 22:36:55 guy Exp $ + * $Id: packet-isis-hello.c,v 1.29 2002/04/07 23:39:00 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -53,7 +53,6 @@ static int hf_isis_hello_clv_ipv4_int_addr = -1; static int hf_isis_hello_clv_ipv6_int_addr = -1; static int hf_isis_hello_clv_ptp_adj = -1; static int hf_isis_hello_clv_mt = -1; -static int hf_isis_hello_clv_restart = -1; static gint ett_isis_hello = -1; static gint ett_isis_hello_clv_area_addr = -1; @@ -787,6 +786,9 @@ isis_register_hello(int proto_isis) { { "Point-to-point Adjacency ", "isis.hello.clv_ptp_adj", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL }}, + { &hf_isis_hello_clv_mt, + { "MT-ID ", "isis.hello.clv_mt", + FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }}, }; static gint *ett[] = { &ett_isis_hello, diff --git a/packet-isis-lsp.c b/packet-isis-lsp.c index f7c3866ebe..d5b9b72b58 100644 --- a/packet-isis-lsp.c +++ b/packet-isis-lsp.c @@ -1,7 +1,7 @@ /* packet-isis-lsp.c * Routines for decoding isis lsp packets and their CLVs * - * $Id: packet-isis-lsp.c,v 1.27 2002/04/07 22:36:55 guy Exp $ + * $Id: packet-isis-lsp.c,v 1.28 2002/04/07 23:39:00 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -1681,6 +1681,10 @@ isis_register_lsp(int proto_isis) { { &hf_isis_lsp_clv_te_router_id, { "Traffic Engineering Router ID", "isis.lsp.clv_te_router_id", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_isis_lsp_clv_mt, + { "MT-ID ", "isis.lsp.clv_mt", + FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }}, }; static gint *ett[] = { &ett_isis_lsp, |