netlink.nl80211.interfaceModule
Wireless interface management.
An nl80211 object over the"nl80211"
generic netlink family: create an instance with netlink.nl80211.interface()
then list, add and delete wireless interfaces; the underlying socket is
closed by close() (or the to-be-closed __close). All methods block and
require a sleepable runtime.
See also
Class interface
| interface:__call ([pid]) | Opens a session, calling the class: netlink.nl80211.interface([pid]). |
| interface:add (opts) | Adds a virtual interface to a wiphy. |
| interface:del (opts) | Deletes a virtual interface. |
| interface:list ([opts]) | Lists the wireless interfaces known to the kernel. |
| interface:new ([o]) | Wraps a table in the class, or derives a class from it. |
Class interface in detail
- interface:__call ([pid])
-
Opens a session, calling the class:
netlink.nl80211.interface([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
-
interface
a new interface object;
niland"ESRCH"if no task has that pid, or the task has exited.Raises
EOPNOTSUPPon a kernel whose sockets cannot hold a namespace of their own, orENOENTwhen the nl80211 family is not registered.See also
- interface:add (opts)
-
Adds a virtual interface to a wiphy.
Parameters
- opts
table
interface parameters: wiphy (radio index, from
netlink.nl80211.wiphy),
nameandiftype(annl80211.iftype).
Returns
-
integer
the new interface’s
ifindex.Raises
on a netlink error (e.g. the name is taken or the iftype unsupported). - opts
table
interface parameters: wiphy (radio index, from
netlink.nl80211.wiphy),
- interface:del (opts)
-
Deletes a virtual interface.
Parameters
- opts
table
interface parameters:
ifindex.
Raises
on a netlink error. - opts
table
interface parameters:
- interface:list ([opts])
-
Lists the wireless interfaces known to the kernel.
Parameters
- opts table list options, of which an interface takes none. (optional)
Returns
-
table
list of
{ifindex, name, wiphy, iftype, mac}tables (macis 6 raw bytes). - interface:new ([o])
-
Wraps a table in the class, or derives a class from it. It opens no socket: calling the class
does,
netlink.nl80211.interface().Parameters
- o table an initial object table. (optional)
Returns
-
interface
the wrapped table or the derived class.
See also