Skip to main content

BipServerBuilder

Struct BipServerBuilder 

Source
pub struct BipServerBuilder { /* private fields */ }
Expand description

BIP-specific builder that constructs BipTransport from interface/port/broadcast fields.

Implementations§

Source§

impl BipServerBuilder

Source

pub fn interface(self, ip: Ipv4Addr) -> Self

Set the local interface IP.

Source

pub fn port(self, port: u16) -> Self

Set the UDP port.

Source

pub fn broadcast_address(self, addr: Ipv4Addr) -> Self

Set the directed broadcast address.

Source

pub fn mode(self, mode: BipMode) -> Self

Set the B/IP mode: a normal node (the default), a foreign device or a BBMD (#938). A foreign device’s build() doesn’t wait for its BBMD to accept the registration; poll BACnetServer::foreign_registration for how it went. A registered Network Port reports the mode in BACnet_IP_Mode.

use bacnet_server::server::BACnetServer;
use bacnet_transport::bbmd::ForeignDevicePolicy;
use bacnet_transport::bip::{BbmdOptions, BipMode};
let builder = BACnetServer::bip_builder().mode(BipMode::Bbmd(BbmdOptions {
    foreign_device_policy: Some(ForeignDevicePolicy::default()),
    ..BbmdOptions::default()
}));
Source

pub fn multicast(self, multicast: Option<BipMulticast>) -> Self

Make the server a B/IP-M node in multicast’s group (Annex J.8), or, with None (the default), not: its broadcasts go to the group, and it takes broadcasts only from the group. Needs an explicit interface, and a nonzero port unless the group has its own; build() fails on what BipTransport::set_multicast refuses. With BipMode::Bbmd the server is the BBMD that serves the group (Annex J.8.3), and its own BDT row must be two-hop. A registered Network Port serves the group as BACnet_IP_Multicast_Address, writable when the server answers ReinitializeDevice (#941); on a BBMD a written group is activated together with the BDT, both or neither (#1963).

Source

pub fn share_port_by_address(self, enabled: bool) -> Self

Bind the interface address itself, so devices on other addresses of this host can share the port, each getting only its own unicast (#1538). Off by default, which binds 0.0.0.0. Needs an explicit interface and a nonzero port, or build fails. See BipTransport::set_share_port_by_address for what changes.

Source

pub fn mutation_policy(self, policy: MutationPolicy) -> Self

Select local mutation authorization (default: MutationPolicy::Permissive). SC mTLS channel/peer authentication is not service authorization.

use bacnet_server::{mutation::MutationPolicy, server::BACnetServer};
let builder = BACnetServer::bip_builder().mutation_policy(MutationPolicy::DenyAll);
Source

pub fn policy(self, policy: impl ServerPolicy) -> Self

Install the server’s authorization policy; see ServerPolicy, or FnPolicy to build one from closures. It replaces any policy set before; put every decision in one policy (one FnPolicy chain) rather than calling this twice.

use bacnet_server::server::BACnetServer;
use bacnet_server::FnPolicy;
// Refuse every remote write; LifeSafety and Audit keep denying.
let builder = BACnetServer::bip_builder().policy(FnPolicy::new().mutation(|_| false));
Source§

impl BipServerBuilder

Source

pub fn audit_reporters(self, profile: AuditReportersConfig) -> Self

Enable the narrow target audit profile; see AuditReportersConfig.

Source§

impl BipServerBuilder

Source

pub fn reinit_password(self, password: impl Into<String>) -> Self

Set the password required for ReinitializeDevice requests.

Source

pub fn on_reinitialize<F>(self, handler: F) -> Self
where F: Fn(&ReinitializeContext, &mut ObjectDatabase) -> Result<(), Error> + Send + Sync + 'static,

Set the ReinitializeDevice handler. It must reply before restarting and stay quick; see ReinitializeHandler.

Source§

impl BipServerBuilder

Source

pub fn time_sync_policy(self, policy: TimeSyncPolicy) -> Self

Configure opt-in inbound clock restrictions; see TimeSyncPolicy.

Source§

impl BipServerBuilder

Source

pub fn dcc_disable_rate_limit(self, limit: Option<DccDisableRateLimit>) -> Self

Limit authorized DISABLE_INITIATION globally; None (default) disables it.

Source§

impl BipServerBuilder

Source

pub fn dcc_password(self, password: impl Into<String>) -> Self

Set the password required for DeviceCommunicationControl requests.

Source

pub fn dcc_source_restriction( self, restriction: Option<DccSourceRestriction>, ) -> Self

Restrict claimed DCC sources; requires explicit RequirePassword policy.

Source

pub fn dcc_policy(self, policy: DccPolicy) -> Self

Select explicit local DCC authorization (default: deny all).

Source§

impl BipServerBuilder

Source

pub fn registered_network_port(self, oid: ObjectIdentifier) -> Self

Select the built-in Network Port that represents this owned B/IP link.

Source§

impl BipServerBuilder

Source

pub fn request_admission_policy(self, policy: RequestAdmissionPolicy) -> Self

Set positive global and peer handler limits, validated before startup.

Source§

impl BipServerBuilder

Source

pub fn read_property_multiple_budget( self, budget: ReadPropertyMultipleBudget, ) -> Self

Set positive per-service RPM limits, validated before transport startup.

Source§

impl BipServerBuilder

Source

pub fn get_alarm_summary_budget(self, budget: GetAlarmSummaryBudget) -> Self

Set limits validated before transport startup.

Source§

impl BipServerBuilder

Source

pub fn atomic_read_file_budget(self, budget: AtomicReadFileBudget) -> Self

Set AtomicReadFile limits validated before transport startup.

Source§

impl BipServerBuilder

Source

pub fn atomic_write_file_budget(self, budget: AtomicWriteFileBudget) -> Self

Set AtomicWriteFile payload limits, validated before transport startup.

Source§

impl BipServerBuilder

Source

pub fn read_range_budget(self, budget: ReadRangeBudget) -> Self

Set ReadRange page limits, validated before startup.

Source§

impl BipServerBuilder

Source

pub fn get_event_information_budget( self, budget: GetEventInformationBudget, ) -> Self

Set GetEventInformation limits, validated before startup.

Source§

impl BipServerBuilder

Source

pub fn get_enrollment_summary_budget( self, budget: GetEnrollmentSummaryBudget, ) -> Self

Set GetEnrollmentSummary limits validated before transport startup.

Source§

impl BipServerBuilder

Source

pub fn device(self, identity: DeviceIdentity) -> Self

Set the one Device identity. With no supplied database, startup creates a stock Device after resolving the owned transport’s receive capacity.

Source

pub fn database(self, db: ObjectDatabase) -> Self

Set the object database (transfers ownership).

Source

pub fn device_binding(self, binding: DeviceBinding) -> Result<Self, Error>

Register one explicit unicast route for a Device recipient.

Source

pub fn audit_notification_sink(self, sink: ObjectIdentifier) -> Self

Select the only local Audit Log that receives authorized notifications.

Source

pub fn enable_fault_detection(self, enabled: bool) -> Self

Enable periodic fault detection / reliability evaluation.

When enabled, every object’s opt-in reliability hook runs every 10 seconds; the default hook is a no-op.

Reliability evaluation only; Event Enrollment evaluation is configured by enable_event_enrollment.

Source

pub fn enable_event_enrollment(self, enabled: bool) -> Self

Enable periodic Event Enrollment evaluation (default true).

Source

pub fn event_enrollment_interval_secs(self, secs: u64) -> Self

Set the interval in seconds between Event Enrollment evaluation passes (default 10).

Source

pub fn discovery_policy(self, policy: DiscoveryPolicy) -> Self

Set the discovery rate-limiting and duplicate suppression policy.

Source

pub fn cov_policy(self, policy: CovPolicy) -> Self

Set the COV quota and notification work budget policy, checked by CovPolicy::validate before transport startup.

Source

pub async fn build(self) -> Result<BACnetServer<BipTransport>, Error>

Build and start the server, constructing a BipTransport from the config.

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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