Module netlink.genl

Generic netlink (NETLINK_GENERIC) interface.

A netlink.session specialization: create an instance with 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:call (family_id, cmd[, flags=0[, payload]]) Sends a single generic netlink command and returns the decoded reply messages.
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]) Creates a new genl object.


Class genl

Generic netlink session.
genl:call (family_id, cmd[, flags=0[, payload]])
Sends a single generic netlink command and returns the decoded reply messages.

Parameters:

  • family_id integer family id (from family).
  • cmd integer command number.
  • flags integer additional NLMF* flags. (default 0)
  • payload string serialized attributes. (optional)

Returns:

    table list of {cmd, attrs} response messages.

Raises:

on netlink error.
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:

if the family does not exist.
genl:new ([o])
Creates a new genl object.

Parameters:

  • o table an initial object table. (optional)

Returns:

    genl the new genl object.

See also:

generated by LDoc 1.5.0 Last updated 2026-07-04 13:06:33