Fix ipd
This commit is contained in:
parent
67440cf835
commit
933086d390
4 changed files with 40 additions and 16 deletions
|
@ -22,10 +22,6 @@ impl Interface for LoopbackInterface {
|
|||
self.ip
|
||||
}
|
||||
|
||||
fn arp_event(&mut self) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn recv(&mut self) -> Result<Vec<Ipv4>> {
|
||||
let mut ips = Vec::new();
|
||||
|
||||
|
@ -41,4 +37,12 @@ impl Interface for LoopbackInterface {
|
|||
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
fn arp_event(&mut self) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn has_loopback_data(&self) -> bool {
|
||||
! self.packets.is_empty()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,10 @@ mod loopback;
|
|||
|
||||
pub trait Interface {
|
||||
fn ip(&self) -> Ipv4Addr;
|
||||
fn arp_event(&mut self) -> Result<()>;
|
||||
fn recv(&mut self) -> Result<Vec<Ipv4>>;
|
||||
fn send(&mut self, ip: Ipv4) -> Result<usize>;
|
||||
|
||||
fn arp_event(&mut self) -> Result<()>;
|
||||
|
||||
fn has_loopback_data(&self) -> bool { false }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue