use crate::{Handle, IpVersion, RuleAddRequest, RuleDelRequest, RuleGetRequest};
use netlink_packet_route::RuleMessage;
pub struct RuleHandle(Handle);
impl RuleHandle {
pub fn new(handle: Handle) -> Self {
RuleHandle(handle)
}
pub fn get(&self, ip_version: IpVersion) -> RuleGetRequest {
RuleGetRequest::new(self.0.clone(), ip_version)
}
pub fn add(&self) -> RuleAddRequest {
RuleAddRequest::new(self.0.clone())
}
pub fn del(&self, rule: RuleMessage) -> RuleDelRequest {
RuleDelRequest::new(self.0.clone(), rule)
}
}