A library wrapper for libipset
.
Support the following commands:
Support the following type:
```rust use std::net::IpAddr;
use ipset::{Error, HashIp, Session};
fn main() -> Result<(), Error> {
let mut session: Session
let ret = session.add(ip)?;
println!("add {}", ret);
let exists = session.test(ip)?;
println!("test {}", exists);
let ips = session.list()?;
for ip in ips {
println!("list {}", ip);
}
let ret = session.del(ip)?;
println!("del {}", ret);
let ret = session.flush()?;
println!("flush {}", ret);
let ret = session.destroy()?;
println!("destroy {}", ret);
Ok(())
} ```