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.- Network
Entry - One entry of
PROP_WIFI_NETWORKS: a network the device knows. - Scan
Result - One entry of
PROP_WIFI_SCAN_RESULTS: an access point the device heard.
Enums§
- ApState
PROP_WIFI_AP_STATEstates.- Link
Reason - Why the station is
LinkState::Connectingrather than up. - Link
State PROP_WIFI_LINKstates.- Security
Mode - A station’s minimum security requirement, or an advertised/AP mode.
Numeric codes are not a security ranking; use
Self::permits. - Wifi
Error - Decode or well-formedness failure.
Constants§
- AP_
CLIENT_ LEN - Encoded length of an
ApClient. - AP_
CONFIG_ MAX_ LEN - Largest encoded
ApConfig. - FLAG_
HIDDEN FLAGSbit 0: the network hides its SSID, so the device probes for it by name rather than waiting to hear it.- FLAG_
RAW_ KEY FLAGSbit 1: the credential is a rawPMK_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.