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§
- Async
Ndisapi Adapter - The struct AsyncNdisapiAdapter represents a network adapter with its associated driver and relevant handles.
- Byte
Range - A Rust struct that represents a range of byte values.
- Data
Link Layer Filter - A Rust struct that represents a data link layer filter.
- Direction
Flags - DirectionFlags represent various direction flags for packet processing.
- Eth802_
3Filter Flags - Eth802_3FilterFlags represent various filtering options for Ethernet 802.3 frames.
- Eth8023
Filter - This structure is used to define an Ethernet 802.3 filter based on various fields like source and destination addresses, and protocol.
- EthM
Request - 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. - EthM
Request Mut - 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. - EthPacket
- This structure represents an Ethernet packet with an optional reference to an
IntermediateBuffer
. - EthPacket
Mut - This structure represents an Ethernet packet with an optional mutable reference to an
IntermediateBuffer
. - EthRequest
- This structure represents a request for an Ethernet packet, containing a network adapter handle and an
EthPacket
. - EthRequest
Mut - This structure represents a request for an Ethernet packet, containing a network adapter handle and an
EthPacketMut
. - Fast
IoSection - 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.
- Fast
IoSection Header - 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.
- Filter
Flags - FilterFlags represent various flags used for packet filtering.
- Filter
Layer Flags - FilterLayerFlags represent the validation flags for various filter layers.
- Guid
Wrapper - A wrapper around
Uuid
to represent a GUID. - Icmp
Filter - A Rust struct that represents an ICMP filter.
- Icmp
Filter Flags - IcmpFilterFlags represent various filtering options for ICMP packets.
- IfLuid
- Wrapper for the
NET_LUID_LH
struct from thewindows
crate. - Intermediate
Buffer - 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. - Intermediate
Buffer Array 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.- Intermediate
Buffer Array Mut 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.- IpAddress
V4 - Represents an IPv4 address in a format used by the packet filtering mechanism.
- IpAddress
V6 - This structure is used to store information about an IPv6 address for packet filtering purposes.
- IpGateway
Info - Represents network gateway information, storing IP address and hardware (MAC) address.
- IpRange
V4 - This structure is used to represent an IPv4 address range based on a start and end IP address.
- IpRange
V6 - Represents an IPv6 address range used by the packet filtering mechanism.
- IpSubnet
V4 - This structure is used to represent an IPv4 subnet based on an IP address and a subnet mask.
- IpSubnet
V6 - Represents an IPv6 subnet used by the packet filtering mechanism.
- IpV4
Filter - Represents an IPv4 filter used by the packet filtering mechanism.
- IpV4
Filter Flags - IpV4FilterFlags represent various filtering options for IPv4 packets.
- IpV6
Filter - This structure is used to define packet filtering rules for IPv6 packets.
- IpV6
Filter Flags - IpV6FilterFlags represent various filtering options for IPv6 packets.
- Iphlp
Network Adapter Info - Represents information about a network adapter.
- MacAddress
- A MAC address represented as a 6-byte array of unsigned integers.
- Ndisapi
- The
Ndisapi
struct represents an instance of the NDIS filter driver that provides access to network adapters and packets. - Network
Adapter Info - Represents information about a network adapter.
- Network
Layer Filter - A Rust struct that represents a network layer filter.
- Packet
OidData - This structure is used to make queries or set parameters on a network adapter.
- Port
Range - This structure is used to define a range of port numbers for packet filtering rules.
- RasLinks
- This structure is a container for RAS (Remote Access Service) link information structures.
- Sock
Addr Storage - 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
. - Static
Filter - 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.
- Static
Filter Table - 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. - TcpUdp
Filter - This structure is used to define filtering rules for TCP and UDP packets.
- TcpUdp
Filter Flags - TcpUdpFilterFlags represent various filtering options for TCP and UDP packets.
- Transport
Layer Filter - A Rust struct that represents a transport layer filter.
- Unsorted
Read Request - A Rust struct that represents an unsorted read/send request.
- Unsorted
Send Request - A Rust struct that represents an unsorted read request.
- Version
- Represents the version information for the NDIS filter driver.
Constants§
- ETHER_
ADDR_ LENGTH - ETHER_ADDR_LENGTH is the length of an Ethernet address in bytes.
- ETH_
802_ 3 - ETH_802_3 is a constant representing the 802.3 Ethernet standard.
- FILTER_
PACKET_ DROP - Drops the packet and prevents it from reaching the destination.
- FILTER_
PACKET_ DROP_ RDR - Drops the packet and and redirects a copy of it for processing by user-mode application.
- FILTER_
PACKET_ PASS - Allows a packet to pass through the filter without any modification.
- FILTER_
PACKET_ PASS_ RDR - Allows the packet to pass through the filter and redirects a copy of it for processing by user-mode application.
- FILTER_
PACKET_ REDIRECT - Redirects the packet for processing in user-mode.
- ICMP
- Constant representing the ICMP protocol.
- IPV4
- Constant representing the IPv4 network protocols.
- IPV6
- Constant representing the IPv6 network protocols.
- IP_
RANGE_ V4_ TYPE - Constant representing the IPv4 address range type.
- IP_
RANGE_ V6_ TYPE - Constant representing the IPv6 address range type.
- IP_
SUBNET_ V4_ TYPE - Constant representing the IPv4 subnet type.
- IP_
SUBNET_ V6_ TYPE - Constant representing the IPv6 subnet type.
- TCPUDP
- Constant representing the TCP or UDP protocols.
Unions§
- Data
Link Layer Filter Union - A Rust union that holds an
Eth8023Filter
. - IpAddress
V4Union - A Rust union representing either an IPv4 subnet (IpSubnetV4) or an IPv4 address range (IpRangeV4).
- IpAddress
V6Union - This structure is used to store information about a particular address space for packet filtering purposes.
- Network
Layer Filter Union - A Rust union that holds either an
IpV4Filter
or anIpV6Filter
. - Transport
Layer Filter Union - A Rust union that represents a transport layer filter.