Skip to content

0.6.6

Choose a tag to compare

@wiresock wiresock released this 01 May 07:02
· 3 commits to refs/heads/main since this release
c234b77

Version 0.6.6 Release Notes

✨ New Features

Add new NDISAPI functions from upstream wiresock/ndisapi (#37)

This release adds Rust bindings for the new IOCTLs — indexes 30–36 — and corresponding API functions introduced in the upstream wiresock/ndisapi C++ project, enabling per-filter mutation and driver-side cache control without rebuilding the entire filter table.

New Ndisapi Methods

Per-filter mutation

  • add_packet_filter_front — push a filter to the front of the table
  • add_packet_filter_back — append a filter to the back of the table
  • insert_packet_filter — insert a filter at a specific position
  • remove_packet_filter — remove a filter by zero-based index

Packet filter cache

  • set_packet_filter_cache_state
  • enable_packet_filter_cache
  • disable_packet_filter_cache

Packet fragment cache

  • set_packet_fragment_cache_state
  • enable_packet_fragment_cache
  • disable_packet_fragment_cache

New IOCTL Constants

Defined in src/driver/ioctl.rs:

  • IOCTL_NDISRD_ADD_PACKET_FILTER_FRONT30
  • IOCTL_NDISRD_ADD_PACKET_FILTER_BACK31
  • IOCTL_NDISRD_REMOVE_FILTER_BY_INDEX32
  • IOCTL_NDISRD_GET_ADP_FILTERS_LIST33; constant only, no wrapper yet, matches upstream
  • IOCTL_NDISRD_INSERT_FILTER_BY_INDEX34
  • IOCTL_NDISRD_SET_FILTER_CACHE_STATE35
  • IOCTL_NDISRD_SET_FRAGMENT_CACHE_STATE36

New Struct

  • StaticFilterWithPosition#[repr(C, packed)] equivalent of _STATIC_FILTER_WITH_POSITION, containing a position: u32 followed by a StaticFilter. Re-exported from the crate root.

🧰 Maintenance

  • Bump crate version to 0.6.6.
  • Update README install snippet.

Example

use ndisapi::{Ndisapi, StaticFilter};

let api = Ndisapi::new("NDISRD")?;

// Add/insert/remove individual filters without rebuilding the whole table
api.add_packet_filter_front(&filter)?;
api.insert_packet_filter(&filter, 2)?;
api.remove_packet_filter(filter_index)?;

// Toggle driver-side caches
api.disable_packet_filter_cache()?;
api.enable_packet_fragment_cache()?;

Compatibility

No breaking changes — all additions are purely additive.

The new per-filter methods use the *_packet_filter_* prefix to stay consistent with the existing get_packet_filter_table / set_packet_filter_table API.