Home /Modules/wifi/WIFI.VM.BRIDGE.md

WIFI.VM.BRIDGE.md

lib/wifi/WIFI.VM.BRIDGE.md · 37 line(s) · markdown

SLeeLa Wi-Fi SLVM bridge contract

Native ownership

The live adapter operations are implemented in wifi-common/ as the C wifi_manager_t API and the C++17 wrapper. The source objects under /lib/wifi are the SLeeLa-facing data model, policy layer, and OOD state facade. They do not fabricate successful radio results.

The current SLVM must register a platform bridge before an SLeeLa OOD can discover live access points. The bridge owns a bounded table of wifi_manager_t instances; SLWifiManager.nativeHandle is a VM-local index into that table, not a native pointer. Only the bridge may create/destroy the underlying manager or dereference its handle.

Required operations

The VM/OS adapter maps these logical operations to the C ABI:

SLeeLa OOD operationNative C operationResult
initialize with policywifi_security_policy_default, wifi_manager_initVM-local manager handle or status
scanwifi_manager_scancurrent bounded result set and count
select resultwifi_manager_selectan exact network value copied into VM-owned memory
connectwifi_manager_connectnative connection request status
disconnectwifi_manager_disconnectdisconnection status
report security/statuswifi_security_name, wifi_status_nameUTF-8 diagnostic text

Native scan results must be copied into VM-owned objects. Never expose pointers into the C manager's internal cache to SLeeLa code. Revalidate the selected SSID, BSSID and security using the native API at connection time. Treat all strings crossing the bridge as UTF-8 and length-bound them to the C ABI's 32-octet SSID and 17-character BSSID limits.

Authentication boundary

State contract

SLWifiManager.beginScanRequest() enters SCANNING only after a native handle has been bound. The bridge reports completion through acceptScanResult(status, count). The UI must populate the list only from results returned by the current scan. A connection attempt first runs the SLeeLa policy checks, then passes the copied selection and credential mode to the native API. Only acceptConnectionResult(WIFI_STATUS_OK) may move the facade to CONNECTED.

The portable C API and native provider build/test workflow is .github/workflows/wifi-native.yml. Platform SDK, driver, permissions and regulatory state still govern what hardware can do.