📄 packet_8h-source.html
字号:
<a name="l00107"></a>00107 {<a name="l00108"></a><a class="code" href="structpacket__file__header.html#b396ddef34e11edb49e5edfcc39c2dc7">00108</a> UINT <a class="code" href="structpacket__file__header.html#b396ddef34e11edb49e5edfcc39c2dc7" title="Libpcap magic number.">magic</a>; <a name="l00109"></a><a class="code" href="structpacket__file__header.html#312dffcaa516df104318626fbdc01a77">00109</a> USHORT <a class="code" href="structpacket__file__header.html#312dffcaa516df104318626fbdc01a77" title="Libpcap major version.">version_major</a>; <a name="l00110"></a><a class="code" href="structpacket__file__header.html#143bc467378ffbd0460662bd8912082b">00110</a> USHORT <a class="code" href="structpacket__file__header.html#143bc467378ffbd0460662bd8912082b" title="Libpcap minor version.">version_minor</a>; <a name="l00111"></a><a class="code" href="structpacket__file__header.html#b0f3e0ccc83861eb84cd3da32f01f090">00111</a> UINT <a class="code" href="structpacket__file__header.html#b0f3e0ccc83861eb84cd3da32f01f090" title="Gmt to local correction.">thiszone</a>; <a name="l00112"></a><a class="code" href="structpacket__file__header.html#5938c470e9e548ad2ac04923725e7721">00112</a> UINT <a class="code" href="structpacket__file__header.html#5938c470e9e548ad2ac04923725e7721" title="Accuracy of timestamps.">sigfigs</a>; <a name="l00113"></a><a class="code" href="structpacket__file__header.html#45b189420d67014dba25bd13da85ddae">00113</a> UINT <a class="code" href="structpacket__file__header.html#45b189420d67014dba25bd13da85ddae" title="Length of the max saved portion of each packet.">snaplen</a>; <a name="l00114"></a><a class="code" href="structpacket__file__header.html#b2a8854181cde7a065a43380b56fd2a1">00114</a> UINT <a class="code" href="structpacket__file__header.html#b2a8854181cde7a065a43380b56fd2a1" title="Data link type (DLT_*). See win_bpf.h for details.">linktype</a>; <a name="l00115"></a>00115 };<a name="l00116"></a>00116 <a name="l00121"></a><a class="code" href="structsf__pkthdr.html">00121</a> <span class="keyword">struct </span><a class="code" href="structsf__pkthdr.html" title="Header associated to a packet in the driver&#39;s buffer when the driver is in dump...">sf_pkthdr</a> {<a name="l00122"></a><a class="code" href="structsf__pkthdr.html#21be78b2818c91cb205885b8a6f5aed8">00122</a> <span class="keyword">struct </span>timeval <a class="code" href="structsf__pkthdr.html#21be78b2818c91cb205885b8a6f5aed8" title="time stamp">ts</a>; <a name="l00123"></a><a class="code" href="structsf__pkthdr.html#ddde4bcd837b0ac2f4ab6472162c8ec2">00123</a> UINT <a class="code" href="structsf__pkthdr.html#ddde4bcd837b0ac2f4ab6472162c8ec2">caplen</a>; <a name="l00124"></a>00124 <a name="l00125"></a>00125 <a name="l00126"></a><a class="code" href="structsf__pkthdr.html#acda8195c98d3cc32ebece7b17dac774">00126</a> UINT <a class="code" href="structsf__pkthdr.html#acda8195c98d3cc32ebece7b17dac774" title="Length of the original packet (off wire).">len</a>; <a name="l00127"></a>00127 };<a name="l00128"></a>00128 <a name="l00129"></a>00129 <span class="comment">//</span><a name="l00130"></a>00130 <span class="comment">// NT4 DDK doesn't have C_ASSERT</span><a name="l00131"></a>00131 <span class="comment">//</span><a name="l00132"></a>00132 <span class="preprocessor">#ifndef C_ASSERT</span><a name="l00133"></a><a class="code" href="group__NPF__include.html#g7300b6880da1b61717e7ff815d579bf6">00133</a> <span class="preprocessor"></span><span class="preprocessor">#define C_ASSERT(a)</span><a name="l00134"></a>00134 <span class="preprocessor"></span><span class="preprocessor">#endif</span><a name="l00135"></a>00135 <span class="preprocessor"></span><a name="l00143"></a><a class="code" href="struct__PACKET__OID__DATA.html">00143</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__PACKET__OID__DATA.html" title="Structure containing an OID request.">_PACKET_OID_DATA</a> {<a name="l00144"></a><a class="code" href="struct__PACKET__OID__DATA.html#7f776f07ead21514e4c48555980644c8">00144</a> ULONG <a class="code" href="struct__PACKET__OID__DATA.html#7f776f07ead21514e4c48555980644c8">Oid</a>; <a name="l00145"></a>00145 <a name="l00146"></a><a class="code" href="struct__PACKET__OID__DATA.html#bfb371817eb1c8f0d8a165bb2b798092">00146</a> ULONG <a class="code" href="struct__PACKET__OID__DATA.html#bfb371817eb1c8f0d8a165bb2b798092" title="Length of the data field.">Length</a>; <a name="l00147"></a><a class="code" href="struct__PACKET__OID__DATA.html#4cbcc2ef0ca2424d2488748b944f4507">00147</a> UCHAR <a class="code" href="struct__PACKET__OID__DATA.html#4cbcc2ef0ca2424d2488748b944f4507">Data</a>[1]; <a name="l00148"></a>00148 <a name="l00149"></a>00149 }<a name="l00150"></a>00150 <a class="code" href="struct__PACKET__OID__DATA.html" title="Structure containing an OID request.">PACKET_OID_DATA</a>, *<a class="code" href="struct__PACKET__OID__DATA.html" title="Structure containing an OID request.">PPACKET_OID_DATA</a>;<a name="l00151"></a>00151 <a name="l00152"></a>00152 <a class="code" href="group__NPF__include.html#g7300b6880da1b61717e7ff815d579bf6">C_ASSERT</a>(<span class="keyword">sizeof</span>(<a class="code" href="struct__PACKET__OID__DATA.html" title="Structure containing an OID request.">PACKET_OID_DATA</a>) == 12);<a name="l00153"></a>00153 <a name="l00163"></a><a class="code" href="struct__INTERNAL__REQUEST.html">00163</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__INTERNAL__REQUEST.html" title="Stores an OID request.">_INTERNAL_REQUEST</a> {<a name="l00164"></a><a class="code" href="struct__INTERNAL__REQUEST.html#52c50c47cc14f9989d741158ef6da1b9">00164</a> LIST_ENTRY <a class="code" href="struct__INTERNAL__REQUEST.html#52c50c47cc14f9989d741158ef6da1b9" title="Used to handle lists of requests.">ListElement</a>; <a name="l00165"></a>00165 <span class="comment">// PIRP Irp; ///< Irp that performed the request</span><a name="l00166"></a>00166 <span class="comment">// BOOLEAN Internal; ///< True if the request is for internal use of npf.sys. False if the request is performed by the user through an IOCTL.</span><a name="l00167"></a><a class="code" href="struct__INTERNAL__REQUEST.html#a27c26f410846e10408bc8ac558430b9">00167</a> NDIS_EVENT <a class="code" href="struct__INTERNAL__REQUEST.html#a27c26f410846e10408bc8ac558430b9">InternalRequestCompletedEvent</a>;<a name="l00168"></a><a class="code" href="struct__INTERNAL__REQUEST.html#9d22abed5e537b5a86700c0cae0aeeda">00168</a> NDIS_REQUEST <a class="code" href="struct__INTERNAL__REQUEST.html#9d22abed5e537b5a86700c0cae0aeeda" title="The structure with the actual request, that will be passed to NdisRequest().">Request</a>; <a name="l00169"></a><a class="code" href="struct__INTERNAL__REQUEST.html#1948690a3012c81acf392ba489b32b60">00169</a> NDIS_STATUS <a class="code" href="struct__INTERNAL__REQUEST.html#1948690a3012c81acf392ba489b32b60">RequestStatus</a>;<a name="l00170"></a>00170 <a name="l00171"></a>00171 } <a class="code" href="struct__INTERNAL__REQUEST.html" title="Stores an OID request.">INTERNAL_REQUEST</a>, *<a class="code" href="struct__INTERNAL__REQUEST.html" title="Stores an OID request.">PINTERNAL_REQUEST</a>;<a name="l00172"></a>00172 <a name="l00180"></a><a class="code" href="struct__PACKET__RESERVED.html">00180</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__PACKET__RESERVED.html" title="Contains a NDIS packet.">_PACKET_RESERVED</a> {<a name="l00181"></a><a class="code" href="struct__PACKET__RESERVED.html#52c50c47cc14f9989d741158ef6da1b9">00181</a> LIST_ENTRY <a class="code" href="struct__PACKET__RESERVED.html#52c50c47cc14f9989d741158ef6da1b9" title="Used to handle lists of packets.">ListElement</a>; <a name="l00182"></a><a class="code" href="struct__PACKET__RESERVED.html#4bee02d146b824008b9d03379b085b1e">00182</a> PIRP <a class="code" href="struct__PACKET__RESERVED.html#4bee02d146b824008b9d03379b085b1e" title="Irp that performed the request.">Irp</a>; <a name="l00183"></a><a class="code" href="struct__PACKET__RESERVED.html#3bbb67b64845622d97356325852ef6be">00183</a> PMDL <a class="code" href="struct__PACKET__RESERVED.html#3bbb67b64845622d97356325852ef6be" title="MDL mapping the buffer of the packet.">pMdl</a>; <a name="l00184"></a><a class="code" href="struct__PACKET__RESERVED.html#bc42eac7c5d3593aa809edceadb0743f">00184</a> BOOLEAN <a class="code" href="struct__PACKET__RESERVED.html#bc42eac7c5d3593aa809edceadb0743f">FreeBufAfterWrite</a>; <a name="l00185"></a>00185 <a name="l00186"></a><a class="code" href="struct__PACKET__RESERVED.html#761baf004d76cf5faf3c898787fceeb6">00186</a> ULONG <a class="code" href="struct__PACKET__RESERVED.html#761baf004d76cf5faf3c898787fceeb6" title="The CPU on which the packet was pulled out of the linked list of free packets.">Cpu</a>; <a name="l00187"></a>00187 } <a class="code" href="struct__PACKET__RESERVED.html" title="Contains a NDIS packet.">PACKET_RESERVED</a>, *<a class="code" href="struct__PACKET__RESERVED.html" title="Contains a NDIS packet.">PPACKET_RESERVED</a>;<a name="l00188"></a>00188 <a name="l00189"></a><a class="code" href="group__NPF__include.html#g048ba8dfabc6ac16c602a1ca6fe994fc">00189</a> <span class="preprocessor">#define RESERVED(_p) ((PPACKET_RESERVED)((_p)->ProtocolReserved)) </span><a name="l00190"></a>00190 <span class="preprocessor"></span><a name="l00191"></a>00191 <span class="preprocessor"></span><a name="l00196"></a><a class="code" href="struct__DEVICE__EXTENSION.html">00196</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__DEVICE__EXTENSION.html" title="Port device extension.">_DEVICE_EXTENSION</a> {<a name="l00197"></a><a class="code" href="struct__DEVICE__EXTENSION.html#8201dab43dd06ad55b93317cbbd54211">00197</a> NDIS_STRING <a class="code" href="struct__DEVICE__EXTENSION.html#8201dab43dd06ad55b93317cbbd54211" title="Name of the adapter.">AdapterName</a>; <a name="l00198"></a><a class="code" href="struct__DEVICE__EXTENSION.html#147b6ff0677e88b5721e51ab7759121a">00198</a> PWSTR <a class="code" href="struct__DEVICE__EXTENSION.html#147b6ff0677e88b5721e51ab7759121a">ExportString</a>; <a name="l00199"></a>00199 <a name="l00200"></a>00200 } <a class="code" href="struct__DEVICE__EXTENSION.html" title="Port device extension.">DEVICE_EXTENSION</a>, *<a class="code" href="struct__DEVICE__EXTENSION.html" title="Port device extension.">PDEVICE_EXTENSION</a>;<a name="l00201"></a>00201 <a name="l00207"></a><a class="code" href="struct____CPU__Private__Data.html">00207</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct____CPU__Private__Data.html" title="Kernel buffer of each CPU.">__CPU_Private_Data</a><a name="l00208"></a>00208 {<a name="l00209"></a><a class="code" href="struct____CPU__Private__Data.html#897d2179904e0d6fafd73b3d400052de">00209</a> ULONG <a class="code" href="struct____CPU__Private__Data.html#897d2179904e0d6fafd73b3d400052de" title="Zero-based index of the producer in the buffer. It indicates the first free byte...">P</a>; <a name="l00210"></a><a class="code" href="struct____CPU__Private__Data.html#2df61425b58c12f1de6f0e6aaeb131ea">00210</a> ULONG <a class="code" href="struct____CPU__Private__Data.html#2df61425b58c12f1de6f0e6aaeb131ea" title="Zero-based index of the consumer in the buffer. It indicates the first free byte...">C</a>; <a name="l00211"></a><a class="code" href="struct____CPU__Private__Data.html#caf5ef1e959170b06d01fc65a27bb951">00211</a> ULONG <a class="code" href="struct____CPU__Private__Data.html#caf5ef1e959170b06d01fc65a27bb951" title="Number of the free bytes in the buffer.">Free</a>; <a name="l00212"></a><a class="code" href="struct____CPU__Private__Data.html#7ed9f5e612c567cfa25af0f46a25dad4">00212</a> PUCHAR <a class="code" href="struct____CPU__Private__Data.html#7ed9f5e612c567cfa25af0f46a25dad4" title="Pointer to the kernel buffer used to capture packets.">Buffer</a>; <a name="l00213"></a><a class="code" href="struct____CPU__Private__Data.html#c723ebbda9ff2ef8e4d773c7305db1f6">00213</a> ULONG <a class="code" href="struct____CPU__Private__Data.html#c723ebbda9ff2ef8e4d773c7305db1f6">Accepted</a>; <a name="l00214"></a>00214 <a name="l00215"></a>00215 <a name="l00216"></a>00216 <a name="l00217"></a><a class="code" href="struct____CPU__Private__Data.html#82febc79f3f3bbf857a4fd34447b5ca2">00217</a> ULONG <a class="code" href="struct____CPU__Private__Data.html#82febc79f3f3bbf857a4fd34447b5ca2">Received</a>; <a name="l00218"></a>00218 <a name="l00219"></a>00219 <a name="l00220"></a>00220 <a name="l00221"></a><a class="code" href="struct____CPU__Private__Data.html#04eecb86252e644a73f38346274340dc">00221</a> ULONG <a class="code" href="struct____CPU__Private__Data.html#04eecb86252e644a73f38346274340dc">Dropped</a>; <a name="l00222"></a>00222 <a name="l00223"></a>00223 <a name="l00224"></a>00224 <a name="l00225"></a><a class="code" href="struct____CPU__Private__Data.html#59c9030d87b24c9cb4efdabe9c7b9337">00225</a> NDIS_SPIN_LOCK <a class="code" href="struct____CPU__Private__Data.html#59c9030d87b24c9cb4efdabe9c7b9337" title="It protects the buffer associated with this CPU.">BufferLock</a>; <a name="l00226"></a><a class="code" href="struct____CPU__Private__Data.html#cae03ade5065032ceaeef0bd03217b4f">00226</a> PMDL <a class="code" href="struct____CPU__Private__Data.html#cae03ade5065032ceaeef0bd03217b4f" title="MDL used to map the portion of the buffer that will contain an incoming packet.">TransferMdl1</a>; <a name="l00227"></a><a class="code" href="struct____CPU__Private__Data.html#17b59e156d00ef5c76bdfe454c73ca49">00227</a> PMDL <a class="code" href="struct____CPU__Private__Data.html#17b59e156d00ef5c76bdfe454c73ca49" title="Second MDL used to map the portion of the buffer that will contain an incoming packet...">TransferMdl2</a>; <a name="l00228"></a><a class="code" href="struct____CPU__Private__Data.html#58f2c915dfc7041ccb0d568eb79b494e">00228</a> ULONG <a class="code" href="struct____CPU__Private__Data.html#58f2c915dfc7041ccb0d568eb79b494e" title="Used by NdisTransferData() (when we call NdisTransferData, p index must be updated...">NewP</a>; <a name="l00229"></a>00229 }<a name="l00230"></a>00230 <a class="code" href="struct____CPU__Private__Data.html" title="Kernel buffer of each CPU.">CpuPrivateData</a>;<a name="l00231"></a>00231 <a name="l00232"></a>00232 <a name="l00240"></a><a class="code" href="struct__OPEN__INSTANCE.html">00240</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__OPEN__INSTANCE.html" title="Contains the state of a running instance of the NPF driver.">_OPEN_INSTANCE</a><a name="l00241"></a>00241 {<a name="l00242"></a><a class="code" href="struct__OPEN__INSTANCE.html#aa72c26b5a1b98197da412302325e009">00242</a> PDEVICE_EXTENSION <a class="code" href="struct__OPEN__INSTANCE.html#aa72c26b5a1b98197da412302325e009">DeviceExtension</a>; <a name="l00243"></a>00243 <a name="l00244"></a><a class="code" href="struct__OPEN__INSTANCE.html#a017f65671fb96e4a0d3e875536579df">00244</a> NDIS_HANDLE <a class="code" href="struct__OPEN__INSTANCE.html#a017f65671fb96e4a0d3e875536579df" title="NDIS idetifier of the adapter used by this instance.">AdapterHandle</a>; <a name="l00245"></a><a class="code" href="struct__OPEN__INSTANCE.html#f6a81c046e634d6149550d3475924c05">00245</a> UINT <a class="code" href="struct__OPEN__INSTANCE.html#f6a81c046e634d6149550d3475924c05">Medium</a>; <a name="l00246"></a>00246 <a name="l00247"></a><a class="code" href="struct__OPEN__INSTANCE.html#bb035c7e10216edcf41fa1576fecca42">00247</a> NDIS_HANDLE <a class="code" href="struct__OPEN__INSTANCE.html#bb035c7e10216edcf41fa1576fecca42" title="Pool of NDIS_PACKET structures used to transfer the packets from and to the NIC driver...">PacketPool</a>; <a name="l00248"></a><a class="code" href="struct__OPEN__INSTANCE.html#be53f2762ef5451c80b2fcadeff59884">00248</a> KSPIN_LOCK <a class="code" href="struct__OPEN__INSTANCE.html#be53f2762ef5451c80b2fcadeff59884" title="SpinLock used to synchronize the OID requests.">RequestSpinLock</a>; <a name="l00249"></a><a class="code" href="struct__OPEN__INSTANCE.html#805c530d7fa5f6078b9170dc0cd03f5c">00249</a> LIST_ENTRY <a class="code" href="struct__OPEN__INSTANCE.html#805c530d7fa5f6078b9170dc0cd03f5c" title="List of pending OID requests.">RequestList</a>; <a name="l00250"></a><a class="code" href="struct__OPEN__INSTANCE.html#1836c9a11084bf113d902946c5c41499">00250</a> LIST_ENTRY <a class="code" href="struct__OPEN__INSTANCE.html#1836c9a11084bf113d902946c5c41499" title="List of pending adapter reset requests.">ResetIrpList</a>; <a name="l00251"></a><a class="code" href="struct__OPEN__INSTANCE.html#9a6854a154d332159dbcb19e5d104441">00251</a> <a class="code" href="struct__INTERNAL__REQUEST.html" title="Stores an OID request.">INTERNAL_REQUEST</a> <a class="code" href="struct__OPEN__INSTANCE.html#9a6854a154d332159dbcb19e5d104441" title="Array of structures that wrap every single OID request.">Requests</a>[<a class="code" href="group__NPF__include.html#g8fc96cee4177a369a99de7026ebeba81" title="Maximum number of simultaneous IOCTL requests.">MAX_REQUESTS</a>]; <a name="l00252"></a><a class="code" href="struct__OPEN__INSTANCE.html#006227bc7ca0b2df920a8adfb7740ecb">00252</a> PMDL <a class="code" href="struct__OPEN__INSTANCE.html#006227bc7ca0b2df920a8adfb7740ecb" title="Pointer to a Memory descriptor list (MDL) that maps the circular buffer&#39;s memory...">BufferMdl</a>; <a name="l00253"></a><a class="code" href="struct__OPEN__INSTANCE.html#6139735ab3e4fa797d344e314bba6473">00253</a> PKEVENT <a class="code" href="struct__OPEN__INSTANCE.html#6139735ab3e4fa797d344e314bba6473" title="Pointer to the event on which the read calls on this instance must wait.">ReadEvent</a>; <a name="l00254"></a><a class="code" href="struct__OPEN__INSTANCE.html#312a1a6ffddf98f960cd0ac2d56fce52">00254</a> PUCHAR <a class="code" href="struct__OPEN__INSTANCE.html#312a1a6ffddf98f960cd0ac2d56fce52">bpfprogram</a>; <a name="l00255"></a>00255 <a name="l00256"></a>00256 <a name="l00257"></a>00257 <a name="l00258"></a>00258 <a name="l00259"></a>00259 <span class="preprocessor">#ifdef _X86_</span><a name="l00260"></a>00260 <span class="preprocessor"></span> <a class="code" href="structJIT__BPF__Filter.html" title="Structure describing a x86 filtering program created by the jitter.">JIT_BPF_Filter</a> *Filter;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -