2 * Area Border Router function.
3 * Copyright (C) 2004 Yasuhiro Ohara
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
18 * along with GNU Zebra; see the file COPYING. If not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
33 #include "ospf6_proto.h"
34 #include "ospf6_route.h"
35 #include "ospf6_lsa.h"
36 #include "ospf6_route.h"
37 #include "ospf6_lsdb.h"
38 #include "ospf6_message.h"
40 #include "ospf6_top.h"
41 #include "ospf6_area.h"
42 #include "ospf6_interface.h"
43 #include "ospf6_neighbor.h"
45 #include "ospf6_flood.h"
46 #include "ospf6_intra.h"
47 #include "ospf6_abr.h"
50 unsigned char conf_debug_ospf6_abr
;
53 ospf6_is_router_abr (struct ospf6
*o
)
56 struct ospf6_area
*oa
;
59 for (node
= listhead (o
->area_list
); node
; nextnode (node
))
61 oa
= OSPF6_AREA (getdata (node
));
62 if (IS_AREA_ENABLED (oa
))
72 ospf6_abr_enable_area (struct ospf6_area
*area
)
74 struct ospf6_area
*oa
;
75 struct ospf6_route
*ro
;
78 for (node
= listhead (area
->ospf6
->area_list
); node
; nextnode (node
))
80 oa
= OSPF6_AREA (getdata (node
));
82 /* update B bit for each area */
83 OSPF6_ROUTER_LSA_SCHEDULE (oa
);
85 /* install other area's configured address range */
88 for (ro
= ospf6_route_head (oa
->range_table
); ro
;
89 ro
= ospf6_route_next (ro
))
91 if (CHECK_FLAG (ro
->flag
, OSPF6_ROUTE_ACTIVE_SUMMARY
))
92 ospf6_abr_originate_summary_to_area (ro
, area
);
97 /* install calculated routes to border routers */
98 for (ro
= ospf6_route_head (area
->ospf6
->brouter_table
); ro
;
99 ro
= ospf6_route_next (ro
))
100 ospf6_abr_originate_summary_to_area (ro
, area
);
102 /* install calculated routes to network (may be rejected by ranges) */
103 for (ro
= ospf6_route_head (area
->ospf6
->route_table
); ro
;
104 ro
= ospf6_route_next (ro
))
105 ospf6_abr_originate_summary_to_area (ro
, area
);
109 ospf6_abr_disable_area (struct ospf6_area
*area
)
111 struct ospf6_area
*oa
;
112 struct ospf6_route
*ro
;
113 struct ospf6_lsa
*old
;
116 /* Withdraw all summary prefixes previously originated */
117 for (ro
= ospf6_route_head (area
->summary_prefix
); ro
;
118 ro
= ospf6_route_next (ro
))
120 old
= ospf6_lsdb_lookup (ro
->path
.origin
.type
, ro
->path
.origin
.id
,
121 area
->ospf6
->router_id
, area
->lsdb
);
123 ospf6_lsa_purge (old
);
124 ospf6_route_remove (ro
, area
->summary_prefix
);
127 /* Withdraw all summary router-routes previously originated */
128 for (ro
= ospf6_route_head (area
->summary_router
); ro
;
129 ro
= ospf6_route_next (ro
))
131 old
= ospf6_lsdb_lookup (ro
->path
.origin
.type
, ro
->path
.origin
.id
,
132 area
->ospf6
->router_id
, area
->lsdb
);
134 ospf6_lsa_purge (old
);
135 ospf6_route_remove (ro
, area
->summary_router
);
138 /* Schedule Router-LSA for each area (ABR status may change) */
139 for (node
= listhead (area
->ospf6
->area_list
); node
; nextnode (node
))
141 oa
= OSPF6_AREA (getdata (node
));
143 /* update B bit for each area */
144 OSPF6_ROUTER_LSA_SCHEDULE (oa
);
148 /* RFC 2328 12.4.3. Summary-LSAs */
150 ospf6_abr_originate_summary_to_area (struct ospf6_route
*route
,
151 struct ospf6_area
*area
)
153 struct ospf6_lsa
*lsa
, *old
= NULL
;
154 struct ospf6_interface
*oi
;
155 struct ospf6_route
*summary
, *range
= NULL
;
156 struct ospf6_area
*route_area
;
157 char buffer
[OSPF6_MAX_LSASIZE
];
158 struct ospf6_lsa_header
*lsa_header
;
160 struct ospf6_inter_prefix_lsa
*prefix_lsa
;
161 struct ospf6_inter_router_lsa
*router_lsa
;
162 struct ospf6_route_table
*summary_table
= NULL
;
167 if (route
->type
== OSPF6_DEST_TYPE_ROUTER
)
169 if (IS_OSPF6_DEBUG_ABR
|| IS_OSPF6_DEBUG_ORIGINATE (INTER_ROUTER
))
172 inet_ntop (AF_INET
, &(ADV_ROUTER_IN_PREFIX (&route
->prefix
)),
174 zlog_info ("Originating summary in area %s for ASBR %s",
177 summary_table
= area
->summary_router
;
181 if (IS_OSPF6_DEBUG_ABR
|| IS_OSPF6_DEBUG_ORIGINATE (INTER_PREFIX
))
184 prefix2str (&route
->prefix
, buf
, sizeof (buf
));
185 zlog_info ("Originating summary in area %s for %s",
188 summary_table
= area
->summary_prefix
;
191 summary
= ospf6_route_lookup (&route
->prefix
, summary_table
);
193 old
= ospf6_lsdb_lookup (summary
->path
.origin
.type
,
194 summary
->path
.origin
.id
,
195 area
->ospf6
->router_id
, area
->lsdb
);
197 /* if this route has just removed, remove corresponding LSA */
198 if (CHECK_FLAG (route
->flag
, OSPF6_ROUTE_REMOVE
))
201 zlog_info ("The route has just removed, purge previous LSA");
203 ospf6_route_remove (summary
, summary_table
);
205 ospf6_lsa_purge (old
);
209 /* Only destination type network, range or ASBR are considered */
210 if (route
->type
!= OSPF6_DEST_TYPE_NETWORK
&&
211 route
->type
!= OSPF6_DEST_TYPE_RANGE
&&
212 (route
->type
!= OSPF6_DEST_TYPE_ROUTER
||
213 ! CHECK_FLAG (route
->path
.router_bits
, OSPF6_ROUTER_BIT_E
)))
216 zlog_info ("Route type is none of network, range nor ASBR, withdraw");
218 ospf6_route_remove (summary
, summary_table
);
220 ospf6_lsa_purge (old
);
224 /* AS External routes are never considered */
225 if (route
->path
.type
== OSPF6_PATH_TYPE_EXTERNAL1
||
226 route
->path
.type
== OSPF6_PATH_TYPE_EXTERNAL2
)
229 zlog_info ("Path type is external, withdraw");
231 ospf6_route_remove (summary
, summary_table
);
233 ospf6_lsa_purge (old
);
237 /* do not generate if the path's area is the same as target area */
238 if (route
->path
.area_id
== area
->area_id
)
241 zlog_info ("The route is in the area itself, ignore");
243 ospf6_route_remove (summary
, summary_table
);
245 ospf6_lsa_purge (old
);
249 /* do not generate if the nexthops belongs to the target area */
250 oi
= ospf6_interface_lookup_by_ifindex (route
->nexthop
[0].ifindex
);
251 if (oi
&& oi
->area
&& oi
->area
== area
)
254 zlog_info ("The route's nexthop is in the same area, ignore");
256 ospf6_route_remove (summary
, summary_table
);
258 ospf6_lsa_purge (old
);
262 /* do not generate if the route cost is greater or equal to LSInfinity */
263 if (route
->path
.cost
>= LS_INFINITY
)
266 zlog_info ("The cost exceeds LSInfinity, withdraw");
268 ospf6_route_remove (summary
, summary_table
);
270 ospf6_lsa_purge (old
);
274 /* if this is a route to ASBR */
275 if (route
->type
== OSPF6_DEST_TYPE_ROUTER
)
277 /* Only the prefered best path is considered */
278 if (! CHECK_FLAG (route
->flag
, OSPF6_ROUTE_BEST
))
281 zlog_info ("This is the secondary path to the ASBR, ignore");
283 ospf6_route_remove (summary
, summary_table
);
285 ospf6_lsa_purge (old
);
289 /* Do not generate if the area is stub */
293 /* if this is an intra-area route, this may be suppressed by aggregation */
294 if (route
->type
== OSPF6_DEST_TYPE_NETWORK
&&
295 route
->path
.type
== OSPF6_PATH_TYPE_INTRA
)
297 /* search for configured address range for the route's area */
298 route_area
= ospf6_area_lookup (route
->path
.area_id
, area
->ospf6
);
300 range
= ospf6_route_lookup_bestmatch (&route
->prefix
,
301 route_area
->range_table
);
303 /* ranges are ignored when originate backbone routes to transit area.
304 Otherwise, if ranges are configured, the route is suppressed. */
305 if (range
&& ! CHECK_FLAG (range
->flag
, OSPF6_ROUTE_REMOVE
) &&
306 (route
->path
.area_id
!= BACKBONE_AREA_ID
||
307 ! IS_AREA_TRANSIT (area
)))
311 prefix2str (&range
->prefix
, buf
, sizeof (buf
));
312 zlog_info ("Suppressed by range %s of area %s",
313 buf
, route_area
->name
);
317 ospf6_route_remove (summary
, summary_table
);
319 ospf6_lsa_purge (old
);
324 /* If this is a configured address range */
325 if (route
->type
== OSPF6_DEST_TYPE_RANGE
)
327 /* If DoNotAdvertise is set */
328 if (CHECK_FLAG (route
->flag
, OSPF6_ROUTE_DO_NOT_ADVERTISE
))
331 zlog_info ("This is the range with DoNotAdvertise set. ignore");
333 ospf6_route_remove (summary
, summary_table
);
335 ospf6_lsa_purge (old
);
339 /* Whether the route have active longer prefix */
340 if (! CHECK_FLAG (route
->flag
, OSPF6_ROUTE_ACTIVE_SUMMARY
))
343 zlog_info ("The range is not active. withdraw");
345 ospf6_route_remove (summary
, summary_table
);
347 ospf6_lsa_purge (old
);
352 /* the route is going to be originated. store it in area's summary_table */
355 summary
= ospf6_route_copy (route
);
356 if (route
->type
== OSPF6_DEST_TYPE_NETWORK
||
357 route
->type
== OSPF6_DEST_TYPE_RANGE
)
358 summary
->path
.origin
.type
= htons (OSPF6_LSTYPE_INTER_PREFIX
);
360 summary
->path
.origin
.type
= htons (OSPF6_LSTYPE_INTER_ROUTER
);
361 summary
->path
.origin
.adv_router
= area
->ospf6
->router_id
;
362 summary
->path
.origin
.id
=
363 ospf6_new_ls_id (summary
->path
.origin
.type
,
364 summary
->path
.origin
.adv_router
, area
->lsdb
);
365 ospf6_route_add (summary
, summary_table
);
369 summary
->type
= route
->type
;
370 gettimeofday (&summary
->changed
, NULL
);
373 summary
->path
.router_bits
= route
->path
.router_bits
;
374 summary
->path
.options
[0] = route
->path
.options
[0];
375 summary
->path
.options
[1] = route
->path
.options
[1];
376 summary
->path
.options
[2] = route
->path
.options
[2];
377 summary
->path
.prefix_options
= route
->path
.prefix_options
;
378 summary
->path
.area_id
= area
->area_id
;
379 summary
->path
.type
= OSPF6_PATH_TYPE_INTER
;
380 summary
->path
.cost
= route
->path
.cost
;
381 summary
->nexthop
[0] = route
->nexthop
[0];
384 memset (buffer
, 0, sizeof (buffer
));
385 lsa_header
= (struct ospf6_lsa_header
*) buffer
;
387 if (route
->type
== OSPF6_DEST_TYPE_ROUTER
)
389 router_lsa
= (struct ospf6_inter_router_lsa
*)
390 ((caddr_t
) lsa_header
+ sizeof (struct ospf6_lsa_header
));
391 p
= (caddr_t
) router_lsa
+ sizeof (struct ospf6_inter_router_lsa
);
393 /* Fill Inter-Area-Router-LSA */
394 router_lsa
->options
[0] = route
->path
.options
[0];
395 router_lsa
->options
[1] = route
->path
.options
[1];
396 router_lsa
->options
[2] = route
->path
.options
[2];
397 OSPF6_ABR_SUMMARY_METRIC_SET (router_lsa
, route
->path
.cost
);
398 router_lsa
->router_id
= ADV_ROUTER_IN_PREFIX (&route
->prefix
);
399 type
= htons (OSPF6_LSTYPE_INTER_ROUTER
);
403 prefix_lsa
= (struct ospf6_inter_prefix_lsa
*)
404 ((caddr_t
) lsa_header
+ sizeof (struct ospf6_lsa_header
));
405 p
= (caddr_t
) prefix_lsa
+ sizeof (struct ospf6_inter_prefix_lsa
);
407 /* Fill Inter-Area-Prefix-LSA */
408 OSPF6_ABR_SUMMARY_METRIC_SET (prefix_lsa
, route
->path
.cost
);
409 prefix_lsa
->prefix
.prefix_length
= route
->prefix
.prefixlen
;
410 prefix_lsa
->prefix
.prefix_options
= route
->path
.prefix_options
;
413 memcpy (p
, &route
->prefix
.u
.prefix6
,
414 OSPF6_PREFIX_SPACE (route
->prefix
.prefixlen
));
415 ospf6_prefix_apply_mask (&prefix_lsa
->prefix
);
416 p
+= OSPF6_PREFIX_SPACE (route
->prefix
.prefixlen
);
417 type
= htons (OSPF6_LSTYPE_INTER_PREFIX
);
420 /* Fill LSA Header */
422 lsa_header
->type
= type
;
423 lsa_header
->id
= summary
->path
.origin
.id
;
424 lsa_header
->adv_router
= area
->ospf6
->router_id
;
426 ospf6_new_ls_seqnum (lsa_header
->type
, lsa_header
->id
,
427 lsa_header
->adv_router
, area
->lsdb
);
428 lsa_header
->length
= htons ((caddr_t
) p
- (caddr_t
) lsa_header
);
431 ospf6_lsa_checksum (lsa_header
);
434 lsa
= ospf6_lsa_create (lsa_header
);
437 ospf6_lsa_originate_area (lsa
, area
);
441 ospf6_abr_range_update (struct ospf6_route
*range
)
444 struct ospf6_route
*ro
;
446 assert (range
->type
== OSPF6_DEST_TYPE_RANGE
);
448 /* update range's cost and active flag */
449 for (ro
= ospf6_route_match_head (&range
->prefix
, ospf6
->route_table
);
450 ro
; ro
= ospf6_route_match_next (&range
->prefix
, ro
))
452 if (ro
->path
.area_id
== range
->path
.area_id
&&
453 ! CHECK_FLAG (ro
->flag
, OSPF6_ROUTE_REMOVE
))
454 cost
= MAX (cost
, ro
->path
.cost
);
457 if (range
->path
.cost
!= cost
)
459 range
->path
.cost
= cost
;
461 if (range
->path
.cost
)
462 SET_FLAG (range
->flag
, OSPF6_ROUTE_ACTIVE_SUMMARY
);
464 UNSET_FLAG (range
->flag
, OSPF6_ROUTE_ACTIVE_SUMMARY
);
466 ospf6_abr_originate_summary (range
);
471 ospf6_abr_originate_summary (struct ospf6_route
*route
)
474 struct ospf6_area
*oa
;
475 struct ospf6_route
*range
= NULL
;
477 if (route
->type
== OSPF6_DEST_TYPE_NETWORK
)
479 oa
= ospf6_area_lookup (route
->path
.area_id
, ospf6
);
480 range
= ospf6_route_lookup_bestmatch (&route
->prefix
, oa
->range_table
);
482 ospf6_abr_range_update (range
);
485 for (node
= listhead (ospf6
->area_list
); node
; nextnode (node
))
487 oa
= (struct ospf6_area
*) getdata (node
);
488 ospf6_abr_originate_summary_to_area (route
, oa
);
492 /* RFC 2328 16.2. Calculating the inter-area routes */
494 ospf6_abr_examin_summary (struct ospf6_lsa
*lsa
, struct ospf6_area
*oa
)
496 struct prefix prefix
, abr_prefix
;
497 struct ospf6_route_table
*table
= NULL
;
498 struct ospf6_route
*range
, *route
, *old
= NULL
;
499 struct ospf6_route
*abr_entry
;
501 char options
[3] = {0, 0, 0};
502 u_int8_t prefix_options
= 0;
504 u_char router_bits
= 0;
509 if (lsa
->header
->type
== htons (OSPF6_LSTYPE_INTER_PREFIX
))
511 struct ospf6_inter_prefix_lsa
*prefix_lsa
;
513 if (IS_OSPF6_DEBUG_EXAMIN (INTER_PREFIX
))
516 zlog_info ("Examin %s in area %s", lsa
->name
, oa
->name
);
519 prefix_lsa
= (struct ospf6_inter_prefix_lsa
*)
520 OSPF6_LSA_HEADER_END (lsa
->header
);
521 prefix
.family
= AF_INET6
;
522 prefix
.prefixlen
= prefix_lsa
->prefix
.prefix_length
;
523 ospf6_prefix_in6_addr (&prefix
.u
.prefix6
, &prefix_lsa
->prefix
);
524 prefix2str (&prefix
, buf
, sizeof (buf
));
525 table
= oa
->ospf6
->route_table
;
526 type
= OSPF6_DEST_TYPE_NETWORK
;
527 prefix_options
= prefix_lsa
->prefix
.prefix_options
;
528 cost
= OSPF6_ABR_SUMMARY_METRIC (prefix_lsa
);
530 else if (lsa
->header
->type
== htons (OSPF6_LSTYPE_INTER_ROUTER
))
532 struct ospf6_inter_router_lsa
*router_lsa
;
534 if (IS_OSPF6_DEBUG_EXAMIN (INTER_ROUTER
))
537 zlog_info ("Examin %s in area %s", lsa
->name
, oa
->name
);
540 router_lsa
= (struct ospf6_inter_router_lsa
*)
541 OSPF6_LSA_HEADER_END (lsa
->header
);
542 ospf6_linkstate_prefix (router_lsa
->router_id
, htonl (0), &prefix
);
543 inet_ntop (AF_INET
, &router_lsa
->router_id
, buf
, sizeof (buf
));
544 table
= oa
->ospf6
->brouter_table
;
545 type
= OSPF6_DEST_TYPE_ROUTER
;
546 options
[0] = router_lsa
->options
[0];
547 options
[1] = router_lsa
->options
[1];
548 options
[2] = router_lsa
->options
[2];
549 cost
= OSPF6_ABR_SUMMARY_METRIC (router_lsa
);
550 SET_FLAG (router_bits
, OSPF6_ROUTER_BIT_E
);
555 /* Find existing route */
556 route
= ospf6_route_lookup (&prefix
, table
);
558 ospf6_route_lock (route
);
559 while (route
&& ospf6_route_is_prefix (&prefix
, route
))
561 if (route
->path
.area_id
== oa
->area_id
&&
562 route
->path
.origin
.type
== lsa
->header
->type
&&
563 route
->path
.origin
.id
== lsa
->header
->id
&&
564 route
->path
.origin
.adv_router
== lsa
->header
->adv_router
)
566 route
= ospf6_route_next (route
);
569 /* (1) if cost == LSInfinity or if the LSA is MaxAge */
570 if (cost
== LS_INFINITY
)
573 zlog_info ("cost is LS_INFINITY, ignore");
575 ospf6_route_remove (old
, table
);
578 if (OSPF6_LSA_IS_MAXAGE (lsa
))
581 zlog_info ("LSA is MaxAge, ignore");
583 ospf6_route_remove (old
, table
);
587 /* (2) if the LSA is self-originated, ignore */
588 if (lsa
->header
->adv_router
== oa
->ospf6
->router_id
)
591 zlog_info ("LSA is self-originated, ignore");
593 ospf6_route_remove (old
, table
);
597 /* (3) if the prefix is equal to an active configured address range */
598 if (lsa
->header
->type
== htons (OSPF6_LSTYPE_INTER_PREFIX
))
600 range
= ospf6_route_lookup (&prefix
, oa
->range_table
);
604 zlog_info ("Prefix is equal to address range, ignore");
606 ospf6_route_remove (old
, table
);
611 /* (4) if the routing table entry for the ABR does not exist */
612 ospf6_linkstate_prefix (lsa
->header
->adv_router
, htonl (0), &abr_prefix
);
613 abr_entry
= ospf6_route_lookup (&abr_prefix
, oa
->ospf6
->brouter_table
);
614 if (abr_entry
== NULL
|| abr_entry
->path
.area_id
!= oa
->area_id
||
615 CHECK_FLAG (abr_entry
->flag
, OSPF6_ROUTE_REMOVE
) ||
616 ! CHECK_FLAG (abr_entry
->path
.router_bits
, OSPF6_ROUTER_BIT_B
))
619 zlog_info ("ABR router entry does not exist, ignore");
621 ospf6_route_remove (old
, table
);
625 /* (5),(6),(7) the path preference is handled by the sorting
626 in the routing table. Always install the path by substituting
627 old route (if any). */
629 route
= ospf6_route_copy (old
);
631 route
= ospf6_route_create ();
634 route
->prefix
= prefix
;
635 route
->path
.origin
.type
= lsa
->header
->type
;
636 route
->path
.origin
.id
= lsa
->header
->id
;
637 route
->path
.origin
.adv_router
= lsa
->header
->adv_router
;
638 route
->path
.router_bits
= router_bits
;
639 route
->path
.options
[0] = options
[0];
640 route
->path
.options
[1] = options
[1];
641 route
->path
.options
[2] = options
[2];
642 route
->path
.prefix_options
= prefix_options
;
643 route
->path
.area_id
= oa
->area_id
;
644 route
->path
.type
= OSPF6_PATH_TYPE_INTER
;
645 route
->path
.cost
= abr_entry
->path
.cost
+ cost
;
646 for (i
= 0; i
< OSPF6_MULTI_PATH_LIMIT
; i
++)
647 route
->nexthop
[i
] = abr_entry
->nexthop
[i
];
650 zlog_info ("Install route: %s", buf
);
651 ospf6_route_add (route
, table
);
655 ospf6_abr_examin_brouter (u_int32_t router_id
)
657 struct ospf6_lsa
*lsa
;
658 struct ospf6_area
*oa
;
662 type
= htons (OSPF6_LSTYPE_INTER_ROUTER
);
663 for (node
= listhead (ospf6
->area_list
); node
; nextnode (node
))
665 oa
= OSPF6_AREA (getdata (node
));
666 for (lsa
= ospf6_lsdb_type_router_head (type
, router_id
, oa
->lsdb
); lsa
;
667 lsa
= ospf6_lsdb_type_router_next (type
, router_id
, lsa
))
668 ospf6_abr_examin_summary (lsa
, oa
);
671 type
= htons (OSPF6_LSTYPE_INTER_PREFIX
);
672 for (node
= listhead (ospf6
->area_list
); node
; nextnode (node
))
674 oa
= OSPF6_AREA (getdata (node
));
675 for (lsa
= ospf6_lsdb_type_router_head (type
, router_id
, oa
->lsdb
); lsa
;
676 lsa
= ospf6_lsdb_type_router_next (type
, router_id
, lsa
))
677 ospf6_abr_examin_summary (lsa
, oa
);
682 /* Display functions */
684 ospf6_inter_area_prefix_lsa_show (struct vty
*vty
, struct ospf6_lsa
*lsa
)
686 struct ospf6_inter_prefix_lsa
*prefix_lsa
;
690 prefix_lsa
= (struct ospf6_inter_prefix_lsa
*)
691 OSPF6_LSA_HEADER_END (lsa
->header
);
693 vty_out (vty
, " Metric: %lu%s",
694 (u_long
) OSPF6_ABR_SUMMARY_METRIC (prefix_lsa
), VNL
);
696 ospf6_prefix_options_printbuf (prefix_lsa
->prefix
.prefix_options
,
698 vty_out (vty
, " Prefix Options: %s%s", buf
, VNL
);
700 ospf6_prefix_in6_addr (&in6
, &prefix_lsa
->prefix
);
701 inet_ntop (AF_INET6
, &in6
, buf
, sizeof (buf
));
702 vty_out (vty
, " Prefix: %s/%d%s", buf
,
703 prefix_lsa
->prefix
.prefix_length
, VNL
);
709 ospf6_inter_area_router_lsa_show (struct vty
*vty
, struct ospf6_lsa
*lsa
)
711 struct ospf6_inter_router_lsa
*router_lsa
;
714 router_lsa
= (struct ospf6_inter_router_lsa
*)
715 OSPF6_LSA_HEADER_END (lsa
->header
);
717 ospf6_options_printbuf (router_lsa
->options
, buf
, sizeof (buf
));
718 vty_out (vty
, " Options: %s%s", buf
, VNL
);
719 vty_out (vty
, " Metric: %lu%s",
720 (u_long
) OSPF6_ABR_SUMMARY_METRIC (router_lsa
), VNL
);
721 inet_ntop (AF_INET
, &router_lsa
->router_id
, buf
, sizeof (buf
));
722 vty_out (vty
, " Destination Router ID: %s%s", buf
, VNL
);
728 DEFUN (debug_ospf6_abr
,
733 "Debug OSPFv3 ABR function\n"
736 OSPF6_DEBUG_ABR_ON ();
740 DEFUN (no_debug_ospf6_abr
,
741 no_debug_ospf6_abr_cmd
,
742 "no debug ospf6 abr",
746 "Debug OSPFv3 ABR function\n"
749 OSPF6_DEBUG_ABR_OFF ();
754 config_write_ospf6_debug_abr (struct vty
*vty
)
756 if (IS_OSPF6_DEBUG_ABR
)
757 vty_out (vty
, "debug ospf6 abr%s", VNL
);
762 install_element_ospf6_debug_abr ()
764 install_element (ENABLE_NODE
, &debug_ospf6_abr_cmd
);
765 install_element (ENABLE_NODE
, &no_debug_ospf6_abr_cmd
);
766 install_element (CONFIG_NODE
, &debug_ospf6_abr_cmd
);
767 install_element (CONFIG_NODE
, &no_debug_ospf6_abr_cmd
);
770 struct ospf6_lsa_handler inter_prefix_handler
=
772 OSPF6_LSTYPE_INTER_PREFIX
,
774 ospf6_inter_area_prefix_lsa_show
777 struct ospf6_lsa_handler inter_router_handler
=
779 OSPF6_LSTYPE_INTER_ROUTER
,
781 ospf6_inter_area_router_lsa_show
787 ospf6_install_lsa_handler (&inter_prefix_handler
);
788 ospf6_install_lsa_handler (&inter_router_handler
);