CI / test (push) Failing after 18s
- New `network` panel module (in the default panel, before the battery and the clock): signal bars and the
Wi-Fi network's name, a plug when wired, crossed-out bars offline or in airplane mode. Its
popup shows the status and the last action's outcome ("Couldn't connect to X: wrong
password?"), switches for Wi-Fi and airplane mode, and the networks in range (strongest
access point per name, the one in use first). Click a saved or open network to connect, a new
secured one to type its password in a field under it (Enter or Connect), the one in use to
disconnect, or "Forget" on a saved one. Opening the popup asks for a scan.
- compositor/network: NetworkManager over D-Bus through a small D-Bus client of our own
(wire format, EXTERNAL auth, async calls) on the existing @sys socket calls, so neither host
needed new imports. One ObjectManager.GetManagedObjects + GetAll every 2 s; GetSettings once
per saved connection; RequestScan, Device.Disconnect, WirelessEnabled / WwanEnabled,
ActivateConnection (saved), AddAndActivateConnection (new: open, WPA/WPA2 PSK, WPA3 SAE) and
Settings.Connection.Delete. Without NetworkManager it falls back to read-only status from
/proc/net/dev, /proc/net/wireless and /sys/class/net (no network names there), and looks for
NetworkManager again every 30 s.
- New `network` capability (wit/capabilities.wit): status, wifi-networks, scan, connect,
disconnect, forget, set-wifi-enabled, set-airplane-mode. Served from host tables 8/9 and a
`network(network-request)` request by the wasmer/wasmtime stub (compositor/wasm), host-wasm
and the MoonBit wasmhost. The stub's build_list learned bool fields; request strings are
wiped after use (Wi-Fi passwords).
- Running out of module instances now says "too many modules loaded".
- Deferred: VPN, hotspot, hidden networks, WEP and 802.1X (enterprise) networks, IP settings,
mobile broadband beyond the airplane switch, D-Bus signals (state is polled).
- Tests: D-Bus wire format (incl. the well-known Hello bytes), NetworkManager objects -> status
and list, security settings, /proc parsing; the module through the shell against a fake
backend (list, connect/forget/disconnect, password entry, switches, read-only); a host-wasm
test; and scripts/test-network-dbus.sh, which runs the backend against python-dbusmock's
NetworkManager on a private bus.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hizqNXcNDuef3gxa7D
83 lines
1.8 KiB
MoonBit
83 lines
1.8 KiB
MoonBit
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
|
|
|
|
///|
|
|
pub fn mbt_ffi_cabi_realloc(
|
|
src_offset : Int,
|
|
src_size : Int,
|
|
_dst_alignment : Int,
|
|
dst_size : Int,
|
|
) -> Int {
|
|
// malloc
|
|
if src_offset == 0 && src_size == 0 {
|
|
return mbt_ffi_malloc(dst_size)
|
|
}
|
|
// free
|
|
if dst_size == 0 {
|
|
mbt_ffi_free(src_offset)
|
|
return 0
|
|
}
|
|
// realloc
|
|
let dst = mbt_ffi_malloc(dst_size)
|
|
mbt_ffi_copy(dst, src_offset, if src_size < dst_size { src_size } else { dst_size })
|
|
mbt_ffi_free(src_offset)
|
|
dst
|
|
}
|
|
|
|
///|
|
|
extern "wasm" fn mbt_ffi_copy(dest : Int, src : Int, len : Int) =
|
|
#|(func (param i32) (param i32) (param i32) local.get 0 local.get 1 local.get 2 memory.copy)
|
|
|
|
///|
|
|
extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int =
|
|
#|(func (param i32) (result i32) (local i32)
|
|
#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc
|
|
#| local.tee 1 i32.const 0 call $moonbit.init_array8
|
|
#| local.get 1)
|
|
|
|
///|
|
|
extern "wasm" fn mbt_ffi_free(position : Int) =
|
|
#|(func (param i32) local.get 0 call $moonbit.decref)
|
|
|
|
///|
|
|
#doc(hidden)
|
|
pub fn wasmExportInfoPostReturn(p0 : Int) -> Unit {
|
|
@plasmoid.wasmExportInfoPostReturn(p0)
|
|
}
|
|
|
|
///|
|
|
#doc(hidden)
|
|
pub fn wasmExportRender(p0 : Int, p1 : Int) -> Int {
|
|
@plasmoid.wasmExportRender(p0, p1)
|
|
}
|
|
|
|
///|
|
|
#doc(hidden)
|
|
pub fn wasmExportPopup() -> Int {
|
|
@plasmoid.wasmExportPopup()
|
|
}
|
|
|
|
///|
|
|
#doc(hidden)
|
|
pub fn wasmExportRenderPostReturn(p0 : Int) -> Unit {
|
|
@plasmoid.wasmExportRenderPostReturn(p0)
|
|
}
|
|
|
|
///|
|
|
#doc(hidden)
|
|
pub fn wasmExportPopupPostReturn(p0 : Int) -> Unit {
|
|
@plasmoid.wasmExportPopupPostReturn(p0)
|
|
}
|
|
|
|
///|
|
|
#doc(hidden)
|
|
pub fn wasmExportOnEvent(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int {
|
|
@plasmoid.wasmExportOnEvent(p0, p1, p2, p3)
|
|
}
|
|
|
|
///|
|
|
#doc(hidden)
|
|
pub fn wasmExportInfo() -> Int {
|
|
@plasmoid.wasmExportInfo()
|
|
}
|
|
|