Ethereal-dev: [Ethereal-dev] IS-IS cleanup, new Checksum CLV dissector
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, 8 Dec 2003 11:40:09 +0100
hi .*, pls find attached a patch that cleans up the IS-IS dissector and adds a new CLV dissector; (i have added also a few packet captures that contains examples for the Checksum CLV) for the commit log: ------------------------------ - unify the IS-IS CLV space IS-IS uses a unified CLV space across all Level and PDU Types there is no need to define PDU- and Level- Specific CLV Types - clean up Authentication CLV TLV #10 is the official supported TLV for carrying authentication information- todays code displays TLV #10 as non-standard which is wrong; also the notion of "Domain" "Authentication" and "Link" password has disappeared from contemporary routing SW; - add IP Authentication CLV dissector this CLV is depreciated - however it is using different semantics than TLV #10 so we need a dedicated dissector - add Checksum CLV dissector add support for RFC 3358 Checksum CLVs majority of code re-used from the LSP checksum verification dissector; -------------------------------- -- /hannes
Index: packet-isis-clv.c =================================================================== RCS file: /cvsroot/ethereal/packet-isis-clv.c,v retrieving revision 1.28 diff -u -r1.28 packet-isis-clv.c --- packet-isis-clv.c 4 Jun 2003 08:46:35 -0000 1.28 +++ packet-isis-clv.c 8 Dec 2003 10:19:05 -0000 @@ -128,26 +128,23 @@ * * Description: * Take apart the CLV that hold authentication information. This - * is currently 1 octet auth type (which must be 1) and then - * the clear text password. - * - * An ISIS password has different meaning depending where it - * is found. Thus we support a passed in prefix string to - * use to name this. + * is currently 1 octet auth type. + * the two defined authentication types + * are 1 for a clear text password and + * 54 for a HMAC-MD5 digest * * 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 - * char * : Password meaning * * Output: * void, but we will add to proto tree if !NULL. */ void isis_dissect_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, - int length, char *meaning) + int length) { guchar pw_type; int auth_unsupported; @@ -204,8 +201,7 @@ break; } - proto_tree_add_text ( tree, tvb, offset - 1, length + 1, - "%s %s", meaning, gstr->str ); + proto_tree_add_text ( tree, tvb, offset - 1, length + 1, "%s", gstr->str ); /* * We're done with the GString, so delete it and get rid of @@ -218,6 +214,38 @@ "Unknown authentication type" ); } } + +/* + * Name: isis_ip_authentication_clv() + * + * Description: + * dump the IP authentication information found in TLV 133 + * the CLV is standardized in rf1195, however all major + * implementations use TLV #10 + * 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_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, + int length) +{ + if ( !tree ) return; /* nothing to do! */ + + if ( length != 0 ) { + proto_tree_add_text ( tree, tvb, offset, length, + "IP Authentication: %.*s", length, + tvb_get_ptr(tvb, offset, length) ); + } +} + /* * Name: isis_dissect_hostname_clv() Index: packet-isis-clv.h =================================================================== RCS file: /cvsroot/ethereal/packet-isis-clv.h,v retrieving revision 1.9 diff -u -r1.9 packet-isis-clv.h --- packet-isis-clv.h 28 Aug 2002 21:00:18 -0000 1.9 +++ packet-isis-clv.h 8 Dec 2003 10:19:05 -0000 @@ -27,14 +27,58 @@ #define _PACKET_ISIS_CLV_H /* + * A CLV is a tuple of a type, length and a value and is normally used for + * encoding information in all sorts of places. + * IS-IS uses a uniform CLV code space that is shared across + * all PDU Types. + * + * list taken from rfc3359 plus some memory from veterans ;-) + */ + +#define ISIS_CLV_AREA_ADDRESS 1 /* iso10589 */ +#define ISIS_CLV_IS_REACH 2 /* iso10589 */ +#define ISIS_CLV_ES_NEIGHBORS 3 /* iso10589 */ +#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_PADDING 8 /* iso10589 */ +#define ISIS_CLV_LSP_ENTRIES 9 /* iso10589 */ +#define ISIS_CLV_AUTHENTICATION 10 /* iso10589, rfc3567 */ +#define ISIS_CLV_CHECKSUM 12 /* rfc3358 */ +#define ISIS_CLV_LSP_BUFFERSIZE 14 /* iso10589 rev2 */ +#define ISIS_CLV_EXTD_IS_REACH 22 /* draft-ietf-isis-traffic-05 */ +#define ISIS_CLV_IS_ALIAS_ID 24 /* draft-ietf-isis-ext-lsp-frags-02 */ +#define ISIS_CLV_INT_IP_REACH 128 /* rfc1195, rfc2966 */ +#define ISIS_CLV_PROTOCOLS_SUPPORTED 129 /* rfc1195 */ +#define ISIS_CLV_EXT_IP_REACH 130 /* rfc1195, rfc2966 */ +#define ISIS_CLV_IDRP_INFO 131 /* rfc1195 */ +#define ISIS_CLV_IP_ADDR 132 /* rfc1195 */ +#define ISIS_CLV_IP_AUTHENTICATION 133 /* rfc1195, depreciated */ +#define ISIS_CLV_TE_ROUTER_ID 134 /* draft-ietf-isis-traffic-05 */ +#define ISIS_CLV_EXTD_IP_REACH 135 /* draft-ietf-isis-traffic-05 */ +#define ISIS_CLV_HOSTNAME 137 /* rfc2763 */ +#define ISIS_CLV_SHARED_RISK_GROUP 138 /* draft-ietf-isis-gmpls-extensions */ +#define ISIS_CLV_RESTART 211 /* draft-ietf-isis-restart-01 */ +#define ISIS_CLV_MT_IS_REACH 222 /* draft-ietf-isis-wg-multi-topology-05 */ +#define ISIS_CLV_MT_SUPPORTED 229 /* draft-ietf-isis-wg-multi-topology-05 */ +#define ISIS_CLV_IP6_ADDR 232 /* draft-ietf-isis-ipv6-02 */ +#define ISIS_CLV_MT_IP_REACH 235 /* draft-ietf-isis-wg-multi-topology-05 */ +#define ISIS_CLV_IP6_REACH 236 /* draft-ietf-isis-ipv6-02 */ +#define ISIS_CLV_MT_IP6_REACH 237 /* draft-ietf-isis-wg-multi-topology-05 */ +#define ISIS_CLV_PTP_ADJ_STATE 240 /* rfc3373 */ +#define ISIS_CLV_IIH_SEQNR 241 /* draft-shen-isis-iih-sequence-00 */ +#define ISIS_CLV_VENDOR_PRIVATE 250 /* draft-ietf-isis-proprietary-tlv-00 */ + +/* * Our sub-packet dismantle structure for CLV's */ typedef struct { - int optcode; /* code for option */ - char *tree_text; /* text for fold out */ - gint *tree_id; /* id for add_item */ - void (*dissect)(tvbuff_t *tvb, proto_tree *tree, - int offset, int id_length, int length); + int optcode; /* code for option */ + char *tree_text; /* text for fold out */ + gint *tree_id; /* id for add_item */ + void (*dissect)(tvbuff_t *tvb, proto_tree *tree, + int offset, int id_length, int length); } isis_clv_handle_t; /* @@ -42,27 +86,29 @@ * are only valid from with isis decodes. */ extern void isis_dissect_clvs(tvbuff_t *tvb, proto_tree *tree, int offset, - const isis_clv_handle_t *opts, int len, int id_length, - int unknown_tree_id); + const isis_clv_handle_t *opts, int len, int id_length, + int unknown_tree_id); extern void isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length); + int offset, int length); extern void isis_dissect_te_router_id_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length, int tree_id); + int offset, int length, int tree_id); extern void isis_dissect_ipv6_int_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length, int tree_id); + int offset, int length, int tree_id); extern void isis_dissect_ip_int_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length, int tree_id); + int offset, int length, int tree_id); extern void isis_dissect_mt_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length, int tree_id); + int offset, int length, int tree_id); extern void isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length); + int offset, int length); extern void isis_dissect_authentication_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length, char *meaning); + int offset, int length); +extern void isis_dissect_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, + int offset, int length); extern void isis_dissect_area_address_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length); + int offset, int length); extern void isis_dissect_metric(tvbuff_t *tvb, proto_tree *tree, int offset, - guint8 value, char *pstr, int force_supported); + guint8 value, char *pstr, int force_supported); #endif /* _PACKET_ISIS_CLV_H */ Index: packet-isis-hello.c =================================================================== RCS file: /cvsroot/ethereal/packet-isis-hello.c,v retrieving revision 1.33 diff -u -r1.33 packet-isis-hello.c --- packet-isis-hello.c 29 Aug 2002 18:52:51 -0000 1.33 +++ packet-isis-hello.c 8 Dec 2003 10:19:07 -0000 @@ -38,30 +38,32 @@ #include "epan/resolv.h" /* hello packets */ -static int hf_isis_hello_circuit_reserved = -1; -static int hf_isis_hello_source_id = -1; -static int hf_isis_hello_holding_timer = -1; -static int hf_isis_hello_pdu_length = -1; -static int hf_isis_hello_priority_reserved = -1; -static int hf_isis_hello_lan_id = -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; -static int hf_isis_hello_clv_ptp_adj = -1; -static int hf_isis_hello_clv_mt = -1; - -static gint ett_isis_hello = -1; -static gint ett_isis_hello_clv_area_addr = -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; -static gint ett_isis_hello_clv_nlpid = -1; -static gint ett_isis_hello_clv_auth = -1; +static int hf_isis_hello_circuit_reserved = -1; +static int hf_isis_hello_source_id = -1; +static int hf_isis_hello_holding_timer = -1; +static int hf_isis_hello_pdu_length = -1; +static int hf_isis_hello_priority_reserved = -1; +static int hf_isis_hello_lan_id = -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; +static int hf_isis_hello_clv_ptp_adj = -1; +static int hf_isis_hello_clv_mt = -1; + +static gint ett_isis_hello = -1; +static gint ett_isis_hello_clv_area_addr = -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; +static gint ett_isis_hello_clv_nlpid = -1; +static gint ett_isis_hello_clv_authentication = -1; +static gint ett_isis_hello_clv_ip_authentication = -1; static gint ett_isis_hello_clv_ipv4_int_addr = -1; static gint ett_isis_hello_clv_ipv6_int_addr = -1; -static gint ett_isis_hello_clv_ptp_adj = -1; -static gint ett_isis_hello_clv_mt = -1; -static gint ett_isis_hello_clv_restart = -1; +static gint ett_isis_hello_clv_ptp_adj = -1; +static gint ett_isis_hello_clv_mt = -1; +static gint ett_isis_hello_clv_restart = -1; +static gint ett_isis_hello_clv_checksum = -1; static const value_string isis_hello_circuit_type_vals[] = { { ISIS_HELLO_TYPE_RESERVED, "Reserved 0 (discard PDU)"}, @@ -81,7 +83,11 @@ proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_area_address_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); -static void dissect_hello_auth_clv(tvbuff_t *tvb, +static void dissect_hello_authentication_clv(tvbuff_t *tvb, + proto_tree *tree, int offset, int id_length, int length); +static void dissect_hello_ip_authentication_clv(tvbuff_t *tvb, + proto_tree *tree, int offset, int id_length, int length); +static void dissect_hello_checksum_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_ipv6_int_addr_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); @@ -97,66 +103,72 @@ static const isis_clv_handle_t clv_l1_hello_opts[] = { { - ISIS_CLV_L1H_AREA_ADDRESS, + ISIS_CLV_AREA_ADDRESS, "Area address(es)", &ett_isis_hello_clv_area_addr, dissect_hello_area_address_clv }, { - ISIS_CLV_L1H_IS_NEIGHBORS, + ISIS_CLV_IS_NEIGHBORS, "IS Neighbor(s)", &ett_isis_hello_clv_is_neighbors, dissect_hello_is_neighbors_clv }, { - ISIS_CLV_L1H_PADDING, + ISIS_CLV_PADDING, "Padding", &ett_isis_hello_clv_padding, dissect_hello_padding_clv }, { - ISIS_CLV_L1H_NLPID, + ISIS_CLV_PROTOCOLS_SUPPORTED, "Protocols Supported", &ett_isis_hello_clv_nlpid, dissect_hello_nlpid_clv }, { - ISIS_CLV_L1H_IP_INTERFACE_ADDR, + ISIS_CLV_IP_ADDR, "IP Interface address(es)", &ett_isis_hello_clv_ipv4_int_addr, dissect_hello_ip_int_addr_clv }, { - ISIS_CLV_L1H_IPv6_INTERFACE_ADDR, + ISIS_CLV_IP6_ADDR, "IPv6 Interface address(es)", &ett_isis_hello_clv_ipv6_int_addr, dissect_hello_ipv6_int_addr_clv }, { - ISIS_CLV_L1H_RESTART, + ISIS_CLV_RESTART, "Restart Signaling", &ett_isis_hello_clv_restart, dissect_hello_restart_clv }, { - ISIS_CLV_L1H_AUTHENTICATION_NS, - "Authentication(non spec)", - &ett_isis_hello_clv_auth, - dissect_hello_auth_clv + ISIS_CLV_AUTHENTICATION, + "Authentication", + &ett_isis_hello_clv_authentication, + dissect_hello_authentication_clv }, { - ISIS_CLV_L1H_AUTHENTICATION, - "Authentication", - &ett_isis_hello_clv_auth, - dissect_hello_auth_clv + ISIS_CLV_IP_AUTHENTICATION, + "IP Authentication", + &ett_isis_hello_clv_ip_authentication, + dissect_hello_ip_authentication_clv }, { - ISIS_CLV_L1H_MT, + ISIS_CLV_MT_SUPPORTED, "Multi Topology", &ett_isis_hello_clv_mt, dissect_hello_mt_clv }, { + ISIS_CLV_CHECKSUM, + "Checksum", + &ett_isis_hello_clv_checksum, + dissect_hello_checksum_clv + }, + { 0, "", NULL, @@ -166,66 +178,72 @@ static const isis_clv_handle_t clv_l2_hello_opts[] = { { - ISIS_CLV_L2H_AREA_ADDRESS, + ISIS_CLV_AREA_ADDRESS, "Area address(es)", &ett_isis_hello_clv_area_addr, dissect_hello_area_address_clv }, { - ISIS_CLV_L2H_IS_NEIGHBORS, + ISIS_CLV_IS_NEIGHBORS, "IS Neighbor(s)", &ett_isis_hello_clv_is_neighbors, dissect_hello_is_neighbors_clv }, { - ISIS_CLV_L2H_PADDING, + ISIS_CLV_PADDING, "Padding", &ett_isis_hello_clv_padding, dissect_hello_padding_clv }, { - ISIS_CLV_L2H_NLPID, + ISIS_CLV_PROTOCOLS_SUPPORTED, "Protocols Supported", &ett_isis_hello_clv_nlpid, dissect_hello_nlpid_clv }, { - ISIS_CLV_L2H_IP_INTERFACE_ADDR, + ISIS_CLV_IP_ADDR, "IP Interface address(es)", &ett_isis_hello_clv_ipv4_int_addr, dissect_hello_ip_int_addr_clv }, { - ISIS_CLV_L2H_IPv6_INTERFACE_ADDR, + ISIS_CLV_IP6_ADDR, "IPv6 Interface address(es)", &ett_isis_hello_clv_ipv6_int_addr, dissect_hello_ipv6_int_addr_clv }, { - ISIS_CLV_L2H_AUTHENTICATION_NS, - "Authentication(non spec)", - &ett_isis_hello_clv_auth, - dissect_hello_auth_clv + ISIS_CLV_AUTHENTICATION, + "Authentication", + &ett_isis_hello_clv_authentication, + dissect_hello_authentication_clv }, { - ISIS_CLV_L2H_RESTART, + ISIS_CLV_IP_AUTHENTICATION, + "IP Authentication", + &ett_isis_hello_clv_ip_authentication, + dissect_hello_ip_authentication_clv + }, + { + ISIS_CLV_RESTART, "Restart Signaling", &ett_isis_hello_clv_restart, dissect_hello_restart_clv }, { - ISIS_CLV_L2H_AUTHENTICATION, - "Authentication", - &ett_isis_hello_clv_auth, - dissect_hello_auth_clv - }, - { - ISIS_CLV_L2H_MT, + ISIS_CLV_MT_SUPPORTED, "Multi Topology", &ett_isis_hello_clv_mt, dissect_hello_mt_clv }, { + ISIS_CLV_CHECKSUM, + "Checksum", + &ett_isis_hello_clv_checksum, + dissect_hello_checksum_clv + }, + { 0, "", NULL, @@ -235,66 +253,72 @@ static const isis_clv_handle_t clv_ptp_hello_opts[] = { { - ISIS_CLV_PTP_AREA_ADDRESS, + ISIS_CLV_AREA_ADDRESS, "Area address(es)", &ett_isis_hello_clv_area_addr, dissect_hello_area_address_clv }, { - ISIS_CLV_PTP_PADDING, + ISIS_CLV_PADDING, "Padding", &ett_isis_hello_clv_padding, dissect_hello_padding_clv }, { - ISIS_CLV_PTP_NLPID, + ISIS_CLV_PROTOCOLS_SUPPORTED, "Protocols Supported", &ett_isis_hello_clv_nlpid, dissect_hello_nlpid_clv }, { - ISIS_CLV_PTP_IP_INTERFACE_ADDR, + ISIS_CLV_IP_ADDR, "IP Interface address(es)", &ett_isis_hello_clv_ipv4_int_addr, dissect_hello_ip_int_addr_clv }, { - ISIS_CLV_PTP_IPv6_INTERFACE_ADDR, + ISIS_CLV_IP6_ADDR, "IPv6 Interface address(es)", &ett_isis_hello_clv_ipv6_int_addr, dissect_hello_ipv6_int_addr_clv }, { - ISIS_CLV_PTP_AUTHENTICATION_NS, - "Authentication(non spec)", - &ett_isis_hello_clv_auth, - dissect_hello_auth_clv + ISIS_CLV_AUTHENTICATION, + "Authentication", + &ett_isis_hello_clv_authentication, + dissect_hello_authentication_clv }, { - ISIS_CLV_PTP_AUTHENTICATION, - "Authentication", - &ett_isis_hello_clv_auth, - dissect_hello_auth_clv + ISIS_CLV_IP_AUTHENTICATION, + "IP Authentication", + &ett_isis_hello_clv_ip_authentication, + dissect_hello_ip_authentication_clv }, { - ISIS_CLV_PTP_RESTART, + ISIS_CLV_RESTART, "Restart Option", &ett_isis_hello_clv_restart, dissect_hello_restart_clv }, { - ISIS_CLV_PTP_ADJ, + ISIS_CLV_PTP_ADJ_STATE, "Point-to-point Adjacency State", &ett_isis_hello_clv_ptp_adj, dissect_hello_ptp_adj_clv }, { - ISIS_CLV_PTP_MT, + ISIS_CLV_MT_SUPPORTED, "Multi Topology", &ett_isis_hello_clv_mt, dissect_hello_mt_clv }, { + ISIS_CLV_CHECKSUM, + "Checksum", + &ett_isis_hello_clv_checksum, + dissect_hello_checksum_clv + }, + { 0, "", NULL, @@ -438,12 +462,11 @@ } /* - * Name: dissect_hello_auth_clv() + * Name: dissect_hello_authentication_clv() * * Description: - * Decode for a hello packets authenticaion clv. Calls into the - * clv common one. An auth inside a hello packet is a perlink - * password. + * Decode for a hello packets authenticaion clv. + * Calls into the CLV common one. * * Input: * tvbuff_t * : tvbuffer for packet data @@ -456,19 +479,111 @@ * void, will modify proto_tree if not null. */ static void -dissect_hello_auth_clv(tvbuff_t *tvb, +dissect_hello_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_authentication_clv(tvb, tree, offset, - length, "authentication" ); + isis_dissect_authentication_clv(tvb, tree, offset, length); } /* + * Name: dissect_hello_ip_authentication_clv() + * + * Description: + * Decode for a hello packets IP authenticaion 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_ip_authentication_clv(tvbuff_t *tvb, + proto_tree *tree, int offset, int id_length _U_, int length) +{ + isis_dissect_ip_authentication_clv(tvb, tree, offset, length); +} + +/* + * Name: dissect_hello_checksum_clv() + * + * Description: + * dump and verify the optional checksum in TLV 12 + * + * 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. + */ + +static void +dissect_hello_checksum_clv(tvbuff_t *tvb, + proto_tree *tree, int offset, int id_length _U_, int length) { + + guint16 pdu_length,checksum, cacl_checksum=0; + + if (tree) { + if ( length != 2 ) { + proto_tree_add_text ( tree, tvb, offset, length, + "incorrect checksum length (%u), should be (2)", length ); + return; + } + + checksum = tvb_get_ntohs(tvb, offset); + + /* the check_and_get_checksum() function needs to know how big + * the packet is. we can either pass through the pdu-len through several layers + * of dissectors and wrappers or extract the PDU length field from the PDU specific header + * which is offseted 17 bytes in IIHs (relative to the beginning of the IS-IS packet) */ + + pdu_length = tvb_get_ntohs(tvb, 17); + + /* unlike the LSP checksum verification which starts at an offset of 12 we start at offset 0*/ + switch (check_and_get_checksum(tvb, 0, pdu_length, checksum, offset, &cacl_checksum)) + { + + case NO_CKSUM : + proto_tree_add_text ( tree, tvb, offset, length, + "Checksum: 0x%04x (unused)", checksum); + break; + case DATA_MISSING : + isis_dissect_unknown(tvb, tree, offset, + "packet length %d went beyond packet", + tvb_length_remaining(tvb, 0)); + break; + case CKSUM_NOT_OK : + proto_tree_add_text ( tree, tvb, offset, length, + "Checksum: 0x%04x (incorrect, should be 0x%04x)", + checksum, + cacl_checksum); + break; + case CKSUM_OK : + proto_tree_add_text ( tree, tvb, offset, length, + "Checksum: 0x%04x (correct)", checksum); + break; + default : + g_message("'check_and_get_checksum' returned an invalid value"); + } + } +} + + + +/* * Name: dissect_hello_area_address_clv() * * Description: - * Decode for a hello packets area address clv. Calls into the - * clv common one. + * Decode for a hello packets area address clv. + * Calls into the CLV common one. * * Input: * tvbuff_t * : tvbuffer for packet data @@ -798,12 +913,14 @@ &ett_isis_hello_clv_padding, &ett_isis_hello_clv_unknown, &ett_isis_hello_clv_nlpid, - &ett_isis_hello_clv_auth, + &ett_isis_hello_clv_authentication, + &ett_isis_hello_clv_ip_authentication, &ett_isis_hello_clv_ipv4_int_addr, &ett_isis_hello_clv_ipv6_int_addr, &ett_isis_hello_clv_ptp_adj, &ett_isis_hello_clv_mt, - &ett_isis_hello_clv_restart + &ett_isis_hello_clv_restart, + &ett_isis_hello_clv_checksum }; proto_register_field_array(proto_isis, hf, array_length(hf)); Index: packet-isis-hello.h =================================================================== RCS file: /cvsroot/ethereal/packet-isis-hello.h,v retrieving revision 1.10 diff -u -r1.10 packet-isis-hello.h --- packet-isis-hello.h 29 Aug 2002 18:52:51 -0000 1.10 +++ packet-isis-hello.h 8 Dec 2003 10:19:07 -0000 @@ -40,61 +40,6 @@ #define ISIS_HELLO_TYPE_LEVEL_12 3 /* - * detail clv information on l1 hello packets - */ -#define ISIS_CLV_L1H_AREA_ADDRESS 1 -#define ISIS_CLV_L1H_IS_NEIGHBORS 6 -#define ISIS_CLV_L1H_PADDING 8 -#define ISIS_CLV_L1H_NLPID 129 -#define ISIS_CLV_L1H_IP_INTERFACE_ADDR 132 -#define ISIS_CLV_L1H_RESTART 211 -#define ISIS_CLV_L1H_MT 229 -#define ISIS_CLV_L1H_IPv6_INTERFACE_ADDR 232 - -/* - * Note, the spec say 133, but everyone seems to use 10. Any clue on why - * this is would be appreciated! - */ -#define ISIS_CLV_L1H_AUTHENTICATION_NS 10 /*non spec */ -#define ISIS_CLV_L1H_AUTHENTICATION 133 - -/* - * detail clv information on l2 hello packets - */ -#define ISIS_CLV_L2H_AREA_ADDRESS 1 -#define ISIS_CLV_L2H_IS_NEIGHBORS 6 -#define ISIS_CLV_L2H_PADDING 8 -#define ISIS_CLV_L2H_NLPID 129 -#define ISIS_CLV_L2H_IP_INTERFACE_ADDR 132 -#define ISIS_CLV_L2H_RESTART 211 -#define ISIS_CLV_L2H_MT 229 -#define ISIS_CLV_L2H_IPv6_INTERFACE_ADDR 232 -/* - * Note, the spec say 133, but everyone seems to use 10. Any clue on why - * this is would be appreciated! - */ -#define ISIS_CLV_L2H_AUTHENTICATION_NS 10 /*non spec */ -#define ISIS_CLV_L2H_AUTHENTICATION 133 - -/* - * detail clv information on PTP hello packets - */ -#define ISIS_CLV_PTP_AREA_ADDRESS 1 -#define ISIS_CLV_PTP_PADDING 8 -#define ISIS_CLV_PTP_NLPID 129 -#define ISIS_CLV_PTP_IP_INTERFACE_ADDR 132 -#define ISIS_CLV_PTP_RESTART 211 -#define ISIS_CLV_PTP_MT 229 -#define ISIS_CLV_PTP_IPv6_INTERFACE_ADDR 232 -#define ISIS_CLV_PTP_ADJ 240 -/* - * Note, the spec say 133, but everyone seems to use 10. Any clue on why - * this is would be appreciated! - */ -#define ISIS_CLV_PTP_AUTHENTICATION_NS 10 /*non spec */ -#define ISIS_CLV_PTP_AUTHENTICATION 133 - -/* * misc. bittest macros */ Index: packet-isis-lsp.c =================================================================== RCS file: /cvsroot/ethereal/packet-isis-lsp.c,v retrieving revision 1.45 diff -u -r1.45 packet-isis-lsp.c --- packet-isis-lsp.c 19 Nov 2003 09:58:37 -0000 1.45 +++ packet-isis-lsp.c 8 Dec 2003 10:19:12 -0000 @@ -70,7 +70,8 @@ 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_authentication = -1; +static gint ett_isis_lsp_clv_ip_authentication = -1; static gint ett_isis_lsp_clv_ipv4_int_addr = -1; static gint ett_isis_lsp_clv_ipv6_int_addr = -1; /* CLV 232 */ static gint ett_isis_lsp_clv_ip_reachability = -1; @@ -122,9 +123,9 @@ proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_area_address_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); -static void dissect_lsp_l2_auth_clv(tvbuff_t *tvb, +static void dissect_lsp_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); -static void dissect_lsp_l1_auth_clv(tvbuff_t *tvb, +static void dissect_lsp_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_ipv6_int_addr_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); @@ -154,115 +155,115 @@ static const isis_clv_handle_t clv_l1_lsp_opts[] = { { - ISIS_CLV_L1_LSP_AREA_ADDRESS, + ISIS_CLV_AREA_ADDRESS, "Area address(es)", &ett_isis_lsp_clv_area_addr, dissect_lsp_area_address_clv }, { - ISIS_CLV_L1_LSP_IS_NEIGHBORS, + ISIS_CLV_IS_REACH, "IS Reachability", &ett_isis_lsp_clv_is_neighbors, dissect_lsp_l1_is_neighbors_clv }, { - ISIS_CLV_L1_LSP_ES_NEIGHBORS, + ISIS_CLV_ES_NEIGHBORS, "ES Neighbor(s)", &ett_isis_lsp_clv_is_neighbors, dissect_lsp_l1_es_neighbors_clv }, { - ISIS_CLV_L1_LSP_EXT_IS_REACHABLE, + ISIS_CLV_EXTD_IS_REACH, "Extended IS reachability", &ett_isis_lsp_clv_ext_is_reachability, dissect_lsp_ext_is_reachability_clv }, { - ISIS_CLV_L1_LSP_IP_INT_REACHABLE, + ISIS_CLV_INT_IP_REACH, "IP Internal reachability", &ett_isis_lsp_clv_ip_reachability, dissect_lsp_ip_reachability_clv }, { - ISIS_CLV_L1_LSP_IP_EXT_REACHABLE, + ISIS_CLV_EXT_IP_REACH, "IP External reachability", &ett_isis_lsp_clv_ip_reachability, dissect_lsp_ip_reachability_clv }, { - ISIS_CLV_L1_LSP_EXT_IP_REACHABLE, + ISIS_CLV_EXTD_IP_REACH, "Extended IP Reachability", &ett_isis_lsp_clv_ext_ip_reachability, dissect_lsp_ext_ip_reachability_clv }, { - ISIS_CLV_L1_LSP_IPv6_REACHABLE, + ISIS_CLV_IP6_REACH, "IPv6 reachability", &ett_isis_lsp_clv_ipv6_reachability, dissect_lsp_ipv6_reachability_clv }, { - ISIS_CLV_L1_LSP_NLPID, + ISIS_CLV_PROTOCOLS_SUPPORTED, "Protocols supported", &ett_isis_lsp_clv_nlpid, dissect_lsp_nlpid_clv }, { - ISIS_CLV_L1_LSP_HOSTNAME, + ISIS_CLV_HOSTNAME, "Hostname", &ett_isis_lsp_clv_hostname, dissect_lsp_hostname_clv }, { - ISIS_CLV_L1_LSP_TE_ROUTER_ID, + ISIS_CLV_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, + ISIS_CLV_IP_ADDR, "IP Interface address(es)", &ett_isis_lsp_clv_ipv4_int_addr, dissect_lsp_ip_int_addr_clv }, { - ISIS_CLV_L1_LSP_IPv6_INTERFACE_ADDR, + ISIS_CLV_IP6_ADDR, "IPv6 Interface address(es)", &ett_isis_lsp_clv_ipv6_int_addr, dissect_lsp_ipv6_int_addr_clv }, { - ISIS_CLV_L1_LSP_AUTHENTICATION_NS, - "Authentication(non-spec)", - &ett_isis_lsp_clv_auth, - dissect_lsp_l1_auth_clv + ISIS_CLV_AUTHENTICATION, + "Authentication", + &ett_isis_lsp_clv_authentication, + dissect_lsp_authentication_clv }, { - ISIS_CLV_L1_LSP_AUTHENTICATION, - "Authentication", - &ett_isis_lsp_clv_auth, - dissect_lsp_l1_auth_clv + ISIS_CLV_IP_AUTHENTICATION, + "IP Authentication", + &ett_isis_lsp_clv_ip_authentication, + dissect_lsp_ip_authentication_clv }, { - ISIS_CLV_L1_LSP_MT, - "Multi Topology", + ISIS_CLV_MT_SUPPORTED, + "Multi Topology supported", &ett_isis_lsp_clv_mt, dissect_lsp_mt_clv }, { - ISIS_CLV_L1_LSP_MT_IS_REACHABLE, + ISIS_CLV_MT_IS_REACH, "Multi Topology IS Reachability", &ett_isis_lsp_clv_mt_is, dissect_lsp_mt_is_reachability_clv }, { - ISIS_CLV_L1_LSP_MT_REACHABLE_IPv4_PREFX, + ISIS_CLV_MT_IP_REACH, "Multi Topology Reachable IPv4 Prefixes", &ett_isis_lsp_clv_mt_reachable_IPv4_prefx, dissect_lsp_mt_reachable_IPv4_prefx_clv }, { - ISIS_CLV_L1_LSP_MT_REACHABLE_IPv6_PREFX, + ISIS_CLV_MT_IP6_REACH, "Multi Topology Reachable IPv6 Prefixes", &ett_isis_lsp_clv_mt_reachable_IPv6_prefx, dissect_lsp_mt_reachable_IPv6_prefx_clv @@ -277,121 +278,121 @@ static const isis_clv_handle_t clv_l2_lsp_opts[] = { { - ISIS_CLV_L1_LSP_AREA_ADDRESS, + ISIS_CLV_AREA_ADDRESS, "Area address(es)", &ett_isis_lsp_clv_area_addr, dissect_lsp_area_address_clv }, { - ISIS_CLV_L2_LSP_IS_NEIGHBORS, + ISIS_CLV_IS_REACH, "IS Reachability", &ett_isis_lsp_clv_is_neighbors, dissect_lsp_l2_is_neighbors_clv }, { - ISIS_CLV_L2_LSP_EXT_IS_REACHABLE, + ISIS_CLV_EXTD_IS_REACH, "Extended IS reachability", &ett_isis_lsp_clv_ext_is_reachability, dissect_lsp_ext_is_reachability_clv }, { - ISIS_CLV_L2_LSP_PARTITION_DIS, + ISIS_CLV_PARTITION_DIS, "Parition Designated Level 2 IS", &ett_isis_lsp_clv_partition_dis, dissect_lsp_partition_dis_clv }, { - ISIS_CLV_L2_LSP_PREFIX_NEIGHBORS, + ISIS_CLV_PREFIX_NEIGHBORS, "Prefix neighbors", &ett_isis_lsp_clv_prefix_neighbors, dissect_lsp_prefix_neighbors_clv }, { - ISIS_CLV_L2_LSP_IP_INT_REACHABLE, + ISIS_CLV_INT_IP_REACH, "IP Internal reachability", &ett_isis_lsp_clv_ip_reachability, dissect_lsp_ip_reachability_clv }, { - ISIS_CLV_L2_LSP_IP_EXT_REACHABLE, + ISIS_CLV_EXT_IP_REACH, "IP External reachability", &ett_isis_lsp_clv_ip_reachability, dissect_lsp_ip_reachability_clv }, { - ISIS_CLV_L2_LSP_NLPID, + ISIS_CLV_PROTOCOLS_SUPPORTED, "Protocols supported", &ett_isis_lsp_clv_nlpid, dissect_lsp_nlpid_clv }, { - ISIS_CLV_L2_LSP_HOSTNAME, + ISIS_CLV_HOSTNAME, "Hostname", &ett_isis_lsp_clv_hostname, dissect_lsp_hostname_clv }, { - ISIS_CLV_L2_LSP_TE_ROUTER_ID, + ISIS_CLV_TE_ROUTER_ID, "Traffic Engineering Router ID", &ett_isis_lsp_clv_te_router_id, dissect_lsp_te_router_id_clv }, { - ISIS_CLV_L2_LSP_EXT_IP_REACHABLE, + ISIS_CLV_EXTD_IP_REACH, "Extended IP Reachability", &ett_isis_lsp_clv_ext_ip_reachability, dissect_lsp_ext_ip_reachability_clv }, { - ISIS_CLV_L2_LSP_IPv6_REACHABLE, + ISIS_CLV_IP6_REACH, "IPv6 reachability", &ett_isis_lsp_clv_ipv6_reachability, dissect_lsp_ipv6_reachability_clv }, { - ISIS_CLV_L2_LSP_IP_INTERFACE_ADDR, + ISIS_CLV_IP_ADDR, "IP Interface address(es)", &ett_isis_lsp_clv_ipv4_int_addr, dissect_lsp_ip_int_addr_clv }, { - ISIS_CLV_L2_LSP_IPv6_INTERFACE_ADDR, + ISIS_CLV_IP6_ADDR, "IPv6 Interface address(es)", &ett_isis_lsp_clv_ipv6_int_addr, dissect_lsp_ipv6_int_addr_clv }, { - ISIS_CLV_L2_LSP_AUTHENTICATION_NS, - "Authentication(non spec)", - &ett_isis_lsp_clv_auth, - dissect_lsp_l2_auth_clv + ISIS_CLV_AUTHENTICATION, + "Authentication", + &ett_isis_lsp_clv_authentication, + dissect_lsp_authentication_clv }, { - ISIS_CLV_L2_LSP_AUTHENTICATION, - "Authentication", - &ett_isis_lsp_clv_auth, - dissect_lsp_l2_auth_clv + ISIS_CLV_IP_AUTHENTICATION, + "IP Authentication", + &ett_isis_lsp_clv_ip_authentication, + dissect_lsp_ip_authentication_clv }, { - ISIS_CLV_L2_LSP_MT, + ISIS_CLV_MT_SUPPORTED, "Multi Topology", &ett_isis_lsp_clv_mt, dissect_lsp_mt_clv }, { - ISIS_CLV_L2_LSP_MT_IS_REACHABLE, + ISIS_CLV_MT_IS_REACH, "Multi Topology IS Reachability", &ett_isis_lsp_clv_mt_is, dissect_lsp_mt_is_reachability_clv }, { - ISIS_CLV_L2_LSP_MT_REACHABLE_IPv4_PREFX, + ISIS_CLV_MT_IP_REACH, "Multi Topology Reachable IPv4 Prefixes", &ett_isis_lsp_clv_mt_reachable_IPv4_prefx, dissect_lsp_mt_reachable_IPv4_prefx_clv }, { - ISIS_CLV_L2_LSP_MT_REACHABLE_IPv6_PREFX, + ISIS_CLV_MT_IP6_REACH, "Multi Topology Reachable IPv6 Prefixes", &ett_isis_lsp_clv_mt_reachable_IPv6_prefx, dissect_lsp_mt_reachable_IPv6_prefx_clv @@ -1033,11 +1034,11 @@ } /* - * Name: dissect_lsp_L1_auth_clv() + * Name: dissect_lsp_authentication_clv() * * Description: * Decode for a lsp packets authenticaion clv. Calls into the - * clv common one. An auth inside a L1 LSP is a per area password + * clv common one. * * Input: * tvbuff_t * : tvbuffer for packet data @@ -1050,19 +1051,18 @@ * void, will modify proto_tree if not null. */ static void -dissect_lsp_l1_auth_clv(tvbuff_t *tvb, proto_tree *tree, int offset, +dissect_lsp_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_authentication_clv(tvb, tree, offset, length, - "Per area authentication" ); + isis_dissect_authentication_clv(tvb, tree, offset, length); } /* - * Name: dissect_lsp_L2_auth_clv() + * Name: dissect_lsp_ip_authentication_clv() * * Description: * Decode for a lsp packets authenticaion clv. Calls into the - * clv common one. An auth inside a L2 LSP is a per domain password + * clv common one. * * Input: * tvbuff_t * : tvbuffer for packet data @@ -1075,11 +1075,10 @@ * void, will modify proto_tree if not null. */ static void -dissect_lsp_l2_auth_clv(tvbuff_t *tvb, proto_tree *tree, int offset, +dissect_lsp_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_authentication_clv(tvb, tree, offset, length, - "Per domain authentication" ); + isis_dissect_ip_authentication_clv(tvb, tree, offset, length); } /* @@ -1984,7 +1983,8 @@ &ett_isis_lsp_clv_unknown, &ett_isis_lsp_clv_partition_dis, &ett_isis_lsp_clv_prefix_neighbors, - &ett_isis_lsp_clv_auth, + &ett_isis_lsp_clv_authentication, + &ett_isis_lsp_clv_ip_authentication, &ett_isis_lsp_clv_nlpid, &ett_isis_lsp_clv_hostname, &ett_isis_lsp_clv_ipv4_int_addr, Index: packet-isis-lsp.h =================================================================== RCS file: /cvsroot/ethereal/packet-isis-lsp.h,v retrieving revision 1.18 diff -u -r1.18 packet-isis-lsp.h --- packet-isis-lsp.h 19 Nov 2003 09:58:37 -0000 1.18 +++ packet-isis-lsp.h 8 Dec 2003 10:19:12 -0000 @@ -78,63 +78,6 @@ #define ISIS_LSP_CLV_METRIC_VALUE(x) ((x)&0x3f) /* - * detail clv information on L1 lsp packets - */ -#define ISIS_CLV_L1_LSP_AREA_ADDRESS 1 -#define ISIS_CLV_L1_LSP_IS_NEIGHBORS 2 -#define ISIS_CLV_L1_LSP_ES_NEIGHBORS 3 -#define ISIS_CLV_L1_LSP_EXT_IS_REACHABLE 22 -#define ISIS_CLV_L1_LSP_IP_INT_REACHABLE 128 -#define ISIS_CLV_L1_LSP_NLPID 129 -#define ISIS_CLV_L1_LSP_IP_EXT_REACHABLE 130 -#define ISIS_CLV_L1_LSP_IP_INTERFACE_ADDR 132 -#define ISIS_CLV_L1_LSP_TE_ROUTER_ID 134 -#define ISIS_CLV_L1_LSP_EXT_IP_REACHABLE 135 -#define ISIS_CLV_L1_LSP_HOSTNAME 137 -#define ISIS_CLV_L1_LSP_MT_IS_REACHABLE 222 -#define ISIS_CLV_L1_LSP_MT 229 -#define ISIS_CLV_L1_LSP_IPv6_INTERFACE_ADDR 232 -#define ISIS_CLV_L1_LSP_MT_REACHABLE_IPv4_PREFX 235 -#define ISIS_CLV_L1_LSP_IPv6_REACHABLE 236 -#define ISIS_CLV_L1_LSP_MT_REACHABLE_IPv6_PREFX 237 -/* - * Note, the spec say 133, but everyone seems to use 10. Any clue on why - * this is would be appreciated! - */ -#define ISIS_CLV_L1_LSP_AUTHENTICATION_NS 10 /* non spec */ -#define ISIS_CLV_L1_LSP_AUTHENTICATION 133 - -/* - * detail clv information on L2 lsp packets - */ -#define ISIS_CLV_L2_LSP_AREA_ADDRESS 1 -#define ISIS_CLV_L2_LSP_IS_NEIGHBORS 2 -#define ISIS_CLV_L2_LSP_PARTITION_DIS 4 -#define ISIS_CLV_L2_LSP_PREFIX_NEIGHBORS 5 -#define ISIS_CLV_L2_LSP_EXT_IS_REACHABLE 22 -#define ISIS_CLV_L2_LSP_IP_INT_REACHABLE 128 -#define ISIS_CLV_L2_LSP_NLPID 129 -#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_EXT_IP_REACHABLE 135 -#define ISIS_CLV_L2_LSP_HOSTNAME 137 -#define ISIS_CLV_L2_LSP_MT_IS_REACHABLE 222 -#define ISIS_CLV_L2_LSP_MT 229 -#define ISIS_CLV_L2_LSP_IPv6_INTERFACE_ADDR 232 -#define ISIS_CLV_L2_LSP_MT_REACHABLE_IPv4_PREFX 235 -#define ISIS_CLV_L2_LSP_IPv6_REACHABLE 236 -#define ISIS_CLV_L2_LSP_MT_REACHABLE_IPv6_PREFX 237 - -/* - * Note, the spec say 133, but everyone seems to use 10. Any clue on why - * this is would be appreciated! - */ -#define ISIS_CLV_L2_LSP_AUTHENTICATION_NS 10 /*non spec */ -#define ISIS_CLV_L2_LSP_AUTHENTICATION 133 - -/* * Published API functions. NOTE, this are "local" API functions and * are only valid from with isis decodes. */ Index: packet-isis-snp.c =================================================================== RCS file: /cvsroot/ethereal/packet-isis-snp.c,v retrieving revision 1.22 diff -u -r1.22 packet-isis-snp.c --- packet-isis-snp.c 9 Jul 2003 04:25:16 -0000 1.22 +++ packet-isis-snp.c 8 Dec 2003 10:19:13 -0000 @@ -40,46 +40,56 @@ /* csnp packets */ static int hf_isis_csnp_pdu_length = -1; static gint ett_isis_csnp = -1; -static gint ett_isis_csnp_lsp_entries = -1; +static gint ett_isis_csnp_clv_lsp_entries = -1; static gint ett_isis_csnp_lsp_entry = -1; -static gint ett_isis_csnp_authentication = -1; +static gint ett_isis_csnp_clv_authentication = -1; +static gint ett_isis_csnp_clv_ip_authentication = -1; +static gint ett_isis_csnp_clv_checksum = -1; static gint ett_isis_csnp_clv_unknown = -1; /* psnp packets */ static int hf_isis_psnp_pdu_length = -1; static gint ett_isis_psnp = -1; -static gint ett_isis_psnp_lsp_entries = -1; +static gint ett_isis_psnp_clv_lsp_entries = -1; static gint ett_isis_psnp_lsp_entry = -1; -static gint ett_isis_psnp_authentication = -1; +static gint ett_isis_psnp_clv_authentication = -1; +static gint ett_isis_psnp_clv_ip_authentication = -1; +static gint ett_isis_psnp_clv_checksum = -1; static gint ett_isis_psnp_clv_unknown = -1; -static void dissect_l1_snp_authentication_clv(tvbuff_t *tvb, +static void dissect_snp_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); -static void dissect_l2_snp_authentication_clv(tvbuff_t *tvb, +static void dissect_snp_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); -static void dissect_csnp_lsp_entries(tvbuff_t *tvb, +static void dissect_snp_checksum_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); -static void dissect_psnp_lsp_entries(tvbuff_t *tvb, +static void dissect_snp_lsp_entries_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); static const isis_clv_handle_t clv_l1_csnp_opts[] = { { - ISIS_CLV_L1_CSNP_LSP_ENTRIES, + ISIS_CLV_LSP_ENTRIES, "LSP entries", - &ett_isis_csnp_lsp_entries, - dissect_csnp_lsp_entries + &ett_isis_csnp_clv_lsp_entries, + dissect_snp_lsp_entries_clv }, { - ISIS_CLV_L1_CSNP_AUTHENTICATION_NS, - "Authentication(non spec)", - &ett_isis_csnp_authentication, - dissect_l1_snp_authentication_clv + ISIS_CLV_AUTHENTICATION, + "Authentication", + &ett_isis_csnp_clv_authentication, + dissect_snp_authentication_clv }, { - ISIS_CLV_L1_CSNP_AUTHENTICATION, - "Authentication", - &ett_isis_csnp_authentication, - dissect_l1_snp_authentication_clv + ISIS_CLV_IP_AUTHENTICATION, + "IP Authentication", + &ett_isis_csnp_clv_ip_authentication, + dissect_snp_ip_authentication_clv + }, + { + ISIS_CLV_CHECKSUM, + "Checksum", + &ett_isis_csnp_clv_checksum, + dissect_snp_checksum_clv }, { 0, "", NULL, NULL @@ -88,22 +98,28 @@ static const isis_clv_handle_t clv_l2_csnp_opts[] = { { - ISIS_CLV_L2_CSNP_LSP_ENTRIES, + ISIS_CLV_LSP_ENTRIES, "LSP entries", - &ett_isis_csnp_lsp_entries, - dissect_csnp_lsp_entries + &ett_isis_csnp_clv_lsp_entries, + dissect_snp_lsp_entries_clv + }, + { + ISIS_CLV_AUTHENTICATION, + "Authentication", + &ett_isis_csnp_clv_authentication, + dissect_snp_authentication_clv }, { - ISIS_CLV_L2_CSNP_AUTHENTICATION_NS, - "Authentication(non spec)", - &ett_isis_csnp_authentication, - dissect_l2_snp_authentication_clv + ISIS_CLV_IP_AUTHENTICATION, + "IP Authentication", + &ett_isis_csnp_clv_ip_authentication, + dissect_snp_ip_authentication_clv }, { - ISIS_CLV_L2_CSNP_AUTHENTICATION, - "Authentication", - &ett_isis_csnp_authentication, - dissect_l2_snp_authentication_clv + ISIS_CLV_CHECKSUM, + "Checksum", + &ett_isis_csnp_clv_checksum, + dissect_snp_checksum_clv }, { 0, "", NULL, NULL @@ -112,22 +128,28 @@ static const isis_clv_handle_t clv_l1_psnp_opts[] = { { - ISIS_CLV_L1_PSNP_LSP_ENTRIES, + ISIS_CLV_LSP_ENTRIES, "LSP entries", - &ett_isis_psnp_lsp_entries, - dissect_psnp_lsp_entries + &ett_isis_psnp_clv_lsp_entries, + dissect_snp_lsp_entries_clv }, { - ISIS_CLV_L1_PSNP_AUTHENTICATION_NS, - "Authentication(non spec)", - &ett_isis_psnp_authentication, - dissect_l1_snp_authentication_clv + ISIS_CLV_AUTHENTICATION, + "Authentication", + &ett_isis_psnp_clv_authentication, + dissect_snp_authentication_clv }, { - ISIS_CLV_L1_PSNP_AUTHENTICATION, - "Authentication", - &ett_isis_psnp_authentication, - dissect_l1_snp_authentication_clv + ISIS_CLV_IP_AUTHENTICATION, + "IP Authentication", + &ett_isis_psnp_clv_ip_authentication, + dissect_snp_ip_authentication_clv + }, + { + ISIS_CLV_CHECKSUM, + "Checksum", + &ett_isis_psnp_clv_checksum, + dissect_snp_checksum_clv }, { 0, "", NULL, NULL @@ -136,22 +158,28 @@ static const isis_clv_handle_t clv_l2_psnp_opts[] = { { - ISIS_CLV_L2_PSNP_LSP_ENTRIES, + ISIS_CLV_LSP_ENTRIES, "LSP entries", - &ett_isis_psnp_lsp_entries, - dissect_psnp_lsp_entries + &ett_isis_psnp_clv_lsp_entries, + dissect_snp_lsp_entries_clv }, { - ISIS_CLV_L2_PSNP_AUTHENTICATION_NS, - "Authentication(non spec)", - &ett_isis_psnp_authentication, - dissect_l2_snp_authentication_clv + ISIS_CLV_AUTHENTICATION, + "Authentication", + &ett_isis_psnp_clv_authentication, + dissect_snp_authentication_clv }, { - ISIS_CLV_L2_PSNP_AUTHENTICATION, - "Authentication", - &ett_isis_psnp_authentication, - dissect_l2_snp_authentication_clv + ISIS_CLV_IP_AUTHENTICATION, + "IP Authentication", + &ett_isis_psnp_clv_ip_authentication, + dissect_snp_ip_authentication_clv + }, + { + ISIS_CLV_CHECKSUM, + "Checksum", + &ett_isis_psnp_clv_checksum, + dissect_snp_checksum_clv }, { 0, "", NULL, NULL @@ -159,7 +187,7 @@ }; /* - * Name: dissect_snp_lsp_entries() + * Name: dissect_snp_lsp_entries_clv() * * Description: * All the snp packets use a common payload format. We have up @@ -180,7 +208,7 @@ * void, but we will add to proto tree if !NULL. */ static void -dissect_csnp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset, +dissect_snp_lsp_entries_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { proto_tree *subtree,*ti; @@ -188,7 +216,7 @@ while ( length > 0 ) { if ( length < 2+id_length+2+4+2 ) { isis_dissect_unknown(tvb, tree, offset, - "Short CSNP header entry (%d vs %d)", length, + "Short SNP header entry (%d vs %d)", length, 2+id_length+2+4+2 ); return; } @@ -224,50 +252,6 @@ } -static void -dissect_psnp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset, - int id_length, int length) -{ - proto_tree *subtree,*ti; - - while ( length > 0 ) { - if ( length < 2+id_length+2+4+2 ) { - isis_dissect_unknown(tvb, tree, offset, - "Short PSNP header entry (%d vs %d)", length, - 2+id_length+2+4+2 ); - return; - } - - ti = proto_tree_add_text(tree, tvb, offset, 2+id_length+2+4+2, - "LSP-ID: %s, Sequence: 0x%08x, Lifetime: %5us, Checksum: 0x%04x", - print_system_id( tvb_get_ptr(tvb, offset+2, id_length+2), id_length+2 ), - tvb_get_ntohl(tvb, offset+2+id_length+2), - tvb_get_ntohs(tvb, offset), - tvb_get_ntohs(tvb, offset+2+id_length+2+4)); - - subtree = proto_item_add_subtree(ti,ett_isis_psnp_lsp_entry); - - proto_tree_add_text(subtree, tvb, offset+2, 8, - "LSP-ID: : %s", - print_system_id( tvb_get_ptr(tvb, offset+2, id_length+2), id_length+2 )); - - proto_tree_add_text(subtree, tvb, offset+2+id_length+2, 4, - "LSP Sequence Number : 0x%08x", - tvb_get_ntohl(tvb, offset+2+id_length+2)); - - proto_tree_add_text(subtree, tvb, offset, 2, - "Remaining Lifetime : %us", - tvb_get_ntohs(tvb, offset)); - - proto_tree_add_text(subtree, tvb, offset+2+id_length+2+4, 2, - "LSP checksum : 0x%04x", - tvb_get_ntohs(tvb, offset+2+id_length+2+4)); - - length -= 2+id_length+2+4+2; - offset += 2+id_length+2+4+2; - } - -} /* * Name: isis_dissect_isis_csnp() @@ -429,11 +413,11 @@ } /* - * Name: dissect_L1_snp_authentication_clv() + * Name: dissect_snp_authentication_clv() * * Description: - * Decode for a lsp packets authenticaion clv. Calls into the - * clv common one. An auth inside a L1 SNP is a per area password + * Decode for a snp packets authenticaion clv. + * Calls into the CLV common one. * * Input: * tvbuff_t * : tvbuffer for packet data @@ -446,19 +430,18 @@ * void, will modify proto_tree if not null. */ static void -dissect_l1_snp_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, +dissect_snp_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_authentication_clv(tvb, tree, offset, length, - "Per area authentication" ); + isis_dissect_authentication_clv(tvb, tree, offset, length); } /* - * Name: dissect_l2_authentication_clv() + * Name: dissect_snp_ip_authentication_clv() * * Description: - * Decode for a lsp packets authenticaion clv. Calls into the - * clv common one. An auth inside a L2 LSP is a per domain password + * Decode for a snp packets authenticaion clv. + * Calls into the CLV common one. * * Input: * tvbuff_t * : tvbuffer for packet data @@ -471,11 +454,77 @@ * void, will modify proto_tree if not null. */ static void -dissect_l2_snp_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, +dissect_snp_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_authentication_clv(tvb, tree, offset, length, - "Per domain authentication" ); + isis_dissect_ip_authentication_clv(tvb, tree, offset, length); +} + +/* + * Name: dissect_snp_checksum_clv() + * + * Description: + * dump and verify the optional checksum in TLV 12 + * + * 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. + */ + +static void +dissect_snp_checksum_clv(tvbuff_t *tvb, + proto_tree *tree, int offset, int id_length _U_, int length) { + + guint16 pdu_length,checksum, cacl_checksum=0; + + if (tree) { + if ( length != 2 ) { + proto_tree_add_text ( tree, tvb, offset, length, + "incorrect checksum length (%u), should be (2)", length ); + return; + } + + checksum = tvb_get_ntohs(tvb, offset); + + /* the check_and_get_checksum() function needs to know how big + * the packet is. we can either pass through the pdu-len through several layers + * of dissectors and wrappers or extract the PDU length field from the PDU specific header + * which is offseted 8 bytes (relative to the beginning of the IS-IS packet) in SNPs */ + + pdu_length = tvb_get_ntohs(tvb, 8); + + /* unlike the LSP checksum verification which starts at an offset of 12 we start at offset 0*/ + switch (check_and_get_checksum(tvb, 0, pdu_length, checksum, offset, &cacl_checksum)) + { + + case NO_CKSUM : + proto_tree_add_text ( tree, tvb, offset, length, + "Checksum: 0x%04x (unused)", checksum); + break; + case DATA_MISSING : + isis_dissect_unknown(tvb, tree, offset, + "packet length %d went beyond packet", + tvb_length_remaining(tvb, 0)); + break; + case CKSUM_NOT_OK : + proto_tree_add_text ( tree, tvb, offset, length, + "Checksum: 0x%04x (incorrect, should be 0x%04x)", + checksum, + cacl_checksum); + break; + case CKSUM_OK : + proto_tree_add_text ( tree, tvb, offset, length, + "Checksum: 0x%04x (correct)", checksum); + break; + default : + g_message("'check_and_get_checksum' returned an invalid value"); + } + } } /* @@ -499,9 +548,11 @@ }; static gint *ett[] = { &ett_isis_csnp, - &ett_isis_csnp_lsp_entries, + &ett_isis_csnp_clv_lsp_entries, &ett_isis_csnp_lsp_entry, - &ett_isis_csnp_authentication, + &ett_isis_csnp_clv_authentication, + &ett_isis_csnp_clv_ip_authentication, + &ett_isis_csnp_clv_checksum, &ett_isis_csnp_clv_unknown, }; @@ -531,9 +582,11 @@ }; static gint *ett[] = { &ett_isis_psnp, - &ett_isis_psnp_lsp_entries, + &ett_isis_psnp_clv_lsp_entries, &ett_isis_psnp_lsp_entry, - &ett_isis_psnp_authentication, + &ett_isis_psnp_clv_authentication, + &ett_isis_psnp_clv_ip_authentication, + &ett_isis_psnp_clv_checksum, &ett_isis_psnp_clv_unknown, }; Index: packet-isis-snp.h =================================================================== RCS file: /cvsroot/ethereal/packet-isis-snp.h,v retrieving revision 1.7 diff -u -r1.7 packet-isis-snp.h --- packet-isis-snp.h 29 Aug 2002 18:52:51 -0000 1.7 +++ packet-isis-snp.h 8 Dec 2003 10:19:13 -0000 @@ -27,39 +27,6 @@ #define _PACKET_ISIS_SNP_H /* - * Note, the spec say 133 for authentication, but everyone seems to use 10. - * Any clue on why this is would be appreciated! - */ - -/* - * detail cvls information for L1 CSNP packets - */ -#define ISIS_CLV_L1_CSNP_LSP_ENTRIES 9 -#define ISIS_CLV_L1_CSNP_AUTHENTICATION_NS 10 -#define ISIS_CLV_L1_CSNP_AUTHENTICATION 133 - -/* - * detail cvls information for L2 CSNP packets - */ -#define ISIS_CLV_L2_CSNP_LSP_ENTRIES 9 -#define ISIS_CLV_L2_CSNP_AUTHENTICATION_NS 10 -#define ISIS_CLV_L2_CSNP_AUTHENTICATION 133 - -/* - * detail cvls information for L1 PSNP packets - */ -#define ISIS_CLV_L1_PSNP_LSP_ENTRIES 9 -#define ISIS_CLV_L1_PSNP_AUTHENTICATION_NS 10 -#define ISIS_CLV_L1_PSNP_AUTHENTICATION 133 - -/* - * detail cvls information for L2 PSNP packets - */ -#define ISIS_CLV_L2_PSNP_LSP_ENTRIES 9 -#define ISIS_CLV_L2_PSNP_AUTHENTICATION_NS 10 -#define ISIS_CLV_L2_PSNP_AUTHENTICATION 133 - -/* * Published API functions. NOTE, this are "local" API functions and * are only valid from with isis decodes. */
Attachment:
ppp-isis-checksum.tcpdump
Description: Binary data
Attachment:
isis-iih-checksum-zero-md5.tcpdump
Description: Binary data
- Follow-Ups:
- Re: [Ethereal-dev] IS-IS cleanup, new Checksum CLV dissector
- From: Guy Harris
- Re: [Ethereal-dev] IS-IS cleanup, new Checksum CLV dissector
- Prev by Date: RE: [Ethereal-dev] Are WSP content types the same as HTTP content types?
- Next by Date: [Ethereal-dev] nsis script fix
- Previous by thread: Re: [Ethereal-dev] What is "File->Save Highlighted" menu item for?
- Next by thread: Re: [Ethereal-dev] IS-IS cleanup, new Checksum CLV dissector
- Index(es):