tun/
lib.rs

1//            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2//                    Version 2, December 2004
3//
4// Copyleft (ↄ) meh. <meh@schizofreni.co> | http://meh.schizofreni.co
5//
6// Everyone is permitted to copy and distribute verbatim or modified
7// copies of this license document, and changing it is allowed as long
8// as the name is changed.
9//
10//            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11//   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12//
13//  0. You just DO WHAT THE FUCK YOU WANT TO.
14
15mod error;
16pub use crate::error::{BoxError, Error, Result};
17
18mod address;
19pub use crate::address::ToAddress;
20
21mod device;
22pub use crate::device::AbstractDevice;
23
24mod configuration;
25pub use crate::configuration::{Configuration, Layer};
26
27mod platform;
28pub use crate::platform::*;
29
30pub(crate) mod run_command;
31
32#[cfg(feature = "async")]
33mod r#async;
34#[cfg(feature = "async")]
35pub use r#async::*;
36
37pub fn configure() -> Configuration {
38    Configuration::default()
39}
40
41#[cfg(unix)]
42pub const DEFAULT_MTU: u16 = 1500;
43#[cfg(windows)]
44pub const DEFAULT_MTU: u16 = wintun_bindings::MAX_IP_PACKET_SIZE as _; // u16::MAX
45
46pub const PACKET_INFORMATION_LENGTH: usize = 4;