Module ndp

Source
Expand description

Helpers for tests involving the Neighbor Discovery Protocol.

Constants§

MESSAGE_TTL
As per RFC 4861 sections 4.1-4.5, NDP packets MUST have a hop limit of 255.

Functions§

assert_dad_failed
Assert that the address state provider event stream yields an address removal error, indicating that DAD failed.
assert_dad_success
Assert that the address state provider event stream yields an address assignment event, implying that DAD succeeded.
create_message
Create an NDP message with the provided parameters, including IPv6 and Ethernet headers.
expect_dad_neighbor_solicitation
Wait for and verify a NS message transmitted by netstack for DAD. Returns the bytes of the NS message.
fail_dad_with_na
Transmit a Neighbor Advertisement message simulating that a node owns constants::ipv6::LINK_LOCAL_ADDR.
fail_dad_with_ns
Transmit a Neighbor Solicitation message simulating that a node is performing DAD for constants::ipv6::LINK_LOCAL_ADDR.
send_ra
Send Router Advertisement NDP message.
send_ra_with_router_lifetime
Send Router Advertisement NDP message with router lifetime.
wait_for_router_solicitation
Wait for a router solicitation message.
write_message
Write an NDP message to the provided fake endpoint.

Type Aliases§

DadState
A result type that can be used to evaluate the outcome of Duplicate Address Detection (DAD).