ospf6_interface.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. * Copyright (C) 2003 Yasuhiro Ohara
  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
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef OSPF6_INTERFACE_H
  22. #define OSPF6_INTERFACE_H
  23. #include "if.h"
  24. /* Debug option */
  25. extern unsigned char conf_debug_ospf6_interface;
  26. #define OSPF6_DEBUG_INTERFACE_ON() \
  27. (conf_debug_ospf6_interface = 1)
  28. #define OSPF6_DEBUG_INTERFACE_OFF() \
  29. (conf_debug_ospf6_interface = 0)
  30. #define IS_OSPF6_DEBUG_INTERFACE \
  31. (conf_debug_ospf6_interface)
  32. /* Interface structure */
  33. struct ospf6_interface
  34. {
  35. /* IF info from zebra */
  36. struct interface *interface;
  37. /* back pointer */
  38. struct ospf6_area *area;
  39. /* list of ospf6 neighbor */
  40. struct list *neighbor_list;
  41. /* linklocal address of this I/F */
  42. struct in6_addr *linklocal_addr;
  43. /* Interface ID; use interface->ifindex */
  44. /* ospf6 instance id */
  45. u_char instance_id;
  46. /* I/F transmission delay */
  47. u_int32_t transdelay;
  48. /* Router Priority */
  49. u_char priority;
  50. /* Time Interval */
  51. u_int16_t hello_interval;
  52. u_int16_t dead_interval;
  53. u_int32_t rxmt_interval;
  54. /* Cost */
  55. u_int32_t cost;
  56. /* I/F MTU */
  57. u_int32_t ifmtu;
  58. /* Interface State */
  59. u_char state;
  60. /* OSPF6 Interface flag */
  61. char flag;
  62. /* MTU mismatch check */
  63. u_char mtu_ignore;
  64. /* Decision of DR Election */
  65. u_int32_t drouter;
  66. u_int32_t bdrouter;
  67. u_int32_t prev_drouter;
  68. u_int32_t prev_bdrouter;
  69. /* Linklocal LSA Database: includes Link-LSA */
  70. struct ospf6_lsdb *lsdb;
  71. struct ospf6_lsdb *lsdb_self;
  72. struct ospf6_lsdb *lsupdate_list;
  73. struct ospf6_lsdb *lsack_list;
  74. /* Ongoing Tasks */
  75. struct thread *thread_send_hello;
  76. struct thread *thread_send_lsupdate;
  77. struct thread *thread_send_lsack;
  78. struct thread *thread_network_lsa;
  79. struct thread *thread_link_lsa;
  80. struct thread *thread_intra_prefix_lsa;
  81. struct ospf6_route_table *route_connected;
  82. /* prefix-list name to filter connected prefix */
  83. char *plist_name;
  84. };
  85. /* interface state */
  86. #define OSPF6_INTERFACE_NONE 0
  87. #define OSPF6_INTERFACE_DOWN 1
  88. #define OSPF6_INTERFACE_LOOPBACK 2
  89. #define OSPF6_INTERFACE_WAITING 3
  90. #define OSPF6_INTERFACE_POINTTOPOINT 4
  91. #define OSPF6_INTERFACE_DROTHER 5
  92. #define OSPF6_INTERFACE_BDR 6
  93. #define OSPF6_INTERFACE_DR 7
  94. #define OSPF6_INTERFACE_MAX 8
  95. extern const char *ospf6_interface_state_str[];
  96. /* flags */
  97. #define OSPF6_INTERFACE_DISABLE 0x01
  98. #define OSPF6_INTERFACE_PASSIVE 0x02
  99. /* Function Prototypes */
  100. extern struct ospf6_interface *ospf6_interface_lookup_by_ifindex (int);
  101. extern struct ospf6_interface *ospf6_interface_create (struct interface *);
  102. extern void ospf6_interface_delete (struct ospf6_interface *);
  103. extern void ospf6_interface_enable (struct ospf6_interface *);
  104. extern void ospf6_interface_disable (struct ospf6_interface *);
  105. extern void ospf6_interface_if_add (struct interface *);
  106. extern void ospf6_interface_if_del (struct interface *);
  107. extern void ospf6_interface_state_update (struct interface *);
  108. extern void ospf6_interface_connected_route_update (struct interface *);
  109. /* interface event */
  110. extern int interface_up (struct thread *);
  111. extern int interface_down (struct thread *);
  112. extern int wait_timer (struct thread *);
  113. extern int backup_seen (struct thread *);
  114. extern int neighbor_change (struct thread *);
  115. extern void ospf6_interface_init (void);
  116. extern int config_write_ospf6_debug_interface (struct vty *vty);
  117. extern void install_element_ospf6_debug_interface (void);
  118. #endif /* OSPF6_INTERFACE_H */