pub struct ResponseRoute { /* private fields */ }Expand description
Saved transport authority and addressing for a response.
Verified direct ingress requires a matching original-socket capability. Missing or mismatched capability fails closed. Router delivery also retains its addressed endpoint and original return port/peer. Clones own neither the router nor a socket and do not extend either lifetime.
Implementations§
Source§impl ResponseRoute
impl ResponseRoute
Sourcepub fn new(
provenance: TransportProvenance,
direct: Option<DirectResponse>,
) -> Self
pub fn new( provenance: TransportProvenance, direct: Option<DirectResponse>, ) -> Self
Capture immutable ingress provenance and its optional direct capability. A supplied capability is checked against provenance at every send.
Sourcepub fn unverified() -> Self
pub fn unverified() -> Self
Plain, non-direct addressing for locally constructed legacy envelopes.
Sourcepub fn provenance(&self) -> TransportProvenance
pub fn provenance(&self) -> TransportProvenance
Original authentication scope; this never follows a replacement peer.
Sourcepub fn max_apdu_length(
&self,
apdu_limit: u16,
destination: Option<&NpduAddress>,
) -> Result<u16, Error>
pub fn max_apdu_length( &self, apdu_limit: u16, destination: Option<&NpduAddress>, ) -> Result<u16, Error>
Cap an APDU by the captured router port and direct peer NPDU/BVLC limits, including both source and destination headers actually used by a reply. Ordinary ingress keeps the supplied APDU cap. Invalid authority/addressing is an error; retirement does not invalidate this immutable sizing snapshot.
Sourcepub fn requires_direct_response(&self) -> bool
pub fn requires_direct_response(&self) -> bool
Whether direct-socket authority must be checked, including a malformed context with a missing or mismatched capability.
Sourcepub fn requires_original_route(&self) -> bool
pub fn requires_original_route(&self) -> bool
Whether response issuance requires captured router or direct authority.
Sourcepub fn same_origin(&self, other: &Self) -> bool
pub fn same_origin(&self, other: &Self) -> bool
Compare the opening transport origin and router endpoint of a request. A later segment cannot switch the addressed endpoint or router instance. Direct capability presence is checked separately at each immediate send; reassembly retains the opening capability for its completed request.
Sourcepub fn encode_reply_npdu(
&self,
apdu: &[u8],
destination: Option<&NpduAddress>,
expecting_reply: bool,
priority: NetworkPriority,
) -> Result<BytesMut, Error>
pub fn encode_reply_npdu( &self, apdu: &[u8], destination: Option<&NpduAddress>, expecting_reply: bool, priority: NetworkPriority, ) -> Result<BytesMut, Error>
Encode a response for an immediate MS/TP handoff. This validates all captured authority and router lifetime before returning any bytes. Direct SC responses must use network issuance, never the DER channel.