oops
[libnl.git] / include / netlink / object.h
1 /*
2  * netlink/object.c     Generic Cacheable Object
3  *
4  *      This library is free software; you can redistribute it and/or
5  *      modify it under the terms of the GNU Lesser General Public
6  *      License as published by the Free Software Foundation version 2.1
7  *      of the License.
8  *
9  * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10  */
11
12 #ifndef NETLINK_OBJECT_H_
13 #define NETLINK_OBJECT_H_
14
15 #include <netlink/netlink.h>
16 #include <netlink/utils.h>
17
18 struct nl_cache;
19 struct nl_object;
20 struct nl_cache_ops;
21
22 /* General */
23 extern struct nl_object *       nl_object_alloc(size_t size);
24 extern struct nl_object *       nl_object_alloc_from_ops(struct nl_cache_ops *);
25 extern struct nl_object *       nl_object_alloc_name(const char *);
26 extern void                     nl_object_free(struct nl_object *);
27 extern struct nl_object *       nl_object_clone(struct nl_object *obj);
28 extern void                     nl_object_get(struct nl_object *);
29 extern void                     nl_object_put(struct nl_object *);
30 extern int                      nl_object_shared(struct nl_object *);
31 extern void                     nl_object_dump(struct nl_object *,
32                                                struct nl_dump_params *);
33 extern int                      nl_object_match(struct nl_object *,
34                                                 struct nl_object *);
35
36 /* Access Functions */
37 extern int                      nl_object_get_refcnt(struct nl_object *);
38 extern struct nl_cache_ops *    nl_object_get_ops(struct nl_object *);
39 extern struct nl_cache *        nl_object_get_cache(struct nl_object *);
40 extern inline void *            nl_object_priv(struct nl_object *);
41
42 #endif