00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef NETLINK_OBJECT_H_
00013 #define NETLINK_OBJECT_H_
00014
00015 #include <netlink/netlink.h>
00016 #include <netlink/utils.h>
00017
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021
00022 struct nl_cache;
00023 struct nl_object;
00024 struct nl_object_ops;
00025
00026 #define OBJ_CAST(ptr) ((struct nl_object *) (ptr))
00027
00028
00029 extern struct nl_object * nl_object_alloc(struct nl_object_ops *);
00030 extern int nl_object_alloc_name(const char *,
00031 struct nl_object **);
00032 extern void nl_object_free(struct nl_object *);
00033 extern struct nl_object * nl_object_clone(struct nl_object *obj);
00034 extern void nl_object_get(struct nl_object *);
00035 extern void nl_object_put(struct nl_object *);
00036 extern int nl_object_shared(struct nl_object *);
00037 extern void nl_object_dump(struct nl_object *,
00038 struct nl_dump_params *);
00039 extern int nl_object_identical(struct nl_object *,
00040 struct nl_object *);
00041 extern uint32_t nl_object_diff(struct nl_object *,
00042 struct nl_object *);
00043 extern int nl_object_match_filter(struct nl_object *,
00044 struct nl_object *);
00045 extern char * nl_object_attrs2str(struct nl_object *,
00046 uint32_t attrs, char *buf,
00047 size_t);
00048 extern char * nl_object_attr_list(struct nl_object *,
00049 char *, size_t);
00050
00051
00052 extern void nl_object_mark(struct nl_object *);
00053 extern void nl_object_unmark(struct nl_object *);
00054 extern int nl_object_is_marked(struct nl_object *);
00055
00056
00057 extern int nl_object_get_refcnt(struct nl_object *);
00058 extern struct nl_cache * nl_object_get_cache(struct nl_object *);
00059 static inline void * nl_object_priv(struct nl_object *obj)
00060 {
00061 return obj;
00062 }
00063
00064
00065 #ifdef __cplusplus
00066 }
00067 #endif
00068
00069 #endif