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
//! OS-level TUN and TAP devices.
//!
//! - [`Tun`] is an L3 device that reads/writes raw IP packets.
//! - [`Tap`] is an L2 device that reads/writes Ethernet frames.
//!
//! Both spawn a background reader thread which invokes the installed handler
//! for each received message.
//!
//! Platform support:
//! - **Linux**: TUN and TAP via `/dev/net/tun`.
//! - **macOS**: TUN via the `utun` kernel control. TAP is not available
//! (the OS has no kernel TAP driver); [`Tap::open`] returns
//! `ErrorKind::Unsupported`. The macOS path is compiled and type-checked
//! against the `x86_64-apple-darwin` target but cannot be exercised in the
//! Linux CI sandbox; runtime paths are marked `// TODO(tuntap): needs macOS`.
//! - **Everywhere else**: the types compile but [`Tun::open`] and [`Tap::open`]
//! return `ErrorKind::Unsupported`.
pub use ;
pub use ;
// Everywhere else the types still exist so that `full` -- and any
// cross-platform code naming them -- compiles; opening one reports
// `Unsupported` rather than failing the build.
pub use ;
setters!