NDISAPI-RS
NDISAPI-RS is a Rust crate for interacting with the Windows Packet Filter driver. It provides an easy-to-use, safe, and efficient interface to efficiently filter (inspect and modify) raw network packets at the NDIS level of the network stack with minimal impact on network activity.
Windows Packet Filter (WinpkFilter) is a high-performance, lightweight packet filtering framework for Windows, enabling developers to efficiently inspect, modify, and control raw network packets at the NDIS level. With user-friendly APIs and support for various Windows versions, WinpkFilter simplifies network packet manipulation without requiring kernel-mode programming expertise.
Features
- Enumerate network adapters
- Query and set network adapter properties
- Capture and analyze packets
- Filter and modify packets
- Send raw packets
Dependencies
- Rust 1.58.0 or later
- Windows 7, 8, 10, or 11
- Windows Packet Filter driver installed
Installation
Add the following to your Cargo.toml
file:
[]
= "0.4.2"
Usage
Here's an example of how to enumerate network adapters and print their information:
use ;
For more examples and in-depth usage, check out the documentation.
Demo
Here is an example of how to run the listadapters
example:
\D }
)
)
)
\D }
)
)
\D }
)
)
)
Following is the demonstration of the async-packthru example. For this scenario, we will assume that vEthernet (WLAN Virtual Switch)
is the default internet connection
=======================================================================================================
)
=======================================================================================================
)
=======================================================================================================
)
)
)
}
License
This project is licensed under the Apache License 2.0. See LICENSE for details.