1PCAP_CREATE(3PCAP)                                          PCAP_CREATE(3PCAP)
2
3
4

NAME

6       pcap_create - create a live capture handle
7

SYNOPSIS

9       #include <pcap/pcap.h>
10
11       char errbuf[PCAP_ERRBUF_SIZE];
12
13       pcap_t *pcap_create(const char *source, char *errbuf);
14

DESCRIPTION

16       pcap_create()  is  used  to  create  a packet capture handle to look at
17       packets on the network.  source is a string that specifies the  network
18       device  to  open;  on Linux systems with 2.2 or later kernels, a source
19       argument of "any" or NULL can be  used  to  capture  packets  from  all
20       interfaces.
21
22       The returned handle must be activated with pcap_activate() before pack‐
23       ets can be captured with it; options for the capture, such as promiscu‐
24       ous mode, can be set on the handle before activating it.
25

RETURN VALUE

27       pcap_create()  returns  a  pcap_t * on success and NULL on failure.  If
28       NULL is returned, errbuf is filled in with an  appropriate  error  mes‐
29       sage.   errbuf  is assumed to be able to hold at least PCAP_ERRBUF_SIZE
30       chars.
31

SEE ALSO

33       pcap(3PCAP), pcap_activate(3PCAP)
34
35
36
37                                 5 April 2008               PCAP_CREATE(3PCAP)
Impressum