blob: 06841b83cc4ce96652301552406852ca22cd04d9 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
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
18 * along with GNU Zebra; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 */
22
23#ifndef _ZEBRA_OSPFD_H
24#define _ZEBRA_OSPFD_H
25
Jeremy Jacksonc514adc2009-01-23 15:48:10 -050026#include <zebra.h>
Dinesh Dutt8551e6d2013-10-22 17:42:18 -070027#include "libospf.h"
Jeremy Jacksonc514adc2009-01-23 15:48:10 -050028
paul718e3742002-12-13 20:15:29 +000029#include "filter.h"
hasso343f5cc2005-03-25 19:48:40 +000030#include "log.h"
paul718e3742002-12-13 20:15:29 +000031
32#define OSPF_VERSION 2
33
paul718e3742002-12-13 20:15:29 +000034/* VTY port number. */
35#define OSPF_VTY_PORT 2604
paul718e3742002-12-13 20:15:29 +000036
37/* IP TTL for OSPF protocol. */
38#define OSPF_IP_TTL 1
39#define OSPF_VL_IP_TTL 100
40
41/* Default configuration file name for ospfd. */
42#define OSPF_DEFAULT_CONFIG "ospfd.conf"
43
paul464c8202003-06-22 08:32:35 +000044#define OSPF_NSSA_TRANS_STABLE_DEFAULT 40
paul718e3742002-12-13 20:15:29 +000045
46#define OSPF_ALLSPFROUTERS 0xe0000005 /* 224.0.0.5 */
47#define OSPF_ALLDROUTERS 0xe0000006 /* 224.0.0.6 */
48
paul718e3742002-12-13 20:15:29 +000049
50/* OSPF Authentication Type. */
51#define OSPF_AUTH_NULL 0
52#define OSPF_AUTH_SIMPLE 1
53#define OSPF_AUTH_CRYPTOGRAPHIC 2
54/* For Interface authentication setting default */
55#define OSPF_AUTH_NOTSET -1
56/* For the consumption and sanity of the command handler */
57/* DO NIOT REMOVE!!! Need to detect whether a value has
58 been given or not in VLink command handlers */
59#define OSPF_AUTH_CMD_NOTSEEN -2
60
paul718e3742002-12-13 20:15:29 +000061/* OSPF options. */
62#define OSPF_OPTION_T 0x01 /* TOS. */
63#define OSPF_OPTION_E 0x02
64#define OSPF_OPTION_MC 0x04
65#define OSPF_OPTION_NP 0x08
66#define OSPF_OPTION_EA 0x10
67#define OSPF_OPTION_DC 0x20
68#define OSPF_OPTION_O 0x40
69
70/* OSPF Database Description flags. */
71#define OSPF_DD_FLAG_MS 0x01
72#define OSPF_DD_FLAG_M 0x02
73#define OSPF_DD_FLAG_I 0x04
74#define OSPF_DD_FLAG_ALL 0x07
75
paul718e3742002-12-13 20:15:29 +000076#define OSPF_LS_REFRESH_SHIFT (60 * 15)
77#define OSPF_LS_REFRESH_JITTER 60
78
paul020709f2003-04-04 02:44:16 +000079/* OSPF master for system wide configuration and variables. */
80struct ospf_master
81{
82 /* OSPF instance. */
83 struct list *ospf;
84
85 /* OSPF thread master. */
86 struct thread_master *master;
87
88 /* Zebra interface list. */
89 struct list *iflist;
90
91 /* Redistributed external information. */
92 struct route_table *external_info[ZEBRA_ROUTE_MAX + 1];
93#define EXTERNAL_INFO(T) om->external_info[T]
94
95 /* OSPF start time. */
96 time_t start_time;
97
98 /* Various OSPF global configuration. */
99 u_char options;
paulc9c93d52005-11-26 13:31:11 +0000100#define OSPF_MASTER_SHUTDOWN (1 << 0) /* deferred-shutdown */
paul020709f2003-04-04 02:44:16 +0000101};
102
paul718e3742002-12-13 20:15:29 +0000103/* OSPF instance structure. */
104struct ospf
105{
106 /* OSPF Router ID. */
107 struct in_addr router_id; /* Configured automatically. */
108 struct in_addr router_id_static; /* Configured manually. */
109
110 /* ABR/ASBR internal flags. */
111 u_char flags;
112#define OSPF_FLAG_ABR 0x0001
113#define OSPF_FLAG_ASBR 0x0002
114
115 /* ABR type. */
116 u_char abr_type;
117#define OSPF_ABR_UNKNOWN 0
118#define OSPF_ABR_STAND 1
119#define OSPF_ABR_IBM 2
120#define OSPF_ABR_CISCO 3
121#define OSPF_ABR_SHORTCUT 4
pauld57834f2005-07-12 20:04:22 +0000122#define OSPF_ABR_DEFAULT OSPF_ABR_CISCO
paul718e3742002-12-13 20:15:29 +0000123
124 /* NSSA ABR */
125 u_char anyNSSA; /* Bump for every NSSA attached. */
126
127 /* Configured variables. */
128 u_char config;
129#define OSPF_RFC1583_COMPATIBLE (1 << 0)
130#define OSPF_OPAQUE_CAPABLE (1 << 2)
Andrew J. Schorrd7e60dd2006-06-29 20:20:52 +0000131#define OSPF_LOG_ADJACENCY_CHANGES (1 << 3)
132#define OSPF_LOG_ADJACENCY_DETAIL (1 << 4)
paul718e3742002-12-13 20:15:29 +0000133
134#ifdef HAVE_OPAQUE_LSA
135 /* Opaque-LSA administrative flags. */
136 u_char opaque;
137#define OPAQUE_OPERATION_READY_BIT (1 << 0)
paul718e3742002-12-13 20:15:29 +0000138#endif /* HAVE_OPAQUE_LSA */
139
paul88d6cf32005-10-29 12:50:09 +0000140 /* RFC3137 stub router. Configured time to stay stub / max-metric */
141 unsigned int stub_router_startup_time; /* seconds */
142 unsigned int stub_router_shutdown_time; /* seconds */
143#define OSPF_STUB_ROUTER_UNCONFIGURED 0
Ayan Banerjee4ba4fc82012-12-03 11:17:24 -0800144 u_char stub_router_admin_set;
145#define OSPF_STUB_ROUTER_ADMINISTRATIVE_SET 1
146#define OSPF_STUB_ROUTER_ADMINISTRATIVE_UNSET 0
paul88d6cf32005-10-29 12:50:09 +0000147
JR Riversb4154c12012-09-24 17:26:53 +0000148#define OSPF_STUB_MAX_METRIC_SUMMARY_COST 0x00ff0000
149
paul88d6cf32005-10-29 12:50:09 +0000150 /* SPF parameters */
151 unsigned int spf_delay; /* SPF delay time. */
152 unsigned int spf_holdtime; /* SPF hold time. */
153 unsigned int spf_max_holdtime; /* SPF maximum-holdtime */
154 unsigned int spf_hold_multiplier; /* Adaptive multiplier for hold time */
155
paul718e3742002-12-13 20:15:29 +0000156 int default_originate; /* Default information originate. */
157#define DEFAULT_ORIGINATE_NONE 0
158#define DEFAULT_ORIGINATE_ZEBRA 1
159#define DEFAULT_ORIGINATE_ALWAYS 2
160 u_int32_t ref_bandwidth; /* Reference Bandwidth (Kbps). */
161 struct route_table *networks; /* OSPF config networks. */
hasso52dc7ee2004-09-23 19:18:23 +0000162 struct list *vlinks; /* Configured Virtual-Links. */
163 struct list *areas; /* OSPF areas. */
paul718e3742002-12-13 20:15:29 +0000164 struct route_table *nbr_nbma;
165 struct ospf_area *backbone; /* Pointer to the Backbone Area. */
166
hasso52dc7ee2004-09-23 19:18:23 +0000167 struct list *oiflist; /* ospf interfaces */
Paul Jakma7ffa8fa2006-10-22 20:07:53 +0000168 u_char passive_interface_default; /* passive-interface default */
paul718e3742002-12-13 20:15:29 +0000169
170 /* LSDB of AS-external-LSAs. */
171 struct ospf_lsdb *lsdb;
172
paul718e3742002-12-13 20:15:29 +0000173 /* Flags. */
174 int external_origin; /* AS-external-LSA origin flag. */
175 int ase_calc; /* ASE calculation flag. */
176
177#ifdef HAVE_OPAQUE_LSA
hasso52dc7ee2004-09-23 19:18:23 +0000178 struct list *opaque_lsa_self; /* Type-11 Opaque-LSAs */
paul718e3742002-12-13 20:15:29 +0000179#endif /* HAVE_OPAQUE_LSA */
180
181 /* Routing tables. */
182 struct route_table *old_table; /* Old routing table. */
183 struct route_table *new_table; /* Current routing table. */
184
185 struct route_table *old_rtrs; /* Old ABR/ASBR RT. */
186 struct route_table *new_rtrs; /* New ABR/ASBR RT. */
187
188 struct route_table *new_external_route; /* New External Route. */
189 struct route_table *old_external_route; /* Old External Route. */
190
191 struct route_table *external_lsas; /* Database of external LSAs,
192 prefix is LSA's adv. network*/
193
Dinesh G Dutt50f38b32014-09-30 12:53:28 -0700194 /* Time stamps */
pauld24f6e22005-10-21 09:23:12 +0000195 struct timeval ts_spf; /* SPF calculation time stamp. */
Dinesh G Dutt50f38b32014-09-30 12:53:28 -0700196 struct timeval ts_spf_duration; /* Execution time of last SPF */
paul718e3742002-12-13 20:15:29 +0000197
Dinesh Dutt91e6a0e2012-12-04 10:46:37 -0800198 struct route_table *maxage_lsa; /* List of MaxAge LSA for deletion. */
paul718e3742002-12-13 20:15:29 +0000199 int redistribute; /* Num of redistributed protocols. */
200
201 /* Threads. */
paul718e3742002-12-13 20:15:29 +0000202 struct thread *t_abr_task; /* ABR task timer. */
203 struct thread *t_asbr_check; /* ASBR check timer. */
204 struct thread *t_distribute_update; /* Distirbute list update timer. */
205 struct thread *t_spf_calc; /* SPF calculation timer. */
206 struct thread *t_ase_calc; /* ASE calculation timer. */
207 struct thread *t_external_lsa; /* AS-external-LSA origin timer. */
208#ifdef HAVE_OPAQUE_LSA
209 struct thread *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */
210#endif /* HAVE_OPAQUE_LSA */
Paul Jakma02d942c2010-01-24 23:36:20 +0000211
Paul Jakma02d942c2010-01-24 23:36:20 +0000212 unsigned int maxage_delay; /* Delay on Maxage remover timer, sec */
paul718e3742002-12-13 20:15:29 +0000213 struct thread *t_maxage; /* MaxAge LSA remover timer. */
214 struct thread *t_maxage_walker; /* MaxAge LSA checking timer. */
Paul Jakma02d942c2010-01-24 23:36:20 +0000215
paulc9c93d52005-11-26 13:31:11 +0000216 struct thread *t_deferred_shutdown; /* deferred/stub-router shutdown timer*/
paul718e3742002-12-13 20:15:29 +0000217
218 struct thread *t_write;
219 struct thread *t_read;
220 int fd;
Andrew Certain0798cee2012-12-04 13:43:42 -0800221 unsigned int maxsndbuflen;
ajs5c333492005-02-23 15:43:01 +0000222 struct stream *ibuf;
hasso52dc7ee2004-09-23 19:18:23 +0000223 struct list *oi_write_q;
paul718e3742002-12-13 20:15:29 +0000224
225 /* Distribute lists out of other route sources. */
226 struct
227 {
228 char *name;
229 struct access_list *list;
230 } dlist[ZEBRA_ROUTE_MAX];
paul020709f2003-04-04 02:44:16 +0000231#define DISTRIBUTE_NAME(O,T) (O)->dlist[T].name
232#define DISTRIBUTE_LIST(O,T) (O)->dlist[T].list
paul718e3742002-12-13 20:15:29 +0000233
234 /* Redistribute metric info. */
235 struct
236 {
237 int type; /* External metric type (E1 or E2). */
238 int value; /* Value for static metric (24-bit).
239 -1 means metric value is not set. */
240 } dmetric [ZEBRA_ROUTE_MAX + 1];
241
242 /* For redistribute route map. */
243 struct
244 {
245 char *name;
246 struct route_map *map;
247 } route_map [ZEBRA_ROUTE_MAX + 1]; /* +1 is for default-information */
paul020709f2003-04-04 02:44:16 +0000248#define ROUTEMAP_NAME(O,T) (O)->route_map[T].name
249#define ROUTEMAP(O,T) (O)->route_map[T].map
paul718e3742002-12-13 20:15:29 +0000250
251 int default_metric; /* Default metric for redistribute. */
252
253#define OSPF_LSA_REFRESHER_GRANULARITY 10
254#define OSPF_LSA_REFRESHER_SLOTS ((OSPF_LS_REFRESH_TIME + \
255 OSPF_LS_REFRESH_SHIFT)/10 + 1)
256 struct
257 {
258 u_int16_t index;
hasso52dc7ee2004-09-23 19:18:23 +0000259 struct list *qs[OSPF_LSA_REFRESHER_SLOTS];
paul718e3742002-12-13 20:15:29 +0000260 } lsa_refresh_queue;
261
262 struct thread *t_lsa_refresher;
263 time_t lsa_refresher_started;
264#define OSPF_LSA_REFRESH_INTERVAL_DEFAULT 10
265 u_int16_t lsa_refresh_interval;
266
267 /* Distance parameter. */
268 u_char distance_all;
269 u_char distance_intra;
270 u_char distance_inter;
271 u_char distance_external;
272
273 /* Statistics for LSA origination. */
274 u_int32_t lsa_originate_count;
275
276 /* Statistics for LSA used for new instantiation. */
277 u_int32_t rx_lsa_count;
278
279 struct route_table *distance_table;
280};
281
282/* OSPF area structure. */
283struct ospf_area
284{
285 /* OSPF instance. */
paul68980082003-03-25 05:07:42 +0000286 struct ospf *ospf;
paul718e3742002-12-13 20:15:29 +0000287
288 /* Zebra interface list belonging to the area. */
hasso52dc7ee2004-09-23 19:18:23 +0000289 struct list *oiflist;
paul718e3742002-12-13 20:15:29 +0000290
291 /* Area ID. */
292 struct in_addr area_id;
293
294 /* Area ID format. */
295 char format;
296#define OSPF_AREA_ID_FORMAT_ADDRESS 1
297#define OSPF_AREA_ID_FORMAT_DECIMAL 2
298
299 /* Address range. */
hasso52dc7ee2004-09-23 19:18:23 +0000300 struct list *address_range;
paul718e3742002-12-13 20:15:29 +0000301
302 /* Configured variables. */
303 int external_routing; /* ExternalRoutingCapability. */
304#define OSPF_AREA_DEFAULT 0
305#define OSPF_AREA_STUB 1
306#define OSPF_AREA_NSSA 2
307#define OSPF_AREA_TYPE_MAX 3
308 int no_summary; /* Don't inject summaries into stub.*/
309 int shortcut_configured; /* Area configured as shortcut. */
310#define OSPF_SHORTCUT_DEFAULT 0
311#define OSPF_SHORTCUT_ENABLE 1
312#define OSPF_SHORTCUT_DISABLE 2
313 int shortcut_capability; /* Other ABRs agree on S-bit */
314 u_int32_t default_cost; /* StubDefaultCost. */
315 int auth_type; /* Authentication type. */
paul88d6cf32005-10-29 12:50:09 +0000316
paul718e3742002-12-13 20:15:29 +0000317
paul464c8202003-06-22 08:32:35 +0000318 u_char NSSATranslatorRole; /* NSSA configured role */
paul718e3742002-12-13 20:15:29 +0000319#define OSPF_NSSA_ROLE_NEVER 0
pauld4a53d52003-07-12 21:30:57 +0000320#define OSPF_NSSA_ROLE_CANDIDATE 1
321#define OSPF_NSSA_ROLE_ALWAYS 2
paul464c8202003-06-22 08:32:35 +0000322 u_char NSSATranslatorState; /* NSSA operational role */
pauld4a53d52003-07-12 21:30:57 +0000323#define OSPF_NSSA_TRANSLATE_DISABLED 0
324#define OSPF_NSSA_TRANSLATE_ENABLED 1
paul464c8202003-06-22 08:32:35 +0000325 int NSSATranslatorStabilityInterval;
326
paul718e3742002-12-13 20:15:29 +0000327 u_char transit; /* TransitCapability. */
328#define OSPF_TRANSIT_FALSE 0
329#define OSPF_TRANSIT_TRUE 1
330 struct route_table *ranges; /* Configured Area Ranges. */
paul88d6cf32005-10-29 12:50:09 +0000331
332 /* RFC3137 stub router state flags for area */
333 u_char stub_router_state;
334#define OSPF_AREA_ADMIN_STUB_ROUTED (1 << 0) /* admin stub-router set */
335#define OSPF_AREA_IS_STUB_ROUTED (1 << 1) /* stub-router active */
336#define OSPF_AREA_WAS_START_STUB_ROUTED (1 << 2) /* startup SR was done */
337
paul718e3742002-12-13 20:15:29 +0000338 /* Area related LSDBs[Type1-4]. */
339 struct ospf_lsdb *lsdb;
340
341 /* Self-originated LSAs. */
342 struct ospf_lsa *router_lsa_self;
343#ifdef HAVE_OPAQUE_LSA
hasso52dc7ee2004-09-23 19:18:23 +0000344 struct list *opaque_lsa_self; /* Type-10 Opaque-LSAs */
paul718e3742002-12-13 20:15:29 +0000345#endif /* HAVE_OPAQUE_LSA */
346
347 /* Area announce list. */
348 struct
349 {
350 char *name;
351 struct access_list *list;
Paul Jakmadea04442008-02-26 09:16:09 +0000352 } _export;
353#define EXPORT_NAME(A) (A)->_export.name
354#define EXPORT_LIST(A) (A)->_export.list
paul718e3742002-12-13 20:15:29 +0000355
356 /* Area acceptance list. */
357 struct
358 {
359 char *name;
360 struct access_list *list;
361 } import;
362#define IMPORT_NAME(A) (A)->import.name
363#define IMPORT_LIST(A) (A)->import.list
364
365 /* Type 3 LSA Area prefix-list. */
366 struct
367 {
368 char *name;
369 struct prefix_list *list;
370 } plist_in;
371#define PREFIX_LIST_IN(A) (A)->plist_in.list
372#define PREFIX_NAME_IN(A) (A)->plist_in.name
373
374 struct
375 {
376 char *name;
377 struct prefix_list *list;
378 } plist_out;
379#define PREFIX_LIST_OUT(A) (A)->plist_out.list
380#define PREFIX_NAME_OUT(A) (A)->plist_out.name
381
382 /* Shortest Path Tree. */
383 struct vertex *spf;
384
385 /* Threads. */
paul88d6cf32005-10-29 12:50:09 +0000386 struct thread *t_stub_router; /* Stub-router timer */
paul718e3742002-12-13 20:15:29 +0000387#ifdef HAVE_OPAQUE_LSA
388 struct thread *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */
389#endif /* HAVE_OPAQUE_LSA */
390
391 /* Statistics field. */
392 u_int32_t spf_calculation; /* SPF Calculation Count. */
393
Dinesh G Dutt50f38b32014-09-30 12:53:28 -0700394 /* Time stamps. */
395 struct timeval ts_spf; /* SPF calculation time stamp. */
396
paul718e3742002-12-13 20:15:29 +0000397 /* Router count. */
398 u_int32_t abr_count; /* ABR router in this area. */
399 u_int32_t asbr_count; /* ASBR router in this area. */
400
401 /* Counters. */
402 u_int32_t act_ints; /* Active interfaces. */
403 u_int32_t full_nbrs; /* Fully adjacent neighbors. */
404 u_int32_t full_vls; /* Fully adjacent virtual neighbors. */
405};
406
407/* OSPF config network structure. */
408struct ospf_network
409{
410 /* Area ID. */
411 struct in_addr area_id;
412 int format;
413};
414
415/* OSPF NBMA neighbor structure. */
416struct ospf_nbr_nbma
417{
418 /* Neighbor IP address. */
419 struct in_addr addr;
420
421 /* OSPF interface. */
422 struct ospf_interface *oi;
423
424 /* OSPF neighbor structure. */
425 struct ospf_neighbor *nbr;
426
427 /* Neighbor priority. */
428 u_char priority;
429
430 /* Poll timer value. */
431 u_int32_t v_poll;
432
433 /* Poll timer thread. */
434 struct thread *t_poll;
435
436 /* State change. */
437 u_int32_t state_change;
438};
439
440/* Macro. */
441#define OSPF_AREA_SAME(X,Y) \
442 (memcmp ((X->area_id), (Y->area_id), IPV4_MAX_BYTELEN) == 0)
443
paul020709f2003-04-04 02:44:16 +0000444#define IS_OSPF_ABR(O) ((O)->flags & OSPF_FLAG_ABR)
445#define IS_OSPF_ASBR(O) ((O)->flags & OSPF_FLAG_ASBR)
paul718e3742002-12-13 20:15:29 +0000446
447#define OSPF_IS_AREA_ID_BACKBONE(I) ((I).s_addr == OSPF_AREA_BACKBONE)
448#define OSPF_IS_AREA_BACKBONE(A) OSPF_IS_AREA_ID_BACKBONE ((A)->area_id)
449
450#ifdef roundup
451# define ROUNDUP(val, gran) roundup(val, gran)
452#else /* roundup */
453# define ROUNDUP(val, gran) (((val) - 1 | (gran) - 1) + 1)
454#endif /* roundup */
455
456#define LSA_OPTIONS_GET(area) \
457 (((area)->external_routing == OSPF_AREA_DEFAULT) ? OSPF_OPTION_E : 0)
pauld4a53d52003-07-12 21:30:57 +0000458#define LSA_OPTIONS_NSSA_GET(area) \
459 (((area)->external_routing == OSPF_AREA_NSSA) ? OSPF_OPTION_NP : 0)
paul718e3742002-12-13 20:15:29 +0000460
461#define OSPF_TIMER_ON(T,F,V) \
462 do { \
463 if (!(T)) \
paul68980082003-03-25 05:07:42 +0000464 (T) = thread_add_timer (master, (F), ospf, (V)); \
paul718e3742002-12-13 20:15:29 +0000465 } while (0)
466
467#define OSPF_AREA_TIMER_ON(T,F,V) \
468 do { \
469 if (!(T)) \
470 (T) = thread_add_timer (master, (F), area, (V)); \
471 } while (0)
472
473#define OSPF_POLL_TIMER_ON(T,F,V) \
474 do { \
475 if (!(T)) \
476 (T) = thread_add_timer (master, (F), nbr_nbma, (V)); \
477 } while (0)
478
479#define OSPF_POLL_TIMER_OFF(X) OSPF_TIMER_OFF((X))
480
481#define OSPF_TIMER_OFF(X) \
482 do { \
483 if (X) \
484 { \
485 thread_cancel (X); \
486 (X) = NULL; \
487 } \
488 } while (0)
489
paul020709f2003-04-04 02:44:16 +0000490/* Extern variables. */
491extern struct ospf_master *om;
Stephen Hemminger7ba82f72009-05-15 10:47:45 -0700492extern const struct message ospf_ism_state_msg[];
493extern const struct message ospf_nsm_state_msg[];
494extern const struct message ospf_lsa_type_msg[];
495extern const struct message ospf_link_state_id_type_msg[];
496extern const struct message ospf_network_type_msg[];
497extern const int ospf_ism_state_msg_max;
498extern const int ospf_nsm_state_msg_max;
499extern const int ospf_lsa_type_msg_max;
500extern const int ospf_link_state_id_type_msg_max;
501extern const int ospf_redistributed_proto_max;
502extern const int ospf_network_type_msg_max;
paul718e3742002-12-13 20:15:29 +0000503extern struct zclient *zclient;
504extern struct thread_master *master;
paul718e3742002-12-13 20:15:29 +0000505extern int ospf_zlog;
506
507/* Prototypes. */
ajsf52d13c2005-10-01 17:38:06 +0000508extern const char *ospf_redist_string(u_int route_type);
paul4dadc292005-05-06 21:37:42 +0000509extern struct ospf *ospf_lookup (void);
510extern struct ospf *ospf_get (void);
511extern void ospf_finish (struct ospf *);
paul4dadc292005-05-06 21:37:42 +0000512extern void ospf_router_id_update (struct ospf *ospf);
paul4dadc292005-05-06 21:37:42 +0000513extern int ospf_network_set (struct ospf *, struct prefix_ipv4 *,
514 struct in_addr);
515extern int ospf_network_unset (struct ospf *, struct prefix_ipv4 *,
516 struct in_addr);
517extern int ospf_area_stub_set (struct ospf *, struct in_addr);
518extern int ospf_area_stub_unset (struct ospf *, struct in_addr);
519extern int ospf_area_no_summary_set (struct ospf *, struct in_addr);
520extern int ospf_area_no_summary_unset (struct ospf *, struct in_addr);
521extern int ospf_area_nssa_set (struct ospf *, struct in_addr);
522extern int ospf_area_nssa_unset (struct ospf *, struct in_addr);
523extern int ospf_area_nssa_translator_role_set (struct ospf *, struct in_addr,
524 int);
525extern int ospf_area_export_list_set (struct ospf *, struct ospf_area *,
526 const char *);
527extern int ospf_area_export_list_unset (struct ospf *, struct ospf_area *);
528extern int ospf_area_import_list_set (struct ospf *, struct ospf_area *,
529 const char *);
530extern int ospf_area_import_list_unset (struct ospf *, struct ospf_area *);
531extern int ospf_area_shortcut_set (struct ospf *, struct ospf_area *, int);
532extern int ospf_area_shortcut_unset (struct ospf *, struct ospf_area *);
paul4dadc292005-05-06 21:37:42 +0000533extern int ospf_timers_refresh_set (struct ospf *, int);
534extern int ospf_timers_refresh_unset (struct ospf *);
535extern int ospf_nbr_nbma_set (struct ospf *, struct in_addr);
536extern int ospf_nbr_nbma_unset (struct ospf *, struct in_addr);
537extern int ospf_nbr_nbma_priority_set (struct ospf *, struct in_addr, u_char);
538extern int ospf_nbr_nbma_priority_unset (struct ospf *, struct in_addr);
539extern int ospf_nbr_nbma_poll_interval_set (struct ospf *, struct in_addr,
540 unsigned int);
541extern int ospf_nbr_nbma_poll_interval_unset (struct ospf *, struct in_addr);
542extern void ospf_prefix_list_update (struct prefix_list *);
543extern void ospf_init (void);
Joakim Tjernlunda49eb302008-09-02 19:06:31 +0100544extern void ospf_if_update (struct ospf *, struct interface *);
paul4dadc292005-05-06 21:37:42 +0000545extern void ospf_ls_upd_queue_empty (struct ospf_interface *);
546extern void ospf_terminate (void);
547extern void ospf_nbr_nbma_if_update (struct ospf *, struct ospf_interface *);
548extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup (struct ospf *,
549 struct in_addr);
550extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup_next (struct ospf *,
551 struct in_addr *,
552 int);
553extern int ospf_oi_count (struct interface *);
paul718e3742002-12-13 20:15:29 +0000554
paul4dadc292005-05-06 21:37:42 +0000555extern struct ospf_area *ospf_area_get (struct ospf *, struct in_addr, int);
556extern void ospf_area_check_free (struct ospf *, struct in_addr);
557extern struct ospf_area *ospf_area_lookup_by_area_id (struct ospf *,
558 struct in_addr);
559extern void ospf_area_add_if (struct ospf_area *, struct ospf_interface *);
560extern void ospf_area_del_if (struct ospf_area *, struct ospf_interface *);
paul718e3742002-12-13 20:15:29 +0000561
paul4dadc292005-05-06 21:37:42 +0000562extern void ospf_route_map_init (void);
563extern void ospf_snmp_init (void);
paul718e3742002-12-13 20:15:29 +0000564
paul4dadc292005-05-06 21:37:42 +0000565extern void ospf_master_init (void);
paul020709f2003-04-04 02:44:16 +0000566
paul718e3742002-12-13 20:15:29 +0000567#endif /* _ZEBRA_OSPFD_H */