2 * Zebra connect library for OSPFd
3 * Copyright (C) 1997, 98, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
5 * This file is part of GNU Zebra.
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
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.
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
39 #include "ospfd/ospfd.h"
40 #include "ospfd/ospf_interface.h"
41 #include "ospfd/ospf_ism.h"
42 #include "ospfd/ospf_asbr.h"
43 #include "ospfd/ospf_asbr.h"
44 #include "ospfd/ospf_abr.h"
45 #include "ospfd/ospf_lsa.h"
46 #include "ospfd/ospf_dump.h"
47 #include "ospfd/ospf_route.h"
48 #include "ospfd/ospf_lsdb.h"
49 #include "ospfd/ospf_neighbor.h"
50 #include "ospfd/ospf_nsm.h"
51 #include "ospfd/ospf_zebra.h"
52 #include "ospfd/ospf_te.h"
54 DEFINE_MTYPE_STATIC(OSPFD
, OSPF_EXTERNAL
, "OSPF External route table")
55 DEFINE_MTYPE_STATIC(OSPFD
, OSPF_REDISTRIBUTE
, "OSPF Redistriute")
56 DEFINE_MTYPE_STATIC(OSPFD
, OSPF_DIST_ARGS
, "OSPF Distribute arguments")
58 DEFINE_HOOK(ospf_if_update
, (struct interface
* ifp
), (ifp
))
59 DEFINE_HOOK(ospf_if_delete
, (struct interface
* ifp
), (ifp
))
61 /* Zebra structure to hold current status. */
62 struct zclient
*zclient
= NULL
;
64 /* For registering threads. */
65 extern struct thread_master
*master
;
67 /* Router-id update message from zebra. */
68 static int ospf_router_id_update_zebra(int command
, struct zclient
*zclient
,
69 zebra_size_t length
, vrf_id_t vrf_id
)
71 struct ospf
*ospf
= NULL
;
72 struct prefix router_id
;
73 zebra_router_id_update_read(zclient
->ibuf
, &router_id
);
75 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
)) {
76 char buf
[PREFIX2STR_BUFFER
];
77 prefix2str(&router_id
, buf
, sizeof(buf
));
78 zlog_debug("Zebra rcvd: router id update %s vrf %s id %u",
79 buf
, ospf_vrf_id_to_name(vrf_id
), vrf_id
);
82 ospf
= ospf_lookup_by_vrf_id(vrf_id
);
85 ospf
->router_id_zebra
= router_id
.u
.prefix4
;
86 ospf_router_id_update(ospf
);
88 if (IS_DEBUG_OSPF_EVENT
) {
89 char buf
[PREFIX2STR_BUFFER
];
91 prefix2str(&router_id
, buf
, sizeof(buf
));
92 zlog_debug("%s: ospf instance not found for vrf %s id %u router_id %s",
94 ospf_vrf_id_to_name(vrf_id
), vrf_id
, buf
);
100 /* Inteface addition message from zebra. */
101 static int ospf_interface_add(int command
, struct zclient
*zclient
,
102 zebra_size_t length
, vrf_id_t vrf_id
)
104 struct interface
*ifp
= NULL
;
105 struct ospf
*ospf
= NULL
;
107 ifp
= zebra_interface_add_read(zclient
->ibuf
, vrf_id
);
111 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
113 "Zebra: interface add %s vrf %s[%u] index %d flags %llx metric %d mtu %d",
114 ifp
->name
, ospf_vrf_id_to_name(ifp
->vrf_id
),
115 ifp
->vrf_id
, ifp
->ifindex
,
116 (unsigned long long)ifp
->flags
, ifp
->metric
, ifp
->mtu
);
120 if (!OSPF_IF_PARAM_CONFIGURED(IF_DEF_PARAMS(ifp
), type
)) {
121 SET_IF_PARAM(IF_DEF_PARAMS(ifp
), type
);
122 IF_DEF_PARAMS(ifp
)->type
= ospf_default_iftype(ifp
);
125 ospf
= ospf_lookup_by_vrf_id(vrf_id
);
129 ospf_if_update(ospf
, ifp
);
131 hook_call(ospf_if_update
, ifp
);
136 static int ospf_interface_delete(int command
, struct zclient
*zclient
,
137 zebra_size_t length
, vrf_id_t vrf_id
)
139 struct interface
*ifp
;
141 struct route_node
*rn
;
144 /* zebra_interface_state_read() updates interface structure in iflist */
145 ifp
= zebra_interface_state_read(s
, vrf_id
);
151 zlog_warn("Zebra: got delete of %s, but interface is still up",
154 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
156 "Zebra: interface delete %s vrf %s[%u] index %d flags %llx metric %d mtu %d",
157 ifp
->name
, ospf_vrf_id_to_name(ifp
->vrf_id
),
158 ifp
->vrf_id
, ifp
->ifindex
,
159 (unsigned long long)ifp
->flags
, ifp
->metric
, ifp
->mtu
);
161 hook_call(ospf_if_delete
, ifp
);
163 for (rn
= route_top(IF_OIFS(ifp
)); rn
; rn
= route_next(rn
))
165 ospf_if_free((struct ospf_interface
*)rn
->info
);
167 if_set_index(ifp
, IFINDEX_INTERNAL
);
171 static struct interface
*zebra_interface_if_lookup(struct stream
*s
,
174 char ifname_tmp
[INTERFACE_NAMSIZ
];
176 /* Read interface name. */
177 stream_get(ifname_tmp
, s
, INTERFACE_NAMSIZ
);
179 /* And look it up. */
180 return if_lookup_by_name(ifname_tmp
, vrf_id
);
183 static int ospf_interface_state_up(int command
, struct zclient
*zclient
,
184 zebra_size_t length
, vrf_id_t vrf_id
)
186 struct interface
*ifp
;
187 struct ospf_interface
*oi
;
188 struct route_node
*rn
;
190 ifp
= zebra_interface_if_lookup(zclient
->ibuf
, vrf_id
);
195 /* Interface is already up. */
196 if (if_is_operative(ifp
)) {
197 /* Temporarily keep ifp values. */
198 struct interface if_tmp
;
199 memcpy(&if_tmp
, ifp
, sizeof(struct interface
));
201 zebra_interface_if_set_value(zclient
->ibuf
, ifp
);
203 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
205 "Zebra: Interface[%s] state update speed %u -> %u, bw %d -> %d",
206 ifp
->name
, if_tmp
.speed
, ifp
->speed
,
207 if_tmp
.bandwidth
, ifp
->bandwidth
);
209 ospf_if_recalculate_output_cost(ifp
);
211 if (if_tmp
.mtu
!= ifp
->mtu
) {
212 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
214 "Zebra: Interface[%s] MTU change %u -> %u.",
215 ifp
->name
, if_tmp
.mtu
, ifp
->mtu
);
217 /* Must reset the interface (simulate down/up) when MTU
224 zebra_interface_if_set_value(zclient
->ibuf
, ifp
);
226 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
227 zlog_debug("Zebra: Interface[%s] state change to up.",
230 for (rn
= route_top(IF_OIFS(ifp
)); rn
; rn
= route_next(rn
)) {
231 if ((oi
= rn
->info
) == NULL
)
240 static int ospf_interface_state_down(int command
, struct zclient
*zclient
,
241 zebra_size_t length
, vrf_id_t vrf_id
)
243 struct interface
*ifp
;
244 struct ospf_interface
*oi
;
245 struct route_node
*node
;
247 ifp
= zebra_interface_state_read(zclient
->ibuf
, vrf_id
);
252 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
253 zlog_debug("Zebra: Interface[%s] state change to down.",
256 for (node
= route_top(IF_OIFS(ifp
)); node
; node
= route_next(node
)) {
257 if ((oi
= node
->info
) == NULL
)
265 static int ospf_interface_address_add(int command
, struct zclient
*zclient
,
266 zebra_size_t length
, vrf_id_t vrf_id
)
269 struct ospf
*ospf
= NULL
;
272 c
= zebra_interface_address_read(command
, zclient
->ibuf
, vrf_id
);
277 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
)) {
278 char buf
[PREFIX2STR_BUFFER
];
279 prefix2str(c
->address
, buf
, sizeof(buf
));
280 zlog_debug("Zebra: interface %s address add %s vrf %s id %u",
281 c
->ifp
->name
, buf
, ospf_vrf_id_to_name(vrf_id
),
285 ospf
= ospf_lookup_by_vrf_id(vrf_id
);
289 ospf_if_update(ospf
, c
->ifp
);
291 hook_call(ospf_if_update
, c
->ifp
);
296 static int ospf_interface_address_delete(int command
, struct zclient
*zclient
,
297 zebra_size_t length
, vrf_id_t vrf_id
)
300 struct interface
*ifp
;
301 struct ospf_interface
*oi
;
302 struct route_node
*rn
;
305 c
= zebra_interface_address_read(command
, zclient
->ibuf
, vrf_id
);
310 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
)) {
311 char buf
[PREFIX2STR_BUFFER
];
312 prefix2str(c
->address
, buf
, sizeof(buf
));
313 zlog_debug("Zebra: interface %s address delete %s",
319 p
.prefixlen
= IPV4_MAX_PREFIXLEN
;
321 rn
= route_node_lookup(IF_OIFS(ifp
), &p
);
329 route_unlock_node(rn
);
331 /* Call interface hook functions to clean up */
334 hook_call(ospf_if_update
, c
->ifp
);
341 static int ospf_interface_link_params(int command
, struct zclient
*zclient
,
344 struct interface
*ifp
;
346 ifp
= zebra_interface_link_params_read(zclient
->ibuf
);
352 ospf_mpls_te_update_if(ifp
);
357 /* VRF update for an interface. */
358 static int ospf_interface_vrf_update(int command
, struct zclient
*zclient
,
359 zebra_size_t length
, vrf_id_t vrf_id
)
361 struct interface
*ifp
= NULL
;
364 ifp
= zebra_interface_vrf_update_read(zclient
->ibuf
, vrf_id
,
369 if (IS_DEBUG_OSPF_EVENT
)
370 zlog_debug("%s: Rx Interface %s VRF change vrf_id %u New vrf %s id %u",
371 __PRETTY_FUNCTION__
, ifp
->name
, vrf_id
,
372 ospf_vrf_id_to_name(new_vrf_id
), new_vrf_id
);
374 /*if_update(ifp, ifp->name, strlen(ifp->name), new_vrf_id);*/
375 if_update_to_new_vrf(ifp
, new_vrf_id
);
380 void ospf_zebra_add(struct ospf
*ospf
, struct prefix_ipv4
*p
,
381 struct ospf_route
*or)
383 struct zapi_route api
;
384 struct zapi_nexthop
*api_nh
;
386 struct ospf_path
*path
;
387 struct listnode
*node
;
390 memset(&api
, 0, sizeof(api
));
391 api
.vrf_id
= ospf
->vrf_id
;
392 api
.type
= ZEBRA_ROUTE_OSPF
;
393 api
.instance
= ospf
->instance
;
394 api
.safi
= SAFI_UNICAST
;
396 memcpy(&api
.prefix
, p
, sizeof(*p
));
397 SET_FLAG(api
.message
, ZAPI_MESSAGE_NEXTHOP
);
400 SET_FLAG(api
.message
, ZAPI_MESSAGE_METRIC
);
401 if (or->path_type
== OSPF_PATH_TYPE1_EXTERNAL
)
402 api
.metric
= or->cost
+ or->u
.ext
.type2_cost
;
403 else if (or->path_type
== OSPF_PATH_TYPE2_EXTERNAL
)
404 api
.metric
= or->u
.ext
.type2_cost
;
406 api
.metric
= or->cost
;
408 /* Check if path type is ASE */
409 if (((or->path_type
== OSPF_PATH_TYPE1_EXTERNAL
)
410 || (or->path_type
== OSPF_PATH_TYPE2_EXTERNAL
))
411 && (or->u
.ext
.tag
> 0) && (or->u
.ext
.tag
<= ROUTE_TAG_MAX
)) {
412 SET_FLAG(api
.message
, ZAPI_MESSAGE_TAG
);
413 api
.tag
= or->u
.ext
.tag
;
416 /* Distance value. */
417 distance
= ospf_distance_apply(ospf
, p
, or);
419 SET_FLAG(api
.message
, ZAPI_MESSAGE_DISTANCE
);
420 api
.distance
= distance
;
423 /* Nexthop, ifindex, distance and metric information. */
424 for (ALL_LIST_ELEMENTS_RO(or->paths
, node
, path
)) {
425 if (count
>= MULTIPATH_NUM
)
427 api_nh
= &api
.nexthops
[count
];
429 if (path
->unnumbered
|| (path
->nexthop
.s_addr
!= INADDR_ANY
430 && path
->ifindex
!= 0)) {
431 #else /* HAVE_NETLINK */
432 if (path
->nexthop
.s_addr
!= INADDR_ANY
&& path
->ifindex
!= 0) {
433 #endif /* HAVE_NETLINK */
434 api_nh
->gate
.ipv4
= path
->nexthop
;
435 api_nh
->ifindex
= path
->ifindex
;
436 api_nh
->type
= NEXTHOP_TYPE_IPV4_IFINDEX
;
437 } else if (path
->nexthop
.s_addr
!= INADDR_ANY
) {
438 api_nh
->gate
.ipv4
= path
->nexthop
;
439 api_nh
->type
= NEXTHOP_TYPE_IPV4
;
441 api_nh
->ifindex
= path
->ifindex
;
442 api_nh
->type
= NEXTHOP_TYPE_IFINDEX
;
446 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
)) {
447 char buf
[2][INET_ADDRSTRLEN
];
449 "Zebra: Route add %s/%d nexthop %s, ifindex=%d",
450 inet_ntop(AF_INET
, &p
->prefix
, buf
[0],
452 p
->prefixlen
, inet_ntop(AF_INET
, &path
->nexthop
,
453 buf
[1], sizeof(buf
[1])),
457 api
.nexthop_num
= count
;
459 zclient_route_send(ZEBRA_ROUTE_ADD
, zclient
, &api
);
462 void ospf_zebra_delete(struct ospf
*ospf
, struct prefix_ipv4
*p
,
463 struct ospf_route
*or)
465 struct zapi_route api
;
467 memset(&api
, 0, sizeof(api
));
468 api
.vrf_id
= ospf
->vrf_id
;
469 api
.type
= ZEBRA_ROUTE_OSPF
;
470 api
.instance
= ospf
->instance
;
471 api
.safi
= SAFI_UNICAST
;
472 memcpy(&api
.prefix
, p
, sizeof(*p
));
474 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
)) {
475 char buf
[INET_ADDRSTRLEN
];
476 zlog_debug("Zebra: Route delete %s/%d",
477 inet_ntop(AF_INET
, &p
->prefix
, buf
, sizeof(buf
[0])),
481 zclient_route_send(ZEBRA_ROUTE_DELETE
, zclient
, &api
);
484 void ospf_zebra_add_discard(struct ospf
*ospf
, struct prefix_ipv4
*p
)
486 struct zapi_route api
;
488 memset(&api
, 0, sizeof(api
));
489 api
.vrf_id
= ospf
->vrf_id
;
490 api
.type
= ZEBRA_ROUTE_OSPF
;
491 api
.instance
= ospf
->instance
;
492 api
.safi
= SAFI_UNICAST
;
493 memcpy(&api
.prefix
, p
, sizeof(*p
));
494 zapi_route_set_blackhole(&api
, BLACKHOLE_NULL
);
496 zclient_route_send(ZEBRA_ROUTE_ADD
, zclient
, &api
);
498 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
499 zlog_debug("Zebra: Route add discard %s/%d",
500 inet_ntoa(p
->prefix
), p
->prefixlen
);
503 void ospf_zebra_delete_discard(struct ospf
*ospf
, struct prefix_ipv4
*p
)
505 struct zapi_route api
;
507 memset(&api
, 0, sizeof(api
));
508 api
.vrf_id
= ospf
->vrf_id
;
509 api
.type
= ZEBRA_ROUTE_OSPF
;
510 api
.instance
= ospf
->instance
;
511 api
.safi
= SAFI_UNICAST
;
512 memcpy(&api
.prefix
, p
, sizeof(*p
));
513 zapi_route_set_blackhole(&api
, BLACKHOLE_NULL
);
515 zclient_route_send(ZEBRA_ROUTE_DELETE
, zclient
, &api
);
517 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
518 zlog_debug("Zebra: Route delete discard %s/%d",
519 inet_ntoa(p
->prefix
), p
->prefixlen
);
522 struct ospf_external
*ospf_external_lookup(u_char type
, u_short instance
)
524 struct list
*ext_list
;
525 struct listnode
*node
;
526 struct ospf_external
*ext
;
528 ext_list
= om
->external
[type
];
532 for (ALL_LIST_ELEMENTS_RO(ext_list
, node
, ext
))
533 if (ext
->instance
== instance
)
539 struct ospf_external
*ospf_external_add(u_char type
, u_short instance
)
541 struct list
*ext_list
;
542 struct ospf_external
*ext
;
544 ext
= ospf_external_lookup(type
, instance
);
548 if (!om
->external
[type
])
549 om
->external
[type
] = list_new();
551 ext_list
= om
->external
[type
];
552 ext
= (struct ospf_external
*)XCALLOC(MTYPE_OSPF_EXTERNAL
,
553 sizeof(struct ospf_external
));
554 ext
->instance
= instance
;
555 EXTERNAL_INFO(ext
) = route_table_init();
557 listnode_add(ext_list
, ext
);
562 void ospf_external_del(u_char type
, u_short instance
)
564 struct ospf_external
*ext
;
566 ext
= ospf_external_lookup(type
, instance
);
569 if (EXTERNAL_INFO(ext
))
570 route_table_finish(EXTERNAL_INFO(ext
));
572 listnode_delete(om
->external
[type
], ext
);
573 if (!om
->external
[type
]->count
) {
574 list_delete_and_null(&om
->external
[type
]);
576 XFREE(MTYPE_OSPF_EXTERNAL
, ext
);
580 struct ospf_redist
*ospf_redist_lookup(struct ospf
*ospf
, u_char type
,
583 struct list
*red_list
;
584 struct listnode
*node
;
585 struct ospf_redist
*red
;
587 red_list
= ospf
->redist
[type
];
591 for (ALL_LIST_ELEMENTS_RO(red_list
, node
, red
))
592 if (red
->instance
== instance
)
598 struct ospf_redist
*ospf_redist_add(struct ospf
*ospf
, u_char type
,
601 struct list
*red_list
;
602 struct ospf_redist
*red
;
604 red
= ospf_redist_lookup(ospf
, type
, instance
);
608 if (!ospf
->redist
[type
])
609 ospf
->redist
[type
] = list_new();
611 red_list
= ospf
->redist
[type
];
612 red
= (struct ospf_redist
*)XCALLOC(MTYPE_OSPF_REDISTRIBUTE
,
613 sizeof(struct ospf_redist
));
614 red
->instance
= instance
;
615 red
->dmetric
.type
= -1;
616 red
->dmetric
.value
= -1;
618 listnode_add(red_list
, red
);
623 void ospf_redist_del(struct ospf
*ospf
, u_char type
, u_short instance
)
625 struct ospf_redist
*red
;
627 red
= ospf_redist_lookup(ospf
, type
, instance
);
630 listnode_delete(ospf
->redist
[type
], red
);
631 if (!ospf
->redist
[type
]->count
) {
632 list_delete_and_null(&ospf
->redist
[type
]);
634 ospf_routemap_unset(red
);
635 XFREE(MTYPE_OSPF_REDISTRIBUTE
, red
);
640 int ospf_is_type_redistributed(struct ospf
*ospf
, int type
, u_short instance
)
642 return (DEFAULT_ROUTE_TYPE(type
)
643 ? vrf_bitmap_check(zclient
->default_information
,
646 && redist_check_instance(
647 &zclient
->mi_redist
[AFI_IP
][type
],
651 zclient
->redist
[AFI_IP
][type
],
655 int ospf_redistribute_set(struct ospf
*ospf
, int type
, u_short instance
,
656 int mtype
, int mvalue
)
659 struct ospf_redist
*red
;
661 red
= ospf_redist_lookup(ospf
, type
, instance
);
662 if (ospf_is_type_redistributed(ospf
, type
, instance
)) {
663 if (mtype
!= red
->dmetric
.type
) {
664 red
->dmetric
.type
= mtype
;
665 force
= LSA_REFRESH_FORCE
;
667 if (mvalue
!= red
->dmetric
.value
) {
668 red
->dmetric
.value
= mvalue
;
669 force
= LSA_REFRESH_FORCE
;
672 ospf_external_lsa_refresh_type(ospf
, type
, instance
, force
);
674 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
676 "Redistribute[%s][%d]: Refresh Type[%d], Metric[%d]",
677 ospf_redist_string(type
), instance
,
678 metric_type(ospf
, type
, instance
),
679 metric_value(ospf
, type
, instance
));
684 red
->dmetric
.type
= mtype
;
685 red
->dmetric
.value
= mvalue
;
687 ospf_external_add(type
, instance
);
689 zclient_redistribute(ZEBRA_REDISTRIBUTE_ADD
, zclient
, AFI_IP
, type
,
690 instance
, ospf
->vrf_id
);
692 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
693 zlog_debug("Redistribute[%s][%d] vrf id %u: Start Type[%d], Metric[%d]",
694 ospf_redist_string(type
), instance
, ospf
->vrf_id
,
695 metric_type(ospf
, type
, instance
),
696 metric_value(ospf
, type
, instance
));
698 ospf_asbr_status_update(ospf
, ++ospf
->redistribute
);
703 int ospf_redistribute_unset(struct ospf
*ospf
, int type
, u_short instance
)
705 if (type
== zclient
->redist_default
&& instance
== zclient
->instance
)
708 if (!ospf_is_type_redistributed(ospf
, type
, instance
))
711 zclient_redistribute(ZEBRA_REDISTRIBUTE_DELETE
, zclient
, AFI_IP
, type
,
712 instance
, ospf
->vrf_id
);
714 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
715 zlog_debug("Redistribute[%s][%d] vrf id %u: Stop",
716 ospf_redist_string(type
), instance
, ospf
->vrf_id
);
718 ospf_redist_del(ospf
, type
, instance
);
720 /* Remove the routes from OSPF table. */
721 ospf_redistribute_withdraw(ospf
, type
, instance
);
723 ospf_external_del(type
, instance
);
725 ospf_asbr_status_update(ospf
, --ospf
->redistribute
);
730 int ospf_redistribute_default_set(struct ospf
*ospf
, int originate
, int mtype
,
733 struct ospf_redist
*red
;
735 ospf
->default_originate
= originate
;
737 red
= ospf_redist_add(ospf
, DEFAULT_ROUTE
, 0);
738 red
->dmetric
.type
= mtype
;
739 red
->dmetric
.value
= mvalue
;
741 ospf_external_add(DEFAULT_ROUTE
, 0);
743 if (ospf_is_type_redistributed(ospf
, DEFAULT_ROUTE
, 0)) {
744 /* if ospf->default_originate changes value, is calling
745 ospf_external_lsa_refresh_default sufficient to implement
747 ospf_external_lsa_refresh_default(ospf
);
749 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
751 "Redistribute[%s]: Refresh Type[%d], Metric[%d]",
752 ospf_redist_string(DEFAULT_ROUTE
),
753 metric_type(ospf
, DEFAULT_ROUTE
, 0),
754 metric_value(ospf
, DEFAULT_ROUTE
, 0));
758 zclient_redistribute_default(ZEBRA_REDISTRIBUTE_DEFAULT_ADD
, zclient
,
761 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
762 zlog_debug("Redistribute[DEFAULT]: Start Type[%d], Metric[%d]",
763 metric_type(ospf
, DEFAULT_ROUTE
, 0),
764 metric_value(ospf
, DEFAULT_ROUTE
, 0));
766 if (ospf
->router_id
.s_addr
== 0)
767 ospf
->external_origin
|= (1 << DEFAULT_ROUTE
);
769 thread_add_timer(master
, ospf_default_originate_timer
, ospf
, 1,
772 ospf_asbr_status_update(ospf
, ++ospf
->redistribute
);
777 int ospf_redistribute_default_unset(struct ospf
*ospf
)
779 if (!ospf_is_type_redistributed(ospf
, DEFAULT_ROUTE
, 0))
782 ospf
->default_originate
= DEFAULT_ORIGINATE_NONE
;
783 ospf_redist_del(ospf
, DEFAULT_ROUTE
, 0);
785 zclient_redistribute_default(ZEBRA_REDISTRIBUTE_DEFAULT_DELETE
, zclient
,
788 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
789 zlog_debug("Redistribute[DEFAULT]: Stop");
791 // Pending: how does the external_info cleanup work in this case?
793 ospf_asbr_status_update(ospf
, --ospf
->redistribute
);
798 static int ospf_external_lsa_originate_check(struct ospf
*ospf
,
799 struct external_info
*ei
)
801 /* If prefix is multicast, then do not originate LSA. */
802 if (IN_MULTICAST(htonl(ei
->p
.prefix
.s_addr
))) {
804 "LSA[Type5:%s]: Not originate AS-external-LSA, "
805 "Prefix belongs multicast",
806 inet_ntoa(ei
->p
.prefix
));
810 /* Take care of default-originate. */
811 if (is_prefix_default(&ei
->p
))
812 if (ospf
->default_originate
== DEFAULT_ORIGINATE_NONE
) {
814 "LSA[Type5:0.0.0.0]: Not originate AS-external-LSA "
822 /* If connected prefix is OSPF enable interface, then do not announce. */
823 int ospf_distribute_check_connected(struct ospf
*ospf
, struct external_info
*ei
)
825 struct listnode
*node
;
826 struct ospf_interface
*oi
;
829 for (ALL_LIST_ELEMENTS_RO(ospf
->oiflist
, node
, oi
))
830 if (prefix_match(oi
->address
, (struct prefix
*)&ei
->p
))
835 /* return 1 if external LSA must be originated, 0 otherwise */
836 int ospf_redistribute_check(struct ospf
*ospf
, struct external_info
*ei
,
839 struct route_map_set_values save_values
;
840 struct prefix_ipv4
*p
= &ei
->p
;
841 struct ospf_redist
*red
;
842 u_char type
= is_prefix_default(&ei
->p
) ? DEFAULT_ROUTE
: ei
->type
;
843 u_short instance
= is_prefix_default(&ei
->p
) ? 0 : ei
->instance
;
848 if (!ospf_external_lsa_originate_check(ospf
, ei
))
851 /* Take care connected route. */
852 if (type
== ZEBRA_ROUTE_CONNECT
853 && !ospf_distribute_check_connected(ospf
, ei
))
856 if (!DEFAULT_ROUTE_TYPE(type
) && DISTRIBUTE_NAME(ospf
, type
))
857 /* distirbute-list exists, but access-list may not? */
858 if (DISTRIBUTE_LIST(ospf
, type
))
859 if (access_list_apply(DISTRIBUTE_LIST(ospf
, type
), p
)
861 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
863 "Redistribute[%s]: %s/%d filtered by ditribute-list.",
864 ospf_redist_string(type
),
865 inet_ntoa(p
->prefix
),
870 save_values
= ei
->route_map_set
;
871 ospf_reset_route_map_set_values(&ei
->route_map_set
);
873 /* apply route-map if needed */
874 red
= ospf_redist_lookup(ospf
, type
, instance
);
875 if (red
&& ROUTEMAP_NAME(red
)) {
878 ret
= route_map_apply(ROUTEMAP(red
), (struct prefix
*)p
,
881 if (ret
== RMAP_DENYMATCH
) {
882 ei
->route_map_set
= save_values
;
883 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
885 "Redistribute[%s]: %s/%d filtered by route-map.",
886 ospf_redist_string(type
),
887 inet_ntoa(p
->prefix
), p
->prefixlen
);
891 /* check if 'route-map set' changed something */
893 *changed
= !ospf_route_map_set_compare(
894 &ei
->route_map_set
, &save_values
);
900 /* OSPF route-map set for redistribution */
901 void ospf_routemap_set(struct ospf_redist
*red
, const char *name
)
903 if (ROUTEMAP_NAME(red
))
904 free(ROUTEMAP_NAME(red
));
906 ROUTEMAP_NAME(red
) = strdup(name
);
907 ROUTEMAP(red
) = route_map_lookup_by_name(name
);
910 void ospf_routemap_unset(struct ospf_redist
*red
)
912 if (ROUTEMAP_NAME(red
))
913 free(ROUTEMAP_NAME(red
));
915 ROUTEMAP_NAME(red
) = NULL
;
916 ROUTEMAP(red
) = NULL
;
919 /* Zebra route add and delete treatment. */
920 static int ospf_zebra_read_route(int command
, struct zclient
*zclient
,
921 zebra_size_t length
, vrf_id_t vrf_id
)
923 struct zapi_route api
;
924 struct prefix_ipv4 p
;
925 unsigned long ifindex
;
926 struct in_addr nexthop
;
927 struct external_info
*ei
;
931 ospf
= ospf_lookup_by_vrf_id(vrf_id
);
935 if (zapi_route_decode(zclient
->ibuf
, &api
) < 0)
938 ifindex
= api
.nexthops
[0].ifindex
;
939 nexthop
= api
.nexthops
[0].gate
.ipv4
;
941 memcpy(&p
, &api
.prefix
, sizeof(p
));
942 if (IPV4_NET127(ntohl(p
.prefix
.s_addr
)))
945 if (command
== ZEBRA_REDISTRIBUTE_ROUTE_ADD
) {
946 /* XXX|HACK|TODO|FIXME:
947 * Maybe we should ignore reject/blackhole routes? Testing
948 * shows that there is no problems though and this is only way
949 * to "summarize" routes in ASBR at the moment. Maybe we need
950 * just a better generalised solution for these types?
953 /* Protocol tag overwrites all other tag value sent by zebra */
954 if (ospf
->dtag
[api
.type
] > 0)
955 api
.tag
= ospf
->dtag
[api
.type
];
958 * Given zebra sends update for a prefix via ADD message, it
960 * be considered as an implicit DEL for that prefix with other
964 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
966 ospf_external_info_delete(i
, api
.instance
, p
);
968 ei
= ospf_external_info_add(api
.type
, api
.instance
, p
, ifindex
,
971 /* Nothing has changed, so nothing to do; return */
974 if (ospf
->router_id
.s_addr
== 0)
975 /* Set flags to generate AS-external-LSA originate event
976 for each redistributed protocols later. */
977 ospf
->external_origin
|= (1 << api
.type
);
980 if (is_prefix_default(&p
))
981 ospf_external_lsa_refresh_default(ospf
);
983 struct ospf_lsa
*current
;
985 current
= ospf_external_info_find_lsa(
988 ospf_external_lsa_originate(
995 "ospf_zebra_read_route() : %s refreshing LSA",
998 ospf_external_lsa_refresh(
1005 } else /* if (command == ZEBRA_REDISTRIBUTE_ROUTE_DEL) */
1007 ospf_external_info_delete(api
.type
, api
.instance
, p
);
1008 if (is_prefix_default(&p
))
1009 ospf_external_lsa_refresh_default(ospf
);
1011 ospf_external_lsa_flush(ospf
, api
.type
, &p
,
1012 ifindex
/*, nexthop */);
1019 int ospf_distribute_list_out_set(struct ospf
*ospf
, int type
, const char *name
)
1021 /* Lookup access-list for distribute-list. */
1022 DISTRIBUTE_LIST(ospf
, type
) = access_list_lookup(AFI_IP
, name
);
1024 /* Clear previous distribute-name. */
1025 if (DISTRIBUTE_NAME(ospf
, type
))
1026 free(DISTRIBUTE_NAME(ospf
, type
));
1028 /* Set distribute-name. */
1029 DISTRIBUTE_NAME(ospf
, type
) = strdup(name
);
1031 /* If access-list have been set, schedule update timer. */
1032 if (DISTRIBUTE_LIST(ospf
, type
))
1033 ospf_distribute_list_update(ospf
, type
, 0);
1038 int ospf_distribute_list_out_unset(struct ospf
*ospf
, int type
,
1041 /* Schedule update timer. */
1042 if (DISTRIBUTE_LIST(ospf
, type
))
1043 ospf_distribute_list_update(ospf
, type
, 0);
1045 /* Unset distribute-list. */
1046 DISTRIBUTE_LIST(ospf
, type
) = NULL
;
1048 /* Clear distribute-name. */
1049 if (DISTRIBUTE_NAME(ospf
, type
))
1050 free(DISTRIBUTE_NAME(ospf
, type
));
1052 DISTRIBUTE_NAME(ospf
, type
) = NULL
;
1057 /* distribute-list update timer. */
1058 static int ospf_distribute_list_update_timer(struct thread
*thread
)
1060 struct route_node
*rn
;
1061 struct external_info
*ei
;
1062 struct route_table
*rt
;
1063 struct ospf_lsa
*lsa
;
1064 int type
, default_refresh
= 0, arg_type
;
1065 struct ospf
*ospf
= NULL
;
1066 void **arg
= THREAD_ARG (thread
);
1068 ospf
= (struct ospf
*)arg
[0];
1069 arg_type
= (int)(intptr_t)arg
[1];
1074 ospf
->t_distribute_update
= NULL
;
1076 zlog_info("Zebra[Redistribute]: distribute-list update timer fired!");
1078 if (IS_DEBUG_OSPF_EVENT
) {
1079 zlog_debug("%s: ospf distribute-list update arg_type %d vrf %s id %d",
1080 __PRETTY_FUNCTION__
, arg_type
,
1081 ospf_vrf_id_to_name(ospf
->vrf_id
), ospf
->vrf_id
);
1084 /* foreach all external info. */
1085 for (type
= 0; type
<= ZEBRA_ROUTE_MAX
; type
++) {
1086 struct list
*ext_list
;
1087 struct listnode
*node
;
1088 struct ospf_external
*ext
;
1090 ext_list
= om
->external
[type
];
1094 for (ALL_LIST_ELEMENTS_RO(ext_list
, node
, ext
)) {
1095 rt
= ext
->external_info
;
1098 for (rn
= route_top(rt
); rn
; rn
= route_next(rn
))
1099 if ((ei
= rn
->info
) != NULL
) {
1100 if (is_prefix_default(&ei
->p
))
1101 default_refresh
= 1;
1103 (lsa
= ospf_external_info_find_lsa(
1105 ospf_external_lsa_refresh(
1107 LSA_REFRESH_IF_CHANGED
);
1109 ospf_external_lsa_originate(
1114 if (default_refresh
)
1115 ospf_external_lsa_refresh_default(ospf
);
1117 XFREE(MTYPE_OSPF_DIST_ARGS
, arg
);
1121 /* Update distribute-list and set timer to apply access-list. */
1122 void ospf_distribute_list_update(struct ospf
*ospf
, int type
,
1125 struct route_table
*rt
;
1126 struct ospf_external
*ext
;
1127 void **args
= XCALLOC(MTYPE_OSPF_DIST_ARGS
, sizeof(void *)*2);
1130 args
[1] = (void *)((ptrdiff_t) type
);
1132 /* External info does not exist. */
1133 ext
= ospf_external_lookup(type
, instance
);
1134 if (!ext
|| !(rt
= EXTERNAL_INFO(ext
))) {
1135 XFREE(MTYPE_OSPF_DIST_ARGS
, args
);
1139 /* If exists previously invoked thread, then let it continue. */
1140 if (ospf
->t_distribute_update
) {
1141 XFREE(MTYPE_OSPF_DIST_ARGS
, args
);
1146 ospf
->t_distribute_update
= NULL
;
1147 thread_add_timer_msec(master
, ospf_distribute_list_update_timer
,
1148 (void **)args
, ospf
->min_ls_interval
,
1149 &ospf
->t_distribute_update
);
1152 /* If access-list is updated, apply some check. */
1153 static void ospf_filter_update(struct access_list
*access
)
1158 struct ospf_area
*area
;
1159 struct listnode
*node
, *n1
;
1161 /* If OSPF instance does not exist, return right now. */
1162 if (listcount(om
->ospf
) == 0)
1165 /* Iterate all ospf [VRF] instances */
1166 for (ALL_LIST_ELEMENTS_RO(om
->ospf
, n1
, ospf
)) {
1167 /* Update distribute-list, and apply filter. */
1168 for (type
= 0; type
<= ZEBRA_ROUTE_MAX
; type
++) {
1169 struct list
*red_list
;
1170 struct listnode
*node
;
1171 struct ospf_redist
*red
;
1173 red_list
= ospf
->redist
[type
];
1175 for (ALL_LIST_ELEMENTS_RO(red_list
, node
, red
)) {
1176 if (ROUTEMAP(red
)) {
1177 /* if route-map is not NULL it may be
1178 * using this access list */
1179 ospf_distribute_list_update(
1181 type
, red
->instance
);
1185 /* There is place for route-map for default-information
1186 * (ZEBRA_ROUTE_MAX),
1187 * but no distribute list. */
1188 if (type
== ZEBRA_ROUTE_MAX
)
1191 if (DISTRIBUTE_NAME(ospf
, type
)) {
1192 /* Keep old access-list for distribute-list. */
1193 struct access_list
*old
= DISTRIBUTE_LIST(ospf
,
1196 /* Update access-list for distribute-list. */
1197 DISTRIBUTE_LIST(ospf
, type
) = access_list_lookup(
1198 AFI_IP
, DISTRIBUTE_NAME(ospf
, type
));
1200 /* No update for this distribute type. */
1201 if (old
== NULL
&& DISTRIBUTE_LIST(ospf
, type
) == NULL
)
1204 /* Schedule distribute-list update timer. */
1205 if (DISTRIBUTE_LIST(ospf
, type
) == NULL
1206 || strcmp(DISTRIBUTE_NAME(ospf
, type
), access
->name
)
1208 ospf_distribute_list_update(ospf
, type
, 0);
1212 /* Update Area access-list. */
1213 for (ALL_LIST_ELEMENTS_RO(ospf
->areas
, node
, area
)) {
1214 if (EXPORT_NAME(area
)) {
1215 EXPORT_LIST(area
) = NULL
;
1219 if (IMPORT_NAME(area
)) {
1220 IMPORT_LIST(area
) = NULL
;
1225 /* Schedule ABR tasks -- this will be changed -- takada. */
1226 if (IS_OSPF_ABR(ospf
) && abr_inv
)
1227 ospf_schedule_abr_task(ospf
);
1231 /* If prefix-list is updated, do some updates. */
1232 void ospf_prefix_list_update(struct prefix_list
*plist
)
1234 struct ospf
*ospf
= NULL
;
1237 struct ospf_area
*area
;
1238 struct listnode
*node
, *n1
;
1240 /* If OSPF instatnce does not exist, return right now. */
1241 if (listcount(om
->ospf
) == 0)
1244 /* Iterate all ospf [VRF] instances */
1245 for (ALL_LIST_ELEMENTS_RO(om
->ospf
, n1
, ospf
)) {
1247 /* Update all route-maps which are used
1248 * as redistribution filters.
1249 * They might use prefix-list.
1251 for (type
= 0; type
<= ZEBRA_ROUTE_MAX
; type
++) {
1252 struct list
*red_list
;
1253 struct listnode
*node
;
1254 struct ospf_redist
*red
;
1256 red_list
= ospf
->redist
[type
];
1258 for (ALL_LIST_ELEMENTS_RO(red_list
,
1260 if (ROUTEMAP(red
)) {
1261 /* if route-map is not NULL
1263 * this prefix list */
1264 ospf_distribute_list_update(
1272 /* Update area filter-lists. */
1273 for (ALL_LIST_ELEMENTS_RO(ospf
->areas
, node
, area
)) {
1274 /* Update filter-list in. */
1275 if (PREFIX_NAME_IN(area
))
1276 if (strcmp(PREFIX_NAME_IN(area
),
1277 prefix_list_name(plist
)) == 0) {
1278 PREFIX_LIST_IN(area
) =
1281 PREFIX_NAME_IN(area
));
1285 /* Update filter-list out. */
1286 if (PREFIX_NAME_OUT(area
))
1287 if (strcmp(PREFIX_NAME_OUT(area
),
1288 prefix_list_name(plist
)) == 0) {
1289 PREFIX_LIST_IN(area
) =
1292 PREFIX_NAME_OUT(area
));
1297 /* Schedule ABR task. */
1298 if (IS_OSPF_ABR(ospf
) && abr_inv
)
1299 ospf_schedule_abr_task(ospf
);
1303 static struct ospf_distance
*ospf_distance_new(void)
1305 return XCALLOC(MTYPE_OSPF_DISTANCE
, sizeof(struct ospf_distance
));
1308 static void ospf_distance_free(struct ospf_distance
*odistance
)
1310 XFREE(MTYPE_OSPF_DISTANCE
, odistance
);
1313 int ospf_distance_set(struct vty
*vty
, struct ospf
*ospf
,
1314 const char *distance_str
, const char *ip_str
,
1315 const char *access_list_str
)
1318 struct prefix_ipv4 p
;
1320 struct route_node
*rn
;
1321 struct ospf_distance
*odistance
;
1323 ret
= str2prefix_ipv4(ip_str
, &p
);
1325 vty_out(vty
, "Malformed prefix\n");
1326 return CMD_WARNING_CONFIG_FAILED
;
1329 distance
= atoi(distance_str
);
1331 /* Get OSPF distance node. */
1332 rn
= route_node_get(ospf
->distance_table
, (struct prefix
*)&p
);
1334 odistance
= rn
->info
;
1335 route_unlock_node(rn
);
1337 odistance
= ospf_distance_new();
1338 rn
->info
= odistance
;
1341 /* Set distance value. */
1342 odistance
->distance
= distance
;
1344 /* Reset access-list configuration. */
1345 if (odistance
->access_list
) {
1346 free(odistance
->access_list
);
1347 odistance
->access_list
= NULL
;
1349 if (access_list_str
)
1350 odistance
->access_list
= strdup(access_list_str
);
1355 int ospf_distance_unset(struct vty
*vty
, struct ospf
*ospf
,
1356 const char *distance_str
, const char *ip_str
,
1357 char const *access_list_str
)
1360 struct prefix_ipv4 p
;
1361 struct route_node
*rn
;
1362 struct ospf_distance
*odistance
;
1364 ret
= str2prefix_ipv4(ip_str
, &p
);
1366 vty_out(vty
, "Malformed prefix\n");
1367 return CMD_WARNING_CONFIG_FAILED
;
1370 rn
= route_node_lookup(ospf
->distance_table
, (struct prefix
*)&p
);
1372 vty_out(vty
, "Can't find specified prefix\n");
1373 return CMD_WARNING_CONFIG_FAILED
;
1376 odistance
= rn
->info
;
1378 if (odistance
->access_list
)
1379 free(odistance
->access_list
);
1380 ospf_distance_free(odistance
);
1383 route_unlock_node(rn
);
1384 route_unlock_node(rn
);
1389 void ospf_distance_reset(struct ospf
*ospf
)
1391 struct route_node
*rn
;
1392 struct ospf_distance
*odistance
;
1394 for (rn
= route_top(ospf
->distance_table
); rn
; rn
= route_next(rn
))
1395 if ((odistance
= rn
->info
) != NULL
) {
1396 if (odistance
->access_list
)
1397 free(odistance
->access_list
);
1398 ospf_distance_free(odistance
);
1400 route_unlock_node(rn
);
1404 u_char
ospf_distance_apply(struct ospf
*ospf
, struct prefix_ipv4
*p
,
1405 struct ospf_route
*or)
1411 if (ospf
->distance_intra
)
1412 if (or->path_type
== OSPF_PATH_INTRA_AREA
)
1413 return ospf
->distance_intra
;
1415 if (ospf
->distance_inter
)
1416 if (or->path_type
== OSPF_PATH_INTER_AREA
)
1417 return ospf
->distance_inter
;
1419 if (ospf
->distance_external
)
1420 if (or->path_type
== OSPF_PATH_TYPE1_EXTERNAL
||
1421 or->path_type
== OSPF_PATH_TYPE2_EXTERNAL
)
1422 return ospf
->distance_external
;
1424 if (ospf
->distance_all
)
1425 return ospf
->distance_all
;
1430 void ospf_zebra_vrf_register(struct ospf
*ospf
)
1432 if (!zclient
|| zclient
->sock
< 0 || !ospf
)
1435 if (ospf
->vrf_id
!= VRF_UNKNOWN
) {
1436 if (IS_DEBUG_OSPF_EVENT
)
1437 zlog_debug("%s: Register VRF %s id %u",
1438 __PRETTY_FUNCTION__
,
1439 ospf_vrf_id_to_name(ospf
->vrf_id
),
1441 /* Deregister for router-id, interfaces,
1442 * redistributed routes. */
1443 zclient_send_reg_requests(zclient
, ospf
->vrf_id
);
1447 void ospf_zebra_vrf_deregister(struct ospf
*ospf
)
1449 if (!zclient
|| zclient
->sock
< 0 || !ospf
)
1452 if (ospf
->vrf_id
!= VRF_DEFAULT
&& ospf
->vrf_id
!= VRF_UNKNOWN
) {
1453 if (IS_DEBUG_OSPF_EVENT
)
1454 zlog_debug("%s: De-Register VRF %s id %u to Zebra.",
1455 __PRETTY_FUNCTION__
,
1456 ospf_vrf_id_to_name(ospf
->vrf_id
),
1458 /* Deregister for router-id, interfaces,
1459 * redistributed routes. */
1460 zclient_send_dereg_requests(zclient
, ospf
->vrf_id
);
1463 static void ospf_zebra_connected(struct zclient
*zclient
)
1465 /* Send the client registration */
1466 bfd_client_sendmsg(zclient
, ZEBRA_BFD_CLIENT_REGISTER
);
1468 zclient_send_reg_requests(zclient
, VRF_DEFAULT
);
1471 void ospf_zebra_init(struct thread_master
*master
, u_short instance
)
1473 /* Allocate zebra structure. */
1474 zclient
= zclient_new(master
);
1475 zclient_init(zclient
, ZEBRA_ROUTE_OSPF
, instance
, &ospfd_privs
);
1476 zclient
->zebra_connected
= ospf_zebra_connected
;
1477 zclient
->router_id_update
= ospf_router_id_update_zebra
;
1478 zclient
->interface_add
= ospf_interface_add
;
1479 zclient
->interface_delete
= ospf_interface_delete
;
1480 zclient
->interface_up
= ospf_interface_state_up
;
1481 zclient
->interface_down
= ospf_interface_state_down
;
1482 zclient
->interface_address_add
= ospf_interface_address_add
;
1483 zclient
->interface_address_delete
= ospf_interface_address_delete
;
1484 zclient
->interface_link_params
= ospf_interface_link_params
;
1485 zclient
->interface_vrf_update
= ospf_interface_vrf_update
;
1487 zclient
->redistribute_route_add
= ospf_zebra_read_route
;
1488 zclient
->redistribute_route_del
= ospf_zebra_read_route
;
1490 access_list_add_hook(ospf_filter_update
);
1491 access_list_delete_hook(ospf_filter_update
);
1492 prefix_list_add_hook(ospf_prefix_list_update
);
1493 prefix_list_delete_hook(ospf_prefix_list_update
);