diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2003-08-24 05:44:48 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2003-08-24 05:44:48 +0000 |
commit | f713d7da88ef480958992b5ac1f903358a815f6a (patch) | |
tree | 383db9acf5e57ca3d50c69fc0c6d8dcaf5ef08ce /tap-iousers.c | |
parent | 0f9440cb55b724e98843fd1855bfae6557c85021 (diff) | |
download | wireshark-f713d7da88ef480958992b5ac1f903358a815f6a.tar.gz wireshark-f713d7da88ef480958992b5ac1f903358a815f6a.tar.bz2 wireshark-f713d7da88ef480958992b5ac1f903358a815f6a.zip |
Update for the tethereal talkers to amke it support IPX.
Useage is -z talkers,ipx[,<filter>]
svn path=/trunk/; revision=8242
Diffstat (limited to 'tap-iousers.c')
-rw-r--r-- | tap-iousers.c | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/tap-iousers.c b/tap-iousers.c index 74da27903a..076bc5fe4c 100644 --- a/tap-iousers.c +++ b/tap-iousers.c @@ -1,7 +1,7 @@ /* tap-iousers.c * iostat 2003 Ronnie Sahlberg * - * $Id: tap-iousers.c,v 1.10 2003/08/24 04:58:31 sahlberg Exp $ + * $Id: tap-iousers.c,v 1.11 2003/08/24 05:44:38 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -39,6 +39,7 @@ #include "tap.h" #include "register.h" #include "packet-ip.h" +#include "packet-ipx.h" #include "packet-tcp.h" #include "packet-udp.h" #include "packet-eth.h" @@ -213,6 +214,53 @@ iousers_ip_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, v } static int +iousers_ipx_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, void *vipx) +{ + ipxhdr_t *ipxh=vipx; + address *addr1, *addr2; + io_users_item_t *iui; + + if(CMP_ADDRESS(&ipxh->ipx_src, &ipxh->ipx_dst)>0){ + addr1=&ipxh->ipx_src; + addr2=&ipxh->ipx_dst; + } else { + addr2=&ipxh->ipx_src; + addr1=&ipxh->ipx_dst; + } + + for(iui=iu->items;iui;iui=iui->next){ + if((!CMP_ADDRESS(&iui->addr1, addr1)) + &&(!CMP_ADDRESS(&iui->addr2, addr2)) ){ + break; + } + } + + if(!iui){ + iui=g_malloc(sizeof(io_users_item_t)); + iui->next=iu->items; + iu->items=iui; + COPY_ADDRESS(&iui->addr1, addr1); + iui->name1=strdup(address_to_str(addr1)); + COPY_ADDRESS(&iui->addr2, addr2); + iui->name2=strdup(address_to_str(addr2)); + iui->frames1=0; + iui->frames2=0; + iui->bytes1=0; + iui->bytes2=0; + } + + if(!CMP_ADDRESS(&ipxh->ipx_dst, &iui->addr1)){ + iui->frames1++; + iui->bytes1+=pinfo->fd->pkt_len; + } else { + iui->frames2++; + iui->bytes2+=pinfo->fd->pkt_len; + } + + return 1; +} + +static int iousers_fc_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, void *vfc) { fc_hdr *fchdr=vfc; @@ -445,6 +493,14 @@ iousers_init(char *optarg) } tap_type="tr"; packet_func=iousers_tr_packet; + } else if(!strncmp(optarg,"talkers,ipx",11)){ + if(optarg[11]==','){ + filter=optarg+12; + } else { + filter=NULL; + } + tap_type="ipx"; + packet_func=iousers_ipx_packet; } else if(!strncmp(optarg,"talkers,ip",10)){ if(optarg[10]==','){ filter=optarg+11; @@ -459,6 +515,7 @@ iousers_init(char *optarg) fprintf(stderr," \"eth\"\n"); fprintf(stderr," \"fc\"\n"); fprintf(stderr," \"ip\"\n"); + fprintf(stderr," \"ipx\"\n"); fprintf(stderr," \"tcp\"\n"); fprintf(stderr," \"tr\"\n"); fprintf(stderr," \"udp\"\n"); |