pim_assert.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. PIM for Quagga
  3. Copyright (C) 2008 Everton da Silva Marques
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; see the file COPYING; if not, write to the
  14. Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
  15. MA 02110-1301 USA
  16. $QuaggaId: $Format:%an, %ai, %h$ $
  17. */
  18. #ifndef PIM_ASSERT_H
  19. #define PIM_ASSERT_H
  20. #include <zebra.h>
  21. #include "if.h"
  22. #include "pim_neighbor.h"
  23. #include "pim_ifchannel.h"
  24. /*
  25. RFC 4601: 4.11. Timer Values
  26. Note that for historical reasons, the Assert message lacks a
  27. Holdtime field. Thus, changing the Assert Time from the default
  28. value is not recommended.
  29. */
  30. #define PIM_ASSERT_OVERRIDE_INTERVAL (3) /* seconds */
  31. #define PIM_ASSERT_TIME (180) /* seconds */
  32. #define PIM_ASSERT_METRIC_PREFERENCE_MAX (0xFFFFFFFF)
  33. #define PIM_ASSERT_ROUTE_METRIC_MAX (0xFFFFFFFF)
  34. void pim_ifassert_winner_set(struct pim_ifchannel *ch,
  35. enum pim_ifassert_state new_state,
  36. struct in_addr winner,
  37. struct pim_assert_metric winner_metric);
  38. int pim_assert_recv(struct interface *ifp,
  39. struct pim_neighbor *neigh,
  40. struct in_addr src_addr,
  41. uint8_t *buf, int buf_size);
  42. int pim_assert_metric_better(const struct pim_assert_metric *m1,
  43. const struct pim_assert_metric *m2);
  44. int pim_assert_metric_match(const struct pim_assert_metric *m1,
  45. const struct pim_assert_metric *m2);
  46. int pim_assert_build_msg(uint8_t *pim_msg, int buf_size,
  47. struct interface *ifp,
  48. struct in_addr group_addr,
  49. struct in_addr source_addr,
  50. uint32_t metric_preference,
  51. uint32_t route_metric,
  52. uint32_t rpt_bit_flag);
  53. int pim_assert_send(struct pim_ifchannel *ch);
  54. int assert_action_a1(struct pim_ifchannel *ch);
  55. void assert_action_a4(struct pim_ifchannel *ch);
  56. void assert_action_a5(struct pim_ifchannel *ch);
  57. #endif /* PIM_ASSERT_H */