zebra_rnh.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Zebra next hop tracking header
  3. * Copyright (C) 2013 Cumulus Networks, Inc.
  4. *
  5. * This file is part of GNU Zebra.
  6. *
  7. * GNU Zebra is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2, or (at your option) any
  10. * later version.
  11. *
  12. * GNU Zebra is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with GNU Zebra; see the file COPYING. If not, write to the Free
  19. * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  20. * 02111-1307, USA.
  21. */
  22. #ifndef _ZEBRA_RNH_H
  23. #define _ZEBRA_RNH_H
  24. #include "prefix.h"
  25. #include "vty.h"
  26. /* Nexthop structure. */
  27. struct rnh
  28. {
  29. u_char flags;
  30. #define ZEBRA_NHT_CONNECTED 0x1
  31. struct rib *state;
  32. struct list *client_list;
  33. struct route_node *node;
  34. };
  35. extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid);
  36. extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid);
  37. extern void zebra_delete_rnh(struct rnh *rnh);
  38. extern void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client, vrf_id_t vrf_id_t);
  39. extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client);
  40. extern int zebra_evaluate_rnh_table(vrf_id_t vrfid, int family);
  41. extern int zebra_dispatch_rnh_table(vrf_id_t vrfid, int family, struct zserv *cl);
  42. extern void zebra_print_rnh_table(vrf_id_t vrfid, int family, struct vty *vty);
  43. extern char *rnh_str(struct rnh *rnh, char *buf, int size);
  44. extern int zebra_cleanup_rnh_client(vrf_id_t vrf, int family, struct zserv *client);
  45. #endif /*_ZEBRA_RNH_H */