filter fix
[platform/upstream/libpcap.git] / pcap_activate.3pcap
1 .\" Copyright (c) 1994, 1996, 1997
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that: (1) source code distributions
6 .\" retain the above copyright notice and this paragraph in its entirety, (2)
7 .\" distributions including binary code include the above copyright notice and
8 .\" this paragraph in its entirety in the documentation or other materials
9 .\" provided with the distribution, and (3) all advertising materials mentioning
10 .\" features or use of this software display the following acknowledgement:
11 .\" ``This product includes software developed by the University of California,
12 .\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
13 .\" the University nor the names of its contributors may be used to endorse
14 .\" or promote products derived from this software without specific prior
15 .\" written permission.
16 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 .\"
20 .TH PCAP_ACTIVATE 3PCAP "21 September 2010"
21 .SH NAME
22 pcap_activate \- activate a capture handle
23 .SH SYNOPSIS
24 .nf
25 .ft B
26 #include <pcap/pcap.h>
27 .ft
28 .LP
29 .ft B
30 int pcap_activate(pcap_t *p);
31 .ft
32 .fi
33 .SH DESCRIPTION
34 .B pcap_activate()
35 is used to activate a packet capture handle to look
36 at packets on the network, with the options that were set on the handle
37 being in effect.
38 .SH RETURN VALUE
39 .B pcap_activate()
40 returns 0 on success without warnings,
41 .B PCAP_WARNING_PROMISC_NOTSUP
42 on success on a device that doesn't support promiscuous mode if
43 promiscuous mode was requested,
44 .B PCAP_WARNING_TSTAMP_TYPE_NOTSUP
45 on success if the time stamp type specified in a previous
46 .B pcap_set_tstamp_type()
47 call isn't supported by the capture source (the time stamp type is
48 left as the default),
49 .B PCAP_WARNING
50 on success with any other warning,
51 .B PCAP_ERROR_ACTIVATED
52 if the handle has already been activated,
53 .B PCAP_ERROR_NO_SUCH_DEVICE
54 if the capture source specified when the handle was created doesn't
55 exist,
56 .B PCAP_ERROR_PERM_DENIED
57 if the process doesn't have permission to open the capture source,
58 .B PCAP_ERROR_PROMISC_PERM_DENIED
59 if the process has permission to open the capture source but doesn't
60 have permission to put it into promiscuous mode,
61 .B PCAP_ERROR_RFMON_NOTSUP
62 if monitor mode was specified but the capture source doesn't support
63 monitor mode,
64 .B PCAP_ERROR_IFACE_NOT_UP
65 if the capture source is not up, and
66 .B PCAP_ERROR
67 if another error occurred.
68 If
69 .B PCAP_WARNING
70 or
71 .B PCAP_ERROR
72 is returned,
73 .B pcap_geterr()
74 or
75 .B pcap_perror()
76 may be called with
77 .I p
78 as an argument to fetch or display a message describing the warning or
79 error.
80 If
81 .BR PCAP_WARNING_PROMISC_NOTSUP ,
82 .BR PCAP_ERROR_NO_SUCH_DEVICE ,
83 or
84 .B PCAP_ERROR_PERM_DENIED
85 is returned,
86 .B pcap_geterr()
87 or
88 .B pcap_perror()
89 may be called with
90 .I p
91 as an argument to fetch or display an message giving additional details
92 about the problem that might be useful for debugging the problem if it's
93 unexpected.
94 .SH SEE ALSO
95 pcap(3PCAP)