feat: update ipset mng
This commit is contained in:
32
src/ipset.rs
32
src/ipset.rs
@@ -4,6 +4,38 @@ use std::process::Command;
|
||||
|
||||
const CMD_IPSET: &str = "ipset";
|
||||
|
||||
// TODO
|
||||
// list names
|
||||
// list ipsetname
|
||||
// add
|
||||
// del
|
||||
|
||||
struct IpSet {
|
||||
name: String,
|
||||
}
|
||||
|
||||
impl IpSet {
|
||||
pub fn list_names() -> Vec<String> {
|
||||
vec![]
|
||||
}
|
||||
|
||||
pub fn list(&self) -> Vec<String> {
|
||||
vec![]
|
||||
}
|
||||
|
||||
pub fn add(&self, ip: &str) -> () {}
|
||||
|
||||
pub fn del(&self, ip: &str) -> () {}
|
||||
}
|
||||
|
||||
fn list_names() {}
|
||||
|
||||
fn list_ipset(ipset_name: &str) {}
|
||||
|
||||
fn add_ipset(ipset_name: &str, ip: &str) {}
|
||||
|
||||
fn del_ipset(ipset_name: &str, ip: &str) {}
|
||||
|
||||
fn execute_ipset<I, S>(args: I) -> XResult<(Vec<u8>, Vec<u8>)>
|
||||
where
|
||||
I: IntoIterator<Item = S>,
|
||||
|
||||
Reference in New Issue
Block a user