Expand description
The NDISAPI crate is a Rust library that provides functionality for capturing and filtering network packets on Windows operating systems. The crate contains the following main modules: driver, ndisapi, async_api, and main.
§driver
The driver module provides low-level functionality for interacting with Windows Packet Filter driver, and is used by the ndisapi module to capture and filter network packets.
§ndisapi
The ndisapi module contains the main functionality for capturing and filtering network packets. This includes various structs and enums for representing packet data and filter settings, as well as an Ndisapi struct for interacting with the driver and performing packet capture and filtering operations.
§async_io
The async_io module provides asynchronous methods for managing and interacting with the network adapter. This includes
reading and writing Ethernet packets, and adjusting adapter settings. This is achieved through the use of async
functions,
which allow these operations to be performed without blocking the rest of your application.
§netlib
The netlib module provides functionality for interacting with the Windows IP Helper API. This includes structs and enums for representing network adapter information, IP addresses, and other network-related data.
Structs§
- The struct AsyncNdisapiAdapter represents a network adapter with its associated driver and relevant handles.
- A Rust struct that represents a range of byte values.
- A Rust struct that represents a data link layer filter.
- DirectionFlags represent various direction flags for packet processing.
- Eth802_3FilterFlags represent various filtering options for Ethernet 802.3 frames.
- This structure is used to define an Ethernet 802.3 filter based on various fields like source and destination addresses, and protocol.
- This structure represents a request for multiple Ethernet packets, containing a network adapter handle, packet number, packet success count, and an array of
EthPacket
instances. - This structure represents a request for multiple Ethernet packets, containing a network adapter handle, packet number, packet success count, and an array of
EthPacketMut
instances. - This structure represents an Ethernet packet with an optional reference to an
IntermediateBuffer
. - This structure represents an Ethernet packet with an optional mutable reference to an
IntermediateBuffer
. - This structure represents a request for an Ethernet packet, containing a network adapter handle and an
EthPacket
. - This structure represents a request for an Ethernet packet, containing a network adapter handle and an
EthPacketMut
. - This structure represents a Fast I/O section, which includes a FastIoSectionHeader and an array of IntermediateBuffer structures. It is used to store information about packet data and the state of read and write operations.
- This structure is used as the header for the FastIoSection structure, containing the FastIoWriteUnion and a flag indicating whether a read operation is in progress.
- FilterFlags represent various flags used for packet filtering.
- FilterLayerFlags represent the validation flags for various filter layers.
- A wrapper around
Uuid
to represent a GUID. - A Rust struct that represents an ICMP filter.
- IcmpFilterFlags represent various filtering options for ICMP packets.
- Wrapper for the
NET_LUID_LH
struct from thewindows
crate. - The
IntermediateBuffer
structure represents an intermediate buffer that stores packet data along with some additional information. This structure is used internally by the packet filter driver. IntermediateBufferArray
is a struct that holds an array of references toIntermediateBuffer
objects. It also keeps track of the number of initialized elements in the array.IntermediateBufferArrayMut
is a struct that holds an array of mutable references toIntermediateBuffer
objects. It also keeps track of the number of initialized elements in the array.- Represents an IPv4 address in a format used by the packet filtering mechanism.
- This structure is used to store information about an IPv6 address for packet filtering purposes.
- Represents network gateway information, storing IP address and hardware (MAC) address.
- This structure is used to represent an IPv4 address range based on a start and end IP address.
- Represents an IPv6 address range used by the packet filtering mechanism.
- This structure is used to represent an IPv4 subnet based on an IP address and a subnet mask.
- Represents an IPv6 subnet used by the packet filtering mechanism.
- Represents an IPv4 filter used by the packet filtering mechanism.
- IpV4FilterFlags represent various filtering options for IPv4 packets.
- This structure is used to define packet filtering rules for IPv6 packets.
- IpV6FilterFlags represent various filtering options for IPv6 packets.
- Represents information about a network adapter.
- A MAC address represented as a 6-byte array of unsigned integers.
- The
Ndisapi
struct represents an instance of the NDIS filter driver that provides access to network adapters and packets. - Represents information about a network adapter.
- A Rust struct that represents a network layer filter.
- This structure is used to make queries or set parameters on a network adapter.
- This structure is used to define a range of port numbers for packet filtering rules.
- This structure is a container for RAS (Remote Access Service) link information structures.
- The
SockAddrStorage
struct represents a socket address for IPv4 or IPv6 addresses. It can be created from various Windows socket address types and can be converted to astd::net::SocketAddr
. - This structure is used to define a single static filter rule for packet filtering. Each rule can specify filtering criteria at the data link, network, and transport layers. The structure also includes counters for incoming and outgoing packets and bytes that match the filter rule.
- This structure represents an array of static filter rules, each of which is defined by a
StaticFilter
structure. It is used to manage multiple filter rules for packet filtering in a table format. - This structure is used to define filtering rules for TCP and UDP packets.
- TcpUdpFilterFlags represent various filtering options for TCP and UDP packets.
- A Rust struct that represents a transport layer filter.
- A Rust struct that represents an unsorted read/send request.
- A Rust struct that represents an unsorted read request.
- Represents the version information for the NDIS filter driver.
Constants§
- ETHER_ADDR_LENGTH is the length of an Ethernet address in bytes.
- ETH_802_3 is a constant representing the 802.3 Ethernet standard.
- Drops the packet and prevents it from reaching the destination.
- Drops the packet and and redirects a copy of it for processing by user-mode application.
- Allows a packet to pass through the filter without any modification.
- Allows the packet to pass through the filter and redirects a copy of it for processing by user-mode application.
- Redirects the packet for processing in user-mode.
- Constant representing the ICMP protocol.
- Constant representing the IPv4 network protocols.
- Constant representing the IPv6 network protocols.
- Constant representing the IPv4 address range type.
- Constant representing the IPv6 address range type.
- Constant representing the IPv4 subnet type.
- Constant representing the IPv6 subnet type.
- Constant representing the TCP or UDP protocols.
Unions§
- A Rust union that holds an
Eth8023Filter
. - A Rust union representing either an IPv4 subnet (IpSubnetV4) or an IPv4 address range (IpRangeV4).
- This structure is used to store information about a particular address space for packet filtering purposes.
- A Rust union that holds either an
IpV4Filter
or anIpV6Filter
. - A Rust union that represents a transport layer filter.