12 #ifndef NETLINK_OBJECT_H_
13 #define NETLINK_OBJECT_H_
15 #include <netlink/netlink.h>
16 #include <netlink/utils.h>
26 #define OBJ_CAST(ptr) ((struct nl_object *) (ptr))
45 uint32_t attrs,
char *buf,
56 extern int nl_object_get_refcnt(
struct nl_object *);
57 extern struct nl_cache * nl_object_get_cache(
struct nl_object *);
58 static inline void * nl_object_priv(
struct nl_object *obj)
char * nl_object_attr_list(struct nl_object *obj, char *buf, size_t len)
Return list of attributes present in an object.
struct nl_object * nl_object_alloc(struct nl_object_ops *ops)
Allocate a new object of kind specified by the operations handle.
void nl_object_get(struct nl_object *obj)
Acquire a reference on a object.
int nl_object_shared(struct nl_object *obj)
Check whether this object is used by multiple users.
void nl_object_unmark(struct nl_object *obj)
Remove mark from object.
void nl_object_free(struct nl_object *obj)
Free a cacheable object.
void nl_object_dump(struct nl_object *obj, struct nl_dump_params *params)
Dump this object according to the specified parameters.
void nl_object_put(struct nl_object *obj)
Release a reference from an object.
int nl_object_identical(struct nl_object *a, struct nl_object *b)
Check if the identifiers of two objects are identical.
struct nl_object * nl_object_alloc_name(const char *kind)
Allocate a new object of kind specified by the name.
int nl_object_match_filter(struct nl_object *obj, struct nl_object *filter)
Match a filter against an object.
void nl_object_mark(struct nl_object *obj)
Add mark to object.
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_is_marked(struct nl_object *obj)
Return true if object is marked.
char * nl_object_attrs2str(struct nl_object *obj, uint32_t attrs, char *buf, size_t len)
Convert bitmask of attributes to a character string.
uint32_t nl_object_diff(struct nl_object *a, struct nl_object *b)
Compute bitmask representing difference in attribute values.