pcap.h File Reference

Go to the source code of this file.

Functions

Windows-specific Extensions
The functions in this section extend libpcap to offer advanced functionalities (like remote packet capture, packet buffer size variation or high-precision packet injection). Howerver, at the moment they can be used only in Windows.

PAirpcapHandle pcap_get_airpcap_handle (pcap_t *p)
 Returns the AirPcap handler associated with an adapter. This handler can be used to change the wireless-related settings of the CACE Technologies AirPcap wireless capture adapters.
bool pcap_offline_filter (struct bpf_program *prog, const struct pcap_pkthdr *header, const u_char *pkt_data)
 Returns if a given filter applies to an offline packet.
int pcap_live_dump (pcap_t *p, char *filename, int maxsize, int maxpacks)
 Save a capture to file.
int pcap_live_dump_ended (pcap_t *p, int sync)
 Return the status of the kernel dump process, i.e. tells if one of the limits defined with pcap_live_dump() has been reached.
struct pcap_statpcap_stats_ex (pcap_t *p, int *pcap_stat_size)
 Return statistics on current capture.
int pcap_setbuff (pcap_t *p, int dim)
 Set the size of the kernel buffer associated with an adapter.
int pcap_setmode (pcap_t *p, int mode)
 Set the working mode of the interface p to mode.
int pcap_setmintocopy (pcap_t *p, int size)
 Set the minumum amount of data received by the kernel in a single call.
HANDLE pcap_getevent (pcap_t *p)
 Return the handle of the event associated with the interface p.
pcap_send_queuepcap_sendqueue_alloc (u_int memsize)
 Allocate a send queue.
void pcap_sendqueue_destroy (pcap_send_queue *queue)
 Destroy a send queue.
int pcap_sendqueue_queue (pcap_send_queue *queue, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data)
 Add a packet to a send queue.
u_int pcap_sendqueue_transmit (pcap_t *p, pcap_send_queue *queue, int sync)
 Send a queue of raw packets to the network.
int pcap_findalldevs_ex (char *source, struct pcap_rmtauth *auth, pcap_if_t **alldevs, char *errbuf)
 Create a list of network devices that can be opened with pcap_open().
int pcap_createsrcstr (char *source, int type, const char *host, const char *port, const char *name, char *errbuf)
 Accept a set of strings (host name, port, ...), and it returns the complete source string according to the new format (e.g. 'rpcap://1.2.3.4/eth0').
int pcap_parsesrcstr (const char *source, int *type, char *host, char *port, char *name, char *errbuf)
 Parse the source string and returns the pieces in which the source can be split.
pcap_tpcap_open (const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf)
 Open a generic source in order to capture / send (WinPcap only) traffic.
struct pcap_samppcap_setsampling (pcap_t *p)
 Define a sampling method for packet capture.
SOCKET pcap_remoteact_accept (const char *address, const char *port, const char *hostlist, char *connectinghost, struct pcap_rmtauth *auth, char *errbuf)
 Block until a network connection is accepted (active mode only).
int pcap_remoteact_close (const char *host, char *errbuf)
 Drop an active connection (active mode only).
void pcap_remoteact_cleanup ()
 Clean the socket that is currently used in waiting active connections.
int pcap_remoteact_list (char *hostlist, char sep, int size, char *errbuf)
 Return the hostname of the host that have an active connection with us (active mode only).


documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2008 CACE Technologies. All rights reserved.