use crate::{Handle, IpVersion, RouteAddRequest, RouteDelRequest, RouteGetRequest};
use netlink_packet_route::RouteMessage;
pub struct RouteHandle(Handle);
impl RouteHandle {
pub fn new(handle: Handle) -> Self {
RouteHandle(handle)
}
pub fn get(&self, ip_version: IpVersion) -> RouteGetRequest {
RouteGetRequest::new(self.0.clone(), ip_version)
}
pub fn add(&self) -> RouteAddRequest {
RouteAddRequest::new(self.0.clone())
}
pub fn del(&self, route: RouteMessage) -> RouteDelRequest {
RouteDelRequest::new(self.0.clone(), route)
}
}