Struct windivert_sys::WinDivertFlags[][src]

#[repr(transparent)]
pub struct WinDivertFlags(_);
Expand description

Flag type required by WinDivertOpen(). It follows a builder like style.

Different flags affect how the opened handle behaves. The following flags are supported:

  • sniff: This flag opens the WinDivert handle in packet sniffing mode. In packet sniffing mode the original packet is not dropped-and-diverted (the default) but copied-and-diverted. This mode is useful for implementing packet sniffing tools similar to those applications that currently use Winpcap.
  • drop: This flag indicates that the user application does not intend to read matching packets with recv() (or any of it’s variants), instead the packets should be silently dropped. This is useful for implementing simple packet filters using the WinDivert filter language.
  • recv_only: This flags forces the handle into receive only mode which effectively disables send() (and any of it’s variants). This means that it is possible to block/capture packets or events but not inject them.
  • send_only: This flags forces the handle into send only mode which effectively disables recv() (and any of it’s variants). This means that it is possible to inject packets or events, but not block/capture them.
  • no_installs: This flags causes WinDivertOpen to fail with ERROR_SERVICE_DOES_NOT_EXIST (1060) if the WinDivert driver is not already installed. This flag is useful for querying the WinDivert driver state using Reflect layer.
  • fragments: If set, the handle will capture inbound IP fragments, but not inbound reassembled IP packets. Otherwise, if not set (the default), the handle will capture inbound reassembled IP packets, but not inbound IP fragments. This flag only affects inbound packets at the Network layer, else the flag is ignored. Note that any combination of (snif | drop) or (recv_only | send_only) are considered invalid.

Some layers have mandatory flags:

Implementations

WinDivertFlags builder methods.

Creates a new flag field with all options unset.

Sets sniff flag.

Unsets sniff flag.

Sets drop flag.

Unsets drop flag.

Sets recv_only flag

Unsets recv_only flag

Sets send_only flag.

Unsets send_only flag.

Sets no_installs flag.

Unsets no_installs flag.

Sets fragments flag.

Unsets fragments flag.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.