pub struct Bvlc6Function(/* private fields */);Expand description
A B/IPv6 BVLC function code: the second octet of every B/IPv6 BVLL message, which says what the message is (Annex U.2, Table U-1).
The set is open, so a decoder can report a code it doesn’t know. The constants are the twelve functions of Annex U.2. Code 0x0B is not among them: the clause that defined it (U.2.12) was deleted, so this edition treats it like any other unknown code.
Implementations§
Source§impl Bvlc6Function
impl Bvlc6Function
Sourcepub const BVLC_RESULT: Self
pub const BVLC_RESULT: Self
Acknowledges a request that needs an answer (U.2.1).
Wire value 0x00.
Sourcepub const ORIGINAL_UNICAST_NPDU: Self
pub const ORIGINAL_UNICAST_NPDU: Self
A directed NPDU, naming its recipient’s VMAC (U.2.2).
Wire value 0x01.
Sourcepub const ORIGINAL_BROADCAST_NPDU: Self
pub const ORIGINAL_BROADCAST_NPDU: Self
A broadcast NPDU from a node that isn’t a foreign device (U.2.3).
Wire value 0x02.
Sourcepub const ADDRESS_RESOLUTION: Self
pub const ADDRESS_RESOLUTION: Self
Asks, by multicast, which B/IPv6 address a VMAC is at (U.2.4).
Wire value 0x03.
Sourcepub const FORWARDED_ADDRESS_RESOLUTION: Self
pub const FORWARDED_ADDRESS_RESOLUTION: Self
An Address-Resolution a BBMD sends on into other multicast domains (U.2.5).
Wire value 0x04.
Sourcepub const ADDRESS_RESOLUTION_ACK: Self
pub const ADDRESS_RESOLUTION_ACK: Self
Answers either kind of Address-Resolution (U.2.6).
Wire value 0x05.
Sourcepub const VIRTUAL_ADDRESS_RESOLUTION: Self
pub const VIRTUAL_ADDRESS_RESOLUTION: Self
Asks a node at a known B/IPv6 address for its VMAC (U.2.7).
Wire value 0x06.
Sourcepub const VIRTUAL_ADDRESS_RESOLUTION_ACK: Self
pub const VIRTUAL_ADDRESS_RESOLUTION_ACK: Self
Answers a Virtual-Address-Resolution (U.2.8).
Wire value 0x07.
Sourcepub const FORWARDED_NPDU: Self
pub const FORWARDED_NPDU: Self
An NPDU a BBMD passes on, with its originator’s VMAC and address (U.2.9).
Wire value 0x08.
Sourcepub const REGISTER_FOREIGN_DEVICE: Self
pub const REGISTER_FOREIGN_DEVICE: Self
Asks a BBMD to take the sender as a foreign device (U.2.10).
Wire value 0x09.
Sourcepub const DELETE_FOREIGN_DEVICE_TABLE_ENTRY: Self
pub const DELETE_FOREIGN_DEVICE_TABLE_ENTRY: Self
Removes one entry from a BBMD’s foreign device table (U.2.11).
Wire value 0x0A.
Sourcepub const DISTRIBUTE_BROADCAST_TO_NETWORK: Self
pub const DISTRIBUTE_BROADCAST_TO_NETWORK: Self
A foreign device’s broadcast, for its BBMD to distribute (U.2.13).
Wire value 0x0C.
Sourcepub const ALL_NAMED: &[(&str, Self)]
pub const ALL_NAMED: &[(&str, Self)]
Every named constant, with its name, in the order declared.
Sourcepub const fn name(self) -> Option<&'static str>
pub const fn name(self) -> Option<&'static str>
The constant’s name, or None for a value the standard
doesn’t define.
Sourcepub const fn is_defined(self) -> bool
pub const fn is_defined(self) -> bool
Whether the standard defines this value.
Source§impl Bvlc6Function
impl Bvlc6Function
Sourcepub const fn payload_shape(self) -> Option<PayloadShape>
pub const fn payload_shape(self) -> Option<PayloadShape>
The payload layout of this function, from its format clause in
Annex U.2, or None for a code Annex U doesn’t define. The payload
is everything after the 4-octet header, so it starts with a VMAC in
every message (Table U-1 gives the whole lengths).
- Virtual-Address-Resolution: the source VMAC, 3 octets (U.2.7.1).
- BVLC-Result and Register-Foreign-Device: the source VMAC and a result code or time-to-live, 5 octets (U.2.1.1, U.2.10.1).
- Address-Resolution and the two ACKs: two VMACs, 6 octets (U.2.4.1, U.2.6.1, U.2.8.1).
- Delete-Foreign-Device-Table-Entry: the source VMAC and the entry’s B/IPv6 address, 21 octets (U.2.11.1).
- Forwarded-Address-Resolution: two VMACs and the originator’s address, 24 octets (U.2.5.1).
- Original-Broadcast-NPDU and Distribute-Broadcast-To-Network: a VMAC, then the NPDU (U.2.3.1, U.2.13.1).
- Original-Unicast-NPDU: two VMACs, then the NPDU (U.2.2.1).
- Forwarded-NPDU: the originator’s VMAC and address, then the NPDU (U.2.9.1).
use bacnet_bip_codec::ipv6::Bvlc6Function;
use bacnet_bip_codec::PayloadShape;
assert_eq!(
Bvlc6Function::FORWARDED_NPDU.payload_shape(),
Some(PayloadShape::Npdu { prefix: 21 }),
);
assert_eq!(Bvlc6Function::from_raw(0x0B).payload_shape(), None);Sourcepub const fn nak(self) -> Option<Bvlc6ResultCode>
pub const fn nak(self) -> Option<Bvlc6ResultCode>
The NAK named after this function in Annex U.2.1.1, for the five
requests that have one: both address resolutions, foreign-device
registration, FDT entry deletion and broadcast distribution. None
for every other code.
Annex U says when to send four of them. A device that is not a BBMD answers the last three with their NAKs (U.4.4, U.4.5.3, U.4.5.4), and so does a BBMD that can’t carry them out. A BBMD answers an Address-Resolution sent to it with its NAK when the sender is not a registered foreign device, or when the BBMD can’t pass the request on (U.4.4); a broadcast distribution from a node that isn’t a registered foreign device gets its NAK the same way. A Forwarded-Address-Resolution is never answered with a BVLC-Result.
Trait Implementations§
Source§impl Clone for Bvlc6Function
impl Clone for Bvlc6Function
impl Copy for Bvlc6Function
Source§impl Debug for Bvlc6Function
Name::CONSTANT for a named value, Name(raw) otherwise.
impl Debug for Bvlc6Function
Name::CONSTANT for a named value, Name(raw) otherwise.
Source§impl Display for Bvlc6Function
The constant’s name, or the raw value in decimal.
impl Display for Bvlc6Function
The constant’s name, or the raw value in decimal.