📄 incs_2pcap_8h-source.html
字号:
<a name="l00052"></a>00052 <span class="preprocessor">#ifdef __cplusplus</span><a name="l00053"></a>00053 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {<a name="l00054"></a>00054 <span class="preprocessor">#endif</span><a name="l00055"></a>00055 <span class="preprocessor"></span><a name="l00056"></a><a class="code" href="group__wpcap__def.html#gac031371d41e21ff96e80409e05a7ddb">00056</a> <span class="preprocessor">#define PCAP_VERSION_MAJOR 2 </span><a name="l00057"></a><a class="code" href="group__wpcap__def.html#g9c200b070c9f626d38184588b16849c2">00057</a> <span class="preprocessor">#define PCAP_VERSION_MINOR 4 </span><a name="l00058"></a>00058 <span class="preprocessor"></span><a name="l00059"></a><a class="code" href="group__wpcap__def.html#gcd448353957d92c98fccc29e1fc8d927">00059</a> <span class="preprocessor"></span><span class="preprocessor">#define PCAP_ERRBUF_SIZE 256 </span><a name="l00060"></a>00060 <span class="preprocessor"></span><a name="l00061"></a>00061 <span class="preprocessor"></span><a name="l00065"></a>00065 <span class="preprocessor">#if BPF_RELEASE - 0 < 199406</span><a name="l00066"></a><a class="code" href="group__wpcap__def.html#g759c6336c1d9abb462d9248c5ca5c437">00066</a> <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">int</span> <a class="code" href="group__wpcap__def.html#g759c6336c1d9abb462d9248c5ca5c437" title="32-bit integer">bpf_int32</a>; <a name="l00067"></a><a class="code" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482">00067</a> <span class="keyword">typedef</span> u_int <a class="code" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482" title="32-bit unsigned integer">bpf_u_int32</a>; <a name="l00068"></a>00068 <span class="preprocessor">#endif</span><a name="l00069"></a>00069 <span class="preprocessor"></span><a name="l00070"></a><a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">00070</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>pcap <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="l00071"></a><a class="code" href="group__wpcap__def.html#gb8c7858aa3a7e3158d9d58cb113a2ae8">00071</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>pcap_dumper <a class="code" href="group__wpcap__def.html#gb8c7858aa3a7e3158d9d58cb113a2ae8" title="libpcap savefile descriptor.">pcap_dumper_t</a>; <a name="l00072"></a><a class="code" href="group__wpcap__def.html#g3a6e7cbf8d9752da3add4676c7cd4c58">00072</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structpcap__if.html" title="Item in a list of interfaces, used by pcap_findalldevs().">pcap_if</a> <a class="code" href="structpcap__if.html" title="Item in a list of interfaces, used by pcap_findalldevs().">pcap_if_t</a>; <a name="l00073"></a><a class="code" href="group__wpcap__def.html#gd5c2e491e2ca9d8eefe4217021c99bdc">00073</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structpcap__addr.html" title="Representation of an interface address, used by pcap_findalldevs().">pcap_addr</a> <a class="code" href="structpcap__addr.html" title="Representation of an interface address, used by pcap_findalldevs().">pcap_addr_t</a>; <a name="l00074"></a>00074 <a name="l00110"></a><a class="code" href="structpcap__file__header.html">00110</a> <span class="keyword">struct </span><a class="code" href="structpcap__file__header.html" title="Header of a libpcap dump file.">pcap_file_header</a> {<a name="l00111"></a><a class="code" href="structpcap__file__header.html#18b75bcc7dcee1412b74b57bb238cf3d">00111</a> bpf_u_int32 <a class="code" href="structpcap__file__header.html#18b75bcc7dcee1412b74b57bb238cf3d">magic</a>;<a name="l00112"></a><a class="code" href="structpcap__file__header.html#571fada6e8ffbb02ad47e64f0f721d4a">00112</a> u_short <a class="code" href="structpcap__file__header.html#571fada6e8ffbb02ad47e64f0f721d4a" title="Libpcap major version.">version_major</a>; <a name="l00113"></a><a class="code" href="structpcap__file__header.html#82971bc0da75fef683f826bd48050307">00113</a> u_short <a class="code" href="structpcap__file__header.html#82971bc0da75fef683f826bd48050307" title="Libpcap minor version.">version_minor</a>; <a name="l00114"></a><a class="code" href="structpcap__file__header.html#e729a1ba12145c96acbe2bb6310bc7e1">00114</a> bpf_int32 <a class="code" href="structpcap__file__header.html#e729a1ba12145c96acbe2bb6310bc7e1" title="gmt to local correction">thiszone</a>; <a name="l00115"></a><a class="code" href="structpcap__file__header.html#209ec264363632ccd21b412c93d2881a">00115</a> bpf_u_int32 <a class="code" href="structpcap__file__header.html#209ec264363632ccd21b412c93d2881a" title="accuracy of timestamps">sigfigs</a>; <a name="l00116"></a><a class="code" href="structpcap__file__header.html#a73496b51e5edb630420e4044792c897">00116</a> bpf_u_int32 <a class="code" href="structpcap__file__header.html#a73496b51e5edb630420e4044792c897" title="max length saved portion of each pkt">snaplen</a>; <a name="l00117"></a><a class="code" href="structpcap__file__header.html#1c54dd90a08b2c232f2f204bfaa54496">00117</a> bpf_u_int32 <a class="code" href="structpcap__file__header.html#1c54dd90a08b2c232f2f204bfaa54496" title="data link type (LINKTYPE_*)">linktype</a>; <a name="l00118"></a>00118 };<a name="l00119"></a>00119 <a name="l00126"></a><a class="code" href="structpcap__pkthdr.html">00126</a> <span class="keyword">struct </span><a class="code" href="structpcap__pkthdr.html" title="Header of a packet in the dump file.">pcap_pkthdr</a> {<a name="l00127"></a><a class="code" href="structpcap__pkthdr.html#21be78b2818c91cb205885b8a6f5aed8">00127</a> <span class="keyword">struct </span>timeval <a class="code" href="structpcap__pkthdr.html#21be78b2818c91cb205885b8a6f5aed8" title="time stamp">ts</a>; <a name="l00128"></a><a class="code" href="structpcap__pkthdr.html#ac5771ed2efd92508bb4fe650f2ce7d7">00128</a> bpf_u_int32 <a class="code" href="structpcap__pkthdr.html#ac5771ed2efd92508bb4fe650f2ce7d7" title="length of portion present">caplen</a>; <a name="l00129"></a><a class="code" href="structpcap__pkthdr.html#728f264db4f5cc304742565a2bcdbeea">00129</a> bpf_u_int32 <a class="code" href="structpcap__pkthdr.html#728f264db4f5cc304742565a2bcdbeea" title="length this packet (off wire)">len</a>; <a name="l00130"></a>00130 };<a name="l00131"></a>00131 <a name="l00136"></a><a class="code" href="structpcap__stat.html">00136</a> <span class="keyword">struct </span><a class="code" href="structpcap__stat.html" title="Structure that keeps statistical values on an interface.">pcap_stat</a> {<a name="l00137"></a><a class="code" href="structpcap__stat.html#825c8bdb589e7de8e597f6d6f7af8125">00137</a> u_int <a class="code" href="structpcap__stat.html#825c8bdb589e7de8e597f6d6f7af8125" title="number of packets transited on the network">ps_recv</a>; <a name="l00138"></a><a class="code" href="structpcap__stat.html#2cfc89d84a0ba404cacfa59f6b112bc1">00138</a> u_int <a class="code" href="structpcap__stat.html#2cfc89d84a0ba404cacfa59f6b112bc1" title="number of packets dropped by the driver">ps_drop</a>; <a name="l00139"></a><a class="code" href="structpcap__stat.html#bc51be1ec5423e462bde5eac5a9b7c56">00139</a> u_int <a class="code" href="structpcap__stat.html#bc51be1ec5423e462bde5eac5a9b7c56" title="drops by interface, not yet supported">ps_ifdrop</a>; <a name="l00140"></a>00140 <span class="preprocessor">#ifdef WIN32</span><a name="l00141"></a><a class="code" href="structpcap__stat.html#579778ac11d2b5c142ce8bc7ed37bb08">00141</a> <span class="preprocessor"></span> u_int <a class="code" href="structpcap__stat.html#579778ac11d2b5c142ce8bc7ed37bb08" title="Win32 specific. number of packets captured, i.e number of packets that are accepted...">bs_capt</a>; <a name="l00142"></a>00142 <span class="preprocessor">#endif </span><span class="comment">/* WIN32 */</span><a name="l00143"></a>00143 };<a name="l00144"></a>00144 <a name="l00148"></a><a class="code" href="structpcap__if.html">00148</a> <span class="keyword">struct </span><a class="code" href="structpcap__if.html" title="Item in a list of interfaces, used by pcap_findalldevs().">pcap_if</a> {<a name="l00149"></a><a class="code" href="structpcap__if.html#81508e6e4e41ca4235c8d6b51913c536">00149</a> <span class="keyword">struct </span><a class="code" href="structpcap__if.html" title="Item in a list of interfaces, used by pcap_findalldevs().">pcap_if</a> *<a class="code" href="structpcap__if.html#81508e6e4e41ca4235c8d6b51913c536" title="if not NULL, a pointer to the next element in the list; NULL for the last element...">next</a>; <a name="l00150"></a><a class="code" href="structpcap__if.html#5ac083a645d964373f022d03df4849c8">00150</a> <span class="keywordtype">char</span> *<a class="code" href="structpcap__if.html#5ac083a645d964373f022d03df4849c8" title="a pointer to a string giving a name for the device to pass to pcap_open_live()">name</a>; <a name="l00151"></a><a class="code" href="structpcap__if.html#8444d6e0dfe2bbab0b5e7b24308f1559">00151</a> <span class="keywordtype">char</span> *<a class="code" href="structpcap__if.html#8444d6e0dfe2bbab0b5e7b24308f1559" title="if not NULL, a pointer to a string giving a human-readable description of the device...">description</a>; <a name="l00152"></a><a class="code" href="structpcap__if.html#3910004677550db6d9b09792ba3e2cca">00152</a> <span class="keyword">struct </span><a class="code" href="structpcap__addr.html" title="Representation of an interface address, used by pcap_findalldevs().">pcap_addr</a> *<a class="code" href="structpcap__if.html#3910004677550db6d9b09792ba3e2cca" title="a pointer to the first element of a list of addresses for the interface">addresses</a>; <a name="l00153"></a><a class="code" href="structpcap__if.html#304e038dd1326c14b31a206cbad18756">00153</a> u_int <a class="code" href="structpcap__if.html#304e038dd1326c14b31a206cbad18756" title="PCAP_IF_ interface flags. Currently the only possible flag is PCAP_IF_LOOPBACK, that...">flags</a>; <a name="l00154"></a>00154 };<a name="l00155"></a>00155 <a name="l00156"></a><a class="code" href="group__wpcap__def.html#g43a6601bfd438efc02b0ba71c5439647">00156</a> <span class="preprocessor">#define PCAP_IF_LOOPBACK 0x00000001 </span><a name="l00157"></a>00157 <span class="preprocessor"></span><a name="l00158"></a>00158 <span class="preprocessor"></span><a name="l00161"></a><a class="code" href="structpcap__addr.html">00161</a> <span class="keyword">struct </span><a class="code" href="structpcap__addr.html" title="Representation of an interface address, used by pcap_findalldevs().">pcap_addr</a> {<a name="l00162"></a><a class="code" href="structpcap__addr.html#b151e8e96bdb23ae8dd8d644de561999">00162</a> <span class="keyword">struct </span><a class="code" href="structpcap__addr.html" title="Representation of an interface address, used by pcap_findalldevs().">pcap_addr</a> *<a class="code" href="structpcap__addr.html#b151e8e96bdb23ae8dd8d644de561999" title="if not NULL, a pointer to the next element in the list; NULL for the last element...">next</a>; <a name="l00163"></a><a class="code" href="structpcap__addr.html#4863f5b8767cd19fe6ea4db75456e5df">00163</a> <span class="keyword">struct </span>sockaddr *<a class="code" href="structpcap__addr.html#4863f5b8767cd19fe6ea4db75456e5df" title="a pointer to a struct sockaddr containing an address">addr</a>; <a name="l00164"></a><a class="code" href="structpcap__addr.html#c43963e42e4d901e55e433ab9c3ea686">00164</a> <span class="keyword">struct </span>sockaddr *<a class="code" href="structpcap__addr.html#c43963e42e4d901e55e433ab9c3ea686" title="if not NULL, a pointer to a struct sockaddr that contains the netmask corresponding...">netmask</a>; <a name="l00165"></a><a class="code" href="structpcap__addr.html#0077647e1560caa72d457120b36c248c">00165</a> <span class="keyword">struct </span>sockaddr *<a class="code" href="structpcap__addr.html#0077647e1560caa72d457120b36c248c" title="if not NULL, a pointer to a struct sockaddr that contains the broadcast address corre
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -