pub async fn create_bridge(&mut self, ports: Vec<PortId>) -> error::Result<PortId> {
        let (error, bridge_id) = self
            .netstack
            .bridge_interfaces(
                &ports.into_iter().map(|id| StackPortId::from(id).to_u32()).collect::<Vec<_>>(),
            )
            .await
            .map_err(|e| {
                error!("Failed creating bridge {:?}", e);
                error::NetworkManager::Hal(error::Hal::BridgeNotCreated)
            })?;
        if error.status != netstack::Status::Ok {
            error!("Failed creating bridge {:?}", error);
            return Err(error::NetworkManager::Hal(error::Hal::BridgeNotCreated));
        }
        info!("bridge created {:?}", bridge_id);
        Ok(u64::from(bridge_id).into())
    }
/// Creates a new interface, bridging the given ports.
Creates a new interface, bridging the given ports.
Creates a new interface bridging the given ports .
pub async fn create_bridge(&mut self, ports: Vec<PortId>) -> error::Result<PortId> {
        let (error, bridge_id) = self
            .netstack
            .bridge_interfaces(
                &ports.into_iter().map(|id| StackPortId::from(id).to_u32()).collect::<Vec<_>>(),
            )
            .await
            .map_err(|e| {
                error!("Failed creating bridge {:?}", e);
                error::NetworkManager::Hal(error::Hal::BridgeNotCreated)
            })?;
        if error.status != netstack::Status::Ok {
            error!("Failed creating bridge {:?}", error);
            return Err(error::NetworkManager::Hal(error::Hal::BridgeNotCreated));
        }
        info!("bridge created {:?}", bridge_id);
        Ok(u64::from(bridge_id).into())
    }
pub async fn create_bridge ( & mut self , ports : Vec < PortId > ) -> error :: Result < PortId > { let ( error , bridge_id ) = self . netstack . bridge_interfaces ( & ports . into_iter ( ) . map ( | id | StackPortId :: from ( id ) . to_u32 ( ) ) . collect :: < Vec < _ > > ( ) , ) . await . map_err ( | e | { error ! ( " " e ) ; error :: NetworkManager :: Hal ( error :: Hal :: BridgeNotCreated ) } ) ? ; if error . status != netstack :: Status :: Ok { error ! ( " " error ) ; return Err ( error :: NetworkManager :: Hal ( error :: Hal :: BridgeNotCreated ) ) ; } info ! ( " " bridge_id ) ; Ok ( u64 :: from ( bridge_id ) . into ( ) ) }
Creates a new interface, bridging the given ports.
Creates a new interface bridging the given ports .
&mut self
ports
Vec<PortId>
&mut self
ports
Vec<PortId>