]>
Commit | Line | Data |
---|---|---|
718e3744 | 1 | /* |
508e53e2 | 2 | * Copyright (C) 2003 Yasuhiro Ohara |
718e3744 | 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 | * | |
896014f4 DL |
16 | * You should have received a copy of the GNU General Public License along |
17 | * with this program; see the file COPYING; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
718e3744 | 19 | */ |
20 | ||
21 | #ifndef OSPF_AREA_H | |
22 | #define OSPF_AREA_H | |
23 | ||
718e3744 | 24 | #include "ospf6_top.h" |
25 | ||
26 | struct ospf6_area | |
27 | { | |
508e53e2 | 28 | /* Reference to Top data structure */ |
29 | struct ospf6 *ospf6; | |
718e3744 | 30 | |
508e53e2 | 31 | /* Area-ID */ |
32 | u_int32_t area_id; | |
718e3744 | 33 | |
79c3f4f4 QY |
34 | #define OSPF6_AREA_FMT_DOTTEDQUAD 1 |
35 | #define OSPF6_AREA_FMT_DECIMAL 2 | |
508e53e2 | 36 | /* Area-ID string */ |
37 | char name[16]; | |
718e3744 | 38 | |
508e53e2 | 39 | /* flag */ |
40 | u_char flag; | |
718e3744 | 41 | |
508e53e2 | 42 | /* OSPF Option */ |
43 | u_char options[3]; | |
718e3744 | 44 | |
049207c3 | 45 | /* Summary routes to be originated (includes Configured Address Ranges) */ |
6452df09 | 46 | struct ospf6_route_table *range_table; |
47 | struct ospf6_route_table *summary_prefix; | |
48 | struct ospf6_route_table *summary_router; | |
049207c3 | 49 | |
ca1f4309 DS |
50 | /* Area type */ |
51 | int no_summary; | |
52 | ||
508e53e2 | 53 | /* OSPF interface list */ |
52dc7ee6 | 54 | struct list *if_list; |
718e3744 | 55 | |
6452df09 | 56 | struct ospf6_lsdb *lsdb; |
57 | struct ospf6_lsdb *lsdb_self; | |
58 | ||
508e53e2 | 59 | struct ospf6_route_table *spf_table; |
718e3744 | 60 | struct ospf6_route_table *route_table; |
718e3744 | 61 | |
ea86e404 | 62 | u_int32_t spf_calculation; /* SPF calculation count */ |
718e3744 | 63 | |
64 | struct thread *thread_router_lsa; | |
508e53e2 | 65 | struct thread *thread_intra_prefix_lsa; |
66 | u_int32_t router_lsa_size_limit; | |
34956b31 | 67 | |
68 | /* Area announce list */ | |
69 | struct | |
70 | { | |
71 | char *name; | |
72 | struct access_list *list; | |
dea04441 PJ |
73 | } _export; |
74 | #define EXPORT_NAME(A) (A)->_export.name | |
75 | #define EXPORT_LIST(A) (A)->_export.list | |
34956b31 | 76 | |
77 | /* Area acceptance list */ | |
78 | struct | |
79 | { | |
80 | char *name; | |
81 | struct access_list *list; | |
82 | } import; | |
83 | #define IMPORT_NAME(A) (A)->import.name | |
84 | #define IMPORT_LIST(A) (A)->import.list | |
85 | ||
86 | /* Type 3 LSA Area prefix-list */ | |
87 | struct | |
88 | { | |
89 | char *name; | |
90 | struct prefix_list *list; | |
91 | } plist_in; | |
92 | #define PREFIX_NAME_IN(A) (A)->plist_in.name | |
93 | #define PREFIX_LIST_IN(A) (A)->plist_in.list | |
94 | ||
95 | struct | |
96 | { | |
97 | char *name; | |
98 | struct prefix_list *list; | |
99 | } plist_out; | |
100 | #define PREFIX_NAME_OUT(A) (A)->plist_out.name | |
101 | #define PREFIX_LIST_OUT(A) (A)->plist_out.list | |
102 | ||
c3c0ac83 DS |
103 | /* Time stamps. */ |
104 | struct timeval ts_spf; /* SPF calculation time stamp. */ | |
718e3744 | 105 | }; |
106 | ||
6452df09 | 107 | #define OSPF6_AREA_ENABLE 0x01 |
108 | #define OSPF6_AREA_ACTIVE 0x02 | |
109 | #define OSPF6_AREA_TRANSIT 0x04 /* TransitCapability */ | |
110 | #define OSPF6_AREA_STUB 0x08 | |
111 | ||
6452df09 | 112 | #define IS_AREA_ENABLED(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ENABLE)) |
113 | #define IS_AREA_ACTIVE(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ACTIVE)) | |
114 | #define IS_AREA_TRANSIT(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_TRANSIT)) | |
115 | #define IS_AREA_STUB(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_STUB)) | |
718e3744 | 116 | |
117 | /* prototypes */ | |
6ac29a51 | 118 | extern int ospf6_area_cmp (void *va, void *vb); |
6452df09 | 119 | |
79c3f4f4 | 120 | extern struct ospf6_area *ospf6_area_create (u_int32_t, struct ospf6 *, int); |
6ac29a51 PJ |
121 | extern void ospf6_area_delete (struct ospf6_area *); |
122 | extern struct ospf6_area *ospf6_area_lookup (u_int32_t, struct ospf6 *); | |
508e53e2 | 123 | |
6ac29a51 PJ |
124 | extern void ospf6_area_enable (struct ospf6_area *); |
125 | extern void ospf6_area_disable (struct ospf6_area *); | |
718e3744 | 126 | |
6ac29a51 | 127 | extern void ospf6_area_show (struct vty *, struct ospf6_area *); |
6452df09 | 128 | |
6ac29a51 PJ |
129 | extern void ospf6_area_config_write (struct vty *vty); |
130 | extern void ospf6_area_init (void); | |
718e3744 | 131 | |
132 | #endif /* OSPF_AREA_H */ |