Tvbuffified ISIS dissector, from Ronnie Sahlberg.

svn path=/trunk/; revision=3626
This commit is contained in:
Guy Harris 2001-07-02 00:19:34 +00:00
parent 6bdba27db5
commit 7ee4a18804
11 changed files with 950 additions and 922 deletions

View File

@ -536,6 +536,7 @@ Ronnie Sahlberg <rsahlber@bigpond.net.au> {
DVMRP support
MRDISC support
MSNIP support
Tvbuffified ISIS dissector
}
Borosa Tomislav <tomislav.borosa@SIEMENS.HR> {

View File

@ -1,7 +1,7 @@
/* packet-isis-clv.c
* Common CLV decode routines.
*
* $Id: packet-isis-clv.c,v 1.13 2001/06/23 19:45:12 guy Exp $
* $Id: packet-isis-clv.c,v 1.14 2001/07/02 00:19:34 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -56,31 +56,32 @@
* CLV is n, x byte hex strings.
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* frame_data * : frame data (complete frame)
* 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
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
isis_dissect_area_address_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree ) {
isis_dissect_area_address_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int length)
{
char *sbuf;
int mylen;
while ( length > 0 ) {
mylen = pd[offset];
mylen = tvb_get_guint8(tvb, offset);
length--;
if (length<=0) {
isis_dissect_unknown( offset, length, tree, fd,
isis_dissect_unknown(tvb, pinfo, tree, offset,
"short address (no length for payload)");
return;
}
if ( mylen > length) {
isis_dissect_unknown(offset, length, tree, fd,
isis_dissect_unknown(tvb, pinfo, tree, offset,
"short address, packet say %d, we have %d left",
mylen, length );
return;
@ -90,11 +91,11 @@ isis_dissect_area_address_clv(const u_char *pd, int offset,
* Lets turn the area address into "standard" 0000.0000.etc
* format string.
*/
/* sbuf = isis_address_to_string ( pd, offset + 1, mylen );*/
sbuf = print_nsap_net( pd + offset + 1, mylen );
/* sbuf = isis_address_to_string ( tvb, offset + 1, mylen );*/
sbuf = print_nsap_net( tvb_get_ptr(tvb, offset + 1, mylen), mylen );
/* and spit it out */
if ( tree ) {
proto_tree_add_text ( tree, NullTVB, offset, mylen + 1,
proto_tree_add_text ( tree, tvb, offset, mylen + 1,
"Area address (%d): %s", mylen, sbuf );
}
offset += mylen + 1;
@ -116,19 +117,20 @@ isis_dissect_area_address_clv(const u_char *pd, int offset,
* use to name this.
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* frame_data * : frame data (complete frame)
* 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
* char * : Password meaning
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
isis_dissect_authentication_clv(const u_char *pd, int offset, guint length,
frame_data *fd, proto_tree *tree, char *meaning) {
isis_dissect_authentication_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int length, char *meaning)
{
u_char pw_type;
char sbuf[300]; /* 255 + header info area */
char *s = sbuf;
@ -138,7 +140,8 @@ isis_dissect_authentication_clv(const u_char *pd, int offset, guint length,
return;
}
pw_type = pd[offset++];
pw_type = tvb_get_guint8(tvb, offset);
offset += 1;
length--;
auth_unsupported = FALSE;
@ -147,7 +150,7 @@ isis_dissect_authentication_clv(const u_char *pd, int offset, guint length,
s += sprintf ( s, "clear text (1), password (length %d) = ", length );
if ( length > 0 ) {
strncpy(s, &pd[offset], length);
strncpy(s, tvb_get_ptr(tvb, offset, length), length);
s[length] = 0;
} else {
strcat(s, "no clear-text password found!!!" );
@ -157,10 +160,12 @@ isis_dissect_authentication_clv(const u_char *pd, int offset, guint length,
s += sprintf ( s, "hmac-md5 (54), password (length %d) = ", length );
if ( length == 16 ) {
s += sprintf ( s, "0x%02x", pd[offset++] );
s += sprintf ( s, "0x%02x", tvb_get_guint8(tvb, offset) );
offset += 1;
length--;
while (length > 0) {
s += sprintf ( s, "%02x", pd[offset++] );
s += sprintf ( s, "%02x", tvb_get_guint8(tvb, offset) );
offset += 1;
length--;
}
s = 0;
@ -174,11 +179,11 @@ isis_dissect_authentication_clv(const u_char *pd, int offset, guint length,
break;
}
proto_tree_add_text ( tree, NullTVB, offset - 1, length + 1,
proto_tree_add_text ( tree, tvb, offset - 1, length + 1,
"%s %s", meaning, sbuf );
if ( auth_unsupported ) {
isis_dissect_unknown(offset, length, tree, fd,
isis_dissect_unknown(tvb, pinfo, tree, offset,
"Unknown authentication type" );
}
}
@ -191,12 +196,11 @@ isis_dissect_authentication_clv(const u_char *pd, int offset, guint length,
* pls note that the hostname is not null terminated
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* frame_data * : frame data (complete frame)
* tvbuff_t * : tvbuffer for packet data
* packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* char * : Password meaning
* 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.
@ -204,35 +208,29 @@ isis_dissect_authentication_clv(const u_char *pd, int offset, guint length,
void
isis_dissect_hostname_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree ) {
char sbuf[256*6];
char *s = sbuf;
int hlen = length;
int old_offset = offset;
isis_dissect_hostname_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int length)
{
if ( !tree ) return; /* nothing to do! */
memcpy ( s, &pd[offset], hlen);
sbuf[hlen] = 0; /* don't forget null termination */
if ( hlen == 0 ) {
sprintf ( sbuf, "--none--" );
if ( length == 0 ) {
proto_tree_add_text ( tree, tvb, offset, length,
"Hostname: --none--" );
} else {
proto_tree_add_text ( tree, tvb, offset, length,
"Hostname: %.*s", length,
tvb_get_ptr(tvb, offset, length) );
}
proto_tree_add_text ( tree, NullTVB, old_offset, hlen,
"Hostname: %s", sbuf );
}
void
isis_dissect_mt_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree, gint tree_id ) {
int mt_block;
isis_dissect_mt_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int length, int tree_id)
{
guint16 mt_block;
char mt_desc[60];
while (length>1) {
@ -241,7 +239,7 @@ isis_dissect_mt_clv(const u_char *pd, int offset,
if (length!=1)
{
/* fetch two bytes */
mt_block=(*(pd+offset)<<8)+(*(pd+offset+1));
mt_block=tvb_get_ntohs(tvb, offset);
/* mask out the lower 12 bits */
switch(mt_block&0x0fff) {
@ -263,7 +261,7 @@ isis_dissect_mt_clv(const u_char *pd, int offset,
default:
strcpy(mt_desc,"Reserved for IETF Consensus");
}
proto_tree_add_text ( tree, NullTVB, offset, 2 ,
proto_tree_add_text ( tree, tvb, offset, 2 ,
"%s Topology (0x%x)%s%s",
mt_desc,
mt_block&0xfff,
@ -271,7 +269,7 @@ isis_dissect_mt_clv(const u_char *pd, int offset,
(mt_block&0x4000) ? ", ATT bit set" : "" );
}
else {
proto_tree_add_text ( tree, NullTVB, offset, 1 ,
proto_tree_add_text ( tree, tvb, offset, 2 ,
"malformed MT-ID");
break;
}
@ -291,33 +289,36 @@ isis_dissect_mt_clv(const u_char *pd, int offset,
* addresses, plain and simple.
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* frame_data * : frame data (complete frame)
* tvbuff_t * : tvbuffer for packet data
* packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* gint : tree id to use for proto tree.
* int : offset into packet data where we are.
* int : length of clv we are decoding
* int : tree id to use for proto tree.
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
isis_dissect_ip_int_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree, gint tree_id ) {
isis_dissect_ip_int_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int length, int tree_id)
{
guint32 addr;
if ( length <= 0 ) {
return;
}
while ( length > 0 ) {
if ( length < 4 ) {
isis_dissect_unknown(offset, length, tree, fd,
isis_dissect_unknown(tvb, pinfo, tree, offset,
"Short ip interface address (%d vs 4)",length );
return;
}
memcpy(&addr, &pd[offset], sizeof(addr));
tvb_memcpy(tvb, (guint8 *)&addr, offset, sizeof(addr));
if ( tree ) {
proto_tree_add_ipv4(tree, tree_id, NullTVB, offset, 4, addr);
proto_tree_add_ipv4(tree, tree_id, tvb, offset, 4, addr);
}
offset += 4;
length -= 4;
@ -334,19 +335,20 @@ isis_dissect_ip_int_clv(const u_char *pd, int offset,
* addresses, plain and simple.
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* frame_data * : frame data (complete frame)
* tvbuff_t * : tvbuffer for packet data
* packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* gint : tree id to use for proto tree.
* int : offset into packet data where we are.
* int : length of clv we are decoding
* int : tree id to use for proto tree.
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
isis_dissect_ipv6_int_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree, gint tree_id ) {
isis_dissect_ipv6_int_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int length, int tree_id)
{
guint8 addr [16];
if ( length <= 0 ) {
@ -355,19 +357,20 @@ isis_dissect_ipv6_int_clv(const u_char *pd, int offset,
while ( length > 0 ) {
if ( length < 16 ) {
isis_dissect_unknown(offset, length, tree, fd,
isis_dissect_unknown(tvb, pinfo, tree, offset,
"Short IPv6 interface address (%d vs 16)",length );
return;
}
memcpy(addr, &pd[offset], sizeof(addr));
tvb_memcpy(tvb, addr, offset, sizeof(addr));
if ( tree ) {
proto_tree_add_ipv6(tree, tree_id, NullTVB, offset, 16, addr);
proto_tree_add_ipv6(tree, tree_id, tvb, offset, 16, addr);
}
offset += 16;
length -= 16;
}
}
/*
* Name: isis_dissect_te_router_id_clv()
*
@ -377,32 +380,34 @@ isis_dissect_ipv6_int_clv(const u_char *pd, int offset,
* only _one_ IP address is present
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* frame_data * : frame data (complete frame)
* tvbuff_t * : tvbuffer for packet data
* packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* gint : tree id to use for proto tree.
* int : offset into packet data where we are.
* int : length of clv we are decoding
* int : tree id to use for proto tree.
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
isis_dissect_te_router_id_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree, gint tree_id ) {
isis_dissect_te_router_id_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int length, int tree_id)
{
guint32 addr;
if ( length <= 0 ) {
return;
}
if ( length != 4 ) {
isis_dissect_unknown(offset, length, tree, fd,
isis_dissect_unknown(tvb, pinfo, tree, offset,
"malformed Traffic Engineering Router ID (%d vs 4)",length );
return;
}
memcpy(&addr, &pd[offset], sizeof(addr));
tvb_memcpy(tvb, (guint8 *)&addr, offset, sizeof(addr));
if ( tree ) {
proto_tree_add_ipv4(tree, tree_id, NullTVB, offset, 4, addr);
proto_tree_add_ipv4(tree, tree_id, tvb, offset, 4, addr);
}
}
@ -416,18 +421,19 @@ isis_dissect_te_router_id_clv(const u_char *pd, int offset,
* plus 1 for zero termination. We just just 256*6 for simplicity.
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* frame_data * : frame data (complete frame)
* 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
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
isis_dissect_nlpid_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree ) {
isis_dissect_nlpid_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int length)
{
char sbuf[256*6];
char *s = sbuf;
int hlen = length;
@ -440,7 +446,8 @@ isis_dissect_nlpid_clv(const u_char *pd, int offset,
s += sprintf ( s, ", " );
}
s += sprintf ( s, "%s (0x%02x)",
val_to_str(pd[offset], nlpid_vals, "Unknown"), pd[offset]);
val_to_str(tvb_get_guint8(tvb, offset), nlpid_vals,
"Unknown"), tvb_get_guint8(tvb, offset));
offset++;
}
@ -448,7 +455,7 @@ isis_dissect_nlpid_clv(const u_char *pd, int offset,
sprintf ( sbuf, "--none--" );
}
proto_tree_add_text ( tree, NullTVB, old_offset, hlen,
proto_tree_add_text ( tree, tvb, old_offset, hlen,
"NLPID(s): %s", sbuf );
}
@ -464,23 +471,24 @@ isis_dissect_nlpid_clv(const u_char *pd, int offset,
* "unknown" clv entrie 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
* and handlers (along with tree text and tree id's).
* int : length of CLV area.
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* frame_data * : frame data (complete frame)
* proto_tree * : protocol display tree to fill out. May be NULL
* gint : unknown clv tree id
* int : length of IDs in packet.
* int : unknown clv tree id
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
isis_dissect_clvs(const isis_clv_handle_t *opts, int len, int id_length,
const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
gint unknown_tree_id ) {
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,
int unknown_tree_id)
{
guint8 code;
guint8 length;
int q;
@ -490,12 +498,16 @@ isis_dissect_clvs(const isis_clv_handle_t *opts, int len, int id_length,
int adj;
while ( len > 0 ) {
code = pd[offset++];
length = pd[offset++];
code = tvb_get_guint8(tvb, offset);
offset += 1;
length = tvb_get_guint8(tvb, offset);
offset += 1;
adj = (sizeof(code) + sizeof(length) + length);
len -= adj;
if ( len < 0 || !BYTES_ARE_IN_FRAME(offset, length) ) {
isis_dissect_unknown(offset, adj, tree, fd,
if ( len < 0 ) {
isis_dissect_unknown(tvb, pinfo, tree, offset,
"Short CLV header (%d vs %d)",
adj, len + adj );
return;
@ -509,20 +521,20 @@ isis_dissect_clvs(const isis_clv_handle_t *opts, int len, int id_length,
/* adjust by 2 for code/len octets */
snprintf ( sbuf, sizeof(sbuf), "%s (%d)",
opts[q].tree_text, length );
ti = proto_tree_add_text(tree, NullTVB, offset - 2,
ti = proto_tree_add_text(tree, tvb, offset - 2,
length + 2, sbuf);
clv_tree = proto_item_add_subtree(ti,
*opts[q].tree_id );
} else {
clv_tree = NULL;
}
opts[q].dissect(pd, offset, length, id_length, fd,
clv_tree );
opts[q].dissect(tvb, pinfo, clv_tree, offset,
id_length, length);
} else {
if (tree) {
snprintf ( sbuf, sizeof(sbuf),
"Unknown code (%d:%d)", code, length );
ti = proto_tree_add_text(tree, NullTVB, offset - 2,
ti = proto_tree_add_text(tree, tvb, offset - 2,
length + 2, sbuf);
clv_tree = proto_item_add_subtree(ti,
unknown_tree_id );
@ -533,3 +545,4 @@ isis_dissect_clvs(const isis_clv_handle_t *opts, int len, int id_length,
offset += length;
}
}

View File

@ -1,7 +1,7 @@
/* packet-isis-clv.h
* Declares for common clv decoding functions.
*
* $Id: packet-isis-clv.h,v 1.6 2001/06/23 19:45:12 guy Exp $
* $Id: packet-isis-clv.h,v 1.7 2001/07/02 00:19:34 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -34,33 +34,38 @@ typedef struct {
int optcode; /* code for option */
char *tree_text; /* text for fold out */
gint *tree_id; /* id for add_item */
void (*dissect)(const u_char *pd, int offset, guint length,
int id_length, frame_data *fd, proto_tree *tree );
void (*dissect)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, int id_length, int length);
} isis_clv_handle_t;
/*
* Published API functions. NOTE, this are "local" API functions and
* are only valid from with isis decodes.
*/
extern void isis_dissect_clvs(const isis_clv_handle_t *opts, int len,
int id_length, const u_char *pd, int offset, frame_data *fd,
proto_tree *tree, int unknown_ett_handle );
extern void isis_dissect_area_address_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree );
extern void isis_dissect_metric(proto_tree *tree, int offset, guint8 value,
char *pstr, int force_supported, gint tree_id );
extern void isis_dissect_authentication_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree, char *meaning);
extern void isis_dissect_ip_int_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree, gint tree_id );
extern void isis_dissect_ipv6_int_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree, gint tree_id );
extern void isis_dissect_nlpid_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree );
extern void isis_dissect_hostname_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree );
extern void isis_dissect_mt_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree, gint tree_id );
extern void isis_dissect_te_router_id_clv(const u_char *pd, int offset,
guint length, frame_data *fd, proto_tree *tree, gint tree_id );
extern 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,
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_metric(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset,
guint8 value, char *pstr, int force_supported);
#endif /* _PACKET_ISIS_CLV_H */

View File

@ -1,7 +1,7 @@
/* packet-isis-hello.c
* Routines for decoding isis hello packets and their CLVs
*
* $Id: packet-isis-hello.c,v 1.18 2001/06/26 20:50:30 guy Exp $
* $Id: packet-isis-hello.c,v 1.19 2001/07/02 00:19:34 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -78,25 +78,33 @@ static const value_string isis_hello_circuit_type_vals[] = {
/*
* Predclare dissectors for use in clv dissection.
*/
static void dissect_hello_area_address_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree);
static void dissect_hello_is_neighbors_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree);
static void dissect_hello_padding_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree);
static void dissect_hello_nlpid_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree);
static void dissect_hello_ip_int_addr_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree);
static void dissect_hello_ipv6_int_addr_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree);
static void dissect_hello_auth_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree);
static void dissect_hello_ptp_adj_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree);
static void dissect_hello_mt_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree);
static void dissect_hello_padding_clv(tvbuff_t *tvb,
packet_info *pinfo, 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);
static void dissect_hello_ptp_adj_clv(tvbuff_t *tvb,
packet_info *pinfo, 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);
static void dissect_hello_auth_clv(tvbuff_t *tvb,
packet_info *pinfo, 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);
static void dissect_hello_ip_int_addr_clv(tvbuff_t *tvb,
packet_info *pinfo, 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);
static void dissect_hello_nlpid_clv(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, int offset,
int id_length, int length);
static const isis_clv_handle_t clv_l1_hello_opts[] = {
@ -296,20 +304,22 @@ static const isis_clv_handle_t clv_ptp_hello_opts[] = {
* clv common one.
*
* Input:
* u_char * : packet data
* int : current offset into packet data
* guint : length of this clv
* int : length of IDs in packet.
* frame_data * : frame data
* 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.
* int : length of this clv
*
* Output:
* void, will modify proto_tree if not null.
*/
static void
dissect_hello_nlpid_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree) {
isis_dissect_nlpid_clv(pd, offset, length, fd, tree );
dissect_hello_nlpid_clv(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, int offset,
int id_length, int length)
{
isis_dissect_nlpid_clv(tvb, pinfo, tree, offset, length);
}
/*
@ -320,21 +330,23 @@ dissect_hello_nlpid_clv(const u_char *pd, int offset,
* clv common one.
*
* Input:
* u_char * : packet data
* int : current offset into packet data
* guint : length of this clv
* int : length of IDs in packet.
* frame_data * : frame data
* 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.
* int : length of this clv
*
* Output:
* void, will modify proto_tree if not null.
*/
static void
dissect_hello_mt_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree) {
isis_dissect_mt_clv(pd, offset, length, fd, tree,
dissect_hello_mt_clv(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, int offset,
int id_length, int length)
{
isis_dissect_mt_clv(tvb, pinfo, tree, offset, length,
hf_isis_hello_clv_mt );
}
@ -346,20 +358,22 @@ dissect_hello_mt_clv(const u_char *pd, int offset,
* clv common one.
*
* Input:
* u_char * : packet data
* int : current offset into packet data
* guint : length of this clv
* int : length of IDs in packet.
* frame_data * : frame data
* 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.
* int : length of this clv
*
* Output:
* void, will modify proto_tree if not null.
*/
static void
dissect_hello_ip_int_addr_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree) {
isis_dissect_ip_int_clv(pd, offset, length, fd, tree,
dissect_hello_ip_int_addr_clv(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, int offset,
int id_length, int length)
{
isis_dissect_ip_int_clv(tvb, pinfo, tree, offset, length,
hf_isis_hello_clv_ipv4_int_addr );
}
@ -371,20 +385,22 @@ dissect_hello_ip_int_addr_clv(const u_char *pd, int offset,
* clv common one.
*
* Input:
* u_char * : packet data
* int : current offset into packet data
* guint : length of this clv
* int : length of IDs in packet.
* frame_data * : frame data
* 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.
* int : length of this clv
*
* Output:
* void, will modify proto_tree if not null.
*/
static void
dissect_hello_ipv6_int_addr_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree) {
isis_dissect_ipv6_int_clv(pd, offset, length, fd, tree,
dissect_hello_ipv6_int_addr_clv(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, int offset,
int id_length, int length)
{
isis_dissect_ipv6_int_clv(tvb, pinfo, tree, offset, length,
hf_isis_hello_clv_ipv6_int_addr );
}
@ -397,21 +413,23 @@ dissect_hello_ipv6_int_addr_clv(const u_char *pd, int offset,
* password.
*
* Input:
* u_char * : packet data
* int : current offset into packet data
* guint : length of this clv
* int : length of IDs in packet.
* frame_data * : frame data
* 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.
* int : length of this clv
*
* Output:
* void, will modify proto_tree if not null.
*/
static void
dissect_hello_auth_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree) {
isis_dissect_authentication_clv(pd, offset, length, fd, tree,
"authentication" );
dissect_hello_auth_clv(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, int offset,
int id_length, int length)
{
isis_dissect_authentication_clv(tvb, pinfo, tree, offset,
length, "authentication" );
}
/*
@ -422,29 +440,34 @@ dissect_hello_auth_clv(const u_char *pd, int offset,
* clv common one.
*
* Input:
* u_char * : packet data
* int : current offset into packet data
* guint : length of this clv
* int : length of IDs in packet.
* frame_data * : frame data
* 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.
* int : length of this clv
*
* Output:
* void, will modify proto_tree if not null.
*/
static void
dissect_hello_area_address_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree) {
isis_dissect_area_address_clv(pd, offset, length, fd, tree );
dissect_hello_area_address_clv(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, int offset,
int id_length, int length)
{
isis_dissect_area_address_clv(tvb, pinfo, tree, offset, length);
}
void
dissect_hello_ptp_adj_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree ) {
static void
dissect_hello_ptp_adj_clv(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, int offset,
int id_length, int length)
{
char adj_state[20];
switch((int)*(pd+offset)) {
switch(tvb_get_guint8(tvb, offset)) {
case 0:
strcpy(adj_state,"Up");
break;
@ -460,35 +483,35 @@ dissect_hello_ptp_adj_clv(const u_char *pd, int offset,
switch(length) {
case 1:
proto_tree_add_text ( tree, NullTVB, offset, 1,
proto_tree_add_text ( tree, tvb, offset, 1,
"Adjacency State: %s", adj_state );
break;
case 5:
proto_tree_add_text ( tree, NullTVB, offset, 1,
proto_tree_add_text ( tree, tvb, offset, 1,
"Adjacency State: %s", adj_state );
proto_tree_add_text ( tree, NullTVB, offset+1, 4,
"Extended Local Circuit ID: %d", (gint32)*(pd+offset+1) );
proto_tree_add_text ( tree, tvb, offset+1, 4,
"Extended Local Circuit ID: %u", tvb_get_ntohl(tvb, offset+1) );
break;
case 11:
proto_tree_add_text ( tree, NullTVB, offset, 1,
proto_tree_add_text ( tree, tvb, offset, 1,
"Adjacency State: %s", adj_state );
proto_tree_add_text ( tree, NullTVB, offset+1, 4,
"Extended Local Circuit ID: %d", (gint32)*(pd+offset+1) );
proto_tree_add_text ( tree, NullTVB, offset+5, 6,
"Neighbor System ID: %s", print_system_id( pd+offset+5, 6 ) );
proto_tree_add_text ( tree, tvb, offset+1, 4,
"Extended Local Circuit ID: %u", tvb_get_ntohl(tvb, offset+1) );
proto_tree_add_text ( tree, tvb, offset+5, 6,
"Neighbor System ID: %s", print_system_id( tvb_get_ptr(tvb, offset+5, 6), 6 ) );
break;
case 15:
proto_tree_add_text ( tree, NullTVB, offset, 1,
proto_tree_add_text ( tree, tvb, offset, 1,
"Adjacency State: %s", adj_state );
proto_tree_add_text ( tree, NullTVB, offset+1, 4,
"Extended Local Circuit ID: %d", (gint32)*(pd+offset+1) );
proto_tree_add_text ( tree, NullTVB, offset+5, 6,
"Neighbor System ID: %s", print_system_id( pd+offset+5, 6 ) );
proto_tree_add_text ( tree, NullTVB, offset+11, 4,
"Neighbor Extended Local Circuit ID: %d", (gint32)*(pd+offset+11) );
proto_tree_add_text ( tree, tvb, offset+1, 4,
"Extended Local Circuit ID: %u", tvb_get_ntohl(tvb, offset+1) );
proto_tree_add_text ( tree, tvb, offset+5, 6,
"Neighbor System ID: %s", print_system_id( tvb_get_ptr(tvb, offset+5, 6), 6 ) );
proto_tree_add_text ( tree, tvb, offset+11, 4,
"Neighbor Extended Local Circuit ID: %u", tvb_get_ntohl(tvb, offset+11) );
break;
default:
isis_dissect_unknown(offset, length, tree, fd,
isis_dissect_unknown(tvb, pinfo, tree, offset,
"malformed TLV (%d vs 1,5,11,15)", length );
return;
}
@ -502,23 +525,23 @@ dissect_hello_ptp_adj_clv(const u_char *pd, int offset,
* (they tend to be an 802.3 MAC address, but its not required).
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* int : length of IDs in packet.
* frame_data * : frame data (complete frame)
* tvbuff_t * : tvbuffer for packet data
* packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* gint : tree id to use for proto tree.
* int : offset into packet data where we are.
* int : length of IDs in packet.
* int : length of clv we are decoding
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
dissect_hello_is_neighbors_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree ) {
static void
dissect_hello_is_neighbors_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int id_length, int length)
{
while ( length > 0 ) {
if (length<6) {
isis_dissect_unknown(offset, length, tree, fd,
isis_dissect_unknown(tvb, pinfo, tree, offset,
"short is neighbor (%d vs 6)", length );
return;
}
@ -527,15 +550,14 @@ dissect_hello_is_neighbors_clv(const u_char *pd, int offset,
* format string.
*/
if ( tree ) {
proto_tree_add_text ( tree, NullTVB, offset, 6,
"IS Neighbor: %s", print_system_id( pd + offset, 6 ) );
proto_tree_add_text ( tree, tvb, offset, 6,
"IS Neighbor: %s", print_system_id( tvb_get_ptr(tvb, offset, 6), 6 ) );
}
offset += 6;
length -= 6;
}
}
/*
* Name: dissect_hello_padding_clv()
*
@ -544,22 +566,24 @@ dissect_hello_is_neighbors_clv(const u_char *pd, int offset,
* so we just return.
*
* Input:
* u_char * : packet data
* int : current offset into packet data
* guint : length of this clv
* int : length of IDs in packet.
* frame_data * : frame data
* 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.
* int : length of this clv
*
* Output:
* void
*/
static void
dissect_hello_padding_clv(const u_char *pd, int offset, guint length,
int id_length, frame_data *fd, proto_tree *tree) {
dissect_hello_padding_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int id_length, int length)
{
/* nothing to do here! */
}
/*
* Name: isis_dissect_isis_hello()
*
@ -569,100 +593,90 @@ dissect_hello_padding_clv(const u_char *pd, int offset, guint length,
* a shorter header.
*
* 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
* int : header length of packet.
* int : length of IDs in packet.
* u_char * : packet data
* int offset : our offset into packet data.
* frame_data * : frame data
* proto_tree * : protocol display tree to add to. May be NULL.
*
* Output:
* void, will modify proto_tree if not NULL.
*/
void
isis_dissect_isis_hello(int hello_type, int header_length, int id_length,
const u_char *pd, int offset, frame_data *fd, proto_tree *tree){
isis_dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, int hello_type, int header_length, int id_length)
{
proto_item *ti;
proto_tree *hello_tree = NULL;
int len;
int hlen;
guint16 pdu_length;
OLD_CHECK_DISPLAY_AS_DATA(proto_isis_hello, pd, offset, fd, tree);
if (hello_type == ISIS_TYPE_PTP_HELLO) {
hlen = 1+id_length+2+2+1;
} else {
hlen = 1+id_length+2+2+1+id_length+1;
}
if (!BYTES_ARE_IN_FRAME(offset, hlen)) {
isis_dissect_unknown(offset, hlen, tree, fd,
"not enough capture data for header (%d vs %d)",
hlen, END_OF_FRAME);
if (!proto_is_protocol_enabled(proto_isis_hello)) {
dissect_data(tvb, offset, pinfo, tree);
return;
}
if (tree) {
ti = proto_tree_add_item(tree, proto_isis_hello, NullTVB,
offset, END_OF_FRAME, FALSE);
ti = proto_tree_add_item(tree, proto_isis_hello, tvb,
offset, tvb_length_remaining(tvb, offset), FALSE);
hello_tree = proto_item_add_subtree(ti, ett_isis_hello);
proto_tree_add_uint_format(hello_tree,
hf_isis_hello_circuit_reserved,
NullTVB, offset, 1, pd[offset],
tvb, offset, 1, tvb_get_guint8(tvb, offset),
"Circuit type : %s, reserved(0x%02x == 0)",
val_to_str(pd[offset]&ISIS_HELLO_CTYPE_MASK,
val_to_str(tvb_get_guint8(tvb, offset)&ISIS_HELLO_CTYPE_MASK,
isis_hello_circuit_type_vals,
"Unknown (0x%x)"),
pd[offset]&ISIS_HELLO_CT_RESERVED_MASK
tvb_get_guint8(tvb, offset)&ISIS_HELLO_CT_RESERVED_MASK
);
}
offset += 1;
if (tree) {
proto_tree_add_bytes_format(hello_tree, hf_isis_hello_source_id, NullTVB,
offset, id_length, &pd[offset],
proto_tree_add_bytes_format(hello_tree, hf_isis_hello_source_id, tvb,
offset, id_length, tvb_get_ptr(tvb, offset, id_length),
"SystemID{ Sender of PDU } : %s",
print_system_id( pd + offset, id_length ) );
print_system_id( tvb_get_ptr(tvb, offset, id_length), id_length ) );
}
offset += id_length;
if (tree) {
proto_tree_add_uint(hello_tree, hf_isis_hello_holding_timer, NullTVB,
offset, 2, pntohs(&pd[offset]));
proto_tree_add_uint(hello_tree, hf_isis_hello_holding_timer, tvb,
offset, 2, tvb_get_ntohs(tvb, offset));
}
offset += 2;
pdu_length = pntohs(&pd[offset]);
pdu_length = tvb_get_ntohs(tvb, offset);
if (tree) {
proto_tree_add_uint(hello_tree, hf_isis_hello_pdu_length, NullTVB,
proto_tree_add_uint(hello_tree, hf_isis_hello_pdu_length, tvb,
offset, 2, pdu_length);
}
offset += 2;
if (hello_type == ISIS_TYPE_PTP_HELLO) {
if (tree) {
proto_tree_add_uint(hello_tree, hf_isis_hello_local_circuit_id, NullTVB,
offset, 1, pd[offset] );
proto_tree_add_uint(hello_tree, hf_isis_hello_local_circuit_id, tvb,
offset, 1, tvb_get_guint8(tvb, offset) );
}
offset += 1;
} else {
if (tree) {
proto_tree_add_uint_format(hello_tree, hf_isis_hello_priority_reserved, NullTVB,
offset, 1, pd[offset],
proto_tree_add_uint_format(hello_tree, hf_isis_hello_priority_reserved, tvb,
offset, 1, tvb_get_guint8(tvb, offset),
"Priority : %d, reserved(0x%02x == 0)",
pd[offset]&ISIS_HELLO_PRIORITY_MASK,
pd[offset]&ISIS_HELLO_P_RESERVED_MASK );
tvb_get_guint8(tvb, offset)&ISIS_HELLO_PRIORITY_MASK,
tvb_get_guint8(tvb, offset)&ISIS_HELLO_P_RESERVED_MASK );
}
offset += 1;
if (tree) {
proto_tree_add_bytes_format(hello_tree, hf_isis_hello_lan_id, NullTVB,
offset, id_length + 1, &pd[offset],
proto_tree_add_bytes_format(hello_tree, hf_isis_hello_lan_id, tvb,
offset, id_length + 1, tvb_get_ptr(tvb, offset, id_length+1),
"SystemID{ Designated IS } : %s",
print_system_id( pd + offset, id_length + 1 ) );
print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length + 1 ) );
}
offset += id_length + 1;
}
@ -670,7 +684,7 @@ isis_dissect_isis_hello(int hello_type, int header_length, int id_length,
len = pdu_length;
len -= header_length;
if (len < 0) {
isis_dissect_unknown(offset, header_length, tree, fd,
isis_dissect_unknown(tvb, pinfo, tree, offset,
"packet header length %d went beyond packet",
header_length );
return;
@ -680,14 +694,17 @@ isis_dissect_isis_hello(int hello_type, int header_length, int id_length,
* our list of valid ones!
*/
if (hello_type == ISIS_TYPE_L1_HELLO){
isis_dissect_clvs ( clv_l1_hello_opts, len, id_length, pd,
offset, fd, hello_tree, ett_isis_hello_clv_unknown );
isis_dissect_clvs(tvb, pinfo, 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 ( clv_l2_hello_opts, len, id_length, pd,
offset, fd, hello_tree, ett_isis_hello_clv_unknown );
isis_dissect_clvs(tvb, pinfo, hello_tree, offset,
clv_l2_hello_opts, len, id_length,
ett_isis_hello_clv_unknown);
} else {
isis_dissect_clvs ( clv_ptp_hello_opts, len, id_length, pd,
offset, fd, hello_tree, ett_isis_hello_clv_unknown );
isis_dissect_clvs(tvb, pinfo, hello_tree, offset,
clv_ptp_hello_opts, len, id_length,
ett_isis_hello_clv_unknown);
}
}

View File

@ -1,7 +1,7 @@
/* packet-isis-hello.h
* Declares for hello handling inside isis.
*
* $Id: packet-isis-hello.h,v 1.4 2001/06/23 19:45:12 guy Exp $
* $Id: packet-isis-hello.h,v 1.5 2001/07/02 00:19:34 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -97,7 +97,7 @@
* Published API functions. NOTE, this are "local" API functions and
* are only valid from with isis decodes.
*/
extern void isis_dissect_isis_hello(int hello_type, int header_length,
int id_length, const u_char *pd, int offset, frame_data *fd,
proto_tree *tree);
extern void isis_dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset,
int hello_type, int header_length,int id_length);
#endif /* _PACKET_ISIS_HELLO_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* packet-isis-lsp.h
* Defines and such for LSP and their CLV decodes
*
* $Id: packet-isis-lsp.h,v 1.8 2001/06/23 19:45:12 guy Exp $
* $Id: packet-isis-lsp.h,v 1.9 2001/07/02 00:19:34 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -110,10 +110,10 @@
* Published API functions. NOTE, this are "local" API functions and
* are only valid from with isis decodes.
*/
extern void isis_dissect_isis_lsp(int hello_type, int header_length,
int id_length, const u_char *pd, int offset, frame_data *fd,
proto_tree *tree);
extern void isis_lsp_decode_lsp_id(char *tstr, proto_tree *tree,
const u_char *pd, int offset, int id_length);
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);
#endif /* _PACKET_ISIS_LSP_H */

View File

@ -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.9 2001/06/18 02:17:47 guy Exp $
* $Id: packet-isis-snp.c,v 1.10 2001/07/02 00:19:34 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -60,12 +60,15 @@ 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_snp_lsp_entries(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree );
static void dissect_l1_snp_authentication_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree );
static void dissect_l2_snp_authentication_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree );
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 const isis_clv_handle_t clv_l1_csnp_opts[] = {
{
@ -174,46 +177,47 @@ static const isis_clv_handle_t clv_l2_psnp_opts[] = {
* 2 : checksum
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of payload to decode.
* int : length of IDs in packet.
* frame_data * : frame data (complete frame)
* 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.
* int : length of IDs in packet.
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
static void
dissect_snp_lsp_entries(const u_char *pd, int offset, guint length,
int id_length, frame_data *fd, proto_tree *tree ) {
dissect_snp_lsp_entries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, int id_length, int length)
{
while ( length > 0 ) {
if ( length < 2+id_length+2+4+2 ) {
isis_dissect_unknown(offset, length, tree, fd,
isis_dissect_unknown(tvb, pinfo, tree, offset,
"Short SNP header entry (%d vs %d)", length,
2+id_length+2+4+2 );
return;
}
proto_tree_add_text(tree, NullTVB, offset, 2, "Remaining life : %d",
pntohs(&pd[offset]));
proto_tree_add_text(tree, tvb, offset, 2, "Remaining life : %d",
tvb_get_ntohs(tvb, offset));
length -= 2;
offset += 2;
isis_lsp_decode_lsp_id( "LSP ID ", tree, pd,
offset, id_length);
isis_lsp_decode_lsp_id(tvb, pinfo, tree, offset,
"LSP ID ", id_length);
length -= id_length + 2;
offset += id_length + 2;
proto_tree_add_text(tree, NullTVB, offset, 4,
proto_tree_add_text(tree, tvb, offset, 4,
"LSP Sequence Number : 0x%04x",
pntohl(&pd[offset]));
tvb_get_ntohl(tvb, offset));
length -= 4;
offset += 4;
proto_tree_add_text(tree, NullTVB, offset, 2,
proto_tree_add_text(tree, tvb, offset, 2,
"LSP checksum : 0x%02x",
pntohs(&pd[offset]));
tvb_get_ntohs(tvb, offset));
length -= 2;
offset += 2;
}
@ -228,66 +232,60 @@ dissect_snp_lsp_entries(const u_char *pd, int offset, guint length,
* to pull apart the lsp id payload.
*
* 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)
* int : header length of packet.
* int : length of IDs in packet.
* u_char * : packet data
* int offset : our offset into packet data.
* frame_data * : frame data
* proto_tree * : protocol display tree to add to. May be NULL.
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
isis_dissect_isis_csnp(int type, int header_length, int id_length,
const u_char *pd, int offset, frame_data *fd, proto_tree *tree){
isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, int type, int header_length, int id_length)
{
proto_item *ti;
proto_tree *csnp_tree = NULL;
int hlen;
guint16 pdu_length;
int len;
OLD_CHECK_DISPLAY_AS_DATA(proto_isis_csnp, pd, offset, fd, tree);
hlen = 2+id_length+1+id_length+2+id_length+2;
if (!BYTES_ARE_IN_FRAME(offset, hlen)) {
isis_dissect_unknown(offset, hlen, tree, fd,
"not enough capture data for header (%d vs %d)",
hlen, END_OF_FRAME);
if (!proto_is_protocol_enabled(proto_isis_csnp)) {
dissect_data(tvb, offset, pinfo, tree);
return;
}
if (tree) {
ti = proto_tree_add_item(tree, proto_isis_csnp, NullTVB,
offset, END_OF_FRAME, FALSE);
ti = proto_tree_add_item(tree, proto_isis_csnp, tvb,
offset, tvb_length_remaining(tvb, offset), FALSE);
csnp_tree = proto_item_add_subtree(ti, ett_isis_csnp);
}
pdu_length = pntohs(&pd[offset]);
pdu_length = tvb_get_ntohs(tvb, offset);
if (tree) {
proto_tree_add_uint(csnp_tree, hf_isis_csnp_pdu_length, NullTVB,
proto_tree_add_uint(csnp_tree, hf_isis_csnp_pdu_length, tvb,
offset, 2, pdu_length);
}
offset += 2;
if (tree) {
proto_tree_add_text(csnp_tree, NullTVB, offset, id_length + 1,
proto_tree_add_text(csnp_tree, tvb, offset, id_length + 1,
"Source id : %s",
print_system_id( pd + offset, id_length + 1 ) );
print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length+1 ) );
}
offset += id_length + 1;
if (tree) {
isis_lsp_decode_lsp_id( "Start LSP id ", csnp_tree, pd, offset,
id_length );
isis_lsp_decode_lsp_id(tvb, pinfo, csnp_tree, offset,
"Start LSP id ", id_length );
}
offset += id_length + 2;
if (tree) {
isis_lsp_decode_lsp_id( "End LSP id ", csnp_tree, pd, offset,
id_length );
isis_lsp_decode_lsp_id(tvb, pinfo, csnp_tree, offset,
"End LSP id ", id_length );
}
offset += id_length + 2;
@ -297,11 +295,13 @@ isis_dissect_isis_csnp(int type, int header_length, int id_length,
}
/* Call into payload dissector */
if (type == ISIS_TYPE_L1_CSNP ) {
isis_dissect_clvs ( clv_l1_csnp_opts, len, id_length, pd,
offset, fd, csnp_tree, ett_isis_csnp_clv_unknown );
isis_dissect_clvs(tvb, pinfo, csnp_tree, offset,
clv_l1_csnp_opts, len, id_length,
ett_isis_csnp_clv_unknown );
} else {
isis_dissect_clvs ( clv_l2_csnp_opts, len, id_length, pd,
offset, fd, csnp_tree, ett_isis_csnp_clv_unknown );
isis_dissect_clvs(tvb, pinfo, csnp_tree, offset,
clv_l2_csnp_opts, len, id_length,
ett_isis_csnp_clv_unknown );
}
}
@ -313,71 +313,67 @@ isis_dissect_isis_csnp(int type, int header_length, int id_length,
* to pull apart the lsp id payload.
*
* 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)
* int : header length of packet.
* int : length of IDs in packet.
* u_char * : packet data
* int offset : our offset into packet data.
* frame_data * : frame data
* proto_tree * : protocol display tree to add to. May be NULL.
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
isis_dissect_isis_psnp(int type, int header_length, int id_length,
const u_char *pd, int offset, frame_data *fd, proto_tree *tree){
isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, int type, int header_length, int id_length)
{
proto_item *ti;
proto_tree *psnp_tree = NULL;
int hlen;
guint16 pdu_length;
int len;
OLD_CHECK_DISPLAY_AS_DATA(proto_isis_psnp, pd, offset, fd, tree);
hlen = 2+id_length+1;
if (!BYTES_ARE_IN_FRAME(offset, hlen)) {
isis_dissect_unknown(offset, hlen, tree, fd,
"not enough capture data for header (%d vs %d)",
hlen, END_OF_FRAME);
if (!proto_is_protocol_enabled(proto_isis_psnp)) {
dissect_data(tvb, offset, pinfo, tree);
return;
}
if (tree) {
ti = proto_tree_add_item(tree, proto_isis_psnp, NullTVB,
offset, END_OF_FRAME, FALSE);
ti = proto_tree_add_item(tree, proto_isis_psnp, tvb,
offset, tvb_length_remaining(tvb, offset), FALSE);
psnp_tree = proto_item_add_subtree(ti, ett_isis_psnp);
}
pdu_length = pntohs(&pd[offset]);
pdu_length = tvb_get_ntohs(tvb, offset);
if (tree) {
proto_tree_add_uint(psnp_tree, hf_isis_psnp_pdu_length, NullTVB,
proto_tree_add_uint(psnp_tree, hf_isis_psnp_pdu_length, tvb,
offset, 2, pdu_length);
}
offset += 2;
if (tree) {
proto_tree_add_text(psnp_tree, NullTVB, offset, id_length + 1,
proto_tree_add_text(psnp_tree, tvb, offset, id_length + 1,
"Source id: %s",
print_system_id( pd + offset, id_length + 1 ) );
print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length + 1 ) );
}
offset += id_length + 1;
len = pdu_length - header_length;
if (len < 0) {
isis_dissect_unknown(offset, header_length, tree, fd,
isis_dissect_unknown(tvb, pinfo, 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 ( clv_l1_csnp_opts, len, id_length, pd,
offset, fd, psnp_tree, ett_isis_psnp_clv_unknown );
isis_dissect_clvs(tvb, pinfo, psnp_tree, offset,
clv_l1_csnp_opts, len, id_length,
ett_isis_psnp_clv_unknown );
} else {
isis_dissect_clvs ( clv_l2_csnp_opts, len, id_length, pd,
offset, fd, psnp_tree, ett_isis_psnp_clv_unknown );
isis_dissect_clvs(tvb, pinfo, psnp_tree, offset,
clv_l2_csnp_opts, len, id_length,
ett_isis_psnp_clv_unknown );
}
}
@ -389,20 +385,22 @@ isis_dissect_isis_psnp(int type, int header_length, int id_length,
* clv common one. An auth inside a L1 SNP is a per area password
*
* Input:
* u_char * : packet data
* int : current offset into packet data
* guint : length of this clv
* int : length of IDs in packet.
* frame_data * : frame data
* 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.
* int : length of this clv
*
* Output:
* void, will modify proto_tree if not null.
*/
static void
dissect_l1_snp_authentication_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree) {
isis_dissect_authentication_clv(pd, offset, length, fd, tree,
dissect_l1_snp_authentication_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset,
int id_length, int length)
{
isis_dissect_authentication_clv(tvb, pinfo, tree, offset, length,
"Per area authentication" );
}
@ -414,20 +412,22 @@ dissect_l1_snp_authentication_clv(const u_char *pd, int offset,
* clv common one. An auth inside a L2 LSP is a per domain password
*
* Input:
* u_char * : packet data
* int : current offset into packet data
* guint : length of this clv
* int : length of IDs in packet.
* frame_data * : frame data
* 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.
* int : length of this clv
*
* Output:
* void, will modify proto_tree if not null.
*/
static void
dissect_l2_snp_authentication_clv(const u_char *pd, int offset,
guint length, int id_length, frame_data *fd, proto_tree *tree) {
isis_dissect_authentication_clv(pd, offset, length, fd, tree,
dissect_l2_snp_authentication_clv(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset,
int id_length, int length)
{
isis_dissect_authentication_clv(tvb, pinfo, tree, offset, length,
"Per domain authentication" );
}
@ -439,15 +439,6 @@ dissect_l2_snp_authentication_clv(const u_char *pd, int offset,
* NOTE: this procedure is autolinked by the makefile process that
* builds register.c
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* frame_data * : frame data (complete frame)
* proto_tree * : protocol display tree to fill out. May be NULL
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
proto_register_isis_csnp(void) {
@ -477,16 +468,6 @@ proto_register_isis_csnp(void) {
* Register our protocol sub-sets with protocol manager.
* NOTE: this procedure is autolinked by the makefile process that
* builds register.c
*
* Input:
* u_char * : packet data
* int : offset into packet data where we are.
* guint : length of clv we are decoding
* frame_data * : frame data (complete frame)
* proto_tree * : protocol display tree to fill out. May be NULL
*
* Output:
* void, but we will add to proto tree if !NULL.
*/
void
proto_register_isis_psnp(void) {

View File

@ -1,7 +1,7 @@
/* packet-isis-snp.h
* Defines and such for CSNP, PSNP, and their payloads
*
* $Id: packet-isis-snp.h,v 1.2 2000/06/19 08:33:50 guy Exp $
* $Id: packet-isis-snp.h,v 1.3 2001/07/02 00:19:34 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -66,9 +66,11 @@
* Published API functions. NOTE, this are "local" API functions and
* are only valid from with isis decodes.
*/
extern void isis_dissect_isis_csnp(int type, int header_length, int id_length,
const u_char *pd, int offset, frame_data *fd, proto_tree *tree);
extern void isis_dissect_isis_psnp(int type, int header_length, int id_length,
const u_char *pd, int offset, frame_data *fd, proto_tree *tree);
extern void isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset,
int type, int header_length, int id_length);
extern void isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset,
int type, int header_length, int id_length);
#endif /* _PACKET_ISIS_CSNP_H */

View File

@ -2,7 +2,7 @@
* Routines for ISO/OSI network and transport protocol packet disassembly, core
* bits.
*
* $Id: packet-isis.c,v 1.21 2001/06/18 02:17:48 guy Exp $
* $Id: packet-isis.c,v 1.22 2001/07/02 00:19:34 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -82,38 +82,27 @@ static const value_string isis_vals[] = {
* that we make sure we don't go off the end of the bleedin packet here!
*
* Input
* unt offset : Current offset into packet data.
* int len : length of to dump.
* tvbuff_t * : tvbuffer for packet data
* packet_info * : info for current packet
* proto_tree * : tree of display data. May be NULL.
* frame_data * fd : frame data
* int : current offset into packet data
* char * : format text
*
* Output:
* void (may modify proto tree)
*/
void
isis_dissect_unknown(int offset,guint length,proto_tree *tree,frame_data *fd,
char *fmat, ...){
isis_dissect_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, char *fmat, ...)
{
va_list ap;
if ( !IS_DATA_IN_FRAME(offset) ) {
/*
* big oops They were off the end of the packet already.
* Just ignore this one.
*/
return;
}
if ( !BYTES_ARE_IN_FRAME(offset, length) ) {
/*
* length will take us past eop. Truncate length.
*/
length = END_OF_FRAME;
}
va_start(ap, fmat);
proto_tree_add_text_valist(tree, NullTVB, offset, length, fmat, ap);
proto_tree_add_text_valist(tree, tvb, offset,
tvb_length_remaining(tvb, offset), fmat, ap);
va_end(ap);
}
/*
* Name: dissect_isis()
*
@ -122,71 +111,65 @@ isis_dissect_unknown(int offset,guint length,proto_tree *tree,frame_data *fd,
* main isis tree data and call the sub-protocols as needed.
*
* Input:
* u_char * : packet data
* int : offset into packet where we are (packet_data[offset]== start
* of what we care about)
* frame_data * : frame data (whole packet with extra info)
* tvbuff_t * : tvbuffer for packet data
* packet_info * : info for current packet
* proto_tree * : tree of display data. May be NULL.
*
* Output:
* void, but we will add to the proto_tree if it is not NULL.
*/
static void
dissect_isis(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree) {
isis_hdr_t *ihdr;
dissect_isis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
isis_hdr_t ihdr;
proto_item *ti;
proto_tree *isis_tree = NULL;
int id_length;
int offset = 0;
OLD_CHECK_DISPLAY_AS_DATA(proto_isis, pd, offset, fd, tree);
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "ISIS");
if (check_col(pinfo->fd, COL_INFO))
col_clear(pinfo->fd, COL_INFO);
if (check_col(fd, COL_PROTOCOL))
col_set_str(fd, COL_PROTOCOL, "ISIS");
tvb_memcpy(tvb, (guint8 *)&ihdr, offset, sizeof(isis_hdr_t));
if (!BYTES_ARE_IN_FRAME(offset, sizeof(*ihdr))) {
isis_dissect_unknown(offset, sizeof(*ihdr), tree, fd,
"not enough capture data for header (%d vs %d)",
sizeof(*ihdr), END_OF_FRAME);
return;
}
ihdr = (isis_hdr_t *) &pd[offset];
if (ihdr->isis_version != ISIS_REQUIRED_VERSION){
isis_dissect_unknown(offset, END_OF_FRAME, tree, fd,
if (ihdr.isis_version != ISIS_REQUIRED_VERSION){
isis_dissect_unknown(tvb, pinfo, tree, offset,
"Unknown ISIS version (%d vs %d)",
ihdr->isis_version, ISIS_REQUIRED_VERSION );
ihdr.isis_version, ISIS_REQUIRED_VERSION);
return;
}
if (tree) {
ti = proto_tree_add_item(tree, proto_isis, NullTVB, offset,
END_OF_FRAME, FALSE );
ti = proto_tree_add_item(tree, proto_isis, tvb, offset,
tvb_length_remaining(tvb, 0), FALSE );
isis_tree = proto_item_add_subtree(ti, ett_isis);
proto_tree_add_uint(isis_tree, hf_isis_irpd, NullTVB, offset, 1,
ihdr->isis_irpd );
proto_tree_add_uint(isis_tree, hf_isis_header_length, NullTVB,
offset + 1, 1, ihdr->isis_header_length );
proto_tree_add_uint(isis_tree, hf_isis_version, NullTVB,
offset + 2, 1, ihdr->isis_version );
proto_tree_add_uint(isis_tree, hf_isis_system_id_length, NullTVB,
offset + 3, 1, ihdr->isis_system_id_len );
proto_tree_add_uint_format(isis_tree, hf_isis_type, NullTVB,
offset + 4, 1, ihdr->isis_type,
proto_tree_add_uint(isis_tree, hf_isis_irpd, tvb, offset, 1,
ihdr.isis_irpd );
proto_tree_add_uint(isis_tree, hf_isis_header_length, tvb,
offset + 1, 1, ihdr.isis_header_length );
proto_tree_add_uint(isis_tree, hf_isis_version, tvb,
offset + 2, 1, ihdr.isis_version );
proto_tree_add_uint(isis_tree, hf_isis_system_id_length, tvb,
offset + 3, 1, ihdr.isis_system_id_len );
proto_tree_add_uint_format(isis_tree, hf_isis_type, tvb,
offset + 4, 1, ihdr.isis_type,
"PDU Type : %s (R:%s%s%s)",
val_to_str(ihdr->isis_type & ISIS_TYPE_MASK, isis_vals,
val_to_str(ihdr.isis_type & ISIS_TYPE_MASK, isis_vals,
"Unknown (0x%x)"),
(ihdr->isis_type & ISIS_R8_MASK) ? "1" : "0",
(ihdr->isis_type & ISIS_R7_MASK) ? "1" : "0",
(ihdr->isis_type & ISIS_R6_MASK) ? "1" : "0");
proto_tree_add_uint(isis_tree, hf_isis_version2, NullTVB,
offset + 5, 1, ihdr->isis_version2 );
proto_tree_add_uint(isis_tree, hf_isis_reserved, NullTVB,
offset + 6, 1, ihdr->isis_reserved );
proto_tree_add_uint(isis_tree, hf_isis_max_area_adr, NullTVB,
offset + 7, 1, ihdr->isis_max_area_adr );
(ihdr.isis_type & ISIS_R8_MASK) ? "1" : "0",
(ihdr.isis_type & ISIS_R7_MASK) ? "1" : "0",
(ihdr.isis_type & ISIS_R6_MASK) ? "1" : "0");
proto_tree_add_uint(isis_tree, hf_isis_version2, tvb,
offset + 5, 1, ihdr.isis_version2 );
proto_tree_add_uint(isis_tree, hf_isis_reserved, tvb,
offset + 6, 1, ihdr.isis_reserved );
proto_tree_add_uint(isis_tree, hf_isis_max_area_adr, tvb,
offset + 7, 1, ihdr.isis_max_area_adr );
}
@ -195,16 +178,16 @@ dissect_isis(const u_char *pd, int offset, frame_data *fd,
* here. First, dump the name into info column, and THEN
* dispatch the sub-type.
*/
if (check_col(fd, COL_INFO)) {
col_add_str(fd, COL_INFO, val_to_str (
ihdr->isis_type&ISIS_TYPE_MASK, isis_vals,
if (check_col(pinfo->fd, COL_INFO)) {
col_add_str(pinfo->fd, COL_INFO, val_to_str (
ihdr.isis_type&ISIS_TYPE_MASK, isis_vals,
"Unknown (0x%x)" ) );
}
/*
* Interpret the system ID length.
*/
id_length = ihdr->isis_system_id_len;
id_length = ihdr.isis_system_id_len;
if (id_length == 0)
id_length = 6; /* zero means 6-octet ID field length */
else if (id_length == 255) {
@ -216,56 +199,32 @@ dissect_isis(const u_char *pd, int offset, frame_data *fd,
/*
* Advance offset (we are past the header).
*/
offset += sizeof(*ihdr);
switch (ihdr->isis_type) {
offset += sizeof(ihdr);
switch (ihdr.isis_type) {
case ISIS_TYPE_L1_HELLO:
isis_dissect_isis_hello(ISIS_TYPE_L1_HELLO,
ihdr->isis_header_length, id_length,
pd, offset, fd, isis_tree);
break;
case ISIS_TYPE_L2_HELLO:
isis_dissect_isis_hello(ISIS_TYPE_L2_HELLO,
ihdr->isis_header_length, id_length,
pd, offset, fd, isis_tree);
break;
case ISIS_TYPE_PTP_HELLO:
isis_dissect_isis_hello(ISIS_TYPE_PTP_HELLO,
ihdr->isis_header_length, id_length,
pd, offset, fd, isis_tree);
isis_dissect_isis_hello(tvb, pinfo, isis_tree, offset,
ihdr.isis_type, ihdr.isis_header_length, id_length);
break;
case ISIS_TYPE_L1_LSP:
isis_dissect_isis_lsp(ISIS_TYPE_L1_LSP,
ihdr->isis_header_length, id_length,
pd, offset, fd, isis_tree);
break;
case ISIS_TYPE_L2_LSP:
isis_dissect_isis_lsp(ISIS_TYPE_L2_LSP,
ihdr->isis_header_length, id_length,
pd, offset, fd, isis_tree);
isis_dissect_isis_lsp(tvb, pinfo, isis_tree, offset,
ihdr.isis_type, ihdr.isis_header_length, id_length);
break;
case ISIS_TYPE_L1_CSNP:
isis_dissect_isis_csnp(ISIS_TYPE_L1_CSNP,
ihdr->isis_header_length, id_length,
pd, offset, fd, isis_tree);
break;
case ISIS_TYPE_L2_CSNP:
isis_dissect_isis_csnp(ISIS_TYPE_L2_CSNP,
ihdr->isis_header_length, id_length,
pd, offset, fd, isis_tree);
isis_dissect_isis_csnp(tvb, pinfo, isis_tree, offset,
ihdr.isis_type, ihdr.isis_header_length, id_length);
break;
case ISIS_TYPE_L1_PSNP:
isis_dissect_isis_psnp(ISIS_TYPE_L1_PSNP,
ihdr->isis_header_length, id_length,
pd, offset, fd, isis_tree);
break;
case ISIS_TYPE_L2_PSNP:
isis_dissect_isis_psnp(ISIS_TYPE_L2_PSNP,
ihdr->isis_header_length, id_length,
pd, offset, fd, isis_tree);
isis_dissect_isis_psnp(tvb, pinfo, isis_tree, offset,
ihdr.isis_type, ihdr.isis_header_length, id_length);
break;
default:
isis_dissect_unknown(offset, END_OF_FRAME, tree, fd,
"unknown ISIS packet type" );
isis_dissect_unknown(tvb, pinfo, tree, offset,
"Unknown ISIS packet type");
}
} /* dissect_isis */
@ -337,5 +296,5 @@ proto_register_isis(void) {
void
proto_reg_handoff_isis(void)
{
old_dissector_add("osinl", NLPID_ISO10589_ISIS, dissect_isis, proto_isis);
dissector_add("osinl", NLPID_ISO10589_ISIS, dissect_isis, proto_isis);
}

View File

@ -1,7 +1,7 @@
/* packet-isis.h
* Defines and such for core isis protcol decode.
*
* $Id: packet-isis.h,v 1.4 2000/04/17 01:36:31 guy Exp $
* $Id: packet-isis.h,v 1.5 2001/07/02 00:19:34 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -76,8 +76,8 @@ typedef struct {
* published API functions
*/
extern char *isis_address_to_string ( const u_char *pd, int offset, int len );
extern void isis_dissect_unknown( int offset, guint length, proto_tree *tree,
frame_data *fd, char *fmat, ...);
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, ...);
#endif /* _PACKET_ISIS_H */