1 pub use smoltcp::wire::IpEndpoint; 2 3 /// @brief 链路层端点 4 #[derive(Debug, Clone)] 5 pub struct LinkLayerEndpoint { 6 /// 网卡的接口号 7 pub interface: usize, 8 } 9 10 impl LinkLayerEndpoint { 11 /// @brief 创建一个链路层端点 12 /// 13 /// @param interface 网卡的接口号 14 /// 15 /// @return 返回创建的链路层端点 new(interface: usize) -> Self16 pub fn new(interface: usize) -> Self { 17 Self { interface } 18 } 19 } 20