ospf6d.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /*
  2. * Copyright (C) 1999 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 OSPF6D_H
  22. #define OSPF6D_H
  23. #include <zebra.h>
  24. #include "linklist.h"
  25. #ifndef HEADER_DEPENDENCY
  26. /* Include other stuffs */
  27. #include "version.h"
  28. #include "log.h"
  29. #include "getopt.h"
  30. #include "thread.h"
  31. #include "command.h"
  32. #include "memory.h"
  33. #include "sockunion.h"
  34. #include "if.h"
  35. #include "prefix.h"
  36. #include "stream.h"
  37. #include "thread.h"
  38. #include "filter.h"
  39. #include "zclient.h"
  40. #include "table.h"
  41. #include "plist.h"
  42. /* OSPF stuffs */
  43. #include "ospf6_hook.h"
  44. #include "ospf6_types.h"
  45. #include "ospf6_prefix.h"
  46. #include "ospf6_lsa.h"
  47. #include "ospf6_lsdb.h"
  48. #include "ospf6_message.h"
  49. #include "ospf6_proto.h"
  50. #include "ospf6_spf.h"
  51. #include "ospf6_top.h"
  52. #include "ospf6_area.h"
  53. #include "ospf6_interface.h"
  54. #include "ospf6_neighbor.h"
  55. #include "ospf6_ism.h"
  56. #include "ospf6_nsm.h"
  57. #include "ospf6_route.h"
  58. #include "ospf6_dbex.h"
  59. #include "ospf6_network.h"
  60. #include "ospf6_zebra.h"
  61. #include "ospf6_dump.h"
  62. #include "ospf6_routemap.h"
  63. #include "ospf6_asbr.h"
  64. #include "ospf6_abr.h"
  65. #include "ospf6_intra.h"
  66. #endif /*HEADER_DEPENDENCY*/
  67. #define HASHVAL 64
  68. #define MAXIOVLIST 1024
  69. #define OSPF6_DAEMON_VERSION "0.9.6p"
  70. #define AF_LINKSTATE 0xff
  71. /* global variables */
  72. extern char *progname;
  73. extern int errno;
  74. extern int daemon_mode;
  75. extern struct thread_master *master;
  76. extern list iflist;
  77. extern list nexthoplist;
  78. extern struct sockaddr_in6 allspfrouters6;
  79. extern struct sockaddr_in6 alldrouters6;
  80. extern int ospf6_sock;
  81. extern char *recent_reason;
  82. /* Default configuration file name for ospfd. */
  83. #define OSPF6_DEFAULT_CONFIG "ospf6d.conf"
  84. /* Default port values. */
  85. #define OSPF6_VTY_PORT 2606
  86. #ifdef INRIA_IPV6
  87. #ifndef IPV6_PKTINFO
  88. #define IPV6_PKTINFO IPV6_RECVPKTINFO
  89. #endif /* IPV6_PKTINFO */
  90. #endif /* INRIA_IPV6 */
  91. /* Historycal for KAME. */
  92. #ifndef IPV6_JOIN_GROUP
  93. #ifdef IPV6_ADD_MEMBERSHIP
  94. #define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
  95. #endif /* IPV6_ADD_MEMBERSHIP. */
  96. #ifdef IPV6_JOIN_MEMBERSHIP
  97. #define IPV6_JOIN_GROUP IPV6_JOIN_MEMBERSHIP
  98. #endif /* IPV6_JOIN_MEMBERSHIP. */
  99. #endif /* ! IPV6_JOIN_GROUP*/
  100. #ifndef IPV6_LEAVE_GROUP
  101. #ifdef IPV6_DROP_MEMBERSHIP
  102. #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
  103. #endif /* IPV6_DROP_MEMBERSHIP */
  104. #endif /* ! IPV6_LEAVE_GROUP */
  105. #define OSPF6_CMD_CHECK_RUNNING() \
  106. if (ospf6 == NULL) \
  107. { \
  108. vty_out (vty, "OSPFv3 is not running%s", VTY_NEWLINE); \
  109. return CMD_SUCCESS; \
  110. }
  111. #define OSPF6_LEVEL_NONE 0
  112. #define OSPF6_LEVEL_NEIGHBOR 1
  113. #define OSPF6_LEVEL_INTERFACE 2
  114. #define OSPF6_LEVEL_AREA 3
  115. #define OSPF6_LEVEL_TOP 4
  116. #define OSPF6_LEVEL_MAX 5
  117. #define OSPF6_PASSIVE_STR \
  118. "Suppress routing updates on an interface\n"
  119. #define OSPF6_PREFIX_LIST_STR \
  120. "Advertise I/F Address only match entries of prefix-list\n"
  121. #define OSPF6_AREA_STR "Area information\n"
  122. #define OSPF6_AREA_ID_STR "Area ID (as an IPv4 notation)\n"
  123. #define OSPF6_SPF_STR "Shortest Path First tree information\n"
  124. #define OSPF6_ROUTER_ID_STR "Specify Router-ID\n"
  125. #define OSPF6_LS_ID_STR "Specify Link State ID\n"
  126. /* Function Prototypes */
  127. void
  128. ospf6_timeval_sub (const struct timeval *t1, const struct timeval *t2,
  129. struct timeval *result);
  130. void
  131. ospf6_timeval_div (const struct timeval *t1, u_int by,
  132. struct timeval *result);
  133. void
  134. ospf6_timeval_sub_equal (const struct timeval *t, struct timeval *result);
  135. void
  136. ospf6_timeval_decode (const struct timeval *t, long *dayp, long *hourp,
  137. long *minp, long *secp, long *msecp, long *usecp);
  138. void
  139. ospf6_timeval_string (struct timeval *tv, char *buf, int size);
  140. void
  141. ospf6_timeval_string_summary (struct timeval *tv, char *buf, int size);
  142. void
  143. ospf6_count_state (void *arg, int val, void *obj);
  144. void ospf6_init ();
  145. void ospf6_terminate ();
  146. void ospf6_maxage_remover ();
  147. void *ospf6_lsa_get_scope (u_int16_t type, struct ospf6_interface *o6i);
  148. #endif /* OSPF6D_H */