]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Copyright (C) 2016 CumulusNetworks | |
3 | * Donald Sharp | |
4 | * | |
5 | * This file is part of Quagga | |
6 | * | |
7 | * Quagga is free software; you can redistribute it and/or modify it | |
8 | * under the terms of the GNU General Public License as published by the | |
9 | * Free Software Foundation; either version 2, or (at your option) any | |
10 | * later version. | |
11 | * | |
12 | * Quagga is distributed in the hope that it will be useful, but | |
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License 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 | |
20 | */ | |
21 | #include <zebra.h> | |
22 | ||
23 | #include "log.h" | |
24 | #include "linklist.h" | |
25 | #include "command.h" | |
26 | #include "memory.h" | |
27 | #include "srcdest_table.h" | |
28 | #include "vrf.h" | |
29 | #include "vty.h" | |
30 | ||
31 | #include "zebra/debug.h" | |
32 | #include "zebra/zserv.h" | |
33 | #include "zebra/rib.h" | |
34 | #include "zebra/zebra_vrf.h" | |
35 | #include "zebra/zebra_rnh.h" | |
36 | #include "zebra/router-id.h" | |
37 | #include "zebra/zebra_memory.h" | |
38 | #include "zebra/zebra_static.h" | |
39 | #include "zebra/interface.h" | |
40 | #include "zebra/zebra_mpls.h" | |
41 | #include "zebra/zebra_vxlan.h" | |
42 | ||
43 | extern struct zebra_t zebrad; | |
44 | ||
45 | static void zebra_vrf_table_create(struct zebra_vrf *zvrf, afi_t afi, | |
46 | safi_t safi); | |
47 | static void zebra_rnhtable_node_cleanup(struct route_table *table, | |
48 | struct route_node *node); | |
49 | ||
50 | /* VRF information update. */ | |
51 | static void zebra_vrf_add_update(struct zebra_vrf *zvrf) | |
52 | { | |
53 | struct listnode *node, *nnode; | |
54 | struct zserv *client; | |
55 | ||
56 | if (IS_ZEBRA_DEBUG_EVENT) | |
57 | zlog_debug("MESSAGE: ZEBRA_VRF_ADD %s", zvrf_name(zvrf)); | |
58 | ||
59 | for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) | |
60 | zsend_vrf_add(client, zvrf); | |
61 | } | |
62 | ||
63 | static void zebra_vrf_delete_update(struct zebra_vrf *zvrf) | |
64 | { | |
65 | struct listnode *node, *nnode; | |
66 | struct zserv *client; | |
67 | ||
68 | if (IS_ZEBRA_DEBUG_EVENT) | |
69 | zlog_debug("MESSAGE: ZEBRA_VRF_DELETE %s", zvrf_name(zvrf)); | |
70 | ||
71 | for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) | |
72 | zsend_vrf_delete(client, zvrf); | |
73 | } | |
74 | ||
75 | void zebra_vrf_update_all(struct zserv *client) | |
76 | { | |
77 | struct vrf *vrf; | |
78 | ||
79 | RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) { | |
80 | if (vrf->vrf_id != VRF_UNKNOWN) | |
81 | zsend_vrf_add(client, vrf_info_lookup(vrf->vrf_id)); | |
82 | } | |
83 | } | |
84 | ||
85 | /* Callback upon creating a new VRF. */ | |
86 | static int zebra_vrf_new(struct vrf *vrf) | |
87 | { | |
88 | struct zebra_vrf *zvrf; | |
89 | ||
90 | if (IS_ZEBRA_DEBUG_EVENT) | |
91 | zlog_info("VRF %s created, id %u", vrf->name, vrf->vrf_id); | |
92 | ||
93 | zvrf = zebra_vrf_alloc(); | |
94 | vrf->info = zvrf; | |
95 | zvrf->vrf = vrf; | |
96 | router_id_init(zvrf); | |
97 | return 0; | |
98 | } | |
99 | ||
100 | /* Callback upon enabling a VRF. */ | |
101 | static int zebra_vrf_enable(struct vrf *vrf) | |
102 | { | |
103 | struct zebra_vrf *zvrf = vrf->info; | |
104 | struct route_table *stable; | |
105 | struct route_node *rn; | |
106 | struct static_route *si; | |
107 | struct route_table *table; | |
108 | struct interface *ifp; | |
109 | afi_t afi; | |
110 | safi_t safi; | |
111 | ||
112 | assert(zvrf); | |
113 | if (IS_ZEBRA_DEBUG_EVENT) | |
114 | zlog_debug("VRF %s id %u is now active", | |
115 | zvrf_name(zvrf), zvrf_id(zvrf)); | |
116 | ||
117 | if (vrf_is_backend_netns()) | |
118 | zvrf->zns = zebra_ns_lookup((ns_id_t)vrf->vrf_id); | |
119 | else | |
120 | zvrf->zns = zebra_ns_lookup(NS_DEFAULT); | |
121 | /* Inform clients that the VRF is now active. This is an | |
122 | * add for the clients. | |
123 | */ | |
124 | zebra_vrf_add_update(zvrf); | |
125 | ||
126 | /* Allocate tables */ | |
127 | for (afi = AFI_IP; afi <= AFI_IP6; afi++) { | |
128 | for (safi = SAFI_UNICAST; safi <= SAFI_MULTICAST; safi++) | |
129 | zebra_vrf_table_create(zvrf, afi, safi); | |
130 | ||
131 | table = route_table_init(); | |
132 | table->cleanup = zebra_rnhtable_node_cleanup; | |
133 | zvrf->rnh_table[afi] = table; | |
134 | ||
135 | table = route_table_init(); | |
136 | table->cleanup = zebra_rnhtable_node_cleanup; | |
137 | zvrf->import_check_table[afi] = table; | |
138 | } | |
139 | ||
140 | /* Install any static routes configured for this VRF. */ | |
141 | for (afi = AFI_IP; afi < AFI_MAX; afi++) | |
142 | for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { | |
143 | stable = zvrf->stable[afi][safi]; | |
144 | if (!stable) | |
145 | continue; | |
146 | ||
147 | for (rn = route_top(stable); rn; rn = route_next(rn)) | |
148 | for (si = rn->info; si; si = si->next) { | |
149 | si->vrf_id = vrf->vrf_id; | |
150 | if (si->ifindex) { | |
151 | ifp = if_lookup_by_name( | |
152 | si->ifname, si->vrf_id); | |
153 | if (ifp) | |
154 | si->ifindex = | |
155 | ifp->ifindex; | |
156 | else | |
157 | continue; | |
158 | } | |
159 | static_install_route(afi, safi, &rn->p, | |
160 | NULL, si); | |
161 | } | |
162 | } | |
163 | ||
164 | /* Kick off any VxLAN-EVPN processing. */ | |
165 | zebra_vxlan_vrf_enable(zvrf); | |
166 | ||
167 | return 0; | |
168 | } | |
169 | ||
170 | /* Callback upon disabling a VRF. */ | |
171 | static int zebra_vrf_disable(struct vrf *vrf) | |
172 | { | |
173 | struct zebra_vrf *zvrf = vrf->info; | |
174 | struct route_table *stable; | |
175 | struct route_node *rn; | |
176 | struct static_route *si; | |
177 | struct route_table *table; | |
178 | struct interface *ifp; | |
179 | afi_t afi; | |
180 | safi_t safi; | |
181 | unsigned i; | |
182 | ||
183 | assert(zvrf); | |
184 | if (IS_ZEBRA_DEBUG_EVENT) | |
185 | zlog_debug("VRF %s id %u is now inactive", | |
186 | zvrf_name(zvrf), zvrf_id(zvrf)); | |
187 | ||
188 | /* Uninstall any static routes configured for this VRF. */ | |
189 | for (afi = AFI_IP; afi < AFI_MAX; afi++) | |
190 | for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { | |
191 | stable = zvrf->stable[afi][safi]; | |
192 | if (!stable) | |
193 | continue; | |
194 | ||
195 | for (rn = route_top(stable); rn; rn = route_next(rn)) | |
196 | for (si = rn->info; si; si = si->next) | |
197 | static_uninstall_route( | |
198 | afi, safi, &rn->p, NULL, si); | |
199 | } | |
200 | ||
201 | /* Stop any VxLAN-EVPN processing. */ | |
202 | zebra_vxlan_vrf_disable(zvrf); | |
203 | ||
204 | /* Inform clients that the VRF is now inactive. This is a | |
205 | * delete for the clients. | |
206 | */ | |
207 | zebra_vrf_delete_update(zvrf); | |
208 | ||
209 | /* If asked to retain routes, there's nothing more to do. */ | |
210 | if (CHECK_FLAG(zvrf->flags, ZEBRA_VRF_RETAIN)) | |
211 | return 0; | |
212 | ||
213 | /* Remove all routes. */ | |
214 | for (afi = AFI_IP; afi <= AFI_IP6; afi++) { | |
215 | for (safi = SAFI_UNICAST; safi <= SAFI_MULTICAST; safi++) | |
216 | rib_close_table(zvrf->table[afi][safi]); | |
217 | } | |
218 | ||
219 | /* Cleanup Vxlan, MPLS and PW tables. */ | |
220 | zebra_vxlan_cleanup_tables(zvrf); | |
221 | zebra_mpls_cleanup_tables(zvrf); | |
222 | zebra_pw_exit(zvrf); | |
223 | ||
224 | /* Remove link-local IPv4 addresses created for BGP unnumbered peering. */ | |
225 | FOR_ALL_INTERFACES (vrf, ifp) | |
226 | if_nbr_ipv6ll_to_ipv4ll_neigh_del_all(ifp); | |
227 | ||
228 | /* clean-up work queues */ | |
229 | for (i = 0; i < MQ_SIZE; i++) { | |
230 | struct listnode *lnode, *nnode; | |
231 | struct route_node *rnode; | |
232 | rib_dest_t *dest; | |
233 | ||
234 | for (ALL_LIST_ELEMENTS(zebrad.mq->subq[i], | |
235 | lnode, nnode, rnode)) { | |
236 | dest = rib_dest_from_rnode(rnode); | |
237 | if (dest && rib_dest_vrf(dest) == zvrf) { | |
238 | route_unlock_node(rnode); | |
239 | list_delete_node(zebrad.mq->subq[i], lnode); | |
240 | zebrad.mq->size--; | |
241 | } | |
242 | } | |
243 | } | |
244 | ||
245 | /* Cleanup (free) routing tables and NHT tables. */ | |
246 | for (afi = AFI_IP; afi <= AFI_IP6; afi++) { | |
247 | void *table_info; | |
248 | ||
249 | for (safi = SAFI_UNICAST; safi <= SAFI_MULTICAST; safi++) { | |
250 | table = zvrf->table[afi][safi]; | |
251 | table_info = table->info; | |
252 | route_table_finish(table); | |
253 | XFREE(MTYPE_RIB_TABLE_INFO, table_info); | |
254 | zvrf->table[afi][safi] = NULL; | |
255 | } | |
256 | ||
257 | route_table_finish(zvrf->rnh_table[afi]); | |
258 | zvrf->rnh_table[afi] = NULL; | |
259 | route_table_finish(zvrf->import_check_table[afi]); | |
260 | zvrf->import_check_table[afi] = NULL; | |
261 | } | |
262 | ||
263 | return 0; | |
264 | } | |
265 | ||
266 | static int zebra_vrf_delete(struct vrf *vrf) | |
267 | { | |
268 | struct zebra_vrf *zvrf = vrf->info; | |
269 | struct route_table *table; | |
270 | afi_t afi; | |
271 | safi_t safi; | |
272 | unsigned i; | |
273 | ||
274 | assert(zvrf); | |
275 | if (IS_ZEBRA_DEBUG_EVENT) | |
276 | zlog_debug("VRF %s id %u deleted", | |
277 | zvrf_name(zvrf), zvrf_id(zvrf)); | |
278 | ||
279 | /* clean-up work queues */ | |
280 | for (i = 0; i < MQ_SIZE; i++) { | |
281 | struct listnode *lnode, *nnode; | |
282 | struct route_node *rnode; | |
283 | rib_dest_t *dest; | |
284 | ||
285 | for (ALL_LIST_ELEMENTS(zebrad.mq->subq[i], lnode, nnode, rnode)) { | |
286 | dest = rib_dest_from_rnode(rnode); | |
287 | if (dest && rib_dest_vrf(dest) == zvrf) { | |
288 | route_unlock_node(rnode); | |
289 | list_delete_node(zebrad.mq->subq[i], lnode); | |
290 | zebrad.mq->size--; | |
291 | } | |
292 | } | |
293 | } | |
294 | ||
295 | /* Free Vxlan and MPLS. */ | |
296 | zebra_vxlan_close_tables(zvrf); | |
297 | zebra_mpls_close_tables(zvrf); | |
298 | ||
299 | /* release allocated memory */ | |
300 | for (afi = AFI_IP; afi <= AFI_IP6; afi++) { | |
301 | void *table_info; | |
302 | ||
303 | for (safi = SAFI_UNICAST; safi <= SAFI_MULTICAST; safi++) { | |
304 | table = zvrf->table[afi][safi]; | |
305 | if (table) { | |
306 | table_info = table->info; | |
307 | route_table_finish(table); | |
308 | XFREE(MTYPE_RIB_TABLE_INFO, table_info); | |
309 | } | |
310 | ||
311 | table = zvrf->stable[afi][safi]; | |
312 | route_table_finish(table); | |
313 | } | |
314 | ||
315 | route_table_finish(zvrf->rnh_table[afi]); | |
316 | route_table_finish(zvrf->import_check_table[afi]); | |
317 | } | |
318 | ||
319 | /* Cleanup EVPN states for vrf */ | |
320 | zebra_vxlan_vrf_delete(zvrf); | |
321 | ||
322 | list_delete_all_node(zvrf->rid_all_sorted_list); | |
323 | list_delete_all_node(zvrf->rid_lo_sorted_list); | |
324 | XFREE(MTYPE_ZEBRA_VRF, zvrf); | |
325 | vrf->info = NULL; | |
326 | ||
327 | return 0; | |
328 | } | |
329 | ||
330 | /* Return if this VRF has any FRR configuration or not. | |
331 | * IMPORTANT: This function needs to be updated when additional configuration | |
332 | * is added for a VRF. | |
333 | */ | |
334 | int zebra_vrf_has_config(struct zebra_vrf *zvrf) | |
335 | { | |
336 | afi_t afi; | |
337 | safi_t safi; | |
338 | struct route_table *stable; | |
339 | ||
340 | /* NOTE: This is a don't care for the default VRF, but we go through | |
341 | * the motions to keep things consistent. | |
342 | */ | |
343 | /* Any static routes? */ | |
344 | for (afi = AFI_IP; afi < AFI_MAX; afi++) { | |
345 | for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { | |
346 | stable = zvrf->stable[afi][safi]; | |
347 | if (!stable) | |
348 | continue; | |
349 | if (route_table_count(stable)) | |
350 | return 1; | |
351 | } | |
352 | } | |
353 | ||
354 | /* EVPN L3-VNI? */ | |
355 | if (zvrf->l3vni) | |
356 | return 1; | |
357 | ||
358 | return 0; | |
359 | } | |
360 | ||
361 | /* Lookup the routing table in a VRF based on both VRF-Id and table-id. | |
362 | * NOTE: Table-id is relevant only in the Default VRF. | |
363 | */ | |
364 | struct route_table *zebra_vrf_table_with_table_id(afi_t afi, safi_t safi, | |
365 | vrf_id_t vrf_id, | |
366 | u_int32_t table_id) | |
367 | { | |
368 | struct route_table *table = NULL; | |
369 | ||
370 | if (afi >= AFI_MAX || safi >= SAFI_MAX) | |
371 | return NULL; | |
372 | ||
373 | if (vrf_id == VRF_DEFAULT) { | |
374 | if (table_id == RT_TABLE_MAIN | |
375 | || table_id == zebrad.rtm_table_default) | |
376 | table = zebra_vrf_table(afi, safi, vrf_id); | |
377 | else | |
378 | table = zebra_vrf_other_route_table(afi, table_id, | |
379 | vrf_id); | |
380 | } else | |
381 | table = zebra_vrf_table(afi, safi, vrf_id); | |
382 | ||
383 | return table; | |
384 | } | |
385 | ||
386 | void zebra_rtable_node_cleanup(struct route_table *table, | |
387 | struct route_node *node) | |
388 | { | |
389 | struct route_entry *re, *next; | |
390 | ||
391 | RNODE_FOREACH_RE_SAFE (node, re, next) { | |
392 | rib_unlink(node, re); | |
393 | } | |
394 | ||
395 | if (node->info) | |
396 | XFREE(MTYPE_RIB_DEST, node->info); | |
397 | } | |
398 | ||
399 | static void zebra_stable_node_cleanup(struct route_table *table, | |
400 | struct route_node *node) | |
401 | { | |
402 | struct static_route *si, *next; | |
403 | ||
404 | if (node->info) | |
405 | for (si = node->info; si; si = next) { | |
406 | next = si->next; | |
407 | XFREE(MTYPE_STATIC_ROUTE, si); | |
408 | } | |
409 | } | |
410 | ||
411 | static void zebra_rnhtable_node_cleanup(struct route_table *table, | |
412 | struct route_node *node) | |
413 | { | |
414 | if (node->info) | |
415 | zebra_free_rnh(node->info); | |
416 | } | |
417 | ||
418 | /* | |
419 | * Create a routing table for the specific AFI/SAFI in the given VRF. | |
420 | */ | |
421 | static void zebra_vrf_table_create(struct zebra_vrf *zvrf, afi_t afi, | |
422 | safi_t safi) | |
423 | { | |
424 | rib_table_info_t *info; | |
425 | struct route_table *table; | |
426 | ||
427 | assert(!zvrf->table[afi][safi]); | |
428 | ||
429 | if (afi == AFI_IP6) | |
430 | table = srcdest_table_init(); | |
431 | else | |
432 | table = route_table_init(); | |
433 | table->cleanup = zebra_rtable_node_cleanup; | |
434 | zvrf->table[afi][safi] = table; | |
435 | ||
436 | info = XCALLOC(MTYPE_RIB_TABLE_INFO, sizeof(*info)); | |
437 | info->zvrf = zvrf; | |
438 | info->afi = afi; | |
439 | info->safi = safi; | |
440 | table->info = info; | |
441 | } | |
442 | ||
443 | /* Allocate new zebra VRF. */ | |
444 | struct zebra_vrf *zebra_vrf_alloc(void) | |
445 | { | |
446 | struct zebra_vrf *zvrf; | |
447 | afi_t afi; | |
448 | safi_t safi; | |
449 | struct route_table *table; | |
450 | ||
451 | zvrf = XCALLOC(MTYPE_ZEBRA_VRF, sizeof(struct zebra_vrf)); | |
452 | ||
453 | /* Allocate table for static route configuration. */ | |
454 | for (afi = AFI_IP; afi <= AFI_IP6; afi++) { | |
455 | for (safi = SAFI_UNICAST; safi <= SAFI_MULTICAST; safi++) { | |
456 | if (afi == AFI_IP6) | |
457 | table = srcdest_table_init(); | |
458 | else | |
459 | table = route_table_init(); | |
460 | table->cleanup = zebra_stable_node_cleanup; | |
461 | zvrf->stable[afi][safi] = table; | |
462 | } | |
463 | } | |
464 | ||
465 | zebra_vxlan_init_tables(zvrf); | |
466 | zebra_mpls_init_tables(zvrf); | |
467 | zebra_pw_init(zvrf); | |
468 | ||
469 | return zvrf; | |
470 | } | |
471 | ||
472 | /* Lookup VRF by identifier. */ | |
473 | struct zebra_vrf *zebra_vrf_lookup_by_id(vrf_id_t vrf_id) | |
474 | { | |
475 | return vrf_info_lookup(vrf_id); | |
476 | } | |
477 | ||
478 | /* Lookup VRF by name. */ | |
479 | struct zebra_vrf *zebra_vrf_lookup_by_name(const char *name) | |
480 | { | |
481 | struct vrf *vrf; | |
482 | ||
483 | if (!name) | |
484 | name = VRF_DEFAULT_NAME; | |
485 | ||
486 | vrf = vrf_lookup_by_name(name); | |
487 | if (vrf) | |
488 | return ((struct zebra_vrf *)vrf->info); | |
489 | ||
490 | return NULL; | |
491 | } | |
492 | ||
493 | /* Lookup the routing table in an enabled VRF. */ | |
494 | struct route_table *zebra_vrf_table(afi_t afi, safi_t safi, vrf_id_t vrf_id) | |
495 | { | |
496 | struct zebra_vrf *zvrf = vrf_info_lookup(vrf_id); | |
497 | ||
498 | if (!zvrf) | |
499 | return NULL; | |
500 | ||
501 | if (afi >= AFI_MAX || safi >= SAFI_MAX) | |
502 | return NULL; | |
503 | ||
504 | return zvrf->table[afi][safi]; | |
505 | } | |
506 | ||
507 | /* Lookup the static routing table in a VRF. */ | |
508 | struct route_table *zebra_vrf_static_table(afi_t afi, safi_t safi, | |
509 | struct zebra_vrf *zvrf) | |
510 | { | |
511 | if (!zvrf) | |
512 | return NULL; | |
513 | ||
514 | if (afi >= AFI_MAX || safi >= SAFI_MAX) | |
515 | return NULL; | |
516 | ||
517 | return zvrf->stable[afi][safi]; | |
518 | } | |
519 | ||
520 | struct route_table *zebra_vrf_other_route_table(afi_t afi, u_int32_t table_id, | |
521 | vrf_id_t vrf_id) | |
522 | { | |
523 | struct zebra_vrf *zvrf; | |
524 | struct zebra_ns *zns; | |
525 | ||
526 | zvrf = vrf_info_lookup(vrf_id); | |
527 | if (!zvrf) | |
528 | return NULL; | |
529 | ||
530 | zns = zvrf->zns; | |
531 | ||
532 | if (afi >= AFI_MAX) | |
533 | return NULL; | |
534 | ||
535 | if ((vrf_id == VRF_DEFAULT) && (table_id != RT_TABLE_MAIN) | |
536 | && (table_id != zebrad.rtm_table_default)) { | |
537 | return zebra_ns_get_table(zns, zvrf, table_id, afi); | |
538 | } | |
539 | ||
540 | return zvrf->table[afi][SAFI_UNICAST]; | |
541 | } | |
542 | ||
543 | static int vrf_config_write(struct vty *vty) | |
544 | { | |
545 | struct vrf *vrf; | |
546 | struct zebra_vrf *zvrf; | |
547 | ||
548 | RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) { | |
549 | zvrf = vrf->info; | |
550 | ||
551 | if (!zvrf) | |
552 | continue; | |
553 | ||
554 | if (zvrf_id(zvrf) == VRF_DEFAULT) { | |
555 | if (zvrf->l3vni) | |
556 | vty_out(vty, "vni %u\n", zvrf->l3vni); | |
557 | vty_out(vty, "!\n"); | |
558 | } | |
559 | ||
560 | if (vrf_is_user_cfged(vrf)) { | |
561 | vty_out(vty, "vrf %s\n", zvrf_name(zvrf)); | |
562 | if (zvrf->l3vni) | |
563 | vty_out(vty, " vni %u%s\n", | |
564 | zvrf->l3vni, | |
565 | is_l3vni_for_prefix_routes_only(zvrf->l3vni) ? | |
566 | " prefix-routes-only" :""); | |
567 | zebra_ns_config_write(vty, (struct ns *)vrf->ns_ctxt); | |
568 | vty_out(vty, "!\n"); | |
569 | } | |
570 | ||
571 | static_config(vty, zvrf, AFI_IP, SAFI_UNICAST, "ip route"); | |
572 | static_config(vty, zvrf, AFI_IP, SAFI_MULTICAST, "ip mroute"); | |
573 | static_config(vty, zvrf, AFI_IP6, SAFI_UNICAST, "ipv6 route"); | |
574 | ||
575 | if (vrf->vrf_id != VRF_DEFAULT) | |
576 | vty_out(vty, "!\n"); | |
577 | } | |
578 | return 0; | |
579 | } | |
580 | ||
581 | /* Zebra VRF initialization. */ | |
582 | void zebra_vrf_init(void) | |
583 | { | |
584 | vrf_init(zebra_vrf_new, zebra_vrf_enable, | |
585 | zebra_vrf_disable, zebra_vrf_delete); | |
586 | ||
587 | vrf_cmd_init(vrf_config_write); | |
588 | } |