Skip to main content

ServerConfig

Struct ServerConfig 

Source
pub struct ServerConfig {
Show 38 fields pub registered_network_port: Option<ObjectIdentifier>, pub audit_reporters: Option<AuditReportersConfig>, pub get_alarm_summary_budget: GetAlarmSummaryBudget, pub get_enrollment_summary_budget: GetEnrollmentSummaryBudget, pub atomic_read_file_budget: AtomicReadFileBudget, pub atomic_write_file_budget: AtomicWriteFileBudget, pub read_range_budget: ReadRangeBudget, pub get_event_information_budget: GetEventInformationBudget, pub read_property_multiple_budget: ReadPropertyMultipleBudget, pub interface: Ipv4Addr, pub port: u16, pub broadcast_address: Ipv4Addr, pub share_port_by_address: bool, pub max_apdu_length: u32, pub segmentation_supported: Segmentation, pub apdu_segment_timeout_ms: u64, pub vendor_id: u16, pub cov_retry_timeout_ms: u64, pub time_sync_policy: TimeSyncPolicy, pub on_time_sync: Option<Arc<dyn Fn(TimeSyncData) + Send + Sync>>, pub on_reinitialize: Option<ReinitializeHandler>, pub mutation_policy: MutationPolicy, pub mutation_authorizer: Option<MutationAuthorizer>, pub life_safety_operation_authorizer: Option<LifeSafetyOperationAuthorizer>, pub audit_notification_sink: Option<ObjectIdentifier>, pub audit_notification_authorizer: Option<AuditNotificationAuthorizer>, pub unconfirmed_audit_notification_authorizer: Option<UnconfirmedAuditNotificationAuthorizer>, pub dcc_password: Option<String>, pub dcc_policy: DccPolicy, pub dcc_source_restriction: Option<DccSourceRestriction>, pub dcc_disable_rate_limit: Option<DccDisableRateLimit>, pub reinit_password: Option<String>, pub enable_fault_detection: bool, pub enable_event_enrollment: bool, pub event_enrollment_interval_secs: u64, pub discovery_policy: DiscoveryPolicy, pub cov_policy: CovPolicy, pub request_admission_policy: RequestAdmissionPolicy,
}
Expand description

Server configuration.

Fields§

§registered_network_port: Option<ObjectIdentifier>

Explicit concrete Network Port for one owned B/IP transport, in NORMAL, FOREIGN or BBMD mode (a BBMD that also registers as a foreign device is refused at start). None leaves configured objects unbound and receiving-port wildcard unavailable.

§audit_reporters: Option<AuditReportersConfig>

Optional target Audit Reporter profile. Its recipient is provisioned on the built-in Device and becomes writable while the runtime is installed.

§get_alarm_summary_budget: GetAlarmSummaryBudget

Per-service GetAlarmSummary database scan and encoded response limits.

§get_enrollment_summary_budget: GetEnrollmentSummaryBudget

Local complete-response limits for GetEnrollmentSummary.

§atomic_read_file_budget: AtomicReadFileBudget

Local AtomicReadFile raw-count and complete service-ACK limits.

§atomic_write_file_budget: AtomicWriteFileBudget

Local AtomicWriteFile payload admission limits.

§read_range_budget: ReadRangeBudget

ReadRange directional page item and logical service-byte limits.

§get_event_information_budget: GetEventInformationBudget

GetEventInformation database admission and strict response-page limits.

§read_property_multiple_budget: ReadPropertyMultipleBudget

Per-service RPM work and encoded response limits (finite by default).

§interface: Ipv4Addr

Local interface to bind.

§port: u16

UDP port (default 0xBAC0 = 47808).

§broadcast_address: Ipv4Addr

Directed broadcast address.

§share_port_by_address: bool

B/IP only: bind the interface address itself, so devices on other addresses of this host can share the port (#1538). Off by default. Needs an explicit interface and a nonzero port; see BipTransport::set_share_port_by_address for what changes, including that broadcasts and unicast are then received in no fixed order. Only the B/IP builder reads it; a transport passed to start has its own.

§max_apdu_length: u32

Raw local APDU receive ceiling, clamped to the transport’s stable capacity. The effective value must be at least 50 and equal the selected Device’s Max_APDU_Length_Accepted. I-Am retains this raw value; only originated Confirmed-Request headers floor it to a supported encoding.

§segmentation_supported: Segmentation

Segmentation support level.

Enforced, not just advertised: the dispatch loop reassembles inbound segmented requests only under BOTH/RECEIVE and transmits segmented responses only under BOTH/TRANSMIT (Clauses 5.4.5.1 and 5.4.5.3); anything else draws a SEGMENTATION_NOT_SUPPORTED Abort. The default is NONE, so a default-configured server refuses segmented traffic in both directions — set this to what the device should actually honor.

§apdu_segment_timeout_ms: u64

Segment timeout (Tseg) in milliseconds; shared by request receive (4 * Tseg) and response SegmentACK waits. Default: 5000 ms. When segmentation is active it must be positive and match the selected Device.

§vendor_id: u16

Vendor identifier.

§cov_retry_timeout_ms: u64

APDU timeout in ms of confirmed COV and event notifications and of the WriteProperty a Command action sends to another device (default 3000 ms): how long each attempt waits for the reply once its send has completed, before the next retry. The transport bounds the send itself. It is also the base of the COV hold-off after a failed confirmed report, one full retry cycle: this timeout times the attempts (#896).

§time_sync_policy: TimeSyncPolicy

Opt-in inbound time-sync restrictions; default allows all, with no step cap.

§on_time_sync: Option<Arc<dyn Fn(TimeSyncData) + Send + Sync>>

Optional fast, nonblocking observer invoked after the clock changes. A panic is caught (with unwind builds); the change stands and ingress continues. This callback cannot authorize or roll back synchronization.

§on_reinitialize: Option<ReinitializeHandler>

Optional ReinitializeDevice handler, called with the requester’s ReinitializeContext once the request passes its password and state checks. Without it every such request is refused with SERVICES / SERVICE_REQUEST_DENIED.

The rules are on ReinitializeHandler. In short: the SimpleACK goes out only after the handler returns, so schedule any restart for after the reply rather than restarting inline. Nothing yet signals when the reply has left (#1565), so a delay is best effort, and stopping the server before then drops the reply. It runs synchronously with the object database write-locked, so keep it quick and hand slow work to a task; its database edits skip the COV, event and Audit work of BACnetServer::write_local, so apply changes that need it there afterwards. Without reinit_password any peer reaches it, and neither the mutation policy nor the mutation authorizer covers this service, so restrict sources through the context. Refuse with Error::Protocol: a panic or an Error::Reject is answered SERVICES / OTHER.

§mutation_policy: MutationPolicy

Local mutation authorization mode (default: permissive). SC mTLS channel/peer authentication is not service authorization; addresses here are claimed, never certificate principals. See MutationPolicy. Each decision also carries the reassembled ingress TransportProvenance snapshot and the derived channel/relay MutationTrust scope (never leaf identity); unknown origin never satisfies a baseline-only allow rule. Denials mutate nothing and write no audit log. DenyAll also denies each Channel write of an inbound WriteGroup, counted in BACnetServer::mutation_decision_counters (#1319).

§mutation_authorizer: Option<MutationAuthorizer>

Opt-in mutation authorizer; None allows only in permissive mode. See MutationAuthorizer. It also decides each Channel write of an inbound WriteGroup, with no invoke ID and the unconfirmed service in its context, so it can allow some Channels and not others (#1319).

§life_safety_operation_authorizer: Option<LifeSafetyOperationAuthorizer>

Optional LifeSafetyOperation authorization policy.

Absence is fail-closed: requests receive SERVICES / SERVICE_REQUEST_DENIED before object mutation.

§audit_notification_sink: Option<ObjectIdentifier>

Exactly one explicitly configured Audit Log notification sink.

Absence is fail-closed; the server never selects a sink by database iteration order. A built-in AuditLogObject configured with set_member_of also forwards record-changing accepted batches once, after commit, to that parent using a configured DeviceBinding. No backlog, retries, or durable send progress.

§audit_notification_authorizer: Option<AuditNotificationAuthorizer>

Optional fast, nonblocking ConfirmedAuditNotification authorizer.

Absence, false, or a panic denies the request before mutation.

§unconfirmed_audit_notification_authorizer: Option<UnconfirmedAuditNotificationAuthorizer>

Optional fast, nonblocking UnconfirmedAuditNotification authorizer.

Absence, false, or a panic silently denies the request before mutation.

§dcc_password: Option<String>

Optional password required for DeviceCommunicationControl.

§dcc_policy: DccPolicy

Local DCC authorization. Supplying a password alone does not enable DCC.

§dcc_source_restriction: Option<DccSourceRestriction>

Optional exact claimed-source restriction, valid only with RequirePassword.

§dcc_disable_rate_limit: Option<DccDisableRateLimit>

Optional global DISABLE_INITIATION budget; does not enable DCC authorization.

§reinit_password: Option<String>

Optional password required for ReinitializeDevice.

§enable_fault_detection: bool

Enable periodic fault detection / reliability evaluation. When true, the server invokes every object’s opt-in, object-owned reliability evaluation hook every 10 seconds. Stock objects currently inherit the no-op default.

This governs reliability evaluation only. Event Enrollment evaluation is configured separately via enable_event_enrollment.

§enable_event_enrollment: bool

Enable periodic Event Enrollment evaluation (default true).

When true, the server re-reads the property each Event Enrollment object names in its Object_Property_Reference and applies the configured event algorithm. Startup: the task is spawned by start and its first pass runs immediately, then once per interval. Shutdown: stop aborts it and awaits the abort.

This switch governs the evaluation task; it is not the per-object Event_Detection_Enable property of ASHRAE 135-2020 Clause 13.2.2.1. Setting it false stops evaluation without performing the reset that clause requires of a disabled detector (Event_State to NORMAL, with the corresponding timestamp and acknowledgment state), so a device carrying active enrollments will hold whatever state it last detected.

Evaluation is a no-op on databases holding no Event Enrollment objects, so the default is on.

Successful enabled transitions commit Event_State, Acked_Transitions, and Event_Time_Stamps atomically and are then routed through the shared EventNotification sender. Event Enrollment message text remains intentionally absent, and exact event-specific notification values are deferred to the payload projection work.

§event_enrollment_interval_secs: u64

Interval in seconds between Event Enrollment evaluation passes (default 10).

This is a sampling cadence with no basis in ASHRAE 135-2020, which prescribes no evaluation frequency and leaves acquisition of a monitored value a local matter (Clause 12.12). It is not the Time_Delay of an event algorithm, which is how long a condition must persist before a transition is indicated (Clause 13.3) — a coarse interval delays detection and can miss a condition that both appears and clears between two passes.

A value of 0 is clamped to one second. Ignored when enable_event_enrollment is false.

§discovery_policy: DiscoveryPolicy

Discovery rate-limiting and duplicate suppression policy.

§cov_policy: CovPolicy

COV quota, rate accounting, and notification work budget policy.

§request_admission_policy: RequestAdmissionPolicy

Positive independent top-level request handler limits.

Trait Implementations§

Source§

impl Clone for ServerConfig

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 ServerConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ServerConfig

Source§

fn default() -> Self

Returns the “default value” for a type. 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