libnl 3.7.0

Definition of a Generic Netlink command. More...

#include <netlink/genl/mngt.h>

Data Fields

int c_id
 Numeric command identifier (required) More...
 
char * c_name
 Human readable name (required) More...
 
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. More...
 
struct nla_policyc_attr_policy
 Attribute validation policy, enforced before the callback is called. More...
 

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 of a Generic Netlink command.
Definition: mngt.h:82
int c_id
Numeric command identifier (required)
Definition: mngt.h:84
Definition of a Generic Netlink family.
Definition: mngt.h:127

Definition at line 81 of file mngt.h.

Field Documentation

◆ c_id

int genl_cmd::c_id

Numeric command identifier (required)

Definition at line 84 of file mngt.h.

◆ c_name

char* genl_cmd::c_name

Human readable name (required)

Definition at line 87 of file mngt.h.

◆ c_maxattr

int genl_cmd::c_maxattr

Maximum attribute identifier that the command is prepared to handle.

Definition at line 90 of file mngt.h.

◆ c_msg_parser

int(* genl_cmd::c_msg_parser) (struct nl_cache_ops *, struct genl_cmd *, struct genl_info *, void *)

Called whenever a message for this command is received.

Definition at line 93 of file mngt.h.

◆ c_attr_policy

struct nla_policy* genl_cmd::c_attr_policy

Attribute validation policy, enforced before the callback is called.

Definition at line 98 of file mngt.h.