pim_neighbor.h 2.5 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_NEIGHBOR_H
  19. #define PIM_NEIGHBOR_H
  20. #include <zebra.h>
  21. #include "if.h"
  22. #include "linklist.h"
  23. #include "pim_tlv.h"
  24. struct pim_neighbor {
  25. int64_t creation; /* timestamp of creation */
  26. struct in_addr source_addr;
  27. pim_hello_options hello_options;
  28. uint16_t holdtime;
  29. uint16_t propagation_delay_msec;
  30. uint16_t override_interval_msec;
  31. uint32_t dr_priority;
  32. uint32_t generation_id;
  33. struct list *prefix_list; /* list of struct prefix */
  34. struct thread *t_expire_timer;
  35. struct interface *interface;
  36. };
  37. void pim_neighbor_timer_reset(struct pim_neighbor *neigh, uint16_t holdtime);
  38. void pim_neighbor_free(struct pim_neighbor *neigh);
  39. struct pim_neighbor *pim_neighbor_find(struct interface *ifp,
  40. struct in_addr source_addr);
  41. struct pim_neighbor *pim_neighbor_add(struct interface *ifp,
  42. struct in_addr source_addr,
  43. pim_hello_options hello_options,
  44. uint16_t holdtime,
  45. uint16_t propagation_delay,
  46. uint16_t override_interval,
  47. uint32_t dr_priority,
  48. uint32_t generation_id,
  49. struct list *addr_list);
  50. void pim_neighbor_delete(struct interface *ifp,
  51. struct pim_neighbor *neigh,
  52. const char *delete_message);
  53. void pim_neighbor_delete_all(struct interface *ifp,
  54. const char *delete_message);
  55. void pim_neighbor_update(struct pim_neighbor *neigh,
  56. pim_hello_options hello_options,
  57. uint16_t holdtime,
  58. uint32_t dr_priority,
  59. struct list *addr_list);
  60. struct prefix *pim_neighbor_find_secondary(struct pim_neighbor *neigh,
  61. struct in_addr addr);
  62. int pim_if_dr_election(struct interface *ifp);
  63. #endif /* PIM_NEIGHBOR_H */