2005-12-06 00:07:13 +00:00
|
|
|
/* capture-pcap-util.h
|
2004-07-18 00:24:25 +00:00
|
|
|
* Utility definitions for packet capture
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-07-18 00:24:25 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2010-03-04 01:12:04 +00:00
|
|
|
#ifndef __CAPTURE_PCAP_UTIL_H__
|
|
|
|
#define __CAPTURE_PCAP_UTIL_H__
|
2004-07-18 00:24:25 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_LIBPCAP
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2006-02-17 02:18:48 +00:00
|
|
|
#include <pcap.h>
|
|
|
|
|
2004-07-18 00:24:25 +00:00
|
|
|
/*
|
2009-02-23 19:00:30 +00:00
|
|
|
* A snapshot length of 0 is useless - and libpcap/WinPcap don't guarantee
|
|
|
|
* that a snapshot length of 0 will work, and, on some platforms, it won't
|
|
|
|
* (with BPF, for example, the kernel is told the snapshot length via the
|
|
|
|
* return value of the BPF program, and a return value of 0 means "drop
|
|
|
|
* the packet"), so the minimum packet size is 1 byte.
|
2004-07-18 00:24:25 +00:00
|
|
|
*/
|
2009-02-23 19:00:30 +00:00
|
|
|
#define MIN_PACKET_SIZE 1 /* minimum amount of packet data we can read */
|
2004-07-18 00:24:25 +00:00
|
|
|
|
2007-01-21 23:45:36 +00:00
|
|
|
GList *get_interface_list(int *err, char **err_str);
|
2007-12-04 11:19:29 +00:00
|
|
|
#ifdef HAVE_PCAP_REMOTE
|
|
|
|
GList *get_remote_interface_list(const char *hostname, const char *port,
|
|
|
|
int auth_type, const char *username,
|
|
|
|
const char *passwd, int *err, char **err_str);
|
|
|
|
#endif
|
2004-07-18 00:24:25 +00:00
|
|
|
|
2006-02-17 02:18:48 +00:00
|
|
|
const char *linktype_val_to_name(int dlt);
|
|
|
|
int linktype_name_to_val(const char *linktype);
|
|
|
|
|
2004-07-18 00:24:25 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* HAVE_LIBPCAP */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Append to a GString an indication of the version of libpcap/WinPcap
|
|
|
|
* with which we were compiled, if we were, or an indication that we
|
|
|
|
* weren't compiled with libpcap/WinPcap, if we weren't.
|
|
|
|
*/
|
|
|
|
extern void get_compiled_pcap_version(GString *str);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Append to a GString an indication of the version of libpcap/WinPcap
|
|
|
|
* with which we're running, or an indication that we're not running
|
|
|
|
* with libpcap/WinPcap, if we were compiled with libpcap/WinPcap,
|
|
|
|
* or nothing, if we weren't compiled with libpcap/WinPcap.
|
|
|
|
*/
|
|
|
|
extern void get_runtime_pcap_version(GString *str);
|
|
|
|
|
2010-03-04 01:12:04 +00:00
|
|
|
#endif /* __CAPTURE_PCAP_UTIL_H__ */
|