libnl 3.5.0

Data Fields | Private Attributes
genl_ops Struct Reference
Generic Netlink Library (libnl-genl) » Family and Command Registration

Definition of a Generic Netlink family. More...

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

## Data Fields
unsigned int | o_hdrsize
| Length of user header.
int | o_id
| Numeric identifier, automatically filled in by genl_ops_resolve()
char * | o_name
| Human readable name, used by genl_ops_resolve() to resolve numeric id.
struct nl_cache_ops * | o_cache_ops
| If registered via genl_register(), will point to the related cache operations.
struct genl_cmd * | o_cmds
| Optional array defining the available Generic Netlink commands.
int | o_ncmds
| Number of elements in `o_cmds` array.

## Private Attributes
struct nl_list_head | o_list
| Used internally to link together all registered operations.

## Detailed Description

Definition of a Generic Netlink family.

Example:
  static struct genl_cmd foo_cmds[] = {
  [...]
  };
  static struct genl_ops my_genl_ops = {
  .o_name = "foo",
  .o_hdrsize = sizeof(struct my_hdr),
  .o_cmds = foo_cmds,
  .o_ncmds = ARRAY_SIZE(foo_cmds),
  };
  if ((err = genl_register_family(&my_genl_ops)) < 0)
  // ERROR

See also
  genl_cmd

Definition at line 132 of file mngt.h.