libnl  3.2.3
nl_cache_ops Struct Reference

Cache Operations. More...

#include <cache-api.h>

Data Fields

char * co_name
 Name of cache type (must be unique)
int co_hdrsize
 Size of family specific netlink header.
int co_protocol
 Netlink protocol.
struct nl_af_groupco_groups
 Group definition.
int(* co_request_update )(struct nl_cache *, struct nl_sock *)
 Called whenever an update of the cache is required.
int(* co_msg_parser )(struct nl_cache_ops *, struct sockaddr_nl *, struct nlmsghdr *, struct nl_parser_param *)
 Called whenever a message was received that needs to be parsed.
int(* co_event_filter )(struct nl_cache *, struct nl_object *obj)
 Called whenever a notification has been parsed into an object and is considered for inclusion into a cache.
struct nl_object_opsco_obj_ops
 Object operations.
struct nl_cache_opsco_next
 Internal, do not touch!
struct nl_cache * co_major_cache
struct genl_opsco_genl
struct nl_msgtype co_msgtypes []

Detailed Description

Cache Operations.

This structure defines the characterstics of a cache type. It contains pointers to functions which implement the specifics of the object type the cache can hold.

Definition at line 176 of file cache-api.h.


Field Documentation

int(* nl_cache_ops::co_request_update)(struct nl_cache *, struct nl_sock *)

Called whenever an update of the cache is required.

Must send a request message to the kernel requesting a complete dump.

Definition at line 194 of file cache-api.h.

int(* nl_cache_ops::co_msg_parser)(struct nl_cache_ops *, struct sockaddr_nl *, struct nlmsghdr *, struct nl_parser_param *)

Called whenever a message was received that needs to be parsed.

Must parse the message and call the paser callback function (nl_parser_param) provided via the argument.

Definition at line 201 of file cache-api.h.

Referenced by genl_register().

int(* nl_cache_ops::co_event_filter)(struct nl_cache *, struct nl_object *obj)

Called whenever a notification has been parsed into an object and is considered for inclusion into a cache.

Must return NL_SKIP if the object should not be included in the cache.

Definition at line 209 of file cache-api.h.