aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-12-08 00:10:33 +0000
committerGuy Harris <guy@alum.mit.edu>2007-12-08 00:10:33 +0000
commit0ca5f6ace425dc26f77f656a3dbd3fd99646a3de (patch)
tree6b72ed45b60b729978f10061a0742e05df5badc2 /wiretap
parent947e70b4b72bf65c8ad5e29d5cc0d7353f031513 (diff)
downloadwireshark-0ca5f6ace425dc26f77f656a3dbd3fd99646a3de.tar.gz
wireshark-0ca5f6ace425dc26f77f656a3dbd3fd99646a3de.tar.bz2
wireshark-0ca5f6ace425dc26f77f656a3dbd3fd99646a3de.zip
Get rid of wtap_process_pcap_packet(); it's no longer used. Get rid of
no-longer-needed wiretap/wtap-capture.h. Clean up wiretap/libwiretap.vcproj (note: this isn't going to scale, if it has to contain a list of all the files, as most committers will be editing only Makefile.common files). svn path=/trunk/; revision=23803
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/Makefile.common1
-rw-r--r--wiretap/libpcap.c211
-rw-r--r--wiretap/libwiretap.vcproj8
-rw-r--r--wiretap/wtap-capture.h32
4 files changed, 0 insertions, 252 deletions
diff --git a/wiretap/Makefile.common b/wiretap/Makefile.common
index f1fe817d3a..8ef34201c6 100644
--- a/wiretap/Makefile.common
+++ b/wiretap/Makefile.common
@@ -110,7 +110,6 @@ NONGENERATED_HEADER_FILES = \
visual.h \
vms.h \
wtap.h \
- wtap-capture.h \
wtap-int.h
# Files that generate compileable files
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c
index 29adc69308..04cedf9029 100644
--- a/wiretap/libpcap.c
+++ b/wiretap/libpcap.c
@@ -34,17 +34,6 @@
#include "erf.h"
#include "libpcap.h"
-#ifdef HAVE_LIBPCAP
-#include <pcap.h>
-#endif
-
-#ifdef HAVE_LIBPCAP
-# ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-# endif
-#include "wtap-capture.h"
-#endif
-
/*
* Various pseudo-headers that appear at the beginning of packet data.
*
@@ -2265,206 +2254,6 @@ static int wtap_wtap_encap_to_pcap_encap(int encap)
return -1;
}
-#ifdef HAVE_LIBPCAP
-/*
- * Given a Wiretap encapsulation type, and raw packet data and the packet
- * header from libpcap, process any pseudo-header in the packet,
- * fill in the Wiretap packet header, and return a pointer to the
- * beginning of the non-pseudo-header data in the packet.
- */
-const guchar *
-wtap_process_pcap_packet(gint linktype, const struct pcap_pkthdr *phdr,
- const guchar *pd, union wtap_pseudo_header *pseudo_header,
- struct wtap_pkthdr *whdr, int *err)
-{
- guint size;
-
- /* "phdr->ts" may not necessarily be a "struct timeval" - it may
- be a "struct bpf_timeval", with member sizes wired to 32
- bits - and we may go that way ourselves in the future, so
- copy the members individually. */
- whdr->ts.secs = phdr->ts.tv_sec;
- whdr->ts.nsecs = phdr->ts.tv_usec * 1000;
- whdr->caplen = phdr->caplen;
- whdr->len = phdr->len;
- whdr->pkt_encap = linktype;
-
- /*
- * If this is an ATM packet, the first four bytes are the
- * direction of the packet (transmit/receive), the VPI, and
- * the VCI; read them and generate the pseudo-header from
- * them.
- */
- switch (linktype) {
-
- case WTAP_ENCAP_ATM_PDUS:
- if (whdr->caplen < SUNATM_LEN) {
- /*
- * Uh-oh, the packet isn't big enough to even
- * have a pseudo-header.
- */
- g_message("libpcap: SunATM capture has a %u-byte packet, too small to have even an ATM pseudo-header\n",
- whdr->caplen);
- *err = WTAP_ERR_BAD_RECORD;
- return NULL;
- }
- libpcap_get_sunatm_pseudoheader(pd, pseudo_header);
-
- /*
- * Don't count the pseudo-header as part of the packet.
- */
- whdr->len -= SUNATM_LEN;
- whdr->caplen -= SUNATM_LEN;
- pd += SUNATM_LEN;
-
- /*
- * If this is ATM LANE traffic, try to guess what type of
- * LANE traffic it is based on the packet contents.
- */
- if (pseudo_header->atm.type == TRAF_LANE)
- atm_guess_lane_type(pd, whdr->caplen, pseudo_header);
- break;
-
- case WTAP_ENCAP_IRDA:
- if (whdr->caplen < IRDA_SLL_LEN) {
- /*
- * Uh-oh, the packet isn't big enough to even
- * have a pseudo-header.
- */
- g_message("libpcap: IrDA capture has a %u-byte packet, too small to have even an IrDA pseudo-header\n",
- whdr->caplen);
- *err = WTAP_ERR_BAD_RECORD;
- return NULL;
- }
- if (!libpcap_get_irda_pseudoheader(pd, pseudo_header, err, NULL))
- return NULL;
-
- /*
- * Don't count the pseudo-header as part of the packet.
- */
- whdr->len -= IRDA_SLL_LEN;
- whdr->caplen -= IRDA_SLL_LEN;
- pd += IRDA_SLL_LEN;
- break;
-
- case WTAP_ENCAP_MTP2_WITH_PHDR:
- if (whdr->caplen < MTP2_HDR_LEN) {
- /*
- * Uh-oh, the packet isn't big enough to even
- * have a pseudo-header.
- */
- g_message("libpcap: MTP2 capture has a %u-byte packet, too small to have even an MTP2 pseudo-header\n",
- whdr->caplen);
- *err = WTAP_ERR_BAD_RECORD;
- return NULL;
- }
- if (!libpcap_get_mtp2_pseudoheader(pd, pseudo_header))
- return NULL;
-
- /*
- * Don't count the pseudo-header as part of the packet.
- */
- whdr->len -= MTP2_HDR_LEN;
- whdr->caplen -= MTP2_HDR_LEN;
- pd += MTP2_HDR_LEN;
- break;
-
- case WTAP_ENCAP_LINUX_LAPD:
- if (whdr->caplen < LAPD_SLL_LEN) {
- /*
- * Uh-oh, the packet isn't big enough to even
- * have a pseudo-header.
- */
- g_message("libpcap: LAPD capture has a %u-byte packet, too small to have even an LAPD pseudo-header\n",
- whdr->caplen);
- *err = WTAP_ERR_BAD_RECORD;
- return NULL;
- }
- if (!libpcap_get_lapd_pseudoheader(pd, pseudo_header, err, NULL))
- return NULL;
-
- /*
- * Don't count the pseudo-header as part of the packet.
- */
- whdr->len -= LAPD_SLL_LEN;
- whdr->caplen -= LAPD_SLL_LEN;
- pd += LAPD_SLL_LEN;
- break;
-
- case WTAP_ENCAP_USB_LINUX:
- if (whdr->caplen < sizeof (struct linux_usb_phdr)) {
- /*
- * Uh-oh, the packet isn't big enough to even
- * have a pseudo-header.
- */
- g_message("libpcap: Linux USB file has a %u-byte packet, too small to have even a LAPD pseudo-header\n",
- whdr->caplen);
- *err = WTAP_ERR_BAD_RECORD;
- return NULL;
- }
- /*
- * Don't count the pseudo-header as part of the packet.
- */
- whdr->len -= sizeof (struct linux_usb_phdr);
- whdr->caplen -= sizeof (struct linux_usb_phdr);
- pd += sizeof (struct linux_usb_phdr);
- break;
-
- case WTAP_ENCAP_ERF:
- if (whdr->caplen < sizeof(struct erf_phdr) ) {
- /*
- * Uh-oh, the packet isn't big enough to even
- * have a pseudo-header.
- */
- g_message("libpcap: ERF capture has a %u-byte packet, too small to have even an ERF pseudo-header\n",
- whdr->caplen);
- *err = WTAP_ERR_BAD_RECORD;
- return NULL;
- }
- if (!libpcap_get_erf_pseudoheader(pd, whdr, pseudo_header))
- return NULL;
-
- /*
- * Don't count the pseudo-header as part of the packet.
- */
- whdr->len -= sizeof(struct erf_phdr);
- whdr->caplen -= sizeof(struct erf_phdr);
- pd += sizeof(struct erf_phdr);
-
- if (!libpcap_get_erf_subheader(pd, pseudo_header, &size))
- return NULL;
-
- /*
- * Don't count the pseudo-header as part of the packet.
- */
- whdr->len -= size;
- whdr->caplen -= size;
- pd += size;
- break;
-
- case WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR:
- if (whdr->caplen < sizeof (struct libpcap_bt_phdr)) {
- /*
- * Uh-oh, the packet isn't big enough to even
- * have a pseudo-header.
- */
- g_message("libpcap: bluetooth file has a %u-byte packet, too small to have even a pseudo-header\n",
- whdr->caplen);
- *err = WTAP_ERR_BAD_RECORD;
- return NULL;
- }
- /*
- * Don't count the pseudo-header as part of the packet.
- */
- whdr->len -= sizeof (struct libpcap_bt_phdr);
- whdr->caplen -= sizeof (struct libpcap_bt_phdr);
- pd += sizeof (struct libpcap_bt_phdr);
- break;
- }
- return pd;
-}
-#endif
-
/* Returns 0 if we could write the specified encapsulation type,
an error indication otherwise. */
int libpcap_dump_can_write_encap(int encap)
diff --git a/wiretap/libwiretap.vcproj b/wiretap/libwiretap.vcproj
index c8713cdbca..3e45910cfe 100644
--- a/wiretap/libwiretap.vcproj
+++ b/wiretap/libwiretap.vcproj
@@ -254,10 +254,6 @@
>
</File>
<File
- RelativePath=".\config.h.win32"
- >
- </File>
- <File
RelativePath=".\cosine.h"
>
</File>
@@ -378,10 +374,6 @@
>
</File>
<File
- RelativePath=".\wtap-capture.h"
- >
- </File>
- <File
RelativePath=".\wtap-int.h"
>
</File>
diff --git a/wiretap/wtap-capture.h b/wiretap/wtap-capture.h
deleted file mode 100644
index 9b69799882..0000000000
--- a/wiretap/wtap-capture.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* wtap_capture.h
- *
- * $Id$
- *
- * Wiretap Library
- * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.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.
- */
-
-#ifndef __WTAP_CAPTURE_H__
-#define __WTAP_CAPTURE_H__
-
-/* XXX - needed until "wiretap" can do live packet captures */
-const guchar *wtap_process_pcap_packet(gint linktype,
- const struct pcap_pkthdr *phdr, const guchar *pd,
- union wtap_pseudo_header *pseudo_header, struct wtap_pkthdr *whdr,
- int *err);
-
-#endif /* __WTAP_CAPTURE_H__ */