This commit was generated by cvs2svn to compensate for changes in r786,
[libnl.git] / include / netlink / route / neighbour.h
1 /*
2  * netlink/route/neighbour.h    Neighbours
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_NEIGHBOUR_H_
13 #define NETLINK_NEIGHBOUR_H_
14
15 #include <netlink/netlink.h>
16 #include <netlink/cache.h>
17 #include <netlink/addr.h>
18
19 struct rtnl_neigh;
20
21 /* neighbour object allocation/freeage */
22 extern struct rtnl_neigh *      rtnl_neigh_alloc(void);
23 extern void                     rtnl_neigh_put(struct rtnl_neigh *);
24 extern void                     rtnl_neigh_free(struct rtnl_neigh *);
25
26 /* neighbour cache management */
27 extern struct nl_cache *        rtnl_neigh_alloc_cache(struct nl_handle *);
28 extern struct rtnl_neigh *      rtnl_neigh_get(struct nl_cache *, int,
29                                                struct nl_addr *);
30
31 /* Neigbour state translations */
32 extern char *                   rtnl_neigh_state2str(int, char *, size_t);
33 extern int                      rtnl_neigh_str2state(const char *);
34
35 /* Neighbour flags translations */
36 extern char *                   rtnl_neigh_flags2str(int, char *, size_t);
37 extern int                      rtnl_neigh_str2flag(const char *);
38
39 /* Neighbour Addition */
40 extern int                      rtnl_neigh_add(struct nl_handle *,
41                                                struct rtnl_neigh *, int);
42 extern struct nl_msg *          rtnl_neigh_build_add_request(struct rtnl_neigh *, int);
43
44 /* Neighbour Modification */
45 extern int                      rtnl_neigh_change(struct nl_handle *,
46                                                   struct rtnl_neigh *, int);
47 extern struct nl_msg *          rtnl_neigh_build_change_request(struct rtnl_neigh *, int);
48
49 /* Neighbour Deletion */
50 extern int                      rtnl_neigh_delete(struct nl_handle *,
51                                                   struct rtnl_neigh *, int);
52 extern struct nl_msg *          rtnl_neigh_build_delete_request(struct rtnl_neigh *, int);
53
54 /* Access functions */
55 extern void                     rtnl_neigh_set_state(struct rtnl_neigh *, int);
56 extern int                      rtnl_neigh_get_state(struct rtnl_neigh *);
57 extern void                     rtnl_neigh_unset_state(struct rtnl_neigh *,
58                                                        int);
59
60 extern void                     rtnl_neigh_set_flags(struct rtnl_neigh *,
61                                                      unsigned int);
62 extern void                     rtnl_neigh_unset_flags(struct rtnl_neigh *,
63                                                        unsigned int);
64 extern unsigned int             rtnl_neigh_get_flags(struct rtnl_neigh *);
65
66 extern void                     rtnl_neigh_set_ifindex(struct rtnl_neigh *,
67                                                        int);
68 extern int                      rtnl_neigh_get_ifindex(struct rtnl_neigh *);
69
70 extern void                     rtnl_neigh_set_lladdr(struct rtnl_neigh *,
71                                                       struct nl_addr *);
72 extern struct nl_addr *         rtnl_neigh_get_lladdr(struct rtnl_neigh *);
73
74 extern int                      rtnl_neigh_set_dst(struct rtnl_neigh *,
75                                                    struct nl_addr *);
76 extern struct nl_addr *         rtnl_neigh_get_dst(struct rtnl_neigh *);
77
78 extern void                     rtnl_neigh_set_type(struct rtnl_neigh *, int);
79 extern int                      rtnl_neigh_get_type(struct rtnl_neigh *);
80
81 extern void                     rtnl_neigh_set_family(struct rtnl_neigh *, int);
82 extern int                      rtnl_neigh_get_family(struct rtnl_neigh *);
83
84 #endif