57 lines
1.3 KiB
Rust
57 lines
1.3 KiB
Rust
//! Shared protocol primitives for the LAN party L2 tunnel.
|
|
//!
|
|
//! This crate intentionally contains no socket, TAP, QUIC, or OS-specific
|
|
//! behavior. It is the small contract that the Windows client, Linux gateway,
|
|
//! and relay must all agree on.
|
|
|
|
mod ethernet;
|
|
mod mac;
|
|
mod mtu;
|
|
mod overlay;
|
|
mod safety;
|
|
|
|
pub use ethernet::{
|
|
ETHERNET_HEADER_LEN,
|
|
EthernetFrame,
|
|
MAX_STANDARD_ETHERNET_FRAME_LEN,
|
|
MAX_STANDARD_ETHERNET_PAYLOAD_LEN,
|
|
MIN_ETHERNET_FRAME_LEN,
|
|
};
|
|
pub use mac::{MacAddr, MacParseError};
|
|
pub use mtu::{
|
|
DEFAULT_DATAGRAM_SAFETY_MARGIN,
|
|
DEFAULT_TAP_MTU,
|
|
MIN_USEFUL_TAP_MTU,
|
|
MtuError,
|
|
ethernet_frame_exceeds_tap_mtu,
|
|
max_ethernet_frame_len_for_tap_mtu,
|
|
max_tap_mtu_for_datagram,
|
|
recommended_tap_mtu,
|
|
};
|
|
pub use overlay::{
|
|
FrameType,
|
|
OVERLAY_FLAGS_NONE,
|
|
OVERLAY_HEADER_LEN,
|
|
OVERLAY_MAGIC,
|
|
OVERLAY_VERSION,
|
|
OverlayHeader,
|
|
OverlayPacket,
|
|
ProtoError,
|
|
decode_datagram,
|
|
encode_datagram,
|
|
validate_datagram_budget,
|
|
};
|
|
pub use safety::{
|
|
ETHERTYPE_8021AD,
|
|
ETHERTYPE_8021Q,
|
|
ETHERTYPE_EAPOL,
|
|
ETHERTYPE_IPV4,
|
|
ETHERTYPE_IPV6,
|
|
ETHERTYPE_LLDP,
|
|
ETHERTYPE_QINQ,
|
|
ETHERTYPE_SLOW_PROTOCOLS,
|
|
EthernetSafetyDrop,
|
|
gateway_lan_safety_drop_reason,
|
|
remote_client_safety_drop_reason,
|
|
};
|