diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-08-29 18:52:54 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-08-29 18:52:54 +0000 |
commit | 79195136aaa365702c69a0ca1ab0cbe553a6bf44 (patch) | |
tree | 17812cffbc32d0f4b6a1a20fc5fc47efa1628f98 | |
parent | ab3cf9bc61e0d023a3425fbb26eb7af5cd541a3c (diff) |
From Hannes Gredler: make the IS-IS dissector more verbose in the INFO
field - specifically for
IIHs the System-ID of the Hello;
LSPs the LSP-ID, Sequence #, Lifetime;
CSNPs the LAN-ID, Start LSP-ID, End LSP-ID.
and change the display of some IDs.
Clean up white space.
svn path=/trunk/; revision=6128
-rw-r--r-- | epan/osi-utils.c | 14 | ||||
-rw-r--r-- | packet-isis-hello.c | 35 | ||||
-rw-r--r-- | packet-isis-hello.h | 4 | ||||
-rw-r--r-- | packet-isis-lsp.c | 15 | ||||
-rw-r--r-- | packet-isis-lsp.h | 4 | ||||
-rw-r--r-- | packet-isis-snp.c | 30 | ||||
-rw-r--r-- | packet-isis-snp.h | 6 | ||||
-rw-r--r-- | packet-isis.c | 10 |
8 files changed, 76 insertions, 42 deletions
diff --git a/epan/osi-utils.c b/epan/osi-utils.c index b61b2dd176..73dd44f873 100644 --- a/epan/osi-utils.c +++ b/epan/osi-utils.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI network and transport protocol packet disassembly * Main entrance point and common functions * - * $Id: osi-utils.c,v 1.8 2002/08/28 20:40:44 jmayer Exp $ + * $Id: osi-utils.c,v 1.9 2002/08/29 18:52:54 guy Exp $ * Laurent Deniel <deniel@worldnet.fr> * Ralf Schneider <Ralf.Schneider@t-online.de> * @@ -77,11 +77,17 @@ gchar *print_system_id( const guint8 *buffer, int length ) { } cur = str; - if ( ( 6 == length ) || ( 7 == length ) ) { /* Special case, print as MAC */ + if ( ( 6 == length ) || /* System-ID */ + ( 7 == length ) || /* LAN-ID */ + ( 8 == length )) { /* LSP-ID */ cur += sprintf(cur, "%02x%02x.%02x%02x.%02x%02x", buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5] ); - if ( 7 == length ) { - sprintf( cur, ".%02x", buffer[6] ); + if ( ( 7 == length ) || + ( 8 == length )) { + sprintf( cur, ".%02x", buffer[6] ); + } + if ( 8 == length ) { + sprintf( cur, "-%02x", buffer[7] ); } } else { diff --git a/packet-isis-hello.c b/packet-isis-hello.c index d407a80337..17866f2439 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.32 2002/08/28 21:00:18 jmayer Exp $ + * $Id: packet-isis-hello.c,v 1.33 2002/08/29 18:52:51 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -625,7 +625,7 @@ dissect_hello_padding_clv(tvbuff_t *tvb _U_, proto_tree *tree _U_, int offset _U * void, will modify proto_tree if not NULL. */ void -isis_dissect_isis_hello(tvbuff_t *tvb, proto_tree *tree, int offset, +isis_dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hello_type, int header_length, int id_length) { proto_item *ti; @@ -656,9 +656,13 @@ isis_dissect_isis_hello(tvbuff_t *tvb, proto_tree *tree, int offset, source_id = tvb_get_ptr(tvb, offset, id_length); proto_tree_add_bytes_format(hello_tree, hf_isis_hello_source_id, tvb, offset, id_length, source_id, - "SystemID{ Sender of PDU } : %s", + "System-ID {Sender of PDU} : %s", print_system_id( source_id, id_length ) ); - } + } + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, ", System-ID: %s", + print_system_id( tvb_get_ptr(tvb, offset, id_length), id_length ) ); + } offset += id_length; if (tree) { @@ -681,22 +685,21 @@ isis_dissect_isis_hello(tvbuff_t *tvb, proto_tree *tree, int offset, } offset += 1; } else { - - if (tree) { - octet = tvb_get_guint8(tvb, offset); - proto_tree_add_uint_format(hello_tree, hf_isis_hello_priority_reserved, tvb, - offset, 1, octet, - "Priority : %d, reserved(0x%02x == 0)", - octet&ISIS_HELLO_PRIORITY_MASK, - octet&ISIS_HELLO_P_RESERVED_MASK ); - } - offset += 1; + if (tree) { + octet = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(hello_tree, hf_isis_hello_priority_reserved, tvb, + offset, 1, octet, + "Priority : %d, reserved(0x%02x == 0)", + octet&ISIS_HELLO_PRIORITY_MASK, + octet&ISIS_HELLO_P_RESERVED_MASK ); + } + offset += 1; if (tree) { lan_id = tvb_get_ptr(tvb, offset, id_length+1); proto_tree_add_bytes_format(hello_tree, hf_isis_hello_lan_id, tvb, - offset, id_length + 1, lan_id, - "SystemID{ Designated IS } : %s", + offset, id_length + 1, lan_id, + "System-ID {Designated IS} : %s", print_system_id( lan_id, id_length + 1 ) ); } offset += id_length + 1; diff --git a/packet-isis-hello.h b/packet-isis-hello.h index 725a1adbc7..b726882f8d 100644 --- a/packet-isis-hello.h +++ b/packet-isis-hello.h @@ -1,7 +1,7 @@ /* packet-isis-hello.h * Declares for hello handling inside isis. * - * $Id: packet-isis-hello.h,v 1.9 2002/08/28 21:00:18 jmayer Exp $ + * $Id: packet-isis-hello.h,v 1.10 2002/08/29 18:52:51 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -105,7 +105,7 @@ * Published API functions. NOTE, this are "local" API functions and * are only valid from with isis decodes. */ -extern void isis_dissect_isis_hello(tvbuff_t *tvb, proto_tree *tree, +extern void isis_dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hello_type, int header_length,int id_length); extern void isis_register_hello(int proto_isis); diff --git a/packet-isis-lsp.c b/packet-isis-lsp.c index 5336de2d9d..34e54cbb5c 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.34 2002/08/28 21:00:18 jmayer Exp $ + * $Id: packet-isis-lsp.c,v 1.35 2002/08/29 18:52:51 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -1524,7 +1524,7 @@ isis_lsp_decode_lsp_id(tvbuff_t *tvb, proto_tree *tree, int offset, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_isis_lsp(tvbuff_t *tvb, proto_tree *tree, int offset, +isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int lsp_type, int header_length, int id_length) { proto_item *ti; @@ -1554,7 +1554,11 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, proto_tree *tree, int offset, if (tree) { isis_lsp_decode_lsp_id(tvb, lsp_tree, offset, - "LSP ID", id_length); + "LSP-ID", id_length); + } + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, ", LSP-ID: %s", + print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) ); } offset += id_length + 2; @@ -1563,6 +1567,11 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, proto_tree *tree, int offset, offset, 4, tvb_get_ntohl(tvb, offset)); } + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, ", Sequence: 0x%08x, Lifetime: %5us", + tvb_get_ntohl(tvb, offset), + tvb_get_ntohs(tvb, offset - (id_length+2+2))); + } offset += 4; if (tree) { diff --git a/packet-isis-lsp.h b/packet-isis-lsp.h index 08d65348c8..2efe5def0c 100644 --- a/packet-isis-lsp.h +++ b/packet-isis-lsp.h @@ -1,7 +1,7 @@ /* packet-isis-lsp.h * Defines and such for LSP and their CLV decodes * - * $Id: packet-isis-lsp.h,v 1.13 2002/08/28 21:00:18 jmayer Exp $ + * $Id: packet-isis-lsp.h,v 1.14 2002/08/29 18:52:51 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -108,7 +108,7 @@ * Published API functions. NOTE, this are "local" API functions and * are only valid from with isis decodes. */ -extern void isis_dissect_isis_lsp(tvbuff_t *tvb, proto_tree *tree, +extern void isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hello_type, int header_length, int id_length); extern void isis_lsp_decode_lsp_id(tvbuff_t *tvb, proto_tree *tree, int offset, char *tstr, int id_length); diff --git a/packet-isis-snp.c b/packet-isis-snp.c index 4c77050bad..7cad07f78f 100644 --- a/packet-isis-snp.c +++ b/packet-isis-snp.c @@ -1,7 +1,7 @@ /* packet-isis-snp.c * Routines for decoding isis complete & partial SNP and their payload * - * $Id: packet-isis-snp.c,v 1.18 2002/08/28 21:00:18 jmayer Exp $ + * $Id: packet-isis-snp.c,v 1.19 2002/08/29 18:52:51 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -230,7 +230,7 @@ dissect_snp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_isis_csnp(tvbuff_t *tvb, proto_tree *tree, int offset, +isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int type, int header_length, int id_length) { proto_item *ti; @@ -253,20 +253,32 @@ isis_dissect_isis_csnp(tvbuff_t *tvb, proto_tree *tree, int offset, if (tree) { proto_tree_add_text(csnp_tree, tvb, offset, id_length + 1, - "Source id : %s", + "Source-ID: %s", print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length+1 ) ); } + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s", + print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length+1 ) ); + } offset += id_length + 1; if (tree) { isis_lsp_decode_lsp_id(tvb, csnp_tree, offset, - "Start LSP id ", id_length ); + "Start LSP-ID", id_length ); + } + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP-ID: %s", + print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) ); } offset += id_length + 2; if (tree) { isis_lsp_decode_lsp_id(tvb, csnp_tree, offset, - "End LSP id ", id_length ); + "End LSP-ID ", id_length ); + } + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP-ID: %s", + print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) ); } offset += id_length + 2; @@ -305,7 +317,7 @@ isis_dissect_isis_csnp(tvbuff_t *tvb, proto_tree *tree, int offset, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_isis_psnp(tvbuff_t *tvb, proto_tree *tree, int offset, +isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int type, int header_length, int id_length) { proto_item *ti; @@ -328,9 +340,13 @@ isis_dissect_isis_psnp(tvbuff_t *tvb, proto_tree *tree, int offset, if (tree) { proto_tree_add_text(psnp_tree, tvb, offset, id_length + 1, - "Source id: %s", + "Source-ID: %s", print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length + 1 ) ); } + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s", + print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length+1 ) ); + } offset += id_length + 1; len = pdu_length - header_length; diff --git a/packet-isis-snp.h b/packet-isis-snp.h index bc3bf93501..97b433d458 100644 --- a/packet-isis-snp.h +++ b/packet-isis-snp.h @@ -1,7 +1,7 @@ /* packet-isis-snp.h * Defines and such for CSNP, PSNP, and their payloads * - * $Id: packet-isis-snp.h,v 1.6 2002/08/28 21:00:18 jmayer Exp $ + * $Id: packet-isis-snp.h,v 1.7 2002/08/29 18:52:51 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -63,10 +63,10 @@ * Published API functions. NOTE, this are "local" API functions and * are only valid from with isis decodes. */ -extern void isis_dissect_isis_csnp(tvbuff_t *tvb, proto_tree *tree, +extern void isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int type, int header_length, int id_length); extern void isis_register_csnp(int proto_isis); -extern void isis_dissect_isis_psnp(tvbuff_t *tvb, proto_tree *tree, +extern void isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int type, int header_length, int id_length); extern void isis_register_psnp(int proto_isis); diff --git a/packet-isis.c b/packet-isis.c index 19c3aed766..d56e4b8753 100644 --- a/packet-isis.c +++ b/packet-isis.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI network and transport protocol packet disassembly, core * bits. * - * $Id: packet-isis.c,v 1.33 2002/08/28 21:00:18 jmayer Exp $ + * $Id: packet-isis.c,v 1.34 2002/08/29 18:52:51 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -221,22 +221,22 @@ dissect_isis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ISIS_TYPE_L1_HELLO: case ISIS_TYPE_L2_HELLO: case ISIS_TYPE_PTP_HELLO: - isis_dissect_isis_hello(tvb, isis_tree, offset, + isis_dissect_isis_hello(tvb, pinfo, isis_tree, offset, isis_type, isis_header_length, isis_system_id_len); break; case ISIS_TYPE_L1_LSP: case ISIS_TYPE_L2_LSP: - isis_dissect_isis_lsp(tvb, isis_tree, offset, + isis_dissect_isis_lsp(tvb, pinfo, isis_tree, offset, isis_type, isis_header_length, isis_system_id_len); break; case ISIS_TYPE_L1_CSNP: case ISIS_TYPE_L2_CSNP: - isis_dissect_isis_csnp(tvb, isis_tree, offset, + isis_dissect_isis_csnp(tvb, pinfo, isis_tree, offset, isis_type, isis_header_length, isis_system_id_len); break; case ISIS_TYPE_L1_PSNP: case ISIS_TYPE_L2_PSNP: - isis_dissect_isis_psnp(tvb, isis_tree, offset, + isis_dissect_isis_psnp(tvb, pinfo, isis_tree, offset, isis_type, isis_header_length, isis_system_id_len); break; default: |