libnl 1.1

include/netlink/route/neighbour.h

00001 /*
00002  * netlink/route/neighbour.h    Neighbours
00003  *
00004  *      This library is free software; you can redistribute it and/or
00005  *      modify it under the terms of the GNU Lesser General Public
00006  *      License as published by the Free Software Foundation version 2.1
00007  *      of the License.
00008  *
00009  * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
00010  */
00011 
00012 #ifndef NETLINK_NEIGHBOUR_H_
00013 #define NETLINK_NEIGHBOUR_H_
00014 
00015 #include <netlink/netlink.h>
00016 #include <netlink/cache.h>
00017 #include <netlink/addr.h>
00018 
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022 
00023 struct rtnl_neigh;
00024 
00025 /* neighbour object allocation/freeage */
00026 extern struct rtnl_neigh *      rtnl_neigh_alloc(void);
00027 extern void                     rtnl_neigh_put(struct rtnl_neigh *);
00028 
00029 /* neighbour cache management */
00030 extern struct nl_cache *        rtnl_neigh_alloc_cache(struct nl_handle *);
00031 extern struct rtnl_neigh *      rtnl_neigh_get(struct nl_cache *, int,
00032                                                struct nl_addr *);
00033 
00034 /* Neigbour state translations */
00035 extern char *                   rtnl_neigh_state2str(int, char *, size_t);
00036 extern int                      rtnl_neigh_str2state(const char *);
00037 
00038 /* Neighbour flags translations */
00039 extern char *                   rtnl_neigh_flags2str(int, char *, size_t);
00040 extern int                      rtnl_neigh_str2flag(const char *);
00041 
00042 /* Neighbour Addition */
00043 extern int                      rtnl_neigh_add(struct nl_handle *,
00044                                                struct rtnl_neigh *, int);
00045 extern struct nl_msg *          rtnl_neigh_build_add_request(struct rtnl_neigh *, int);
00046 
00047 /* Neighbour Modification */
00048 extern int                      rtnl_neigh_change(struct nl_handle *,
00049                                                   struct rtnl_neigh *, int);
00050 extern struct nl_msg *          rtnl_neigh_build_change_request(struct rtnl_neigh *, int);
00051 
00052 /* Neighbour Deletion */
00053 extern int                      rtnl_neigh_delete(struct nl_handle *,
00054                                                   struct rtnl_neigh *, int);
00055 extern struct nl_msg *          rtnl_neigh_build_delete_request(struct rtnl_neigh *, int);
00056 
00057 /* Access functions */
00058 extern void                     rtnl_neigh_set_state(struct rtnl_neigh *, int);
00059 extern int                      rtnl_neigh_get_state(struct rtnl_neigh *);
00060 extern void                     rtnl_neigh_unset_state(struct rtnl_neigh *,
00061                                                        int);
00062 
00063 extern void                     rtnl_neigh_set_flags(struct rtnl_neigh *,
00064                                                      unsigned int);
00065 extern void                     rtnl_neigh_unset_flags(struct rtnl_neigh *,
00066                                                        unsigned int);
00067 extern unsigned int             rtnl_neigh_get_flags(struct rtnl_neigh *);
00068 
00069 extern void                     rtnl_neigh_set_ifindex(struct rtnl_neigh *,
00070                                                        int);
00071 extern int                      rtnl_neigh_get_ifindex(struct rtnl_neigh *);
00072 
00073 extern void                     rtnl_neigh_set_lladdr(struct rtnl_neigh *,
00074                                                       struct nl_addr *);
00075 extern struct nl_addr *         rtnl_neigh_get_lladdr(struct rtnl_neigh *);
00076 
00077 extern int                      rtnl_neigh_set_dst(struct rtnl_neigh *,
00078                                                    struct nl_addr *);
00079 extern struct nl_addr *         rtnl_neigh_get_dst(struct rtnl_neigh *);
00080 
00081 extern void                     rtnl_neigh_set_type(struct rtnl_neigh *, int);
00082 extern int                      rtnl_neigh_get_type(struct rtnl_neigh *);
00083 
00084 extern void                     rtnl_neigh_set_family(struct rtnl_neigh *, int);
00085 extern int                      rtnl_neigh_get_family(struct rtnl_neigh *);
00086 
00087 #ifdef __cplusplus
00088 }
00089 #endif
00090 
00091 #endif