#[non_exhaustive]pub struct Groups {
pub broadcast: SocketAddrV4,
pub interface: Ipv4Addr,
pub directed: Ipv4Addr,
}Expand description
A link’s group destinations: the B/IP addresses that reach more than one node. No node sends from one, so a datagram from one, or a Forwarded-NPDU naming one as its origin, is dropped: answering it would reach the whole group.
It is #[non_exhaustive], so a link that comes to have another group
destination of its own (a second broadcast address, say) isn’t a
breaking change: outside this crate, take it from Link::groups or
build it with Groups::new.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.broadcast: SocketAddrV4The link’s broadcast address: its broadcast IP at the network’s port.
interface: Ipv4AddrThe node’s own interface IP. A broadcast IP equal to it, or a loopback one, as loopback tests set up, is a group only at the network’s port.
directed: Ipv4AddrFor a B/IP-M node, its IP subnet’s directed broadcast address
(LocalSubnet::directed): no
longer where its broadcasts go, but still an address that reaches
more than one node. It counts as the broadcast IP does, at any port.
0.0.0.0 for none: a plain address rather than an Option, so a
router’s empty group rule stays all zero bits and its storage stays
in .bss.
Implementations§
Source§impl Groups
impl Groups
Sourcepub const fn new(broadcast: SocketAddrV4, interface: Ipv4Addr) -> Self
pub const fn new(broadcast: SocketAddrV4, interface: Ipv4Addr) -> Self
The group destinations of a link whose broadcast address is
broadcast, on the interface whose IP is interface, with no
directed broadcast beside it.
Sourcepub const fn contains(&self, address: SocketAddrV4) -> bool
pub const fn contains(&self, address: SocketAddrV4) -> bool
Whether address is a group destination: the link’s broadcast
address, or any address whose IP is a group IP (Groups::contains_ip).
Sourcepub const fn contains_ip(&self, ip: Ipv4Addr) -> bool
pub const fn contains_ip(&self, ip: Ipv4Addr) -> bool
Whether ip is a group at any port: 255.255.255.255, a multicast
address, or the broadcast IP or a member’s directed broadcast when
it is neither loopback nor the node’s own interface. This is the
test for a datagram’s UDP source.