libnl 3.5.0

Data Fields
genl_cmd Struct Reference
Generic Netlink Library (libnl-genl) » Family and Command Registration

Definition of a Generic Netlink command. More...

`#include <netlink/genl/mngt.h>`

## Data Fields
int | c_id
| Numeric command identifier (required)
char * | c_name
| Human readable name (required)
int | c_maxattr
| Maximum attribute identifier that the command is prepared to handle. More...
int(* | c_msg_parser )(struct nl_cache_ops *, struct genl_cmd *, struct genl_info *, void *)
| Called whenever a message for this command is received.
struct nla_policy * | c_attr_policy
| Attribute validation policy, enforced before the callback is called.

## Detailed Description

Definition of a Generic Netlink command.

This structure is used to define the list of available commands on the receiving side.

Example:
  static struct genl_cmd foo_cmds[] = {
  {
  .c_id = FOO_CMD_NEW,
  .c_name = "NEWFOO" ,
  .c_maxattr = FOO_ATTR_MAX,
  .c_attr_policy = foo_policy,
  .c_msg_parser = foo_msg_parser,
  },
  {
  .c_id = FOO_CMD_DEL,
  .c_name = "DELFOO" ,
  },
  };
  static struct genl_ops my_genl_ops = {
  [...]
  .o_cmds = foo_cmds,
  .o_ncmds = ARRAY_SIZE(foo_cmds),
  };

Definition at line 87 of file mngt.h.

## Field Documentation

## ◆ c_maxattr

int genl_cmd::c_maxattr

Maximum attribute identifier that the command is prepared to handle.

Definition at line 96 of file mngt.h.