Module wifi

Module wifi 

Source
Expand description

Wi-Fi codecs (PROP_WIFI_*).

The structures of docs/protocol/src/ulcp-wifi.md: a known-network entry and its credential, a scan result, the station’s link, and the access point’s configuration, state, and clients.

Every codec here is used by both sides, which is the point: a device that builds PROP_WIFI_LINK with the same writer a host parses it with cannot disagree with that host about the format.

Decoding is structural and tolerant in the way docs/protocol/src/ulcp-conformance.md requires of receivers: it rejects what it cannot parse and accepts what it can, including trailing octets a later revision may append. Well-formedness, the rules a device answers STATUS_INVALID_ARGUMENT to, is NetworkEntry::validate and ApConfig::validate, kept separate so that a sender can check itself before transmitting and a device can check the sender.

Whole-table values concatenate items with a length prefix each; that framing is crate::items::prefixed_items and is not repeated here.

Structs§

ApClient
One entry of PROP_WIFI_AP_CLIENTS: a station on the device’s network.
ApConfig
PROP_WIFI_AP_CONFIG: the network the device offers.
ApStatus
PROP_WIFI_AP_STATE.
Association
Which access point the station is on, present only while up.
Link
PROP_WIFI_LINK.
NetworkEntry
One entry of PROP_WIFI_NETWORKS: a network the device knows.
ScanResult
One entry of PROP_WIFI_SCAN_RESULTS: an access point the device heard.

Enums§

ApState
PROP_WIFI_AP_STATE states.
LinkReason
Why the station is LinkState::Connecting rather than up.
LinkState
PROP_WIFI_LINK states.
SecurityMode
A station’s minimum security requirement, or an advertised/AP mode. Numeric codes are not a security ranking; use Self::permits.
WifiError
Decode or well-formedness failure.

Constants§

AP_CLIENT_LEN
Encoded length of an ApClient.
AP_CONFIG_MAX_LEN
Largest encoded ApConfig.
FLAG_HIDDEN
FLAGS bit 0: the network hides its SSID, so the device probes for it by name rather than waiting to hear it.
FLAG_RAW_KEY
FLAGS bit 1: the credential is a raw PMK_LEN-octet pairwise master key rather than a passphrase.
LINK_MAX_LEN
Largest encoded Link: state, reason, BSSID, and frequency.
MAC_LEN
Length of a BSSID or a station MAC address.
NETWORK_ENTRY_MAX_LEN
Largest encoded NetworkEntry: flags, mode, length, a full SSID, and the longest credential any mode defines.
PASSPHRASE_MAX_LEN
Longest WPA/WPA2 passphrase, per 802.11 Annex J.
PASSPHRASE_MIN_LEN
Shortest WPA/WPA2 passphrase, per 802.11 Annex J.
PMK_LEN
Length of a raw pairwise master key.
SAE_PASSWORD_MAX_LEN
Longest SAE password this protocol admits. SAE itself sets no bound; this is where the more generous stacks stop.
SCAN_RESULT_MAX_LEN
Largest encoded ScanResult.
SSID_MAX_LEN
Longest SSID, in octets. Not text: an SSID is 0 to 32 arbitrary octets, and a device compares it bytewise.