restore: networking stack files from reflog (Phases 1-6)
Recovered from reflog commits 1c80937e and d0ecc067 after force-push data loss.
Includes: filter/, icmp_error.rs, slaac.rs, bond.rs, bridge.rs, gre.rs, ipip.rs,
qdisc.rs, tun.rs, vlan.rs, vxlan.rs, netfilter.rs, tun.rs, conntrack.rs, nat.rs,
rule.rs, table.rs, redbear-ufw/, dhcpv6d/, netdiag/ — 39 files total.
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
pub mod bond;
|
||||
pub mod bridge;
|
||||
pub mod ethernet;
|
||||
pub mod gre;
|
||||
pub mod ipip;
|
||||
pub mod loopback;
|
||||
pub mod stp;
|
||||
pub mod qdisc;
|
||||
pub mod tun;
|
||||
pub mod vlan;
|
||||
pub mod vxlan;
|
||||
|
||||
use std::rc::Rc;
|
||||
|
||||
@@ -30,6 +37,32 @@ pub trait LinkDevice {
|
||||
|
||||
fn ip_address(&self) -> Option<IpCidr>;
|
||||
fn set_ip_address(&mut self, addr: IpCidr);
|
||||
|
||||
fn arp_table(&self) -> String {
|
||||
String::new()
|
||||
}
|
||||
|
||||
fn flush_arp(&mut self) {}
|
||||
|
||||
fn mtu(&self) -> usize {
|
||||
1500
|
||||
}
|
||||
|
||||
fn link_state(&self) -> &'static str {
|
||||
"unknown"
|
||||
}
|
||||
|
||||
fn statistics(&self) -> Stats {
|
||||
Stats::default()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Copy)]
|
||||
pub struct Stats {
|
||||
pub rx_bytes: u64,
|
||||
pub rx_packets: u64,
|
||||
pub tx_bytes: u64,
|
||||
pub tx_packets: u64,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
||||
Reference in New Issue
Block a user