diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-04-30 18:58:16 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-04-30 18:58:16 +0000 |
commit | 105efda4044b2f031b1c36d666f7cb6b0221694f (patch) | |
tree | 33a4c7bd7deb9227ad48f5b8187c5f05419aa1e3 /wiretap/snoop.c | |
parent | da74615c7998037094df81255d4dd3d55e36ab47 (diff) | |
download | wireshark-105efda4044b2f031b1c36d666f7cb6b0221694f.tar.gz |
Move the code to guess the traffic type based on the packet contents
into Wiretap, so that if you read a frame from Wiretap you have what
traffic type information could be gleaned from the information in the
capture file, and can write the frame out to a capture file where the
file contains some or all of that information without having to
determine it outside of Wiretap.
svn path=/trunk/; revision=5314
Diffstat (limited to 'wiretap/snoop.c')
-rw-r--r-- | wiretap/snoop.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/wiretap/snoop.c b/wiretap/snoop.c index e3c81afb05..7d51201697 100644 --- a/wiretap/snoop.c +++ b/wiretap/snoop.c @@ -1,6 +1,6 @@ /* snoop.c * - * $Id: snoop.c,v 1.47 2002/04/30 09:23:29 guy Exp $ + * $Id: snoop.c,v 1.48 2002/04/30 18:58:16 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -28,6 +28,7 @@ #include "wtap-int.h" #include "file_wrappers.h" #include "buffer.h" +#include "atm.h" #include "snoop.h" #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> @@ -386,6 +387,16 @@ static gboolean snoop_read(wtap *wth, int *err, long *data_offset) wth->phdr.pkt_encap = wth->file_encap; /* + * If this is ATM LANE traffic, try to guess what type of LANE + * traffic it is based on the packet contents. + */ + if (wth->file_encap == WTAP_ENCAP_ATM_SNIFFER && + wth->pseudo_header.atm.type == TRAF_LANE) { + atm_guess_lane_type(buffer_start_ptr(wth->frame_buffer), + wth->phdr.caplen, &wth->pseudo_header); + } + + /* * Skip over the padding (don't "fseek()", as the standard * I/O library on some platforms discards buffered data if * you do that, which means it does a lot more reads). |