mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-07-04 18:48:43 +08:00
20 lines
462 B
Rust
20 lines
462 B
Rust
use netutils::{Ipv4, Ipv4Addr};
|
|
use std::io::Result;
|
|
|
|
pub use self::ethernet::EthernetInterface;
|
|
pub use self::loopback::LoopbackInterface;
|
|
|
|
mod ethernet;
|
|
mod loopback;
|
|
|
|
pub trait Interface {
|
|
fn ip(&self) -> Ipv4Addr;
|
|
fn routable(&self, dst: Ipv4Addr) -> bool;
|
|
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 }
|
|
}
|