ospf6_area.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 OSPF_AREA_H
  22. #define OSPF_AREA_H
  23. #include "ospf6_top.h"
  24. struct ospf6_area
  25. {
  26. /* Reference to Top data structure */
  27. struct ospf6 *ospf6;
  28. /* Area-ID */
  29. u_int32_t area_id;
  30. /* Area-ID string */
  31. char name[16];
  32. /* flag */
  33. u_char flag;
  34. /* OSPF Option */
  35. u_char options[3];
  36. /* Summary routes to be originated (includes Configured Address Ranges) */
  37. struct ospf6_route_table *range_table;
  38. struct ospf6_route_table *summary_prefix;
  39. struct ospf6_route_table *summary_router;
  40. /* OSPF interface list */
  41. struct list *if_list;
  42. struct ospf6_lsdb *lsdb;
  43. struct ospf6_lsdb *lsdb_self;
  44. struct ospf6_route_table *spf_table;
  45. struct ospf6_route_table *route_table;
  46. struct thread *thread_spf_calculation;
  47. struct thread *thread_route_calculation;
  48. struct thread *thread_router_lsa;
  49. struct thread *thread_intra_prefix_lsa;
  50. u_int32_t router_lsa_size_limit;
  51. /* Area announce list */
  52. struct
  53. {
  54. char *name;
  55. struct access_list *list;
  56. } _export;
  57. #define EXPORT_NAME(A) (A)->_export.name
  58. #define EXPORT_LIST(A) (A)->_export.list
  59. /* Area acceptance list */
  60. struct
  61. {
  62. char *name;
  63. struct access_list *list;
  64. } import;
  65. #define IMPORT_NAME(A) (A)->import.name
  66. #define IMPORT_LIST(A) (A)->import.list
  67. /* Type 3 LSA Area prefix-list */
  68. struct
  69. {
  70. char *name;
  71. struct prefix_list *list;
  72. } plist_in;
  73. #define PREFIX_NAME_IN(A) (A)->plist_in.name
  74. #define PREFIX_LIST_IN(A) (A)->plist_in.list
  75. struct
  76. {
  77. char *name;
  78. struct prefix_list *list;
  79. } plist_out;
  80. #define PREFIX_NAME_OUT(A) (A)->plist_out.name
  81. #define PREFIX_LIST_OUT(A) (A)->plist_out.list
  82. };
  83. #define OSPF6_AREA_ENABLE 0x01
  84. #define OSPF6_AREA_ACTIVE 0x02
  85. #define OSPF6_AREA_TRANSIT 0x04 /* TransitCapability */
  86. #define OSPF6_AREA_STUB 0x08
  87. #define BACKBONE_AREA_ID (htonl (0))
  88. #define IS_AREA_BACKBONE(oa) ((oa)->area_id == BACKBONE_AREA_ID)
  89. #define IS_AREA_ENABLED(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ENABLE))
  90. #define IS_AREA_ACTIVE(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ACTIVE))
  91. #define IS_AREA_TRANSIT(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_TRANSIT))
  92. #define IS_AREA_STUB(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_STUB))
  93. /* prototypes */
  94. extern int ospf6_area_cmp (void *va, void *vb);
  95. extern struct ospf6_area *ospf6_area_create (u_int32_t, struct ospf6 *);
  96. extern void ospf6_area_delete (struct ospf6_area *);
  97. extern struct ospf6_area *ospf6_area_lookup (u_int32_t, struct ospf6 *);
  98. extern void ospf6_area_enable (struct ospf6_area *);
  99. extern void ospf6_area_disable (struct ospf6_area *);
  100. extern void ospf6_area_show (struct vty *, struct ospf6_area *);
  101. extern void ospf6_area_config_write (struct vty *vty);
  102. extern void ospf6_area_init (void);
  103. #endif /* OSPF_AREA_H */