/build/buildd/libnl-1.0~pre6/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 struct rtnl_neigh;
00020 
00021 /* neighbour object allocation/freeage */
00022 extern struct rtnl_neigh *      rtnl_neigh_alloc(void);
00023 extern void                     rtnl_neigh_put(struct rtnl_neigh *);
00024 extern void                     rtnl_neigh_free(struct rtnl_neigh *);
00025 
00026 /* neighbour cache management */
00027 extern struct nl_cache *        rtnl_neigh_alloc_cache(struct nl_handle *);
00028 extern struct rtnl_neigh *      rtnl_neigh_get(struct nl_cache *, int,
00029                                                struct nl_addr *);
00030 
00031 /* Neigbour state translations */
00032 extern char *                   rtnl_neigh_state2str(int, char *, size_t);
00033 extern int                      rtnl_neigh_str2state(const char *);
00034 
00035 /* Neighbour flags translations */
00036 extern char *                   rtnl_neigh_flags2str(int, char *, size_t);
00037 extern int                      rtnl_neigh_str2flag(const char *);
00038 
00039 /* Neighbour Addition */
00040 extern int                      rtnl_neigh_add(struct nl_handle *,
00041                                                struct rtnl_neigh *, int);
00042 extern struct nl_msg *          rtnl_neigh_build_add_request(struct rtnl_neigh *, int);
00043 
00044 /* Neighbour Modification */
00045 extern int                      rtnl_neigh_change(struct nl_handle *,
00046                                                   struct rtnl_neigh *, int);
00047 extern struct nl_msg *          rtnl_neigh_build_change_request(struct rtnl_neigh *, int);
00048 
00049 /* Neighbour Deletion */
00050 extern int                      rtnl_neigh_delete(struct nl_handle *,
00051                                                   struct rtnl_neigh *, int);
00052 extern struct nl_msg *          rtnl_neigh_build_delete_request(struct rtnl_neigh *, int);
00053 
00054 /* Access functions */
00055 extern void                     rtnl_neigh_set_state(struct rtnl_neigh *, int);
00056 extern int                      rtnl_neigh_get_state(struct rtnl_neigh *);
00057 extern void                     rtnl_neigh_unset_state(struct rtnl_neigh *,
00058                                                        int);
00059 
00060 extern void                     rtnl_neigh_set_flags(struct rtnl_neigh *,
00061                                                      unsigned int);
00062 extern void                     rtnl_neigh_unset_flags(struct rtnl_neigh *,
00063                                                        unsigned int);
00064 extern unsigned int             rtnl_neigh_get_flags(struct rtnl_neigh *);
00065 
00066 extern void                     rtnl_neigh_set_ifindex(struct rtnl_neigh *,
00067                                                        int);
00068 extern int                      rtnl_neigh_get_ifindex(struct rtnl_neigh *);
00069 
00070 extern void                     rtnl_neigh_set_lladdr(struct rtnl_neigh *,
00071                                                       struct nl_addr *);
00072 extern struct nl_addr *         rtnl_neigh_get_lladdr(struct rtnl_neigh *);
00073 
00074 extern int                      rtnl_neigh_set_dst(struct rtnl_neigh *,
00075                                                    struct nl_addr *);
00076 extern struct nl_addr *         rtnl_neigh_get_dst(struct rtnl_neigh *);
00077 
00078 extern void                     rtnl_neigh_set_type(struct rtnl_neigh *, int);
00079 extern int                      rtnl_neigh_get_type(struct rtnl_neigh *);
00080 
00081 extern void                     rtnl_neigh_set_family(struct rtnl_neigh *, int);
00082 extern int                      rtnl_neigh_get_family(struct rtnl_neigh *);
00083 
00084 #endif

Generated on Fri Apr 27 14:14:07 2007 for libnl by  doxygen 1.5.1