blob: 508f623d0347caf88c7f46ba5174f3461c652605 [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. */
Olivier Dugeon29a14012016-04-19 18:42:40 +020062#define OSPF_OPTION_MT 0x01 /* M/T */
paul718e3742002-12-13 20:15:29 +000063#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
Olivier Dugeon29a14012016-04-19 18:42:40 +020069#define OSPF_OPTION_DN 0x80
paul718e3742002-12-13 20:15:29 +000070
71/* OSPF Database Description flags. */
72#define OSPF_DD_FLAG_MS 0x01
73#define OSPF_DD_FLAG_M 0x02
74#define OSPF_DD_FLAG_I 0x04
75#define OSPF_DD_FLAG_ALL 0x07
76
paul718e3742002-12-13 20:15:29 +000077#define OSPF_LS_REFRESH_SHIFT (60 * 15)
78#define OSPF_LS_REFRESH_JITTER 60
79
paul020709f2003-04-04 02:44:16 +000080/* OSPF master for system wide configuration and variables. */
81struct ospf_master
82{
83 /* OSPF instance. */
84 struct list *ospf;
85
86 /* OSPF thread master. */
87 struct thread_master *master;
88
89 /* Zebra interface list. */
90 struct list *iflist;
91
92 /* Redistributed external information. */
93 struct route_table *external_info[ZEBRA_ROUTE_MAX + 1];
94#define EXTERNAL_INFO(T) om->external_info[T]
95
96 /* OSPF start time. */
97 time_t start_time;
98
99 /* Various OSPF global configuration. */
100 u_char options;
paulc9c93d52005-11-26 13:31:11 +0000101#define OSPF_MASTER_SHUTDOWN (1 << 0) /* deferred-shutdown */
paul020709f2003-04-04 02:44:16 +0000102};
103
paul718e3742002-12-13 20:15:29 +0000104/* OSPF instance structure. */
105struct ospf
106{
107 /* OSPF Router ID. */
108 struct in_addr router_id; /* Configured automatically. */
109 struct in_addr router_id_static; /* Configured manually. */
110
111 /* ABR/ASBR internal flags. */
112 u_char flags;
113#define OSPF_FLAG_ABR 0x0001
114#define OSPF_FLAG_ASBR 0x0002
115
116 /* ABR type. */
117 u_char abr_type;
118#define OSPF_ABR_UNKNOWN 0
119#define OSPF_ABR_STAND 1
120#define OSPF_ABR_IBM 2
121#define OSPF_ABR_CISCO 3
122#define OSPF_ABR_SHORTCUT 4
pauld57834f2005-07-12 20:04:22 +0000123#define OSPF_ABR_DEFAULT OSPF_ABR_CISCO
paul718e3742002-12-13 20:15:29 +0000124
125 /* NSSA ABR */
126 u_char anyNSSA; /* Bump for every NSSA attached. */
127
128 /* Configured variables. */
129 u_char config;
130#define OSPF_RFC1583_COMPATIBLE (1 << 0)
131#define OSPF_OPAQUE_CAPABLE (1 << 2)
Andrew J. Schorrd7e60dd2006-06-29 20:20:52 +0000132#define OSPF_LOG_ADJACENCY_CHANGES (1 << 3)
133#define OSPF_LOG_ADJACENCY_DETAIL (1 << 4)
paul718e3742002-12-13 20:15:29 +0000134
paul718e3742002-12-13 20:15:29 +0000135 /* Opaque-LSA administrative flags. */
136 u_char opaque;
137#define OPAQUE_OPERATION_READY_BIT (1 << 0)
paul718e3742002-12-13 20:15:29 +0000138
paul88d6cf32005-10-29 12:50:09 +0000139 /* RFC3137 stub router. Configured time to stay stub / max-metric */
140 unsigned int stub_router_startup_time; /* seconds */
141 unsigned int stub_router_shutdown_time; /* seconds */
142#define OSPF_STUB_ROUTER_UNCONFIGURED 0
Ayan Banerjee4ba4fc82012-12-03 11:17:24 -0800143 u_char stub_router_admin_set;
144#define OSPF_STUB_ROUTER_ADMINISTRATIVE_SET 1
145#define OSPF_STUB_ROUTER_ADMINISTRATIVE_UNSET 0
paul88d6cf32005-10-29 12:50:09 +0000146
JR Riversb4154c12012-09-24 17:26:53 +0000147#define OSPF_STUB_MAX_METRIC_SUMMARY_COST 0x00ff0000
148
Michael Rossberg2ef762e2015-07-27 07:56:25 +0200149 /* LSA timers */
150 unsigned int min_ls_interval; /* minimum delay between LSAs (in msec) */
151 unsigned int min_ls_arrival; /* minimum interarrival time between LSAs (in msec) */
152
paul88d6cf32005-10-29 12:50:09 +0000153 /* SPF parameters */
154 unsigned int spf_delay; /* SPF delay time. */
155 unsigned int spf_holdtime; /* SPF hold time. */
156 unsigned int spf_max_holdtime; /* SPF maximum-holdtime */
157 unsigned int spf_hold_multiplier; /* Adaptive multiplier for hold time */
158
paul718e3742002-12-13 20:15:29 +0000159 int default_originate; /* Default information originate. */
160#define DEFAULT_ORIGINATE_NONE 0
161#define DEFAULT_ORIGINATE_ZEBRA 1
162#define DEFAULT_ORIGINATE_ALWAYS 2
163 u_int32_t ref_bandwidth; /* Reference Bandwidth (Kbps). */
164 struct route_table *networks; /* OSPF config networks. */
hasso52dc7ee2004-09-23 19:18:23 +0000165 struct list *vlinks; /* Configured Virtual-Links. */
166 struct list *areas; /* OSPF areas. */
paul718e3742002-12-13 20:15:29 +0000167 struct route_table *nbr_nbma;
168 struct ospf_area *backbone; /* Pointer to the Backbone Area. */
169
hasso52dc7ee2004-09-23 19:18:23 +0000170 struct list *oiflist; /* ospf interfaces */
Paul Jakma7ffa8fa2006-10-22 20:07:53 +0000171 u_char passive_interface_default; /* passive-interface default */
paul718e3742002-12-13 20:15:29 +0000172
173 /* LSDB of AS-external-LSAs. */
174 struct ospf_lsdb *lsdb;
175
paul718e3742002-12-13 20:15:29 +0000176 /* Flags. */
177 int external_origin; /* AS-external-LSA origin flag. */
178 int ase_calc; /* ASE calculation flag. */
179
hasso52dc7ee2004-09-23 19:18:23 +0000180 struct list *opaque_lsa_self; /* Type-11 Opaque-LSAs */
paul718e3742002-12-13 20:15:29 +0000181
182 /* Routing tables. */
183 struct route_table *old_table; /* Old routing table. */
184 struct route_table *new_table; /* Current routing table. */
185
186 struct route_table *old_rtrs; /* Old ABR/ASBR RT. */
187 struct route_table *new_rtrs; /* New ABR/ASBR RT. */
188
189 struct route_table *new_external_route; /* New External Route. */
190 struct route_table *old_external_route; /* Old External Route. */
191
192 struct route_table *external_lsas; /* Database of external LSAs,
193 prefix is LSA's adv. network*/
194
Dinesh G Dutt50f38b32014-09-30 12:53:28 -0700195 /* Time stamps */
pauld24f6e22005-10-21 09:23:12 +0000196 struct timeval ts_spf; /* SPF calculation time stamp. */
Dinesh G Dutt50f38b32014-09-30 12:53:28 -0700197 struct timeval ts_spf_duration; /* Execution time of last SPF */
paul718e3742002-12-13 20:15:29 +0000198
Dinesh Dutt91e6a0e2012-12-04 10:46:37 -0800199 struct route_table *maxage_lsa; /* List of MaxAge LSA for deletion. */
paul718e3742002-12-13 20:15:29 +0000200 int redistribute; /* Num of redistributed protocols. */
201
202 /* Threads. */
paul718e3742002-12-13 20:15:29 +0000203 struct thread *t_abr_task; /* ABR task timer. */
204 struct thread *t_asbr_check; /* ASBR check timer. */
205 struct thread *t_distribute_update; /* Distirbute list update timer. */
206 struct thread *t_spf_calc; /* SPF calculation timer. */
207 struct thread *t_ase_calc; /* ASE calculation timer. */
208 struct thread *t_external_lsa; /* AS-external-LSA origin timer. */
paul718e3742002-12-13 20:15:29 +0000209 struct thread *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */
Paul Jakma02d942c2010-01-24 23:36:20 +0000210
Paul Jakma02d942c2010-01-24 23:36:20 +0000211 unsigned int maxage_delay; /* Delay on Maxage remover timer, sec */
paul718e3742002-12-13 20:15:29 +0000212 struct thread *t_maxage; /* MaxAge LSA remover timer. */
213 struct thread *t_maxage_walker; /* MaxAge LSA checking timer. */
Paul Jakma02d942c2010-01-24 23:36:20 +0000214
paulc9c93d52005-11-26 13:31:11 +0000215 struct thread *t_deferred_shutdown; /* deferred/stub-router shutdown timer*/
paul718e3742002-12-13 20:15:29 +0000216
217 struct thread *t_write;
218 struct thread *t_read;
219 int fd;
Andrew Certain0798cee2012-12-04 13:43:42 -0800220 unsigned int maxsndbuflen;
ajs5c333492005-02-23 15:43:01 +0000221 struct stream *ibuf;
hasso52dc7ee2004-09-23 19:18:23 +0000222 struct list *oi_write_q;
paul718e3742002-12-13 20:15:29 +0000223
224 /* Distribute lists out of other route sources. */
225 struct
226 {
227 char *name;
228 struct access_list *list;
229 } dlist[ZEBRA_ROUTE_MAX];
paul020709f2003-04-04 02:44:16 +0000230#define DISTRIBUTE_NAME(O,T) (O)->dlist[T].name
231#define DISTRIBUTE_LIST(O,T) (O)->dlist[T].list
paul718e3742002-12-13 20:15:29 +0000232
233 /* Redistribute metric info. */
234 struct
235 {
236 int type; /* External metric type (E1 or E2). */
237 int value; /* Value for static metric (24-bit).
238 -1 means metric value is not set. */
239 } dmetric [ZEBRA_ROUTE_MAX + 1];
240
241 /* For redistribute route map. */
242 struct
243 {
244 char *name;
245 struct route_map *map;
246 } route_map [ZEBRA_ROUTE_MAX + 1]; /* +1 is for default-information */
paul020709f2003-04-04 02:44:16 +0000247#define ROUTEMAP_NAME(O,T) (O)->route_map[T].name
248#define ROUTEMAP(O,T) (O)->route_map[T].map
paul718e3742002-12-13 20:15:29 +0000249
250 int default_metric; /* Default metric for redistribute. */
251
252#define OSPF_LSA_REFRESHER_GRANULARITY 10
253#define OSPF_LSA_REFRESHER_SLOTS ((OSPF_LS_REFRESH_TIME + \
254 OSPF_LS_REFRESH_SHIFT)/10 + 1)
255 struct
256 {
257 u_int16_t index;
hasso52dc7ee2004-09-23 19:18:23 +0000258 struct list *qs[OSPF_LSA_REFRESHER_SLOTS];
paul718e3742002-12-13 20:15:29 +0000259 } lsa_refresh_queue;
260
261 struct thread *t_lsa_refresher;
262 time_t lsa_refresher_started;
263#define OSPF_LSA_REFRESH_INTERVAL_DEFAULT 10
264 u_int16_t lsa_refresh_interval;
265
266 /* Distance parameter. */
267 u_char distance_all;
268 u_char distance_intra;
269 u_char distance_inter;
270 u_char distance_external;
271
272 /* Statistics for LSA origination. */
273 u_int32_t lsa_originate_count;
274
275 /* Statistics for LSA used for new instantiation. */
276 u_int32_t rx_lsa_count;
277
278 struct route_table *distance_table;
279};
280
281/* OSPF area structure. */
282struct ospf_area
283{
284 /* OSPF instance. */
paul68980082003-03-25 05:07:42 +0000285 struct ospf *ospf;
paul718e3742002-12-13 20:15:29 +0000286
287 /* Zebra interface list belonging to the area. */
hasso52dc7ee2004-09-23 19:18:23 +0000288 struct list *oiflist;
paul718e3742002-12-13 20:15:29 +0000289
290 /* Area ID. */
291 struct in_addr area_id;
292
293 /* Area ID format. */
294 char format;
295#define OSPF_AREA_ID_FORMAT_ADDRESS 1
296#define OSPF_AREA_ID_FORMAT_DECIMAL 2
297
298 /* Address range. */
hasso52dc7ee2004-09-23 19:18:23 +0000299 struct list *address_range;
paul718e3742002-12-13 20:15:29 +0000300
301 /* Configured variables. */
302 int external_routing; /* ExternalRoutingCapability. */
303#define OSPF_AREA_DEFAULT 0
304#define OSPF_AREA_STUB 1
305#define OSPF_AREA_NSSA 2
306#define OSPF_AREA_TYPE_MAX 3
307 int no_summary; /* Don't inject summaries into stub.*/
308 int shortcut_configured; /* Area configured as shortcut. */
309#define OSPF_SHORTCUT_DEFAULT 0
310#define OSPF_SHORTCUT_ENABLE 1
311#define OSPF_SHORTCUT_DISABLE 2
312 int shortcut_capability; /* Other ABRs agree on S-bit */
313 u_int32_t default_cost; /* StubDefaultCost. */
314 int auth_type; /* Authentication type. */
paul88d6cf32005-10-29 12:50:09 +0000315
paul718e3742002-12-13 20:15:29 +0000316
paul464c8202003-06-22 08:32:35 +0000317 u_char NSSATranslatorRole; /* NSSA configured role */
paul718e3742002-12-13 20:15:29 +0000318#define OSPF_NSSA_ROLE_NEVER 0
pauld4a53d52003-07-12 21:30:57 +0000319#define OSPF_NSSA_ROLE_CANDIDATE 1
320#define OSPF_NSSA_ROLE_ALWAYS 2
paul464c8202003-06-22 08:32:35 +0000321 u_char NSSATranslatorState; /* NSSA operational role */
pauld4a53d52003-07-12 21:30:57 +0000322#define OSPF_NSSA_TRANSLATE_DISABLED 0
323#define OSPF_NSSA_TRANSLATE_ENABLED 1
paul464c8202003-06-22 08:32:35 +0000324 int NSSATranslatorStabilityInterval;
325
paul718e3742002-12-13 20:15:29 +0000326 u_char transit; /* TransitCapability. */
327#define OSPF_TRANSIT_FALSE 0
328#define OSPF_TRANSIT_TRUE 1
329 struct route_table *ranges; /* Configured Area Ranges. */
paul88d6cf32005-10-29 12:50:09 +0000330
331 /* RFC3137 stub router state flags for area */
332 u_char stub_router_state;
333#define OSPF_AREA_ADMIN_STUB_ROUTED (1 << 0) /* admin stub-router set */
334#define OSPF_AREA_IS_STUB_ROUTED (1 << 1) /* stub-router active */
335#define OSPF_AREA_WAS_START_STUB_ROUTED (1 << 2) /* startup SR was done */
336
paul718e3742002-12-13 20:15:29 +0000337 /* Area related LSDBs[Type1-4]. */
338 struct ospf_lsdb *lsdb;
339
340 /* Self-originated LSAs. */
341 struct ospf_lsa *router_lsa_self;
hasso52dc7ee2004-09-23 19:18:23 +0000342 struct list *opaque_lsa_self; /* Type-10 Opaque-LSAs */
paul718e3742002-12-13 20:15:29 +0000343
344 /* Area announce list. */
345 struct
346 {
347 char *name;
348 struct access_list *list;
Paul Jakmadea04442008-02-26 09:16:09 +0000349 } _export;
350#define EXPORT_NAME(A) (A)->_export.name
351#define EXPORT_LIST(A) (A)->_export.list
paul718e3742002-12-13 20:15:29 +0000352
353 /* Area acceptance list. */
354 struct
355 {
356 char *name;
357 struct access_list *list;
358 } import;
359#define IMPORT_NAME(A) (A)->import.name
360#define IMPORT_LIST(A) (A)->import.list
361
362 /* Type 3 LSA Area prefix-list. */
363 struct
364 {
365 char *name;
366 struct prefix_list *list;
367 } plist_in;
368#define PREFIX_LIST_IN(A) (A)->plist_in.list
369#define PREFIX_NAME_IN(A) (A)->plist_in.name
370
371 struct
372 {
373 char *name;
374 struct prefix_list *list;
375 } plist_out;
376#define PREFIX_LIST_OUT(A) (A)->plist_out.list
377#define PREFIX_NAME_OUT(A) (A)->plist_out.name
378
379 /* Shortest Path Tree. */
380 struct vertex *spf;
381
382 /* Threads. */
paul88d6cf32005-10-29 12:50:09 +0000383 struct thread *t_stub_router; /* Stub-router timer */
paul718e3742002-12-13 20:15:29 +0000384 struct thread *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */
paul718e3742002-12-13 20:15:29 +0000385
386 /* Statistics field. */
387 u_int32_t spf_calculation; /* SPF Calculation Count. */
388
Dinesh G Dutt50f38b32014-09-30 12:53:28 -0700389 /* Time stamps. */
390 struct timeval ts_spf; /* SPF calculation time stamp. */
391
paul718e3742002-12-13 20:15:29 +0000392 /* Router count. */
393 u_int32_t abr_count; /* ABR router in this area. */
394 u_int32_t asbr_count; /* ASBR router in this area. */
395
396 /* Counters. */
397 u_int32_t act_ints; /* Active interfaces. */
398 u_int32_t full_nbrs; /* Fully adjacent neighbors. */
399 u_int32_t full_vls; /* Fully adjacent virtual neighbors. */
400};
401
402/* OSPF config network structure. */
403struct ospf_network
404{
405 /* Area ID. */
406 struct in_addr area_id;
407 int format;
408};
409
410/* OSPF NBMA neighbor structure. */
411struct ospf_nbr_nbma
412{
413 /* Neighbor IP address. */
414 struct in_addr addr;
415
416 /* OSPF interface. */
417 struct ospf_interface *oi;
418
419 /* OSPF neighbor structure. */
420 struct ospf_neighbor *nbr;
421
422 /* Neighbor priority. */
423 u_char priority;
424
425 /* Poll timer value. */
426 u_int32_t v_poll;
427
428 /* Poll timer thread. */
429 struct thread *t_poll;
430
431 /* State change. */
432 u_int32_t state_change;
433};
434
435/* Macro. */
436#define OSPF_AREA_SAME(X,Y) \
437 (memcmp ((X->area_id), (Y->area_id), IPV4_MAX_BYTELEN) == 0)
438
paul020709f2003-04-04 02:44:16 +0000439#define IS_OSPF_ABR(O) ((O)->flags & OSPF_FLAG_ABR)
440#define IS_OSPF_ASBR(O) ((O)->flags & OSPF_FLAG_ASBR)
paul718e3742002-12-13 20:15:29 +0000441
442#define OSPF_IS_AREA_ID_BACKBONE(I) ((I).s_addr == OSPF_AREA_BACKBONE)
443#define OSPF_IS_AREA_BACKBONE(A) OSPF_IS_AREA_ID_BACKBONE ((A)->area_id)
444
445#ifdef roundup
446# define ROUNDUP(val, gran) roundup(val, gran)
447#else /* roundup */
448# define ROUNDUP(val, gran) (((val) - 1 | (gran) - 1) + 1)
449#endif /* roundup */
450
451#define LSA_OPTIONS_GET(area) \
452 (((area)->external_routing == OSPF_AREA_DEFAULT) ? OSPF_OPTION_E : 0)
pauld4a53d52003-07-12 21:30:57 +0000453#define LSA_OPTIONS_NSSA_GET(area) \
454 (((area)->external_routing == OSPF_AREA_NSSA) ? OSPF_OPTION_NP : 0)
paul718e3742002-12-13 20:15:29 +0000455
456#define OSPF_TIMER_ON(T,F,V) \
457 do { \
458 if (!(T)) \
paul68980082003-03-25 05:07:42 +0000459 (T) = thread_add_timer (master, (F), ospf, (V)); \
paul718e3742002-12-13 20:15:29 +0000460 } while (0)
461
462#define OSPF_AREA_TIMER_ON(T,F,V) \
463 do { \
464 if (!(T)) \
465 (T) = thread_add_timer (master, (F), area, (V)); \
466 } while (0)
467
468#define OSPF_POLL_TIMER_ON(T,F,V) \
469 do { \
470 if (!(T)) \
471 (T) = thread_add_timer (master, (F), nbr_nbma, (V)); \
472 } while (0)
473
474#define OSPF_POLL_TIMER_OFF(X) OSPF_TIMER_OFF((X))
475
476#define OSPF_TIMER_OFF(X) \
477 do { \
478 if (X) \
479 { \
480 thread_cancel (X); \
481 (X) = NULL; \
482 } \
483 } while (0)
484
paul020709f2003-04-04 02:44:16 +0000485/* Extern variables. */
486extern struct ospf_master *om;
Stephen Hemminger7ba82f72009-05-15 10:47:45 -0700487extern const struct message ospf_ism_state_msg[];
488extern const struct message ospf_nsm_state_msg[];
489extern const struct message ospf_lsa_type_msg[];
490extern const struct message ospf_link_state_id_type_msg[];
491extern const struct message ospf_network_type_msg[];
492extern const int ospf_ism_state_msg_max;
493extern const int ospf_nsm_state_msg_max;
494extern const int ospf_lsa_type_msg_max;
495extern const int ospf_link_state_id_type_msg_max;
496extern const int ospf_redistributed_proto_max;
497extern const int ospf_network_type_msg_max;
paul718e3742002-12-13 20:15:29 +0000498extern struct zclient *zclient;
499extern struct thread_master *master;
paul718e3742002-12-13 20:15:29 +0000500extern int ospf_zlog;
501
502/* Prototypes. */
ajsf52d13c2005-10-01 17:38:06 +0000503extern const char *ospf_redist_string(u_int route_type);
paul4dadc292005-05-06 21:37:42 +0000504extern struct ospf *ospf_lookup (void);
505extern struct ospf *ospf_get (void);
506extern void ospf_finish (struct ospf *);
paul4dadc292005-05-06 21:37:42 +0000507extern void ospf_router_id_update (struct ospf *ospf);
paul4dadc292005-05-06 21:37:42 +0000508extern int ospf_network_set (struct ospf *, struct prefix_ipv4 *,
509 struct in_addr);
510extern int ospf_network_unset (struct ospf *, struct prefix_ipv4 *,
511 struct in_addr);
512extern int ospf_area_stub_set (struct ospf *, struct in_addr);
513extern int ospf_area_stub_unset (struct ospf *, struct in_addr);
514extern int ospf_area_no_summary_set (struct ospf *, struct in_addr);
515extern int ospf_area_no_summary_unset (struct ospf *, struct in_addr);
516extern int ospf_area_nssa_set (struct ospf *, struct in_addr);
517extern int ospf_area_nssa_unset (struct ospf *, struct in_addr);
518extern int ospf_area_nssa_translator_role_set (struct ospf *, struct in_addr,
519 int);
520extern int ospf_area_export_list_set (struct ospf *, struct ospf_area *,
521 const char *);
522extern int ospf_area_export_list_unset (struct ospf *, struct ospf_area *);
523extern int ospf_area_import_list_set (struct ospf *, struct ospf_area *,
524 const char *);
525extern int ospf_area_import_list_unset (struct ospf *, struct ospf_area *);
526extern int ospf_area_shortcut_set (struct ospf *, struct ospf_area *, int);
527extern int ospf_area_shortcut_unset (struct ospf *, struct ospf_area *);
paul4dadc292005-05-06 21:37:42 +0000528extern int ospf_timers_refresh_set (struct ospf *, int);
529extern int ospf_timers_refresh_unset (struct ospf *);
530extern int ospf_nbr_nbma_set (struct ospf *, struct in_addr);
531extern int ospf_nbr_nbma_unset (struct ospf *, struct in_addr);
532extern int ospf_nbr_nbma_priority_set (struct ospf *, struct in_addr, u_char);
533extern int ospf_nbr_nbma_priority_unset (struct ospf *, struct in_addr);
534extern int ospf_nbr_nbma_poll_interval_set (struct ospf *, struct in_addr,
535 unsigned int);
536extern int ospf_nbr_nbma_poll_interval_unset (struct ospf *, struct in_addr);
537extern void ospf_prefix_list_update (struct prefix_list *);
538extern void ospf_init (void);
Joakim Tjernlunda49eb302008-09-02 19:06:31 +0100539extern void ospf_if_update (struct ospf *, struct interface *);
paul4dadc292005-05-06 21:37:42 +0000540extern void ospf_ls_upd_queue_empty (struct ospf_interface *);
541extern void ospf_terminate (void);
542extern void ospf_nbr_nbma_if_update (struct ospf *, struct ospf_interface *);
543extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup (struct ospf *,
544 struct in_addr);
545extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup_next (struct ospf *,
546 struct in_addr *,
547 int);
548extern int ospf_oi_count (struct interface *);
paul718e3742002-12-13 20:15:29 +0000549
paul4dadc292005-05-06 21:37:42 +0000550extern struct ospf_area *ospf_area_get (struct ospf *, struct in_addr, int);
551extern void ospf_area_check_free (struct ospf *, struct in_addr);
552extern struct ospf_area *ospf_area_lookup_by_area_id (struct ospf *,
553 struct in_addr);
554extern void ospf_area_add_if (struct ospf_area *, struct ospf_interface *);
555extern void ospf_area_del_if (struct ospf_area *, struct ospf_interface *);
paul718e3742002-12-13 20:15:29 +0000556
Paul Jakma8a667cf2009-08-27 16:51:42 +0100557extern void ospf_interface_area_set (struct interface *);
558extern void ospf_interface_area_unset (struct interface *);
559
paul4dadc292005-05-06 21:37:42 +0000560extern void ospf_route_map_init (void);
561extern void ospf_snmp_init (void);
paul718e3742002-12-13 20:15:29 +0000562
paul4dadc292005-05-06 21:37:42 +0000563extern void ospf_master_init (void);
paul020709f2003-04-04 02:44:16 +0000564
paul718e3742002-12-13 20:15:29 +0000565#endif /* _ZEBRA_OSPFD_H */