bgp_nht.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. extern void bgp_parse_nexthop_update(void);
  27. /**
  28. * bgp_find_nexthop() - lookup the nexthop cache table for the bnc object
  29. * ARGUMENTS:
  30. * p - path for which the nexthop object is being looked up
  31. * c - output variable that stores whether the nexthop object has changed
  32. * since last time.
  33. * m - output variable that stores whether the nexthop metric has changed
  34. * since last time.
  35. */
  36. extern int bgp_find_nexthop(struct bgp_info *p, int *c, int *m);
  37. /**
  38. * bgp_find_or_add_nexthop() - lookup the nexthop cache table for the bnc
  39. * object. If not found, create a new object and register with ZEBRA for
  40. * nexthop notification.
  41. * ARGUMENTS:
  42. * a - afi: AFI_IP or AF_IP6
  43. * p - path for which the nexthop object is being looked up
  44. * c - output variable that stores whether the nexthop object has changed
  45. * since last time.
  46. * m - output variable that stores whether the nexthop metric has changed
  47. * since last time.
  48. */
  49. extern int bgp_find_or_add_nexthop(afi_t a, struct bgp_info *p, int *c, int *m);
  50. /**
  51. * bgp_unlink_nexthop() - Unlink the nexthop object from the path structure.
  52. * ARGUMENTS:
  53. * p - path structure.
  54. */
  55. extern void bgp_unlink_nexthop(struct bgp_info *p);
  56. #endif /* _BGP_NHT_H */