use crate::{Handle, NeighbourAddRequest, NeighbourDelRequest, NeighbourGetRequest};
use netlink_packet_route::NeighbourMessage;
use std::net::IpAddr;
pub struct NeighbourHandle(Handle);
impl NeighbourHandle {
pub fn new(handle: Handle) -> Self {
NeighbourHandle(handle)
}
pub fn get(&self) -> NeighbourGetRequest {
NeighbourGetRequest::new(self.0.clone())
}
pub fn add(&self, index: u32, destination: IpAddr) -> NeighbourAddRequest {
NeighbourAddRequest::new(self.0.clone(), index, destination)
}
pub fn add_bridge(&self, index: u32, lla: &[u8]) -> NeighbourAddRequest {
NeighbourAddRequest::new_bridge(self.0.clone(), index, lla)
}
pub fn del(&self, message: NeighbourMessage) -> NeighbourDelRequest {
NeighbourDelRequest::new(self.0.clone(), message)
}
}