]> git.proxmox.com Git - mirror_frr.git/blame - ospfd/ospfd.h
Merge pull request #7639 from qlyoung/frr-lua
[mirror_frr.git] / ospfd / ospfd.h
CommitLineData
718e3744 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.
896014f4 11 *
718e3744 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 *
896014f4
DL
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
718e3744 20 */
21
22#ifndef _ZEBRA_OSPFD_H
23#define _ZEBRA_OSPFD_H
24
c514adc6 25#include <zebra.h>
ae19c240 26#include "qobj.h"
8551e6da 27#include "libospf.h"
132a782e 28#include "ldp_sync.h"
c514adc6 29
718e3744 30#include "filter.h"
343f5cc7 31#include "log.h"
b5a8894d 32#include "vrf.h"
718e3744 33
4a1ab8e4 34#include "ospf_memory.h"
0a3fc2a5 35#include "ospf_dump_api.h"
4a1ab8e4 36
718e3744 37#define OSPF_VERSION 2
38
718e3744 39/* VTY port number. */
40#define OSPF_VTY_PORT 2604
718e3744 41
42/* IP TTL for OSPF protocol. */
43#define OSPF_IP_TTL 1
44#define OSPF_VL_IP_TTL 100
45
46/* Default configuration file name for ospfd. */
47#define OSPF_DEFAULT_CONFIG "ospfd.conf"
48
464c8204 49#define OSPF_NSSA_TRANS_STABLE_DEFAULT 40
718e3744 50
51#define OSPF_ALLSPFROUTERS 0xe0000005 /* 224.0.0.5 */
52#define OSPF_ALLDROUTERS 0xe0000006 /* 224.0.0.6 */
53
718e3744 54/* OSPF Authentication Type. */
55#define OSPF_AUTH_NULL 0
56#define OSPF_AUTH_SIMPLE 1
57#define OSPF_AUTH_CRYPTOGRAPHIC 2
58/* For Interface authentication setting default */
59#define OSPF_AUTH_NOTSET -1
d62a17ae 60/* For the consumption and sanity of the command handler */
718e3744 61/* DO NIOT REMOVE!!! Need to detect whether a value has
62 been given or not in VLink command handlers */
63#define OSPF_AUTH_CMD_NOTSEEN -2
64
718e3744 65/* OSPF options. */
16f1b9ee 66#define OSPF_OPTION_MT 0x01 /* M/T */
718e3744 67#define OSPF_OPTION_E 0x02
68#define OSPF_OPTION_MC 0x04
69#define OSPF_OPTION_NP 0x08
70#define OSPF_OPTION_EA 0x10
71#define OSPF_OPTION_DC 0x20
72#define OSPF_OPTION_O 0x40
16f1b9ee 73#define OSPF_OPTION_DN 0x80
718e3744 74
75/* OSPF Database Description flags. */
76#define OSPF_DD_FLAG_MS 0x01
77#define OSPF_DD_FLAG_M 0x02
78#define OSPF_DD_FLAG_I 0x04
79#define OSPF_DD_FLAG_ALL 0x07
80
718e3744 81#define OSPF_LS_REFRESH_SHIFT (60 * 15)
82#define OSPF_LS_REFRESH_JITTER 60
83
d62a17ae 84struct ospf_external {
d7c0a89a 85 unsigned short instance;
d62a17ae 86 struct route_table *external_info;
7c8ff89e
DS
87};
88
020709f9 89/* OSPF master for system wide configuration and variables. */
d62a17ae 90struct ospf_master {
91 /* OSPF instance. */
92 struct list *ospf;
020709f9 93
d62a17ae 94 /* OSPF thread master. */
95 struct thread_master *master;
020709f9 96
d62a17ae 97 /* Various OSPF global configuration. */
d7c0a89a 98 uint8_t options;
32ab5cf4 99#define OSPF_MASTER_SHUTDOWN (1 << 0) /* deferred-shutdown */
020709f9 100};
101
d62a17ae 102struct ospf_redist {
d7c0a89a 103 unsigned short instance;
d62a17ae 104
105 /* Redistribute metric info. */
106 struct {
107 int type; /* External metric type (E1 or E2). */
108 int value; /* Value for static metric (24-bit).
109 -1 means metric value is not set. */
110 } dmetric;
111
112 /* For redistribute route map. */
113 struct {
114 char *name;
115 struct route_map *map;
116 } route_map; /* +1 is for default-information */
7c8ff89e
DS
117#define ROUTEMAP_NAME(R) (R->route_map.name)
118#define ROUTEMAP(R) (R->route_map.map)
119};
120
c572fbfe
DL
121/* ospf->config */
122enum {
123 OSPF_RFC1583_COMPATIBLE = (1 << 0),
124 OSPF_OPAQUE_CAPABLE = (1 << 2),
125 OSPF_LOG_ADJACENCY_CHANGES = (1 << 3),
126 OSPF_LOG_ADJACENCY_DETAIL = (1 << 4),
127};
128
718e3744 129/* OSPF instance structure. */
d62a17ae 130struct ospf {
131 /* OSPF's running state based on the '[no] router ospf [<instance>]'
132 * config. */
d7c0a89a 133 uint8_t oi_running;
0bad4851 134
d62a17ae 135 /* OSPF instance ID */
d7c0a89a 136 unsigned short instance;
7c8ff89e 137
d62a17ae 138 /* OSPF Router ID. */
139 struct in_addr router_id; /* Configured automatically. */
140 struct in_addr router_id_static; /* Configured manually. */
6021c6c0 141 struct in_addr router_id_zebra;
718e3744 142
996c9314
LB
143 vrf_id_t vrf_id; /* VRF Id */
144 char *name; /* VRF name */
b5a8894d 145
d62a17ae 146 /* ABR/ASBR internal flags. */
d7c0a89a 147 uint8_t flags;
718e3744 148#define OSPF_FLAG_ABR 0x0001
149#define OSPF_FLAG_ASBR 0x0002
150
d62a17ae 151 /* ABR type. */
d7c0a89a 152 uint8_t abr_type;
718e3744 153#define OSPF_ABR_UNKNOWN 0
154#define OSPF_ABR_STAND 1
155#define OSPF_ABR_IBM 2
156#define OSPF_ABR_CISCO 3
157#define OSPF_ABR_SHORTCUT 4
d57834f6 158#define OSPF_ABR_DEFAULT OSPF_ABR_CISCO
718e3744 159
d62a17ae 160 /* NSSA ABR */
d7c0a89a 161 uint8_t anyNSSA; /* Bump for every NSSA attached. */
718e3744 162
c572fbfe 163 /* Configuration bitmask, refer to enum above */
d7c0a89a 164 uint8_t config;
718e3744 165
d62a17ae 166 /* Opaque-LSA administrative flags. */
d7c0a89a 167 uint8_t opaque;
718e3744 168#define OPAQUE_OPERATION_READY_BIT (1 << 0)
718e3744 169
d62a17ae 170 /* RFC3137 stub router. Configured time to stay stub / max-metric */
171 unsigned int stub_router_startup_time; /* seconds */
172 unsigned int stub_router_shutdown_time; /* seconds */
88d6cf37 173#define OSPF_STUB_ROUTER_UNCONFIGURED 0
d7c0a89a 174 uint8_t stub_router_admin_set;
4ba4fc85
AB
175#define OSPF_STUB_ROUTER_ADMINISTRATIVE_SET 1
176#define OSPF_STUB_ROUTER_ADMINISTRATIVE_UNSET 0
88d6cf37 177
b4154c14
JR
178#define OSPF_STUB_MAX_METRIC_SUMMARY_COST 0x00ff0000
179
d62a17ae 180 /* LSA timers */
181 unsigned int min_ls_interval; /* minimum delay between LSAs (in msec) */
182 unsigned int min_ls_arrival; /* minimum interarrival time between LSAs
183 (in msec) */
184
185 /* SPF parameters */
186 unsigned int spf_delay; /* SPF delay time. */
187 unsigned int spf_holdtime; /* SPF hold time. */
188 unsigned int spf_max_holdtime; /* SPF maximum-holdtime */
189 unsigned int
190 spf_hold_multiplier; /* Adaptive multiplier for hold time */
191
192 int default_originate; /* Default information originate. */
718e3744 193#define DEFAULT_ORIGINATE_NONE 0
194#define DEFAULT_ORIGINATE_ZEBRA 1
195#define DEFAULT_ORIGINATE_ALWAYS 2
d7c0a89a 196 uint32_t ref_bandwidth; /* Reference Bandwidth (Kbps). */
d62a17ae 197 struct route_table *networks; /* OSPF config networks. */
198 struct list *vlinks; /* Configured Virtual-Links. */
199 struct list *areas; /* OSPF areas. */
200 struct route_table *nbr_nbma;
201 struct ospf_area *backbone; /* Pointer to the Backbone Area. */
202
203 struct list *oiflist; /* ospf interfaces */
d7c0a89a 204 uint8_t passive_interface_default; /* passive-interface default */
d62a17ae 205
206 /* LSDB of AS-external-LSAs. */
207 struct ospf_lsdb *lsdb;
208
209 /* Flags. */
d62a17ae 210 int ase_calc; /* ASE calculation flag. */
211
212 struct list *opaque_lsa_self; /* Type-11 Opaque-LSAs */
213
214 /* Routing tables. */
215 struct route_table *old_table; /* Old routing table. */
216 struct route_table *new_table; /* Current routing table. */
217
218 struct route_table *old_rtrs; /* Old ABR/ASBR RT. */
219 struct route_table *new_rtrs; /* New ABR/ASBR RT. */
220
221 struct route_table *new_external_route; /* New External Route. */
222 struct route_table *old_external_route; /* Old External Route. */
223
224 struct route_table *external_lsas; /* Database of external LSAs,
225 prefix is LSA's adv. network*/
226
227 /* Time stamps */
228 struct timeval ts_spf; /* SPF calculation time stamp. */
229 struct timeval ts_spf_duration; /* Execution time of last SPF */
230
231 struct route_table *maxage_lsa; /* List of MaxAge LSA for deletion. */
232 int redistribute; /* Num of redistributed protocols. */
233
234 /* Threads. */
235 struct thread *t_abr_task; /* ABR task timer. */
236 struct thread *t_asbr_check; /* ASBR check timer. */
237 struct thread *t_distribute_update; /* Distirbute list update timer. */
238 struct thread *t_spf_calc; /* SPF calculation timer. */
239 struct thread *t_ase_calc; /* ASE calculation timer. */
d62a17ae 240 struct thread
241 *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */
cf9b9f77 242 struct thread *t_sr_update; /* Segment Routing update timer */
d62a17ae 243
244 unsigned int maxage_delay; /* Delay on Maxage remover timer, sec */
245 struct thread *t_maxage; /* MaxAge LSA remover timer. */
246 struct thread *t_maxage_walker; /* MaxAge LSA checking timer. */
247
248 struct thread
249 *t_deferred_shutdown; /* deferred/stub-router shutdown timer*/
250
251 struct thread *t_write;
e8f45e82 252#define OSPF_WRITE_INTERFACE_COUNT_DEFAULT 20
1febb13d
S
253 struct thread *t_default_routemap_timer;
254
d62a17ae 255 int write_oi_count; /* Num of packets sent per thread invocation */
256 struct thread *t_read;
257 int fd;
258 struct stream *ibuf;
259 struct list *oi_write_q;
260
261 /* Distribute lists out of other route sources. */
262 struct {
263 char *name;
264 struct access_list *list;
265 } dlist[ZEBRA_ROUTE_MAX];
020709f9 266#define DISTRIBUTE_NAME(O,T) (O)->dlist[T].name
267#define DISTRIBUTE_LIST(O,T) (O)->dlist[T].list
718e3744 268
d62a17ae 269 /* OSPF redistribute configuration */
270 struct list *redist[ZEBRA_ROUTE_MAX + 1];
718e3744 271
d62a17ae 272 /* Redistribute tag info. */
273 route_tag_t
274 dtag[ZEBRA_ROUTE_MAX + 1]; // Pending: cant configure as of now
0d9551dc 275
d62a17ae 276 int default_metric; /* Default metric for redistribute. */
718e3744 277
278#define OSPF_LSA_REFRESHER_GRANULARITY 10
d62a17ae 279#define OSPF_LSA_REFRESHER_SLOTS \
280 ((OSPF_LS_REFRESH_TIME + OSPF_LS_REFRESH_SHIFT) \
281 / OSPF_LSA_REFRESHER_GRANULARITY \
282 + 1)
283 struct {
d7c0a89a 284 uint16_t index;
d62a17ae 285 struct list *qs[OSPF_LSA_REFRESHER_SLOTS];
286 } lsa_refresh_queue;
287
288 struct thread *t_lsa_refresher;
289 time_t lsa_refresher_started;
718e3744 290#define OSPF_LSA_REFRESH_INTERVAL_DEFAULT 10
d7c0a89a 291 uint16_t lsa_refresh_interval;
d62a17ae 292
293 /* Distance parameter. */
d7c0a89a
QY
294 uint8_t distance_all;
295 uint8_t distance_intra;
296 uint8_t distance_inter;
297 uint8_t distance_external;
d62a17ae 298
299 /* Statistics for LSA origination. */
d7c0a89a 300 uint32_t lsa_originate_count;
d62a17ae 301
302 /* Statistics for LSA used for new instantiation. */
d7c0a89a 303 uint32_t rx_lsa_count;
d62a17ae 304
aed7cc62 305 /* Counter of "ip ospf area x.x.x.x" used
d12566a1 306 * for mutual exclusion of network command under
aed7cc62 307 * router ospf or ip ospf area x under interface. */
d7c0a89a 308 uint32_t if_ospf_cli_count;
d62a17ae 309
310 struct route_table *distance_table;
311
046460a1
CS
312 /* Used during ospf instance going down send LSDB
313 * update to neighbors immediatly */
314 uint8_t inst_shutdown;
315
a92706bb
JU
316 /* Enable or disable sending proactive ARP requests. */
317 bool proactive_arp;
318#define OSPF_PROACTIVE_ARP_DEFAULT true
319
de1ac5fd
CS
320 /* Redistributed external information. */
321 struct list *external[ZEBRA_ROUTE_MAX + 1];
f96f2713 322#define EXTERNAL_INFO(E) (E->external_info)
323
324 /* Gracefull restart Helper supported configs*/
325 /* Supported grace interval*/
326 uint32_t supported_grace_time;
327
328 /* Helper support
329 * Supported : True
330 * Not Supported : False.
331 */
332 bool is_helper_supported;
333
334 /* Support for strict LSA check.
335 * if it is set,Helper aborted
336 * upon a TOPO change.
337 */
338 bool strict_lsa_check;
339
340 /* Support as HELPER only for
341 * planned restarts.
342 */
343 bool only_planned_restart;
344
345 /* This list contains the advertisement
346 * routerids which are not support for HELPERs.
347 */
348 struct hash *enable_rtr_list;
349
350 /* HELPER for number of active
351 * RESTARTERs.
352 */
353 uint16_t active_restarter_cnt;
354
355 /* last HELPER exit reason */
356 uint32_t last_exit_reason;
de1ac5fd 357
cb2bc4cb 358 /* delay timer to process external routes
359 * with summary address.
360 */
361 struct thread *t_external_aggr;
362
363 /* delay interval in seconds */
364 unsigned int aggr_delay_interval;
365
366 /* Table of configured Aggregate addresses */
367 struct route_table *rt_aggr_tbl;
368
369 /* used as argument for aggr delay
370 * timer thread.
371 */
372 int aggr_action;
373
132a782e 374 /* MPLS LDP-IGP Sync */
375 struct ldp_sync_info_cmd ldp_sync_cmd;
376
d62a17ae 377 QOBJ_FIELDS
718e3744 378};
ae19c240 379DECLARE_QOBJ_TYPE(ospf)
718e3744 380
381/* OSPF area structure. */
d62a17ae 382struct ospf_area {
383 /* OSPF instance. */
384 struct ospf *ospf;
718e3744 385
d62a17ae 386 /* Zebra interface list belonging to the area. */
387 struct list *oiflist;
718e3744 388
d62a17ae 389 /* Area ID. */
390 struct in_addr area_id;
718e3744 391
d62a17ae 392 /* Area ID format. */
393 int area_id_fmt;
86573dcb
QY
394#define OSPF_AREA_ID_FMT_DOTTEDQUAD 1
395#define OSPF_AREA_ID_FMT_DECIMAL 2
718e3744 396
d62a17ae 397 /* Address range. */
398 struct list *address_range;
718e3744 399
d62a17ae 400 /* Configured variables. */
401 int external_routing; /* ExternalRoutingCapability. */
402 int no_summary; /* Don't inject summaries into stub.*/
403 int shortcut_configured; /* Area configured as shortcut. */
718e3744 404#define OSPF_SHORTCUT_DEFAULT 0
405#define OSPF_SHORTCUT_ENABLE 1
406#define OSPF_SHORTCUT_DISABLE 2
d62a17ae 407 int shortcut_capability; /* Other ABRs agree on S-bit */
d7c0a89a 408 uint32_t default_cost; /* StubDefaultCost. */
d62a17ae 409 int auth_type; /* Authentication type. */
718e3744 410
d62a17ae 411
d7c0a89a 412 uint8_t NSSATranslatorRole; /* NSSA configured role */
718e3744 413#define OSPF_NSSA_ROLE_NEVER 0
d4a53d58 414#define OSPF_NSSA_ROLE_CANDIDATE 1
415#define OSPF_NSSA_ROLE_ALWAYS 2
d7c0a89a 416 uint8_t NSSATranslatorState; /* NSSA operational role */
d4a53d58 417#define OSPF_NSSA_TRANSLATE_DISABLED 0
418#define OSPF_NSSA_TRANSLATE_ENABLED 1
d62a17ae 419 int NSSATranslatorStabilityInterval;
420
d7c0a89a 421 uint8_t transit; /* TransitCapability. */
718e3744 422#define OSPF_TRANSIT_FALSE 0
423#define OSPF_TRANSIT_TRUE 1
d62a17ae 424 struct route_table *ranges; /* Configured Area Ranges. */
425
426 /* RFC3137 stub router state flags for area */
d7c0a89a 427 uint8_t stub_router_state;
88d6cf37 428#define OSPF_AREA_ADMIN_STUB_ROUTED (1 << 0) /* admin stub-router set */
429#define OSPF_AREA_IS_STUB_ROUTED (1 << 1) /* stub-router active */
430#define OSPF_AREA_WAS_START_STUB_ROUTED (1 << 2) /* startup SR was done */
d62a17ae 431 /* Area related LSDBs[Type1-4]. */
432 struct ospf_lsdb *lsdb;
433
434 /* Self-originated LSAs. */
435 struct ospf_lsa *router_lsa_self;
436 struct list *opaque_lsa_self; /* Type-10 Opaque-LSAs */
437
438 /* Area announce list. */
439 struct {
440 char *name;
441 struct access_list *list;
442 } _export;
dea04441
PJ
443#define EXPORT_NAME(A) (A)->_export.name
444#define EXPORT_LIST(A) (A)->_export.list
718e3744 445
d62a17ae 446 /* Area acceptance list. */
447 struct {
448 char *name;
449 struct access_list *list;
450 } import;
718e3744 451#define IMPORT_NAME(A) (A)->import.name
452#define IMPORT_LIST(A) (A)->import.list
453
d62a17ae 454 /* Type 3 LSA Area prefix-list. */
455 struct {
456 char *name;
457 struct prefix_list *list;
458 } plist_in;
718e3744 459#define PREFIX_LIST_IN(A) (A)->plist_in.list
460#define PREFIX_NAME_IN(A) (A)->plist_in.name
461
d62a17ae 462 struct {
463 char *name;
464 struct prefix_list *list;
465 } plist_out;
718e3744 466#define PREFIX_LIST_OUT(A) (A)->plist_out.list
467#define PREFIX_NAME_OUT(A) (A)->plist_out.name
468
d62a17ae 469 /* Shortest Path Tree. */
470 struct vertex *spf;
81443a28
G
471 struct list *spf_vertex_list;
472
6fc9528e
G
473 bool spf_dry_run; /* flag for checking if the SPF calculation is
474 intended for the local RIB */
475 bool spf_root_node; /* flag for checking if the calculating node is the
476 root node of the SPF tree */
718e3744 477
d62a17ae 478 /* Threads. */
479 struct thread *t_stub_router; /* Stub-router timer */
480 struct thread *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */
718e3744 481
d62a17ae 482 /* Statistics field. */
d7c0a89a 483 uint32_t spf_calculation; /* SPF Calculation Count. */
718e3744 484
d62a17ae 485 /* Time stamps. */
486 struct timeval ts_spf; /* SPF calculation time stamp. */
cf744958 487
d62a17ae 488 /* Router count. */
d7c0a89a
QY
489 uint32_t abr_count; /* ABR router in this area. */
490 uint32_t asbr_count; /* ASBR router in this area. */
718e3744 491
d62a17ae 492 /* Counters. */
d7c0a89a
QY
493 uint32_t act_ints; /* Active interfaces. */
494 uint32_t full_nbrs; /* Fully adjacent neighbors. */
495 uint32_t full_vls; /* Fully adjacent virtual neighbors. */
718e3744 496};
497
498/* OSPF config network structure. */
d62a17ae 499struct ospf_network {
500 /* Area ID. */
501 struct in_addr area_id;
502 int area_id_fmt;
718e3744 503};
504
505/* OSPF NBMA neighbor structure. */
d62a17ae 506struct ospf_nbr_nbma {
507 /* Neighbor IP address. */
508 struct in_addr addr;
718e3744 509
d62a17ae 510 /* OSPF interface. */
511 struct ospf_interface *oi;
718e3744 512
d62a17ae 513 /* OSPF neighbor structure. */
514 struct ospf_neighbor *nbr;
718e3744 515
d62a17ae 516 /* Neighbor priority. */
d7c0a89a 517 uint8_t priority;
718e3744 518
d62a17ae 519 /* Poll timer value. */
d7c0a89a 520 uint32_t v_poll;
718e3744 521
d62a17ae 522 /* Poll timer thread. */
523 struct thread *t_poll;
718e3744 524
d62a17ae 525 /* State change. */
d7c0a89a 526 uint32_t state_change;
718e3744 527};
528
529/* Macro. */
d62a17ae 530#define OSPF_AREA_SAME(X, Y) \
531 (memcmp((X->area_id), (Y->area_id), IPV4_MAX_BYTELEN) == 0)
718e3744 532
020709f9 533#define IS_OSPF_ABR(O) ((O)->flags & OSPF_FLAG_ABR)
534#define IS_OSPF_ASBR(O) ((O)->flags & OSPF_FLAG_ASBR)
718e3744 535
536#define OSPF_IS_AREA_ID_BACKBONE(I) ((I).s_addr == OSPF_AREA_BACKBONE)
537#define OSPF_IS_AREA_BACKBONE(A) OSPF_IS_AREA_ID_BACKBONE ((A)->area_id)
538
539#ifdef roundup
540# define ROUNDUP(val, gran) roundup(val, gran)
d62a17ae 541#else /* roundup */
718e3744 542# define ROUNDUP(val, gran) (((val) - 1 | (gran) - 1) + 1)
543#endif /* roundup */
544
d62a17ae 545#define LSA_OPTIONS_GET(area) \
546 (((area)->external_routing == OSPF_AREA_DEFAULT) ? OSPF_OPTION_E : 0)
547#define LSA_OPTIONS_NSSA_GET(area) \
548 (((area)->external_routing == OSPF_AREA_NSSA) ? OSPF_OPTION_NP : 0)
718e3744 549
ffa2c898
QY
550#define OSPF_TIMER_ON(T,F,V) thread_add_timer (master,(F),ospf,(V),&(T))
551#define OSPF_AREA_TIMER_ON(T,F,V) thread_add_timer (master, (F), area, (V), &(T))
552#define OSPF_POLL_TIMER_ON(T,F,V) thread_add_timer (master, (F), nbr_nbma, (V), &(T))
553#define OSPF_POLL_TIMER_OFF(X) OSPF_TIMER_OFF((X))
b3d6bc6e 554#define OSPF_TIMER_OFF(X) thread_cancel(&(X))
718e3744 555
020709f9 556/* Extern variables. */
557extern struct ospf_master *om;
7ba82f70 558extern const int ospf_redistributed_proto_max;
718e3744 559extern struct zclient *zclient;
560extern struct thread_master *master;
718e3744 561extern int ospf_zlog;
e5c25022 562extern struct zebra_privs_t ospfd_privs;
718e3744 563
564/* Prototypes. */
d7c0a89a
QY
565extern const char *ospf_redist_string(unsigned int route_type);
566extern struct ospf *ospf_lookup_instance(unsigned short);
c572fbfe
DL
567extern struct ospf *ospf_get(unsigned short instance, const char *name,
568 bool *created);
569extern struct ospf *ospf_get_instance(unsigned short, bool *created);
d7c0a89a 570extern struct ospf *ospf_lookup_by_inst_name(unsigned short instance,
b5a8894d
CS
571 const char *name);
572extern struct ospf *ospf_lookup_by_vrf_id(vrf_id_t vrf_id);
d62a17ae 573extern void ospf_finish(struct ospf *);
f91ce319 574extern void ospf_process_refresh_data(struct ospf *ospf, bool reset);
d62a17ae 575extern void ospf_router_id_update(struct ospf *ospf);
f91ce319
MR
576extern void ospf_process_reset(struct ospf *ospf);
577extern void ospf_neighbor_reset(struct ospf *ospf, struct in_addr nbr_id,
578 const char *nbr_str);
d62a17ae 579extern int ospf_network_set(struct ospf *, struct prefix_ipv4 *, struct in_addr,
580 int);
581extern int ospf_network_unset(struct ospf *, struct prefix_ipv4 *,
582 struct in_addr);
583extern int ospf_area_display_format_set(struct ospf *, struct ospf_area *area,
584 int df);
585extern int ospf_area_stub_set(struct ospf *, struct in_addr);
586extern int ospf_area_stub_unset(struct ospf *, struct in_addr);
587extern int ospf_area_no_summary_set(struct ospf *, struct in_addr);
588extern int ospf_area_no_summary_unset(struct ospf *, struct in_addr);
589extern int ospf_area_nssa_set(struct ospf *, struct in_addr);
7ef56a73 590extern int ospf_area_nssa_unset(struct ospf *, struct in_addr, int);
d62a17ae 591extern int ospf_area_nssa_translator_role_set(struct ospf *, struct in_addr,
592 int);
593extern int ospf_area_export_list_set(struct ospf *, struct ospf_area *,
594 const char *);
595extern int ospf_area_export_list_unset(struct ospf *, struct ospf_area *);
596extern int ospf_area_import_list_set(struct ospf *, struct ospf_area *,
597 const char *);
598extern int ospf_area_import_list_unset(struct ospf *, struct ospf_area *);
599extern int ospf_area_shortcut_set(struct ospf *, struct ospf_area *, int);
600extern int ospf_area_shortcut_unset(struct ospf *, struct ospf_area *);
601extern int ospf_timers_refresh_set(struct ospf *, int);
602extern int ospf_timers_refresh_unset(struct ospf *);
f91ce319 603void ospf_area_lsdb_discard_delete(struct ospf_area *area);
d62a17ae 604extern int ospf_nbr_nbma_set(struct ospf *, struct in_addr);
605extern int ospf_nbr_nbma_unset(struct ospf *, struct in_addr);
d7c0a89a 606extern int ospf_nbr_nbma_priority_set(struct ospf *, struct in_addr, uint8_t);
d62a17ae 607extern int ospf_nbr_nbma_priority_unset(struct ospf *, struct in_addr);
608extern int ospf_nbr_nbma_poll_interval_set(struct ospf *, struct in_addr,
609 unsigned int);
610extern int ospf_nbr_nbma_poll_interval_unset(struct ospf *, struct in_addr);
611extern void ospf_prefix_list_update(struct prefix_list *);
d62a17ae 612extern void ospf_if_update(struct ospf *, struct interface *);
613extern void ospf_ls_upd_queue_empty(struct ospf_interface *);
614extern void ospf_terminate(void);
615extern void ospf_nbr_nbma_if_update(struct ospf *, struct ospf_interface *);
616extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup(struct ospf *,
617 struct in_addr);
618extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup_next(struct ospf *,
619 struct in_addr *, int);
620extern int ospf_oi_count(struct interface *);
621
622extern struct ospf_area *ospf_area_get(struct ospf *, struct in_addr);
623extern void ospf_area_check_free(struct ospf *, struct in_addr);
624extern struct ospf_area *ospf_area_lookup_by_area_id(struct ospf *,
625 struct in_addr);
626extern void ospf_area_add_if(struct ospf_area *, struct ospf_interface *);
627extern void ospf_area_del_if(struct ospf_area *, struct ospf_interface *);
628
b5a8894d
CS
629extern void ospf_interface_area_set(struct ospf *, struct interface *);
630extern void ospf_interface_area_unset(struct ospf *, struct interface *);
d62a17ae 631
632extern void ospf_route_map_init(void);
633
634extern void ospf_master_init(struct thread_master *master);
b5a8894d
CS
635extern void ospf_vrf_init(void);
636extern void ospf_vrf_terminate(void);
637extern void ospf_vrf_link(struct ospf *ospf, struct vrf *vrf);
638extern void ospf_vrf_unlink(struct ospf *ospf, struct vrf *vrf);
639const char *ospf_vrf_id_to_name(vrf_id_t vrf_id);
7ef56a73
CS
640int ospf_area_nssa_no_summary_set(struct ospf *, struct in_addr);
641
88b6b28e 642const char *ospf_get_name(const struct ospf *ospf);
718e3744 643#endif /* _ZEBRA_OSPFD_H */