/// Add a new ethernet device to the device layer.
///
/// `add` adds a new `EthernetDeviceState` with the given MAC address and
/// MTU. The MTU will be taken as a limit on the size of Ethernet payloads -
/// the Ethernet header is not counted towards the MTU.
Add a new ethernet device to the device layer.
`add` adds a new `EthernetDeviceState` with the given MAC address and
MTU. The MTU will be taken as a limit on the size of Ethernet payloads
the Ethernet header is not counted towards the MTU.
Add a new ethernet device to the device layer . ` add ` adds a new ` EthernetDeviceState ` with the given MAC address and MTU . The MTU will be taken as a limit on the size of Ethernet payloads the Ethernet header is not counted towards the MTU .
pub(crate) fn add_ethernet_device(&mut self, mac: UnicastAddr<Mac>, mtu: u32) -> DeviceId {
        let Self { ethernet, loopback: _, default_ndp_config, default_ipv6_config } = self;
        let mut builder = EthernetDeviceStateBuilder::new(mac, mtu);
        builder.set_ndp_config(default_ndp_config.clone());
        let mut ethernet_state = IpLinkDeviceState::new(builder.build());
        ethernet_state.ip.ipv6.config = default_ipv6_config.clone();
        let ethernet_state = DeviceState::new(ethernet_state);
        let id = ethernet.push(ethernet_state);
        debug!("adding Ethernet device with ID {} and MTU {}", id, mtu);
        DeviceId::new_ethernet(id)
    }
pub ( crate ) fn add_ethernet_device ( & mut self , mac : UnicastAddr < Mac > , mtu : u32 ) -> DeviceId { let Self { ethernet , loopback : _ , default_ndp_config , default_ipv6_config } = self ; let mut builder = EthernetDeviceStateBuilder :: new ( mac , mtu ) ; builder . set_ndp_config ( default_ndp_config . clone ( ) ) ; let mut ethernet_state = IpLinkDeviceState :: new ( builder . build ( ) ) ; ethernet_state . ip . ipv6 . config = default_ipv6_config . clone ( ) ; let ethernet_state = DeviceState :: new ( ethernet_state ) ; let id = ethernet . push ( ethernet_state ) ; debug ! ( " " id mtu ) ; DeviceId :: new_ethernet ( id ) }
Add a new ethernet device to the device layer.
Add a new ethernet device to the device layer .
&mut self
mac
UnicastAddr<Mac>
mtu
u32