Skip to main content

ReceivedApdu

Struct ReceivedApdu 

Source
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: Bytes

Raw APDU bytes.

§source_mac: MacAddr

Source 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: bool

Whether the NPDU arrived through a data-link multicast or broadcast.

This preserves raw data-link provenance independently of Self::is_group.

§is_group: bool

Whether 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: bool

Whether 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: TransportProvenance

Honest 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

Source

pub fn set_response_route(&mut self, route: ResponseRoute)

Restore the complete opening response context after reassembly.

Source

pub fn response_route(&self) -> ResponseRoute

Save this ingress’s response route before moving it into queued work.

Trait Implementations§

Source§

impl Clone for ReceivedApdu

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReceivedApdu

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more