?? group__wpcapfunc.html
字號:
<!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: Exported functions</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 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><a href="files.html"><span>Files</span></a></li> </ul> </div></div><div class="contents"><h1>Exported functions<br><small>[<a class="el" href="group__wpcap.html">WinPcap user's manual</a>]</small></h1><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Unix-compatible Functions</h2></td></tr><tr><td colspan="2">These functions are part of the libpcap library, and therefore work both on Windows and on Linux. <dl class="note" compact><dt><b>Note:</b></dt><dd>errbuf in <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#g6445eeb76f2757b9fa088b276eea2845" title="Create a pcap_t structure without starting a capture.">pcap_open_dead()</a>, <a class="el" href="group__wpcapfunc.html#g91078168a13de8848df2b7b83d1f5b69" title="Open a savefile in the tcpdump/libpcap format to read packets.">pcap_open_offline()</a>, <a class="el" href="group__wpcapfunc.html#g3f212141c80b59aad8ac535bb0178275" title="Switch between blocking and nonblocking mode.">pcap_setnonblock()</a>, <a class="el" href="group__wpcapfunc.html#gb25dc0bfe06545b86be4103bf010708e" title="Get the "non-blocking" state of an interface.">pcap_getnonblock()</a>, <a class="el" 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="el" href="group__wpcapfunc.html#ged295fc9fd86434372e8a8316f1270b1" title="Return the first valid device in the system.">pcap_lookupdev()</a>, and <a class="el" href="group__wpcapfunc.html#ga35276d0fa530c51a455f298fa1ec453" 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" nowrap align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gbcba231c099919ecd9300d7160b19878">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="#gbcba231c099919ecd9300d7160b19878"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">pcap_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gae6abe06e15c87b803f69773822beca8">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="#gae6abe06e15c87b803f69773822beca8"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">pcap_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g6445eeb76f2757b9fa088b276eea2845">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="#g6445eeb76f2757b9fa088b276eea2845"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">pcap_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g91078168a13de8848df2b7b83d1f5b69">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="#g91078168a13de8848df2b7b83d1f5b69"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__wpcap__def.html#gb8c7858aa3a7e3158d9d58cb113a2ae8">pcap_dumper_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g9506c33d580fdb5e5c288dba0f8a085c">pcap_dump_open</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">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="#g9506c33d580fdb5e5c288dba0f8a085c"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g3f212141c80b59aad8ac535bb0178275">pcap_setnonblock</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">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="#g3f212141c80b59aad8ac535bb0178275"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gb25dc0bfe06545b86be4103bf010708e">pcap_getnonblock</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">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="#gb25dc0bfe06545b86be4103bf010708e"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g7b128eaeef627b408f6a6e2a2f5eb45d">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#gae6abe06e15c87b803f69773822beca8" title="Open a live capture from the network.">pcap_open_live()</a>. <a href="#g7b128eaeef627b408f6a6e2a2f5eb45d"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g346b4b0b7fd1cda4abb9a39f767dbeb1">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#g7b128eaeef627b408f6a6e2a2f5eb45d" title="Construct a list of network devices that can be opened with pcap_open_live().">pcap_findalldevs()</a>. <a href="#g346b4b0b7fd1cda4abb9a39f767dbeb1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ged295fc9fd86434372e8a8316f1270b1">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="#ged295fc9fd86434372e8a8316f1270b1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ga35276d0fa530c51a455f298fa1ec453">pcap_lookupnet</a> (const char *device, <a class="el" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482">bpf_u_int32</a> *netp, <a class="el" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482">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="#ga35276d0fa530c51a455f298fa1ec453"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g60ce104cdf28420d3361cd36d15be44c">pcap_dispatch</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int cnt, <a class="el" href="group__wpcapfunc.html#gbcba231c099919ecd9300d7160b19878">pcap_handler</a> callback, u_char *user)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Collect a group of packets. <a href="#g60ce104cdf28420d3361cd36d15be44c"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g6bcb7c5c59d76ec16b8a699da136b5de">pcap_loop</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int cnt, <a class="el" href="group__wpcapfunc.html#gbcba231c099919ecd9300d7160b19878">pcap_handler</a> callback, u_char *user)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Collect a group of packets. <a href="#g6bcb7c5c59d76ec16b8a699da136b5de"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">u_char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gdf60257f650aaf869671e0a163611fc3">pcap_next</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">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="#gdf60257f650aaf869671e0a163611fc3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g439439c2eae61161dc1efb1e03a81133">pcap_next_ex</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">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="#g439439c2eae61161dc1efb1e03a81133"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#ge0dc50910fabbd375fab8a1352a6cf33">pcap_breakloop</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">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#g60ce104cdf28420d3361cd36d15be44c" title="Collect a group of packets.">pcap_dispatch()</a> or <a class="el" href="group__wpcapfunc.html#g6bcb7c5c59d76ec16b8a699da136b5de" title="Collect a group of packets.">pcap_loop()</a> to return rather than looping. <a href="#ge0dc50910fabbd375fab8a1352a6cf33"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g51dbda0f1ab9da2cfe49d657486d50b2">pcap_sendpacket</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">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="#g51dbda0f1ab9da2cfe49d657486d50b2"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g659439bf5aa3988b5a92d31990fbf437">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="#g659439bf5aa3988b5a92d31990fbf437"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g50de34b8b3298f76c66c82b7ca3f84de">pcap_dump_ftell</a> (<a class="el" href="group__wpcap__def.html#gb8c7858aa3a7e3158d9d58cb113a2ae8">pcap_dumper_t</a> *)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Return the file position for a "savefile". <a href="#g50de34b8b3298f76c66c82b7ca3f84de"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g363bdc6f6b39b4979ddcf15ecb830c5c">pcap_compile</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, struct bpf_program *fp, char *str, int optimize, <a class="el" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482">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="#g363bdc6f6b39b4979ddcf15ecb830c5c"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g8325b202dad14a00609db8372722ae4e">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#g37fdbc8313e90fb2041203a2e40cd482">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="#g8325b202dad14a00609db8372722ae4e"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#gf5f9cfe85dad0967ff607e5159b1ba61">pcap_setfilter</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">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="#gf5f9cfe85dad0967ff607e5159b1ba61"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g9e0a5aad1a5dc79d85f1edfcebe0ac13">pcap_freecode</a> (struct bpf_program *fp)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Free a filter. <a href="#g9e0a5aad1a5dc79d85f1edfcebe0ac13"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g64c019f851f7da6892d51cca15f12ace">pcap_datalink</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Return the link layer of an adapter. <a href="#g64c019f851f7da6892d51cca15f12ace"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcapfunc.html#g64e482360b0ed7d65fce1db23d56b921">pcap_list_datalinks</a> (<a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">pcap_t</a> *p, int **dlt_buf)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">list datalinks <a href="#g64e482360b0ed7d65fce1db23d56b921"></a><br></td></tr>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -