diff --git a/packet-isis-clv.c b/packet-isis-clv.c index 982d875eab..0d3c17cb5c 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.17 2002/04/02 01:25:08 guy Exp $ + * $Id: packet-isis-clv.c,v 1.18 2002/04/07 22:36:55 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -55,7 +55,6 @@ * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * 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 @@ -64,8 +63,8 @@ * void, but we will add to proto tree if !NULL. */ void -isis_dissect_area_address_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length) +isis_dissect_area_address_clv(tvbuff_t *tvb, proto_tree *tree, int offset, + int length) { char *sbuf; int mylen; @@ -74,12 +73,12 @@ isis_dissect_area_address_clv(tvbuff_t *tvb, packet_info *pinfo, mylen = tvb_get_guint8(tvb, offset); length--; if (length<=0) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "short address (no length for payload)"); return; } if ( mylen > length) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "short address, packet say %d, we have %d left", mylen, length ); return; @@ -116,7 +115,6 @@ isis_dissect_area_address_clv(tvbuff_t *tvb, packet_info *pinfo, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * 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 @@ -126,8 +124,8 @@ isis_dissect_area_address_clv(tvbuff_t *tvb, packet_info *pinfo, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length, char *meaning) +isis_dissect_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, + int length, char *meaning) { u_char pw_type; char sbuf[300]; /* 255 + header info area */ @@ -181,7 +179,7 @@ isis_dissect_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, "%s %s", meaning, sbuf ); if ( auth_unsupported ) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "Unknown authentication type" ); } } @@ -195,7 +193,6 @@ isis_dissect_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * 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 @@ -206,8 +203,8 @@ isis_dissect_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, void -isis_dissect_hostname_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length) +isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset, + int length) { if ( !tree ) return; /* nothing to do! */ @@ -225,8 +222,8 @@ isis_dissect_hostname_clv(tvbuff_t *tvb, packet_info *pinfo, void -isis_dissect_mt_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length, int tree_id) +isis_dissect_mt_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length, + int tree_id) { guint16 mt_block; char mt_desc[60]; @@ -288,7 +285,6 @@ isis_dissect_mt_clv(tvbuff_t *tvb, packet_info *pinfo, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * 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 @@ -298,8 +294,8 @@ isis_dissect_mt_clv(tvbuff_t *tvb, packet_info *pinfo, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_ip_int_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length, int tree_id) +isis_dissect_ip_int_clv(tvbuff_t *tvb, proto_tree *tree, int offset, + int length, int tree_id) { if ( length <= 0 ) { return; @@ -307,7 +303,7 @@ isis_dissect_ip_int_clv(tvbuff_t *tvb, packet_info *pinfo, while ( length > 0 ) { if ( length < 4 ) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "Short ip interface address (%d vs 4)",length ); return; } @@ -331,7 +327,6 @@ isis_dissect_ip_int_clv(tvbuff_t *tvb, packet_info *pinfo, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * 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 @@ -341,8 +336,8 @@ isis_dissect_ip_int_clv(tvbuff_t *tvb, packet_info *pinfo, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_ipv6_int_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length, int tree_id) +isis_dissect_ipv6_int_clv(tvbuff_t *tvb, proto_tree *tree, int offset, + int length, int tree_id) { guint8 addr [16]; @@ -352,7 +347,7 @@ isis_dissect_ipv6_int_clv(tvbuff_t *tvb, packet_info *pinfo, while ( length > 0 ) { if ( length < 16 ) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "Short IPv6 interface address (%d vs 16)",length ); return; } @@ -376,7 +371,6 @@ isis_dissect_ipv6_int_clv(tvbuff_t *tvb, packet_info *pinfo, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * 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 @@ -386,15 +380,15 @@ isis_dissect_ipv6_int_clv(tvbuff_t *tvb, packet_info *pinfo, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_te_router_id_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length, int tree_id) +isis_dissect_te_router_id_clv(tvbuff_t *tvb, proto_tree *tree, int offset, + int length, int tree_id) { if ( length <= 0 ) { return; } if ( length != 4 ) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "malformed Traffic Engineering Router ID (%d vs 4)",length ); return; } @@ -414,7 +408,6 @@ isis_dissect_te_router_id_clv(tvbuff_t *tvb, packet_info *pinfo, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * 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 @@ -423,8 +416,7 @@ isis_dissect_te_router_id_clv(tvbuff_t *tvb, packet_info *pinfo, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_nlpid_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length) +isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length) { char sbuf[256*6]; char *s = sbuf; @@ -460,11 +452,10 @@ isis_dissect_nlpid_clv(tvbuff_t *tvb, packet_info *pinfo, * search the passed in valid clv's for this protocol (opts) for * a matching code. If found, we add to the display tree and * then call the dissector. If it is not, we just post an - * "unknown" clv entrie using the passed in unknown clv tree id. + * "unknown" clv entry using the passed in unknown clv tree id. * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to fill out. May be NULL * int : offset into packet data where we are. * isis_clv_handle_t * : NULL dissector terminated array of codes @@ -477,8 +468,8 @@ isis_dissect_nlpid_clv(tvbuff_t *tvb, packet_info *pinfo, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_clvs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, const isis_clv_handle_t *opts, int len, int id_length, +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) { guint8 code; @@ -499,7 +490,7 @@ isis_dissect_clvs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, adj = (sizeof(code) + sizeof(length) + length); len -= adj; if ( len < 0 ) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "Short CLV header (%d vs %d)", adj, len + adj ); return; @@ -520,7 +511,7 @@ isis_dissect_clvs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } else { clv_tree = NULL; } - opts[q].dissect(tvb, pinfo, clv_tree, offset, + opts[q].dissect(tvb, clv_tree, offset, id_length, length); } else { if (tree) { diff --git a/packet-isis-clv.h b/packet-isis-clv.h index 4f2136da16..399566cef6 100644 --- a/packet-isis-clv.h +++ b/packet-isis-clv.h @@ -1,7 +1,7 @@ /* packet-isis-clv.h * Declares for common clv decoding functions. * - * $Id: packet-isis-clv.h,v 1.7 2001/07/02 00:19:34 guy Exp $ + * $Id: packet-isis-clv.h,v 1.8 2002/04/07 22:36:55 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -21,9 +21,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * */ + #ifndef _PACKET_ISIS_CLV_H #define _PACKET_ISIS_CLV_H @@ -34,7 +33,7 @@ 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, packet_info *pinfo, proto_tree *tree, + void (*dissect)(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length); } isis_clv_handle_t; @@ -42,30 +41,28 @@ typedef struct { * Published API functions. NOTE, this are "local" API functions and * are only valid from with isis decodes. */ -extern void isis_dissect_clvs(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, +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); -extern void isis_dissect_nlpid_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length); -extern void isis_dissect_te_router_id_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length, int tree_id); -extern void isis_dissect_ipv6_int_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length, int tree_id); -extern void isis_dissect_ip_int_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length, int tree_id); -extern void isis_dissect_mt_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length, int tree_id); -extern void isis_dissect_hostname_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length); -extern void isis_dissect_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length, char *meaning); -extern void isis_dissect_area_address_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int length); +extern void isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, + 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); +extern void isis_dissect_ipv6_int_clv(tvbuff_t *tvb, proto_tree *tree, + 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); +extern void isis_dissect_mt_clv(tvbuff_t *tvb, proto_tree *tree, + int offset, int length, int tree_id); +extern void isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree, + int offset, int length); +extern void isis_dissect_authentication_clv(tvbuff_t *tvb, proto_tree *tree, + int offset, int length, char *meaning); +extern void isis_dissect_area_address_clv(tvbuff_t *tvb, proto_tree *tree, + int offset, int length); -extern void isis_dissect_metric(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, +extern void isis_dissect_metric(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 value, char *pstr, int force_supported); #endif /* _PACKET_ISIS_CLV_H */ diff --git a/packet-isis-hello.c b/packet-isis-hello.c index 5c630b598b..1ffae4527c 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.27 2002/02/09 23:44:38 guy Exp $ + * $Id: packet-isis-hello.c,v 1.28 2002/04/07 22:36:55 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -79,35 +79,25 @@ static const value_string isis_hello_circuit_type_vals[] = { * Predclare dissectors for use in clv dissection. */ static void dissect_hello_padding_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_is_neighbors_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_ptp_adj_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_area_address_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_auth_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_ipv6_int_addr_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_ip_int_addr_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_mt_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_nlpid_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_hello_restart_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static const isis_clv_handle_t clv_l1_hello_opts[] = { @@ -329,8 +319,7 @@ static const isis_clv_handle_t clv_ptp_hello_opts[] = { static void dissect_hello_restart_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length) + proto_tree *tree, int offset, int id_length, int length) { int restart_options; @@ -355,7 +344,6 @@ dissect_hello_restart_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -366,10 +354,9 @@ dissect_hello_restart_clv(tvbuff_t *tvb, */ static void dissect_hello_nlpid_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length) + proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_nlpid_clv(tvb, pinfo, tree, offset, length); + isis_dissect_nlpid_clv(tvb, tree, offset, length); } /* @@ -381,7 +368,6 @@ dissect_hello_nlpid_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -393,10 +379,9 @@ dissect_hello_nlpid_clv(tvbuff_t *tvb, static void dissect_hello_mt_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length) + proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_mt_clv(tvb, pinfo, tree, offset, length, + isis_dissect_mt_clv(tvb, tree, offset, length, hf_isis_hello_clv_mt ); } @@ -409,7 +394,6 @@ dissect_hello_mt_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -420,10 +404,9 @@ dissect_hello_mt_clv(tvbuff_t *tvb, */ static void dissect_hello_ip_int_addr_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length) + proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_ip_int_clv(tvb, pinfo, tree, offset, length, + isis_dissect_ip_int_clv(tvb, tree, offset, length, hf_isis_hello_clv_ipv4_int_addr ); } @@ -436,7 +419,6 @@ dissect_hello_ip_int_addr_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -447,10 +429,9 @@ dissect_hello_ip_int_addr_clv(tvbuff_t *tvb, */ static void dissect_hello_ipv6_int_addr_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length) + proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_ipv6_int_clv(tvb, pinfo, tree, offset, length, + isis_dissect_ipv6_int_clv(tvb, tree, offset, length, hf_isis_hello_clv_ipv6_int_addr ); } @@ -464,7 +445,6 @@ dissect_hello_ipv6_int_addr_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -475,10 +455,9 @@ dissect_hello_ipv6_int_addr_clv(tvbuff_t *tvb, */ static void dissect_hello_auth_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length) + proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_authentication_clv(tvb, pinfo, tree, offset, + isis_dissect_authentication_clv(tvb, tree, offset, length, "authentication" ); } @@ -491,7 +470,6 @@ dissect_hello_auth_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -502,18 +480,16 @@ dissect_hello_auth_clv(tvbuff_t *tvb, */ static void dissect_hello_area_address_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length) + proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_area_address_clv(tvb, pinfo, tree, offset, length); + isis_dissect_area_address_clv(tvb, tree, offset, length); } static void dissect_hello_ptp_adj_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length) + proto_tree *tree, int offset, int id_length, int length) { char adj_state[20]; @@ -561,7 +537,7 @@ dissect_hello_ptp_adj_clv(tvbuff_t *tvb, "Neighbor Extended Local circuit ID: 0x%08x", tvb_get_ntohl(tvb, offset+11) ); break; default: - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "malformed TLV (%d vs 1,5,11,15)", length ); return; } @@ -576,7 +552,6 @@ dissect_hello_ptp_adj_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to fill out. May be NULL * int : offset into packet data where we are. * int : length of IDs in packet. @@ -586,12 +561,12 @@ dissect_hello_ptp_adj_clv(tvbuff_t *tvb, * void, but we will add to proto tree if !NULL. */ static void -dissect_hello_is_neighbors_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int id_length, int length) +dissect_hello_is_neighbors_clv(tvbuff_t *tvb, proto_tree *tree, int offset, + int id_length, int length) { while ( length > 0 ) { if (length<6) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "short is neighbor (%d vs 6)", length ); return; } @@ -617,7 +592,6 @@ dissect_hello_is_neighbors_clv(tvbuff_t *tvb, packet_info *pinfo, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -627,8 +601,8 @@ dissect_hello_is_neighbors_clv(tvbuff_t *tvb, packet_info *pinfo, * void */ static void -dissect_hello_padding_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, int id_length, int length) +dissect_hello_padding_clv(tvbuff_t *tvb, proto_tree *tree, int offset, + int id_length, int length) { /* nothing to do here! */ } @@ -644,7 +618,6 @@ dissect_hello_padding_clv(tvbuff_t *tvb, packet_info *pinfo, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to add to. May be NULL. * int offset : our offset into packet data. * int : hello type, a la packet-isis.h ISIS_TYPE_* values @@ -655,8 +628,8 @@ dissect_hello_padding_clv(tvbuff_t *tvb, packet_info *pinfo, * void, will modify proto_tree if not NULL. */ 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) +isis_dissect_isis_hello(tvbuff_t *tvb, proto_tree *tree, int offset, + int hello_type, int header_length, int id_length) { proto_item *ti; proto_tree *hello_tree = NULL; @@ -735,7 +708,7 @@ isis_dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, len = pdu_length; len -= header_length; if (len < 0) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "Packet header length %d went beyond packet", header_length ); return; @@ -745,15 +718,15 @@ isis_dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * our list of valid ones! */ if (hello_type == ISIS_TYPE_L1_HELLO){ - isis_dissect_clvs(tvb, pinfo, hello_tree, offset, + isis_dissect_clvs(tvb, hello_tree, offset, clv_l1_hello_opts, len, id_length, ett_isis_hello_clv_unknown); } else if (hello_type == ISIS_TYPE_L2_HELLO) { - isis_dissect_clvs(tvb, pinfo, hello_tree, offset, + isis_dissect_clvs(tvb, hello_tree, offset, clv_l2_hello_opts, len, id_length, ett_isis_hello_clv_unknown); } else { - isis_dissect_clvs(tvb, pinfo, hello_tree, offset, + isis_dissect_clvs(tvb, hello_tree, offset, clv_ptp_hello_opts, len, id_length, ett_isis_hello_clv_unknown); } diff --git a/packet-isis-hello.h b/packet-isis-hello.h index 58ca243d52..bfd24e57bd 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.7 2002/02/09 23:44:38 guy Exp $ + * $Id: packet-isis-hello.h,v 1.8 2002/04/07 22:36:55 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -105,9 +105,8 @@ * 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, packet_info *pinfo, - proto_tree *tree, int offset, - int hello_type, int header_length,int id_length); +extern void isis_dissect_isis_hello(tvbuff_t *tvb, proto_tree *tree, + int offset, int hello_type, int header_length,int id_length); extern void isis_register_hello(int proto_isis); #endif /* _PACKET_ISIS_HELLO_H */ diff --git a/packet-isis-lsp.c b/packet-isis-lsp.c index cdf55396ed..f7c3866ebe 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.26 2002/03/23 22:03:41 guy Exp $ + * $Id: packet-isis-lsp.c,v 1.27 2002/04/07 22:36:55 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -97,62 +97,43 @@ static const value_string isis_lsp_istype_vals[] = { * Predclare dissectors for use in clv dissection. */ static void dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_partition_dis_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_mt_is_reachability_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_ext_is_reachability_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_l2_is_neighbors_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_l1_es_neighbors_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_l1_is_neighbors_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_area_address_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_l2_auth_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_l1_auth_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_ipv6_int_addr_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_ip_int_addr_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_te_router_id_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_hostname_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_mt_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_nlpid_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_ext_ip_reachability_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); static void dissect_lsp_ip_reachability_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length); + proto_tree *tree, int offset, int id_length, int length); @@ -405,7 +386,6 @@ static const isis_clv_handle_t clv_l2_lsp_opts[] = { * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to fill out. May be NULL * int : offset into packet data where we are. * guint8 : value of the metric. @@ -416,8 +396,8 @@ static const isis_clv_handle_t clv_l2_lsp_opts[] = { * void, but we will add to proto tree if !NULL. */ static void -dissect_metric(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, guint8 value, char *pstr, int force_supported ) +dissect_metric(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 value, + char *pstr, int force_supported ) { int s; @@ -443,7 +423,6 @@ dissect_metric(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -453,8 +432,7 @@ dissect_metric(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * void, will modify proto_tree if not null. */ static void -dissect_lsp_ip_reachability_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_ip_reachability_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { proto_item *ti; @@ -476,7 +454,7 @@ dissect_lsp_ip_reachability_clv(tvbuff_t *tvb, while ( length > 0 ) { if (length<12) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "short IP reachability (%d vs 12)", length ); return; } @@ -564,7 +542,6 @@ dissect_lsp_ip_reachability_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -574,9 +551,8 @@ dissect_lsp_ip_reachability_clv(tvbuff_t *tvb, * void, will modify proto_tree if not null. */ static void -dissect_lsp_ext_ip_reachability_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, - int id_length, int length) +dissect_lsp_ext_ip_reachability_clv(tvbuff_t *tvb, proto_tree *tree, + int offset, int id_length, int length) { proto_item *pi = NULL; proto_tree *subtree = NULL; @@ -623,7 +599,6 @@ dissect_lsp_ext_ip_reachability_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -633,8 +608,7 @@ dissect_lsp_ext_ip_reachability_clv(tvbuff_t *tvb, * void, will modify proto_tree if not null. */ static void -dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { proto_item *ti; @@ -694,7 +668,6 @@ dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -704,11 +677,10 @@ dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb, * void, will modify proto_tree if not null. */ static void -dissect_lsp_nlpid_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_nlpid_clv(tvb, pinfo, tree, offset, length); + isis_dissect_nlpid_clv(tvb, tree, offset, length); } /* @@ -719,23 +691,20 @@ dissect_lsp_nlpid_clv(tvbuff_t *tvb, * clv common one. * * Input: - * u_char * : packet data + * tvbuff_t * : tvbuffer for packet data + * proto_tree * : proto tree to build on (may be null) * 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_mt_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_mt_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_mt_clv(tvb, pinfo, tree, offset, length, - hf_isis_lsp_clv_mt ); + isis_dissect_mt_clv(tvb, tree, offset, length, hf_isis_lsp_clv_mt ); } /* @@ -747,7 +716,6 @@ dissect_lsp_mt_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -757,11 +725,10 @@ dissect_lsp_mt_clv(tvbuff_t *tvb, * void, will modify proto_tree if not null. */ static void -dissect_lsp_hostname_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_hostname_clv(tvb, pinfo, tree, offset, length); + isis_dissect_hostname_clv(tvb, tree, offset, length); } @@ -774,7 +741,6 @@ dissect_lsp_hostname_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -784,11 +750,10 @@ dissect_lsp_hostname_clv(tvbuff_t *tvb, * void, will modify proto_tree if not null. */ static void -dissect_lsp_te_router_id_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_te_router_id_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_te_router_id_clv(tvb, pinfo, tree, offset, length, + isis_dissect_te_router_id_clv(tvb, tree, offset, length, hf_isis_lsp_clv_te_router_id ); } @@ -802,7 +767,6 @@ dissect_lsp_te_router_id_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -812,11 +776,10 @@ dissect_lsp_te_router_id_clv(tvbuff_t *tvb, * void, will modify proto_tree if not null. */ static void -dissect_lsp_ip_int_addr_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_ip_int_addr_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_ip_int_clv(tvb, pinfo, tree, offset, length, + isis_dissect_ip_int_clv(tvb, tree, offset, length, hf_isis_lsp_clv_ipv4_int_addr ); } @@ -829,7 +792,6 @@ dissect_lsp_ip_int_addr_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -839,11 +801,10 @@ dissect_lsp_ip_int_addr_clv(tvbuff_t *tvb, * void, will modify proto_tree if not null. */ static void -dissect_lsp_ipv6_int_addr_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_ipv6_int_addr_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_ipv6_int_clv(tvb, pinfo, tree, offset, length, + isis_dissect_ipv6_int_clv(tvb, tree, offset, length, hf_isis_lsp_clv_ipv6_int_addr ); } @@ -856,7 +817,6 @@ dissect_lsp_ipv6_int_addr_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -866,11 +826,10 @@ dissect_lsp_ipv6_int_addr_clv(tvbuff_t *tvb, * void, will modify proto_tree if not null. */ static void -dissect_lsp_l1_auth_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_l1_auth_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_authentication_clv(tvb, pinfo, tree, offset, length, + isis_dissect_authentication_clv(tvb, tree, offset, length, "Per area authentication" ); } @@ -883,7 +842,6 @@ dissect_lsp_l1_auth_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -893,11 +851,10 @@ dissect_lsp_l1_auth_clv(tvbuff_t *tvb, * void, will modify proto_tree if not null. */ static void -dissect_lsp_l2_auth_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_l2_auth_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_authentication_clv(tvb, pinfo, tree, offset, length, + isis_dissect_authentication_clv(tvb, tree, offset, length, "Per domain authentication" ); } @@ -910,7 +867,6 @@ dissect_lsp_l2_auth_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to fill out. May be NULL * int : offset into packet data where we are. * int : length of IDs in packet. @@ -920,11 +876,10 @@ dissect_lsp_l2_auth_clv(tvbuff_t *tvb, * void, but we will add to proto tree if !NULL. */ static void -dissect_lsp_area_address_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_area_address_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_area_address_clv(tvb, pinfo, tree, offset, length); + isis_dissect_area_address_clv(tvb, tree, offset, length); } /* @@ -941,7 +896,6 @@ dissect_lsp_area_address_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to fill out. May be NULL * int : offset into packet data where we are. * int : length of IDs in packet. @@ -953,9 +907,8 @@ dissect_lsp_area_address_clv(tvbuff_t *tvb, * void, but we will add to proto tree if !NULL. */ static void -dissect_lsp_eis_neighbors_clv_inner(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, - int length, int id_length, int show_virtual, int is_eis) +dissect_lsp_eis_neighbors_clv_inner(tvbuff_t *tvb, proto_tree *tree, + int offset, int length, int id_length, int show_virtual, int is_eis) { proto_item *ti; proto_tree *ntree = NULL; @@ -981,7 +934,7 @@ dissect_lsp_eis_neighbors_clv_inner(tvbuff_t *tvb, packet_info *pinfo, while ( length > 0 ) { if (length 0 ){ - isis_dissect_unknown(tvb, pinfo, tree, offset, - "Long lsp parition DIS, %d left over", length ); + isis_dissect_unknown(tvb, tree, offset, + "Long lsp partition DIS, %d left over", length ); return; } } @@ -1488,7 +1430,6 @@ dissect_lsp_partition_dis_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to fill out. May be NULL * int : offset into packet data where we are. * int : length of IDs in packet. @@ -1498,26 +1439,25 @@ dissect_lsp_partition_dis_clv(tvbuff_t *tvb, * void, but we will add to proto tree if !NULL. */ static void -dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree, int offset, +dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { char *sbuf; int mylen; if ( length < 4 ) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "Short lsp prefix neighbors (%d vs 4)", length ); return; } if ( tree ) { - dissect_metric (tvb, pinfo, tree, offset, + dissect_metric (tvb, tree, offset, tvb_get_guint8(tvb, offset), "Default", TRUE ); - dissect_metric (tvb, pinfo, tree, offset+1, + dissect_metric (tvb, tree, offset+1, tvb_get_guint8(tvb, offset+1), "Delay", FALSE ); - dissect_metric (tvb, pinfo, tree, offset+2, + dissect_metric (tvb, tree, offset+2, tvb_get_guint8(tvb, offset+2), "Expense", FALSE ); - dissect_metric (tvb, pinfo, tree, offset+3, + dissect_metric (tvb, tree, offset+3, tvb_get_guint8(tvb, offset+3), "Error", FALSE ); } offset += 4; @@ -1526,12 +1466,12 @@ dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, mylen = tvb_get_guint8(tvb, offset); length--; if (length<=0) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "Zero payload space after length in prefix neighbor" ); return; } if ( mylen > length) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "Interal length of prefix neighbor too long (%d vs %d)", mylen, length ); return; @@ -1560,7 +1500,6 @@ dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : tree to display into. REQUIRED * int : offset into packet data where we are. * char * : title string @@ -1570,8 +1509,8 @@ dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, * void, but we will add to proto tree */ void -isis_lsp_decode_lsp_id(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, char *tstr, int id_length) +isis_lsp_decode_lsp_id(tvbuff_t *tvb, proto_tree *tree, int offset, + char *tstr, int id_length) { proto_tree_add_text(tree, tvb, offset, id_length + 2, "%s: %s.%02x-%02x", tstr, @@ -1589,7 +1528,6 @@ isis_lsp_decode_lsp_id(tvbuff_t *tvb, packet_info *pinfo, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to add to. May be NULL. * int offset : our offset into packet data. * int : LSP type, a la packet-isis.h ISIS_TYPE_* values @@ -1600,8 +1538,8 @@ isis_lsp_decode_lsp_id(tvbuff_t *tvb, packet_info *pinfo, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, int lsp_type, int header_length, int id_length) +isis_dissect_isis_lsp(tvbuff_t *tvb, proto_tree *tree, int offset, + int lsp_type, int header_length, int id_length) { proto_item *ti; proto_tree *lsp_tree = NULL; @@ -1629,7 +1567,7 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset += 2; if (tree) { - isis_lsp_decode_lsp_id(tvb, pinfo, lsp_tree, offset, + isis_lsp_decode_lsp_id(tvb, lsp_tree, offset, "LSP ID", id_length); } offset += id_length + 2; @@ -1682,7 +1620,7 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, len = pdu_length - header_length; if (len < 0) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "packet header length %d went beyond packet", header_length ); return; @@ -1692,11 +1630,11 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * our list of valid ones! */ if (lsp_type == ISIS_TYPE_L1_LSP){ - isis_dissect_clvs(tvb, pinfo, lsp_tree, offset, + isis_dissect_clvs(tvb, lsp_tree, offset, clv_l1_lsp_opts, len, id_length, ett_isis_lsp_clv_unknown ); } else { - isis_dissect_clvs(tvb, pinfo, lsp_tree, offset, + isis_dissect_clvs(tvb, lsp_tree, offset, clv_l2_lsp_opts, len, id_length, ett_isis_lsp_clv_unknown ); } diff --git a/packet-isis-lsp.h b/packet-isis-lsp.h index 57424c154f..c0f5ee5fd0 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.11 2001/12/20 07:33:21 guy Exp $ + * $Id: packet-isis-lsp.h,v 1.12 2002/04/07 22:36:55 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -108,11 +108,10 @@ * 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, 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, packet_info *pinfo, - proto_tree *tree, int offset, char *tstr, int id_length); +extern void isis_dissect_isis_lsp(tvbuff_t *tvb, 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); extern void isis_register_lsp(int proto_isis); #endif /* _PACKET_ISIS_LSP_H */ diff --git a/packet-isis-snp.c b/packet-isis-snp.c index efe03175dc..b4ac0d39fe 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.14 2002/01/24 09:20:49 guy Exp $ + * $Id: packet-isis-snp.c,v 1.15 2002/04/07 22:36:55 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -55,15 +55,12 @@ static gint ett_isis_psnp_lsp_entries = -1; static gint ett_isis_psnp_authentication = -1; static gint ett_isis_psnp_clv_unknown = -1; -static void dissect_l1_snp_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, - int id_length, int length); -static void dissect_l2_snp_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, - int id_length, int length); -static void dissect_snp_lsp_entries(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, - int id_length, int length); +static void dissect_l1_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, + proto_tree *tree, int offset, int id_length, int length); +static void dissect_snp_lsp_entries(tvbuff_t *tvb, + proto_tree *tree, int offset, int id_length, int length); static const isis_clv_handle_t clv_l1_csnp_opts[] = { { @@ -173,7 +170,6 @@ static const isis_clv_handle_t clv_l2_psnp_opts[] = { * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to fill out. May be NULL * int : offset into packet data where we are. * int : length of payload to decode. @@ -183,12 +179,12 @@ static const isis_clv_handle_t clv_l2_psnp_opts[] = { * void, but we will add to proto tree if !NULL. */ static void -dissect_snp_lsp_entries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, int id_length, int length) +dissect_snp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset, + int id_length, int length) { while ( length > 0 ) { if ( length < 2+id_length+2+4+2 ) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "Short SNP header entry (%d vs %d)", length, 2+id_length+2+4+2 ); return; @@ -199,7 +195,7 @@ dissect_snp_lsp_entries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, length -= 2; offset += 2; - isis_lsp_decode_lsp_id(tvb, pinfo, tree, offset, + isis_lsp_decode_lsp_id(tvb, tree, offset, "LSP ID ", id_length); length -= id_length + 2; offset += id_length + 2; @@ -228,7 +224,6 @@ dissect_snp_lsp_entries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to add to. May be NULL. * int offset : our offset into packet data. * int : type (l1 csnp, l2 csnp) @@ -239,8 +234,8 @@ dissect_snp_lsp_entries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, int type, int header_length, int id_length) +isis_dissect_isis_csnp(tvbuff_t *tvb, proto_tree *tree, int offset, + int type, int header_length, int id_length) { proto_item *ti; proto_tree *csnp_tree = NULL; @@ -268,13 +263,13 @@ isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset += id_length + 1; if (tree) { - isis_lsp_decode_lsp_id(tvb, pinfo, csnp_tree, offset, + isis_lsp_decode_lsp_id(tvb, csnp_tree, offset, "Start LSP id ", id_length ); } offset += id_length + 2; if (tree) { - isis_lsp_decode_lsp_id(tvb, pinfo, csnp_tree, offset, + isis_lsp_decode_lsp_id(tvb, csnp_tree, offset, "End LSP id ", id_length ); } offset += id_length + 2; @@ -285,11 +280,11 @@ isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } /* Call into payload dissector */ if (type == ISIS_TYPE_L1_CSNP ) { - isis_dissect_clvs(tvb, pinfo, csnp_tree, offset, + isis_dissect_clvs(tvb, csnp_tree, offset, clv_l1_csnp_opts, len, id_length, ett_isis_csnp_clv_unknown ); } else { - isis_dissect_clvs(tvb, pinfo, csnp_tree, offset, + isis_dissect_clvs(tvb, csnp_tree, offset, clv_l2_csnp_opts, len, id_length, ett_isis_csnp_clv_unknown ); } @@ -304,7 +299,6 @@ isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : protocol display tree to add to. May be NULL. * int : our offset into packet data * int : type (l1 psnp, l2 psnp) @@ -315,8 +309,8 @@ isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * void, but we will add to proto tree if !NULL. */ void -isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, int type, int header_length, int id_length) +isis_dissect_isis_psnp(tvbuff_t *tvb, proto_tree *tree, int offset, + int type, int header_length, int id_length) { proto_item *ti; proto_tree *psnp_tree = NULL; @@ -345,18 +339,18 @@ isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, len = pdu_length - header_length; if (len < 0) { - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "packet header length %d went beyond packet", header_length ); return; } /* Call into payload dissector */ if (type == ISIS_TYPE_L1_CSNP ) { - isis_dissect_clvs(tvb, pinfo, psnp_tree, offset, + isis_dissect_clvs(tvb, psnp_tree, offset, clv_l1_csnp_opts, len, id_length, ett_isis_psnp_clv_unknown ); } else { - isis_dissect_clvs(tvb, pinfo, psnp_tree, offset, + isis_dissect_clvs(tvb, psnp_tree, offset, clv_l2_csnp_opts, len, id_length, ett_isis_psnp_clv_unknown ); } @@ -371,7 +365,6 @@ isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -381,11 +374,10 @@ isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * void, will modify proto_tree if not null. */ static void -dissect_l1_snp_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, +dissect_l1_snp_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_authentication_clv(tvb, pinfo, tree, offset, length, + isis_dissect_authentication_clv(tvb, tree, offset, length, "Per area authentication" ); } @@ -398,7 +390,6 @@ dissect_l1_snp_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, * * Input: * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : proto tree to build on (may be null) * int : current offset into packet data * int : length of IDs in packet. @@ -408,11 +399,10 @@ dissect_l1_snp_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, * void, will modify proto_tree if not null. */ static void -dissect_l2_snp_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, +dissect_l2_snp_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int id_length, int length) { - isis_dissect_authentication_clv(tvb, pinfo, tree, offset, length, + isis_dissect_authentication_clv(tvb, tree, offset, length, "Per domain authentication" ); } diff --git a/packet-isis-snp.h b/packet-isis-snp.h index 2fe5ba0ad2..fec39b847d 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.4 2001/12/20 07:33:21 guy Exp $ + * $Id: packet-isis-snp.h,v 1.5 2002/04/07 22:36:55 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -63,13 +63,11 @@ * 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, packet_info *pinfo, - proto_tree *tree, int offset, - int type, int header_length, int id_length); +extern void isis_dissect_isis_csnp(tvbuff_t *tvb, 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, packet_info *pinfo, - proto_tree *tree, int offset, - int type, int header_length, int id_length); +extern void isis_dissect_isis_psnp(tvbuff_t *tvb, proto_tree *tree, + int offset, int type, int header_length, int id_length); extern void isis_register_psnp(int proto_isis); #endif /* _PACKET_ISIS_CSNP_H */ diff --git a/packet-isis.c b/packet-isis.c index 3416b34b22..1c2caf6e05 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.30 2002/01/24 09:20:49 guy Exp $ + * $Id: packet-isis.c,v 1.31 2002/04/07 22:36:55 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -80,17 +80,17 @@ static const value_string isis_vals[] = { * * Input * tvbuff_t * : tvbuffer for packet data - * packet_info * : info for current packet * proto_tree * : tree of display data. May be NULL. * int : current offset into packet data * char * : format text + * subsequent args : arguments to format * * Output: * void (may modify proto tree) */ void -isis_dissect_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, char *fmat, ...) +isis_dissect_unknown(tvbuff_t *tvb, proto_tree *tree, int offset, + char *fmat, ...) { va_list ap; @@ -138,7 +138,7 @@ dissect_isis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Unknown ISIS version (%u vs %u)", isis_version, ISIS_REQUIRED_VERSION ); } - isis_dissect_unknown(tvb, pinfo, tree, 0, + isis_dissect_unknown(tvb, tree, 0, "Unknown ISIS version (%d vs %d)", isis_version, ISIS_REQUIRED_VERSION); return; @@ -225,26 +225,26 @@ 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, pinfo, isis_tree, offset, + isis_dissect_isis_hello(tvb, 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, pinfo, isis_tree, offset, + isis_dissect_isis_lsp(tvb, 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, pinfo, isis_tree, offset, + isis_dissect_isis_csnp(tvb, 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, pinfo, isis_tree, offset, + isis_dissect_isis_psnp(tvb, isis_tree, offset, isis_type, isis_header_length, isis_system_id_len); break; default: - isis_dissect_unknown(tvb, pinfo, tree, offset, + isis_dissect_unknown(tvb, tree, offset, "Unknown ISIS packet type"); } } /* dissect_isis */ diff --git a/packet-isis.h b/packet-isis.h index 4f1e7067f8..59018c8ddf 100644 --- a/packet-isis.h +++ b/packet-isis.h @@ -1,7 +1,7 @@ /* packet-isis.h * Defines and such for core isis protcol decode. * - * $Id: packet-isis.h,v 1.7 2001/07/02 02:09:26 guy Exp $ + * $Id: packet-isis.h,v 1.8 2002/04/07 22:36:55 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -21,8 +21,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * */ #ifndef _PACKET_ISIS_H @@ -56,7 +54,7 @@ */ extern char *isis_address_to_string(tvbuff_t *tvb, int offset, int len); -extern void isis_dissect_unknown(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, char *fmat, ...); +extern void isis_dissect_unknown(tvbuff_t *tvb, proto_tree *tree, int offset, + char *fmat, ...); #endif /* _PACKET_ISIS_H */