7 releases (breaking)

0.7.0-beta.0 Dec 8, 2024
0.6.0 May 26, 2023
0.5.5 Mar 23, 2023
0.5.1 Dec 21, 2022
0.1.0 Feb 13, 2021

#725 in Network programming

Download history 52/week @ 2024-08-30 12/week @ 2024-09-06 18/week @ 2024-09-13 64/week @ 2024-09-20 73/week @ 2024-09-27 17/week @ 2024-10-04 93/week @ 2024-10-11 25/week @ 2024-10-18 92/week @ 2024-10-25 62/week @ 2024-11-01 7/week @ 2024-11-08 11/week @ 2024-11-15 35/week @ 2024-11-22 84/week @ 2024-11-29 165/week @ 2024-12-06 54/week @ 2024-12-13

341 downloads per month
Used in fumble

LGPL-3.0-or-later

1MB
21K SLoC

C 16K SLoC // 0.1% comments Rust 4K SLoC // 0.0% comments Visual Studio Project 449 SLoC // 0.5% comments Shell 216 SLoC // 0.3% comments Batch 99 SLoC // 0.4% comments Monkey C 22 SLoC // 0.6% comments Bitbake 9 SLoC

WinDivert 2 Rust Wrapper

GitHub

Note: This is a work in process, so the crates won't follow semantic versioning until 1.0.0 release, so any version change below 1.0.0 might introduce breaking changes in the API or the crate usage in general.

This projects allows you to use WinDivert from rust. It consists of two crates:

  • windivert-sys crates.io docs dependency status: Crate providing raw bindings to the WinDivert user mode library.
  • windivert crates.io docs dependency status: (WIP) Built on top of windivert-sys and providing a friendlier Rust API and some abstractions.

Build

To be able to build windivert-sys you require WinDivert library files:

  • It's recommended to specify the path of the folder containing downloaded dll, lib & sys files using the WINDIVERT_PATH environment variable.
  • As a fallback windivert dll & lib files can be compiled from source if the vendored feature is enabled. To avoid multiple compilations set WINDIVERT_DLL_OUTPUT environment variable to save the generated build.
  • It's possible to compile for statically linking to the windivert library by enabling the static feature. Static linking can also be enabled if the WINDIVERT_STATIC is set and it takes priority over the crate features.
  • Any vendoring method will only compile the library. Sys files must always be provided.

Usage

  • windivert-sys shares the same API the native library uses. Read official documentation for more details.
  • windivert WIP

Note: WinDivert dll expects the corresponding driver sys file to be located on the same folder. Since the dll lib & sys files come in the same folder when downloading from official web windivert-sys will search for it on the path provided with WINDIVERT_PATH.

Dependencies

~129MB
~2M SLoC