blob: 655967a9a314a6d14612af38de8b073a4d46b9df [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
hasso508e53e2004-05-18 18:57:06 +00002 * Copyright (C) 2003 Yasuhiro Ohara
paul718e3742002-12-13 20:15:29 +00003 *
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
22#ifndef OSPF_AREA_H
23#define OSPF_AREA_H
24
paul718e3742002-12-13 20:15:29 +000025#include "ospf6_top.h"
26
27struct ospf6_area
28{
hasso508e53e2004-05-18 18:57:06 +000029 /* Reference to Top data structure */
30 struct ospf6 *ospf6;
paul718e3742002-12-13 20:15:29 +000031
hasso508e53e2004-05-18 18:57:06 +000032 /* Area-ID */
33 u_int32_t area_id;
paul718e3742002-12-13 20:15:29 +000034
hasso508e53e2004-05-18 18:57:06 +000035 /* Area-ID string */
36 char name[16];
paul718e3742002-12-13 20:15:29 +000037
hasso508e53e2004-05-18 18:57:06 +000038 /* flag */
39 u_char flag;
paul718e3742002-12-13 20:15:29 +000040
hasso508e53e2004-05-18 18:57:06 +000041 /* OSPF Option */
42 u_char options[3];
paul718e3742002-12-13 20:15:29 +000043
hasso049207c2004-08-04 20:02:13 +000044 /* Summary routes to be originated (includes Configured Address Ranges) */
hasso6452df02004-08-15 05:52:07 +000045 struct ospf6_route_table *range_table;
46 struct ospf6_route_table *summary_prefix;
47 struct ospf6_route_table *summary_router;
hasso049207c2004-08-04 20:02:13 +000048
hasso508e53e2004-05-18 18:57:06 +000049 /* OSPF interface list */
hasso52dc7ee2004-09-23 19:18:23 +000050 struct list *if_list;
paul718e3742002-12-13 20:15:29 +000051
hasso6452df02004-08-15 05:52:07 +000052 struct ospf6_lsdb *lsdb;
53 struct ospf6_lsdb *lsdb_self;
54
hasso508e53e2004-05-18 18:57:06 +000055 struct ospf6_route_table *spf_table;
paul718e3742002-12-13 20:15:29 +000056 struct ospf6_route_table *route_table;
paul718e3742002-12-13 20:15:29 +000057
hasso508e53e2004-05-18 18:57:06 +000058 struct thread *thread_spf_calculation;
59 struct thread *thread_route_calculation;
Vincent Bernatea86e402012-06-04 10:29:49 +020060 u_int32_t spf_calculation; /* SPF calculation count */
paul718e3742002-12-13 20:15:29 +000061
62 struct thread *thread_router_lsa;
hasso508e53e2004-05-18 18:57:06 +000063 struct thread *thread_intra_prefix_lsa;
64 u_int32_t router_lsa_size_limit;
hasso34956b32005-06-24 08:44:02 +000065
66 /* Area announce list */
67 struct
68 {
69 char *name;
70 struct access_list *list;
Paul Jakmadea04442008-02-26 09:16:09 +000071 } _export;
72#define EXPORT_NAME(A) (A)->_export.name
73#define EXPORT_LIST(A) (A)->_export.list
hasso34956b32005-06-24 08:44:02 +000074
75 /* Area acceptance list */
76 struct
77 {
78 char *name;
79 struct access_list *list;
80 } import;
81#define IMPORT_NAME(A) (A)->import.name
82#define IMPORT_LIST(A) (A)->import.list
83
84 /* Type 3 LSA Area prefix-list */
85 struct
86 {
87 char *name;
88 struct prefix_list *list;
89 } plist_in;
90#define PREFIX_NAME_IN(A) (A)->plist_in.name
91#define PREFIX_LIST_IN(A) (A)->plist_in.list
92
93 struct
94 {
95 char *name;
96 struct prefix_list *list;
97 } plist_out;
98#define PREFIX_NAME_OUT(A) (A)->plist_out.name
99#define PREFIX_LIST_OUT(A) (A)->plist_out.list
100
paul718e3742002-12-13 20:15:29 +0000101};
102
hasso6452df02004-08-15 05:52:07 +0000103#define OSPF6_AREA_ENABLE 0x01
104#define OSPF6_AREA_ACTIVE 0x02
105#define OSPF6_AREA_TRANSIT 0x04 /* TransitCapability */
106#define OSPF6_AREA_STUB 0x08
107
hasso6452df02004-08-15 05:52:07 +0000108#define IS_AREA_ENABLED(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ENABLE))
109#define IS_AREA_ACTIVE(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ACTIVE))
110#define IS_AREA_TRANSIT(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_TRANSIT))
111#define IS_AREA_STUB(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_STUB))
paul718e3742002-12-13 20:15:29 +0000112
113/* prototypes */
Paul Jakma6ac29a52008-08-15 13:45:30 +0100114extern int ospf6_area_cmp (void *va, void *vb);
hasso6452df02004-08-15 05:52:07 +0000115
Paul Jakma6ac29a52008-08-15 13:45:30 +0100116extern struct ospf6_area *ospf6_area_create (u_int32_t, struct ospf6 *);
117extern void ospf6_area_delete (struct ospf6_area *);
118extern struct ospf6_area *ospf6_area_lookup (u_int32_t, struct ospf6 *);
paul718e3742002-12-13 20:15:29 +0000119
Paul Jakma6ac29a52008-08-15 13:45:30 +0100120extern void ospf6_area_enable (struct ospf6_area *);
121extern void ospf6_area_disable (struct ospf6_area *);
hasso508e53e2004-05-18 18:57:06 +0000122
Paul Jakma6ac29a52008-08-15 13:45:30 +0100123extern void ospf6_area_show (struct vty *, struct ospf6_area *);
hasso6452df02004-08-15 05:52:07 +0000124
Paul Jakma6ac29a52008-08-15 13:45:30 +0100125extern void ospf6_area_config_write (struct vty *vty);
126extern void ospf6_area_init (void);
paul718e3742002-12-13 20:15:29 +0000127
128#endif /* OSPF_AREA_H */