]> git.proxmox.com Git - mirror_frr.git/blob - ospf6d/ospf6_top.h
Merge pull request #5280 from qlyoung/doc-clean-topotest-json
[mirror_frr.git] / ospf6d / ospf6_top.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 OSPF6_TOP_H
22 #define OSPF6_TOP_H
23
24 #include "qobj.h"
25 #include "routemap.h"
26
27 struct ospf6_master {
28
29 uint32_t zebra_router_id;
30 };
31
32 /* OSPFv3 top level data structure */
33 struct ospf6 {
34 /* The relevant vrf_id */
35 vrf_id_t vrf_id;
36
37 /* my router id */
38 uint32_t router_id;
39
40 /* static router id */
41 uint32_t router_id_static;
42
43 struct in_addr router_id_zebra;
44
45 /* start time */
46 struct timeval starttime;
47
48 /* list of areas */
49 struct list *area_list;
50 struct ospf6_area *backbone;
51
52 /* AS scope link state database */
53 struct ospf6_lsdb *lsdb;
54 struct ospf6_lsdb *lsdb_self;
55
56 struct ospf6_route_table *route_table;
57 struct ospf6_route_table *brouter_table;
58
59 struct ospf6_route_table *external_table;
60 struct route_table *external_id_table;
61 uint32_t external_id;
62
63 /* redistribute route-map */
64 struct {
65 char *name;
66 struct route_map *map;
67 } rmap[ZEBRA_ROUTE_MAX];
68
69 uint8_t flag;
70
71 /* Configured flags */
72 uint8_t config_flags;
73 #define OSPF6_LOG_ADJACENCY_CHANGES (1 << 0)
74 #define OSPF6_LOG_ADJACENCY_DETAIL (1 << 1)
75
76 /* LSA timer parameters */
77 unsigned int lsa_minarrival; /* LSA minimum arrival in milliseconds. */
78
79 /* SPF parameters */
80 unsigned int spf_delay; /* SPF delay time. */
81 unsigned int spf_holdtime; /* SPF hold time. */
82 unsigned int spf_max_holdtime; /* SPF maximum-holdtime */
83 unsigned int
84 spf_hold_multiplier; /* Adaptive multiplier for hold time */
85 unsigned int spf_reason; /* reason bits while scheduling SPF */
86
87 struct timeval ts_spf; /* SPF calculation time stamp. */
88 struct timeval ts_spf_duration; /* Execution time of last SPF */
89 unsigned int last_spf_reason; /* Last SPF reason */
90
91 /* Threads */
92 struct thread *t_spf_calc; /* SPF calculation timer. */
93 struct thread *t_ase_calc; /* ASE calculation timer. */
94 struct thread *maxage_remover;
95 struct thread *t_distribute_update; /* Distirbute update timer. */
96
97 uint32_t ref_bandwidth;
98
99 /* Distance parameters */
100 uint8_t distance_all;
101 uint8_t distance_intra;
102 uint8_t distance_inter;
103 uint8_t distance_external;
104
105 struct route_table *distance_table;
106
107 /* Used during ospf instance going down send LSDB
108 * update to neighbors immediatly */
109 uint8_t inst_shutdown;
110
111 QOBJ_FIELDS
112 };
113 DECLARE_QOBJ_TYPE(ospf6)
114
115 #define OSPF6_DISABLED 0x01
116 #define OSPF6_STUB_ROUTER 0x02
117
118 /* global pointer for OSPF top data structure */
119 extern struct ospf6 *ospf6;
120 extern struct ospf6_master *om6;
121
122 /* prototypes */
123 extern void ospf6_master_init(void);
124 extern void ospf6_top_init(void);
125 extern void ospf6_delete(struct ospf6 *o);
126 extern void ospf6_router_id_update(void);
127
128 extern void ospf6_maxage_remove(struct ospf6 *o);
129
130 #endif /* OSPF6_TOP_H */