Crate ndisapi

Source
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§

AsyncNdisapiAdapter
The struct AsyncNdisapiAdapter represents a network adapter with its associated driver and relevant handles.
ByteRange
A Rust struct that represents a range of byte values.
DataLinkLayerFilter
A Rust struct that represents a data link layer filter.
DirectionFlags
DirectionFlags represent various direction flags for packet processing.
Eth802_3FilterFlags
Eth802_3FilterFlags represent various filtering options for Ethernet 802.3 frames.
Eth8023Filter
This structure is used to define an Ethernet 802.3 filter based on various fields like source and destination addresses, and protocol.
EthMRequest
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.
EthMRequestMut
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.
EthPacketMut
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.
EthRequestMut
This structure represents a request for an Ethernet packet, containing a network adapter handle and an EthPacketMut.
FastIoSection
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.
FastIoSectionHeader
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
FilterFlags represent various flags used for packet filtering.
FilterLayerFlags
FilterLayerFlags represent the validation flags for various filter layers.
GuidWrapper
A wrapper around Uuid to represent a GUID.
IcmpFilter
A Rust struct that represents an ICMP filter.
IcmpFilterFlags
IcmpFilterFlags represent various filtering options for ICMP packets.
IfLuid
Wrapper for the NET_LUID_LH struct from the windows crate.
IntermediateBuffer
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
IntermediateBufferArray is a struct that holds an array of references to IntermediateBuffer objects. It also keeps track of the number of initialized elements in the array.
IntermediateBufferArrayMut
IntermediateBufferArrayMut is a struct that holds an array of mutable references to IntermediateBuffer objects. It also keeps track of the number of initialized elements in the array.
IpAddressV4
Represents an IPv4 address in a format used by the packet filtering mechanism.
IpAddressV6
This structure is used to store information about an IPv6 address for packet filtering purposes.
IpGatewayInfo
Represents network gateway information, storing IP address and hardware (MAC) address.
IpRangeV4
This structure is used to represent an IPv4 address range based on a start and end IP address.
IpRangeV6
Represents an IPv6 address range used by the packet filtering mechanism.
IpSubnetV4
This structure is used to represent an IPv4 subnet based on an IP address and a subnet mask.
IpSubnetV6
Represents an IPv6 subnet used by the packet filtering mechanism.
IpV4Filter
Represents an IPv4 filter used by the packet filtering mechanism.
IpV4FilterFlags
IpV4FilterFlags represent various filtering options for IPv4 packets.
IpV6Filter
This structure is used to define packet filtering rules for IPv6 packets.
IpV6FilterFlags
IpV6FilterFlags represent various filtering options for IPv6 packets.
IphlpNetworkAdapterInfo
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.
NetworkAdapterInfo
Represents information about a network adapter.
NetworkLayerFilter
A Rust struct that represents a network layer filter.
PacketOidData
This structure is used to make queries or set parameters on a network adapter.
PortRange
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.
SockAddrStorage
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 a std::net::SocketAddr.
StaticFilter
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.
StaticFilterTable
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.
TcpUdpFilter
This structure is used to define filtering rules for TCP and UDP packets.
TcpUdpFilterFlags
TcpUdpFilterFlags represent various filtering options for TCP and UDP packets.
TransportLayerFilter
A Rust struct that represents a transport layer filter.
UnsortedReadRequest
A Rust struct that represents an unsorted read/send request.
UnsortedSendRequest
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§

DataLinkLayerFilterUnion
A Rust union that holds an Eth8023Filter.
IpAddressV4Union
A Rust union representing either an IPv4 subnet (IpSubnetV4) or an IPv4 address range (IpRangeV4).
IpAddressV6Union
This structure is used to store information about a particular address space for packet filtering purposes.
NetworkLayerFilterUnion
A Rust union that holds either an IpV4Filter or an IpV6Filter.
TransportLayerFilterUnion
A Rust union that represents a transport layer filter.