ipset-sys

Crates.ioipset-sys
lib.rsipset-sys
version0.1.5
sourcesrc
created_at2022-08-02 13:47:06.36139
updated_at2022-08-08 18:03:17.038897
descriptionipset lib bindings
homepagehttps://crates.io/crates/ipset-sys
repositoryhttps://github.com/pldubouilh/ipset-sys
max_upload_size
id637351
size19,531
Pierre Dubouilh (pldubouilh)

documentation

https://docs.rs/crate/ipset-sys/latest

README

ipset-sys

crate.io

A small crate to talk to ipset from rust.

supports both regular libipset commands, and custom/faster handler for adding ipv4 to sets

Example

    use ipset_sys::IpsetSys;

    fn main() {
        let mut is = IpsetSys::init().unwrap()

        // regular libipset command
        is.run("create bob hash:ip timeout 3600").unwrap()

        // custom ipv4 handler to add to a set
        let addr = std::net::Ipv4Addr::new(1, 4, 4, 4);
        is.add_v4("bob", addr).unwrap()

        is.run("destroy bob").unwrap();
 }
Commit count: 5

cargo fmt