diff --git a/doc/windivert.html b/doc/windivert.html index 7ab2d9c..5828015 100644 --- a/doc/windivert.html +++ b/doc/windivert.html @@ -40,11 +40,14 @@
Remarks
Opens a WinDivert handle for the given filter.
-Unless otherwise specified by flags, any packet that matches the
-filter will be diverted to the handle.
-Diverted packets can be read by the application with
+Unless otherwise specified by flags, any packet or event that
+matches the filter will be diverted to the handle.
+Diverted packets/events can be read by the application with
WinDivertRecv().
-A typical application is only interested in a subset of all network traffic. +A typical application is only interested in a subset of all network traffic +or events. In this case the filter should match as closely as possible to the subset of interest. This avoids unnecessary overheads introduced by diverting packets to the @@ -784,7 +800,10 @@ information.
The layer of the WinDivert handle is determined by the layer parameter. -Currently the following layers are supported. +See WINDIVERT_LAYER for more +information. +Currently the following layers are supported: +
| -The network layer. -This is the default. +Network packets to/from the local machine. +This is the default layer. | |
| -The network layer (forwarded packets). +Network packets passing through the local machine. + | +|
| +WINDIVERT_LAYER_FLOW + | ++Network flow established/deleted events. + | +
| +WINDIVERT_LAYER_SOCKET + | ++Socket operation events. + | +
| +WINDIVERT_LAYER_REFLECT + | ++WinDivert handle events. |
Different WinDivert handles can be assigned different priorities by the priority parameter. @@ -825,12 +867,14 @@ and so on, provided the packet matches the handle's filter. A packet is only diverted once per priority level, so handles should not share priority levels unless they use mutually exclusive filters. Otherwise it is not defined which handle will receive the packet first. -Lower priority values represent higher priorities, with -1000 -being the highest priority, 0 the middle (and a good default) -priority, and 1000 the lowest priority. +Lower priority values represent higher priorities, with +-30000 being the highest priority, 0 the middle +(and a good default) priority, and 30000 the lowest priority.
-The following flags are supported. +Different flags affect how the opened handle behaves. +The following flags are supported: +
| -WINDIVERT_FLAG_DEBUG +WINDIVERT_FLAG_RECV_ONLY |
-This flag causes WinDivertSend() to block
-until the injected packet exits the Windows TCP/IP stack.
-By default, WinDivertSend() does not
-block and returns immediately after the packet enters the
-TCP/IP stack.
-The default mode is faster, but will not return an error code if the
-packet is lost or rejected for any reason; making debugging difficult.
+This flags forces the handle into receive onlymode which effectively +disables WinDivertSend(). +This means that it is possible to block/capture packets or events but not +inject them. + |
+
| +WINDIVERT_FLAG_READ_ONLY + | ++An alias for WINDIVERT_FLAG_RECV_ONLY. + | +
| +WINDIVERT_FLAG_SEND_ONLY + | +
+This flags forces the handle into send onlymode which effectively +disables WinDivertRecv(). +This means that it is possible to inject packets or events, but not +block/capture them. + |
+
| +WINDIVERT_FLAG_WRITE_ONLY + | ++An alias for WINDIVERT_FLAG_SEND_ONLY. + | +
| +WINDIVERT_FLAG_RECV_PARTIAL + | +
+This flags enables partial receives. +By default, if a packet is too big for the buffer passed to +WinDivertRecv(), the operation +will fail with ERROR_INSUFFICIENT_BUFFER. +This flag silences this error and only copies part of the packet +up to the buffer size. +The WINDIVERT_FLAG_RECV_PARTIAL behavior was the default +on older (pre-2.0) versions of WinDivert. + |
++WINDIVERT_FLAG_NO_INSTALL + | ++This flags causes WinDivertOpen() to fail with +ERROR_SERVICE_DOES_NOT_EXIST if the WinDivert driver +is not already installed. +This flag is useful for querying the WinDivert state using a +WINDIVERT_LAYER_REFLECT handle. |
+Note that any combination of +(WINDIVERT_FLAG_SNIFF | WINDIVERT_FLAG_DROP) or +(WINDIVERT_FLAG_RECV_ONLY | WINDIVERT_FLAG_SEND_ONLY) or +(WINDIVERT_FLAG_RECV_PARTIAL | WINDIVERT_FLAG_SEND_ONLY) +are considered invalid.
++Some layers have mandatory flags, as listed below: +
+| +Layer + | ++Required Flags + | +
|---|---|
| +WINDIVERT_LAYER_FLOW + | ++WINDIVERT_FLAG_SNIFF | WINDIVERT_FLAG_RECV_ONLY + | +
| +WINDIVERT_LAYER_SOCKET + | ++WINDIVERT_FLAG_RECV_ONLY + | +
| +WINDIVERT_LAYER_REFLECT + | ++WINDIVERT_FLAG_SNIFF | WINDIVERT_FLAG_RECV_ONLY + | +
@@ -1272,7 +1409,7 @@ Use GetLastError() to get the reason for the error.
Closes a WinDivert handle created by
WinDivertOpen().
-5.10 WinDivertSetParam
5.11 WinDivertGetParam
|