Ethereal-dev: [Ethereal-dev] ethereal IS-IS patch
Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.
From: Hannes Gredler <hannes@xxxxxxxxxxx>
Date: Mon, 16 Apr 2001 01:01:13 +0200
guy, et al, pls find attached a patch to fix some IS-IS area decode problems (particularly with 3 octet area adresses) IPv6 support in the supported protocols TLV LSP, ESI syntax has been changed to be aligned better to the installed base of IS-IS. add support for the traffic engineering router ID TLV if some of you want to give it a try, i've added a protocol trace from our labs. things [not coverred in this patch, and hence] to do: Extended IP reachability TLV 135 Extended IS reachability TLV 22 SHA-HMAC support in authentication TLV 10 support for the two different flavors of the three-way draft TLV 240 support for PPP OSI control protocol support for all the IPv6 TLVs hope you find it useful, tx /hannes
? tcpdump.out Index: nlpid.h =================================================================== RCS file: /cvsroot/ethereal/nlpid.h,v retrieving revision 1.8 diff -u -r1.8 nlpid.h --- nlpid.h 2001/03/30 10:51:49 1.8 +++ nlpid.h 2001/04/15 22:43:47 @@ -43,6 +43,7 @@ #define NLPID_ISO9542X25_ESIS 0x8a #define NLPID_ISO10030 0x8c #define NLPID_ISO11577 0x8d /* X.273 */ +#define NLPID_IP6 0x8e #define NLPID_COMPRESSED 0xb0 /* "Data compression protocol" */ #define NLPID_IP 0xcc #define NLPID_PPP 0xcf Index: packet-isis-clv.c =================================================================== RCS file: /cvsroot/ethereal/packet-isis-clv.c,v retrieving revision 1.9 diff -u -r1.9 packet-isis-clv.c --- packet-isis-clv.c 2001/04/08 19:32:03 1.9 +++ packet-isis-clv.c 2001/04/15 22:43:50 @@ -46,6 +46,7 @@ #include "packet-osi.h" #include "packet-isis.h" #include "packet-isis-clv.h" +#include "nlpid.h" /* @@ -262,7 +263,46 @@ } } + /* + * Name: isis_dissect_te_router_id_clv() + * + * Description: + * Display the Traffic Engineering Router ID TLV #134. + * This TLV is like the IP Interface TLV, except that + * only _one_ IP address is present + * + * Input: + * u_char * : packet data + * int : offset into packet data where we are. + * guint : length of clv we are decoding + * frame_data * : frame data (complete frame) + * proto_tree * : protocol display tree to fill out. May be NULL + * gint : tree id to use for proto tree. + * + * Output: + * void, but we will add to proto tree if !NULL. + */ +void +isis_dissect_te_router_id_clv(const u_char *pd, int offset, + guint length, frame_data *fd, proto_tree *tree, gint tree_id ) { + guint32 addr; + if ( length <= 0 ) { + return; + } + + if ( length != 4 ) { + isis_dissect_unknown(offset, length, tree, fd, + "malformed Traffic Enginnering Router ID (%d vs 4)",length ); + return; + } + memcpy(&addr, &pd[offset], sizeof(addr)); + if ( tree ) { + proto_tree_add_ipv4(tree, tree_id, NullTVB, offset, 4, addr); + } +} + +/* * Name: isis_dissect_nlpid_clv() * * Description: @@ -293,16 +333,26 @@ while ( length-- > 0 ) { if (s != sbuf ) { - s += sprintf ( s, ", " ); - } - s += sprintf ( s, "0x%02x", pd[offset++] ); + s += sprintf ( s, ", " ); + } + switch (pd[offset]) { + case NLPID_IP: + s += sprintf ( s, "IP (0x%02x)", pd[offset++] ); + break; + case NLPID_IP6: + s += sprintf ( s, "IPv6 (0x%02x)", pd[offset++] ); + break; + default: + s += sprintf ( s, "0x%02x", pd[offset++] ); + } } + if ( hlen == 0 ) { sprintf ( sbuf, "--none--" ); } proto_tree_add_text ( tree, NullTVB, old_offset, hlen, - "NLPID: %s", sbuf ); + "NLPID(s): %s", sbuf ); } /* Index: packet-isis-clv.h =================================================================== RCS file: /cvsroot/ethereal/packet-isis-clv.h,v retrieving revision 1.3 diff -u -r1.3 packet-isis-clv.h --- packet-isis-clv.h 2001/04/08 19:32:03 1.3 +++ packet-isis-clv.h 2001/04/15 22:43:50 @@ -58,4 +58,6 @@ guint length, frame_data *fd, proto_tree *tree ); extern void isis_dissect_hostname_clv(const u_char *pd, int offset, guint length, frame_data *fd, proto_tree *tree ); +extern void isis_dissect_te_router_id_clv(const u_char *pd, int offset, + guint length, frame_data *fd, proto_tree *tree, gint tree_id ); #endif /* _PACKET_ISIS_CLV_H */ Index: packet-isis-hello.c =================================================================== RCS file: /cvsroot/ethereal/packet-isis-hello.c,v retrieving revision 1.12 diff -u -r1.12 packet-isis-hello.c --- packet-isis-hello.c 2001/04/08 19:32:03 1.12 +++ packet-isis-hello.c 2001/04/15 22:43:53 @@ -107,7 +107,7 @@ }, { ISIS_CLV_L1H_NLPID, - "NLPID", + "Protocols Supported", &ett_isis_hello_clv_nlpid, dissect_hello_nlpid_clv }, @@ -158,7 +158,7 @@ }, { ISIS_CLV_L2H_NLPID, - "NLPID", + "Protocols Supported", &ett_isis_hello_clv_nlpid, dissect_hello_nlpid_clv }, @@ -203,7 +203,7 @@ }, { ISIS_CLV_PTP_NLPID, - "NLPID", + "Protocols Supported", &ett_isis_hello_clv_nlpid, dissect_hello_nlpid_clv }, Index: packet-isis-lsp.c =================================================================== RCS file: /cvsroot/ethereal/packet-isis-lsp.c,v retrieving revision 1.11 diff -u -r1.11 packet-isis-lsp.c --- packet-isis-lsp.c 2001/04/08 19:32:03 1.11 +++ packet-isis-lsp.c 2001/04/15 22:43:57 @@ -56,6 +56,7 @@ static int hf_isis_lsp_sequence_number = -1; static int hf_isis_lsp_checksum = -1; static int hf_isis_lsp_clv_ipv4_int_addr = -1; +static int hf_isis_lsp_clv_te_router_id = -1; static gint ett_isis_lsp = -1; static gint ett_isis_lsp_clv_area_addr = -1; @@ -65,6 +66,7 @@ static gint ett_isis_lsp_clv_prefix_neighbors = -1; static gint ett_isis_lsp_clv_nlpid = -1; static gint ett_isis_lsp_clv_hostname = -1; +static gint ett_isis_lsp_clv_te_router_id = -1; static gint ett_isis_lsp_clv_auth = -1; static gint ett_isis_lsp_clv_ipv4_int_addr = -1; static gint ett_isis_lsp_clv_ip_reachability = -1; @@ -100,6 +102,8 @@ guint length, int id_length, frame_data *fd, proto_tree *tree); static void dissect_lsp_hostname_clv(const u_char *pd, int offset, guint length, int id_length, frame_data *fd, proto_tree *tree); +static void dissect_lsp_te_router_id_clv(const u_char *pd, int offset, + guint length, int id_length, frame_data *fd, proto_tree *tree); static void dissect_lsp_ip_int_addr_clv(const u_char *pd, int offset, guint length, int id_length, frame_data *fd, proto_tree *tree); static void dissect_lsp_l1_auth_clv(const u_char *pd, int offset, @@ -134,7 +138,7 @@ }, { ISIS_CLV_L1_LSP_NLPID, - "NLPID", + "Protocols supported", &ett_isis_lsp_clv_nlpid, dissect_lsp_nlpid_clv }, @@ -144,6 +148,12 @@ &ett_isis_lsp_clv_hostname, dissect_lsp_hostname_clv }, + { + ISIS_CLV_L1_LSP_TE_ROUTER_ID, + "Traffic Engineering Router ID", + &ett_isis_lsp_clv_te_router_id, + dissect_lsp_te_router_id_clv + }, { ISIS_CLV_L1_LSP_IP_INTERFACE_ADDR, "IP Interface address(es)", @@ -203,7 +213,7 @@ }, { ISIS_CLV_L2_LSP_NLPID, - "NLPID", + "Protocols supported", &ett_isis_lsp_clv_nlpid, dissect_lsp_nlpid_clv }, @@ -213,6 +223,12 @@ &ett_isis_lsp_clv_hostname, dissect_lsp_hostname_clv }, + { + ISIS_CLV_L2_LSP_TE_ROUTER_ID, + "Traffic Engineering Router ID", + &ett_isis_lsp_clv_te_router_id, + dissect_lsp_te_router_id_clv + }, { ISIS_CLV_L2_LSP_IP_EXT_REACHABLE, "IP external reachability", @@ -396,6 +412,36 @@ guint length, int id_length, frame_data *fd, proto_tree *tree) { isis_dissect_hostname_clv(pd, offset, length, fd, tree ); } + + +/* + * Name: dissect_lsp_te_router_id_clv() + * + * Description: + * Decode for a lsp packets Traffic Engineering ID clv. Calls into the + * clv common one. + * + * Input: + * u_char * : packet data + * int : current offset into packet data + * guint : length of this clv + * int : length of IDs in packet. + * frame_data * : frame data + * proto_tree * : proto tree to build on (may be null) + * + * Output: + * void, will modify proto_tree if not null. + */ +static void +dissect_lsp_te_router_id_clv(const u_char *pd, int offset, + guint length, int id_length, frame_data *fd, proto_tree *tree) { + isis_dissect_te_router_id_clv(pd, offset, length, fd, tree, + hf_isis_lsp_clv_te_router_id ); +} + + + + /* * Name: dissect_lsp_ip_int_addr_clv() * @@ -576,9 +622,12 @@ "Expense",FALSE ); dissect_metric ( ntree, offset + 3, pd[offset+3], "Error", FALSE ); - proto_tree_add_text ( ntree, NullTVB, offset + 4, id_length, + +/* this is redundant information + Proto_tree_add_text ( ntree, NullTVB, offset + 4, id_length, "Neighbour ID: %s", print_system_id( pd + offset + 4, id_length ) ); +*/ } offset += tlen; length -= tlen; @@ -974,6 +1023,10 @@ { &hf_isis_lsp_clv_ipv4_int_addr, { "IPv4 interface address: ", "isis_lsp.clv_ipv4_int_addr", FT_IPv4, BASE_NONE, NULL, 0x0, "" }}, + + { &hf_isis_lsp_clv_te_router_id, + { "Traffic Engineering Router ID: ", "isis_lsp.clv_te_router_id", FT_IPv4, + BASE_NONE, NULL, 0x0, "" }}, }; static gint *ett[] = { &ett_isis_lsp, @@ -986,6 +1039,7 @@ &ett_isis_lsp_clv_nlpid, &ett_isis_lsp_clv_hostname, &ett_isis_lsp_clv_ipv4_int_addr, + &ett_isis_lsp_clv_te_router_id, &ett_isis_lsp_clv_ip_reachability, }; Index: packet-isis-lsp.h =================================================================== RCS file: /cvsroot/ethereal/packet-isis-lsp.h,v retrieving revision 1.3 diff -u -r1.3 packet-isis-lsp.h --- packet-isis-lsp.h 2001/04/08 19:32:03 1.3 +++ packet-isis-lsp.h 2001/04/15 22:43:58 @@ -62,6 +62,7 @@ #define ISIS_CLV_L1_LSP_IP_INT_REACHABLE 128 #define ISIS_CLV_L1_LSP_NLPID 129 #define ISIS_CLV_L1_LSP_IP_INTERFACE_ADDR 132 +#define ISIS_CLV_L1_LSP_TE_ROUTER_ID 134 #define ISIS_CLV_L1_LSP_HOSTNAME 137 /* * Note, the spec say 133, but everyone seems to use 10. Any clue on why @@ -82,6 +83,7 @@ #define ISIS_CLV_L2_LSP_IP_EXT_REACHABLE 130 #define ISIS_CLV_L2_LSP_IDRP_INFO 131 #define ISIS_CLV_L2_LSP_IP_INTERFACE_ADDR 132 +#define ISIS_CLV_L2_LSP_TE_ROUTER_ID 134 #define ISIS_CLV_L2_LSP_HOSTNAME 137 /* * Note, the spec say 133, but everyone seems to use 10. Any clue on why Index: packet-ppp.c =================================================================== RCS file: /cvsroot/ethereal/packet-ppp.c,v retrieving revision 1.61 diff -u -r1.61 packet-ppp.c --- packet-ppp.c 2001/03/31 10:35:54 1.61 +++ packet-ppp.c 2001/04/15 22:44:05 @@ -93,6 +93,7 @@ static const value_string ppp_vals[] = { {PPP_IP, "IP" }, + {PPP_OSI, "OSI" }, {PPP_AT, "Appletalk" }, {PPP_IPX, "Netware IPX/SPX"}, {PPP_VJC_COMP, "VJ compressed TCP"}, @@ -106,6 +107,7 @@ {PPP_MPLS_UNI, "MPLS Unicast"}, {PPP_MPLS_MULTI, "MPLS Multicast"}, {PPP_IPCP, "IP Control Protocol" }, + {PPP_OSICP, "OSI Control Protocol" }, {PPP_ATCP, "AppleTalk Control Protocol" }, {PPP_IPXCP, "IPX Control Protocol" }, {PPP_CCP, "Compression Control Protocol" }, Index: ppptypes.h =================================================================== RCS file: /cvsroot/ethereal/ppptypes.h,v retrieving revision 1.7 diff -u -r1.7 ppptypes.h --- ppptypes.h 2001/04/08 19:32:03 1.7 +++ ppptypes.h 2001/04/15 22:44:07 @@ -1,7 +1,7 @@ /* ppptypes.h * Defines PPP packet types. * - * $Id: ppptypes.h,v 1.7 2001/04/08 19:32:03 guy Exp $ + * $Id: ppptypes.h,v 1.5 2001/01/14 08:25:14 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@xxxxxxxx> @@ -32,7 +32,7 @@ */ #define PPP_IP 0x21 /* Internet Protocol */ -#define PPP_OSI 0x23 +#define PPP_OSI 0x23 /* OSI Protocol */ #define PPP_AT 0x29 /* AppleTalk Protocol */ #define PPP_IPX 0x2b /* IPX protocol */ #define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ @@ -46,6 +46,7 @@ #define PPP_MPLS_UNI 0x0281 /* MPLS Unicast */ #define PPP_MPLS_MULTI 0x0283 /* MPLS Multicast */ #define PPP_IPCP 0x8021 /* IP Control Protocol */ +#define PPP_OSICP 0x8023 /* OSI Control Protocol */ #define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ #define PPP_IPXCP 0x802b /* IPX Control Protocol */ #define PPP_CCP 0x80fd /* Compression Control Protocol */ @@ -54,5 +55,44 @@ #define PPP_LQR 0xc025 /* Link Quality Report protocol */ #define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ #define PPP_CBCP 0xc029 /* Callback Control Protocol */ + +/* + * Address and control field for Cisco HDLC. + * RFC 1547, "Requirements for an Internet Standard Point-to-Point Protocol", + * section 4.3.1 "Cisco Systems point-to-point protocols", says + * + * The Cisco Systems gateway supports both asynchronous links using SLIP + * and synchronous links using either simple HDLC framing, X.25 LAPB or + * full X.25. The HDLC framing procedure includes a four byte header. + * The first octet (address) is either 0x0F (unicast intent) or 0x8F + * (multicast intent). The second octet (control byte) is left zero and + * is not checked on reception. The third and fourth octets contain a + * standard 16 bit Ethernet protocol type code. + * + */ +#define CISCO_HDLC_ADDR_UNICAST 0x0F00 +#define CISCO_HDLC_ADDR_MULTICAST 0x8F00 + +/* + * Protocol types for the Cisco HDLC format. + * + * As per the above, according to RFC 1547, these are "standard 16 bit + * Ethernet protocol type code[s]", but 0x8035 is Reverse ARP, and + * that is (at least according to the Linux ISDN code) not the + * same as Cisco SLARP. + * + * In addition, 0x2000 is apparently the Cisco Discovery Protocol, but + * on Ethernet those are encapsulated inside SNAP with an OUI of + * OUI_CISCO, not OUI_ENCAP_ETHER. + * + * Perhaps we should set up a protocol table for those protocols + * that differ between Ethernet and Cisco HDLC, and have the PPP + * code first try that table and, if it finds nothing in that + * table, call "ethertype()". (Unfortunately, that means that - + * assuming we had a Cisco SLARP dissector - said dissector were + * disabled, SLARP packets would be dissected as Reverse ARP + * packets, not as data. + */ +#define CISCO_SLARP 0x8035 /* Cisco SLARP protocol */ #endif /* ppptypes.h */ Index: epan/osi-utils.c =================================================================== RCS file: /cvsroot/ethereal/epan/osi-utils.c,v retrieving revision 1.2 diff -u -r1.2 osi-utils.c --- osi-utils.c 2001/04/02 10:41:19 1.2 +++ osi-utils.c 2001/04/15 22:44:08 @@ -86,7 +86,7 @@ cur = str; if ( ( 6 == length ) || ( 7 == length ) ) { /* Special case, print as MAC */ - cur += sprintf(str, "[%02x:%02x:%02x_%02x:%02x:%02x]", buffer[0], buffer[1], + cur += sprintf(str, "%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] ); @@ -152,6 +152,11 @@ return str; } else { /* print standard format */ + if ( length == RFC1237_AREA_LEN ) { + sprintf( str, "%02x.%02x%02x", buffer[0], buffer[1], + buffer[2] ); + return( str ); + } if ( 4 < length ) { while ( tmp < length / 4 ) { /* 16/4==4 four Octets left to print */ cur += sprintf( str, "%02x%02x%02x%02x.", buffer[tmp++], buffer[tmp++],
Attachment:
hannes-isis-ppp.tcpdump.1500
Description: Binary data
- Follow-Ups:
- [Ethereal-dev] Re: ethereal IS-IS patch
- From: Guy Harris
- [Ethereal-dev] Re: ethereal IS-IS patch
- Prev by Date: Re: [Ethereal-dev] old_dissectors
- Next by Date: [Ethereal-dev] IP defragment
- Previous by thread: [Ethereal-dev] new dissector to submit
- Next by thread: [Ethereal-dev] Re: ethereal IS-IS patch
- Index(es):