pub struct ReceivedApdu {
pub apdu: Bytes,
pub source_mac: MacAddr,
pub ingress_network: Option<u16>,
pub source_network: Option<NpduAddress>,
pub link_layer_group: bool,
pub is_group: bool,
pub global_broadcast: bool,
pub data_attributes: Vec<DataAttribute>,
pub provenance: TransportProvenance,
pub direct_response: Option<DirectResponse>,
pub router_response: Option<RouterResponse>,
pub reply_tx: Option<Sender<Bytes>>,
}Expand description
A received APDU with source addressing information.
Fields§
§apdu: BytesRaw APDU bytes.
source_mac: MacAddrSource MAC address in transport-native format (claimed identity; see
TransportProvenance. On SC this is the source VMAC, not a
certificate principal).
ingress_network: Option<u16>BACnet network number of the router ingress port at admission time.
Router deliveries set this to Some, independently of the routed source
address. Non-router NetworkLayer deliveries use None because the
layer owns one transport without an assigned ingress network number.
Both raw and tracked deliveries carry this metadata. For
RouterOptions::track_admission,
it scopes source_mac to the ingress port for the
16-queued-APDU quota; source_network is not part
of that key. See the receive-queue contract.
source_network: Option<NpduAddress>Source network address if the APDU was routed (NPDU had source field). Claimed SNET/SADR, never a credential (RB-07 compat mode: decisions unchanged; RB-09 consumes provenance later).
link_layer_group: boolWhether the NPDU arrived through a data-link multicast or broadcast.
This preserves raw data-link provenance independently of Self::is_group.
is_group: boolWhether the APDU’s effective BACnet destination was multicast or broadcast.
A specific DNET/DADR remains a unicast even when a router used a group data-link destination to reach that remote device.
global_broadcast: boolWhether the NPDU named the global broadcast network (DNET 65535).
A global broadcast is also a group delivery, but Self::is_group
alone cannot tell it from a local or one-network broadcast once a
router has passed it on. A Notification Forwarder ignores event
notifications that arrive this way (Clause 12.51).
data_attributes: Vec<DataAttribute>Data-link attributes associated with the NPDU, if the transport supplied any.
provenance: TransportProvenanceHonest transport + origin provenance, immutable by value (RB-07).
Threaded from bacnet_transport::port::ReceivedNpdu; cloning
preserves the meaning and never duplicates reply authority. Compat
mode: forwarding/learning/admission decisions ignore it.
direct_response: Option<DirectResponse>Sealed route back to this envelope’s original verified direct socket.
router_response: Option<RouterResponse>Captured router endpoint and return-port authority for local delivery
of a Confirmed-Request, the only APDU answered on its arrival route;
None for every other APDU (#1713).
reply_tx: Option<Sender<Bytes>>Optional reply channel for MS/TP DataExpectingReply flows. The application layer can send NPDU-wrapped reply bytes through this channel. An APDU dropped at queue admission releases this sender without sending bytes, just as when the application receiver is closed. The transport observes channel closure and retains its existing no-reply handling.
Implementations§
Source§impl ReceivedApdu
impl ReceivedApdu
Sourcepub fn set_response_route(&mut self, route: ResponseRoute)
pub fn set_response_route(&mut self, route: ResponseRoute)
Restore the complete opening response context after reassembly.
Sourcepub fn response_route(&self) -> ResponseRoute
pub fn response_route(&self) -> ResponseRoute
Save this ingress’s response route before moving it into queued work.