1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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)
}
}