Add a new AT_OSI address type.

In the CLNP dissector, set the source and destination network-layer and
"top-level" addresses; this will cause them to show up in the source and
destination columns of the summary display if you're showing the
network-layer or top-level address (although you'll probably have to
widen those columns significantly to see the entire address), and also
makes them available to subdissectors.

svn path=/trunk/; revision=3131
This commit is contained in:
Guy Harris 2001-03-15 06:41:13 +00:00
parent fceae9e370
commit a9659200c1
3 changed files with 17 additions and 8 deletions

View File

@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
* $Id: packet.c,v 1.20 2001/02/08 07:06:55 guy Exp $
* $Id: packet.c,v 1.21 2001/03/15 06:41:13 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -78,6 +78,7 @@
#include "packet-ipv6.h"
#include "packet-sna.h"
#include "packet-vines.h"
#include "packet-osi.h"
#include "resolv.h"
#include "tvbuff.h"
@ -842,6 +843,13 @@ col_set_addr(frame_data *fd, int col, address *addr, gboolean is_res)
fd->cinfo->col_data[col] = fd->cinfo->col_buf[col];
break;
case AT_OSI:
strncpy(fd->cinfo->col_buf[col], print_nsap_net(addr->data, addr->len),
COL_MAX_LEN);
fd->cinfo->col_buf[col][COL_MAX_LEN - 1] = '\0';
fd->cinfo->col_data[col] = fd->cinfo->col_buf[col];
break;
default:
break;
}

View File

@ -1,7 +1,7 @@
/* packet.h
* Definitions for packet disassembly structures and routines
*
* $Id: packet.h,v 1.22 2001/02/27 07:28:48 guy Exp $
* $Id: packet.h,v 1.23 2001/03/15 06:41:13 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -129,7 +129,8 @@ typedef enum {
AT_IPX, /* IPX */
AT_SNA, /* SNA */
AT_ATALK, /* Appletalk DDP */
AT_VINES /* Banyan Vines */
AT_VINES, /* Banyan Vines */
AT_OSI, /* OSI NSAP */
} address_type;
typedef struct _address {

View File

@ -1,7 +1,7 @@
/* packet-clnp.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
* $Id: packet-clnp.c,v 1.25 2001/03/13 21:34:23 gram Exp $
* $Id: packet-clnp.c,v 1.26 2001/03/15 06:41:12 guy Exp $
* Laurent Deniel <deniel@worldnet.fr>
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
@ -1703,10 +1703,10 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
opt_len -= dst_len + src_len +2;
}
if (check_col(pinfo->fd, COL_RES_NET_SRC))
col_add_fstr(pinfo->fd, COL_RES_NET_SRC, "%s", print_nsap_net(src_addr, src_len));
if (check_col(pinfo->fd, COL_RES_NET_DST))
col_add_fstr(pinfo->fd, COL_RES_NET_DST, "%s", print_nsap_net(dst_addr, dst_len));
SET_ADDRESS(&pinfo->net_src, AT_OSI, src_len, src_addr);
SET_ADDRESS(&pinfo->src, AT_OSI, src_len, src_addr);
SET_ADDRESS(&pinfo->net_dst, AT_OSI, dst_len, dst_addr);
SET_ADDRESS(&pinfo->dst, AT_OSI, dst_len, dst_addr);
/* Segmentation Part */