summaryrefslogtreecommitdiff
path: root/wiretap/libpcap.h
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 /wiretap/libpcap.h
parent8efdf8a74c3f0c32a380d15aeed0a3f6aff56a29 (diff)
downloadwireshark-86bf1fc851b5564f5700a937de3213e8354aa52e.tar.gz
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 'wiretap/libpcap.h')
-rw-r--r--wiretap/libpcap.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/wiretap/libpcap.h b/wiretap/libpcap.h
new file mode 100644
index 0000000000..5de0a34e71
--- /dev/null
+++ b/wiretap/libpcap.h
@@ -0,0 +1,25 @@
+/* libpcap.h
+ *
+ * $Id: libpcap.h,v 1.1 1998/11/15 05:29:12 guy Exp $
+ *
+ * Wiretap Library
+ * Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+int libpcap_open(wtap *wth);
+int libpcap_read(wtap *wth);