1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>WinPcap: pcap.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>pcap.h File Reference</h1>
<p><a href="funcs_2pcap_8h_source.html">Go to the source code of this file.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Windows-specific Extensions</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrp06003dbc75790df77036476ed55327c8"></a> 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. </p>
<br/><br/></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="Win32-Extensions_8h.html#aadfdcc0e37082d8f6b28a43ec9a0bccf">PAirpcapHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga4c8f8d1b9238c74faa156494a6b98670">pcap_get_airpcap_handle</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">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. <a href="group__wpcapfunc.html#ga4c8f8d1b9238c74faa156494a6b98670"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gae92f11bfb001c19b2d0fbcd6821d222a">pcap_offline_filter</a> (struct bpf_program *prog, const struct <a class="el" href="structpcap__pkthdr.html">pcap_pkthdr</a> *header, const u_char *pkt_data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns if a given filter applies to an offline packet. <a href="group__wpcapfunc.html#gae92f11bfb001c19b2d0fbcd6821d222a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gaedef54159d918b22a7de8e75b8a3ef4d">pcap_live_dump</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, char *filename, int maxsize, int maxpacks)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a capture to file. <a href="group__wpcapfunc.html#gaedef54159d918b22a7de8e75b8a3ef4d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gafe8a334f3a7ae2dc7f52e96523da39be">pcap_live_dump_ended</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int sync)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the status of the kernel dump process, i.e. tells if one of the limits defined with <a class="el" href="group__wpcapfunc.html#gaedef54159d918b22a7de8e75b8a3ef4d" title="Save a capture to file.">pcap_live_dump()</a> has been reached. <a href="group__wpcapfunc.html#gafe8a334f3a7ae2dc7f52e96523da39be"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structpcap__stat.html">pcap_stat</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga8050f7829956aabd243cc32b3cfabbd6">pcap_stats_ex</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int *pcap_stat_size)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return statistics on current capture. <a href="group__wpcapfunc.html#ga8050f7829956aabd243cc32b3cfabbd6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga124bde25ccd9e39017ff2abec2dda623">pcap_setbuff</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int dim)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the size of the kernel buffer associated with an adapter. <a href="group__wpcapfunc.html#ga124bde25ccd9e39017ff2abec2dda623"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gaef07ef49d3c75644f3fd34518e2fe720">pcap_setmode</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int mode)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the working mode of the interface p to mode. <a href="group__wpcapfunc.html#gaef07ef49d3c75644f3fd34518e2fe720"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gab14ceacbf1c2f63026416dd73f80dc0d">pcap_setmintocopy</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int size)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the minumum amount of data received by the kernel in a single call. <a href="group__wpcapfunc.html#gab14ceacbf1c2f63026416dd73f80dc0d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">HANDLE </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga2c415e9192c7b18a81a02300ae6f2c02">pcap_getevent</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the handle of the event associated with the interface p. <a href="group__wpcapfunc.html#ga2c415e9192c7b18a81a02300ae6f2c02"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structpcap__send__queue.html">pcap_send_queue</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gab940e69631b7cc7f2232a69ea02b86d9">pcap_sendqueue_alloc</a> (u_int memsize)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocate a send queue. <a href="group__wpcapfunc.html#gab940e69631b7cc7f2232a69ea02b86d9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga72624f7a9932cc2124abf661001e0aa4">pcap_sendqueue_destroy</a> (<a class="el" href="structpcap__send__queue.html">pcap_send_queue</a> *queue)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy a send queue. <a href="group__wpcapfunc.html#ga72624f7a9932cc2124abf661001e0aa4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga4c57ea320d71dbfe55c5665af9db1297">pcap_sendqueue_queue</a> (<a class="el" href="structpcap__send__queue.html">pcap_send_queue</a> *queue, const struct <a class="el" href="structpcap__pkthdr.html">pcap_pkthdr</a> *pkt_header, const u_char *pkt_data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a packet to a send queue. <a href="group__wpcapfunc.html#ga4c57ea320d71dbfe55c5665af9db1297"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u_int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gaa4d55eb047a1cccc0e28397ce04ee097">pcap_sendqueue_transmit</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, <a class="el" href="structpcap__send__queue.html">pcap_send_queue</a> *queue, int sync)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Send a queue of raw packets to the network. <a href="group__wpcapfunc.html#gaa4d55eb047a1cccc0e28397ce04ee097"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga98f36e62c95c6ad81eaa8b2bbeb8f16e">pcap_findalldevs_ex</a> (char *source, struct <a class="el" href="structpcap__rmtauth.html">pcap_rmtauth</a> *auth, <a class="el" href="structpcap__if.html">pcap_if_t</a> **alldevs, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a list of network devices that can be opened with <a class="el" href="group__wpcapfunc.html#ga2b64c7b6490090d1d37088794f1f1791" title="Open a generic source in order to capture / send (WinPcap only) traffic.">pcap_open()</a>. <a href="group__wpcapfunc.html#ga98f36e62c95c6ad81eaa8b2bbeb8f16e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gaa3111e10f930a9772a32a922b26948b0">pcap_createsrcstr</a> (char *source, int type, const char *<a class="el" href="wpcap__remote_8htm.html#a3c46d79c790748a5942fb43baa6b3073">host</a>, const char *port, const char *name, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">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'). <a href="group__wpcapfunc.html#gaa3111e10f930a9772a32a922b26948b0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga090e0afd3f463b4b60a64c47eddc1ba2">pcap_parsesrcstr</a> (const char *source, int *type, char *<a class="el" href="wpcap__remote_8htm.html#a3c46d79c790748a5942fb43baa6b3073">host</a>, char *port, char *name, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Parse the source string and returns the pieces in which the source can be split. <a href="group__wpcapfunc.html#ga090e0afd3f463b4b60a64c47eddc1ba2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga2b64c7b6490090d1d37088794f1f1791">pcap_open</a> (const char *source, int snaplen, int flags, int read_timeout, struct <a class="el" href="structpcap__rmtauth.html">pcap_rmtauth</a> *auth, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Open a generic source in order to capture / send (WinPcap only) traffic. <a href="group__wpcapfunc.html#ga2b64c7b6490090d1d37088794f1f1791"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structpcap__samp.html">pcap_samp</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga84c7d55f5b0e7d545b38d6b8e7bde005">pcap_setsampling</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Define a sampling method for packet capture. <a href="group__wpcapfunc.html#ga84c7d55f5b0e7d545b38d6b8e7bde005"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">SOCKET </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga5495943cc8262db57f726e2a23f837dd">pcap_remoteact_accept</a> (const char *address, const char *port, const char *hostlist, char *connectinghost, struct <a class="el" href="structpcap__rmtauth.html">pcap_rmtauth</a> *auth, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Block until a network connection is accepted (active mode only). <a href="group__wpcapfunc.html#ga5495943cc8262db57f726e2a23f837dd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga6a84e03497f946d61c440696e57e2c95">pcap_remoteact_close</a> (const char *<a class="el" href="wpcap__remote_8htm.html#a3c46d79c790748a5942fb43baa6b3073">host</a>, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Drop an active connection (active mode only). <a href="group__wpcapfunc.html#ga6a84e03497f946d61c440696e57e2c95"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga7b022e0a67f5ff62fd13df5c688d6d82">pcap_remoteact_cleanup</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Clean the socket that is currently used in waiting active connections. <a href="group__wpcapfunc.html#ga7b022e0a67f5ff62fd13df5c688d6d82"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga7ee8f666bff537aa457b7c05651cf815">pcap_remoteact_list</a> (char *hostlist, char sep, int size, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the hostname of the host that have an active connection with us (active mode only). <a href="group__wpcapfunc.html#ga7ee8f666bff537aa457b7c05651cf815"></a><br/></td></tr>
<tr><td colspan="2"><h2>Unix-compatible Functions</h2></td></tr>
<tr><td colspan="2"><p><a class="anchor" id="amgrp66235da55168274536ca96ecc6470bf6"></a> These functions are part of the libpcap library, and therefore work both on Windows and on Linux. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>errbuf in <a class="el" href="group__wpcapfunc.html#gaae6abe06e15c87b803f69773822beca8" title="Open a live capture from the network.">pcap_open_live()</a>, <a class="el" href="group__wpcapfunc.html#ga6445eeb76f2757b9fa088b276eea2845" title="Create a pcap_t structure without starting a capture.">pcap_open_dead()</a>, <a class="el" href="group__wpcapfunc.html#ga91078168a13de8848df2b7b83d1f5b69" title="Open a savefile in the tcpdump/libpcap format to read packets.">pcap_open_offline()</a>, <a class="el" href="group__wpcapfunc.html#ga3f212141c80b59aad8ac535bb0178275" title="Switch between blocking and nonblocking mode.">pcap_setnonblock()</a>, <a class="el" href="group__wpcapfunc.html#gab25dc0bfe06545b86be4103bf010708e" title="Get the "non-blocking" state of an interface.">pcap_getnonblock()</a>, <a class="el" href="group__wpcapfunc.html#ga7b128eaeef627b408f6a6e2a2f5eb45d" title="Construct a list of network devices that can be opened with pcap_open_live().">pcap_findalldevs()</a>, <a class="el" href="group__wpcapfunc.html#gaed295fc9fd86434372e8a8316f1270b1" title="Return the first valid device in the system.">pcap_lookupdev()</a>, and <a class="el" href="group__wpcapfunc.html#gaa35276d0fa530c51a455f298fa1ec453" title="Return the subnet and netmask of an interface.">pcap_lookupnet()</a> is assumed to be able to hold at least PCAP_ERRBUF_SIZE chars. </dd></dl>
<br/><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gabcba231c099919ecd9300d7160b19878">pcap_handler</a> )(u_char *user, const struct <a class="el" href="structpcap__pkthdr.html">pcap_pkthdr</a> *pkt_header, const u_char *pkt_data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Prototype of the callback function that receives the packets. <a href="group__wpcapfunc.html#gabcba231c099919ecd9300d7160b19878"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gaae6abe06e15c87b803f69773822beca8">pcap_open_live</a> (const char *device, int snaplen, int promisc, int to_ms, char *ebuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Open a live capture from the network. <a href="group__wpcapfunc.html#gaae6abe06e15c87b803f69773822beca8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga6445eeb76f2757b9fa088b276eea2845">pcap_open_dead</a> (int linktype, int snaplen)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a pcap_t structure without starting a capture. <a href="group__wpcapfunc.html#ga6445eeb76f2757b9fa088b276eea2845"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga91078168a13de8848df2b7b83d1f5b69">pcap_open_offline</a> (const char *fname, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Open a savefile in the tcpdump/libpcap format to read packets. <a href="group__wpcapfunc.html#ga91078168a13de8848df2b7b83d1f5b69"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__wpcap__def.html#gab8c7858aa3a7e3158d9d58cb113a2ae8">pcap_dumper_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga9506c33d580fdb5e5c288dba0f8a085c">pcap_dump_open</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, const char *fname)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Open a file to write packets. <a href="group__wpcapfunc.html#ga9506c33d580fdb5e5c288dba0f8a085c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga3f212141c80b59aad8ac535bb0178275">pcap_setnonblock</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int nonblock, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Switch between blocking and nonblocking mode. <a href="group__wpcapfunc.html#ga3f212141c80b59aad8ac535bb0178275"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gab25dc0bfe06545b86be4103bf010708e">pcap_getnonblock</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the "non-blocking" state of an interface. <a href="group__wpcapfunc.html#gab25dc0bfe06545b86be4103bf010708e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga7b128eaeef627b408f6a6e2a2f5eb45d">pcap_findalldevs</a> (<a class="el" href="structpcap__if.html">pcap_if_t</a> **alldevsp, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct a list of network devices that can be opened with <a class="el" href="group__wpcapfunc.html#gaae6abe06e15c87b803f69773822beca8" title="Open a live capture from the network.">pcap_open_live()</a>. <a href="group__wpcapfunc.html#ga7b128eaeef627b408f6a6e2a2f5eb45d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga346b4b0b7fd1cda4abb9a39f767dbeb1">pcap_freealldevs</a> (<a class="el" href="structpcap__if.html">pcap_if_t</a> *alldevsp)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Free an interface list returned by <a class="el" href="group__wpcapfunc.html#ga7b128eaeef627b408f6a6e2a2f5eb45d" title="Construct a list of network devices that can be opened with pcap_open_live().">pcap_findalldevs()</a>. <a href="group__wpcapfunc.html#ga346b4b0b7fd1cda4abb9a39f767dbeb1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gaed295fc9fd86434372e8a8316f1270b1">pcap_lookupdev</a> (char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the first valid device in the system. <a href="group__wpcapfunc.html#gaed295fc9fd86434372e8a8316f1270b1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gaa35276d0fa530c51a455f298fa1ec453">pcap_lookupnet</a> (const char *device, <a class="el" href="group__wpcap__def.html#ga37fdbc8313e90fb2041203a2e40cd482">bpf_u_int32</a> *netp, <a class="el" href="group__wpcap__def.html#ga37fdbc8313e90fb2041203a2e40cd482">bpf_u_int32</a> *maskp, char *errbuf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the subnet and netmask of an interface. <a href="group__wpcapfunc.html#gaa35276d0fa530c51a455f298fa1ec453"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga60ce104cdf28420d3361cd36d15be44c">pcap_dispatch</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int cnt, <a class="el" href="group__wpcapfunc.html#gabcba231c099919ecd9300d7160b19878">pcap_handler</a> callback, u_char *user)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Collect a group of packets. <a href="group__wpcapfunc.html#ga60ce104cdf28420d3361cd36d15be44c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga6bcb7c5c59d76ec16b8a699da136b5de">pcap_loop</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int cnt, <a class="el" href="group__wpcapfunc.html#gabcba231c099919ecd9300d7160b19878">pcap_handler</a> callback, u_char *user)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Collect a group of packets. <a href="group__wpcapfunc.html#ga6bcb7c5c59d76ec16b8a699da136b5de"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u_char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gadf60257f650aaf869671e0a163611fc3">pcap_next</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, struct <a class="el" href="structpcap__pkthdr.html">pcap_pkthdr</a> *h)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the next available packet. <a href="group__wpcapfunc.html#gadf60257f650aaf869671e0a163611fc3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga439439c2eae61161dc1efb1e03a81133">pcap_next_ex</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, struct <a class="el" href="structpcap__pkthdr.html">pcap_pkthdr</a> **pkt_header, const u_char **pkt_data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Read a packet from an interface or from an offline capture. <a href="group__wpcapfunc.html#ga439439c2eae61161dc1efb1e03a81133"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gae0dc50910fabbd375fab8a1352a6cf33">pcap_breakloop</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set a flag that will force <a class="el" href="group__wpcapfunc.html#ga60ce104cdf28420d3361cd36d15be44c" title="Collect a group of packets.">pcap_dispatch()</a> or <a class="el" href="group__wpcapfunc.html#ga6bcb7c5c59d76ec16b8a699da136b5de" title="Collect a group of packets.">pcap_loop()</a> to return rather than looping. <a href="group__wpcapfunc.html#gae0dc50910fabbd375fab8a1352a6cf33"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga51dbda0f1ab9da2cfe49d657486d50b2">pcap_sendpacket</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, u_char *buf, int size)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Send a raw packet. <a href="group__wpcapfunc.html#ga51dbda0f1ab9da2cfe49d657486d50b2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga659439bf5aa3988b5a92d31990fbf437">pcap_dump</a> (u_char *user, const struct <a class="el" href="structpcap__pkthdr.html">pcap_pkthdr</a> *h, const u_char *sp)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a packet to disk. <a href="group__wpcapfunc.html#ga659439bf5aa3988b5a92d31990fbf437"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga50de34b8b3298f76c66c82b7ca3f84de">pcap_dump_ftell</a> (<a class="el" href="group__wpcap__def.html#gab8c7858aa3a7e3158d9d58cb113a2ae8">pcap_dumper_t</a> *)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the file position for a "savefile". <a href="group__wpcapfunc.html#ga50de34b8b3298f76c66c82b7ca3f84de"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga363bdc6f6b39b4979ddcf15ecb830c5c">pcap_compile</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, struct bpf_program *fp, char *str, int optimize, <a class="el" href="group__wpcap__def.html#ga37fdbc8313e90fb2041203a2e40cd482">bpf_u_int32</a> netmask)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compile a packet filter, converting an high level filtering expression (see <a class="el" href="group__language.html">Filtering expression syntax</a>) in a program that can be interpreted by the kernel-level filtering engine. <a href="group__wpcapfunc.html#ga363bdc6f6b39b4979ddcf15ecb830c5c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga8325b202dad14a00609db8372722ae4e">pcap_compile_nopcap</a> (int snaplen_arg, int linktype_arg, struct bpf_program *program, char *buf, int optimize, <a class="el" href="group__wpcap__def.html#ga37fdbc8313e90fb2041203a2e40cd482">bpf_u_int32</a> mask)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compile a packet filter without the need of opening an adapter. This function converts an high level filtering expression (see <a class="el" href="group__language.html">Filtering expression syntax</a>) in a program that can be interpreted by the kernel-level filtering engine. <a href="group__wpcapfunc.html#ga8325b202dad14a00609db8372722ae4e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gaf5f9cfe85dad0967ff607e5159b1ba61">pcap_setfilter</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, struct bpf_program *fp)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Associate a filter to a capture. <a href="group__wpcapfunc.html#gaf5f9cfe85dad0967ff607e5159b1ba61"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga9e0a5aad1a5dc79d85f1edfcebe0ac13">pcap_freecode</a> (struct bpf_program *fp)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Free a filter. <a href="group__wpcapfunc.html#ga9e0a5aad1a5dc79d85f1edfcebe0ac13"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga64c019f851f7da6892d51cca15f12ace">pcap_datalink</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the link layer of an adapter. <a href="group__wpcapfunc.html#ga64c019f851f7da6892d51cca15f12ace"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga64e482360b0ed7d65fce1db23d56b921">pcap_list_datalinks</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int **dlt_buf)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">list datalinks <a href="group__wpcapfunc.html#ga64e482360b0ed7d65fce1db23d56b921"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga9588b99ac118cf827873d9e941eb6c77">pcap_set_datalink</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int dlt)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current data link type of the pcap descriptor to the type specified by dlt. -1 is returned on failure. <a href="group__wpcapfunc.html#ga9588b99ac118cf827873d9e941eb6c77"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga440b2f0757acd4804588933324909207">pcap_datalink_name_to_val</a> (const char *name)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Translates a data link type name, which is a DLT_ name with the DLT_ removed, to the corresponding data link type value. The translation is case-insensitive. -1 is returned on failure. <a href="group__wpcapfunc.html#ga440b2f0757acd4804588933324909207"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gad45c16d494577f1886704af8f31ed442">pcap_datalink_val_to_name</a> (int dlt)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Translates a data link type value to the corresponding data link type name. NULL is returned on failure. <a href="group__wpcapfunc.html#gad45c16d494577f1886704af8f31ed442"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga3f142cd0694b49357e4a73371db71411">pcap_datalink_val_to_description</a> (int dlt)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Translates a data link type value to a short description of that data link type. NULL is returned on failure. <a href="group__wpcapfunc.html#ga3f142cd0694b49357e4a73371db71411"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gae5c6e9768e89a6b82f9d720f37e6ab97">pcap_snapshot</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the dimension of the packet portion (in bytes) that is delivered to the application. <a href="group__wpcapfunc.html#gae5c6e9768e89a6b82f9d720f37e6ab97"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gaba4941e09e5e03ba39841de4b1d5d6a4">pcap_is_swapped</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">returns true if the current savefile uses a different byte order than the current system. <a href="group__wpcapfunc.html#gaba4941e09e5e03ba39841de4b1d5d6a4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga39dfb05149b443cc25b8febc455ca753">pcap_major_version</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">return the major version number of the pcap library used to write the savefile. <a href="group__wpcapfunc.html#ga39dfb05149b443cc25b8febc455ca753"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gac7a9dd9cd040ee500221cf35dfb49248">pcap_minor_version</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">return the minor version number of the pcap library used to write the savefile. <a href="group__wpcapfunc.html#gac7a9dd9cd040ee500221cf35dfb49248"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">FILE * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga4c9f5690b99fb2af1f8904403f7da06b">pcap_file</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the standard stream of an offline capture. <a href="group__wpcapfunc.html#ga4c9f5690b99fb2af1f8904403f7da06b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gabbd74d8c3ce1bcbccc76129ac38f4549">pcap_stats</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, struct <a class="el" href="structpcap__stat.html">pcap_stat</a> *ps)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return statistics on current capture. <a href="group__wpcapfunc.html#gabbd74d8c3ce1bcbccc76129ac38f4549"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gac3b6784c6c2623b93b22f6f219bd470e">pcap_perror</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, char *prefix)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">print the text of the last pcap library error on stderr, prefixed by prefix. <a href="group__wpcapfunc.html#gac3b6784c6c2623b93b22f6f219bd470e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga81305cb154e4497e95bbb9b708631a3a">pcap_geterr</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">return the error text pertaining to the last pcap library error. <a href="group__wpcapfunc.html#ga81305cb154e4497e95bbb9b708631a3a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gafac2067e8f66f5a5a87f19f5e2b5ad4f">pcap_strerror</a> (int error)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Provided in case strerror() isn't available. <a href="group__wpcapfunc.html#gafac2067e8f66f5a5a87f19f5e2b5ad4f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga2d92cec9ff55906b5b6fb883e4bd72f4">pcap_lib_version</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to a string giving information about the version of the libpcap library being used; note that it contains more information than just a version number. <a href="group__wpcapfunc.html#ga2d92cec9ff55906b5b6fb883e4bd72f4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gaa45a5e1a4ba9925bb3586dcbeec78560">pcap_close</a> (<a class="el" href="group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">close the files associated with p and deallocates resources. <a href="group__wpcapfunc.html#gaa45a5e1a4ba9925bb3586dcbeec78560"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">FILE * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga8dac02f297422ff2ab5983d1e30c58b6">pcap_dump_file</a> (<a class="el" href="group__wpcap__def.html#gab8c7858aa3a7e3158d9d58cb113a2ae8">pcap_dumper_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">return the standard I/O stream of the 'savefile' opened by <a class="el" href="group__wpcapfunc.html#ga9506c33d580fdb5e5c288dba0f8a085c" title="Open a file to write packets.">pcap_dump_open()</a>. <a href="group__wpcapfunc.html#ga8dac02f297422ff2ab5983d1e30c58b6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga90404ae3dcffcd3bbe78f8b187a88984">pcap_dump_flush</a> (<a class="el" href="group__wpcap__def.html#gab8c7858aa3a7e3158d9d58cb113a2ae8">pcap_dumper_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Flushes the output buffer to the ``savefile,'' so that any packets written with <a class="el" href="group__wpcapfunc.html#ga659439bf5aa3988b5a92d31990fbf437" title="Save a packet to disk.">pcap_dump()</a> but not yet written to the ``savefile'' will be written. -1 is returned on error, 0 on success. <a href="group__wpcapfunc.html#ga90404ae3dcffcd3bbe78f8b187a88984"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga3897795c1e9fb10571092febae964ef0">pcap_dump_close</a> (<a class="el" href="group__wpcap__def.html#gab8c7858aa3a7e3158d9d58cb113a2ae8">pcap_dumper_t</a> *p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Closes a savefile. <a href="group__wpcapfunc.html#ga3897795c1e9fb10571092febae964ef0"></a><br/></td></tr>
</table>
</div>
<hr>
<p align="right"><img border="0" src="winpcap_small.gif" align="absbottom" width="91" height="27">
documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009
CACE Technologies. All rights reserved.</p>
|