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

📄 group__wpcapfunc.html

📁 Winpcap是一个强大的网络开发库
💻 HTML
📖 第 1 页 / 共 5 页
字号:
          <td class="paramtype">struct bpf_program *&nbsp;</td>          <td class="paramname"> <em>fp</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">char *&nbsp;</td>          <td class="paramname"> <em>str</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>optimize</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype"><a class="el" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482">bpf_u_int32</a>&nbsp;</td>          <td class="paramname"> <em>netmask</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>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. <p><a class="el" href="group__wpcapfunc.html#g363bdc6f6b39b4979ddcf15ecb830c5c" title="Compile a packet filter, converting an high level filtering expression (see Filtering...">pcap_compile()</a> is used to compile the string str into a filter program. program is a pointer to a bpf_program struct and is filled in by <a class="el" href="group__wpcapfunc.html#g363bdc6f6b39b4979ddcf15ecb830c5c" title="Compile a packet filter, converting an high level filtering expression (see Filtering...">pcap_compile()</a>. optimize controls whether optimization on the resulting code is performed. netmask specifies the IPv4 netmask of the network on which packets are being captured; it is used only when checking for IPv4 broadcast addresses in the filter program. If the netmask of the network on which packets are being captured isn't known to the program, or if packets are being captured on the Linux "any" pseudo-interface that can capture on more than one network, a value of 0 can be supplied; tests for IPv4 broadcast addreses won't be done correctly, but all other tests in the filter program will be OK. A return of -1 indicates an error in which case <a class="el" href="group__wpcapfunc.html#g81305cb154e4497e95bbb9b708631a3a" title="return the error text pertaining to the last pcap library error.">pcap_geterr()</a> may be used to display the error text.<p><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__wpcapfunc.html#gae6abe06e15c87b803f69773822beca8" title="Open a live capture from the network.">pcap_open_live()</a>, <a class="el" href="group__wpcapfunc.html#gf5f9cfe85dad0967ff607e5159b1ba61" title="Associate a filter to a capture.">pcap_setfilter()</a>, <a class="el" href="group__wpcapfunc.html#g9e0a5aad1a5dc79d85f1edfcebe0ac13" title="Free a filter.">pcap_freecode()</a>, <a class="el" href="group__wpcapfunc.html#ge5c6e9768e89a6b82f9d720f37e6ab97" title="Return the dimension of the packet portion (in bytes) that is delivered to the application...">pcap_snapshot()</a> </dd></dl></div></div><p><a class="anchor" name="g8325b202dad14a00609db8372722ae4e"></a><!-- doxytag: member="funcs/pcap.h::pcap_compile_nopcap" ref="g8325b202dad14a00609db8372722ae4e" args="(int snaplen_arg, int linktype_arg, struct bpf_program *program, char *buf, int optimize, bpf_u_int32 mask)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">int pcap_compile_nopcap           </td>          <td>(</td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>snaplen_arg</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>linktype_arg</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">struct bpf_program *&nbsp;</td>          <td class="paramname"> <em>program</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">char *&nbsp;</td>          <td class="paramname"> <em>buf</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>optimize</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype"><a class="el" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482">bpf_u_int32</a>&nbsp;</td>          <td class="paramname"> <em>mask</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>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. <p><a class="el" href="group__wpcapfunc.html#g8325b202dad14a00609db8372722ae4e" title="Compile a packet filter without the need of opening an adapter. This function converts...">pcap_compile_nopcap()</a> is similar to <a class="el" href="group__wpcapfunc.html#g363bdc6f6b39b4979ddcf15ecb830c5c" title="Compile a packet filter, converting an high level filtering expression (see Filtering...">pcap_compile()</a> except that instead of passing a pcap structure, one passes the snaplen and linktype explicitly. It is intended to be used for compiling filters for direct BPF usage, without necessarily having called <a class="el" href="group__wpcapfunc.html#g2b64c7b6490090d1d37088794f1f1791" title="Open a generic source in order to capture / send (WinPcap only) traffic.">pcap_open()</a>. A return of -1 indicates an error; the error text is unavailable. (<a class="el" href="group__wpcapfunc.html#g8325b202dad14a00609db8372722ae4e" title="Compile a packet filter without the need of opening an adapter. This function converts...">pcap_compile_nopcap()</a> is a wrapper around <a class="el" href="group__wpcapfunc.html#g6445eeb76f2757b9fa088b276eea2845" title="Create a pcap_t structure without starting a capture.">pcap_open_dead()</a>, <a class="el" href="group__wpcapfunc.html#g363bdc6f6b39b4979ddcf15ecb830c5c" title="Compile a packet filter, converting an high level filtering expression (see Filtering...">pcap_compile()</a>, and <a class="el" href="group__wpcapfunc.html#ga45a5e1a4ba9925bb3586dcbeec78560" title="close the files associated with p and deallocates resources.">pcap_close()</a>; the latter three routines can be used directly in order to get the error text for a compilation error.)<p>Look at the <a class="el" href="group__language.html">Filtering expression syntax</a> section for details on the str parameter.<p><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__wpcapfunc.html#gae6abe06e15c87b803f69773822beca8" title="Open a live capture from the network.">pcap_open_live()</a>, <a class="el" href="group__wpcapfunc.html#gf5f9cfe85dad0967ff607e5159b1ba61" title="Associate a filter to a capture.">pcap_setfilter()</a>, <a class="el" href="group__wpcapfunc.html#g9e0a5aad1a5dc79d85f1edfcebe0ac13" title="Free a filter.">pcap_freecode()</a>, <a class="el" href="group__wpcapfunc.html#ge5c6e9768e89a6b82f9d720f37e6ab97" title="Return the dimension of the packet portion (in bytes) that is delivered to the application...">pcap_snapshot()</a> </dd></dl></div></div><p><a class="anchor" name="ga3111e10f930a9772a32a922b26948b0"></a><!-- doxytag: member="funcs/pcap.h::pcap_createsrcstr" ref="ga3111e10f930a9772a32a922b26948b0" args="(char *source, int type, const char *host, const char *port, const char *name, char *errbuf)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">int pcap_createsrcstr           </td>

⌨️ 快捷键说明

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