Expand description
Client and protocol support for iWAN-compatible networks.
The crate separates the byte-level protocol from system tunnel management.
Applications that already own a TUN device can use Client and
PacketDevice without invoking any platform commands.
§Main APIs
Clientauthenticates direct connections and creates aConnectedSession.PacketDeviceexchanges IP packets without configuring a system TUN interface.ClientConfigconfigures transport, encryption, reconnection, and Segment Routing.protocolcontains wire-level packet and TLV types.managedcontains controller authentication and connection discovery when themanagedfeature is enabled.
§Example
use openiwan::{Client, ClientConfig, EncryptionMethod, Result};
fn connect(password: String) -> Result<()> {
let mut config = ClientConfig::new("vpn.example.com:443");
config.encryption = EncryptionMethod::Aes;
let client = Client::new(config, "alice", password)?;
let session = client.authenticate()?;
session.close()
}§Cargo features
managedenables controller-managed APIs and the CLI’s profile and saved credential workflows.forwardenables the CLI’s TCP, HTTP, and HTTPS forwarding commands.
Both features are enabled by default. Disable them when an application needs only the core client, protocol, DNS, and TUN APIs.
Re-exports§
pub use client::Client;pub use client::ConnectedSession;pub use client::PacketDevice;pub use client::SessionEnd;pub use client::SessionInfo;pub use config::ClientConfig;pub use config::ReconnectPolicy;pub use config::SegmentRoutingConfig;pub use error::Error;pub use error::Result;pub use protocol::EncryptionMethod;pub use protocol::PacketHeader;pub use protocol::PacketType;pub use protocol::Tlv;pub use protocol::TlvType;pub use sr::SrEncryptionAlgorithm;
Modules§
- client
- config
- crypto
- Cryptographic primitives used by the traditional iWAN data plane.
- dns
- DNS policy, packet enforcement, physical relay, platform configuration, and userspace name resolution.
- error
- fragment
- Traditional and segment-routing iWAN fragment codecs.
- managed
- protocol
- Byte-exact traditional iWAN framing.
- sr
- Segment Routing (SEGRT) transport.
- tun