Move the Linux Bluetooth and USB declarations to a header file.
Clean up some comments. Protect all references to the USB stuff from the common Linux code with PCAP_SUPPORT_USB, just as references to the Bluetooth code are protected with PCAP_SUPPORT_BT.
This commit is contained in:
parent
50ce2663e8
commit
455aff8ba9
2
FILES
2
FILES
|
@ -82,6 +82,7 @@ pcap/usb.h
|
|||
pcap-bpf.c
|
||||
pcap-bpf.h
|
||||
pcap-bt-linux.c
|
||||
pcap-bt-linux.h
|
||||
pcap-dag.c
|
||||
pcap-dag.h
|
||||
pcap-dlpi.c
|
||||
|
@ -102,6 +103,7 @@ pcap-stdinc.h
|
|||
pcap-snit.c
|
||||
pcap-snoop.c
|
||||
pcap-usb-linux.c
|
||||
pcap-usb-linux.h
|
||||
pcap-win32.c
|
||||
pcap.3
|
||||
pcap.c
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.17 2006-10-13 17:36:41 guy Exp $ (LBL)
|
||||
@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.18 2006-10-13 17:46:45 guy Exp $ (LBL)
|
||||
|
||||
To build libpcap, run "./configure" (a shell script). The configure
|
||||
script will determine your system attributes and generate an
|
||||
|
@ -358,6 +358,7 @@ pcap/usb.h - public definition of DLT_USB headeer
|
|||
pcap-bpf.c - BSD Packet Filter support
|
||||
pcap-bpf.h - header for backwards compatibility
|
||||
pcap-bt-linux.c - Bluetooth capture support for Linux
|
||||
pcap-bt-linux.h - Bluetooth capture support for Linux
|
||||
pcap-dag.c - Endace DAG device capture support
|
||||
pcap-dag.h - Endace DAG device capture support
|
||||
pcap-dlpi.c - Data Link Provider Interface support
|
||||
|
@ -378,6 +379,7 @@ pcap-stdinc.h - includes and #defines for compiling on Win32 systems
|
|||
pcap-snit.c - SunOS 4.x STREAMS-based Network Interface Tap support
|
||||
pcap-snoop.c - IRIX Snoop network monitoring support
|
||||
pcap-usb-linux.c - USB capture support for Linux
|
||||
pcap-usb-linux.h - USB capture support for Linux
|
||||
pcap-win32.c - WinPcap capture support
|
||||
pcap.3 - manual entry
|
||||
pcap.c - pcap utility routines
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* USB sniffig API implementation for linux platform
|
||||
* Bluetooth sniffing API implementation for Linux platform
|
||||
* By Paolo Abeni <paolo.abeni@email.com>
|
||||
*
|
||||
*/
|
||||
|
@ -38,6 +38,7 @@
|
|||
#endif
|
||||
|
||||
#include "pcap-int.h"
|
||||
#include "pcap-bt-linux.h"
|
||||
|
||||
#ifdef NEED_STRERROR_H
|
||||
#include "strerror.h"
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
|
||||
* Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Politecnico di Torino, CACE Technologies
|
||||
* nor the names of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Bluetooth sniffing API implementation for Linux platform
|
||||
* By Paolo Abeni <paolo.abeni@email.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Prototypes for Bluetooth-related functions
|
||||
*/
|
||||
int bt_platform_finddevs(pcap_if_t **alldevsp, char *err_str);
|
||||
pcap_t* bt_open_live(const char* bus, int snaplen, int promisc , int to_ms, char* errmsg);
|
30
pcap-linux.c
30
pcap-linux.c
|
@ -27,7 +27,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static const char rcsid[] _U_ =
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.127 2006-10-13 17:34:53 guy Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.128 2006-10-13 17:46:46 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -87,6 +87,14 @@ static const char rcsid[] _U_ =
|
|||
#ifdef HAVE_SEPTEL_API
|
||||
#include "pcap-septel.h"
|
||||
#endif /* HAVE_SEPTEL_API */
|
||||
|
||||
#ifdef PCAP_SUPPORT_USB
|
||||
#include "pcap-usb-linux.h"
|
||||
#endif
|
||||
|
||||
#ifdef PCAP_SUPPORT_BT
|
||||
#include "pcap-bt-linux.h"
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -184,23 +192,6 @@ typedef int socklen_t;
|
|||
*/
|
||||
#define BIGGER_THAN_ALL_MTUS (64*1024)
|
||||
|
||||
#ifdef PCAP_SUPPORT_USB
|
||||
/*
|
||||
* Prototypes for USB-related functions
|
||||
*/
|
||||
int usb_platform_finddevs(pcap_if_t **alldevsp, char *err_str);
|
||||
pcap_t* usb_open_live(const char* bus, int snaplen, int promisc , int to_ms, char* errmsg);
|
||||
#endif
|
||||
|
||||
#ifdef PCAP_SUPPORT_BT
|
||||
/*
|
||||
* Prototypes for Bluetooth-related functions
|
||||
*/
|
||||
int bt_platform_finddevs(pcap_if_t **alldevsp, char *err_str);
|
||||
pcap_t* bt_open_live(const char* bus, int snaplen, int promisc , int to_ms, char* errmsg);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes for internal functions
|
||||
*/
|
||||
|
@ -278,10 +269,11 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef PCAP_SUPPORT_USB
|
||||
if (strstr(device, "usb")) {
|
||||
return usb_open_live(device, snaplen, promisc, to_ms, ebuf);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Allocate a handle for this session. */
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* USB sniffig API implementation for linux platform
|
||||
* USB sniffing API implementation for Linux platform
|
||||
* By Paolo Abeni <paolo.abeni@email.com>
|
||||
*
|
||||
*/
|
||||
|
@ -39,6 +39,7 @@
|
|||
#endif
|
||||
|
||||
#include "pcap-int.h"
|
||||
#include "pcap-usb-linux.h"
|
||||
#include "pcap/usb.h"
|
||||
|
||||
#ifdef NEED_STRERROR_H
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
|
||||
* Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Politecnico di Torino, CACE Technologies
|
||||
* nor the names of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* USB sniffing API implementation for Linux platform
|
||||
* By Paolo Abeni <paolo.abeni@email.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Prototypes for USB-related functions
|
||||
*/
|
||||
int usb_platform_finddevs(pcap_if_t **alldevsp, char *err_str);
|
||||
pcap_t* usb_open_live(const char* bus, int snaplen, int promisc , int to_ms, char* errmsg);
|
Reference in New Issue