aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1998-11-15 05:29:17 +0000
committerGuy Harris <guy@alum.mit.edu>1998-11-15 05:29:17 +0000
commit86bf1fc851b5564f5700a937de3213e8354aa52e (patch)
tree46a497072e194a9ed5f20733549362347c4d6eef /capture.c
parent8efdf8a74c3f0c32a380d15aeed0a3f6aff56a29 (diff)
Add support to wiretap for reading Sun "snoop" capture files.
That requires that, in the packet-reading loop, we pass to the callback routine the offset in the file of a packet's data, because we can no longer compute that offset by subtracting the size of the captured packet data from the offset in the file after the data was read - "snoop" may stick padding in after the packet data to align packet headers on 4-byte boundaries. Doing that required that we arrange that we do that for "libpcap" capture files as well; the cleanest way to do that was to write our own code for reading "libpcap" capture files, rather than using the "libpcap" code to do it. Make "wtap_dispatch_cb()" and "pcap_dispatch_cb()" static to "file.c", as they're not used elsewhere. If we're using wiretap, don't define in "file.h" stuff used only when we're not using wiretap. Update the wiretap README to reflect Gilbert's and my recent changes. Clean up some memory leaks in "wiretap/lanalyzer.c" and "wiretap/ngsniffer.c", where the capture-file-format-specific data wasn't freed if the open failed. svn path=/trunk/; revision=91
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/capture.c b/capture.c
index d566496254..03320b858f 100644
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.8 1998/10/28 21:38:06 gerald Exp $
+ * $Id: capture.c,v 1.9 1998/11/15 05:28:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -126,7 +126,7 @@ get_interface_list() {
! strchr(ifr->ifr_name, ':')) {
il = g_list_append(il, g_strdup(ifr->ifr_name));
}
-#ifdef HAVE_SOCKADDR_SA_LEN
+#ifdef HAVE_SA_LEN
ifr = (struct ifreq *) ((char *) ifr + ifr->ifr_addr.sa_len + IFNAMSIZ);
#else
ifr = (struct ifreq *) ((char *) ifr + sizeof(struct ifreq));