pub struct DeviceCommunicationControlAuthorizationContext {
pub source_mac: MacAddr,
pub source_network: Option<NpduAddress>,
pub provenance: TransportProvenance,
pub invoke_id: u8,
pub requested_state: DccState,
pub duration_minutes: Option<u16>,
}Expand description
Network identity and the requested change supplied to
ServerPolicy::authorize_device_communication_control.
The policy is asked only once the password, the static
DccPolicy and the source restriction pass,
and before the disable rate limit is charged. The password is never part of
the context. Debug is redacted: address lengths and whether a principal
is present, never addresses or certificate data.
Fields§
§source_mac: MacAddrImmediate data-link peer (or router) address.
source_network: Option<NpduAddress>Originating NPDU source when the request was routed.
provenance: TransportProvenanceImmutable ingress snapshot; the source of the principal, if any.
invoke_id: u8Confirmed-request invoke identifier.
requested_state: DccStateThe state the request asks for. The deprecated DISABLE never gets this far: the server refuses it first.
duration_minutes: Option<u16>The requested duration in minutes; None asks for no time limit.
Implementations§
Source§impl DeviceCommunicationControlAuthorizationContext
impl DeviceCommunicationControlAuthorizationContext
Sourcepub fn principal(&self) -> Option<ScPrincipal>
pub fn principal(&self) -> Option<ScPrincipal>
The principal of the peer that originated the request: the verified
leaf certificate of a direct BACnet/SC connection, when the request
carries no routed source. None for other ingress, hub-relayed and
routed requests included (see crate::policy).
Sourcepub fn forwarding_peer_principal(&self) -> Option<ScPrincipal>
pub fn forwarding_peer_principal(&self) -> Option<ScPrincipal>
The principal of the direct BACnet/SC peer that handed this request
over, a router included when the request was routed; None off a
verified direct SC connection. Trusting it trusts everything that
peer forwards.
Sourcepub fn certificate(&self) -> Option<&ScPeerCertificate>
Available on crate feature sc-tls only.
pub fn certificate(&self) -> Option<&ScPeerCertificate>
sc-tls only.The verified leaf certificate of the peer that originated the
request: the one principal fingerprints, for
rules by subject, Subject Alternative Name or issuer, which
survive certificate renewal. None exactly when principal()
is: other ingress, hub-relayed and routed requests (see
crate::policy). Its contents are the peer’s: don’t log them.
Sourcepub fn forwarding_peer_certificate(&self) -> Option<&ScPeerCertificate>
Available on crate feature sc-tls only.
pub fn forwarding_peer_certificate(&self) -> Option<&ScPeerCertificate>
sc-tls only.The verified leaf certificate of the direct BACnet/SC peer that
handed this request over, a router included when the request
was routed: the one
forwarding_peer_principal
fingerprints. None off a verified direct SC connection.
Sourcepub fn direct_sc_identity(&self) -> Option<DirectScIdentity>
pub fn direct_sc_identity(&self) -> Option<DirectScIdentity>
The immediate direct-SC hop’s verified leaf and connection incarnation: for a routed request, the router that forwarded it. Absent off a verified direct SC connection. Separate from claimed addresses.