neighbour.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. #ifndef NETLINK_NEIGHBOUR_H_
  12. #define NETLINK_NEIGHBOUR_H_
  13. #include <netlink/netlink.h>
  14. #include <netlink/cache.h>
  15. #include <netlink/addr.h>
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. struct rtnl_neigh;
  20. extern struct rtnl_neigh *rtnl_neigh_alloc(void);
  21. extern void rtnl_neigh_put(struct rtnl_neigh *);
  22. extern int rtnl_neigh_alloc_cache(struct nl_sock *, struct nl_cache **);
  23. extern int rtnl_neigh_alloc_cache_flags(struct nl_sock *,
  24. struct nl_cache **,
  25. unsigned int);
  26. extern struct rtnl_neigh *rtnl_neigh_get(struct nl_cache *, int,
  27. struct nl_addr *);
  28. extern struct rtnl_neigh *rtnl_neigh_get_by_vlan(struct nl_cache *, int,
  29. struct nl_addr *, int);
  30. extern int rtnl_neigh_parse(struct nlmsghdr *, struct rtnl_neigh **);
  31. extern char * rtnl_neigh_state2str(int, char *, size_t);
  32. extern int rtnl_neigh_str2state(const char *);
  33. extern char * rtnl_neigh_flags2str(int, char *, size_t);
  34. extern int rtnl_neigh_str2flag(const char *);
  35. extern int rtnl_neigh_add(struct nl_sock *, struct rtnl_neigh *, int);
  36. extern int rtnl_neigh_build_add_request(struct rtnl_neigh *, int,
  37. struct nl_msg **);
  38. extern int rtnl_neigh_delete(struct nl_sock *, struct rtnl_neigh *, int);
  39. extern int rtnl_neigh_build_delete_request(struct rtnl_neigh *, int,
  40. struct nl_msg **);
  41. extern void rtnl_neigh_set_state(struct rtnl_neigh *, int);
  42. extern int rtnl_neigh_get_state(struct rtnl_neigh *);
  43. extern void rtnl_neigh_unset_state(struct rtnl_neigh *,
  44. int);
  45. extern void rtnl_neigh_set_flags(struct rtnl_neigh *,
  46. unsigned int);
  47. extern void rtnl_neigh_unset_flags(struct rtnl_neigh *,
  48. unsigned int);
  49. extern unsigned int rtnl_neigh_get_flags(struct rtnl_neigh *);
  50. extern void rtnl_neigh_set_ifindex(struct rtnl_neigh *,
  51. int);
  52. extern int rtnl_neigh_get_ifindex(struct rtnl_neigh *);
  53. extern void rtnl_neigh_set_lladdr(struct rtnl_neigh *,
  54. struct nl_addr *);
  55. extern struct nl_addr * rtnl_neigh_get_lladdr(struct rtnl_neigh *);
  56. extern int rtnl_neigh_set_dst(struct rtnl_neigh *,
  57. struct nl_addr *);
  58. extern struct nl_addr * rtnl_neigh_get_dst(struct rtnl_neigh *);
  59. extern void rtnl_neigh_set_type(struct rtnl_neigh *, int);
  60. extern int rtnl_neigh_get_type(struct rtnl_neigh *);
  61. extern void rtnl_neigh_set_family(struct rtnl_neigh *, int);
  62. extern int rtnl_neigh_get_family(struct rtnl_neigh *);
  63. extern void rtnl_neigh_set_vlan(struct rtnl_neigh *, int);
  64. extern int rtnl_neigh_get_vlan(struct rtnl_neigh *);
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif