Crates.io | winfw |
lib.rs | winfw |
version | 0.1.8 |
source | src |
created_at | 2021-06-19 04:04:37.348429 |
updated_at | 2022-11-27 11:00:35.135072 |
description | Interact with the Windows Firewall from Rust |
homepage | |
repository | https://github.com/marirs/winfw-rs |
max_upload_size | |
id | 411981 |
size | 52,269 |
Interact with the Windows Firewall from Rust. Bindings for Windows Firewall, with clean & simple API for use with Rust.
This crate can perform the following:
Cargo.toml:
[target.'cfg(windows)'.dependencies]
winfw = "0.1.8"
main.rs:
use winfw::get_fw_rules;
fn main() {
// enumerating fw rules
let rules = get_fw_rules();
match rules {
Err(rules) => println!("Error: {}", rules),
Ok(rules) => {
for rule in rules.iter() {
println!("{}", rule);
}
}
}
}
cargo run --example list_all_rules
cargo run --example add_new_rule
cargo run --example del_rule
cargo run --example disable_rule
License: MIT/Apache 2.0