- Notifications
You must be signed in to change notification settings - Fork26
yaa110/rust-iptables
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This crate provides bindings foriptables application in Linux (inspired bygo-iptables). This crate uses iptables binary to manipulate chains and tables. This source code is licensed under MIT license that can be found in the LICENSE file.
[dependencies]iptables ="*"
1- Import the crateiptables
and manipulate chains:
let ipt = iptables::new(false).unwrap();assert!(ipt.new_chain("nat","NEWCHAINNAME").is_ok());assert!(ipt.append("nat","NEWCHAINNAME","-j ACCEPT").is_ok());assert!(ipt.exists("nat","NEWCHAINNAME","-j ACCEPT").unwrap());assert!(ipt.delete("nat","NEWCHAINNAME","-j ACCEPT").is_ok());assert!(ipt.delete_chain("nat","NEWCHAINNAME").is_ok());
For more information, please check the test file intests
folder.
About
Rust bindings for iptables
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.