1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! # knust — Asynchronous KNX/IP Library for Rust
//!
//! knust is a high-performance, memory-safe implementation of the KNX/IP protocol
//! for building automation systems. It provides async/await support and strong
//! type safety while maintaining compatibility with KNX standards.
//!
//! ## Features
//!
//! - Async/await support with tokio
//! - Memory-safe protocol parsing
//! - Support for tunneling and routing connections
//! - Comprehensive error handling
//! - Property-based testing for correctness
//!
//! ## Cargo features
//!
//! - `dpt` (**on** by default) — datapoint-type encode/decode (DPT 1..251).
//! Disable for a raw-frame-only client that never interprets group values;
//! owns the `strum` dependency.
//! - `ets` (off) — ETS CSV group-address import (`parse_ets_csv`). The only
//! consumer of tokio's `fs`. Implies `dpt` (DPT string parsing).
//! - `server` (off) — act as a KNXnet/IP tunneling server (`TunnelServer`).
//! Most consumers are clients and don't need it.
//! - `secure` (off) — KNX IP Secure + KNX Data Security: session handshake,
//! group encryption, `.knxkeys` keyring parsing/validation, and the secure
//! server path. Pulls in the crypto stack (`aes`, `x25519-dalek`, `pbkdf2`,
//! `sha2`, …). Implies `ets`.
//! KNX IP Secure (the session handshake) is verified against real
//! hardware; KNX Data Security (group encryption, see
//! [`security::group`]) is **experimental** and unverified against a
//! reference implementation — see that module's docs.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use knust::{Knx, ConnectionConfig, ConnectionType};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), knust::KnxError> {
//! let config = ConnectionConfig {
//! connection_type: ConnectionType::Tunneling,
//! gateway_ip: Some("192.168.1.100".parse().unwrap()),
//! ..Default::default()
//! };
//!
//! let knx = Knx::new(config).await?;
//! // Use the library...
//! Ok(())
//! }
//! ```
// `clippy::pedantic` lints that are noise for a byte-level KNX/IP protocol
// library. These are deliberate, not oversights:
// - casts: protocol code packs/unpacks bytes and scales fixed-point values;
// `try_from` would inject failure paths for values already masked/bounded.
// - too_many_lines / struct_excessive_bools: size heuristics; splitting the
// protocol state machines or replacing config bools would churn the API
// without making it clearer.
// Re-export commonly used types
pub use ;
pub use KeyringConfig;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
/// Library version information
pub const VERSION: &str = env!;