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

  • The struct AsyncNdisapiAdapter represents a network adapter with its associated driver and relevant handles.
  • DirectionFlags represent various direction flags for packet processing.
  • Eth802_3FilterFlags represent various filtering options for Ethernet 802.3 frames.
  • 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 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 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.
  • IcmpFilterFlags represent various filtering options for ICMP packets.
  • Wrapper for the NET_LUID_LH struct from the windows 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.
  • Represents network gateway information, storing IP address and hardware (MAC) address.
  • IpV4FilterFlags represent various filtering options for IPv4 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.
  • This structure is used to make queries or set parameters on a network adapter.
  • 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 a std::net::SocketAddr.
  • 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 represent various filtering options for TCP and UDP packets.
  • A Rust struct that represents an unsorted read/send 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.