1 /* OSPF version 2 daemon program.
2 Copyright (C) 1999, 2000 Toshiaki Takada
4 This file is part of GNU Zebra.
6 GNU Zebra is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 GNU Zebra is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Zebra; see the file COPYING. If not, write to the Free
18 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
33 #include "sockunion.h" /* for inet_aton () */
37 #include "ospfd/ospfd.h"
38 #include "ospfd/ospf_network.h"
39 #include "ospfd/ospf_interface.h"
40 #include "ospfd/ospf_ism.h"
41 #include "ospfd/ospf_asbr.h"
42 #include "ospfd/ospf_lsa.h"
43 #include "ospfd/ospf_lsdb.h"
44 #include "ospfd/ospf_neighbor.h"
45 #include "ospfd/ospf_nsm.h"
46 #include "ospfd/ospf_spf.h"
47 #include "ospfd/ospf_packet.h"
48 #include "ospfd/ospf_dump.h"
49 #include "ospfd/ospf_zebra.h"
50 #include "ospfd/ospf_abr.h"
51 #include "ospfd/ospf_flood.h"
52 #include "ospfd/ospf_route.h"
53 #include "ospfd/ospf_ase.h"
57 /* OSPF process wide configuration. */
58 static struct ospf_master ospf_master
;
60 /* OSPF process wide configuration pointer to export. */
61 struct ospf_master
*om
;
63 extern struct zclient
*zclient
;
66 void ospf_remove_vls_through_area (struct ospf
*, struct ospf_area
*);
67 void ospf_network_free (struct ospf
*, struct ospf_network
*);
68 void ospf_area_free (struct ospf_area
*);
69 void ospf_network_run (struct ospf
*, struct prefix
*, struct ospf_area
*);
71 /* Get Router ID from ospf interface list. */
73 ospf_router_id_get (list if_list
)
76 struct in_addr router_id
;
78 memset (&router_id
, 0, sizeof (struct in_addr
));
80 for (node
= listhead (if_list
); node
; nextnode (node
))
82 struct ospf_interface
*oi
= getdata (node
);
84 if (!if_is_up (oi
->ifp
) ||
85 OSPF_IF_PARAM (oi
, passive_interface
) == OSPF_IF_PASSIVE
)
88 /* Ignore virtual link interface. */
89 if (oi
->type
!= OSPF_IFTYPE_VIRTUALLINK
&&
90 oi
->type
!= OSPF_IFTYPE_LOOPBACK
)
91 if (IPV4_ADDR_CMP (&router_id
, &oi
->address
->u
.prefix4
) < 0)
92 router_id
= oi
->address
->u
.prefix4
;
98 #define OSPF_EXTERNAL_LSA_ORIGINATE_DELAY 1
101 ospf_router_id_update (struct ospf
*ospf
)
103 struct in_addr router_id
, router_id_old
;
106 if (IS_DEBUG_OSPF_EVENT
)
107 zlog_info ("Router-ID[OLD:%s]: Update", inet_ntoa (ospf
->router_id
));
109 router_id_old
= ospf
->router_id
;
111 if (ospf
->router_id_static
.s_addr
!= 0)
112 router_id
= ospf
->router_id_static
;
114 router_id
= ospf_router_id_get (ospf
->oiflist
);
116 ospf
->router_id
= router_id
;
118 if (IS_DEBUG_OSPF_EVENT
)
119 zlog_info ("Router-ID[NEW:%s]: Update", inet_ntoa (ospf
->router_id
));
121 if (!IPV4_ADDR_SAME (&router_id_old
, &router_id
))
123 for (node
= listhead (ospf
->oiflist
); node
; nextnode (node
))
125 struct ospf_interface
*oi
= getdata (node
);
127 /* Update self-neighbor's router_id. */
128 oi
->nbr_self
->router_id
= router_id
;
131 /* If AS-external-LSA is queued, then flush those LSAs. */
132 if (router_id_old
.s_addr
== 0 && ospf
->external_origin
)
135 /* Originate each redistributed external route. */
136 for (type
= 0; type
< ZEBRA_ROUTE_MAX
; type
++)
137 if (ospf
->external_origin
& (1 << type
))
138 thread_add_event (master
, ospf_external_lsa_originate_timer
,
140 /* Originate Deafult. */
141 if (ospf
->external_origin
& (1 << ZEBRA_ROUTE_MAX
))
142 thread_add_event (master
, ospf_default_originate_timer
,
143 &ospf
->default_originate
, 0);
145 ospf
->external_origin
= 0;
148 OSPF_TIMER_ON (ospf
->t_router_lsa_update
,
149 ospf_router_lsa_update_timer
, OSPF_LSA_UPDATE_DELAY
);
154 ospf_router_id_update_timer (struct thread
*thread
)
156 struct ospf
*ospf
= THREAD_ARG (thread
);
158 if (IS_DEBUG_OSPF_EVENT
)
159 zlog_info ("Router-ID: Update timer fired!");
161 ospf
->t_router_id_update
= NULL
;
162 ospf_router_id_update (ospf
);
167 /* For OSPF area sort by area id. */
169 ospf_area_id_cmp (struct ospf_area
*a1
, struct ospf_area
*a2
)
171 if (ntohl (a1
->area_id
.s_addr
) > ntohl (a2
->area_id
.s_addr
))
173 if (ntohl (a1
->area_id
.s_addr
) < ntohl (a2
->area_id
.s_addr
))
178 /* Allocate new ospf structure. */
184 struct ospf
*new = XCALLOC (MTYPE_OSPF_TOP
, sizeof (struct ospf
));
186 new->router_id
.s_addr
= htonl (0);
187 new->router_id_static
.s_addr
= htonl (0);
189 new->abr_type
= OSPF_ABR_STAND
;
190 new->oiflist
= list_new ();
191 new->vlinks
= list_new ();
192 new->areas
= list_new ();
193 new->areas
->cmp
= (int (*)(void *, void *)) ospf_area_id_cmp
;
194 new->networks
= route_table_init ();
195 new->nbr_nbma
= route_table_init ();
197 new->lsdb
= ospf_lsdb_new ();
199 new->default_originate
= DEFAULT_ORIGINATE_NONE
;
201 new->new_external_route
= route_table_init ();
202 new->old_external_route
= route_table_init ();
203 new->external_lsas
= route_table_init ();
205 /* Distribute parameter init. */
206 for (i
= 0; i
<= ZEBRA_ROUTE_MAX
; i
++)
208 new->dmetric
[i
].type
= -1;
209 new->dmetric
[i
].value
= -1;
211 new->default_metric
= -1;
212 new->ref_bandwidth
= OSPF_DEFAULT_REF_BANDWIDTH
;
214 /* SPF timer value init. */
215 new->spf_delay
= OSPF_SPF_DELAY_DEFAULT
;
216 new->spf_holdtime
= OSPF_SPF_HOLDTIME_DEFAULT
;
219 new->maxage_lsa
= list_new ();
220 new->t_maxage_walker
=
221 thread_add_timer (master
, ospf_lsa_maxage_walker
,
222 new, OSPF_LSA_MAXAGE_CHECK_INTERVAL
);
224 /* Distance table init. */
225 new->distance_table
= route_table_init ();
227 new->lsa_refresh_queue
.index
= 0;
228 new->lsa_refresh_interval
= OSPF_LSA_REFRESH_INTERVAL_DEFAULT
;
229 new->t_lsa_refresher
= thread_add_timer (master
, ospf_lsa_refresh_walker
,
230 new, new->lsa_refresh_interval
);
231 new->lsa_refresher_started
= time (NULL
);
233 new->fd
= ospf_sock_init ();
235 new->t_read
= thread_add_read (master
, ospf_read
, new, new->fd
);
236 new->oi_write_q
= list_new ();
244 if (listcount (om
->ospf
) == 0)
247 return getdata (listhead (om
->ospf
));
251 ospf_add (struct ospf
*ospf
)
253 listnode_add (om
->ospf
, ospf
);
257 ospf_delete (struct ospf
*ospf
)
259 listnode_delete (om
->ospf
, ospf
);
267 ospf
= ospf_lookup ();
273 if (ospf
->router_id_static
.s_addr
== 0)
274 ospf_router_id_update (ospf
);
276 #ifdef HAVE_OPAQUE_LSA
277 ospf_opaque_type11_lsa_init (ospf
);
278 #endif /* HAVE_OPAQUE_LSA */
285 ospf_finish (struct ospf
*ospf
)
287 struct route_node
*rn
;
288 struct ospf_nbr_nbma
*nbr_nbma
;
289 struct ospf_lsa
*lsa
;
293 #ifdef HAVE_OPAQUE_LSA
294 ospf_opaque_type11_lsa_term (ospf
);
295 #endif /* HAVE_OPAQUE_LSA */
297 /* Unredister redistribution */
298 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
299 ospf_redistribute_unset (ospf
, i
);
301 for (node
= listhead (ospf
->areas
); node
;)
303 struct ospf_area
*area
= getdata (node
);
306 ospf_remove_vls_through_area (ospf
, area
);
309 for (node
= listhead (ospf
->vlinks
); node
; )
311 struct ospf_vl_data
*vl_data
= node
->data
;
314 ospf_vl_delete (ospf
, vl_data
);
317 list_delete (ospf
->vlinks
);
319 /* Reset interface. */
320 for (node
= listhead (ospf
->oiflist
); node
;)
322 struct ospf_interface
*oi
= getdata (node
);
329 /* Clear static neighbors */
330 for (rn
= route_top (ospf
->nbr_nbma
); rn
; rn
= route_next (rn
))
331 if ((nbr_nbma
= rn
->info
))
333 OSPF_POLL_TIMER_OFF (nbr_nbma
->t_poll
);
337 nbr_nbma
->nbr
->nbr_nbma
= NULL
;
338 nbr_nbma
->nbr
= NULL
;
343 listnode_delete (nbr_nbma
->oi
->nbr_nbma
, nbr_nbma
);
347 XFREE (MTYPE_OSPF_NEIGHBOR_STATIC
, nbr_nbma
);
350 route_table_finish (ospf
->nbr_nbma
);
352 /* Clear networks and Areas. */
353 for (rn
= route_top (ospf
->networks
); rn
; rn
= route_next (rn
))
355 struct ospf_network
*network
;
357 if ((network
= rn
->info
) != NULL
)
359 ospf_network_free (ospf
, network
);
361 route_unlock_node (rn
);
365 for (node
= listhead (ospf
->areas
); node
;)
367 struct ospf_area
*area
= getdata (node
);
370 listnode_delete (ospf
->areas
, area
);
371 ospf_area_free (area
);
374 /* Cancel all timers. */
375 OSPF_TIMER_OFF (ospf
->t_external_lsa
);
376 OSPF_TIMER_OFF (ospf
->t_router_id_update
);
377 OSPF_TIMER_OFF (ospf
->t_router_lsa_update
);
378 OSPF_TIMER_OFF (ospf
->t_spf_calc
);
379 OSPF_TIMER_OFF (ospf
->t_ase_calc
);
380 OSPF_TIMER_OFF (ospf
->t_maxage
);
381 OSPF_TIMER_OFF (ospf
->t_maxage_walker
);
382 OSPF_TIMER_OFF (ospf
->t_abr_task
);
383 OSPF_TIMER_OFF (ospf
->t_distribute_update
);
384 OSPF_TIMER_OFF (ospf
->t_lsa_refresher
);
385 OSPF_TIMER_OFF (ospf
->t_read
);
386 OSPF_TIMER_OFF (ospf
->t_write
);
390 #ifdef HAVE_OPAQUE_LSA
391 LSDB_LOOP (OPAQUE_AS_LSDB (ospf
), rn
, lsa
)
392 ospf_discard_from_db (ospf
, ospf
->lsdb
, lsa
);
393 #endif /* HAVE_OPAQUE_LSA */
394 LSDB_LOOP (EXTERNAL_LSDB (ospf
), rn
, lsa
)
395 ospf_discard_from_db (ospf
, ospf
->lsdb
, lsa
);
397 ospf_lsdb_delete_all (ospf
->lsdb
);
398 ospf_lsdb_free (ospf
->lsdb
);
400 for (node
= listhead (ospf
->maxage_lsa
); node
; nextnode (node
))
401 ospf_lsa_unlock (getdata (node
));
403 list_delete (ospf
->maxage_lsa
);
406 ospf_route_table_free (ospf
->old_table
);
409 ospf_route_delete (ospf
->new_table
);
410 ospf_route_table_free (ospf
->new_table
);
413 ospf_rtrs_free (ospf
->old_rtrs
);
415 ospf_rtrs_free (ospf
->new_rtrs
);
416 if (ospf
->new_external_route
)
418 ospf_route_delete (ospf
->new_external_route
);
419 ospf_route_table_free (ospf
->new_external_route
);
421 if (ospf
->old_external_route
)
423 ospf_route_delete (ospf
->old_external_route
);
424 ospf_route_table_free (ospf
->old_external_route
);
426 if (ospf
->external_lsas
)
428 ospf_ase_external_lsas_finish (ospf
->external_lsas
);
431 list_delete (ospf
->areas
);
433 for (i
= ZEBRA_ROUTE_SYSTEM
; i
<= ZEBRA_ROUTE_MAX
; i
++)
434 if (EXTERNAL_INFO (i
) != NULL
)
435 for (rn
= route_top (EXTERNAL_INFO (i
)); rn
; rn
= route_next (rn
))
437 if (rn
->info
== NULL
)
440 XFREE (MTYPE_OSPF_EXTERNAL_INFO
, rn
->info
);
442 route_unlock_node (rn
);
445 ospf_distance_reset (ospf
);
446 route_table_finish (ospf
->distance_table
);
450 XFREE (MTYPE_OSPF_TOP
, ospf
);
454 /* allocate new OSPF Area object */
456 ospf_area_new (struct ospf
*ospf
, struct in_addr area_id
)
458 struct ospf_area
*new;
460 /* Allocate new config_network. */
461 new = XCALLOC (MTYPE_OSPF_AREA
, sizeof (struct ospf_area
));
465 new->area_id
= area_id
;
467 new->external_routing
= OSPF_AREA_DEFAULT
;
468 new->default_cost
= 1;
469 new->auth_type
= OSPF_AUTH_NULL
;
472 new->lsdb
= ospf_lsdb_new ();
474 /* Self-originated LSAs initialize. */
475 new->router_lsa_self
= NULL
;
477 #ifdef HAVE_OPAQUE_LSA
478 ospf_opaque_type10_lsa_init (new);
479 #endif /* HAVE_OPAQUE_LSA */
481 new->oiflist
= list_new ();
482 new->ranges
= route_table_init ();
484 if (area_id
.s_addr
== OSPF_AREA_BACKBONE
)
485 ospf
->backbone
= new;
491 ospf_area_free (struct ospf_area
*area
)
493 struct route_node
*rn
;
494 struct ospf_lsa
*lsa
;
497 LSDB_LOOP (ROUTER_LSDB (area
), rn
, lsa
)
498 ospf_discard_from_db (area
->ospf
, area
->lsdb
, lsa
);
499 LSDB_LOOP (NETWORK_LSDB (area
), rn
, lsa
)
500 ospf_discard_from_db (area
->ospf
, area
->lsdb
, lsa
);
501 LSDB_LOOP (SUMMARY_LSDB (area
), rn
, lsa
)
502 ospf_discard_from_db (area
->ospf
, area
->lsdb
, lsa
);
503 LSDB_LOOP (ASBR_SUMMARY_LSDB (area
), rn
, lsa
)
504 ospf_discard_from_db (area
->ospf
, area
->lsdb
, lsa
);
507 LSDB_LOOP (NSSA_LSDB (area
), rn
, lsa
)
508 ospf_discard_from_db (area
->ospf
, area
->lsdb
, lsa
);
509 #endif /* HAVE_NSSA */
510 #ifdef HAVE_OPAQUE_LSA
511 LSDB_LOOP (OPAQUE_AREA_LSDB (area
), rn
, lsa
)
512 ospf_discard_from_db (area
->ospf
, area
->lsdb
, lsa
);
513 LSDB_LOOP (OPAQUE_LINK_LSDB (area
), rn
, lsa
)
514 ospf_discard_from_db (area
->ospf
, area
->lsdb
, lsa
);
515 #endif /* HAVE_OPAQUE_LSA */
517 ospf_lsdb_delete_all (area
->lsdb
);
518 ospf_lsdb_free (area
->lsdb
);
520 ospf_lsa_unlock (area
->router_lsa_self
);
522 route_table_finish (area
->ranges
);
523 list_delete (area
->oiflist
);
525 if (EXPORT_NAME (area
))
526 free (EXPORT_NAME (area
));
528 if (IMPORT_NAME (area
))
529 free (IMPORT_NAME (area
));
532 OSPF_TIMER_OFF (area
->t_router_lsa_self
);
534 if (OSPF_IS_AREA_BACKBONE (area
))
535 area
->ospf
->backbone
= NULL
;
537 XFREE (MTYPE_OSPF_AREA
, area
);
541 ospf_area_check_free (struct ospf
*ospf
, struct in_addr area_id
)
543 struct ospf_area
*area
;
545 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
547 listcount (area
->oiflist
) == 0 &&
548 area
->ranges
->top
== NULL
&&
549 area
->shortcut_configured
== OSPF_SHORTCUT_DEFAULT
&&
550 area
->external_routing
== OSPF_AREA_DEFAULT
&&
551 area
->no_summary
== 0 &&
552 area
->default_cost
== 1 &&
553 EXPORT_NAME (area
) == NULL
&&
554 IMPORT_NAME (area
) == NULL
&&
555 area
->auth_type
== OSPF_AUTH_NULL
)
557 listnode_delete (ospf
->areas
, area
);
558 ospf_area_free (area
);
563 ospf_area_get (struct ospf
*ospf
, struct in_addr area_id
, int format
)
565 struct ospf_area
*area
;
567 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
570 area
= ospf_area_new (ospf
, area_id
);
571 area
->format
= format
;
572 listnode_add_sort (ospf
->areas
, area
);
573 ospf_check_abr_status (ospf
);
580 ospf_area_lookup_by_area_id (struct ospf
*ospf
, struct in_addr area_id
)
582 struct ospf_area
*area
;
585 for (node
= listhead (ospf
->areas
); node
; nextnode (node
))
587 area
= getdata (node
);
589 if (IPV4_ADDR_SAME (&area
->area_id
, &area_id
))
597 ospf_area_add_if (struct ospf_area
*area
, struct ospf_interface
*oi
)
599 listnode_add (area
->oiflist
, oi
);
603 ospf_area_del_if (struct ospf_area
*area
, struct ospf_interface
*oi
)
605 listnode_delete (area
->oiflist
, oi
);
609 /* Config network statement related functions. */
610 struct ospf_network
*
611 ospf_network_new (struct in_addr area_id
, int format
)
613 struct ospf_network
*new;
614 new = XCALLOC (MTYPE_OSPF_NETWORK
, sizeof (struct ospf_network
));
616 new->area_id
= area_id
;
617 new->format
= format
;
623 ospf_network_free (struct ospf
*ospf
, struct ospf_network
*network
)
625 ospf_area_check_free (ospf
, network
->area_id
);
626 ospf_schedule_abr_task (ospf
);
627 XFREE (MTYPE_OSPF_NETWORK
, network
);
631 ospf_network_set (struct ospf
*ospf
, struct prefix_ipv4
*p
,
632 struct in_addr area_id
)
634 struct ospf_network
*network
;
635 struct ospf_area
*area
;
636 struct route_node
*rn
;
637 struct external_info
*ei
;
638 int ret
= OSPF_AREA_ID_FORMAT_ADDRESS
;
640 rn
= route_node_get (ospf
->networks
, (struct prefix
*)p
);
643 /* There is already same network statement. */
644 route_unlock_node (rn
);
648 rn
->info
= network
= ospf_network_new (area_id
, ret
);
649 area
= ospf_area_get (ospf
, area_id
, ret
);
651 /* Run network config now. */
652 ospf_network_run (ospf
, (struct prefix
*)p
, area
);
654 /* Update connected redistribute. */
655 if (ospf_is_type_redistributed (ZEBRA_ROUTE_CONNECT
))
656 if (EXTERNAL_INFO (ZEBRA_ROUTE_CONNECT
))
657 for (rn
= route_top (EXTERNAL_INFO (ZEBRA_ROUTE_CONNECT
));
658 rn
; rn
= route_next (rn
))
659 if ((ei
= rn
->info
) != NULL
)
660 if (ospf_external_info_find_lsa (ospf
, &ei
->p
))
661 if (!ospf_distribute_check_connected (ospf
, ei
))
662 ospf_external_lsa_flush (ospf
, ei
->type
, &ei
->p
,
663 ei
->ifindex
, ei
->nexthop
);
665 ospf_area_check_free (ospf
, area_id
);
671 ospf_network_unset (struct ospf
*ospf
, struct prefix_ipv4
*p
,
672 struct in_addr area_id
)
674 struct route_node
*rn
;
675 struct ospf_network
*network
;
676 struct external_info
*ei
;
678 rn
= route_node_lookup (ospf
->networks
, (struct prefix
*)p
);
683 if (!IPV4_ADDR_SAME (&area_id
, &network
->area_id
))
686 ospf_network_free (ospf
, rn
->info
);
688 route_unlock_node (rn
);
690 ospf_if_update (ospf
);
692 /* Update connected redistribute. */
693 if (ospf_is_type_redistributed (ZEBRA_ROUTE_CONNECT
))
694 if (EXTERNAL_INFO (ZEBRA_ROUTE_CONNECT
))
695 for (rn
= route_top (EXTERNAL_INFO (ZEBRA_ROUTE_CONNECT
));
696 rn
; rn
= route_next (rn
))
697 if ((ei
= rn
->info
) != NULL
)
698 if (!ospf_external_info_find_lsa (ospf
, &ei
->p
))
699 if (ospf_distribute_check_connected (ospf
, ei
))
700 ospf_external_lsa_originate (ospf
, ei
);
705 /* Check whether interface matches given network
706 * returns: 1, true. 0, false
709 ospf_network_match_iface(struct connected
*co
, struct prefix
*net
)
711 /* Behaviour to match both Cisco where:
712 * iface address lies within network specified -> ospf
713 * and zebra 0.9[2ish-3]:
714 * PtP special case: network specified == iface peer addr -> ospf
717 ((ifc_pointopoint (co
) &&
718 IPV4_ADDR_SAME ( &(co
->destination
->u
.prefix4
), &(net
->u
.prefix4
)))
719 || prefix_match (net
, co
->address
))
725 ospf_network_run (struct ospf
*ospf
, struct prefix
*p
, struct ospf_area
*area
)
727 struct interface
*ifp
;
730 /* Schedule Router ID Update. */
731 if (ospf
->router_id_static
.s_addr
== 0)
732 if (ospf
->t_router_id_update
== NULL
)
734 OSPF_TIMER_ON (ospf
->t_router_id_update
, ospf_router_id_update_timer
,
735 OSPF_ROUTER_ID_UPDATE_DELAY
);
738 /* Get target interface. */
739 for (node
= listhead (om
->iflist
); node
; nextnode (node
))
743 if ((ifp
= getdata (node
)) == NULL
)
746 if (memcmp (ifp
->name
, "VLINK", 5) == 0)
749 /* if interface prefix is match specified prefix,
750 then create socket and join multicast group. */
751 for (cn
= listhead (ifp
->connected
); cn
; nextnode (cn
))
753 struct connected
*co
= getdata (cn
);
756 if (CHECK_FLAG(co
->flags
,ZEBRA_IFA_SECONDARY
))
759 if (ifc_pointopoint (co
))
760 addr
= co
->destination
;
764 if (p
->family
== co
->address
->family
765 && ! ospf_if_is_configured (ospf
, &(addr
->u
.prefix4
))
766 && ospf_network_match_iface(co
,p
))
768 struct ospf_interface
*oi
;
771 oi
= ospf_if_new (ospf
, ifp
, co
->address
);
774 oi
->nbr_self
->address
= *oi
->address
;
779 oi
->params
= ospf_lookup_if_params (ifp
, oi
->address
->u
.prefix4
);
780 oi
->output_cost
= ospf_if_get_output_cost (oi
);
782 if (area
->external_routing
!= OSPF_AREA_DEFAULT
)
783 UNSET_FLAG (oi
->nbr_self
->options
, OSPF_OPTION_E
);
784 oi
->nbr_self
->priority
= OSPF_IF_PARAM (oi
, priority
);
786 /* Add pseudo neighbor. */
787 ospf_nbr_add_self (oi
);
789 /* Make sure pseudo neighbor's router_id. */
790 oi
->nbr_self
->router_id
= ospf
->router_id
;
791 oi
->nbr_self
->src
= oi
->address
->u
.prefix4
;
793 /* Relate ospf interface to ospf instance. */
796 /* update network type as interface flag */
797 /* If network type is specified previously,
798 skip network type setting. */
799 oi
->type
= IF_DEF_PARAMS (ifp
)->type
;
802 switch (area
->external_routing
)
804 case OSPF_AREA_DEFAULT
:
805 SET_FLAG (oi
->nbr_self
->options
, OSPF_OPTION_E
);
808 UNSET_FLAG (oi
->nbr_self
->options
, OSPF_OPTION_E
);
812 UNSET_FLAG (oi
->nbr_self
->options
, OSPF_OPTION_E
);
813 SET_FLAG (oi
->nbr_self
->options
, OSPF_OPTION_NP
);
815 #endif /* HAVE_NSSA */
818 ospf_area_add_if (oi
->area
, oi
);
820 if (if_is_operative (ifp
))
830 ospf_ls_upd_queue_empty (struct ospf_interface
*oi
)
832 struct route_node
*rn
;
835 struct ospf_lsa
*lsa
;
837 /* empty ls update queue */
838 for (rn
= route_top (oi
->ls_upd_queue
); rn
;
839 rn
= route_next (rn
))
840 if ((lst
= (list
) rn
->info
))
842 for (node
= listhead (lst
); node
; nextnode (node
))
843 if ((lsa
= getdata (node
)))
844 ospf_lsa_unlock (lsa
);
849 /* remove update event */
850 if (oi
->t_ls_upd_event
)
852 thread_cancel (oi
->t_ls_upd_event
);
853 oi
->t_ls_upd_event
= NULL
;
858 ospf_if_update (struct ospf
*ospf
)
860 struct route_node
*rn
;
863 struct ospf_network
*network
;
864 struct ospf_area
*area
;
868 /* Update Router ID scheduled. */
869 if (ospf
->router_id_static
.s_addr
== 0)
870 if (ospf
->t_router_id_update
== NULL
)
872 OSPF_TIMER_ON (ospf
->t_router_id_update
,
873 ospf_router_id_update_timer
,
874 OSPF_ROUTER_ID_UPDATE_DELAY
);
877 /* Find interfaces that not configured already. */
878 for (node
= listhead (ospf
->oiflist
); node
; node
= next
)
881 struct ospf_interface
*oi
= getdata (node
);
882 struct connected
*co
= oi
->connected
;
884 next
= nextnode (node
);
886 if (oi
->type
== OSPF_IFTYPE_VIRTUALLINK
)
889 for (rn
= route_top (ospf
->networks
); rn
; rn
= route_next (rn
))
891 if (rn
->info
== NULL
)
894 if (ospf_network_match_iface(co
,&rn
->p
))
897 route_unlock_node (rn
);
906 /* Run each interface. */
907 for (rn
= route_top (ospf
->networks
); rn
; rn
= route_next (rn
))
908 if (rn
->info
!= NULL
)
910 network
= (struct ospf_network
*) rn
->info
;
911 area
= ospf_area_get (ospf
, network
->area_id
, network
->format
);
912 ospf_network_run (ospf
, &rn
->p
, area
);
918 ospf_remove_vls_through_area (struct ospf
*ospf
, struct ospf_area
*area
)
921 struct ospf_vl_data
*vl_data
;
923 for (node
= listhead (ospf
->vlinks
); node
; node
= next
)
926 if ((vl_data
= getdata (node
)) != NULL
)
927 if (IPV4_ADDR_SAME (&vl_data
->vl_area_id
, &area
->area_id
))
928 ospf_vl_delete (ospf
, vl_data
);
933 struct message ospf_area_type_msg
[] =
935 { OSPF_AREA_DEFAULT
, "Default" },
936 { OSPF_AREA_STUB
, "Stub" },
937 { OSPF_AREA_NSSA
, "NSSA" },
939 int ospf_area_type_msg_max
= OSPF_AREA_TYPE_MAX
;
942 ospf_area_type_set (struct ospf_area
*area
, int type
)
945 struct ospf_interface
*oi
;
947 if (area
->external_routing
== type
)
949 if (IS_DEBUG_OSPF_EVENT
)
950 zlog_info ("Area[%s]: Types are the same, ignored.",
951 inet_ntoa (area
->area_id
));
955 area
->external_routing
= type
;
957 if (IS_DEBUG_OSPF_EVENT
)
958 zlog_info ("Area[%s]: Configured as %s", inet_ntoa (area
->area_id
),
959 LOOKUP (ospf_area_type_msg
, type
));
961 switch (area
->external_routing
)
963 case OSPF_AREA_DEFAULT
:
964 for (node
= listhead (area
->oiflist
); node
; nextnode (node
))
965 if ((oi
= getdata (node
)) != NULL
)
966 if (oi
->nbr_self
!= NULL
)
967 SET_FLAG (oi
->nbr_self
->options
, OSPF_OPTION_E
);
970 for (node
= listhead (area
->oiflist
); node
; nextnode (node
))
971 if ((oi
= getdata (node
)) != NULL
)
972 if (oi
->nbr_self
!= NULL
)
974 if (IS_DEBUG_OSPF_EVENT
)
975 zlog_info ("setting options on %s accordingly", IF_NAME (oi
));
976 UNSET_FLAG (oi
->nbr_self
->options
, OSPF_OPTION_E
);
977 if (IS_DEBUG_OSPF_EVENT
)
978 zlog_info ("options set on %s: %x",
979 IF_NAME (oi
), OPTIONS (oi
));
984 for (node
= listhead (area
->oiflist
); node
; nextnode (node
))
985 if ((oi
= getdata (node
)) != NULL
)
986 if (oi
->nbr_self
!= NULL
)
988 zlog_info ("setting nssa options on %s accordingly", IF_NAME (oi
));
989 UNSET_FLAG (oi
->nbr_self
->options
, OSPF_OPTION_E
);
990 SET_FLAG (oi
->nbr_self
->options
, OSPF_OPTION_NP
);
991 zlog_info ("options set on %s: %x", IF_NAME (oi
), OPTIONS (oi
));
993 #endif /* HAVE_NSSA */
999 ospf_router_lsa_timer_add (area
);
1000 ospf_schedule_abr_task (area
->ospf
);
1004 ospf_area_shortcut_set (struct ospf
*ospf
, struct ospf_area
*area
, int mode
)
1006 if (area
->shortcut_configured
== mode
)
1009 area
->shortcut_configured
= mode
;
1010 ospf_router_lsa_timer_add (area
);
1011 ospf_schedule_abr_task (ospf
);
1013 ospf_area_check_free (ospf
, area
->area_id
);
1019 ospf_area_shortcut_unset (struct ospf
*ospf
, struct ospf_area
*area
)
1021 area
->shortcut_configured
= OSPF_SHORTCUT_DEFAULT
;
1022 ospf_router_lsa_timer_add (area
);
1023 ospf_area_check_free (ospf
, area
->area_id
);
1024 ospf_schedule_abr_task (ospf
);
1030 ospf_area_vlink_count (struct ospf
*ospf
, struct ospf_area
*area
)
1032 struct ospf_vl_data
*vl
;
1036 for (node
= listhead (ospf
->vlinks
); node
; nextnode (node
))
1038 vl
= getdata (node
);
1039 if (IPV4_ADDR_SAME (&vl
->vl_area_id
, &area
->area_id
))
1047 ospf_area_stub_set (struct ospf
*ospf
, struct in_addr area_id
)
1049 struct ospf_area
*area
;
1050 int format
= OSPF_AREA_ID_FORMAT_ADDRESS
;
1052 area
= ospf_area_get (ospf
, area_id
, format
);
1053 if (ospf_area_vlink_count (ospf
, area
))
1056 if (area
->external_routing
!= OSPF_AREA_STUB
)
1057 ospf_area_type_set (area
, OSPF_AREA_STUB
);
1063 ospf_area_stub_unset (struct ospf
*ospf
, struct in_addr area_id
)
1065 struct ospf_area
*area
;
1067 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1071 if (area
->external_routing
== OSPF_AREA_STUB
)
1072 ospf_area_type_set (area
, OSPF_AREA_DEFAULT
);
1074 ospf_area_check_free (ospf
, area_id
);
1080 ospf_area_no_summary_set (struct ospf
*ospf
, struct in_addr area_id
)
1082 struct ospf_area
*area
;
1083 int format
= OSPF_AREA_ID_FORMAT_ADDRESS
;
1085 area
= ospf_area_get (ospf
, area_id
, format
);
1086 area
->no_summary
= 1;
1092 ospf_area_no_summary_unset (struct ospf
*ospf
, struct in_addr area_id
)
1094 struct ospf_area
*area
;
1096 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1100 area
->no_summary
= 0;
1101 ospf_area_check_free (ospf
, area_id
);
1107 ospf_area_nssa_set (struct ospf
*ospf
, struct in_addr area_id
)
1109 struct ospf_area
*area
;
1110 int format
= OSPF_AREA_ID_FORMAT_ADDRESS
;
1112 area
= ospf_area_get (ospf
, area_id
, format
);
1113 if (ospf_area_vlink_count (ospf
, area
))
1116 if (area
->external_routing
!= OSPF_AREA_NSSA
)
1118 ospf_area_type_set (area
, OSPF_AREA_NSSA
);
1126 ospf_area_nssa_unset (struct ospf
*ospf
, struct in_addr area_id
)
1128 struct ospf_area
*area
;
1130 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1134 if (area
->external_routing
== OSPF_AREA_NSSA
)
1137 ospf_area_type_set (area
, OSPF_AREA_DEFAULT
);
1140 ospf_area_check_free (ospf
, area_id
);
1146 ospf_area_nssa_translator_role_set (struct ospf
*ospf
, struct in_addr area_id
,
1149 struct ospf_area
*area
;
1151 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1155 area
->NSSATranslator
= role
;
1161 ospf_area_nssa_translator_role_unset (struct ospf
*ospf
,
1162 struct in_addr area_id
)
1164 struct ospf_area
*area
;
1166 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1170 area
->NSSATranslator
= OSPF_NSSA_ROLE_CANDIDATE
;
1172 ospf_area_check_free (ospf
, area_id
);
1178 ospf_area_export_list_set (struct ospf
*ospf
,
1179 struct ospf_area
*area
, char *list_name
)
1181 struct access_list
*list
;
1182 list
= access_list_lookup (AFI_IP
, list_name
);
1184 EXPORT_LIST (area
) = list
;
1186 if (EXPORT_NAME (area
))
1187 free (EXPORT_NAME (area
));
1189 EXPORT_NAME (area
) = strdup (list_name
);
1190 ospf_schedule_abr_task (ospf
);
1196 ospf_area_export_list_unset (struct ospf
*ospf
, struct ospf_area
* area
)
1199 EXPORT_LIST (area
) = 0;
1201 if (EXPORT_NAME (area
))
1202 free (EXPORT_NAME (area
));
1204 EXPORT_NAME (area
) = NULL
;
1206 ospf_area_check_free (ospf
, area
->area_id
);
1208 ospf_schedule_abr_task (ospf
);
1214 ospf_area_import_list_set (struct ospf
*ospf
,
1215 struct ospf_area
*area
, char *name
)
1217 struct access_list
*list
;
1218 list
= access_list_lookup (AFI_IP
, name
);
1220 IMPORT_LIST (area
) = list
;
1222 if (IMPORT_NAME (area
))
1223 free (IMPORT_NAME (area
));
1225 IMPORT_NAME (area
) = strdup (name
);
1226 ospf_schedule_abr_task (ospf
);
1232 ospf_area_import_list_unset (struct ospf
*ospf
, struct ospf_area
* area
)
1234 IMPORT_LIST (area
) = 0;
1236 if (IMPORT_NAME (area
))
1237 free (IMPORT_NAME (area
));
1239 IMPORT_NAME (area
) = NULL
;
1240 ospf_area_check_free (ospf
, area
->area_id
);
1242 ospf_schedule_abr_task (ospf
);
1248 ospf_timers_spf_set (struct ospf
*ospf
, u_int32_t delay
, u_int32_t hold
)
1250 ospf
->spf_delay
= delay
;
1251 ospf
->spf_holdtime
= hold
;
1257 ospf_timers_spf_unset (struct ospf
*ospf
)
1259 ospf
->spf_delay
= OSPF_SPF_DELAY_DEFAULT
;
1260 ospf
->spf_holdtime
= OSPF_SPF_HOLDTIME_DEFAULT
;
1266 ospf_timers_refresh_set (struct ospf
*ospf
, int interval
)
1270 if (ospf
->lsa_refresh_interval
== interval
)
1273 time_left
= ospf
->lsa_refresh_interval
-
1274 (time (NULL
) - ospf
->lsa_refresher_started
);
1276 if (time_left
> interval
)
1278 OSPF_TIMER_OFF (ospf
->t_lsa_refresher
);
1279 ospf
->t_lsa_refresher
=
1280 thread_add_timer (master
, ospf_lsa_refresh_walker
, ospf
, interval
);
1282 ospf
->lsa_refresh_interval
= interval
;
1288 ospf_timers_refresh_unset (struct ospf
*ospf
)
1292 time_left
= ospf
->lsa_refresh_interval
-
1293 (time (NULL
) - ospf
->lsa_refresher_started
);
1295 if (time_left
> OSPF_LSA_REFRESH_INTERVAL_DEFAULT
)
1297 OSPF_TIMER_OFF (ospf
->t_lsa_refresher
);
1298 ospf
->t_lsa_refresher
=
1299 thread_add_timer (master
, ospf_lsa_refresh_walker
, ospf
,
1300 OSPF_LSA_REFRESH_INTERVAL_DEFAULT
);
1303 ospf
->lsa_refresh_interval
= OSPF_LSA_REFRESH_INTERVAL_DEFAULT
;
1309 struct ospf_nbr_nbma
*
1310 ospf_nbr_nbma_new ()
1312 struct ospf_nbr_nbma
*nbr_nbma
;
1314 nbr_nbma
= XMALLOC (MTYPE_OSPF_NEIGHBOR_STATIC
,
1315 sizeof (struct ospf_nbr_nbma
));
1316 memset (nbr_nbma
, 0, sizeof (struct ospf_nbr_nbma
));
1318 nbr_nbma
->priority
= OSPF_NEIGHBOR_PRIORITY_DEFAULT
;
1319 nbr_nbma
->v_poll
= OSPF_POLL_INTERVAL_DEFAULT
;
1325 ospf_nbr_nbma_free (struct ospf_nbr_nbma
*nbr_nbma
)
1327 XFREE (MTYPE_OSPF_NEIGHBOR_STATIC
, nbr_nbma
);
1331 ospf_nbr_nbma_delete (struct ospf
*ospf
, struct ospf_nbr_nbma
*nbr_nbma
)
1333 struct route_node
*rn
;
1334 struct prefix_ipv4 p
;
1337 p
.prefix
= nbr_nbma
->addr
;
1338 p
.prefixlen
= IPV4_MAX_BITLEN
;
1340 rn
= route_node_lookup (ospf
->nbr_nbma
, (struct prefix
*)&p
);
1343 ospf_nbr_nbma_free (rn
->info
);
1345 route_unlock_node (rn
);
1346 route_unlock_node (rn
);
1351 ospf_nbr_nbma_down (struct ospf_nbr_nbma
*nbr_nbma
)
1353 OSPF_TIMER_OFF (nbr_nbma
->t_poll
);
1357 nbr_nbma
->nbr
->nbr_nbma
= NULL
;
1358 OSPF_NSM_EVENT_EXECUTE (nbr_nbma
->nbr
, NSM_KillNbr
);
1362 listnode_delete (nbr_nbma
->oi
->nbr_nbma
, nbr_nbma
);
1366 ospf_nbr_nbma_add (struct ospf_nbr_nbma
*nbr_nbma
,
1367 struct ospf_interface
*oi
)
1369 struct ospf_neighbor
*nbr
;
1370 struct route_node
*rn
;
1373 if (oi
->type
!= OSPF_IFTYPE_NBMA
)
1376 if (nbr_nbma
->nbr
!= NULL
)
1379 if (IPV4_ADDR_SAME (&oi
->nbr_self
->address
.u
.prefix4
, &nbr_nbma
->addr
))
1383 listnode_add (oi
->nbr_nbma
, nbr_nbma
);
1385 /* Get neighbor information from table. */
1387 p
.prefixlen
= IPV4_MAX_BITLEN
;
1388 p
.u
.prefix4
= nbr_nbma
->addr
;
1390 rn
= route_node_get (oi
->nbrs
, (struct prefix
*)&p
);
1394 nbr
->nbr_nbma
= nbr_nbma
;
1395 nbr_nbma
->nbr
= nbr
;
1397 route_unlock_node (rn
);
1401 nbr
= rn
->info
= ospf_nbr_new (oi
);
1402 nbr
->state
= NSM_Down
;
1403 nbr
->src
= nbr_nbma
->addr
;
1404 nbr
->nbr_nbma
= nbr_nbma
;
1405 nbr
->priority
= nbr_nbma
->priority
;
1408 nbr_nbma
->nbr
= nbr
;
1410 OSPF_NSM_EVENT_EXECUTE (nbr
, NSM_Start
);
1415 ospf_nbr_nbma_if_update (struct ospf
*ospf
, struct ospf_interface
*oi
)
1417 struct ospf_nbr_nbma
*nbr_nbma
;
1418 struct route_node
*rn
;
1419 struct prefix_ipv4 p
;
1421 if (oi
->type
!= OSPF_IFTYPE_NBMA
)
1424 for (rn
= route_top (ospf
->nbr_nbma
); rn
; rn
= route_next (rn
))
1425 if ((nbr_nbma
= rn
->info
))
1426 if (nbr_nbma
->oi
== NULL
&& nbr_nbma
->nbr
== NULL
)
1429 p
.prefix
= nbr_nbma
->addr
;
1430 p
.prefixlen
= IPV4_MAX_BITLEN
;
1432 if (prefix_match (oi
->address
, (struct prefix
*)&p
))
1433 ospf_nbr_nbma_add (nbr_nbma
, oi
);
1437 struct ospf_nbr_nbma
*
1438 ospf_nbr_nbma_lookup (struct ospf
*ospf
, struct in_addr nbr_addr
)
1440 struct route_node
*rn
;
1441 struct prefix_ipv4 p
;
1444 p
.prefix
= nbr_addr
;
1445 p
.prefixlen
= IPV4_MAX_BITLEN
;
1447 rn
= route_node_lookup (ospf
->nbr_nbma
, (struct prefix
*)&p
);
1450 route_unlock_node (rn
);
1456 struct ospf_nbr_nbma
*
1457 ospf_nbr_nbma_lookup_next (struct ospf
*ospf
, struct in_addr
*addr
, int first
)
1460 struct ospf_nbr_nbma
*nbr_nbma
;
1468 for (node
= listhead (ospf
->nbr_nbma
); node
; nextnode (node
))
1470 nbr_nbma
= getdata (node
);
1474 *addr
= nbr_nbma
->addr
;
1477 else if (ntohl (nbr_nbma
->addr
.s_addr
) > ntohl (addr
->s_addr
))
1479 *addr
= nbr_nbma
->addr
;
1488 ospf_nbr_nbma_set (struct ospf
*ospf
, struct in_addr nbr_addr
)
1490 struct ospf_nbr_nbma
*nbr_nbma
;
1491 struct ospf_interface
*oi
;
1492 struct prefix_ipv4 p
;
1493 struct route_node
*rn
;
1496 nbr_nbma
= ospf_nbr_nbma_lookup (ospf
, nbr_addr
);
1500 nbr_nbma
= ospf_nbr_nbma_new ();
1501 nbr_nbma
->addr
= nbr_addr
;
1504 p
.prefix
= nbr_addr
;
1505 p
.prefixlen
= IPV4_MAX_BITLEN
;
1507 rn
= route_node_get (ospf
->nbr_nbma
, (struct prefix
*)&p
);
1508 rn
->info
= nbr_nbma
;
1510 for (node
= listhead (ospf
->oiflist
); node
; nextnode (node
))
1512 oi
= getdata (node
);
1513 if (oi
->type
== OSPF_IFTYPE_NBMA
)
1514 if (prefix_match (oi
->address
, (struct prefix
*)&p
))
1516 ospf_nbr_nbma_add (nbr_nbma
, oi
);
1525 ospf_nbr_nbma_unset (struct ospf
*ospf
, struct in_addr nbr_addr
)
1527 struct ospf_nbr_nbma
*nbr_nbma
;
1529 nbr_nbma
= ospf_nbr_nbma_lookup (ospf
, nbr_addr
);
1530 if (nbr_nbma
== NULL
)
1533 ospf_nbr_nbma_down (nbr_nbma
);
1534 ospf_nbr_nbma_delete (ospf
, nbr_nbma
);
1540 ospf_nbr_nbma_priority_set (struct ospf
*ospf
, struct in_addr nbr_addr
,
1543 struct ospf_nbr_nbma
*nbr_nbma
;
1545 nbr_nbma
= ospf_nbr_nbma_lookup (ospf
, nbr_addr
);
1546 if (nbr_nbma
== NULL
)
1549 if (nbr_nbma
->priority
!= priority
)
1550 nbr_nbma
->priority
= priority
;
1556 ospf_nbr_nbma_priority_unset (struct ospf
*ospf
, struct in_addr nbr_addr
)
1558 struct ospf_nbr_nbma
*nbr_nbma
;
1560 nbr_nbma
= ospf_nbr_nbma_lookup (ospf
, nbr_addr
);
1561 if (nbr_nbma
== NULL
)
1564 if (nbr_nbma
!= OSPF_NEIGHBOR_PRIORITY_DEFAULT
)
1565 nbr_nbma
->priority
= OSPF_NEIGHBOR_PRIORITY_DEFAULT
;
1571 ospf_nbr_nbma_poll_interval_set (struct ospf
*ospf
, struct in_addr nbr_addr
,
1574 struct ospf_nbr_nbma
*nbr_nbma
;
1576 nbr_nbma
= ospf_nbr_nbma_lookup (ospf
, nbr_addr
);
1577 if (nbr_nbma
== NULL
)
1580 if (nbr_nbma
->v_poll
!= interval
)
1582 nbr_nbma
->v_poll
= interval
;
1583 if (nbr_nbma
->oi
&& ospf_if_is_up (nbr_nbma
->oi
))
1585 OSPF_TIMER_OFF (nbr_nbma
->t_poll
);
1586 OSPF_POLL_TIMER_ON (nbr_nbma
->t_poll
, ospf_poll_timer
,
1595 ospf_nbr_nbma_poll_interval_unset (struct ospf
*ospf
, struct in_addr addr
)
1597 struct ospf_nbr_nbma
*nbr_nbma
;
1599 nbr_nbma
= ospf_nbr_nbma_lookup (ospf
, addr
);
1600 if (nbr_nbma
== NULL
)
1603 if (nbr_nbma
->v_poll
!= OSPF_POLL_INTERVAL_DEFAULT
)
1604 nbr_nbma
->v_poll
= OSPF_POLL_INTERVAL_DEFAULT
;
1611 ospf_prefix_list_update (struct prefix_list
*plist
)
1614 struct ospf_area
*area
;
1618 /* If OSPF instatnce does not exist, return right now. */
1619 ospf
= ospf_lookup ();
1623 /* Update Area prefix-list. */
1624 for (node
= listhead (ospf
->areas
); node
; nextnode (node
))
1626 area
= getdata (node
);
1628 /* Update filter-list in. */
1629 if (PREFIX_NAME_IN (area
))
1630 if (strcmp (PREFIX_NAME_IN (area
), plist
->name
) == 0)
1632 PREFIX_LIST_IN (area
) =
1633 prefix_list_lookup (AFI_IP
, PREFIX_NAME_IN (area
));
1637 /* Update filter-list out. */
1638 if (PREFIX_NAME_OUT (area
))
1639 if (strcmp (PREFIX_NAME_OUT (area
), plist
->name
) == 0)
1641 PREFIX_LIST_IN (area
) =
1642 prefix_list_lookup (AFI_IP
, PREFIX_NAME_OUT (area
));
1647 /* Schedule ABR tasks. */
1648 if (IS_OSPF_ABR (ospf
) && abr_inv
)
1649 ospf_schedule_abr_task (ospf
);
1655 memset (&ospf_master
, 0, sizeof (struct ospf_master
));
1658 om
->ospf
= list_new ();
1659 om
->master
= thread_master_create ();
1660 om
->start_time
= time (NULL
);
1666 prefix_list_add_hook (ospf_prefix_list_update
);
1667 prefix_list_delete_hook (ospf_prefix_list_update
);