6#ifndef NETLINK_OBJECT_H_
7#define NETLINK_OBJECT_H_
9#include <netlink/netlink.h>
10#include <netlink/utils.h>
20#define OBJ_CAST(ptr) ((struct nl_object *) (ptr))
29 struct nl_object *src);
35extern void nl_object_dump_buf(
struct nl_object *,
char *,
size_t);
45 uint32_t attrs,
char *buf,
50 uint32_t *, uint32_t);
66static inline void * nl_object_priv(
struct nl_object *obj)
int nl_object_alloc_name(const char *, struct nl_object **)
Allocate new object of kind specified by the name.
struct nl_object_ops * nl_object_get_ops(const struct nl_object *)
Return object operations structure.
uint32_t nl_object_diff(struct nl_object *, struct nl_object *)
Compute 32-bit bitmask representing difference in attribute values.
void nl_object_dump(struct nl_object *, struct nl_dump_params *)
Dump this object according to the specified parameters.
int nl_object_update(struct nl_object *dst, struct nl_object *src)
Merge a cacheable object.
const char * nl_object_get_type(const struct nl_object *)
Return the object's type.
struct nl_object * nl_object_clone(struct nl_object *obj)
Allocate a new object and copy all data from an existing object.
int nl_object_get_msgtype(const struct nl_object *)
Return the netlink message type the object was derived from.
char * nl_object_attrs2str(struct nl_object *, uint32_t attrs, char *buf, size_t)
Convert bitmask of attributes to a character string.
uint64_t nl_object_diff64(struct nl_object *, struct nl_object *)
Compute bitmask representing difference in attribute values.
uint32_t nl_object_get_id_attrs(struct nl_object *obj)
Return object id attribute mask.
int nl_object_get_refcnt(struct nl_object *)
Return number of references held.
int nl_object_shared(struct nl_object *)
Check whether this object is used by multiple users.
void nl_object_unmark(struct nl_object *)
Remove mark from object.
void nl_object_put(struct nl_object *)
Release a reference from an object.
struct nl_cache * nl_object_get_cache(struct nl_object *)
Return cache the object is associated with.
int nl_object_identical(struct nl_object *, struct nl_object *)
Check if the identifiers of two objects are identical.
char * nl_object_attr_list(struct nl_object *, char *, size_t)
Return list of attributes present in an object.
void nl_object_get(struct nl_object *)
Acquire a reference on a object.
void nl_object_free(struct nl_object *)
Free a cacheable object.
int nl_object_match_filter(struct nl_object *, struct nl_object *)
Match a filter against an object.
int nl_object_is_marked(struct nl_object *)
Return true if object is marked.
void nl_object_mark(struct nl_object *)
Add mark to object.
struct nl_object * nl_object_alloc(struct nl_object_ops *)
Allocate a new object of kind specified by the operations handle.
void nl_object_keygen(struct nl_object *, uint32_t *, uint32_t)
Generate object hash key.