Function netstack3_ip::icmp::send_icmpv4_host_unreachable

source ·
pub fn send_icmpv4_host_unreachable<B: BufferMut, BC: IcmpBindingsContext, CC: InnerIcmpv4Context<BC> + CounterContext<IcmpTxCounters<Ipv4>>>(
    core_ctx: &mut CC,
    bindings_ctx: &mut BC,
    device: Option<&CC::DeviceId>,
    frame_dst: Option<FrameDestination>,
    src_ip: SocketIpAddr<Ipv4Addr>,
    dst_ip: SocketIpAddr<Ipv4Addr>,
    original_packet: B,
    header_len: usize,
    fragment_type: Ipv4FragmentType,
)
Expand description

Send an ICMP(v4) message in response to receiving a packet destined for an unreachable address.

send_icmpv4_host_unreachable sends the appropriate ICMP message in response to receiving an IP packet from src_ip to dst_ip, where dst_ip is unreachable. In particular, this is an ICMP “destination unreachable” message with a “host unreachable” code.

original_packet must be an initial fragment or a complete IP packet, per RFC 792 Introduction:

Also ICMP messages are only sent about errors in handling fragment zero of fragemented [sic] datagrams.

header_len is the length of the header including all options.