]> git.proxmox.com Git - mirror_frr.git/blob - ospf6d/ospf6_area.h
Merge pull request #5288 from SumitAgarwal123/bfd_docs
[mirror_frr.git] / ospf6d / ospf6_area.h
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 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
19 */
20
21 #ifndef OSPF_AREA_H
22 #define OSPF_AREA_H
23
24 #include "ospf6_top.h"
25
26 struct ospf6_area {
27 /* Reference to Top data structure */
28 struct ospf6 *ospf6;
29
30 /* Area-ID */
31 uint32_t area_id;
32
33 #define OSPF6_AREA_FMT_DOTTEDQUAD 1
34 #define OSPF6_AREA_FMT_DECIMAL 2
35 /* Area-ID string */
36 char name[16];
37
38 /* flag */
39 uint8_t flag;
40
41 /* OSPF Option */
42 uint8_t options[3];
43
44 /* Summary routes to be originated (includes Configured Address Ranges)
45 */
46 struct ospf6_route_table *range_table;
47 struct ospf6_route_table *summary_prefix;
48 struct ospf6_route_table *summary_router;
49
50 /* Area type */
51 int no_summary;
52
53 /* Brouter traversal protection */
54 int intra_brouter_calc;
55
56 /* OSPF interface list */
57 struct list *if_list;
58
59 struct ospf6_lsdb *lsdb;
60 struct ospf6_lsdb *lsdb_self;
61 struct ospf6_lsdb *temp_router_lsa_lsdb;
62
63 struct ospf6_route_table *spf_table;
64 struct ospf6_route_table *route_table;
65
66 uint32_t spf_calculation; /* SPF calculation count */
67
68 struct thread *thread_router_lsa;
69 struct thread *thread_intra_prefix_lsa;
70 uint32_t router_lsa_size_limit;
71
72 /* Area announce list */
73 struct {
74 char *name;
75 struct access_list *list;
76 } _export;
77 #define EXPORT_NAME(A) (A)->_export.name
78 #define EXPORT_LIST(A) (A)->_export.list
79
80 /* Area acceptance list */
81 struct {
82 char *name;
83 struct access_list *list;
84 } import;
85 #define IMPORT_NAME(A) (A)->import.name
86 #define IMPORT_LIST(A) (A)->import.list
87
88 /* Type 3 LSA Area prefix-list */
89 struct {
90 char *name;
91 struct prefix_list *list;
92 } plist_in;
93 #define PREFIX_NAME_IN(A) (A)->plist_in.name
94 #define PREFIX_LIST_IN(A) (A)->plist_in.list
95
96 struct {
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
103 /* Time stamps. */
104 struct timeval ts_spf; /* SPF calculation time stamp. */
105
106 uint32_t full_nbrs; /* Fully adjacent neighbors. */
107 uint8_t intra_prefix_originate; /* Force intra_prefix lsa originate */
108 };
109
110 #define OSPF6_AREA_ENABLE 0x01
111 #define OSPF6_AREA_ACTIVE 0x02
112 #define OSPF6_AREA_TRANSIT 0x04 /* TransitCapability */
113 #define OSPF6_AREA_STUB 0x08
114
115 #define IS_AREA_ENABLED(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ENABLE))
116 #define IS_AREA_ACTIVE(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ACTIVE))
117 #define IS_AREA_TRANSIT(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_TRANSIT))
118 #define IS_AREA_STUB(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_STUB))
119
120 /* prototypes */
121 extern int ospf6_area_cmp(void *va, void *vb);
122
123 extern struct ospf6_area *ospf6_area_create(uint32_t, struct ospf6 *, int);
124 extern void ospf6_area_delete(struct ospf6_area *);
125 extern struct ospf6_area *ospf6_area_lookup(uint32_t, struct ospf6 *);
126
127 extern void ospf6_area_enable(struct ospf6_area *);
128 extern void ospf6_area_disable(struct ospf6_area *);
129
130 extern void ospf6_area_show(struct vty *, struct ospf6_area *);
131
132 extern void ospf6_area_plist_update(struct prefix_list *plist, int add);
133 extern void ospf6_area_config_write(struct vty *vty);
134 extern void ospf6_area_init(void);
135 struct ospf6_interface;
136 extern void ospf6_area_interface_delete(struct ospf6_interface *oi);
137
138 #endif /* OSPF_AREA_H */