⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 funcs_2pcap_8h-source.html

📁 Winpcap是一个强大的网络开发库
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>WinPcap: pcap.h Source File</title><link href="style.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.6 --><div class="navigation" id="top">  <div class="tabs">    <ul>      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>      <li><a href="modules.html"><span>Modules</span></a></li>      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>      <li class="current"><a href="files.html"><span>Files</span></a></li>    </ul>  </div><h1>pcap.h</h1><a href="funcs_2pcap_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00017"></a>00017 <span class="comment">//\{ </span><a name="l00018"></a>00018 <a name="l00027"></a><a class="code" href="group__wpcapfunc.html#gbcba231c099919ecd9300d7160b19878">00027</a> <span class="keyword">typedef</span> void (*<a class="code" href="group__wpcapfunc.html#gbcba231c099919ecd9300d7160b19878" title="Prototype of the callback function that receives the packets.">pcap_handler</a>)(u_char *user, <span class="keyword">const</span> <span class="keyword">struct </span><a class="code" href="structpcap__pkthdr.html" title="Header of a packet in the dump file.">pcap_pkthdr</a> *pkt_header,<a name="l00028"></a>00028                  <span class="keyword">const</span> u_char *pkt_data);<a name="l00029"></a>00029 <a name="l00063"></a>00063 <a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *<a class="code" href="group__wpcapfunc.html#gae6abe06e15c87b803f69773822beca8" title="Open a live capture from the network.">pcap_open_live</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *device, <span class="keywordtype">int</span> snaplen, <span class="keywordtype">int</span> promisc, <span class="keywordtype">int</span> to_ms, <span class="keywordtype">char</span> *ebuf);<a name="l00064"></a>00064 <a name="l00065"></a>00065 <a name="l00075"></a>00075 <a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *<a class="code" href="group__wpcapfunc.html#g6445eeb76f2757b9fa088b276eea2845" title="Create a pcap_t structure without starting a capture.">pcap_open_dead</a>(<span class="keywordtype">int</span> linktype, <span class="keywordtype">int</span> snaplen);<a name="l00076"></a>00076 <a name="l00077"></a>00077 <a name="l00091"></a>00091 <a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *<a class="code" href="group__wpcapfunc.html#g91078168a13de8848df2b7b83d1f5b69" title="Open a savefile in the tcpdump/libpcap format to read packets.">pcap_open_offline</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *fname, <span class="keywordtype">char</span> *errbuf);<a name="l00092"></a>00092 <a name="l00105"></a>00105 <a class="code" href="group__wpcap__def.html#gb8c7858aa3a7e3158d9d58cb113a2ae8" title="libpcap savefile descriptor.">pcap_dumper_t</a> *<a class="code" href="group__wpcapfunc.html#g9506c33d580fdb5e5c288dba0f8a085c" title="Open a file to write packets.">pcap_dump_open</a>(<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *p, <span class="keyword">const</span> <span class="keywordtype">char</span> *fname);<a name="l00106"></a>00106 <a name="l00124"></a>00124 <span class="keywordtype">int</span> <a class="code" href="group__wpcapfunc.html#g3f212141c80b59aad8ac535bb0178275" title="Switch between blocking and nonblocking mode.">pcap_setnonblock</a>(<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *p, <span class="keywordtype">int</span> nonblock, <span class="keywordtype">char</span> *errbuf);<a name="l00125"></a>00125 <a name="l00126"></a>00126 <a name="l00136"></a>00136 <span class="keywordtype">int</span> <a class="code" href="group__wpcapfunc.html#gb25dc0bfe06545b86be4103bf010708e" title="Get the &amp;quot;non-blocking&amp;quot; state of an interface.">pcap_getnonblock</a>(<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *p, <span class="keywordtype">char</span> *errbuf);<a name="l00137"></a>00137 <a name="l00153"></a>00153 <span class="keywordtype">int</span> <a class="code" href="group__wpcapfunc.html#g7b128eaeef627b408f6a6e2a2f5eb45d" title="Construct a list of network devices that can be opened with pcap_open_live().">pcap_findalldevs</a>(<a class="code" href="structpcap__if.html" title="Item in a list of interfaces, used by pcap_findalldevs().">pcap_if_t</a> **alldevsp, <span class="keywordtype">char</span> *errbuf);<a name="l00154"></a>00154 <a name="l00161"></a>00161 <span class="keywordtype">void</span> <a class="code" href="group__wpcapfunc.html#g346b4b0b7fd1cda4abb9a39f767dbeb1" title="Free an interface list returned by pcap_findalldevs().">pcap_freealldevs</a>(<a class="code" href="structpcap__if.html" title="Item in a list of interfaces, used by pcap_findalldevs().">pcap_if_t</a> *alldevsp);<a name="l00162"></a>00162 <a name="l00173"></a>00173 <span class="keywordtype">char</span> *<a class="code" href="group__wpcapfunc.html#ged295fc9fd86434372e8a8316f1270b1" title="Return the first valid device in the system.">pcap_lookupdev</a>(<span class="keywordtype">char</span> *errbuf);<a name="l00174"></a>00174 <a name="l00175"></a>00175 <a name="l00187"></a>00187 <span class="keywordtype">int</span> <a class="code" href="group__wpcapfunc.html#ga35276d0fa530c51a455f298fa1ec453" title="Return the subnet and netmask of an interface.">pcap_lookupnet</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *device, <a class="code" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482" title="32-bit unsigned integer">bpf_u_int32</a> *netp, <a class="code" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482" title="32-bit unsigned integer">bpf_u_int32</a> *maskp, <span class="keywordtype">char</span> *errbuf);<a name="l00188"></a>00188 <a name="l00227"></a>00227 <span class="keywordtype">int</span> <a class="code" href="group__wpcapfunc.html#g60ce104cdf28420d3361cd36d15be44c" title="Collect a group of packets.">pcap_dispatch</a>(<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *p, <span class="keywordtype">int</span> cnt, <a class="code" href="group__wpcapfunc.html#gbcba231c099919ecd9300d7160b19878" title="Prototype of the callback function that receives the packets.">pcap_handler</a> callback, u_char *user);<a name="l00228"></a>00228 <a name="l00229"></a>00229 <a name="l00244"></a>00244 <span class="keywordtype">int</span> <a class="code" href="group__wpcapfunc.html#g6bcb7c5c59d76ec16b8a699da136b5de" title="Collect a group of packets.">pcap_loop</a>(<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *p, <span class="keywordtype">int</span> cnt, <a class="code" href="group__wpcapfunc.html#gbcba231c099919ecd9300d7160b19878" title="Prototype of the callback function that receives the packets.">pcap_handler</a> callback, u_char *user);<a name="l00245"></a>00245 <a name="l00246"></a>00246 <a name="l00261"></a>00261 u_char *<a class="code" href="group__wpcapfunc.html#gdf60257f650aaf869671e0a163611fc3" title="Return the next available packet.">pcap_next</a>(<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *p, <span class="keyword">struct</span> <a class="code" href="structpcap__pkthdr.html" title="Header of a packet in the dump file.">pcap_pkthdr</a> *h);<a name="l00262"></a>00262 <a name="l00279"></a>00279 <span class="keywordtype">int</span> <a class="code" href="group__wpcapfunc.html#g439439c2eae61161dc1efb1e03a81133" title="Read a packet from an interface or from an offline capture.">pcap_next_ex</a>(<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *p, <span class="keyword">struct</span> <a class="code" href="structpcap__pkthdr.html" title="Header of a packet in the dump file.">pcap_pkthdr</a> **pkt_header, <span class="keyword">const</span> u_char **pkt_data);<a name="l00280"></a>00280 <a name="l00302"></a>00302 <span class="keywordtype">void</span> <a class="code" href="group__wpcapfunc.html#ge0dc50910fabbd375fab8a1352a6cf33" title="set a flag that will force pcap_dispatch() or pcap_loop() to return rather than looping...">pcap_breakloop</a>(<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *);<a name="l00303"></a>00303 <a name="l00315"></a>00315 <span class="keywordtype">int</span> <a class="code" href="group__wpcapfunc.html#g51dbda0f1ab9da2cfe49d657486d50b2" title="Send a raw packet.">pcap_sendpacket</a>(<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *p, u_char *buf, <span class="keywordtype">int</span> size);  <a name="l00316"></a>00316 <a name="l00327"></a>00327 <span class="keywordtype">void</span> <a class="code" href="group__wpcapfunc.html#g659439bf5aa3988b5a92d31990fbf437" title="Save a packet to disk.">pcap_dump</a>(u_char *user, <span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structpcap__pkthdr.html" title="Header of a packet in the dump file.">pcap_pkthdr</a> *h, <span class="keyword">const</span> u_char *sp);<a name="l00328"></a>00328 <a name="l00337"></a>00337 <span class="keywordtype">long</span> <a class="code" href="group__wpcapfunc.html#g50de34b8b3298f76c66c82b7ca3f84de" title="Return the file position for a &amp;quot;savefile&amp;quot;.">pcap_dump_ftell</a>(<a class="code" href="group__wpcap__def.html#gb8c7858aa3a7e3158d9d58cb113a2ae8" title="libpcap savefile descriptor.">pcap_dumper_t</a> *);<a name="l00338"></a>00338 <a name="l00357"></a>00357 <span class="keywordtype">int</span> <a class="code" href="group__wpcapfunc.html#g363bdc6f6b39b4979ddcf15ecb830c5c" title="Compile a packet filter, converting an high level filtering expression (see Filtering...">pcap_compile</a>(<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *p, <span class="keyword">struct</span> bpf_program *fp, <span class="keywordtype">char</span> *str, <span class="keywordtype">int</span> optimize, <a class="code" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482" title="32-bit unsigned integer">bpf_u_int32</a> netmask);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -