microsandbox_network/lib.rs
1//! `microsandbox-network` provides the smoltcp in-process networking engine
2//! for sandbox network isolation and policy enforcement.
3
4// New lints introduced in rustc 1.95 fire on existing code; addressing
5// them is out of scope for the current change and tracked separately.
6#![allow(
7 clippy::useless_conversion,
8 clippy::identity_op,
9 clippy::unnecessary_cast,
10 clippy::needless_update,
11 clippy::manual_c_str_literals
12)]
13
14mod addr;
15
16pub mod config;
17pub mod dns;
18pub mod icmp;
19pub mod netstack;
20pub mod network;
21pub mod policy;
22pub mod ports;
23pub mod secrets;
24pub mod tcp;
25pub mod tls;
26pub mod udp;
27
28//--------------------------------------------------------------------------------------------------
29// Constants
30//--------------------------------------------------------------------------------------------------
31
32/// Static hostname the guest uses to reach the sandbox host.
33///
34/// The host-side DNS interceptor matches guest queries against this
35/// name, and agentd writes the same name into `/etc/hosts`.
36pub(crate) const HOST_ALIAS: &str = "host.microsandbox.internal";
37
38//--------------------------------------------------------------------------------------------------
39// Re-Exports
40//--------------------------------------------------------------------------------------------------
41
42pub use config::builder;
43pub use icmp::{error as icmp_error, relay as icmp_relay};
44pub use netstack::{backend, device, poll as stack, shared};
45pub use ports::publisher;
46pub use tcp::{connection as conn, proxy};
47pub use udp::{fragments as udp_fragments, relay as udp_relay};