use std::net::IpAddr;
use crate::{IpEntry, IpSetError, Result};
#[derive(Clone, Copy, Debug, Default)]
pub enum IpSetType {
#[default]
HashIp,
HashNet,
}
#[derive(Clone, Copy, Debug, Default)]
pub enum IpSetFamily {
#[default]
Inet,
Inet6,
}
#[derive(Clone, Debug, Default)]
pub struct IpSetCreateOptions {
pub set_type: IpSetType,
pub family: IpSetFamily,
pub hashsize: Option<u32>,
pub maxelem: Option<u32>,
pub timeout: Option<u32>,
}
#[derive(Clone, Copy, Debug, Default)]
pub enum NftSetType {
#[default]
Ipv4Addr,
Ipv6Addr,
}
#[derive(Clone, Debug, Default)]
pub struct NftSetCreateOptions {
pub set_type: NftSetType,
pub timeout: Option<u32>,
pub flags: Option<u32>,
}
pub fn ipset_create(_setname: &str, _options: &IpSetCreateOptions) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn ipset_destroy(_setname: &str) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn ipset_flush(_setname: &str) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn ipset_add<E: Into<IpEntry>>(_setname: &str, _entry: E) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn ipset_del<E: Into<IpEntry>>(_setname: &str, _entry: E) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn ipset_test<E: Into<IpEntry>>(_setname: &str, _entry: E) -> Result<bool> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn ipset_list(_setname: &str) -> Result<Vec<IpAddr>> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn nftset_create_table(_family: &str, _table: &str) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn nftset_delete_table(_family: &str, _table: &str) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn nftset_create_set(
_family: &str,
_table: &str,
_setname: &str,
_options: &NftSetCreateOptions,
) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn nftset_delete_set(_family: &str, _table: &str, _setname: &str) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn nftset_add<E: Into<IpEntry>>(
_family: &str,
_table: &str,
_setname: &str,
_entry: E,
) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn nftset_del<E: Into<IpEntry>>(
_family: &str,
_table: &str,
_setname: &str,
_entry: E,
) -> Result<()> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn nftset_test<E: Into<IpEntry>>(
_family: &str,
_table: &str,
_setname: &str,
_entry: E,
) -> Result<bool> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn nftset_list(_family: &str, _table: &str, _setname: &str) -> Result<Vec<IpAddr>> {
Err(IpSetError::UnsupportedPlatform)
}
pub fn nftset_list_tables(_family: &str) -> Result<Vec<String>> {
Err(IpSetError::UnsupportedPlatform)
}