Skip to main content

encode_addressed

Function encode_addressed 

Source
pub fn encode_addressed(
    source: Ipv6Addr,
    destination: Ipv6Addr,
    message: &[u8],
) -> Vec<u8> ⓘ
Expand description

Wrap an ICMPv6 message with the two addresses its checksum was computed over.

The UDP test transport exists because a raw ICMPv6 socket needs privileges nothing here has. It carries source(16) || destination(16) || icmpv6 message, which is exactly the part of the IPv6 header the ICMPv6 checksum depends on — so the receiving side can verify the checksum, and the test therefore proves the pseudo-header calculation end to end rather than only in the codec’s own unit tests.

No real NDP peer speaks this. It is not a tunnel or an encapsulation anyone has defined.