1 /* Redistribution Handler
2 * Copyright (C) 1998 Kunihiro Ishiguro
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
35 #include "zebra/rib.h"
36 #include "zebra/zserv.h"
37 #include "zebra/zebra_ns.h"
38 #include "zebra/zebra_vrf.h"
39 #include "zebra/zebra_routemap.h"
40 #include "zebra/redistribute.h"
41 #include "zebra/debug.h"
42 #include "zebra/router-id.h"
43 #include "zebra/zebra_memory.h"
45 #define ZEBRA_PTM_SUPPORT
47 /* array holding redistribute info about table redistribution */
48 /* bit AFI is set if that AFI is redistributing routes from this table */
49 static u_char zebra_import_table_used
[ZEBRA_KERNEL_TABLE_MAX
];
50 static u_int32_t zebra_import_table_distance
[AFI_MAX
][ZEBRA_KERNEL_TABLE_MAX
];
53 is_zebra_import_table_enabled(afi_t afi
, u_int32_t table_id
)
55 if (is_zebra_valid_kernel_table(table_id
))
57 if (CHECK_FLAG(zebra_import_table_used
[table_id
], (u_char
)afi
))
67 is_default (struct prefix
*p
)
69 if (p
->family
== AF_INET
)
70 if (p
->u
.prefix4
.s_addr
== 0 && p
->prefixlen
== 0)
73 #if 0 /* IPv6 default separation is now pending until protocol daemon
75 if (p
->family
== AF_INET6
)
76 if (IN6_IS_ADDR_UNSPECIFIED (&p
->u
.prefix6
) && p
->prefixlen
== 0)
79 #endif /* HAVE_IPV6 */
84 zebra_redistribute_default (struct zserv
*client
, vrf_id_t vrf_id
)
87 struct route_table
*table
;
88 struct route_node
*rn
;
91 struct prefix_ipv6 p6
;
92 #endif /* HAVE_IPV6 */
95 /* Lookup default route. */
96 memset (&p
, 0, sizeof (struct prefix_ipv4
));
100 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, vrf_id
);
103 rn
= route_node_lookup (table
, (struct prefix
*)&p
);
106 RNODE_FOREACH_RIB (rn
, newrib
)
107 if (CHECK_FLAG (newrib
->flags
, ZEBRA_FLAG_SELECTED
)
108 && newrib
->distance
!= DISTANCE_INFINITY
)
109 zsend_redistribute_route (ZEBRA_REDISTRIBUTE_IPV4_ADD
, client
, &rn
->p
, newrib
);
110 route_unlock_node (rn
);
115 /* Lookup default route. */
116 memset (&p6
, 0, sizeof (struct prefix_ipv6
));
117 p6
.family
= AF_INET6
;
120 table
= zebra_vrf_table (AFI_IP6
, SAFI_UNICAST
, vrf_id
);
123 rn
= route_node_lookup (table
, (struct prefix
*)&p6
);
126 RNODE_FOREACH_RIB (rn
, newrib
)
127 if (CHECK_FLAG (newrib
->flags
, ZEBRA_FLAG_SELECTED
)
128 && newrib
->distance
!= DISTANCE_INFINITY
)
129 zsend_redistribute_route (ZEBRA_REDISTRIBUTE_IPV6_ADD
, client
, &rn
->p
, newrib
);
130 route_unlock_node (rn
);
133 #endif /* HAVE_IPV6 */
136 /* Redistribute routes. */
138 zebra_redistribute (struct zserv
*client
, int type
, u_short instance
, vrf_id_t vrf_id
)
141 struct route_table
*table
;
142 struct route_node
*rn
;
144 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, vrf_id
);
146 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
147 RNODE_FOREACH_RIB (rn
, newrib
)
149 if (IS_ZEBRA_DEBUG_EVENT
)
150 zlog_debug("%s: checking: selected=%d, type=%d, distance=%d, zebra_check_addr=%d",
151 __func__
, CHECK_FLAG (newrib
->flags
, ZEBRA_FLAG_SELECTED
),
152 newrib
->type
, newrib
->distance
, zebra_check_addr (&rn
->p
));
154 if (CHECK_FLAG (newrib
->flags
, ZEBRA_FLAG_SELECTED
)
155 && newrib
->type
== type
156 && newrib
->instance
== instance
157 && newrib
->distance
!= DISTANCE_INFINITY
158 && zebra_check_addr (&rn
->p
))
160 client
->redist_v4_add_cnt
++;
161 zsend_redistribute_route (ZEBRA_REDISTRIBUTE_IPV4_ADD
, client
, &rn
->p
, newrib
);
165 table
= zebra_vrf_table (AFI_IP6
, SAFI_UNICAST
, vrf_id
);
167 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
168 RNODE_FOREACH_RIB (rn
, newrib
)
169 if (CHECK_FLAG (newrib
->flags
, ZEBRA_FLAG_SELECTED
)
170 && newrib
->type
== type
171 && newrib
->instance
== instance
172 && newrib
->distance
!= DISTANCE_INFINITY
173 && zebra_check_addr (&rn
->p
))
175 client
->redist_v6_add_cnt
++;
176 zsend_redistribute_route (ZEBRA_REDISTRIBUTE_IPV6_ADD
, client
, &rn
->p
, newrib
);
180 /* Either advertise a route for redistribution to registered clients or */
181 /* withdraw redistribution if add cannot be done for client */
183 redistribute_update (struct prefix
*p
, struct rib
*rib
, struct rib
*prev_rib
)
185 struct listnode
*node
, *nnode
;
186 struct zserv
*client
;
187 int send_redistribute
;
189 char buf
[INET6_ADDRSTRLEN
];
191 if (IS_ZEBRA_DEBUG_RIB
)
193 inet_ntop (p
->family
, &p
->u
.prefix
, buf
, INET6_ADDRSTRLEN
);
194 zlog_debug ("%u:%s/%d: Redist update rib %p (type %d), old %p (type %d)",
195 rib
->vrf_id
, buf
, p
->prefixlen
, rib
, rib
->type
,
196 prev_rib
, prev_rib
? prev_rib
->type
: -1);
199 afi
= family2afi(p
->family
);
202 zlog_warn("%s: Unknown AFI/SAFI prefix received\n", __FUNCTION__
);
206 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
208 send_redistribute
= 0;
210 if (is_default(p
) && client
->redist_default
)
211 send_redistribute
= 1;
213 if (rib
->instance
&& redist_check_instance(&client
->mi_redist
[afi
][rib
->type
],
215 send_redistribute
= 1;
217 if ((is_default (p
) &&
218 vrf_bitmap_check (client
->redist_default
, rib
->vrf_id
))
219 || vrf_bitmap_check (client
->redist
[afi
][rib
->type
], rib
->vrf_id
))
220 send_redistribute
= 1;
222 if (send_redistribute
)
227 client
->redist_v4_add_cnt
++;
228 zsend_redistribute_route (ZEBRA_REDISTRIBUTE_IPV4_ADD
, client
,
232 client
->redist_v6_add_cnt
++;
233 zsend_redistribute_route (ZEBRA_REDISTRIBUTE_IPV6_ADD
, client
,
237 zlog_warn("%s: Unknown AFI/SAFI prefix received\n", __FUNCTION__
);
243 redist_check_instance(&client
->mi_redist
[afi
][prev_rib
->type
],
245 vrf_bitmap_check (client
->redist
[afi
][prev_rib
->type
], rib
->vrf_id
)))
250 client
->redist_v4_del_cnt
++;
251 zsend_redistribute_route (ZEBRA_REDISTRIBUTE_IPV4_DEL
, client
, p
,
255 client
->redist_v6_del_cnt
++;
256 zsend_redistribute_route (ZEBRA_REDISTRIBUTE_IPV6_DEL
, client
, p
,
267 redistribute_delete (struct prefix
*p
, struct rib
*rib
)
269 struct listnode
*node
, *nnode
;
270 struct zserv
*client
;
271 char buf
[INET6_ADDRSTRLEN
];
274 if (IS_ZEBRA_DEBUG_RIB
)
276 inet_ntop (p
->family
, &p
->u
.prefix
, buf
, INET6_ADDRSTRLEN
);
277 zlog_debug ("%u:%s/%d: Redist delete rib %p (type %d)",
278 rib
->vrf_id
, buf
, p
->prefixlen
, rib
, rib
->type
);
281 /* Add DISTANCE_INFINITY check. */
282 if (rib
->distance
== DISTANCE_INFINITY
)
285 afi
= family2afi(p
->family
);
288 zlog_warn("%s: Unknown AFI/SAFI prefix received\n", __FUNCTION__
);
292 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
294 if ((is_default (p
) &&
295 vrf_bitmap_check (client
->redist_default
, rib
->vrf_id
)) ||
297 redist_check_instance(&client
->mi_redist
[afi
][rib
->type
],
299 vrf_bitmap_check (client
->redist
[afi
][rib
->type
], rib
->vrf_id
))
301 if (p
->family
== AF_INET
)
302 zsend_redistribute_route (ZEBRA_REDISTRIBUTE_IPV4_DEL
, client
, p
,
304 if (p
->family
== AF_INET6
)
305 zsend_redistribute_route (ZEBRA_REDISTRIBUTE_IPV6_DEL
, client
, p
,
312 zebra_redistribute_add (int command
, struct zserv
*client
, int length
,
313 struct zebra_vrf
*zvrf
)
319 afi
= stream_getc (client
->ibuf
);
320 type
= stream_getc (client
->ibuf
);
321 instance
= stream_getw (client
->ibuf
);
323 if (type
== 0 || type
>= ZEBRA_ROUTE_MAX
)
326 if (instance
&& !redist_check_instance(&client
->mi_redist
[afi
][type
], instance
))
328 redist_add_instance(&client
->mi_redist
[afi
][type
], instance
);
329 zebra_redistribute (client
, type
, instance
, zvrf
->vrf_id
);
332 if (! vrf_bitmap_check (client
->redist
[afi
][type
], zvrf
->vrf_id
))
334 vrf_bitmap_set (client
->redist
[afi
][type
], zvrf
->vrf_id
);
335 zebra_redistribute (client
, type
, 0, zvrf
->vrf_id
);
340 zebra_redistribute_delete (int command
, struct zserv
*client
, int length
,
341 struct zebra_vrf
*zvrf
)
347 afi
= stream_getc (client
->ibuf
);
348 type
= stream_getc (client
->ibuf
);
349 instance
= stream_getw (client
->ibuf
);
351 if (type
== 0 || type
>= ZEBRA_ROUTE_MAX
)
354 if (instance
&& redist_check_instance(&client
->mi_redist
[afi
][type
], instance
))
356 redist_del_instance(&client
->mi_redist
[afi
][type
], instance
);
357 //Pending: why no reaction here?
359 vrf_bitmap_unset (client
->redist
[afi
][type
], zvrf
->vrf_id
);
363 zebra_redistribute_default_add (int command
, struct zserv
*client
, int length
,
364 struct zebra_vrf
*zvrf
)
366 vrf_bitmap_set (client
->redist_default
, zvrf
->vrf_id
);
367 zebra_redistribute_default (client
, zvrf
->vrf_id
);
371 zebra_redistribute_default_delete (int command
, struct zserv
*client
,
372 int length
, struct zebra_vrf
*zvrf
)
374 vrf_bitmap_unset (client
->redist_default
, zvrf
->vrf_id
);
377 /* Interface up information. */
379 zebra_interface_up_update (struct interface
*ifp
)
381 struct listnode
*node
, *nnode
;
382 struct zserv
*client
;
384 if (IS_ZEBRA_DEBUG_EVENT
)
385 zlog_debug ("MESSAGE: ZEBRA_INTERFACE_UP %s", ifp
->name
);
387 if (ifp
->ptm_status
|| !ifp
->ptm_enable
) {
388 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
391 zsend_interface_update (ZEBRA_INTERFACE_UP
, client
, ifp
);
392 zsend_interface_link_params (client
, ifp
);
397 /* Interface down information. */
399 zebra_interface_down_update (struct interface
*ifp
)
401 struct listnode
*node
, *nnode
;
402 struct zserv
*client
;
404 if (IS_ZEBRA_DEBUG_EVENT
)
405 zlog_debug ("MESSAGE: ZEBRA_INTERFACE_DOWN %s", ifp
->name
);
407 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
409 zsend_interface_update (ZEBRA_INTERFACE_DOWN
, client
, ifp
);
413 /* Interface information update. */
415 zebra_interface_add_update (struct interface
*ifp
)
417 struct listnode
*node
, *nnode
;
418 struct zserv
*client
;
420 if (IS_ZEBRA_DEBUG_EVENT
)
421 zlog_debug ("MESSAGE: ZEBRA_INTERFACE_ADD %s[%d]", ifp
->name
, ifp
->vrf_id
);
423 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
427 zsend_interface_add (client
, ifp
);
428 zsend_interface_link_params (client
, ifp
);
433 zebra_interface_delete_update (struct interface
*ifp
)
435 struct listnode
*node
, *nnode
;
436 struct zserv
*client
;
438 if (IS_ZEBRA_DEBUG_EVENT
)
439 zlog_debug ("MESSAGE: ZEBRA_INTERFACE_DELETE %s", ifp
->name
);
441 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
444 zsend_interface_delete (client
, ifp
);
448 /* Interface address addition. */
450 zebra_interface_address_add_update (struct interface
*ifp
,
451 struct connected
*ifc
)
453 struct listnode
*node
, *nnode
;
454 struct zserv
*client
;
457 if (IS_ZEBRA_DEBUG_EVENT
)
459 char buf
[PREFIX_STRLEN
];
462 zlog_debug ("MESSAGE: ZEBRA_INTERFACE_ADDRESS_ADD %s on %s",
463 prefix2str (p
, buf
, sizeof(buf
)),
467 if (!CHECK_FLAG(ifc
->conf
, ZEBRA_IFC_REAL
))
468 zlog_warn("WARNING: advertising address to clients that is not yet usable.");
470 router_id_add_address(ifc
);
472 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
473 if (CHECK_FLAG (ifc
->conf
, ZEBRA_IFC_REAL
))
475 client
->connected_rt_add_cnt
++;
476 zsend_interface_address (ZEBRA_INTERFACE_ADDRESS_ADD
, client
, ifp
, ifc
);
480 /* Interface address deletion. */
482 zebra_interface_address_delete_update (struct interface
*ifp
,
483 struct connected
*ifc
)
485 struct listnode
*node
, *nnode
;
486 struct zserv
*client
;
489 if (IS_ZEBRA_DEBUG_EVENT
)
491 char buf
[PREFIX_STRLEN
];
494 zlog_debug ("MESSAGE: ZEBRA_INTERFACE_ADDRESS_DELETE %s on %s",
495 prefix2str (p
, buf
, sizeof(buf
)),
499 router_id_del_address(ifc
);
501 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
502 if (CHECK_FLAG (ifc
->conf
, ZEBRA_IFC_REAL
))
504 client
->connected_rt_del_cnt
++;
505 zsend_interface_address (ZEBRA_INTERFACE_ADDRESS_DELETE
, client
, ifp
, ifc
);
509 /* Interface VRF change. May need to delete from clients not interested in
510 * the new VRF. Note that this function is invoked *prior* to the VRF change.
513 zebra_interface_vrf_update_del (struct interface
*ifp
, vrf_id_t new_vrf_id
)
515 struct listnode
*node
, *nnode
;
516 struct zserv
*client
;
518 if (IS_ZEBRA_DEBUG_EVENT
)
519 zlog_debug ("MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/DEL %s VRF Id %u -> %u",
520 ifp
->name
, ifp
->vrf_id
, new_vrf_id
);
522 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
524 /* Need to delete if the client is not interested in the new VRF. */
525 zsend_interface_update (ZEBRA_INTERFACE_DOWN
, client
, ifp
);
527 zsend_interface_delete (client
, ifp
);
528 zsend_interface_vrf_update (client
, ifp
, new_vrf_id
);
532 /* Interface VRF change. This function is invoked *post* VRF change and sends an
533 * add to clients who are interested in the new VRF but not in the old VRF.
536 zebra_interface_vrf_update_add (struct interface
*ifp
, vrf_id_t old_vrf_id
)
538 struct listnode
*node
, *nnode
;
539 struct zserv
*client
;
541 if (IS_ZEBRA_DEBUG_EVENT
)
542 zlog_debug ("MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/ADD %s VRF Id %u -> %u",
543 ifp
->name
, old_vrf_id
, ifp
->vrf_id
);
545 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
547 /* Need to add if the client is interested in the new VRF. */
549 zsend_interface_add (client
, ifp
);
550 zsend_interface_addresses (client
, ifp
);
555 zebra_add_import_table_entry (struct route_node
*rn
, struct rib
*rib
, const char *rmap_name
)
559 struct nexthop
*nhop
;
561 route_map_result_t ret
= RMAP_MATCH
;
564 ret
= zebra_import_table_route_map_check (AFI_IP
, rib
->type
, &rn
->p
, rib
->nexthop
, rib
->vrf_id
,
565 rib
->tag
, rmap_name
);
567 if (ret
== RMAP_MATCH
)
569 if (rn
->p
.family
== AF_INET
)
572 p
.prefixlen
= rn
->p
.prefixlen
;
573 p
.u
.prefix4
= rn
->p
.u
.prefix4
;
575 if (rib
->nexthop_num
== 1)
578 if (nhop
->type
== NEXTHOP_TYPE_IFINDEX
)
581 gate
= (union g_addr
*)&nhop
->gate
.ipv4
;
583 rib_add (AFI_IP
, SAFI_UNICAST
, rib
->vrf_id
, ZEBRA_ROUTE_TABLE
,
584 rib
->table
, 0, &p
, gate
, (union g_addr
*)&nhop
->src
.ipv4
,
585 nhop
->ifindex
, zebrad
.rtm_table_default
,
586 rib
->metric
, rib
->mtu
,
587 zebra_import_table_distance
[AFI_IP
][rib
->table
]);
589 else if (rib
->nexthop_num
> 1)
591 newrib
= XCALLOC (MTYPE_RIB
, sizeof (struct rib
));
592 newrib
->type
= ZEBRA_ROUTE_TABLE
;
593 newrib
->distance
= zebra_import_table_distance
[AFI_IP
][rib
->table
];
594 newrib
->flags
= rib
->flags
;
595 newrib
->metric
= rib
->metric
;
596 newrib
->mtu
= rib
->mtu
;
597 newrib
->table
= zebrad
.rtm_table_default
;
598 newrib
->nexthop_num
= 0;
599 newrib
->uptime
= time(NULL
);
600 newrib
->instance
= rib
->table
;
602 /* Assuming these routes are never recursive */
603 for (nhop
= rib
->nexthop
; nhop
; nhop
= nhop
->next
)
604 rib_copy_nexthops(newrib
, nhop
);
606 rib_add_multipath(AFI_IP
, SAFI_UNICAST
, &p
, newrib
);
612 zebra_del_import_table_entry (rn
, rib
);
614 /* DD: Add IPv6 code */
619 zebra_del_import_table_entry (struct route_node
*rn
, struct rib
*rib
)
623 if (rn
->p
.family
== AF_INET
)
626 p
.prefixlen
= rn
->p
.prefixlen
;
627 p
.u
.prefix4
= rn
->p
.u
.prefix4
;
629 rib_delete (AFI_IP
, SAFI_UNICAST
, rib
->vrf_id
, ZEBRA_ROUTE_TABLE
,
630 rib
->table
, rib
->flags
, &p
, NULL
,
631 0, zebrad
.rtm_table_default
);
633 /* DD: Add IPv6 code */
638 /* Assuming no one calls this with the main routing table */
640 zebra_import_table (afi_t afi
, u_int32_t table_id
, u_int32_t distance
, const char *rmap_name
, int add
)
642 struct route_table
*table
;
644 struct route_node
*rn
;
646 if (!is_zebra_valid_kernel_table(table_id
) ||
647 ((table_id
== RT_TABLE_MAIN
) || (table_id
== zebrad
.rtm_table_default
)))
653 table
= zebra_vrf_other_route_table(afi
, table_id
, VRF_DEFAULT
);
658 else if (IS_ZEBRA_DEBUG_RIB
)
660 zlog_debug ("%s routes from table %d",
661 add
? "Importing" : "Unimporting", table_id
);
667 zebra_add_import_table_route_map (afi
, rmap_name
, table_id
);
670 rmap_name
= zebra_get_import_table_route_map (afi
, table_id
);
672 zebra_del_import_table_route_map (afi
, table_id
);
675 SET_FLAG(zebra_import_table_used
[table_id
], afi
);
676 zebra_import_table_distance
[afi
][table_id
] = distance
;
680 UNSET_FLAG(zebra_import_table_used
[table_id
], (u_char
)afi
);
681 zebra_import_table_distance
[afi
][table_id
] = ZEBRA_TABLE_DISTANCE_DEFAULT
;
683 rmap_name
= zebra_get_import_table_route_map (afi
, table_id
);
685 zebra_del_import_table_route_map (afi
, table_id
);
688 for (rn
= route_top(table
); rn
; rn
= route_next(rn
))
690 /* For each entry in the non-default routing table,
691 * add the entry in the main table
696 RNODE_FOREACH_RIB (rn
, rib
)
698 if (CHECK_FLAG (rib
->status
, RIB_ENTRY_REMOVED
))
706 if (((afi
== AFI_IP
) && (rn
->p
.family
== AF_INET
)) ||
707 ((afi
== AFI_IP6
) && (rn
->p
.family
== AF_INET6
)))
710 zebra_add_import_table_entry (rn
, rib
, rmap_name
);
712 zebra_del_import_table_entry (rn
, rib
);
719 zebra_import_table_config (struct vty
*vty
)
724 char afi_str
[AFI_MAX
][6] = {"", "ip", "ipv6"};
725 const char *rmap_name
;
727 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
729 for (i
= 1; i
< ZEBRA_KERNEL_TABLE_MAX
; i
++)
731 if (is_zebra_import_table_enabled(afi
, i
))
733 if (zebra_import_table_distance
[afi
][i
] != ZEBRA_TABLE_DISTANCE_DEFAULT
)
735 vty_out(vty
, "%s import-table %d distance %d", afi_str
[afi
],
736 i
, zebra_import_table_distance
[afi
][i
]);
740 vty_out(vty
, "%s import-table %d", afi_str
[afi
], i
);
743 rmap_name
= zebra_get_import_table_route_map (afi
, i
);
745 vty_out(vty
, " route-map %s", rmap_name
);
747 vty_out(vty
, "%s", VTY_NEWLINE
);
757 zebra_import_table_rm_update ()
761 struct route_table
*table
;
763 struct route_node
*rn
;
764 const char *rmap_name
;
766 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
768 for (i
= 1; i
< ZEBRA_KERNEL_TABLE_MAX
; i
++)
770 if (is_zebra_import_table_enabled(afi
, i
))
772 rmap_name
= zebra_get_import_table_route_map (afi
, i
);
776 table
= zebra_vrf_other_route_table(afi
, i
, VRF_DEFAULT
);
777 for (rn
= route_top(table
); rn
; rn
= route_next(rn
))
779 /* For each entry in the non-default routing table,
780 * add the entry in the main table
785 RNODE_FOREACH_RIB (rn
, rib
)
787 if (CHECK_FLAG (rib
->status
, RIB_ENTRY_REMOVED
))
795 if (((afi
== AFI_IP
) && (rn
->p
.family
== AF_INET
)) ||
796 ((afi
== AFI_IP6
) && (rn
->p
.family
== AF_INET6
)))
797 zebra_add_import_table_entry (rn
, rib
, rmap_name
);
806 /* Interface parameters update */
808 zebra_interface_parameters_update (struct interface
*ifp
)
810 struct listnode
*node
, *nnode
;
811 struct zserv
*client
;
813 if (IS_ZEBRA_DEBUG_EVENT
)
814 zlog_debug ("MESSAGE: ZEBRA_INTERFACE_LINK_PARAMS %s", ifp
->name
);
816 for (ALL_LIST_ELEMENTS (zebrad
.client_list
, node
, nnode
, client
))
818 zsend_interface_link_params (client
, ifp
);