]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * OSPFd main header. | |
3 | * Copyright (C) 1998, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada | |
4 | * | |
5 | * This file is part of GNU Zebra. | |
6 | * | |
7 | * GNU Zebra is free software; you can redistribute it and/or modify it | |
8 | * under the terms of the GNU General Public License as published by the | |
9 | * Free Software Foundation; either version 2, or (at your option) any | |
10 | * later version. | |
11 | * | |
12 | * GNU Zebra is distributed in the hope that it will be useful, but | |
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License along | |
18 | * with this program; see the file COPYING; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | */ | |
21 | ||
22 | #ifndef _ZEBRA_OSPFD_H | |
23 | #define _ZEBRA_OSPFD_H | |
24 | ||
25 | #include <zebra.h> | |
26 | #include "qobj.h" | |
27 | #include "libospf.h" | |
28 | ||
29 | #include "filter.h" | |
30 | #include "log.h" | |
31 | #include "vrf.h" | |
32 | ||
33 | #include "ospf_memory.h" | |
34 | #include "ospf_dump_api.h" | |
35 | ||
36 | #define OSPF_VERSION 2 | |
37 | ||
38 | /* VTY port number. */ | |
39 | #define OSPF_VTY_PORT 2604 | |
40 | ||
41 | /* IP TTL for OSPF protocol. */ | |
42 | #define OSPF_IP_TTL 1 | |
43 | #define OSPF_VL_IP_TTL 100 | |
44 | ||
45 | /* Default configuration file name for ospfd. */ | |
46 | #define OSPF_DEFAULT_CONFIG "ospfd.conf" | |
47 | ||
48 | #define OSPF_NSSA_TRANS_STABLE_DEFAULT 40 | |
49 | ||
50 | #define OSPF_ALLSPFROUTERS 0xe0000005 /* 224.0.0.5 */ | |
51 | #define OSPF_ALLDROUTERS 0xe0000006 /* 224.0.0.6 */ | |
52 | ||
53 | /* OSPF Authentication Type. */ | |
54 | #define OSPF_AUTH_NULL 0 | |
55 | #define OSPF_AUTH_SIMPLE 1 | |
56 | #define OSPF_AUTH_CRYPTOGRAPHIC 2 | |
57 | /* For Interface authentication setting default */ | |
58 | #define OSPF_AUTH_NOTSET -1 | |
59 | /* For the consumption and sanity of the command handler */ | |
60 | /* DO NIOT REMOVE!!! Need to detect whether a value has | |
61 | been given or not in VLink command handlers */ | |
62 | #define OSPF_AUTH_CMD_NOTSEEN -2 | |
63 | ||
64 | /* OSPF options. */ | |
65 | #define OSPF_OPTION_MT 0x01 /* M/T */ | |
66 | #define OSPF_OPTION_E 0x02 | |
67 | #define OSPF_OPTION_MC 0x04 | |
68 | #define OSPF_OPTION_NP 0x08 | |
69 | #define OSPF_OPTION_EA 0x10 | |
70 | #define OSPF_OPTION_DC 0x20 | |
71 | #define OSPF_OPTION_O 0x40 | |
72 | #define OSPF_OPTION_DN 0x80 | |
73 | ||
74 | /* OSPF Database Description flags. */ | |
75 | #define OSPF_DD_FLAG_MS 0x01 | |
76 | #define OSPF_DD_FLAG_M 0x02 | |
77 | #define OSPF_DD_FLAG_I 0x04 | |
78 | #define OSPF_DD_FLAG_ALL 0x07 | |
79 | ||
80 | #define OSPF_LS_REFRESH_SHIFT (60 * 15) | |
81 | #define OSPF_LS_REFRESH_JITTER 60 | |
82 | ||
83 | struct ospf_external { | |
84 | unsigned short instance; | |
85 | struct route_table *external_info; | |
86 | }; | |
87 | ||
88 | /* OSPF master for system wide configuration and variables. */ | |
89 | struct ospf_master { | |
90 | /* OSPF instance. */ | |
91 | struct list *ospf; | |
92 | ||
93 | /* OSPF thread master. */ | |
94 | struct thread_master *master; | |
95 | ||
96 | /* Various OSPF global configuration. */ | |
97 | uint8_t options; | |
98 | #define OSPF_MASTER_SHUTDOWN (1 << 0) /* deferred-shutdown */ | |
99 | }; | |
100 | ||
101 | struct ospf_redist { | |
102 | unsigned short instance; | |
103 | ||
104 | /* Redistribute metric info. */ | |
105 | struct { | |
106 | int type; /* External metric type (E1 or E2). */ | |
107 | int value; /* Value for static metric (24-bit). | |
108 | -1 means metric value is not set. */ | |
109 | } dmetric; | |
110 | ||
111 | /* For redistribute route map. */ | |
112 | struct { | |
113 | char *name; | |
114 | struct route_map *map; | |
115 | } route_map; /* +1 is for default-information */ | |
116 | #define ROUTEMAP_NAME(R) (R->route_map.name) | |
117 | #define ROUTEMAP(R) (R->route_map.map) | |
118 | }; | |
119 | ||
120 | /* OSPF instance structure. */ | |
121 | struct ospf { | |
122 | /* OSPF's running state based on the '[no] router ospf [<instance>]' | |
123 | * config. */ | |
124 | uint8_t oi_running; | |
125 | ||
126 | /* OSPF instance ID */ | |
127 | unsigned short instance; | |
128 | ||
129 | /* OSPF Router ID. */ | |
130 | struct in_addr router_id; /* Configured automatically. */ | |
131 | struct in_addr router_id_static; /* Configured manually. */ | |
132 | struct in_addr router_id_zebra; | |
133 | ||
134 | vrf_id_t vrf_id; /* VRF Id */ | |
135 | char *name; /* VRF name */ | |
136 | ||
137 | /* ABR/ASBR internal flags. */ | |
138 | uint8_t flags; | |
139 | #define OSPF_FLAG_ABR 0x0001 | |
140 | #define OSPF_FLAG_ASBR 0x0002 | |
141 | ||
142 | /* ABR type. */ | |
143 | uint8_t abr_type; | |
144 | #define OSPF_ABR_UNKNOWN 0 | |
145 | #define OSPF_ABR_STAND 1 | |
146 | #define OSPF_ABR_IBM 2 | |
147 | #define OSPF_ABR_CISCO 3 | |
148 | #define OSPF_ABR_SHORTCUT 4 | |
149 | #define OSPF_ABR_DEFAULT OSPF_ABR_CISCO | |
150 | ||
151 | /* NSSA ABR */ | |
152 | uint8_t anyNSSA; /* Bump for every NSSA attached. */ | |
153 | ||
154 | /* Configured variables. */ | |
155 | uint8_t config; | |
156 | #define OSPF_RFC1583_COMPATIBLE (1 << 0) | |
157 | #define OSPF_OPAQUE_CAPABLE (1 << 2) | |
158 | #define OSPF_LOG_ADJACENCY_CHANGES (1 << 3) | |
159 | #define OSPF_LOG_ADJACENCY_DETAIL (1 << 4) | |
160 | ||
161 | /* Opaque-LSA administrative flags. */ | |
162 | uint8_t opaque; | |
163 | #define OPAQUE_OPERATION_READY_BIT (1 << 0) | |
164 | ||
165 | /* RFC3137 stub router. Configured time to stay stub / max-metric */ | |
166 | unsigned int stub_router_startup_time; /* seconds */ | |
167 | unsigned int stub_router_shutdown_time; /* seconds */ | |
168 | #define OSPF_STUB_ROUTER_UNCONFIGURED 0 | |
169 | uint8_t stub_router_admin_set; | |
170 | #define OSPF_STUB_ROUTER_ADMINISTRATIVE_SET 1 | |
171 | #define OSPF_STUB_ROUTER_ADMINISTRATIVE_UNSET 0 | |
172 | ||
173 | #define OSPF_STUB_MAX_METRIC_SUMMARY_COST 0x00ff0000 | |
174 | ||
175 | /* LSA timers */ | |
176 | unsigned int min_ls_interval; /* minimum delay between LSAs (in msec) */ | |
177 | unsigned int min_ls_arrival; /* minimum interarrival time between LSAs | |
178 | (in msec) */ | |
179 | ||
180 | /* SPF parameters */ | |
181 | unsigned int spf_delay; /* SPF delay time. */ | |
182 | unsigned int spf_holdtime; /* SPF hold time. */ | |
183 | unsigned int spf_max_holdtime; /* SPF maximum-holdtime */ | |
184 | unsigned int | |
185 | spf_hold_multiplier; /* Adaptive multiplier for hold time */ | |
186 | ||
187 | int default_originate; /* Default information originate. */ | |
188 | #define DEFAULT_ORIGINATE_NONE 0 | |
189 | #define DEFAULT_ORIGINATE_ZEBRA 1 | |
190 | #define DEFAULT_ORIGINATE_ALWAYS 2 | |
191 | uint32_t ref_bandwidth; /* Reference Bandwidth (Kbps). */ | |
192 | struct route_table *networks; /* OSPF config networks. */ | |
193 | struct list *vlinks; /* Configured Virtual-Links. */ | |
194 | struct list *areas; /* OSPF areas. */ | |
195 | struct route_table *nbr_nbma; | |
196 | struct ospf_area *backbone; /* Pointer to the Backbone Area. */ | |
197 | ||
198 | struct list *oiflist; /* ospf interfaces */ | |
199 | uint8_t passive_interface_default; /* passive-interface default */ | |
200 | ||
201 | /* LSDB of AS-external-LSAs. */ | |
202 | struct ospf_lsdb *lsdb; | |
203 | ||
204 | /* Flags. */ | |
205 | int external_origin; /* AS-external-LSA origin flag. */ | |
206 | int ase_calc; /* ASE calculation flag. */ | |
207 | ||
208 | struct list *opaque_lsa_self; /* Type-11 Opaque-LSAs */ | |
209 | ||
210 | /* Routing tables. */ | |
211 | struct route_table *old_table; /* Old routing table. */ | |
212 | struct route_table *new_table; /* Current routing table. */ | |
213 | ||
214 | struct route_table *old_rtrs; /* Old ABR/ASBR RT. */ | |
215 | struct route_table *new_rtrs; /* New ABR/ASBR RT. */ | |
216 | ||
217 | struct route_table *new_external_route; /* New External Route. */ | |
218 | struct route_table *old_external_route; /* Old External Route. */ | |
219 | ||
220 | struct route_table *external_lsas; /* Database of external LSAs, | |
221 | prefix is LSA's adv. network*/ | |
222 | ||
223 | /* Time stamps */ | |
224 | struct timeval ts_spf; /* SPF calculation time stamp. */ | |
225 | struct timeval ts_spf_duration; /* Execution time of last SPF */ | |
226 | ||
227 | struct route_table *maxage_lsa; /* List of MaxAge LSA for deletion. */ | |
228 | int redistribute; /* Num of redistributed protocols. */ | |
229 | ||
230 | /* Threads. */ | |
231 | struct thread *t_abr_task; /* ABR task timer. */ | |
232 | struct thread *t_asbr_check; /* ASBR check timer. */ | |
233 | struct thread *t_distribute_update; /* Distirbute list update timer. */ | |
234 | struct thread *t_spf_calc; /* SPF calculation timer. */ | |
235 | struct thread *t_ase_calc; /* ASE calculation timer. */ | |
236 | struct thread *t_external_lsa; /* AS-external-LSA origin timer. */ | |
237 | struct thread | |
238 | *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */ | |
239 | struct thread *t_sr_update; /* Segment Routing update timer */ | |
240 | ||
241 | unsigned int maxage_delay; /* Delay on Maxage remover timer, sec */ | |
242 | struct thread *t_maxage; /* MaxAge LSA remover timer. */ | |
243 | struct thread *t_maxage_walker; /* MaxAge LSA checking timer. */ | |
244 | ||
245 | struct thread | |
246 | *t_deferred_shutdown; /* deferred/stub-router shutdown timer*/ | |
247 | ||
248 | struct thread *t_write; | |
249 | #define OSPF_WRITE_INTERFACE_COUNT_DEFAULT 20 | |
250 | int write_oi_count; /* Num of packets sent per thread invocation */ | |
251 | struct thread *t_read; | |
252 | int fd; | |
253 | struct stream *ibuf; | |
254 | struct list *oi_write_q; | |
255 | ||
256 | /* Distribute lists out of other route sources. */ | |
257 | struct { | |
258 | char *name; | |
259 | struct access_list *list; | |
260 | } dlist[ZEBRA_ROUTE_MAX]; | |
261 | #define DISTRIBUTE_NAME(O,T) (O)->dlist[T].name | |
262 | #define DISTRIBUTE_LIST(O,T) (O)->dlist[T].list | |
263 | ||
264 | /* OSPF redistribute configuration */ | |
265 | struct list *redist[ZEBRA_ROUTE_MAX + 1]; | |
266 | ||
267 | /* Redistribute tag info. */ | |
268 | route_tag_t | |
269 | dtag[ZEBRA_ROUTE_MAX + 1]; // Pending: cant configure as of now | |
270 | ||
271 | int default_metric; /* Default metric for redistribute. */ | |
272 | ||
273 | #define OSPF_LSA_REFRESHER_GRANULARITY 10 | |
274 | #define OSPF_LSA_REFRESHER_SLOTS \ | |
275 | ((OSPF_LS_REFRESH_TIME + OSPF_LS_REFRESH_SHIFT) \ | |
276 | / OSPF_LSA_REFRESHER_GRANULARITY \ | |
277 | + 1) | |
278 | struct { | |
279 | uint16_t index; | |
280 | struct list *qs[OSPF_LSA_REFRESHER_SLOTS]; | |
281 | } lsa_refresh_queue; | |
282 | ||
283 | struct thread *t_lsa_refresher; | |
284 | time_t lsa_refresher_started; | |
285 | #define OSPF_LSA_REFRESH_INTERVAL_DEFAULT 10 | |
286 | uint16_t lsa_refresh_interval; | |
287 | ||
288 | /* Distance parameter. */ | |
289 | uint8_t distance_all; | |
290 | uint8_t distance_intra; | |
291 | uint8_t distance_inter; | |
292 | uint8_t distance_external; | |
293 | ||
294 | /* Statistics for LSA origination. */ | |
295 | uint32_t lsa_originate_count; | |
296 | ||
297 | /* Statistics for LSA used for new instantiation. */ | |
298 | uint32_t rx_lsa_count; | |
299 | ||
300 | /* Counter of "ip ospf area x.x.x.x" used | |
301 | * for multual exclusion of network command under | |
302 | * router ospf or ip ospf area x under interface. */ | |
303 | uint32_t if_ospf_cli_count; | |
304 | ||
305 | struct route_table *distance_table; | |
306 | ||
307 | /* Used during ospf instance going down send LSDB | |
308 | * update to neighbors immediatly */ | |
309 | uint8_t inst_shutdown; | |
310 | ||
311 | /* Redistributed external information. */ | |
312 | struct list *external[ZEBRA_ROUTE_MAX + 1]; | |
313 | #define EXTERNAL_INFO(E) (E->external_info) | |
314 | ||
315 | QOBJ_FIELDS | |
316 | }; | |
317 | DECLARE_QOBJ_TYPE(ospf) | |
318 | ||
319 | /* OSPF area structure. */ | |
320 | struct ospf_area { | |
321 | /* OSPF instance. */ | |
322 | struct ospf *ospf; | |
323 | ||
324 | /* Zebra interface list belonging to the area. */ | |
325 | struct list *oiflist; | |
326 | ||
327 | /* Area ID. */ | |
328 | struct in_addr area_id; | |
329 | ||
330 | /* Area ID format. */ | |
331 | int area_id_fmt; | |
332 | #define OSPF_AREA_ID_FMT_DOTTEDQUAD 1 | |
333 | #define OSPF_AREA_ID_FMT_DECIMAL 2 | |
334 | ||
335 | /* Address range. */ | |
336 | struct list *address_range; | |
337 | ||
338 | /* Configured variables. */ | |
339 | int external_routing; /* ExternalRoutingCapability. */ | |
340 | int no_summary; /* Don't inject summaries into stub.*/ | |
341 | int shortcut_configured; /* Area configured as shortcut. */ | |
342 | #define OSPF_SHORTCUT_DEFAULT 0 | |
343 | #define OSPF_SHORTCUT_ENABLE 1 | |
344 | #define OSPF_SHORTCUT_DISABLE 2 | |
345 | int shortcut_capability; /* Other ABRs agree on S-bit */ | |
346 | uint32_t default_cost; /* StubDefaultCost. */ | |
347 | int auth_type; /* Authentication type. */ | |
348 | ||
349 | ||
350 | uint8_t NSSATranslatorRole; /* NSSA configured role */ | |
351 | #define OSPF_NSSA_ROLE_NEVER 0 | |
352 | #define OSPF_NSSA_ROLE_CANDIDATE 1 | |
353 | #define OSPF_NSSA_ROLE_ALWAYS 2 | |
354 | uint8_t NSSATranslatorState; /* NSSA operational role */ | |
355 | #define OSPF_NSSA_TRANSLATE_DISABLED 0 | |
356 | #define OSPF_NSSA_TRANSLATE_ENABLED 1 | |
357 | int NSSATranslatorStabilityInterval; | |
358 | ||
359 | uint8_t transit; /* TransitCapability. */ | |
360 | #define OSPF_TRANSIT_FALSE 0 | |
361 | #define OSPF_TRANSIT_TRUE 1 | |
362 | struct route_table *ranges; /* Configured Area Ranges. */ | |
363 | ||
364 | /* RFC3137 stub router state flags for area */ | |
365 | uint8_t stub_router_state; | |
366 | #define OSPF_AREA_ADMIN_STUB_ROUTED (1 << 0) /* admin stub-router set */ | |
367 | #define OSPF_AREA_IS_STUB_ROUTED (1 << 1) /* stub-router active */ | |
368 | #define OSPF_AREA_WAS_START_STUB_ROUTED (1 << 2) /* startup SR was done */ | |
369 | /* Area related LSDBs[Type1-4]. */ | |
370 | struct ospf_lsdb *lsdb; | |
371 | ||
372 | /* Self-originated LSAs. */ | |
373 | struct ospf_lsa *router_lsa_self; | |
374 | struct list *opaque_lsa_self; /* Type-10 Opaque-LSAs */ | |
375 | ||
376 | /* Area announce list. */ | |
377 | struct { | |
378 | char *name; | |
379 | struct access_list *list; | |
380 | } _export; | |
381 | #define EXPORT_NAME(A) (A)->_export.name | |
382 | #define EXPORT_LIST(A) (A)->_export.list | |
383 | ||
384 | /* Area acceptance list. */ | |
385 | struct { | |
386 | char *name; | |
387 | struct access_list *list; | |
388 | } import; | |
389 | #define IMPORT_NAME(A) (A)->import.name | |
390 | #define IMPORT_LIST(A) (A)->import.list | |
391 | ||
392 | /* Type 3 LSA Area prefix-list. */ | |
393 | struct { | |
394 | char *name; | |
395 | struct prefix_list *list; | |
396 | } plist_in; | |
397 | #define PREFIX_LIST_IN(A) (A)->plist_in.list | |
398 | #define PREFIX_NAME_IN(A) (A)->plist_in.name | |
399 | ||
400 | struct { | |
401 | char *name; | |
402 | struct prefix_list *list; | |
403 | } plist_out; | |
404 | #define PREFIX_LIST_OUT(A) (A)->plist_out.list | |
405 | #define PREFIX_NAME_OUT(A) (A)->plist_out.name | |
406 | ||
407 | /* Shortest Path Tree. */ | |
408 | struct vertex *spf; | |
409 | ||
410 | /* Threads. */ | |
411 | struct thread *t_stub_router; /* Stub-router timer */ | |
412 | struct thread *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */ | |
413 | ||
414 | /* Statistics field. */ | |
415 | uint32_t spf_calculation; /* SPF Calculation Count. */ | |
416 | ||
417 | /* Time stamps. */ | |
418 | struct timeval ts_spf; /* SPF calculation time stamp. */ | |
419 | ||
420 | /* Router count. */ | |
421 | uint32_t abr_count; /* ABR router in this area. */ | |
422 | uint32_t asbr_count; /* ASBR router in this area. */ | |
423 | ||
424 | /* Counters. */ | |
425 | uint32_t act_ints; /* Active interfaces. */ | |
426 | uint32_t full_nbrs; /* Fully adjacent neighbors. */ | |
427 | uint32_t full_vls; /* Fully adjacent virtual neighbors. */ | |
428 | }; | |
429 | ||
430 | /* OSPF config network structure. */ | |
431 | struct ospf_network { | |
432 | /* Area ID. */ | |
433 | struct in_addr area_id; | |
434 | int area_id_fmt; | |
435 | }; | |
436 | ||
437 | /* OSPF NBMA neighbor structure. */ | |
438 | struct ospf_nbr_nbma { | |
439 | /* Neighbor IP address. */ | |
440 | struct in_addr addr; | |
441 | ||
442 | /* OSPF interface. */ | |
443 | struct ospf_interface *oi; | |
444 | ||
445 | /* OSPF neighbor structure. */ | |
446 | struct ospf_neighbor *nbr; | |
447 | ||
448 | /* Neighbor priority. */ | |
449 | uint8_t priority; | |
450 | ||
451 | /* Poll timer value. */ | |
452 | uint32_t v_poll; | |
453 | ||
454 | /* Poll timer thread. */ | |
455 | struct thread *t_poll; | |
456 | ||
457 | /* State change. */ | |
458 | uint32_t state_change; | |
459 | }; | |
460 | ||
461 | /* Macro. */ | |
462 | #define OSPF_AREA_SAME(X, Y) \ | |
463 | (memcmp((X->area_id), (Y->area_id), IPV4_MAX_BYTELEN) == 0) | |
464 | ||
465 | #define IS_OSPF_ABR(O) ((O)->flags & OSPF_FLAG_ABR) | |
466 | #define IS_OSPF_ASBR(O) ((O)->flags & OSPF_FLAG_ASBR) | |
467 | ||
468 | #define OSPF_IS_AREA_ID_BACKBONE(I) ((I).s_addr == OSPF_AREA_BACKBONE) | |
469 | #define OSPF_IS_AREA_BACKBONE(A) OSPF_IS_AREA_ID_BACKBONE ((A)->area_id) | |
470 | ||
471 | #ifdef roundup | |
472 | # define ROUNDUP(val, gran) roundup(val, gran) | |
473 | #else /* roundup */ | |
474 | # define ROUNDUP(val, gran) (((val) - 1 | (gran) - 1) + 1) | |
475 | #endif /* roundup */ | |
476 | ||
477 | #define LSA_OPTIONS_GET(area) \ | |
478 | (((area)->external_routing == OSPF_AREA_DEFAULT) ? OSPF_OPTION_E : 0) | |
479 | #define LSA_OPTIONS_NSSA_GET(area) \ | |
480 | (((area)->external_routing == OSPF_AREA_NSSA) ? OSPF_OPTION_NP : 0) | |
481 | ||
482 | #define OSPF_TIMER_ON(T,F,V) thread_add_timer (master,(F),ospf,(V),&(T)) | |
483 | #define OSPF_AREA_TIMER_ON(T,F,V) thread_add_timer (master, (F), area, (V), &(T)) | |
484 | #define OSPF_POLL_TIMER_ON(T,F,V) thread_add_timer (master, (F), nbr_nbma, (V), &(T)) | |
485 | #define OSPF_POLL_TIMER_OFF(X) OSPF_TIMER_OFF((X)) | |
486 | #define OSPF_TIMER_OFF(X) \ | |
487 | do { \ | |
488 | if (X) { \ | |
489 | thread_cancel(X); \ | |
490 | (X) = NULL; \ | |
491 | } \ | |
492 | } while (0) | |
493 | ||
494 | /* Extern variables. */ | |
495 | extern struct ospf_master *om; | |
496 | extern const int ospf_redistributed_proto_max; | |
497 | extern struct zclient *zclient; | |
498 | extern struct thread_master *master; | |
499 | extern int ospf_zlog; | |
500 | extern struct zebra_privs_t ospfd_privs; | |
501 | ||
502 | /* Prototypes. */ | |
503 | extern const char *ospf_redist_string(unsigned int route_type); | |
504 | extern struct ospf *ospf_lookup_instance(unsigned short); | |
505 | extern struct ospf *ospf_get(unsigned short instance, const char *name); | |
506 | extern struct ospf *ospf_get_instance(unsigned short); | |
507 | extern struct ospf *ospf_lookup_by_inst_name(unsigned short instance, | |
508 | const char *name); | |
509 | extern struct ospf *ospf_lookup_by_vrf_id(vrf_id_t vrf_id); | |
510 | extern void ospf_finish(struct ospf *); | |
511 | extern void ospf_router_id_update(struct ospf *ospf); | |
512 | extern int ospf_network_set(struct ospf *, struct prefix_ipv4 *, struct in_addr, | |
513 | int); | |
514 | extern int ospf_network_unset(struct ospf *, struct prefix_ipv4 *, | |
515 | struct in_addr); | |
516 | extern int ospf_area_display_format_set(struct ospf *, struct ospf_area *area, | |
517 | int df); | |
518 | extern int ospf_area_stub_set(struct ospf *, struct in_addr); | |
519 | extern int ospf_area_stub_unset(struct ospf *, struct in_addr); | |
520 | extern int ospf_area_no_summary_set(struct ospf *, struct in_addr); | |
521 | extern int ospf_area_no_summary_unset(struct ospf *, struct in_addr); | |
522 | extern int ospf_area_nssa_set(struct ospf *, struct in_addr); | |
523 | extern int ospf_area_nssa_unset(struct ospf *, struct in_addr, int); | |
524 | extern int ospf_area_nssa_translator_role_set(struct ospf *, struct in_addr, | |
525 | int); | |
526 | extern int ospf_area_export_list_set(struct ospf *, struct ospf_area *, | |
527 | const char *); | |
528 | extern int ospf_area_export_list_unset(struct ospf *, struct ospf_area *); | |
529 | extern int ospf_area_import_list_set(struct ospf *, struct ospf_area *, | |
530 | const char *); | |
531 | extern int ospf_area_import_list_unset(struct ospf *, struct ospf_area *); | |
532 | extern int ospf_area_shortcut_set(struct ospf *, struct ospf_area *, int); | |
533 | extern int ospf_area_shortcut_unset(struct ospf *, struct ospf_area *); | |
534 | extern int ospf_timers_refresh_set(struct ospf *, int); | |
535 | extern int ospf_timers_refresh_unset(struct ospf *); | |
536 | extern int ospf_nbr_nbma_set(struct ospf *, struct in_addr); | |
537 | extern int ospf_nbr_nbma_unset(struct ospf *, struct in_addr); | |
538 | extern int ospf_nbr_nbma_priority_set(struct ospf *, struct in_addr, uint8_t); | |
539 | extern int ospf_nbr_nbma_priority_unset(struct ospf *, struct in_addr); | |
540 | extern int ospf_nbr_nbma_poll_interval_set(struct ospf *, struct in_addr, | |
541 | unsigned int); | |
542 | extern int ospf_nbr_nbma_poll_interval_unset(struct ospf *, struct in_addr); | |
543 | extern void ospf_prefix_list_update(struct prefix_list *); | |
544 | extern void ospf_init(void); | |
545 | extern void ospf_if_update(struct ospf *, struct interface *); | |
546 | extern void ospf_ls_upd_queue_empty(struct ospf_interface *); | |
547 | extern void ospf_terminate(void); | |
548 | extern void ospf_nbr_nbma_if_update(struct ospf *, struct ospf_interface *); | |
549 | extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup(struct ospf *, | |
550 | struct in_addr); | |
551 | extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup_next(struct ospf *, | |
552 | struct in_addr *, int); | |
553 | extern int ospf_oi_count(struct interface *); | |
554 | ||
555 | extern struct ospf_area *ospf_area_get(struct ospf *, struct in_addr); | |
556 | extern void ospf_area_check_free(struct ospf *, struct in_addr); | |
557 | extern struct ospf_area *ospf_area_lookup_by_area_id(struct ospf *, | |
558 | struct in_addr); | |
559 | extern void ospf_area_add_if(struct ospf_area *, struct ospf_interface *); | |
560 | extern void ospf_area_del_if(struct ospf_area *, struct ospf_interface *); | |
561 | ||
562 | extern void ospf_interface_area_set(struct ospf *, struct interface *); | |
563 | extern void ospf_interface_area_unset(struct ospf *, struct interface *); | |
564 | extern bool ospf_interface_area_is_already_set(struct ospf *ospf, | |
565 | struct interface *ifp); | |
566 | ||
567 | extern void ospf_route_map_init(void); | |
568 | ||
569 | extern void ospf_master_init(struct thread_master *master); | |
570 | extern void ospf_vrf_init(void); | |
571 | extern void ospf_vrf_terminate(void); | |
572 | extern void ospf_vrf_link(struct ospf *ospf, struct vrf *vrf); | |
573 | extern void ospf_vrf_unlink(struct ospf *ospf, struct vrf *vrf); | |
574 | const char *ospf_vrf_id_to_name(vrf_id_t vrf_id); | |
575 | int ospf_area_nssa_no_summary_set(struct ospf *, struct in_addr); | |
576 | ||
577 | #endif /* _ZEBRA_OSPFD_H */ |