@fkn/lib/wire
Type Aliases
Section titled “Type Aliases”TcpSocketOption
Section titled “TcpSocketOption”type TcpSocketOption = | { type: typeof TCP_OPTION_NODELAY; value: boolean;} | { type: typeof TCP_OPTION_TTL; value: number;} | { enabled: boolean; initialDelaySeconds: number; type: typeof TCP_OPTION_KEEPALIVE;} | { type: typeof TCP_OPTION_SEND_BUFFER_SIZE; value: number;} | { type: typeof TCP_OPTION_RECV_BUFFER_SIZE; value: number;};UdpSocketOption
Section titled “UdpSocketOption”type UdpSocketOption = | { type: typeof UDP_OPTION_BROADCAST; value: boolean;} | { type: typeof UDP_OPTION_TTL; value: number;} | { type: typeof UDP_OPTION_MULTICAST_TTL_V4; value: number;} | { type: typeof UDP_OPTION_MULTICAST_LOOP_V4; value: boolean;} | { type: typeof UDP_OPTION_MULTICAST_LOOP_V6; value: boolean;} | { group: Uint8Array; interface: Uint8Array; type: typeof UDP_OPTION_ADD_MEMBERSHIP_V4;} | { group: Uint8Array; interface: Uint8Array; type: typeof UDP_OPTION_DROP_MEMBERSHIP_V4;} | { group: Uint8Array; ifIndex: number; type: typeof UDP_OPTION_ADD_MEMBERSHIP_V6;} | { group: Uint8Array; ifIndex: number; type: typeof UDP_OPTION_DROP_MEMBERSHIP_V6;} | { type: typeof UDP_OPTION_SEND_BUFFER_SIZE; value: number;} | { type: typeof UDP_OPTION_RECV_BUFFER_SIZE; value: number;};Variables
Section titled “Variables”TCP_OPTION_KEEPALIVE
Section titled “TCP_OPTION_KEEPALIVE”const TCP_OPTION_KEEPALIVE: 2;TCP_OPTION_NODELAY
Section titled “TCP_OPTION_NODELAY”const TCP_OPTION_NODELAY: 0;Socket option codes as they appear on the WebVPN wire, and the option shapes built from them.
These live in the library rather than beside the packet codecs because BOTH sides need them and
only one side may own them. @fkn/lib already imported these constants at value level (see
webvpn/net.ts and webvpn/dgram.ts), so the previous arrangement had the published package
reaching into src/api/webvpn/packets/* for its own vocabulary, which dragged those modules and
their imports into the library’s type program.
Owning them here inverts that: the codecs in src/api/webvpn/packets/ import from this file, and
the library needs nothing from the app to describe a socket option.
The VALUES are protocol. They are the u8 discriminant of a tagged union nested inside a TcpSetOption or UdpSetOption client packet (metadata-stream tag 8), and a relay built against these numbers is deployed independently of any browser holding this file. Renumbering one is a wire break, not a refactor. Booleans go on the wire as u8, 0 for false and anything else true.
TCP_OPTION_RECV_BUFFER_SIZE
Section titled “TCP_OPTION_RECV_BUFFER_SIZE”const TCP_OPTION_RECV_BUFFER_SIZE: 4;TCP_OPTION_SEND_BUFFER_SIZE
Section titled “TCP_OPTION_SEND_BUFFER_SIZE”const TCP_OPTION_SEND_BUFFER_SIZE: 3;TCP_OPTION_TTL
Section titled “TCP_OPTION_TTL”const TCP_OPTION_TTL: 1;UDP_OPTION_ADD_MEMBERSHIP_V4
Section titled “UDP_OPTION_ADD_MEMBERSHIP_V4”const UDP_OPTION_ADD_MEMBERSHIP_V4: 5;UDP_OPTION_ADD_MEMBERSHIP_V6
Section titled “UDP_OPTION_ADD_MEMBERSHIP_V6”const UDP_OPTION_ADD_MEMBERSHIP_V6: 7;UDP_OPTION_BROADCAST
Section titled “UDP_OPTION_BROADCAST”const UDP_OPTION_BROADCAST: 0;UDP_OPTION_DROP_MEMBERSHIP_V4
Section titled “UDP_OPTION_DROP_MEMBERSHIP_V4”const UDP_OPTION_DROP_MEMBERSHIP_V4: 6;UDP_OPTION_DROP_MEMBERSHIP_V6
Section titled “UDP_OPTION_DROP_MEMBERSHIP_V6”const UDP_OPTION_DROP_MEMBERSHIP_V6: 8;UDP_OPTION_MULTICAST_LOOP_V4
Section titled “UDP_OPTION_MULTICAST_LOOP_V4”const UDP_OPTION_MULTICAST_LOOP_V4: 3;UDP_OPTION_MULTICAST_LOOP_V6
Section titled “UDP_OPTION_MULTICAST_LOOP_V6”const UDP_OPTION_MULTICAST_LOOP_V6: 4;UDP_OPTION_MULTICAST_TTL_V4
Section titled “UDP_OPTION_MULTICAST_TTL_V4”const UDP_OPTION_MULTICAST_TTL_V4: 2;UDP_OPTION_RECV_BUFFER_SIZE
Section titled “UDP_OPTION_RECV_BUFFER_SIZE”const UDP_OPTION_RECV_BUFFER_SIZE: 10;UDP_OPTION_SEND_BUFFER_SIZE
Section titled “UDP_OPTION_SEND_BUFFER_SIZE”const UDP_OPTION_SEND_BUFFER_SIZE: 9;UDP_OPTION_TTL
Section titled “UDP_OPTION_TTL”const UDP_OPTION_TTL: 1;