/// Adds an interface to the hermetic Netstack with `interface_name` and
/// `mac_address`.
///
/// The added interface is assigned a static IP address based on `subnet`.
/// Additionally, the interface joins the provided `network`.
Adds an interface to the hermetic Netstack with `interface_name` and
`mac_address`.

The added interface is assigned a static IP address based on `subnet`.
Additionally, the interface joins the provided `network`.
Adds an interface to the hermetic Netstack with ` interface_name ` and ` mac_address ` . The added interface is assigned a static IP address based on ` subnet ` . Additionally the interface joins the provided ` network ` .
async fn join_network_with_hermetic_netstack<'a>(
    realm: &'a netemul::TestRealm<'a>,
    network: &'a netemul::TestNetwork<'a>,
    network_test_realm: &'a fntr::ControllerProxy,
    interface_name: &'a str,
    mac_address: fnet::MacAddress,
    subnet: fnet::Subnet,
) -> netemul::TestInterface<'a> {
    let interface = realm
        .join_network_with(
            &network,
            interface_name,
            netemul::Ethernet::make_config(netemul::DEFAULT_MTU, Some(mac_address)),
            &netemul::InterfaceConfig::None,
        )
        .await
        .expect("join_network failed");
    add_interface_to_devfs(interface_name, interface.endpoint(), &realm).await;
    network_test_realm
        .add_interface(&mut mac_address.clone(), interface_name)
        .await
        .expect("add_interface failed")
        .expect("add_interface error");
    add_address_to_hermetic_interface(interface_name, subnet, realm).await;
    interface
}
async fn join_network_with_hermetic_netstack < ' a > ( realm : & ' a netemul :: TestRealm < ' a > , network : & ' a netemul :: TestNetwork < ' a > , network_test_realm : & ' a fntr :: ControllerProxy , interface_name : & ' a str , mac_address : fnet :: MacAddress , subnet : fnet :: Subnet , ) -> netemul :: TestInterface < ' a > { let interface = realm . join_network_with ( & network , interface_name , netemul :: Ethernet :: make_config ( netemul :: DEFAULT_MTU , Some ( mac_address ) ) , & netemul :: InterfaceConfig :: None , ) . await . expect ( " " ) ; add_interface_to_devfs ( interface_name , interface . endpoint ( ) , & realm ) . await ; network_test_realm . add_interface ( & mut mac_address . clone ( ) , interface_name ) . await . expect ( " " ) . expect ( " " ) ; add_address_to_hermetic_interface ( interface_name , subnet , realm ) . await ; interface }
Adds an interface to the hermetic Netstack with `interface_name` and
`mac_address`.
Adds an interface to the hermetic Netstack with ` interface_name ` and ` mac_address ` .
realm
&'a netemul::TestRealm<'a>
network
&'a netemul::TestNetwork<'a>
network_test_realm
&'a fntr::ControllerProxy
interface_name
&'a str
mac_address
fnet::MacAddress
subnet
fnet::Subnet