Lunatik

netlink.nl80211.apModule

Access Point control.

An nl80211 object over the "nl80211" generic netlink family: create an instance with netlink.nl80211.ap() then start and stop beaconing on an AP-mode interface; the underlying socket is closed by close() (or the to-be-closed __close). All methods block and require a sleepable runtime.

See also

Class ap

ap:__call ([pid]) Opens a session, calling the class: netlink.nl80211.ap([pid]).
ap:new ([o]) Wraps a table in the class, or derives a class from it.
ap:start (opts) Starts beaconing on an AP-mode interface (which must already be up).
ap:stop (opts) Stops beaconing on an AP-mode interface.

Class ap in detail

ap:__call ([pid])
Opens a session, calling the class: netlink.nl80211.ap([pid]).

Parameters

  • pid integer a task whose network namespace the object reaches, which holds the wiphys and interfaces nl80211 answers for; the initial network namespace when absent. (optional)

Returns

    ap a new ap object; nil and "ESRCH" if no task has that pid, or the task has exited.

Raises

EOPNOTSUPP on a kernel whose sockets cannot hold a namespace of their own, or ENOENT when the nl80211 family is not registered.

See also

ap:new ([o])
Wraps a table in the class, or derives a class from it. It opens no socket: calling the class does, netlink.nl80211.ap().

Parameters

  • o table an initial object table. (optional)

Returns

    ap the wrapped table or the derived class.

See also

ap:start (opts)
Starts beaconing on an AP-mode interface (which must already be up).

Parameters

  • opts table AP parameters: ifindex (an AP interface), freq (channel frequency in MHz), beacon_interval (in TU, 1024 microseconds), dtim (in beacon intervals) and head (the raw beacon frame up to the TIM element); optional ssid and tail (the raw beacon frame after the TIM).

Raises

on a netlink error (e.g. the interface is not an AP, is down, or the beacon or channel is rejected).
ap:stop (opts)
Stops beaconing on an AP-mode interface.

Parameters

  • opts table AP parameters: ifindex.

Raises

on a netlink error.