nexthop.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * netlink/route/nexthop.h Routing Nexthop
  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_ROUTE_NEXTHOP_H_
  12. #define NETLINK_ROUTE_NEXTHOP_H_
  13. #include <netlink/netlink.h>
  14. #include <netlink/addr.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. struct rtnl_nexthop;
  19. enum {
  20. NH_DUMP_FROM_ONELINE = -2,
  21. NH_DUMP_FROM_DETAILS = -1,
  22. NH_DUMP_FROM_ENV = 0,
  23. /* > 0 reserved for nexthop index */
  24. };
  25. extern struct rtnl_nexthop * rtnl_route_nh_alloc(void);
  26. extern struct rtnl_nexthop * rtnl_route_nh_clone(struct rtnl_nexthop *);
  27. extern void rtnl_route_nh_free(struct rtnl_nexthop *);
  28. extern int rtnl_route_nh_compare(struct rtnl_nexthop *,
  29. struct rtnl_nexthop *,
  30. uint32_t, int);
  31. extern void rtnl_route_nh_dump(struct rtnl_nexthop *,
  32. struct nl_dump_params *);
  33. extern void rtnl_route_nh_set_weight(struct rtnl_nexthop *, uint8_t);
  34. extern uint8_t rtnl_route_nh_get_weight(struct rtnl_nexthop *);
  35. extern void rtnl_route_nh_set_ifindex(struct rtnl_nexthop *, int);
  36. extern int rtnl_route_nh_get_ifindex(struct rtnl_nexthop *);
  37. extern void rtnl_route_nh_set_gateway(struct rtnl_nexthop *,
  38. struct nl_addr *);
  39. extern struct nl_addr * rtnl_route_nh_get_gateway(struct rtnl_nexthop *);
  40. extern void rtnl_route_nh_set_flags(struct rtnl_nexthop *,
  41. unsigned int);
  42. extern void rtnl_route_nh_unset_flags(struct rtnl_nexthop *,
  43. unsigned int);
  44. extern unsigned int rtnl_route_nh_get_flags(struct rtnl_nexthop *);
  45. extern void rtnl_route_nh_set_realms(struct rtnl_nexthop *,
  46. uint32_t);
  47. extern uint32_t rtnl_route_nh_get_realms(struct rtnl_nexthop *);
  48. extern char * rtnl_route_nh_flags2str(int, char *, size_t);
  49. extern int rtnl_route_nh_str2flags(const char *);
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif