📄 group__wpcapfunc.html
字号:
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__wpcapfunc.html#gae6abe06e15c87b803f69773822beca8">pcap_open_live()</a>, <a class="el" href="group__wpcapfunc.html#gf5f9cfe85dad0967ff607e5159b1ba61">pcap_setfilter()</a>, <a class="el" href="group__wpcapfunc.html#g9e0a5aad1a5dc79d85f1edfcebe0ac13">pcap_freecode()</a>, <a class="el" href="group__wpcapfunc.html#ge5c6e9768e89a6b82f9d720f37e6ab97">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 </td> <td class="paramname"> <em>snaplen_arg</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>linktype_arg</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct bpf_program * </td> <td class="paramname"> <em>program</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>buf</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </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> </td> <td class="paramname"> <em>mask</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></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">pcap_compile_nopcap()</a> is similar to <a class="el" href="group__wpcapfunc.html#g363bdc6f6b39b4979ddcf15ecb830c5c">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">pcap_open()</a>. A return of -1 indicates an error; the error text is unavailable. (<a class="el" href="group__wpcapfunc.html#g8325b202dad14a00609db8372722ae4e">pcap_compile_nopcap()</a> is a wrapper around <a class="el" href="group__wpcapfunc.html#g6445eeb76f2757b9fa088b276eea2845">pcap_open_dead()</a>, <a class="el" href="group__wpcapfunc.html#g363bdc6f6b39b4979ddcf15ecb830c5c">pcap_compile()</a>, and <a class="el" href="group__wpcapfunc.html#ga45a5e1a4ba9925bb3586dcbeec78560">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">pcap_open_live()</a>, <a class="el" href="group__wpcapfunc.html#gf5f9cfe85dad0967ff607e5159b1ba61">pcap_setfilter()</a>, <a class="el" href="group__wpcapfunc.html#g9e0a5aad1a5dc79d85f1edfcebe0ac13">pcap_freecode()</a>, <a class="el" href="group__wpcapfunc.html#ge5c6e9768e89a6b82f9d720f37e6ab97">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> <td>(</td> <td class="paramtype">char * </td> <td class="paramname"> <em>source</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>host</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>port</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>errbuf</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -