]>
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 OSPF6_TOP_H | |
22 | #define OSPF6_TOP_H | |
23 | ||
ae19c240 | 24 | #include "qobj.h" |
718e3744 | 25 | #include "routemap.h" |
78c6ba61 CS |
26 | struct ospf6_master { |
27 | ||
beadc736 | 28 | /* OSPFv3 instance. */ |
29 | struct list *ospf6; | |
30 | /* OSPFv3 thread master. */ | |
31 | struct thread_master *master; | |
858f9c08 | 32 | in_addr_t zebra_router_id; |
78c6ba61 CS |
33 | }; |
34 | ||
c572fbfe DL |
35 | /* ospf6->config_flags */ |
36 | enum { | |
37 | OSPF6_LOG_ADJACENCY_CHANGES = (1 << 0), | |
38 | OSPF6_LOG_ADJACENCY_DETAIL = (1 << 1), | |
39 | }; | |
40 | ||
a069482f K |
41 | struct ospf6_redist { |
42 | uint8_t instance; | |
b19502d3 YR |
43 | |
44 | /* Redistribute metric info. */ | |
45 | struct { | |
46 | int type; /* External metric type (E1 or E2). */ | |
47 | int value; /* Value for static metric (24-bit). | |
48 | * -1 means metric value is not set. | |
49 | */ | |
50 | } dmetric; | |
51 | ||
a069482f K |
52 | /* For redistribute route map. */ |
53 | struct { | |
54 | char *name; | |
55 | struct route_map *map; | |
56 | } route_map; | |
57 | #define ROUTEMAP_NAME(R) (R->route_map.name) | |
58 | #define ROUTEMAP(R) (R->route_map.map) | |
59 | }; | |
60 | ||
508e53e2 | 61 | /* OSPFv3 top level data structure */ |
d62a17ae | 62 | struct ospf6 { |
cf319495 DS |
63 | /* The relevant vrf_id */ |
64 | vrf_id_t vrf_id; | |
65 | ||
7df1f362 K |
66 | char *name; /* VRF name */ |
67 | ||
d62a17ae | 68 | /* my router id */ |
858f9c08 | 69 | in_addr_t router_id; |
718e3744 | 70 | |
d62a17ae | 71 | /* static router id */ |
858f9c08 | 72 | in_addr_t router_id_static; |
c8a440ec | 73 | |
d6927cf3 CS |
74 | struct in_addr router_id_zebra; |
75 | ||
d62a17ae | 76 | /* start time */ |
77 | struct timeval starttime; | |
718e3744 | 78 | |
d62a17ae | 79 | /* list of areas */ |
80 | struct list *area_list; | |
81 | struct ospf6_area *backbone; | |
718e3744 | 82 | |
d62a17ae | 83 | /* AS scope link state database */ |
84 | struct ospf6_lsdb *lsdb; | |
85 | struct ospf6_lsdb *lsdb_self; | |
718e3744 | 86 | |
d62a17ae | 87 | struct ospf6_route_table *route_table; |
88 | struct ospf6_route_table *brouter_table; | |
508e53e2 | 89 | |
d62a17ae | 90 | struct ospf6_route_table *external_table; |
91 | struct route_table *external_id_table; | |
d7c0a89a | 92 | uint32_t external_id; |
508e53e2 | 93 | |
a069482f | 94 | /* OSPF6 redistribute configuration */ |
b19502d3 | 95 | struct list *redist[ZEBRA_ROUTE_MAX + 1]; |
718e3744 | 96 | |
d7c0a89a | 97 | uint8_t flag; |
718e3744 | 98 | |
b8212e03 YR |
99 | int redistribute; /* Num of redistributed protocols. */ |
100 | ||
c572fbfe | 101 | /* Configuration bitmask, refer to enum above */ |
d7c0a89a | 102 | uint8_t config_flags; |
b19502d3 YR |
103 | int default_originate; /* Default information originate. */ |
104 | #define DEFAULT_ORIGINATE_NONE 0 | |
105 | #define DEFAULT_ORIGINATE_ZEBRA 1 | |
106 | #define DEFAULT_ORIGINATE_ALWAYS 2 | |
d62a17ae | 107 | /* LSA timer parameters */ |
108 | unsigned int lsa_minarrival; /* LSA minimum arrival in milliseconds. */ | |
b6927875 | 109 | |
d62a17ae | 110 | /* SPF parameters */ |
111 | unsigned int spf_delay; /* SPF delay time. */ | |
112 | unsigned int spf_holdtime; /* SPF hold time. */ | |
113 | unsigned int spf_max_holdtime; /* SPF maximum-holdtime */ | |
114 | unsigned int | |
115 | spf_hold_multiplier; /* Adaptive multiplier for hold time */ | |
116 | unsigned int spf_reason; /* reason bits while scheduling SPF */ | |
3810e06e | 117 | |
d62a17ae | 118 | struct timeval ts_spf; /* SPF calculation time stamp. */ |
119 | struct timeval ts_spf_duration; /* Execution time of last SPF */ | |
120 | unsigned int last_spf_reason; /* Last SPF reason */ | |
3810e06e | 121 | |
7df1f362 | 122 | int fd; |
d62a17ae | 123 | /* Threads */ |
124 | struct thread *t_spf_calc; /* SPF calculation timer. */ | |
125 | struct thread *t_ase_calc; /* ASE calculation timer. */ | |
126 | struct thread *maxage_remover; | |
856ae1eb | 127 | struct thread *t_distribute_update; /* Distirbute update timer. */ |
7df1f362 | 128 | struct thread *t_ospf6_receive; /* OSPF6 receive timer */ |
fd500689 | 129 | |
d7c0a89a | 130 | uint32_t ref_bandwidth; |
baff583e | 131 | |
d62a17ae | 132 | /* Distance parameters */ |
d7c0a89a QY |
133 | uint8_t distance_all; |
134 | uint8_t distance_intra; | |
135 | uint8_t distance_inter; | |
136 | uint8_t distance_external; | |
baff583e | 137 | |
d62a17ae | 138 | struct route_table *distance_table; |
ae19c240 | 139 | |
76249532 CS |
140 | /* Used during ospf instance going down send LSDB |
141 | * update to neighbors immediatly */ | |
142 | uint8_t inst_shutdown; | |
143 | ||
1958143e MR |
144 | /* Max number of multiple paths |
145 | * to support ECMP. | |
146 | */ | |
147 | uint16_t max_multipath; | |
148 | ||
96244aca | 149 | QOBJ_FIELDS; |
718e3744 | 150 | }; |
96244aca | 151 | DECLARE_QOBJ_TYPE(ospf6); |
718e3744 | 152 | |
508e53e2 | 153 | #define OSPF6_DISABLED 0x01 |
f41b4a02 | 154 | #define OSPF6_STUB_ROUTER 0x02 |
b8212e03 | 155 | #define OSPF6_FLAG_ASBR 0x04 |
f85b7619 | 156 | #define OSPF6_MAX_IF_ADDRS 100 |
157 | #define OSPF6_MAX_IF_ADDRS_JUMBO 200 | |
158 | #define OSPF6_DEFAULT_MTU 1500 | |
159 | #define OSPF6_JUMBO_MTU 9000 | |
718e3744 | 160 | |
508e53e2 | 161 | /* global pointer for OSPF top data structure */ |
162 | extern struct ospf6 *ospf6; | |
78c6ba61 | 163 | extern struct ospf6_master *om6; |
718e3744 | 164 | |
508e53e2 | 165 | /* prototypes */ |
beadc736 | 166 | extern void ospf6_master_init(struct thread_master *master); |
d62a17ae | 167 | extern void ospf6_top_init(void); |
168 | extern void ospf6_delete(struct ospf6 *o); | |
beadc736 | 169 | extern void ospf6_router_id_update(struct ospf6 *ospf6); |
718e3744 | 170 | |
d62a17ae | 171 | extern void ospf6_maxage_remove(struct ospf6 *o); |
beadc736 | 172 | extern struct ospf6 *ospf6_instance_create(const char *name); |
173 | void ospf6_vrf_link(struct ospf6 *ospf6, struct vrf *vrf); | |
174 | void ospf6_vrf_unlink(struct ospf6 *ospf6, struct vrf *vrf); | |
175 | struct ospf6 *ospf6_lookup_by_vrf_id(vrf_id_t vrf_id); | |
176 | struct ospf6 *ospf6_lookup_by_vrf_name(const char *name); | |
177 | const char *ospf6_vrf_id_to_name(vrf_id_t vrf_id); | |
4e8ccd92 | 178 | void ospf6_vrf_init(void); |
718e3744 | 179 | #endif /* OSPF6_TOP_H */ |