pub(crate) fn del_ip_addr<D: EventDispatcher, A: IpAddress>(
    ctx: &mut Ctx<D>,
    device: DeviceId,
    addr: &SpecifiedAddr<A>,
) -> Result<(), NotFoundError> {
    // `device` must be initialized.
    assert!(is_device_initialized(&ctx.state, device));

    trace!("del_ip_addr: removing addr {:?} from device {:?}", addr, device);

    match Into::into(*addr) {
        IpAddr::V4(addr) => crate::ip::device::del_ipv4_addr(ctx, device, &addr)
            .map(|()| crate::ip::on_routing_state_updated::<Ipv4, _>(ctx)),
        IpAddr::V6(addr) => crate::ip::device::del_ipv6_addr(ctx, device, &addr)
            .map(|()| crate::ip::on_routing_state_updated::<Ipv6, _>(ctx)),
    }
}
/// Removes an IP address and associated subnet from this device.
///
/// # Panics
///
/// Panics if `device` is not initialized.
Removes an IP address and associated subnet from this device.
Removes an IP address and associated subnet from this device .
pub(crate) fn del_ip_addr<D: EventDispatcher, A: IpAddress>(
    ctx: &mut Ctx<D>,
    device: DeviceId,
    addr: &SpecifiedAddr<A>,
) -> Result<(), NotFoundError> {
    // `device` must be initialized.
    assert!(is_device_initialized(&ctx.state, device));
    trace!("del_ip_addr: removing addr {:?} from device {:?}", addr, device);
    match Into::into(*addr) {
        IpAddr::V4(addr) => crate::ip::device::del_ipv4_addr(ctx, device, &addr)
            .map(|()| crate::ip::on_routing_state_updated::<Ipv4, _>(ctx)),
        IpAddr::V6(addr) => crate::ip::device::del_ipv6_addr(ctx, device, &addr)
            .map(|()| crate::ip::on_routing_state_updated::<Ipv6, _>(ctx)),
    }
}
pub ( crate ) fn del_ip_addr < D : EventDispatcher , A : IpAddress > ( ctx : & mut Ctx < D > , device : DeviceId , addr : & SpecifiedAddr < A > , ) -> Result < ( ) , NotFoundError > { // `device` must be initialized. assert ! ( is_device_initialized ( ctx state device ) ) ; trace ! ( " " addr device ) ; match Into :: into ( * addr ) { IpAddr :: V4 ( addr ) => crate :: ip :: device :: del_ipv4_addr ( ctx , device , & addr ) . map ( | ( ) | crate :: ip :: on_routing_state_updated :: < Ipv4 , _ > ( ctx ) ) , IpAddr :: V6 ( addr ) => crate :: ip :: device :: del_ipv6_addr ( ctx , device , & addr ) . map ( | ( ) | crate :: ip :: on_routing_state_updated :: < Ipv6 , _ > ( ctx ) ) , } }
Removes an IP address and associated subnet from this device.
Removes an IP address and associated subnet from this device .
ctx
&mut Ctx<D>
device
DeviceId
addr
&SpecifiedAddr<A>
ctx
&mut Ctx<D>
device
DeviceId
addr
&SpecifiedAddr<A>
panics
Panics if `device` is not initialized.
Panics if ` device ` is not initialized .