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-2008 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 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 struct rtnl_neigh; 24 25 extern struct rtnl_neigh *rtnl_neigh_alloc(void); 26 extern void rtnl_neigh_put(struct rtnl_neigh *); 27 28 extern int rtnl_neigh_alloc_cache(struct nl_sock *, struct nl_cache **); 29 extern struct rtnl_neigh *rtnl_neigh_get(struct nl_cache *, int, 30 struct nl_addr *); 31 32 extern int rtnl_neigh_parse(struct nlmsghdr *, struct rtnl_neigh **); 33 34 extern char * rtnl_neigh_state2str(int, char *, size_t); 35 extern int rtnl_neigh_str2state(const char *); 36 37 extern char * rtnl_neigh_flags2str(int, char *, size_t); 38 extern int rtnl_neigh_str2flag(const char *); 39 40 extern int rtnl_neigh_add(struct nl_sock *, struct rtnl_neigh *, int); 41 extern int rtnl_neigh_build_add_request(struct rtnl_neigh *, int, 42 struct nl_msg **); 43 44 extern int rtnl_neigh_delete(struct nl_sock *, struct rtnl_neigh *, int); 45 extern int rtnl_neigh_build_delete_request(struct rtnl_neigh *, int, 46 struct nl_msg **); 47 48 extern void rtnl_neigh_set_state(struct rtnl_neigh *, int); 49 extern int rtnl_neigh_get_state(struct rtnl_neigh *); 50 extern void rtnl_neigh_unset_state(struct rtnl_neigh *, 51 int); 52 53 extern void rtnl_neigh_set_flags(struct rtnl_neigh *, 54 unsigned int); 55 extern void rtnl_neigh_unset_flags(struct rtnl_neigh *, 56 unsigned int); 57 extern unsigned int rtnl_neigh_get_flags(struct rtnl_neigh *); 58 59 extern void rtnl_neigh_set_ifindex(struct rtnl_neigh *, 60 int); 61 extern int rtnl_neigh_get_ifindex(struct rtnl_neigh *); 62 63 extern void rtnl_neigh_set_lladdr(struct rtnl_neigh *, 64 struct nl_addr *); 65 extern struct nl_addr * rtnl_neigh_get_lladdr(struct rtnl_neigh *); 66 67 extern int rtnl_neigh_set_dst(struct rtnl_neigh *, 68 struct nl_addr *); 69 extern struct nl_addr * rtnl_neigh_get_dst(struct rtnl_neigh *); 70 71 extern void rtnl_neigh_set_type(struct rtnl_neigh *, int); 72 extern int rtnl_neigh_get_type(struct rtnl_neigh *); 73 74 extern void rtnl_neigh_set_family(struct rtnl_neigh *, int); 75 extern int rtnl_neigh_get_family(struct rtnl_neigh *); 76 77 #ifdef __cplusplus 78 } 79 #endif 80 81 #endif 82