Crate ndisapi_rs

Crate ndisapi_rs 

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.
DirectionFlags
DirectionFlags represent various direction flags for packet processing.
Eth802_3FilterFlags
Eth802_3FilterFlags represent various filtering options for Ethernet 802.3 frames.
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.
EthPacket
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.
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.
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.
IpGatewayInfo
Represents network gateway information, storing IP address and hardware (MAC) address.
IpV4FilterFlags
IpV4FilterFlags represent various filtering options for IPv4 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.
PacketOidData
This structure is used to make queries or set parameters on a network adapter.
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.
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.
TcpUdpFilterFlags
TcpUdpFilterFlags represent various filtering options for TCP and UDP packets.
UnsortedReadSendRequest
A Rust struct that represents an unsorted read/send 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.