netlink.genlModule
Generic netlink (NETLINK_GENERIC) interface.
netlink.genl(), resolve a family name to
its id, then dispatch commands; close it when done. All methods block and
require a sleepable runtime.
See also
Class genl
| genl:dump (family_id, cmd[, payload]) | Sends a dump command and collects the full multipart response. |
| genl:family (name) | Resolves a generic netlink family name to its (dynamically assigned) id. |
| genl:new ([o]) | Derives a class from the generic netlink session, as the netlink.nl80211 classes are, or wraps a table in it. |
| genl:talk (family_id, cmd, payload[, flags=0]) | Sends a single generic netlink command and returns the decoded reply messages. |
Class genl in detail
Generic netlink session.
- genl:dump (family_id, cmd[, payload])
-
Sends a dump command and collects the full multipart response.
Parameters
- family_id integer family id (from family).
- cmd integer command number.
- payload string serialized attributes. (optional)
Returns
-
table
list of
{cmd, attrs}response messages.Raises
on netlink error. - genl:family (name)
-
Resolves a generic netlink family name to its (dynamically assigned) id.
Parameters
- name
string
family name (e.g.
"nlctrl","nl80211").
Returns
-
integer
the family id.
Raises
the name of the errno the controller answers:ENOENTwhen no family has that name,EINVALwhen the name is longer thanGENL_NAMSIZ - 1bytes. - name
string
family name (e.g.
- genl:new ([o])
-
Derives a class from the generic netlink session, as the netlink.nl80211 classes are, or wraps a
table in it. It opens no socket: calling the class does,
netlink.genl().Parameters
- o table an initial object table. (optional)
Returns
-
genl
the derived class or the wrapped table.
See also
- genl:talk (family_id, cmd, payload[, flags=0])
-
Sends a single generic netlink command and returns the decoded reply messages.
Parameters
- family_id integer family id (from family).
- cmd integer command number.
- payload string serialized attributes.
- flags integer additional NLM_F_* flags. (default 0)
Returns
-
table
list of
{cmd, attrs}response messages.Raises
on netlink error.