{"id":18315299,"url":"https://github.com/wiresock/ndisapi-rs","last_synced_at":"2026-05-01T09:01:14.130Z","repository":{"id":170037473,"uuid":"646145397","full_name":"wiresock/ndisapi-rs","owner":"wiresock","description":"Rust crate for interacting with the Windows Packet Filter driver.","archived":false,"fork":false,"pushed_at":"2025-02-12T12:00:27.000Z","size":170,"stargazers_count":41,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-28T05:08:30.270Z","etag":null,"topics":["filter","packet","rust","windows"],"latest_commit_sha":null,"homepage":"https://www.ntkernel.com/windows-packet-filter/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiresock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-27T12:36:58.000Z","updated_at":"2025-04-01T18:47:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"64860a9a-a34f-4050-a0ed-808b7f640010","html_url":"https://github.com/wiresock/ndisapi-rs","commit_stats":null,"previous_names":["wiresock/ndisapi-rs"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiresock%2Fndisapi-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiresock%2Fndisapi-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiresock%2Fndisapi-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiresock%2Fndisapi-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiresock","download_url":"https://codeload.github.com/wiresock/ndisapi-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252038180,"owners_count":21684640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filter","packet","rust","windows"],"created_at":"2024-11-05T16:39:16.051Z","updated_at":"2026-05-01T09:01:14.124Z","avatar_url":"https://github.com/wiresock.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NDISAPI\n\n[![Crates.io](https://img.shields.io/crates/v/ndisapi.svg)](https://crates.io/crates/ndisapi)\n[![Documentation](https://docs.rs/ndisapi/badge.svg)](https://docs.rs/ndisapi)\n[![License](https://img.shields.io/crates/l/ndisapi)](https://github.com/wiresock/ndisapi/blob/main/LICENSE)\n\nNDISAPI is a Rust crate for interacting with the [Windows Packet Filter](https://www.ntkernel.com/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.\n\nWindows 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.\n\n## Features\n\n- Enumerate network adapters\n- Query and set network adapter properties\n- Capture and analyze packets\n- Filter and modify packets\n- Send raw packets\n\n## Dependencies\n\n- Rust 1.58.0 or later\n- Windows 7, 8, 10, or 11\n- [Windows Packet Filter](https://github.com/wiresock/ndisapi/releases) driver installed\n\n## Installation\n\nAdd the following to your `Cargo.toml` file:\n\n```toml\n[dependencies]\nndisapi = \"0.6.6\"\n```\n\n## Usage\n\nHere's an example of how to enumerate network adapters and print their information:\n\n```rust\nuse ndisapi::{MacAddress, Ndisapi};\n\nfn main() {\n    let ndis = Ndisapi::new(\"NDISRD\").expect(\"Failed to create NdisApi instance\");\n\n    let adapters = ndis\n        .get_tcpip_bound_adapters_info()\n        .expect(\"Failed to enumerate adapters\");\n\n    for adapter in adapters {\n        println!(\"Adapter: {:?}\", adapter.get_name());\n        println!(\n            \"Description: {:?}\",\n            Ndisapi::get_friendly_adapter_name(adapter.get_name()).unwrap_or(\"Unknown\".to_string())\n        );\n        println!(\n            \"MAC Address: {:?}\",\n            MacAddress::from_slice(adapter.get_hw_address()).unwrap_or_default()\n        );\n        println!(\"-------------------------------\");\n    }\n}\n```\n\nFor more examples and in-depth usage, check out the [documentation](https://docs.rs/ndisapi).\n\n## Demo\n\nHere is an example of how to run the `listadapters` example:\n\n```bash\nS D:\\github.com\\ndisapi-rs\u003e cargo run --example listadapters\n    Finished dev [unoptimized + debuginfo] target(s) in 0.12s\n     Running `target\\debug\\examples\\listadapters.exe`\nDetected Windows Packet Filter version 3.4.8\n1. Local Area Connection* 10\n        \\DEVICE\\{EDEE8C42-F604-4A7B-BFAA-6B110923217E}\n         Medium: 0\n         MAC: 9A:47:3D:60:26:9D\n         MTU: 1500\n         FilterFlags: FilterFlags(0x0)\nGetting OID_GEN_CURRENT_PACKET_FILTER Error: Data error (cyclic redundancy check).\n         OID_802_3_CURRENT_ADDRESS: 9A:47:3D:60:26:9D\n2. vEthernet (Default Switch)\n        \\DEVICE\\{BD64DB34-23DF-45C4-909E-780272A98BAE}\n         Medium: 0\n         MAC: 00:15:5D:01:8C:00\n         MTU: 1500\n         FilterFlags: FilterFlags(0x0)\n         OID_GEN_CURRENT_PACKET_FILTER: 0x0000000B\n         OID_802_3_CURRENT_ADDRESS: 00:15:5D:01:8C:00\n...\n11. vEthernet (WLAN Virtual Switch)\n        \\DEVICE\\{05F9267C-C548-4822-8535-9A57F1A99DB7}\n         Medium: 0\n         MAC: 18:47:3D:60:26:9D\n         MTU: 1500\n         FilterFlags: FilterFlags(0x0)\n         OID_GEN_CURRENT_PACKET_FILTER: 0x0000000B\n         OID_802_3_CURRENT_ADDRESS: 18:47:3D:60:26:9D\n\nSystem wide MTU decrement: 0\n\nSystem wide network adapter startup filter mode: 0\n\nDriver intermediate buffer pool size multiplier: 0\n\nEffective intermediate buffer pool size: 2048\n\n```\n\nFollowing is the demonstration of the async-packthru example. For this scenario, we will assume that `vEthernet (WLAN Virtual Switch)` is the default internet connection\n\n```bash\nPS D:\\github.com\\ndisapi-rs\u003e cargo run --example async-packthru -- --interface-index 11\n    Finished dev [unoptimized + debuginfo] target(s) in 0.11s\n     Running `target\\debug\\examples\\async-packthru.exe --interface-index 11`\nDetected Windows Packet Filter version 3.4.8\nUsing interface \\DEVICE\\{05F9267C-C548-4822-8535-9A57F1A99DB7}\nPress ENTER to exit\n```\n![image](https://github.com/wiresock/ndisapi-rs/assets/20592735/ae6c66fc-70b2-4de2-bd6c-3ecd09b8f123)\n\n## License\n\nThis project is licensed under the Apache License 2.0. See [LICENSE](https://github.com/wiresock/ndisapi/blob/main/LICENSE) for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiresock%2Fndisapi-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiresock%2Fndisapi-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiresock%2Fndisapi-rs/lists"}