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 (at) 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 char * rtnl_neigh_state2str(int, char *, size_t); 33 extern int rtnl_neigh_str2state(const char *); 34 35 extern char * rtnl_neigh_flags2str(int, char *, size_t); 36 extern int rtnl_neigh_str2flag(const char *); 37 38 extern int rtnl_neigh_add(struct nl_sock *, struct rtnl_neigh *, int); 39 extern int rtnl_neigh_build_add_request(struct rtnl_neigh *, int, 40 struct nl_msg **); 41 42 extern int rtnl_neigh_delete(struct nl_sock *, struct rtnl_neigh *, int); 43 extern int rtnl_neigh_build_delete_request(struct rtnl_neigh *, int, 44 struct nl_msg **); 45 46 extern void rtnl_neigh_set_state(struct rtnl_neigh *, int); 47 extern int rtnl_neigh_get_state(struct rtnl_neigh *); 48 extern void rtnl_neigh_unset_state(struct rtnl_neigh *, 49 int); 50 51 extern void rtnl_neigh_set_flags(struct rtnl_neigh *, 52 unsigned int); 53 extern void rtnl_neigh_unset_flags(struct rtnl_neigh *, 54 unsigned int); 55 extern unsigned int rtnl_neigh_get_flags(struct rtnl_neigh *); 56 57 extern void rtnl_neigh_set_ifindex(struct rtnl_neigh *, 58 int); 59 extern int rtnl_neigh_get_ifindex(struct rtnl_neigh *); 60 61 extern void rtnl_neigh_set_lladdr(struct rtnl_neigh *, 62 struct nl_addr *); 63 extern struct nl_addr * rtnl_neigh_get_lladdr(struct rtnl_neigh *); 64 65 extern int rtnl_neigh_set_dst(struct rtnl_neigh *, 66 struct nl_addr *); 67 extern struct nl_addr * rtnl_neigh_get_dst(struct rtnl_neigh *); 68 69 extern void rtnl_neigh_set_type(struct rtnl_neigh *, int); 70 extern int rtnl_neigh_get_type(struct rtnl_neigh *); 71 72 extern void rtnl_neigh_set_family(struct rtnl_neigh *, int); 73 extern int rtnl_neigh_get_family(struct rtnl_neigh *); 74 75 #ifdef __cplusplus 76 } 77 #endif 78 79 #endif 80