feat(access-point): declared writes for SSIDs, radios, VLAN names and the AP configuration, and a DHCP lease reader (NetOrk/netork#695)

WirelessWritesMixin declares push_ssid_config(ssid, SsidConfigDict), a
partial write, and set_radio_channels({radio: channel}), every radio in
one restart; AccessPointDriver and ResidentialGatewayDriver carry it.
AccessPointDriver declares set_vlan_name(vlan_id, name) and, through
ApConfigMixin, apply_ap_config(ApConfigDict, parts): the desired state
in vendor-neutral terms, of which the driver writes the parts the caller
found different, answered by ApConfigResultDict. The part names and
their I/O-free readers live in ap_config.

DhcpLeasesMixin declares get_dhcp_leases() with DhcpLeaseDict, apart
from DhcpServerMixin, so an access point can report the leases it serves.
This commit is contained in:
christianmanivong committed 2026-11-29 20:27:31 +01:00
1 parent 059d97f6de
commit 0db9c9ba65
12 files changed
+678 -2

No files matched your search

+26
View File
@@ -8,6 +8,32 @@ recorded here; their history is the git log.
## [Unreleased]
### Added
- An access point's writes as declared methods (NetOrk/netork#695), so an application no
longer builds the device's commands itself:
- `WirelessWritesMixin`, on `AccessPointDriver` and `ResidentialGatewayDriver`:
`push_ssid_config(ssid, SsidConfigDict)` writes the settings it is given (encryption,
key, hidden, enabled, disassoc_low_ack, max_inactivity) to every interface serving the
SSID and leaves the rest; `set_radio_channels({radio: channel})` changes every radio in
one go, with one restart of the wireless stack (`AUTO_CHANNEL`, 0, lets a radio choose).
A refused step raises.
- `AccessPointDriver.set_vlan_name(vlan_id, name)`: names a VLAN the access point
carries; True when written, False when it carries no such VLAN. An access point needs
no `set_vlan`, which creates VLANs on a switch.
- `ApConfigMixin.apply_ap_config(ApConfigDict, parts)`, on `AccessPointDriver`: the
access point's desired configuration, of which the driver writes the parts the caller
found different. `ApConfigDict` (and `ApSsidConfigDict` per SSID) names radios,
remote syslog, web interface, SSH, the management VLAN, the bridge and its spanning
tree, 802.11r and the SSIDs in vendor-neutral terms; `ApConfigResultDict` says which
parts were written, which were not (unknown, or missing a value they need, such as a
key), whether the device restarts, and what was sent with every passphrase masked.
The parts are `AP_CONFIG_PARTS`, `network/vlan/<vid>` and
`wireless/<ssid>/<attribute>` (`AP_CONFIG_SSID_ATTRIBUTES`); `ap_config_ssid_part`,
`ap_config_vlan_part` and `is_ap_config_part` read them.
- `DhcpLeasesMixin.get_dhcp_leases()`, a list of `DhcpLeaseDict` (mac, ip, hostname,
lease_end, state): the leases a DHCP server handed out, in a mixin of its own, apart from
`DhcpServerMixin`, so that an access point can report them. A failed read raises; a
device that serves none returns `[]`. A driver that already has the method keeps
working; it declares the mixin by adding it to its bases.
- `UpdateMixin.apply_updates(packages, *, log=None)`: an optional keyword-only `log` that
receives each line of the package manager's output as the host prints it
(NetOrk/netork#1112), as `harden_ssh_server(..., log=...)` does. A driver that cannot