#[non_exhaustive]pub struct SessionInfo {Show 14 fields
pub tunnel_id: TunnelId,
pub peer_tunnel_id: TunnelId,
pub session_id: SessionId,
pub peer_session_id: SessionId,
pub pseudowire_type: PseudowireType,
pub l2spec_type: Option<L2SpecType>,
pub cookie: Cookie,
pub peer_cookie: Cookie,
pub recv_seq: bool,
pub send_seq: bool,
pub lns_mode: bool,
pub recv_timeout_ms: Option<u64>,
pub ifname: Option<L2tpIfName>,
pub using_ipsec: bool,
}Expand description
Runtime information returned by the kernel for a session.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tunnel_id: TunnelIdParent tunnel identifier.
peer_tunnel_id: TunnelIdPeer tunnel identifier of the parent tunnel.
session_id: SessionIdLocal session identifier.
peer_session_id: SessionIdPeer session identifier.
pseudowire_type: PseudowireTypeSession pseudowire type.
l2spec_type: Option<L2SpecType>Session L2-specific sublayer type, when the kernel reports it.
Linux accepts L2TP_ATTR_L2SPEC_TYPE on creation but omits it from
session replies, so this is None on current kernels and the value
given at creation cannot be read back.
Local session cookie; empty when none is set.
Peer session cookie; empty when none is set.
recv_seq: boolReceive sequence checking state.
send_seq: boolTransmit sequence number state.
lns_mode: boolLNS mode state.
recv_timeout_ms: Option<u64>Receive timeout in milliseconds.
ifname: Option<L2tpIfName>The session interface name as recorded when the session was created.
The kernel copies the l2tpeth device’s name into the session once,
right after creating the device, and never updates it: an interface
renamed afterwards with rtnetlink keeps being reported, and matched
by the *_by_ifname lookups, under this original name. Applications
that rename these interfaces, or run where udev or networkd rename
them, must track the device by its interface index:
SessionHandle::ifindex captures it from the kernel’s registration
broadcast when the session is created. A lookup of this name with
L2tpIfNameExt::index is only
correct while the interface still bears it, and the kernel does not
report the index itself. Request an explicit, unique name in
SessionConfig::ifname rather than relying on the kernel’s
l2tpeth%d pool, so that no other device can hold the name while
this one does.
using_ipsec: boolWhether IPsec offload/protection is in use.