bgp_nht.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* BGP Nexthop tracking
  2. * Copyright (C) 2013 Cumulus Networks, Inc.
  3. *
  4. * This file is part of GNU Zebra.
  5. *
  6. * GNU Zebra is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2, or (at your option) any
  9. * later version.
  10. *
  11. * GNU Zebra is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GNU Zebra; see the file COPYING. If not, write to the Free
  18. * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  19. * 02111-1307, USA.
  20. */
  21. #ifndef _BGP_NHT_H
  22. #define _BGP_NHT_H
  23. /**
  24. * bgp_parse_nexthop_update() - parse a nexthop update message from Zebra.
  25. */
  26. void bgp_parse_nexthop_update (void);
  27. /**
  28. * bgp_nexthop_check() - check if the bnc object is valid.
  29. * ARGUMENTS:
  30. * p - path for which the nexthop object is being looked up
  31. * connected - True if NH MUST be a connected route
  32. */
  33. int bgp_nexthop_check (struct bgp_info *, int connected);
  34. /**
  35. * bgp_ensure_nexthop() - Ensure a bgp_nexthop_cache object exists for
  36. * the given prefix or peer. If an existing one is not found,
  37. * create a new object and register with ZEBRA for nexthop
  38. * notification.
  39. * ARGUMENTS:
  40. * afi: AFI_IP or AF_IP6
  41. * struct bgp_info *: path for which the nexthop object is
  42. * being looked up
  43. * OR
  44. * struct peer The BGP peer associated with this NHT
  45. * connected - True if NH MUST be a connected route
  46. */
  47. int bgp_ensure_nexthop (struct bgp_info *, struct peer *, int connected);
  48. /**
  49. * bgp_unlink_nexthop() - Unlink the nexthop object from the path structure.
  50. * ARGUMENTS:
  51. * struct bgp_info *: path structure.
  52. */
  53. void bgp_unlink_nexthop (struct bgp_info *);
  54. /**
  55. * bgp_unlink_nexthop() - Unlink the nexthop object for the given peer.
  56. */
  57. extern void bgp_unlink_nexthop(struct bgp_info *p);
  58. void bgp_unlink_nexthop_by_peer (struct peer *);
  59. #endif /* _BGP_NHT_H */