2 * Copyright (C) 2000 Toshiaki Takada
4 * This file is part of GNU Zebra.
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the Free
18 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34 #include "ospfd/ospfd.h"
35 #include "ospfd/ospf_asbr.h"
36 #include "ospfd/ospf_lsa.h"
37 #include "ospfd/ospf_lsdb.h"
38 #include "ospfd/ospf_ism.h"
39 #include "ospfd/ospf_interface.h"
40 #include "ospfd/ospf_nsm.h"
41 #include "ospfd/ospf_neighbor.h"
42 #include "ospfd/ospf_flood.h"
43 #include "ospfd/ospf_abr.h"
44 #include "ospfd/ospf_spf.h"
45 #include "ospfd/ospf_route.h"
46 #include "ospfd/ospf_zebra.h"
47 /*#include "ospfd/ospf_routemap.h" */
48 #include "ospfd/ospf_vty.h"
49 #include "ospfd/ospf_dump.h"
52 const static char *ospf_network_type_str
[] =
64 /* Utility functions. */
66 ospf_str2area_id (const char *str
, struct in_addr
*area_id
, int *format
)
71 /* match "A.B.C.D". */
72 if (strchr (str
, '.') != NULL
)
74 ret
= inet_aton (str
, area_id
);
77 *format
= OSPF_AREA_ID_FORMAT_ADDRESS
;
79 /* match "<0-4294967295>". */
82 ret
= strtoul (str
, &endptr
, 10);
83 if (*endptr
!= '\0' || (ret
== ULONG_MAX
&& errno
== ERANGE
))
86 area_id
->s_addr
= htonl (ret
);
87 *format
= OSPF_AREA_ID_FORMAT_DECIMAL
;
95 str2distribute_source (const char *str
, int *source
)
101 if (strncmp (str
, "k", 1) == 0)
102 *source
= ZEBRA_ROUTE_KERNEL
;
103 else if (strncmp (str
, "c", 1) == 0)
104 *source
= ZEBRA_ROUTE_CONNECT
;
105 else if (strncmp (str
, "s", 1) == 0)
106 *source
= ZEBRA_ROUTE_STATIC
;
107 else if (strncmp (str
, "r", 1) == 0)
108 *source
= ZEBRA_ROUTE_RIP
;
109 else if (strncmp (str
, "b", 1) == 0)
110 *source
= ZEBRA_ROUTE_BGP
;
118 str2metric (const char *str
, int *metric
)
124 *metric
= strtol (str
, NULL
, 10);
125 if (*metric
< 0 && *metric
> 16777214)
127 /* vty_out (vty, "OSPF metric value is invalid%s", VTY_NEWLINE); */
135 str2metric_type (const char *str
, int *metric_type
)
141 if (strncmp (str
, "1", 1) == 0)
142 *metric_type
= EXTERNAL_METRIC_TYPE_1
;
143 else if (strncmp (str
, "2", 1) == 0)
144 *metric_type
= EXTERNAL_METRIC_TYPE_2
;
152 ospf_oi_count (struct interface
*ifp
)
154 struct route_node
*rn
;
157 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
168 "Enable a routing process\n"
169 "Start OSPF configuration\n")
171 vty
->node
= OSPF_NODE
;
172 vty
->index
= ospf_get ();
177 DEFUN (no_router_ospf
,
181 "Enable a routing process\n"
182 "Start OSPF configuration\n")
186 ospf
= ospf_lookup ();
189 vty_out (vty
, "There isn't active ospf instance%s", VTY_NEWLINE
);
198 DEFUN (ospf_router_id
,
200 "ospf router-id A.B.C.D",
201 "OSPF specific commands\n"
202 "router-id for the OSPF process\n"
203 "OSPF router-id in IP address format\n")
205 struct ospf
*ospf
= vty
->index
;
206 struct in_addr router_id
;
209 ret
= inet_aton (argv
[0], &router_id
);
212 vty_out (vty
, "Please specify Router ID by A.B.C.D%s", VTY_NEWLINE
);
216 ospf
->router_id_static
= router_id
;
218 if (ospf
->t_router_id_update
== NULL
)
219 OSPF_TIMER_ON (ospf
->t_router_id_update
, ospf_router_id_update_timer
,
220 OSPF_ROUTER_ID_UPDATE_DELAY
);
225 ALIAS (ospf_router_id
,
228 "router-id for the OSPF process\n"
229 "OSPF router-id in IP address format\n")
231 DEFUN (no_ospf_router_id
,
232 no_ospf_router_id_cmd
,
235 "OSPF specific commands\n"
236 "router-id for the OSPF process\n")
238 struct ospf
*ospf
= vty
->index
;
240 ospf
->router_id_static
.s_addr
= 0;
242 ospf_router_id_update (ospf
);
247 ALIAS (no_ospf_router_id
,
248 no_router_ospf_id_cmd
,
251 "router-id for the OSPF process\n")
253 DEFUN (ospf_passive_interface
,
254 ospf_passive_interface_addr_cmd
,
255 "passive-interface IFNAME A.B.C.D",
256 "Suppress routing updates on an interface\n"
257 "Interface's name\n")
259 struct interface
*ifp
;
262 struct ospf_if_params
*params
;
263 struct route_node
*rn
;
265 ifp
= if_lookup_by_name (argv
[0]);
269 vty_out (vty
, "Please specify an existing interface%s", VTY_NEWLINE
);
273 params
= IF_DEF_PARAMS (ifp
);
277 ret
= inet_aton(argv
[1], &addr
);
280 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
285 params
= ospf_get_if_params (ifp
, addr
);
286 ospf_if_update_params (ifp
, addr
);
289 SET_IF_PARAM (params
, passive_interface
);
290 params
->passive_interface
= OSPF_IF_PASSIVE
;
292 /* XXX We should call ospf_if_set_multicast on exactly those
293 * interfaces for which the passive property changed. It is too much
294 * work to determine this set, so we do this for every interface.
295 * This is safe and reasonable because ospf_if_set_multicast uses a
296 * record of joined groups to avoid systems calls if the desired
297 * memberships match the current memership.
299 for (rn
= route_top(IF_OIFS(ifp
)); rn
; rn
= route_next (rn
))
301 struct ospf_interface
*oi
= rn
->info
;
303 if (oi
&& (OSPF_IF_PARAM(oi
, passive_interface
) == OSPF_IF_PASSIVE
))
304 ospf_if_set_multicast(oi
);
307 * XXX It is not clear what state transitions the interface needs to
308 * undergo when going from active to passive. Fixing this will
309 * require precise identification of interfaces having such a
316 ALIAS (ospf_passive_interface
,
317 ospf_passive_interface_cmd
,
318 "passive-interface IFNAME",
319 "Suppress routing updates on an interface\n"
320 "Interface's name\n")
322 DEFUN (no_ospf_passive_interface
,
323 no_ospf_passive_interface_addr_cmd
,
324 "no passive-interface IFNAME A.B.C.D",
326 "Allow routing updates on an interface\n"
327 "Interface's name\n")
329 struct interface
*ifp
;
331 struct ospf_if_params
*params
;
333 struct route_node
*rn
;
335 ifp
= if_lookup_by_name (argv
[0]);
339 vty_out (vty
, "Please specify an existing interface%s", VTY_NEWLINE
);
343 params
= IF_DEF_PARAMS (ifp
);
347 ret
= inet_aton(argv
[1], &addr
);
350 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
355 params
= ospf_lookup_if_params (ifp
, addr
);
360 UNSET_IF_PARAM (params
, passive_interface
);
361 params
->passive_interface
= OSPF_IF_ACTIVE
;
363 if (params
!= IF_DEF_PARAMS (ifp
))
365 ospf_free_if_params (ifp
, addr
);
366 ospf_if_update_params (ifp
, addr
);
369 /* XXX We should call ospf_if_set_multicast on exactly those
370 * interfaces for which the passive property changed. It is too much
371 * work to determine this set, so we do this for every interface.
372 * This is safe and reasonable because ospf_if_set_multicast uses a
373 * record of joined groups to avoid systems calls if the desired
374 * memberships match the current memership.
376 for (rn
= route_top(IF_OIFS(ifp
)); rn
; rn
= route_next (rn
))
378 struct ospf_interface
*oi
= rn
->info
;
380 if (oi
&& (OSPF_IF_PARAM(oi
, passive_interface
) == OSPF_IF_ACTIVE
))
381 ospf_if_set_multicast(oi
);
387 ALIAS (no_ospf_passive_interface
,
388 no_ospf_passive_interface_cmd
,
389 "no passive-interface IFNAME",
391 "Allow routing updates on an interface\n"
392 "Interface's name\n")
394 DEFUN (ospf_network_area
,
395 ospf_network_area_cmd
,
396 "network A.B.C.D/M area (A.B.C.D|<0-4294967295>)",
397 "Enable routing on an IP network\n"
398 "OSPF network prefix\n"
399 "Set the OSPF area ID\n"
400 "OSPF area ID in IP address format\n"
401 "OSPF area ID as a decimal value\n")
403 struct ospf
*ospf
= vty
->index
;
404 struct prefix_ipv4 p
;
405 struct in_addr area_id
;
408 /* Get network prefix and Area ID. */
409 VTY_GET_IPV4_PREFIX ("network prefix", p
, argv
[0]);
410 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[1]);
412 ret
= ospf_network_set (ospf
, &p
, area_id
);
415 vty_out (vty
, "There is already same network statement.%s", VTY_NEWLINE
);
422 DEFUN (no_ospf_network_area
,
423 no_ospf_network_area_cmd
,
424 "no network A.B.C.D/M area (A.B.C.D|<0-4294967295>)",
426 "Enable routing on an IP network\n"
427 "OSPF network prefix\n"
428 "Set the OSPF area ID\n"
429 "OSPF area ID in IP address format\n"
430 "OSPF area ID as a decimal value\n")
432 struct ospf
*ospf
= (struct ospf
*) vty
->index
;
433 struct prefix_ipv4 p
;
434 struct in_addr area_id
;
437 /* Get network prefix and Area ID. */
438 VTY_GET_IPV4_PREFIX ("network prefix", p
, argv
[0]);
439 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[1]);
441 ret
= ospf_network_unset (ospf
, &p
, area_id
);
444 vty_out (vty
, "Can't find specified network area configuration.%s",
453 DEFUN (ospf_area_range
,
455 "area (A.B.C.D|<0-4294967295>) range A.B.C.D/M",
456 "OSPF area parameters\n"
457 "OSPF area ID in IP address format\n"
458 "OSPF area ID as a decimal value\n"
459 "Summarize routes matching address/mask (border routers only)\n"
460 "Area range prefix\n")
462 struct ospf
*ospf
= vty
->index
;
463 struct prefix_ipv4 p
;
464 struct in_addr area_id
;
468 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
469 VTY_GET_IPV4_PREFIX ("area range", p
, argv
[1]);
471 ospf_area_range_set (ospf
, area_id
, &p
, OSPF_AREA_RANGE_ADVERTISE
);
474 VTY_GET_INTEGER ("range cost", cost
, argv
[2]);
475 ospf_area_range_cost_set (ospf
, area_id
, &p
, cost
);
481 ALIAS (ospf_area_range
,
482 ospf_area_range_advertise_cmd
,
483 "area (A.B.C.D|<0-4294967295>) range A.B.C.D/M advertise",
484 "OSPF area parameters\n"
485 "OSPF area ID in IP address format\n"
486 "OSPF area ID as a decimal value\n"
487 "OSPF area range for route advertise (default)\n"
488 "Area range prefix\n"
489 "Advertise this range (default)\n")
491 ALIAS (ospf_area_range
,
492 ospf_area_range_cost_cmd
,
493 "area (A.B.C.D|<0-4294967295>) range A.B.C.D/M cost <0-16777215>",
494 "OSPF area parameters\n"
495 "OSPF area ID in IP address format\n"
496 "OSPF area ID as a decimal value\n"
497 "Summarize routes matching address/mask (border routers only)\n"
498 "Area range prefix\n"
499 "User specified metric for this range\n"
500 "Advertised metric for this range\n")
502 ALIAS (ospf_area_range
,
503 ospf_area_range_advertise_cost_cmd
,
504 "area (A.B.C.D|<0-4294967295>) range A.B.C.D/M advertise cost <0-16777215>",
505 "OSPF area parameters\n"
506 "OSPF area ID in IP address format\n"
507 "OSPF area ID as a decimal value\n"
508 "Summarize routes matching address/mask (border routers only)\n"
509 "Area range prefix\n"
510 "Advertise this range (default)\n"
511 "User specified metric for this range\n"
512 "Advertised metric for this range\n")
514 DEFUN (ospf_area_range_not_advertise
,
515 ospf_area_range_not_advertise_cmd
,
516 "area (A.B.C.D|<0-4294967295>) range A.B.C.D/M not-advertise",
517 "OSPF area parameters\n"
518 "OSPF area ID in IP address format\n"
519 "OSPF area ID as a decimal value\n"
520 "Summarize routes matching address/mask (border routers only)\n"
521 "Area range prefix\n"
522 "DoNotAdvertise this range\n")
524 struct ospf
*ospf
= vty
->index
;
525 struct prefix_ipv4 p
;
526 struct in_addr area_id
;
529 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
530 VTY_GET_IPV4_PREFIX ("area range", p
, argv
[1]);
532 ospf_area_range_set (ospf
, area_id
, &p
, 0);
537 DEFUN (no_ospf_area_range
,
538 no_ospf_area_range_cmd
,
539 "no area (A.B.C.D|<0-4294967295>) range A.B.C.D/M",
541 "OSPF area parameters\n"
542 "OSPF area ID in IP address format\n"
543 "OSPF area ID as a decimal value\n"
544 "Summarize routes matching address/mask (border routers only)\n"
545 "Area range prefix\n")
547 struct ospf
*ospf
= vty
->index
;
548 struct prefix_ipv4 p
;
549 struct in_addr area_id
;
552 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
553 VTY_GET_IPV4_PREFIX ("area range", p
, argv
[1]);
555 ospf_area_range_unset (ospf
, area_id
, &p
);
560 ALIAS (no_ospf_area_range
,
561 no_ospf_area_range_advertise_cmd
,
562 "no area (A.B.C.D|<0-4294967295>) range A.B.C.D/M (advertise|not-advertise)",
564 "OSPF area parameters\n"
565 "OSPF area ID in IP address format\n"
566 "OSPF area ID as a decimal value\n"
567 "Summarize routes matching address/mask (border routers only)\n"
568 "Area range prefix\n"
569 "Advertise this range (default)\n"
570 "DoNotAdvertise this range\n")
572 ALIAS (no_ospf_area_range
,
573 no_ospf_area_range_cost_cmd
,
574 "no area (A.B.C.D|<0-4294967295>) range A.B.C.D/M cost <0-16777215>",
576 "OSPF area parameters\n"
577 "OSPF area ID in IP address format\n"
578 "OSPF area ID as a decimal value\n"
579 "Summarize routes matching address/mask (border routers only)\n"
580 "Area range prefix\n"
581 "User specified metric for this range\n"
582 "Advertised metric for this range\n")
584 ALIAS (no_ospf_area_range
,
585 no_ospf_area_range_advertise_cost_cmd
,
586 "no area (A.B.C.D|<0-4294967295>) range A.B.C.D/M advertise cost <0-16777215>",
588 "OSPF area parameters\n"
589 "OSPF area ID in IP address format\n"
590 "OSPF area ID as a decimal value\n"
591 "Summarize routes matching address/mask (border routers only)\n"
592 "Area range prefix\n"
593 "Advertise this range (default)\n"
594 "User specified metric for this range\n"
595 "Advertised metric for this range\n")
597 DEFUN (ospf_area_range_substitute
,
598 ospf_area_range_substitute_cmd
,
599 "area (A.B.C.D|<0-4294967295>) range A.B.C.D/M substitute A.B.C.D/M",
600 "OSPF area parameters\n"
601 "OSPF area ID in IP address format\n"
602 "OSPF area ID as a decimal value\n"
603 "Summarize routes matching address/mask (border routers only)\n"
604 "Area range prefix\n"
605 "Announce area range as another prefix\n"
606 "Network prefix to be announced instead of range\n")
608 struct ospf
*ospf
= vty
->index
;
609 struct prefix_ipv4 p
, s
;
610 struct in_addr area_id
;
613 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
614 VTY_GET_IPV4_PREFIX ("area range", p
, argv
[1]);
615 VTY_GET_IPV4_PREFIX ("substituted network prefix", s
, argv
[2]);
617 ospf_area_range_substitute_set (ospf
, area_id
, &p
, &s
);
622 DEFUN (no_ospf_area_range_substitute
,
623 no_ospf_area_range_substitute_cmd
,
624 "no area (A.B.C.D|<0-4294967295>) range A.B.C.D/M substitute A.B.C.D/M",
626 "OSPF area parameters\n"
627 "OSPF area ID in IP address format\n"
628 "OSPF area ID as a decimal value\n"
629 "Summarize routes matching address/mask (border routers only)\n"
630 "Area range prefix\n"
631 "Announce area range as another prefix\n"
632 "Network prefix to be announced instead of range\n")
634 struct ospf
*ospf
= vty
->index
;
635 struct prefix_ipv4 p
, s
;
636 struct in_addr area_id
;
639 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
640 VTY_GET_IPV4_PREFIX ("area range", p
, argv
[1]);
641 VTY_GET_IPV4_PREFIX ("substituted network prefix", s
, argv
[2]);
643 ospf_area_range_substitute_unset (ospf
, area_id
, &p
);
649 /* Command Handler Logic in VLink stuff is delicate!!
651 ALTER AT YOUR OWN RISK!!!!
653 Various dummy values are used to represent 'NoChange' state for
654 VLink configuration NOT being changed by a VLink command, and
655 special syntax is used within the command strings so that the
656 typed in command verbs can be seen in the configuration command
657 bacckend handler. This is to drastically reduce the verbeage
658 required to coe up with a reasonably compatible Cisco VLink command
660 - Matthew Grant <grantma@anathoth.gen.nz>
661 Wed, 21 Feb 2001 15:13:52 +1300
665 /* Configuration data for virtual links
667 struct ospf_vl_config_data
{
668 struct vty
*vty
; /* vty stuff */
669 struct in_addr area_id
; /* area ID from command line */
670 int format
; /* command line area ID format */
671 struct in_addr vl_peer
; /* command line vl_peer */
672 int auth_type
; /* Authehntication type, if given */
673 char *auth_key
; /* simple password if present */
674 int crypto_key_id
; /* Cryptographic key ID */
675 char *md5_key
; /* MD5 authentication key */
676 int hello_interval
; /* Obvious what these are... */
677 int retransmit_interval
;
683 ospf_vl_config_data_init (struct ospf_vl_config_data
*vl_config
,
686 memset (vl_config
, 0, sizeof (struct ospf_vl_config_data
));
687 vl_config
->auth_type
= OSPF_AUTH_CMD_NOTSEEN
;
688 vl_config
->vty
= vty
;
691 static struct ospf_vl_data
*
692 ospf_find_vl_data (struct ospf
*ospf
, struct ospf_vl_config_data
*vl_config
)
694 struct ospf_area
*area
;
695 struct ospf_vl_data
*vl_data
;
697 struct in_addr area_id
;
699 vty
= vl_config
->vty
;
700 area_id
= vl_config
->area_id
;
702 if (area_id
.s_addr
== OSPF_AREA_BACKBONE
)
705 "Configuring VLs over the backbone is not allowed%s",
709 area
= ospf_area_get (ospf
, area_id
, vl_config
->format
);
711 if (area
->external_routing
!= OSPF_AREA_DEFAULT
)
713 if (vl_config
->format
== OSPF_AREA_ID_FORMAT_ADDRESS
)
714 vty_out (vty
, "Area %s is %s%s",
716 area
->external_routing
== OSPF_AREA_NSSA
?"nssa":"stub",
719 vty_out (vty
, "Area %ld is %s%s",
720 (u_long
)ntohl (area_id
.s_addr
),
721 area
->external_routing
== OSPF_AREA_NSSA
?"nssa":"stub",
726 if ((vl_data
= ospf_vl_lookup (area
, vl_config
->vl_peer
)) == NULL
)
728 vl_data
= ospf_vl_data_new (area
, vl_config
->vl_peer
);
729 if (vl_data
->vl_oi
== NULL
)
731 vl_data
->vl_oi
= ospf_vl_new (ospf
, vl_data
);
732 ospf_vl_add (ospf
, vl_data
);
733 ospf_spf_calculate_schedule (ospf
);
741 ospf_vl_set_security (struct ospf_vl_data
*vl_data
,
742 struct ospf_vl_config_data
*vl_config
)
744 struct crypt_key
*ck
;
746 struct interface
*ifp
= vl_data
->vl_oi
->ifp
;
748 vty
= vl_config
->vty
;
750 if (vl_config
->auth_type
!= OSPF_AUTH_CMD_NOTSEEN
)
752 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), auth_type
);
753 IF_DEF_PARAMS (ifp
)->auth_type
= vl_config
->auth_type
;
756 if (vl_config
->auth_key
)
758 memset(IF_DEF_PARAMS (ifp
)->auth_simple
, 0, OSPF_AUTH_SIMPLE_SIZE
+1);
759 strncpy ((char *) IF_DEF_PARAMS (ifp
)->auth_simple
, vl_config
->auth_key
,
760 OSPF_AUTH_SIMPLE_SIZE
);
762 else if (vl_config
->md5_key
)
764 if (ospf_crypt_key_lookup (IF_DEF_PARAMS (ifp
)->auth_crypt
, vl_config
->crypto_key_id
)
767 vty_out (vty
, "OSPF: Key %d already exists%s",
768 vl_config
->crypto_key_id
, VTY_NEWLINE
);
771 ck
= ospf_crypt_key_new ();
772 ck
->key_id
= vl_config
->crypto_key_id
;
773 memset(ck
->auth_key
, 0, OSPF_AUTH_MD5_SIZE
+1);
774 strncpy ((char *) ck
->auth_key
, vl_config
->md5_key
, OSPF_AUTH_MD5_SIZE
);
776 ospf_crypt_key_add (IF_DEF_PARAMS (ifp
)->auth_crypt
, ck
);
778 else if (vl_config
->crypto_key_id
!= 0)
782 if (ospf_crypt_key_lookup (IF_DEF_PARAMS (ifp
)->auth_crypt
,
783 vl_config
->crypto_key_id
) == NULL
)
785 vty_out (vty
, "OSPF: Key %d does not exist%s",
786 vl_config
->crypto_key_id
, VTY_NEWLINE
);
790 ospf_crypt_key_delete (IF_DEF_PARAMS (ifp
)->auth_crypt
, vl_config
->crypto_key_id
);
798 ospf_vl_set_timers (struct ospf_vl_data
*vl_data
,
799 struct ospf_vl_config_data
*vl_config
)
801 struct interface
*ifp
= ifp
= vl_data
->vl_oi
->ifp
;
802 /* Virtual Link data initialised to defaults, so only set
804 if (vl_config
->hello_interval
)
806 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), v_hello
);
807 IF_DEF_PARAMS (ifp
)->v_hello
= vl_config
->hello_interval
;
810 if (vl_config
->dead_interval
)
812 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), v_wait
);
813 IF_DEF_PARAMS (ifp
)->v_wait
= vl_config
->dead_interval
;
816 if (vl_config
->retransmit_interval
)
818 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), retransmit_interval
);
819 IF_DEF_PARAMS (ifp
)->retransmit_interval
= vl_config
->retransmit_interval
;
822 if (vl_config
->transmit_delay
)
824 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), transmit_delay
);
825 IF_DEF_PARAMS (ifp
)->transmit_delay
= vl_config
->transmit_delay
;
833 /* The business end of all of the above */
835 ospf_vl_set (struct ospf
*ospf
, struct ospf_vl_config_data
*vl_config
)
837 struct ospf_vl_data
*vl_data
;
840 vl_data
= ospf_find_vl_data (ospf
, vl_config
);
844 /* Process this one first as it can have a fatal result, which can
845 only logically occur if the virtual link exists already
846 Thus a command error does not result in a change to the
847 running configuration such as unexpectedly altered timer
849 ret
= ospf_vl_set_security (vl_data
, vl_config
);
850 if (ret
!= CMD_SUCCESS
)
853 /* Set any time based parameters, these area already range checked */
855 ret
= ospf_vl_set_timers (vl_data
, vl_config
);
856 if (ret
!= CMD_SUCCESS
)
863 /* This stuff exists to make specifying all the alias commands A LOT simpler
865 #define VLINK_HELPSTR_IPADDR \
866 "OSPF area parameters\n" \
867 "OSPF area ID in IP address format\n" \
868 "OSPF area ID as a decimal value\n" \
869 "Configure a virtual link\n" \
870 "Router ID of the remote ABR\n"
872 #define VLINK_HELPSTR_AUTHTYPE_SIMPLE \
873 "Enable authentication on this virtual link\n" \
876 #define VLINK_HELPSTR_AUTHTYPE_ALL \
877 VLINK_HELPSTR_AUTHTYPE_SIMPLE \
878 "Use null authentication\n" \
879 "Use message-digest authentication\n"
881 #define VLINK_HELPSTR_TIME_PARAM_NOSECS \
882 "Time between HELLO packets\n" \
883 "Time between retransmitting lost link state advertisements\n" \
884 "Link state transmit delay\n" \
885 "Interval after which a neighbor is declared dead\n"
887 #define VLINK_HELPSTR_TIME_PARAM \
888 VLINK_HELPSTR_TIME_PARAM_NOSECS \
891 #define VLINK_HELPSTR_AUTH_SIMPLE \
892 "Authentication password (key)\n" \
893 "The OSPF password (key)"
895 #define VLINK_HELPSTR_AUTH_MD5 \
896 "Message digest authentication password (key)\n" \
899 "Use MD5 algorithm\n" \
900 "The OSPF password (key)"
902 DEFUN (ospf_area_vlink
,
904 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D",
905 VLINK_HELPSTR_IPADDR
)
907 struct ospf
*ospf
= vty
->index
;
908 struct ospf_vl_config_data vl_config
;
909 char auth_key
[OSPF_AUTH_SIMPLE_SIZE
+1];
910 char md5_key
[OSPF_AUTH_MD5_SIZE
+1];
914 ospf_vl_config_data_init(&vl_config
, vty
);
916 /* Read off first 2 parameters and check them */
917 ret
= ospf_str2area_id (argv
[0], &vl_config
.area_id
, &vl_config
.format
);
920 vty_out (vty
, "OSPF area ID is invalid%s", VTY_NEWLINE
);
924 ret
= inet_aton (argv
[1], &vl_config
.vl_peer
);
927 vty_out (vty
, "Please specify valid Router ID as a.b.c.d%s",
934 /* Thats all folks! - BUGS B. strikes again!!!*/
936 return ospf_vl_set (ospf
, &vl_config
);
939 /* Deal with other parameters */
940 for (i
=2; i
< argc
; i
++)
943 /* vty_out (vty, "argv[%d] - %s%s", i, argv[i], VTY_NEWLINE); */
949 if (i
> 2 || strncmp (argv
[i
], "authentication-", 15) == 0)
951 /* authentication-key - this option can occur anywhere on
952 command line. At start of command line
953 must check for authentication option. */
954 memset (auth_key
, 0, OSPF_AUTH_SIMPLE_SIZE
+ 1);
955 strncpy (auth_key
, argv
[i
+1], OSPF_AUTH_SIMPLE_SIZE
);
956 vl_config
.auth_key
= auth_key
;
959 else if (strncmp (argv
[i
], "authentication", 14) == 0)
961 /* authentication - this option can only occur at start
963 vl_config
.auth_type
= OSPF_AUTH_SIMPLE
;
966 if (strncmp (argv
[i
+1], "n", 1) == 0)
968 /* "authentication null" */
969 vl_config
.auth_type
= OSPF_AUTH_NULL
;
972 else if (strncmp (argv
[i
+1], "m", 1) == 0
973 && strcmp (argv
[i
+1], "message-digest-") != 0)
975 /* "authentication message-digest" */
976 vl_config
.auth_type
= OSPF_AUTH_CRYPTOGRAPHIC
;
984 /* message-digest-key */
986 vl_config
.crypto_key_id
= strtol (argv
[i
], NULL
, 10);
987 if (vl_config
.crypto_key_id
< 0)
990 memset(md5_key
, 0, OSPF_AUTH_MD5_SIZE
+1);
991 strncpy (md5_key
, argv
[i
], OSPF_AUTH_MD5_SIZE
);
992 vl_config
.md5_key
= md5_key
;
998 vl_config
.hello_interval
= strtol (argv
[i
], NULL
, 10);
999 if (vl_config
.hello_interval
< 0)
1004 /* Retransmit Interval */
1006 vl_config
.retransmit_interval
= strtol (argv
[i
], NULL
, 10);
1007 if (vl_config
.retransmit_interval
< 0)
1012 /* Transmit Delay */
1014 vl_config
.transmit_delay
= strtol (argv
[i
], NULL
, 10);
1015 if (vl_config
.transmit_delay
< 0)
1022 vl_config
.dead_interval
= strtol (argv
[i
], NULL
, 10);
1023 if (vl_config
.dead_interval
< 0)
1030 /* Action configuration */
1032 return ospf_vl_set (ospf
, &vl_config
);
1036 DEFUN (no_ospf_area_vlink
,
1037 no_ospf_area_vlink_cmd
,
1038 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D",
1040 VLINK_HELPSTR_IPADDR
)
1042 struct ospf
*ospf
= vty
->index
;
1043 struct ospf_area
*area
;
1044 struct ospf_vl_config_data vl_config
;
1045 struct ospf_vl_data
*vl_data
= NULL
;
1046 char auth_key
[OSPF_AUTH_SIMPLE_SIZE
+1];
1050 ospf_vl_config_data_init(&vl_config
, vty
);
1052 ret
= ospf_str2area_id (argv
[0], &vl_config
.area_id
, &format
);
1055 vty_out (vty
, "OSPF area ID is invalid%s", VTY_NEWLINE
);
1059 area
= ospf_area_lookup_by_area_id (ospf
, vl_config
.area_id
);
1062 vty_out (vty
, "Area does not exist%s", VTY_NEWLINE
);
1066 ret
= inet_aton (argv
[1], &vl_config
.vl_peer
);
1069 vty_out (vty
, "Please specify valid Router ID as a.b.c.d%s",
1076 /* Basic VLink no command */
1077 /* Thats all folks! - BUGS B. strikes again!!!*/
1078 if ((vl_data
= ospf_vl_lookup (area
, vl_config
.vl_peer
)))
1079 ospf_vl_delete (ospf
, vl_data
);
1081 ospf_area_check_free (ospf
, vl_config
.area_id
);
1086 /* If we are down here, we are reseting parameters */
1088 /* Deal with other parameters */
1089 for (i
=2; i
< argc
; i
++)
1091 /* vty_out (vty, "argv[%d] - %s%s", i, argv[i], VTY_NEWLINE); */
1097 if (i
> 2 || strncmp (argv
[i
], "authentication-", 15) == 0)
1099 /* authentication-key - this option can occur anywhere on
1100 command line. At start of command line
1101 must check for authentication option. */
1102 memset (auth_key
, 0, OSPF_AUTH_SIMPLE_SIZE
+ 1);
1103 vl_config
.auth_key
= auth_key
;
1105 else if (strncmp (argv
[i
], "authentication", 14) == 0)
1107 /* authentication - this option can only occur at start
1109 vl_config
.auth_type
= OSPF_AUTH_NOTSET
;
1114 /* message-digest-key */
1115 /* Delete one key */
1117 vl_config
.crypto_key_id
= strtol (argv
[i
], NULL
, 10);
1118 if (vl_config
.crypto_key_id
< 0)
1120 vl_config
.md5_key
= NULL
;
1124 /* Hello interval */
1125 vl_config
.hello_interval
= OSPF_HELLO_INTERVAL_DEFAULT
;
1129 /* Retransmit Interval */
1130 vl_config
.retransmit_interval
= OSPF_RETRANSMIT_INTERVAL_DEFAULT
;
1134 /* Transmit Delay */
1135 vl_config
.transmit_delay
= OSPF_TRANSMIT_DELAY_DEFAULT
;
1141 vl_config
.dead_interval
= OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
;
1147 /* Action configuration */
1149 return ospf_vl_set (ospf
, &vl_config
);
1152 ALIAS (ospf_area_vlink
,
1153 ospf_area_vlink_param1_cmd
,
1154 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1155 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
1156 VLINK_HELPSTR_IPADDR
1157 VLINK_HELPSTR_TIME_PARAM
)
1159 ALIAS (no_ospf_area_vlink
,
1160 no_ospf_area_vlink_param1_cmd
,
1161 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1162 "(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
1164 VLINK_HELPSTR_IPADDR
1165 VLINK_HELPSTR_TIME_PARAM
)
1167 ALIAS (ospf_area_vlink
,
1168 ospf_area_vlink_param2_cmd
,
1169 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1170 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1171 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
1172 VLINK_HELPSTR_IPADDR
1173 VLINK_HELPSTR_TIME_PARAM
1174 VLINK_HELPSTR_TIME_PARAM
)
1176 ALIAS (no_ospf_area_vlink
,
1177 no_ospf_area_vlink_param2_cmd
,
1178 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1179 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1180 "(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
1182 VLINK_HELPSTR_IPADDR
1183 VLINK_HELPSTR_TIME_PARAM
1184 VLINK_HELPSTR_TIME_PARAM
)
1186 ALIAS (ospf_area_vlink
,
1187 ospf_area_vlink_param3_cmd
,
1188 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1189 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1190 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1191 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
1192 VLINK_HELPSTR_IPADDR
1193 VLINK_HELPSTR_TIME_PARAM
1194 VLINK_HELPSTR_TIME_PARAM
1195 VLINK_HELPSTR_TIME_PARAM
)
1197 ALIAS (no_ospf_area_vlink
,
1198 no_ospf_area_vlink_param3_cmd
,
1199 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1200 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1201 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1202 "(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
1204 VLINK_HELPSTR_IPADDR
1205 VLINK_HELPSTR_TIME_PARAM
1206 VLINK_HELPSTR_TIME_PARAM
1207 VLINK_HELPSTR_TIME_PARAM
)
1209 ALIAS (ospf_area_vlink
,
1210 ospf_area_vlink_param4_cmd
,
1211 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1212 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1213 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1214 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1215 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
1216 VLINK_HELPSTR_IPADDR
1217 VLINK_HELPSTR_TIME_PARAM
1218 VLINK_HELPSTR_TIME_PARAM
1219 VLINK_HELPSTR_TIME_PARAM
1220 VLINK_HELPSTR_TIME_PARAM
)
1222 ALIAS (no_ospf_area_vlink
,
1223 no_ospf_area_vlink_param4_cmd
,
1224 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1225 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1226 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1227 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1228 "(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
1230 VLINK_HELPSTR_IPADDR
1231 VLINK_HELPSTR_TIME_PARAM
1232 VLINK_HELPSTR_TIME_PARAM
1233 VLINK_HELPSTR_TIME_PARAM
1234 VLINK_HELPSTR_TIME_PARAM
)
1236 ALIAS (ospf_area_vlink
,
1237 ospf_area_vlink_authtype_args_cmd
,
1238 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1239 "(authentication|) (message-digest|null)",
1240 VLINK_HELPSTR_IPADDR
1241 VLINK_HELPSTR_AUTHTYPE_ALL
)
1243 ALIAS (ospf_area_vlink
,
1244 ospf_area_vlink_authtype_cmd
,
1245 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1246 "(authentication|)",
1247 VLINK_HELPSTR_IPADDR
1248 VLINK_HELPSTR_AUTHTYPE_SIMPLE
)
1250 ALIAS (no_ospf_area_vlink
,
1251 no_ospf_area_vlink_authtype_cmd
,
1252 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1253 "(authentication|)",
1255 VLINK_HELPSTR_IPADDR
1256 VLINK_HELPSTR_AUTHTYPE_SIMPLE
)
1258 ALIAS (ospf_area_vlink
,
1259 ospf_area_vlink_md5_cmd
,
1260 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1261 "(message-digest-key|) <1-255> md5 KEY",
1262 VLINK_HELPSTR_IPADDR
1263 VLINK_HELPSTR_AUTH_MD5
)
1265 ALIAS (no_ospf_area_vlink
,
1266 no_ospf_area_vlink_md5_cmd
,
1267 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1268 "(message-digest-key|) <1-255>",
1270 VLINK_HELPSTR_IPADDR
1271 VLINK_HELPSTR_AUTH_MD5
)
1273 ALIAS (ospf_area_vlink
,
1274 ospf_area_vlink_authkey_cmd
,
1275 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1276 "(authentication-key|) AUTH_KEY",
1277 VLINK_HELPSTR_IPADDR
1278 VLINK_HELPSTR_AUTH_SIMPLE
)
1280 ALIAS (no_ospf_area_vlink
,
1281 no_ospf_area_vlink_authkey_cmd
,
1282 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1283 "(authentication-key|)",
1285 VLINK_HELPSTR_IPADDR
1286 VLINK_HELPSTR_AUTH_SIMPLE
)
1288 ALIAS (ospf_area_vlink
,
1289 ospf_area_vlink_authtype_args_authkey_cmd
,
1290 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1291 "(authentication|) (message-digest|null) "
1292 "(authentication-key|) AUTH_KEY",
1293 VLINK_HELPSTR_IPADDR
1294 VLINK_HELPSTR_AUTHTYPE_ALL
1295 VLINK_HELPSTR_AUTH_SIMPLE
)
1297 ALIAS (ospf_area_vlink
,
1298 ospf_area_vlink_authtype_authkey_cmd
,
1299 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1300 "(authentication|) "
1301 "(authentication-key|) AUTH_KEY",
1302 VLINK_HELPSTR_IPADDR
1303 VLINK_HELPSTR_AUTHTYPE_SIMPLE
1304 VLINK_HELPSTR_AUTH_SIMPLE
)
1306 ALIAS (no_ospf_area_vlink
,
1307 no_ospf_area_vlink_authtype_authkey_cmd
,
1308 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1309 "(authentication|) "
1310 "(authentication-key|)",
1312 VLINK_HELPSTR_IPADDR
1313 VLINK_HELPSTR_AUTHTYPE_SIMPLE
1314 VLINK_HELPSTR_AUTH_SIMPLE
)
1316 ALIAS (ospf_area_vlink
,
1317 ospf_area_vlink_authtype_args_md5_cmd
,
1318 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1319 "(authentication|) (message-digest|null) "
1320 "(message-digest-key|) <1-255> md5 KEY",
1321 VLINK_HELPSTR_IPADDR
1322 VLINK_HELPSTR_AUTHTYPE_ALL
1323 VLINK_HELPSTR_AUTH_MD5
)
1325 ALIAS (ospf_area_vlink
,
1326 ospf_area_vlink_authtype_md5_cmd
,
1327 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1328 "(authentication|) "
1329 "(message-digest-key|) <1-255> md5 KEY",
1330 VLINK_HELPSTR_IPADDR
1331 VLINK_HELPSTR_AUTHTYPE_SIMPLE
1332 VLINK_HELPSTR_AUTH_MD5
)
1334 ALIAS (no_ospf_area_vlink
,
1335 no_ospf_area_vlink_authtype_md5_cmd
,
1336 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1337 "(authentication|) "
1338 "(message-digest-key|)",
1340 VLINK_HELPSTR_IPADDR
1341 VLINK_HELPSTR_AUTHTYPE_SIMPLE
1342 VLINK_HELPSTR_AUTH_MD5
)
1345 DEFUN (ospf_area_shortcut
,
1346 ospf_area_shortcut_cmd
,
1347 "area (A.B.C.D|<0-4294967295>) shortcut (default|enable|disable)",
1348 "OSPF area parameters\n"
1349 "OSPF area ID in IP address format\n"
1350 "OSPF area ID as a decimal value\n"
1351 "Configure the area's shortcutting mode\n"
1352 "Set default shortcutting behavior\n"
1353 "Enable shortcutting through the area\n"
1354 "Disable shortcutting through the area\n")
1356 struct ospf
*ospf
= vty
->index
;
1357 struct ospf_area
*area
;
1358 struct in_addr area_id
;
1362 VTY_GET_OSPF_AREA_ID_NO_BB ("shortcut", area_id
, format
, argv
[0]);
1364 area
= ospf_area_get (ospf
, area_id
, format
);
1366 if (strncmp (argv
[1], "de", 2) == 0)
1367 mode
= OSPF_SHORTCUT_DEFAULT
;
1368 else if (strncmp (argv
[1], "di", 2) == 0)
1369 mode
= OSPF_SHORTCUT_DISABLE
;
1370 else if (strncmp (argv
[1], "e", 1) == 0)
1371 mode
= OSPF_SHORTCUT_ENABLE
;
1375 ospf_area_shortcut_set (ospf
, area
, mode
);
1377 if (ospf
->abr_type
!= OSPF_ABR_SHORTCUT
)
1378 vty_out (vty
, "Shortcut area setting will take effect "
1379 "only when the router is configured as Shortcut ABR%s",
1385 DEFUN (no_ospf_area_shortcut
,
1386 no_ospf_area_shortcut_cmd
,
1387 "no area (A.B.C.D|<0-4294967295>) shortcut (enable|disable)",
1389 "OSPF area parameters\n"
1390 "OSPF area ID in IP address format\n"
1391 "OSPF area ID as a decimal value\n"
1392 "Deconfigure the area's shortcutting mode\n"
1393 "Deconfigure enabled shortcutting through the area\n"
1394 "Deconfigure disabled shortcutting through the area\n")
1396 struct ospf
*ospf
= vty
->index
;
1397 struct ospf_area
*area
;
1398 struct in_addr area_id
;
1401 VTY_GET_OSPF_AREA_ID_NO_BB ("shortcut", area_id
, format
, argv
[0]);
1403 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1407 ospf_area_shortcut_unset (ospf
, area
);
1413 DEFUN (ospf_area_stub
,
1415 "area (A.B.C.D|<0-4294967295>) stub",
1416 "OSPF area parameters\n"
1417 "OSPF area ID in IP address format\n"
1418 "OSPF area ID as a decimal value\n"
1419 "Configure OSPF area as stub\n")
1421 struct ospf
*ospf
= vty
->index
;
1422 struct in_addr area_id
;
1425 VTY_GET_OSPF_AREA_ID_NO_BB ("stub", area_id
, format
, argv
[0]);
1427 ret
= ospf_area_stub_set (ospf
, area_id
);
1430 vty_out (vty
, "First deconfigure all virtual link through this area%s",
1435 ospf_area_no_summary_unset (ospf
, area_id
);
1440 DEFUN (ospf_area_stub_no_summary
,
1441 ospf_area_stub_no_summary_cmd
,
1442 "area (A.B.C.D|<0-4294967295>) stub no-summary",
1443 "OSPF stub parameters\n"
1444 "OSPF area ID in IP address format\n"
1445 "OSPF area ID as a decimal value\n"
1446 "Configure OSPF area as stub\n"
1447 "Do not inject inter-area routes into stub\n")
1449 struct ospf
*ospf
= vty
->index
;
1450 struct in_addr area_id
;
1453 VTY_GET_OSPF_AREA_ID_NO_BB ("stub", area_id
, format
, argv
[0]);
1455 ret
= ospf_area_stub_set (ospf
, area_id
);
1458 vty_out (vty
, "%% Area cannot be stub as it contains a virtual link%s",
1463 ospf_area_no_summary_set (ospf
, area_id
);
1468 DEFUN (no_ospf_area_stub
,
1469 no_ospf_area_stub_cmd
,
1470 "no area (A.B.C.D|<0-4294967295>) stub",
1472 "OSPF area parameters\n"
1473 "OSPF area ID in IP address format\n"
1474 "OSPF area ID as a decimal value\n"
1475 "Configure OSPF area as stub\n")
1477 struct ospf
*ospf
= vty
->index
;
1478 struct in_addr area_id
;
1481 VTY_GET_OSPF_AREA_ID_NO_BB ("stub", area_id
, format
, argv
[0]);
1483 ospf_area_stub_unset (ospf
, area_id
);
1484 ospf_area_no_summary_unset (ospf
, area_id
);
1489 DEFUN (no_ospf_area_stub_no_summary
,
1490 no_ospf_area_stub_no_summary_cmd
,
1491 "no area (A.B.C.D|<0-4294967295>) stub no-summary",
1493 "OSPF area parameters\n"
1494 "OSPF area ID in IP address format\n"
1495 "OSPF area ID as a decimal value\n"
1496 "Configure OSPF area as stub\n"
1497 "Do not inject inter-area routes into area\n")
1499 struct ospf
*ospf
= vty
->index
;
1500 struct in_addr area_id
;
1503 VTY_GET_OSPF_AREA_ID_NO_BB ("stub", area_id
, format
, argv
[0]);
1504 ospf_area_no_summary_unset (ospf
, area_id
);
1510 ospf_area_nssa_cmd_handler (struct vty
*vty
, int argc
, const char *argv
[],
1513 struct ospf
*ospf
= vty
->index
;
1514 struct in_addr area_id
;
1517 VTY_GET_OSPF_AREA_ID_NO_BB ("NSSA", area_id
, format
, argv
[0]);
1519 ret
= ospf_area_nssa_set (ospf
, area_id
);
1522 vty_out (vty
, "%% Area cannot be nssa as it contains a virtual link%s",
1529 if (strncmp (argv
[1], "translate-c", 11) == 0)
1530 ospf_area_nssa_translator_role_set (ospf
, area_id
,
1531 OSPF_NSSA_ROLE_CANDIDATE
);
1532 else if (strncmp (argv
[1], "translate-n", 11) == 0)
1533 ospf_area_nssa_translator_role_set (ospf
, area_id
,
1534 OSPF_NSSA_ROLE_NEVER
);
1535 else if (strncmp (argv
[1], "translate-a", 11) == 0)
1536 ospf_area_nssa_translator_role_set (ospf
, area_id
,
1537 OSPF_NSSA_ROLE_ALWAYS
);
1541 ospf_area_nssa_translator_role_set (ospf
, area_id
,
1542 OSPF_NSSA_ROLE_CANDIDATE
);
1546 ospf_area_no_summary_set (ospf
, area_id
);
1548 ospf_area_no_summary_unset (ospf
, area_id
);
1550 ospf_schedule_abr_task (ospf
);
1555 DEFUN (ospf_area_nssa_translate_no_summary
,
1556 ospf_area_nssa_translate_no_summary_cmd
,
1557 "area (A.B.C.D|<0-4294967295>) nssa (translate-candidate|translate-never|translate-always) no-summary",
1558 "OSPF area parameters\n"
1559 "OSPF area ID in IP address format\n"
1560 "OSPF area ID as a decimal value\n"
1561 "Configure OSPF area as nssa\n"
1562 "Configure NSSA-ABR for translate election (default)\n"
1563 "Configure NSSA-ABR to never translate\n"
1564 "Configure NSSA-ABR to always translate\n"
1565 "Do not inject inter-area routes into nssa\n")
1567 return ospf_area_nssa_cmd_handler (vty
, argc
, argv
, 1);
1570 DEFUN (ospf_area_nssa_translate
,
1571 ospf_area_nssa_translate_cmd
,
1572 "area (A.B.C.D|<0-4294967295>) nssa (translate-candidate|translate-never|translate-always)",
1573 "OSPF area parameters\n"
1574 "OSPF area ID in IP address format\n"
1575 "OSPF area ID as a decimal value\n"
1576 "Configure OSPF area as nssa\n"
1577 "Configure NSSA-ABR for translate election (default)\n"
1578 "Configure NSSA-ABR to never translate\n"
1579 "Configure NSSA-ABR to always translate\n")
1581 return ospf_area_nssa_cmd_handler (vty
, argc
, argv
, 0);
1584 DEFUN (ospf_area_nssa
,
1586 "area (A.B.C.D|<0-4294967295>) nssa",
1587 "OSPF area parameters\n"
1588 "OSPF area ID in IP address format\n"
1589 "OSPF area ID as a decimal value\n"
1590 "Configure OSPF area as nssa\n")
1592 return ospf_area_nssa_cmd_handler (vty
, argc
, argv
, 0);
1595 DEFUN (ospf_area_nssa_no_summary
,
1596 ospf_area_nssa_no_summary_cmd
,
1597 "area (A.B.C.D|<0-4294967295>) nssa no-summary",
1598 "OSPF area parameters\n"
1599 "OSPF area ID in IP address format\n"
1600 "OSPF area ID as a decimal value\n"
1601 "Configure OSPF area as nssa\n"
1602 "Do not inject inter-area routes into nssa\n")
1604 return ospf_area_nssa_cmd_handler (vty
, argc
, argv
, 1);
1607 DEFUN (no_ospf_area_nssa
,
1608 no_ospf_area_nssa_cmd
,
1609 "no area (A.B.C.D|<0-4294967295>) nssa",
1611 "OSPF area parameters\n"
1612 "OSPF area ID in IP address format\n"
1613 "OSPF area ID as a decimal value\n"
1614 "Configure OSPF area as nssa\n")
1616 struct ospf
*ospf
= vty
->index
;
1617 struct in_addr area_id
;
1620 VTY_GET_OSPF_AREA_ID_NO_BB ("NSSA", area_id
, format
, argv
[0]);
1622 ospf_area_nssa_unset (ospf
, area_id
);
1623 ospf_area_no_summary_unset (ospf
, area_id
);
1625 ospf_schedule_abr_task (ospf
);
1630 DEFUN (no_ospf_area_nssa_no_summary
,
1631 no_ospf_area_nssa_no_summary_cmd
,
1632 "no area (A.B.C.D|<0-4294967295>) nssa no-summary",
1634 "OSPF area parameters\n"
1635 "OSPF area ID in IP address format\n"
1636 "OSPF area ID as a decimal value\n"
1637 "Configure OSPF area as nssa\n"
1638 "Do not inject inter-area routes into nssa\n")
1640 struct ospf
*ospf
= vty
->index
;
1641 struct in_addr area_id
;
1644 VTY_GET_OSPF_AREA_ID_NO_BB ("NSSA", area_id
, format
, argv
[0]);
1645 ospf_area_no_summary_unset (ospf
, area_id
);
1650 DEFUN (ospf_area_default_cost
,
1651 ospf_area_default_cost_cmd
,
1652 "area (A.B.C.D|<0-4294967295>) default-cost <0-16777215>",
1653 "OSPF area parameters\n"
1654 "OSPF area ID in IP address format\n"
1655 "OSPF area ID as a decimal value\n"
1656 "Set the summary-default cost of a NSSA or stub area\n"
1657 "Stub's advertised default summary cost\n")
1659 struct ospf
*ospf
= vty
->index
;
1660 struct ospf_area
*area
;
1661 struct in_addr area_id
;
1665 VTY_GET_OSPF_AREA_ID_NO_BB ("default-cost", area_id
, format
, argv
[0]);
1666 VTY_GET_INTEGER_RANGE ("stub default cost", cost
, argv
[1], 0, 16777215);
1668 area
= ospf_area_get (ospf
, area_id
, format
);
1670 if (area
->external_routing
== OSPF_AREA_DEFAULT
)
1672 vty_out (vty
, "The area is neither stub, nor NSSA%s", VTY_NEWLINE
);
1676 area
->default_cost
= cost
;
1681 DEFUN (no_ospf_area_default_cost
,
1682 no_ospf_area_default_cost_cmd
,
1683 "no area (A.B.C.D|<0-4294967295>) default-cost <0-16777215>",
1685 "OSPF area parameters\n"
1686 "OSPF area ID in IP address format\n"
1687 "OSPF area ID as a decimal value\n"
1688 "Set the summary-default cost of a NSSA or stub area\n"
1689 "Stub's advertised default summary cost\n")
1691 struct ospf
*ospf
= vty
->index
;
1692 struct ospf_area
*area
;
1693 struct in_addr area_id
;
1697 VTY_GET_OSPF_AREA_ID_NO_BB ("default-cost", area_id
, format
, argv
[0]);
1698 VTY_GET_INTEGER_RANGE ("stub default cost", cost
, argv
[1], 0, 16777215);
1700 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1704 if (area
->external_routing
== OSPF_AREA_DEFAULT
)
1706 vty_out (vty
, "The area is neither stub, nor NSSA%s", VTY_NEWLINE
);
1710 area
->default_cost
= 1;
1712 ospf_area_check_free (ospf
, area_id
);
1717 DEFUN (ospf_area_export_list
,
1718 ospf_area_export_list_cmd
,
1719 "area (A.B.C.D|<0-4294967295>) export-list NAME",
1720 "OSPF area parameters\n"
1721 "OSPF area ID in IP address format\n"
1722 "OSPF area ID as a decimal value\n"
1723 "Set the filter for networks announced to other areas\n"
1724 "Name of the access-list\n")
1726 struct ospf
*ospf
= vty
->index
;
1727 struct ospf_area
*area
;
1728 struct in_addr area_id
;
1731 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1733 area
= ospf_area_get (ospf
, area_id
, format
);
1734 ospf_area_export_list_set (ospf
, area
, argv
[1]);
1739 DEFUN (no_ospf_area_export_list
,
1740 no_ospf_area_export_list_cmd
,
1741 "no area (A.B.C.D|<0-4294967295>) export-list NAME",
1743 "OSPF area parameters\n"
1744 "OSPF area ID in IP address format\n"
1745 "OSPF area ID as a decimal value\n"
1746 "Unset the filter for networks announced to other areas\n"
1747 "Name of the access-list\n")
1749 struct ospf
*ospf
= vty
->index
;
1750 struct ospf_area
*area
;
1751 struct in_addr area_id
;
1754 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1756 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1760 ospf_area_export_list_unset (ospf
, area
);
1766 DEFUN (ospf_area_import_list
,
1767 ospf_area_import_list_cmd
,
1768 "area (A.B.C.D|<0-4294967295>) import-list NAME",
1769 "OSPF area parameters\n"
1770 "OSPF area ID in IP address format\n"
1771 "OSPF area ID as a decimal value\n"
1772 "Set the filter for networks from other areas announced to the specified one\n"
1773 "Name of the access-list\n")
1775 struct ospf
*ospf
= vty
->index
;
1776 struct ospf_area
*area
;
1777 struct in_addr area_id
;
1780 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1782 area
= ospf_area_get (ospf
, area_id
, format
);
1783 ospf_area_import_list_set (ospf
, area
, argv
[1]);
1788 DEFUN (no_ospf_area_import_list
,
1789 no_ospf_area_import_list_cmd
,
1790 "no area (A.B.C.D|<0-4294967295>) import-list NAME",
1792 "OSPF area parameters\n"
1793 "OSPF area ID in IP address format\n"
1794 "OSPF area ID as a decimal value\n"
1795 "Unset the filter for networks announced to other areas\n"
1796 "Name of the access-list\n")
1798 struct ospf
*ospf
= vty
->index
;
1799 struct ospf_area
*area
;
1800 struct in_addr area_id
;
1803 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1805 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1809 ospf_area_import_list_unset (ospf
, area
);
1814 DEFUN (ospf_area_filter_list
,
1815 ospf_area_filter_list_cmd
,
1816 "area (A.B.C.D|<0-4294967295>) filter-list prefix WORD (in|out)",
1817 "OSPF area parameters\n"
1818 "OSPF area ID in IP address format\n"
1819 "OSPF area ID as a decimal value\n"
1820 "Filter networks between OSPF areas\n"
1821 "Filter prefixes between OSPF areas\n"
1822 "Name of an IP prefix-list\n"
1823 "Filter networks sent to this area\n"
1824 "Filter networks sent from this area\n")
1826 struct ospf
*ospf
= vty
->index
;
1827 struct ospf_area
*area
;
1828 struct in_addr area_id
;
1829 struct prefix_list
*plist
;
1832 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1834 area
= ospf_area_get (ospf
, area_id
, format
);
1835 plist
= prefix_list_lookup (AFI_IP
, argv
[1]);
1836 if (strncmp (argv
[2], "in", 2) == 0)
1838 PREFIX_LIST_IN (area
) = plist
;
1839 if (PREFIX_NAME_IN (area
))
1840 free (PREFIX_NAME_IN (area
));
1842 PREFIX_NAME_IN (area
) = strdup (argv
[1]);
1843 ospf_schedule_abr_task (ospf
);
1847 PREFIX_LIST_OUT (area
) = plist
;
1848 if (PREFIX_NAME_OUT (area
))
1849 free (PREFIX_NAME_OUT (area
));
1851 PREFIX_NAME_OUT (area
) = strdup (argv
[1]);
1852 ospf_schedule_abr_task (ospf
);
1858 DEFUN (no_ospf_area_filter_list
,
1859 no_ospf_area_filter_list_cmd
,
1860 "no area (A.B.C.D|<0-4294967295>) filter-list prefix WORD (in|out)",
1862 "OSPF area parameters\n"
1863 "OSPF area ID in IP address format\n"
1864 "OSPF area ID as a decimal value\n"
1865 "Filter networks between OSPF areas\n"
1866 "Filter prefixes between OSPF areas\n"
1867 "Name of an IP prefix-list\n"
1868 "Filter networks sent to this area\n"
1869 "Filter networks sent from this area\n")
1871 struct ospf
*ospf
= vty
->index
;
1872 struct ospf_area
*area
;
1873 struct in_addr area_id
;
1874 struct prefix_list
*plist
;
1877 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1879 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1880 plist
= prefix_list_lookup (AFI_IP
, argv
[1]);
1881 if (strncmp (argv
[2], "in", 2) == 0)
1883 if (PREFIX_NAME_IN (area
))
1884 if (strcmp (PREFIX_NAME_IN (area
), argv
[1]) != 0)
1887 PREFIX_LIST_IN (area
) = NULL
;
1888 if (PREFIX_NAME_IN (area
))
1889 free (PREFIX_NAME_IN (area
));
1891 PREFIX_NAME_IN (area
) = NULL
;
1893 ospf_schedule_abr_task (ospf
);
1897 if (PREFIX_NAME_OUT (area
))
1898 if (strcmp (PREFIX_NAME_OUT (area
), argv
[1]) != 0)
1901 PREFIX_LIST_OUT (area
) = NULL
;
1902 if (PREFIX_NAME_OUT (area
))
1903 free (PREFIX_NAME_OUT (area
));
1905 PREFIX_NAME_OUT (area
) = NULL
;
1907 ospf_schedule_abr_task (ospf
);
1914 DEFUN (ospf_area_authentication_message_digest
,
1915 ospf_area_authentication_message_digest_cmd
,
1916 "area (A.B.C.D|<0-4294967295>) authentication message-digest",
1917 "OSPF area parameters\n"
1918 "Enable authentication\n"
1919 "Use message-digest authentication\n")
1921 struct ospf
*ospf
= vty
->index
;
1922 struct ospf_area
*area
;
1923 struct in_addr area_id
;
1926 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1928 area
= ospf_area_get (ospf
, area_id
, format
);
1929 area
->auth_type
= OSPF_AUTH_CRYPTOGRAPHIC
;
1934 DEFUN (ospf_area_authentication
,
1935 ospf_area_authentication_cmd
,
1936 "area (A.B.C.D|<0-4294967295>) authentication",
1937 "OSPF area parameters\n"
1938 "OSPF area ID in IP address format\n"
1939 "OSPF area ID as a decimal value\n"
1940 "Enable authentication\n")
1942 struct ospf
*ospf
= vty
->index
;
1943 struct ospf_area
*area
;
1944 struct in_addr area_id
;
1947 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1949 area
= ospf_area_get (ospf
, area_id
, format
);
1950 area
->auth_type
= OSPF_AUTH_SIMPLE
;
1955 DEFUN (no_ospf_area_authentication
,
1956 no_ospf_area_authentication_cmd
,
1957 "no area (A.B.C.D|<0-4294967295>) authentication",
1959 "OSPF area parameters\n"
1960 "OSPF area ID in IP address format\n"
1961 "OSPF area ID as a decimal value\n"
1962 "Enable authentication\n")
1964 struct ospf
*ospf
= vty
->index
;
1965 struct ospf_area
*area
;
1966 struct in_addr area_id
;
1969 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1971 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1975 area
->auth_type
= OSPF_AUTH_NULL
;
1977 ospf_area_check_free (ospf
, area_id
);
1983 DEFUN (ospf_abr_type
,
1985 "ospf abr-type (cisco|ibm|shortcut|standard)",
1986 "OSPF specific commands\n"
1987 "Set OSPF ABR type\n"
1988 "Alternative ABR, cisco implementation\n"
1989 "Alternative ABR, IBM implementation\n"
1991 "Standard behavior (RFC2328)\n")
1993 struct ospf
*ospf
= vty
->index
;
1994 u_char abr_type
= OSPF_ABR_UNKNOWN
;
1996 if (strncmp (argv
[0], "c", 1) == 0)
1997 abr_type
= OSPF_ABR_CISCO
;
1998 else if (strncmp (argv
[0], "i", 1) == 0)
1999 abr_type
= OSPF_ABR_IBM
;
2000 else if (strncmp (argv
[0], "sh", 2) == 0)
2001 abr_type
= OSPF_ABR_SHORTCUT
;
2002 else if (strncmp (argv
[0], "st", 2) == 0)
2003 abr_type
= OSPF_ABR_STAND
;
2007 /* If ABR type value is changed, schedule ABR task. */
2008 if (ospf
->abr_type
!= abr_type
)
2010 ospf
->abr_type
= abr_type
;
2011 ospf_schedule_abr_task (ospf
);
2017 DEFUN (no_ospf_abr_type
,
2018 no_ospf_abr_type_cmd
,
2019 "no ospf abr-type (cisco|ibm|shortcut)",
2021 "OSPF specific commands\n"
2022 "Set OSPF ABR type\n"
2023 "Alternative ABR, cisco implementation\n"
2024 "Alternative ABR, IBM implementation\n"
2027 struct ospf
*ospf
= vty
->index
;
2028 u_char abr_type
= OSPF_ABR_UNKNOWN
;
2030 if (strncmp (argv
[0], "c", 1) == 0)
2031 abr_type
= OSPF_ABR_CISCO
;
2032 else if (strncmp (argv
[0], "i", 1) == 0)
2033 abr_type
= OSPF_ABR_IBM
;
2034 else if (strncmp (argv
[0], "s", 1) == 0)
2035 abr_type
= OSPF_ABR_SHORTCUT
;
2039 /* If ABR type value is changed, schedule ABR task. */
2040 if (ospf
->abr_type
== abr_type
)
2042 ospf
->abr_type
= OSPF_ABR_STAND
;
2043 ospf_schedule_abr_task (ospf
);
2049 DEFUN (ospf_compatible_rfc1583
,
2050 ospf_compatible_rfc1583_cmd
,
2051 "compatible rfc1583",
2052 "OSPF compatibility list\n"
2053 "compatible with RFC 1583\n")
2055 struct ospf
*ospf
= vty
->index
;
2057 if (!CHECK_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
))
2059 SET_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
);
2060 ospf_spf_calculate_schedule (ospf
);
2065 DEFUN (no_ospf_compatible_rfc1583
,
2066 no_ospf_compatible_rfc1583_cmd
,
2067 "no compatible rfc1583",
2069 "OSPF compatibility list\n"
2070 "compatible with RFC 1583\n")
2072 struct ospf
*ospf
= vty
->index
;
2074 if (CHECK_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
))
2076 UNSET_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
);
2077 ospf_spf_calculate_schedule (ospf
);
2082 ALIAS (ospf_compatible_rfc1583
,
2083 ospf_rfc1583_flag_cmd
,
2084 "ospf rfc1583compatibility",
2085 "OSPF specific commands\n"
2086 "Enable the RFC1583Compatibility flag\n")
2088 ALIAS (no_ospf_compatible_rfc1583
,
2089 no_ospf_rfc1583_flag_cmd
,
2090 "no ospf rfc1583compatibility",
2092 "OSPF specific commands\n"
2093 "Disable the RFC1583Compatibility flag\n")
2095 DEFUN (ospf_timers_spf
,
2096 ospf_timers_spf_cmd
,
2097 "timers spf <0-4294967295> <0-4294967295>",
2098 "Adjust routing timers\n"
2100 "Delay between receiving a change to SPF calculation\n"
2101 "Hold time between consecutive SPF calculations\n")
2103 struct ospf
*ospf
= vty
->index
;
2104 u_int32_t delay
, hold
;
2106 VTY_GET_INTEGER ("SPF delay timer", delay
, argv
[0]);
2107 VTY_GET_INTEGER ("SPF hold timer", hold
, argv
[1]);
2109 ospf_timers_spf_set (ospf
, delay
, hold
);
2114 DEFUN (no_ospf_timers_spf
,
2115 no_ospf_timers_spf_cmd
,
2118 "Adjust routing timers\n"
2119 "OSPF SPF timers\n")
2121 struct ospf
*ospf
= vty
->index
;
2123 ospf
->spf_delay
= OSPF_SPF_DELAY_DEFAULT
;
2124 ospf
->spf_holdtime
= OSPF_SPF_HOLDTIME_DEFAULT
;
2130 DEFUN (ospf_neighbor
,
2134 "Neighbor IP address\n")
2136 struct ospf
*ospf
= vty
->index
;
2137 struct in_addr nbr_addr
;
2138 unsigned int priority
= OSPF_NEIGHBOR_PRIORITY_DEFAULT
;
2139 unsigned int interval
= OSPF_POLL_INTERVAL_DEFAULT
;
2141 VTY_GET_IPV4_ADDRESS ("neighbor address", nbr_addr
, argv
[0]);
2144 VTY_GET_INTEGER_RANGE ("neighbor priority", priority
, argv
[1], 0, 255);
2147 VTY_GET_INTEGER_RANGE ("poll interval", interval
, argv
[2], 1, 65535);
2149 ospf_nbr_nbma_set (ospf
, nbr_addr
);
2151 ospf_nbr_nbma_priority_set (ospf
, nbr_addr
, priority
);
2153 ospf_nbr_nbma_poll_interval_set (ospf
, nbr_addr
, priority
);
2158 ALIAS (ospf_neighbor
,
2159 ospf_neighbor_priority_poll_interval_cmd
,
2160 "neighbor A.B.C.D priority <0-255> poll-interval <1-65535>",
2162 "Neighbor IP address\n"
2163 "Neighbor Priority\n"
2165 "Dead Neighbor Polling interval\n"
2168 ALIAS (ospf_neighbor
,
2169 ospf_neighbor_priority_cmd
,
2170 "neighbor A.B.C.D priority <0-255>",
2172 "Neighbor IP address\n"
2173 "Neighbor Priority\n"
2176 DEFUN (ospf_neighbor_poll_interval
,
2177 ospf_neighbor_poll_interval_cmd
,
2178 "neighbor A.B.C.D poll-interval <1-65535>",
2180 "Neighbor IP address\n"
2181 "Dead Neighbor Polling interval\n"
2184 struct ospf
*ospf
= vty
->index
;
2185 struct in_addr nbr_addr
;
2186 unsigned int priority
= OSPF_NEIGHBOR_PRIORITY_DEFAULT
;
2187 unsigned int interval
= OSPF_POLL_INTERVAL_DEFAULT
;
2189 VTY_GET_IPV4_ADDRESS ("neighbor address", nbr_addr
, argv
[0]);
2192 VTY_GET_INTEGER_RANGE ("poll interval", interval
, argv
[1], 1, 65535);
2195 VTY_GET_INTEGER_RANGE ("neighbor priority", priority
, argv
[2], 0, 255);
2197 ospf_nbr_nbma_set (ospf
, nbr_addr
);
2199 ospf_nbr_nbma_poll_interval_set (ospf
, nbr_addr
, interval
);
2201 ospf_nbr_nbma_priority_set (ospf
, nbr_addr
, priority
);
2206 ALIAS (ospf_neighbor_poll_interval
,
2207 ospf_neighbor_poll_interval_priority_cmd
,
2208 "neighbor A.B.C.D poll-interval <1-65535> priority <0-255>",
2210 "Neighbor address\n"
2211 "OSPF dead-router polling interval\n"
2213 "OSPF priority of non-broadcast neighbor\n"
2216 DEFUN (no_ospf_neighbor
,
2217 no_ospf_neighbor_cmd
,
2218 "no neighbor A.B.C.D",
2221 "Neighbor IP address\n")
2223 struct ospf
*ospf
= vty
->index
;
2224 struct in_addr nbr_addr
;
2227 VTY_GET_IPV4_ADDRESS ("neighbor address", nbr_addr
, argv
[0]);
2229 ret
= ospf_nbr_nbma_unset (ospf
, nbr_addr
);
2234 ALIAS (no_ospf_neighbor
,
2235 no_ospf_neighbor_priority_cmd
,
2236 "no neighbor A.B.C.D priority <0-255>",
2239 "Neighbor IP address\n"
2240 "Neighbor Priority\n"
2243 ALIAS (no_ospf_neighbor
,
2244 no_ospf_neighbor_poll_interval_cmd
,
2245 "no neighbor A.B.C.D poll-interval <1-65535>",
2248 "Neighbor IP address\n"
2249 "Dead Neighbor Polling interval\n"
2252 ALIAS (no_ospf_neighbor
,
2253 no_ospf_neighbor_priority_pollinterval_cmd
,
2254 "no neighbor A.B.C.D priority <0-255> poll-interval <1-65535>",
2257 "Neighbor IP address\n"
2258 "Neighbor Priority\n"
2260 "Dead Neighbor Polling interval\n"
2264 DEFUN (ospf_refresh_timer
, ospf_refresh_timer_cmd
,
2265 "refresh timer <10-1800>",
2266 "Adjust refresh parameters\n"
2267 "Set refresh timer\n"
2268 "Timer value in seconds\n")
2270 struct ospf
*ospf
= vty
->index
;
2271 unsigned int interval
;
2273 VTY_GET_INTEGER_RANGE ("refresh timer", interval
, argv
[0], 10, 1800);
2274 interval
= (interval
/ 10) * 10;
2276 ospf_timers_refresh_set (ospf
, interval
);
2281 DEFUN (no_ospf_refresh_timer
, no_ospf_refresh_timer_val_cmd
,
2282 "no refresh timer <10-1800>",
2283 "Adjust refresh parameters\n"
2284 "Unset refresh timer\n"
2285 "Timer value in seconds\n")
2287 struct ospf
*ospf
= vty
->index
;
2288 unsigned int interval
;
2292 VTY_GET_INTEGER_RANGE ("refresh timer", interval
, argv
[0], 10, 1800);
2294 if (ospf
->lsa_refresh_interval
!= interval
||
2295 interval
== OSPF_LSA_REFRESH_INTERVAL_DEFAULT
)
2299 ospf_timers_refresh_unset (ospf
);
2304 ALIAS (no_ospf_refresh_timer
,
2305 no_ospf_refresh_timer_cmd
,
2307 "Adjust refresh parameters\n"
2308 "Unset refresh timer\n")
2310 DEFUN (ospf_auto_cost_reference_bandwidth
,
2311 ospf_auto_cost_reference_bandwidth_cmd
,
2312 "auto-cost reference-bandwidth <1-4294967>",
2313 "Calculate OSPF interface cost according to bandwidth\n"
2314 "Use reference bandwidth method to assign OSPF cost\n"
2315 "The reference bandwidth in terms of Mbits per second\n")
2317 struct ospf
*ospf
= vty
->index
;
2319 struct listnode
*node
;
2320 struct interface
*ifp
;
2322 refbw
= strtol (argv
[0], NULL
, 10);
2323 if (refbw
< 1 || refbw
> 4294967)
2325 vty_out (vty
, "reference-bandwidth value is invalid%s", VTY_NEWLINE
);
2329 /* If reference bandwidth is changed. */
2330 if ((refbw
* 1000) == ospf
->ref_bandwidth
)
2333 ospf
->ref_bandwidth
= refbw
* 1000;
2334 vty_out (vty
, "%% OSPF: Reference bandwidth is changed.%s", VTY_NEWLINE
);
2335 vty_out (vty
, " Please ensure reference bandwidth is consistent across all routers%s", VTY_NEWLINE
);
2337 for (ALL_LIST_ELEMENTS_RO (om
->iflist
, node
, ifp
))
2338 ospf_if_recalculate_output_cost (ifp
);
2343 DEFUN (no_ospf_auto_cost_reference_bandwidth
,
2344 no_ospf_auto_cost_reference_bandwidth_cmd
,
2345 "no auto-cost reference-bandwidth",
2347 "Calculate OSPF interface cost according to bandwidth\n"
2348 "Use reference bandwidth method to assign OSPF cost\n")
2350 struct ospf
*ospf
= vty
->index
;
2351 struct listnode
*node
, *nnode
;
2352 struct interface
*ifp
;
2354 if (ospf
->ref_bandwidth
== OSPF_DEFAULT_REF_BANDWIDTH
)
2357 ospf
->ref_bandwidth
= OSPF_DEFAULT_REF_BANDWIDTH
;
2358 vty_out (vty
, "%% OSPF: Reference bandwidth is changed.%s", VTY_NEWLINE
);
2359 vty_out (vty
, " Please ensure reference bandwidth is consistent across all routers%s", VTY_NEWLINE
);
2361 for (ALL_LIST_ELEMENTS (om
->iflist
, node
, nnode
, ifp
))
2362 ospf_if_recalculate_output_cost (ifp
);
2367 const char *ospf_abr_type_descr_str
[] =
2370 "Standard (RFC2328)",
2372 "Alternative Cisco",
2373 "Alternative Shortcut"
2376 const char *ospf_shortcut_mode_descr_str
[] =
2386 show_ip_ospf_area (struct vty
*vty
, struct ospf_area
*area
)
2389 vty_out (vty
, " Area ID: %s", inet_ntoa (area
->area_id
));
2391 /* Show Area type/mode. */
2392 if (OSPF_IS_AREA_BACKBONE (area
))
2393 vty_out (vty
, " (Backbone)%s", VTY_NEWLINE
);
2396 if (area
->external_routing
== OSPF_AREA_STUB
)
2397 vty_out (vty
, " (Stub%s%s)",
2398 area
->no_summary
? ", no summary" : "",
2399 area
->shortcut_configured
? "; " : "");
2401 else if (area
->external_routing
== OSPF_AREA_NSSA
)
2402 vty_out (vty
, " (NSSA%s%s)",
2403 area
->no_summary
? ", no summary" : "",
2404 area
->shortcut_configured
? "; " : "");
2406 vty_out (vty
, "%s", VTY_NEWLINE
);
2407 vty_out (vty
, " Shortcutting mode: %s",
2408 ospf_shortcut_mode_descr_str
[area
->shortcut_configured
]);
2409 vty_out (vty
, ", S-bit consensus: %s%s",
2410 area
->shortcut_capability
? "ok" : "no", VTY_NEWLINE
);
2413 /* Show number of interfaces. */
2414 vty_out (vty
, " Number of interfaces in this area: Total: %d, "
2415 "Active: %d%s", listcount (area
->oiflist
),
2416 area
->act_ints
, VTY_NEWLINE
);
2418 if (area
->external_routing
== OSPF_AREA_NSSA
)
2420 vty_out (vty
, " It is an NSSA configuration. %s Elected NSSA/ABR performs type-7/type-5 LSA translation. %s", VTY_NEWLINE
, VTY_NEWLINE
);
2421 if (! IS_OSPF_ABR (area
->ospf
))
2422 vty_out (vty
, " It is not ABR, therefore not Translator. %s",
2424 else if (area
->NSSATranslatorState
)
2426 vty_out (vty
, " We are an ABR and ");
2427 if (area
->NSSATranslatorRole
== OSPF_NSSA_ROLE_CANDIDATE
)
2428 vty_out (vty
, "the NSSA Elected Translator. %s",
2430 else if (area
->NSSATranslatorRole
== OSPF_NSSA_ROLE_ALWAYS
)
2431 vty_out (vty
, "always an NSSA Translator. %s",
2436 vty_out (vty
, " We are an ABR, but ");
2437 if (area
->NSSATranslatorRole
== OSPF_NSSA_ROLE_CANDIDATE
)
2438 vty_out (vty
, "not the NSSA Elected Translator. %s",
2441 vty_out (vty
, "never an NSSA Translator. %s",
2446 /* Show number of fully adjacent neighbors. */
2447 vty_out (vty
, " Number of fully adjacent neighbors in this area:"
2448 " %d%s", area
->full_nbrs
, VTY_NEWLINE
);
2450 /* Show authentication type. */
2451 vty_out (vty
, " Area has ");
2452 if (area
->auth_type
== OSPF_AUTH_NULL
)
2453 vty_out (vty
, "no authentication%s", VTY_NEWLINE
);
2454 else if (area
->auth_type
== OSPF_AUTH_SIMPLE
)
2455 vty_out (vty
, "simple password authentication%s", VTY_NEWLINE
);
2456 else if (area
->auth_type
== OSPF_AUTH_CRYPTOGRAPHIC
)
2457 vty_out (vty
, "message digest authentication%s", VTY_NEWLINE
);
2459 if (!OSPF_IS_AREA_BACKBONE (area
))
2460 vty_out (vty
, " Number of full virtual adjacencies going through"
2461 " this area: %d%s", area
->full_vls
, VTY_NEWLINE
);
2463 /* Show SPF calculation times. */
2464 vty_out (vty
, " SPF algorithm executed %d times%s",
2465 area
->spf_calculation
, VTY_NEWLINE
);
2467 /* Show number of LSA. */
2468 vty_out (vty
, " Number of LSA %ld%s", area
->lsdb
->total
, VTY_NEWLINE
);
2469 vty_out (vty
, " Number of router LSA %ld. Checksum Sum 0x%08x%s",
2470 ospf_lsdb_count (area
->lsdb
, OSPF_ROUTER_LSA
),
2471 ospf_lsdb_checksum (area
->lsdb
, OSPF_ROUTER_LSA
), VTY_NEWLINE
);
2472 vty_out (vty
, " Number of network LSA %ld. Checksum Sum 0x%08x%s",
2473 ospf_lsdb_count (area
->lsdb
, OSPF_NETWORK_LSA
),
2474 ospf_lsdb_checksum (area
->lsdb
, OSPF_NETWORK_LSA
), VTY_NEWLINE
);
2475 vty_out (vty
, " Number of summary LSA %ld. Checksum Sum 0x%08x%s",
2476 ospf_lsdb_count (area
->lsdb
, OSPF_SUMMARY_LSA
),
2477 ospf_lsdb_checksum (area
->lsdb
, OSPF_SUMMARY_LSA
), VTY_NEWLINE
);
2478 vty_out (vty
, " Number of ASBR summary LSA %ld. Checksum Sum 0x%08x%s",
2479 ospf_lsdb_count (area
->lsdb
, OSPF_ASBR_SUMMARY_LSA
),
2480 ospf_lsdb_checksum (area
->lsdb
, OSPF_ASBR_SUMMARY_LSA
), VTY_NEWLINE
);
2481 vty_out (vty
, " Number of NSSA LSA %ld. Checksum Sum 0x%08x%s",
2482 ospf_lsdb_count (area
->lsdb
, OSPF_AS_NSSA_LSA
),
2483 ospf_lsdb_checksum (area
->lsdb
, OSPF_AS_NSSA_LSA
), VTY_NEWLINE
);
2484 #ifdef HAVE_OPAQUE_LSA
2485 vty_out (vty
, " Number of opaque link LSA %ld. Checksum Sum 0x%08x%s",
2486 ospf_lsdb_count (area
->lsdb
, OSPF_OPAQUE_LINK_LSA
),
2487 ospf_lsdb_checksum (area
->lsdb
, OSPF_OPAQUE_LINK_LSA
), VTY_NEWLINE
);
2488 vty_out (vty
, " Number of opaque area LSA %ld. Checksum Sum 0x%08x%s",
2489 ospf_lsdb_count (area
->lsdb
, OSPF_OPAQUE_AREA_LSA
),
2490 ospf_lsdb_checksum (area
->lsdb
, OSPF_OPAQUE_AREA_LSA
), VTY_NEWLINE
);
2491 #endif /* HAVE_OPAQUE_LSA */
2492 vty_out (vty
, "%s", VTY_NEWLINE
);
2495 DEFUN (show_ip_ospf
,
2500 "OSPF information\n")
2502 struct listnode
*node
, *nnode
;
2503 struct ospf_area
* area
;
2506 /* Check OSPF is enable. */
2507 ospf
= ospf_lookup ();
2510 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
2514 /* Show Router ID. */
2515 vty_out (vty
, " OSPF Routing Process, Router ID: %s%s",
2516 inet_ntoa (ospf
->router_id
),
2519 /* Show capability. */
2520 vty_out (vty
, " Supports only single TOS (TOS0) routes%s", VTY_NEWLINE
);
2521 vty_out (vty
, " This implementation conforms to RFC2328%s", VTY_NEWLINE
);
2522 vty_out (vty
, " RFC1583Compatibility flag is %s%s",
2523 CHECK_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
) ?
2524 "enabled" : "disabled", VTY_NEWLINE
);
2525 #ifdef HAVE_OPAQUE_LSA
2526 vty_out (vty
, " OpaqueCapability flag is %s%s%s",
2527 CHECK_FLAG (ospf
->config
, OSPF_OPAQUE_CAPABLE
) ?
2528 "enabled" : "disabled",
2529 IS_OPAQUE_LSA_ORIGINATION_BLOCKED (ospf
->opaque
) ?
2530 " (origination blocked)" : "",
2532 #endif /* HAVE_OPAQUE_LSA */
2534 /* Show SPF timers. */
2535 vty_out (vty
, " SPF schedule delay %d secs, Hold time between two SPFs %d secs%s",
2536 ospf
->spf_delay
, ospf
->spf_holdtime
, VTY_NEWLINE
);
2538 /* Show refresh parameters. */
2539 vty_out (vty
, " Refresh timer %d secs%s",
2540 ospf
->lsa_refresh_interval
, VTY_NEWLINE
);
2542 /* Show ABR/ASBR flags. */
2543 if (CHECK_FLAG (ospf
->flags
, OSPF_FLAG_ABR
))
2544 vty_out (vty
, " This router is an ABR, ABR type is: %s%s",
2545 ospf_abr_type_descr_str
[ospf
->abr_type
], VTY_NEWLINE
);
2547 if (CHECK_FLAG (ospf
->flags
, OSPF_FLAG_ASBR
))
2548 vty_out (vty
, " This router is an ASBR "
2549 "(injecting external routing information)%s", VTY_NEWLINE
);
2551 /* Show Number of AS-external-LSAs. */
2552 vty_out (vty
, " Number of external LSA %ld. Checksum Sum 0x%08x%s",
2553 ospf_lsdb_count (ospf
->lsdb
, OSPF_AS_EXTERNAL_LSA
),
2554 ospf_lsdb_checksum (ospf
->lsdb
, OSPF_AS_EXTERNAL_LSA
), VTY_NEWLINE
);
2555 #ifdef HAVE_OPAQUE_LSA
2556 vty_out (vty
, " Number of opaque AS LSA %ld. Checksum Sum 0x%08x%s",
2557 ospf_lsdb_count (ospf
->lsdb
, OSPF_OPAQUE_AS_LSA
),
2558 ospf_lsdb_checksum (ospf
->lsdb
, OSPF_OPAQUE_AS_LSA
), VTY_NEWLINE
);
2559 #endif /* HAVE_OPAQUE_LSA */
2560 /* Show number of areas attached. */
2561 vty_out (vty
, " Number of areas attached to this router: %d%s%s",
2562 listcount (ospf
->areas
), VTY_NEWLINE
, VTY_NEWLINE
);
2564 /* Show each area status. */
2565 for (ALL_LIST_ELEMENTS (ospf
->areas
, node
, nnode
, area
))
2566 show_ip_ospf_area (vty
, area
);
2573 show_ip_ospf_interface_sub (struct vty
*vty
, struct ospf
*ospf
,
2574 struct interface
*ifp
)
2577 struct ospf_neighbor
*nbr
;
2578 struct route_node
*rn
;
2581 /* Is interface up? */
2582 vty_out (vty
, "%s is %s%s", ifp
->name
,
2583 ((is_up
= if_is_operative(ifp
)) ? "up" : "down"), VTY_NEWLINE
);
2584 vty_out (vty
, " ifindex %u, MTU %u bytes, BW %u Kbit %s%s",
2585 ifp
->ifindex
, ifp
->mtu
, ifp
->bandwidth
, if_flag_dump(ifp
->flags
),
2588 /* Is interface OSPF enabled? */
2589 if (ospf_oi_count(ifp
) == 0)
2591 vty_out (vty
, " OSPF not enabled on this interface%s", VTY_NEWLINE
);
2596 vty_out (vty
, " OSPF is enabled, but not running on this interface%s",
2601 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
2603 struct ospf_interface
*oi
= rn
->info
;
2608 /* Show OSPF interface information. */
2609 vty_out (vty
, " Internet Address %s/%d,",
2610 inet_ntoa (oi
->address
->u
.prefix4
), oi
->address
->prefixlen
);
2612 if (oi
->connected
->destination
)
2613 vty_out (vty
, " %s %s,",
2614 ((ifp
->flags
& IFF_POINTOPOINT
) ? "Peer" : "Broadcast"),
2615 inet_ntoa (oi
->connected
->destination
->u
.prefix4
));
2617 vty_out (vty
, " Area %s%s", ospf_area_desc_string (oi
->area
),
2620 vty_out (vty
, " Router ID %s, Network Type %s, Cost: %d%s",
2621 inet_ntoa (ospf
->router_id
), ospf_network_type_str
[oi
->type
],
2622 oi
->output_cost
, VTY_NEWLINE
);
2624 vty_out (vty
, " Transmit Delay is %d sec, State %s, Priority %d%s",
2625 OSPF_IF_PARAM (oi
,transmit_delay
), LOOKUP (ospf_ism_state_msg
, oi
->state
),
2626 PRIORITY (oi
), VTY_NEWLINE
);
2628 /* Show DR information. */
2629 if (DR (oi
).s_addr
== 0)
2630 vty_out (vty
, " No designated router on this network%s", VTY_NEWLINE
);
2633 nbr
= ospf_nbr_lookup_by_addr (oi
->nbrs
, &DR (oi
));
2635 vty_out (vty
, " No designated router on this network%s", VTY_NEWLINE
);
2638 vty_out (vty
, " Designated Router (ID) %s,",
2639 inet_ntoa (nbr
->router_id
));
2640 vty_out (vty
, " Interface Address %s%s",
2641 inet_ntoa (nbr
->address
.u
.prefix4
), VTY_NEWLINE
);
2645 /* Show BDR information. */
2646 if (BDR (oi
).s_addr
== 0)
2647 vty_out (vty
, " No backup designated router on this network%s",
2651 nbr
= ospf_nbr_lookup_by_addr (oi
->nbrs
, &BDR (oi
));
2653 vty_out (vty
, " No backup designated router on this network%s",
2657 vty_out (vty
, " Backup Designated Router (ID) %s,",
2658 inet_ntoa (nbr
->router_id
));
2659 vty_out (vty
, " Interface Address %s%s",
2660 inet_ntoa (nbr
->address
.u
.prefix4
), VTY_NEWLINE
);
2664 vty_out (vty
, " Multicast group memberships:");
2665 if (CHECK_FLAG(oi
->multicast_memberships
, MEMBER_ALLROUTERS
))
2666 vty_out (vty
, " OSPFAllRouters");
2667 if (CHECK_FLAG(oi
->multicast_memberships
, MEMBER_DROUTERS
))
2668 vty_out (vty
, " OSPFDesignatedRouters");
2669 if (!CHECK_FLAG(oi
->multicast_memberships
,
2670 MEMBER_ALLROUTERS
|MEMBER_DROUTERS
))
2671 vty_out (vty
, " <None>");
2672 vty_out (vty
, "%s", VTY_NEWLINE
);
2674 vty_out (vty
, " Timer intervals configured,");
2675 vty_out (vty
, " Hello %d, Dead %d, Wait %d, Retransmit %d%s",
2676 OSPF_IF_PARAM (oi
, v_hello
), OSPF_IF_PARAM (oi
, v_wait
),
2677 OSPF_IF_PARAM (oi
, v_wait
),
2678 OSPF_IF_PARAM (oi
, retransmit_interval
),
2681 if (OSPF_IF_PARAM (oi
, passive_interface
) == OSPF_IF_ACTIVE
)
2682 vty_out (vty
, " Hello due in %s%s",
2683 ospf_timer_dump (oi
->t_hello
, buf
, 9), VTY_NEWLINE
);
2684 else /* OSPF_IF_PASSIVE is set */
2685 vty_out (vty
, " No Hellos (Passive interface)%s", VTY_NEWLINE
);
2687 vty_out (vty
, " Neighbor Count is %d, Adjacent neighbor count is %d%s",
2688 ospf_nbr_count (oi
, 0), ospf_nbr_count (oi
, NSM_Full
),
2693 DEFUN (show_ip_ospf_interface
,
2694 show_ip_ospf_interface_cmd
,
2695 "show ip ospf interface [INTERFACE]",
2698 "OSPF information\n"
2699 "Interface information\n"
2702 struct interface
*ifp
;
2704 struct listnode
*node
;
2706 ospf
= ospf_lookup ();
2708 /* Show All Interfaces. */
2710 for (ALL_LIST_ELEMENTS_RO (iflist
, node
, ifp
))
2711 show_ip_ospf_interface_sub (vty
, ospf
, ifp
);
2712 /* Interface name is specified. */
2715 if ((ifp
= if_lookup_by_name (argv
[0])) == NULL
)
2716 vty_out (vty
, "No such interface name%s", VTY_NEWLINE
);
2718 show_ip_ospf_interface_sub (vty
, ospf
, ifp
);
2725 show_ip_ospf_neighbor_sub (struct vty
*vty
, struct ospf_interface
*oi
)
2727 struct route_node
*rn
;
2728 struct ospf_neighbor
*nbr
;
2732 for (rn
= route_top (oi
->nbrs
); rn
; rn
= route_next (rn
))
2733 if ((nbr
= rn
->info
))
2734 /* Do not show myself. */
2735 if (nbr
!= oi
->nbr_self
)
2736 /* Down state is not shown. */
2737 if (nbr
->state
!= NSM_Down
)
2739 ospf_nbr_state_message (nbr
, msgbuf
, 16);
2741 if (nbr
->state
== NSM_Attempt
&& nbr
->router_id
.s_addr
== 0)
2742 vty_out (vty
, "%-15s %3d %-15s %8s ",
2744 msgbuf
, ospf_timer_dump (nbr
->t_inactivity
, timebuf
, 9));
2746 vty_out (vty
, "%-15s %3d %-15s %8s ",
2747 inet_ntoa (nbr
->router_id
), nbr
->priority
,
2748 msgbuf
, ospf_timer_dump (nbr
->t_inactivity
, timebuf
, 9));
2749 vty_out (vty
, "%-15s ", inet_ntoa (nbr
->src
));
2750 vty_out (vty
, "%-15s %5ld %5ld %5d%s",
2751 IF_NAME (oi
), ospf_ls_retransmit_count (nbr
),
2752 ospf_ls_request_count (nbr
), ospf_db_summary_count (nbr
),
2757 DEFUN (show_ip_ospf_neighbor
,
2758 show_ip_ospf_neighbor_cmd
,
2759 "show ip ospf neighbor",
2762 "OSPF information\n"
2766 struct ospf_interface
*oi
;
2767 struct listnode
*node
;
2769 ospf
= ospf_lookup ();
2772 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
2776 /* Show All neighbors. */
2777 vty_out (vty
, "%sNeighbor ID Pri State Dead "
2778 "Time Address Interface RXmtL "
2779 "RqstL DBsmL%s", VTY_NEWLINE
, VTY_NEWLINE
);
2781 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
2782 show_ip_ospf_neighbor_sub (vty
, oi
);
2787 DEFUN (show_ip_ospf_neighbor_all
,
2788 show_ip_ospf_neighbor_all_cmd
,
2789 "show ip ospf neighbor all",
2792 "OSPF information\n"
2794 "include down status neighbor\n")
2796 struct ospf
*ospf
= vty
->index
;
2797 struct listnode
*node
;
2798 struct ospf_interface
*oi
;
2802 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
2806 /* Show All neighbors. */
2807 vty_out (vty
, "%sNeighbor ID Pri State Dead "
2808 "Time Address Interface RXmtL "
2809 "RqstL DBsmL%s", VTY_NEWLINE
, VTY_NEWLINE
);
2811 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
2813 struct listnode
*nbr_node
;
2814 struct ospf_nbr_nbma
*nbr_nbma
;
2816 show_ip_ospf_neighbor_sub (vty
, oi
);
2818 /* print Down neighbor status */
2819 for (ALL_LIST_ELEMENTS_RO (oi
->nbr_nbma
, nbr_node
, nbr_nbma
))
2821 if (nbr_nbma
->nbr
== NULL
2822 || nbr_nbma
->nbr
->state
== NSM_Down
)
2824 vty_out (vty
, "%-15s %3d %-15s %8s ",
2825 "-", nbr_nbma
->priority
, "Down", "-");
2826 vty_out (vty
, "%-15s %-15s %5d %5d %5d%s",
2827 inet_ntoa (nbr_nbma
->addr
), IF_NAME (oi
),
2828 0, 0, 0, VTY_NEWLINE
);
2836 DEFUN (show_ip_ospf_neighbor_int
,
2837 show_ip_ospf_neighbor_int_cmd
,
2838 "show ip ospf neighbor A.B.C.D",
2841 "OSPF information\n"
2846 struct ospf_interface
*oi
;
2847 struct in_addr addr
;
2850 ret
= inet_aton (argv
[0], &addr
);
2853 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
2858 ospf
= ospf_lookup ();
2861 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
2865 if ((oi
= ospf_if_is_configured (ospf
, &addr
)) == NULL
)
2866 vty_out (vty
, "No such interface address%s", VTY_NEWLINE
);
2869 vty_out (vty
, "%sNeighbor ID Pri State Dead "
2870 "Time Address Interface RXmtL "
2871 "RqstL DBsmL%s", VTY_NEWLINE
, VTY_NEWLINE
);
2872 show_ip_ospf_neighbor_sub (vty
, oi
);
2879 show_ip_ospf_nbr_nbma_detail_sub (struct vty
*vty
, struct ospf_interface
*oi
,
2880 struct ospf_nbr_nbma
*nbr_nbma
)
2884 /* Show neighbor ID. */
2885 vty_out (vty
, " Neighbor %s,", "-");
2887 /* Show interface address. */
2888 vty_out (vty
, " interface address %s%s",
2889 inet_ntoa (nbr_nbma
->addr
), VTY_NEWLINE
);
2891 vty_out (vty
, " In the area %s via interface %s%s",
2892 ospf_area_desc_string (oi
->area
), IF_NAME (oi
), VTY_NEWLINE
);
2893 /* Show neighbor priority and state. */
2894 vty_out (vty
, " Neighbor priority is %d, State is %s,",
2895 nbr_nbma
->priority
, "Down");
2896 /* Show state changes. */
2897 vty_out (vty
, " %d state changes%s", nbr_nbma
->state_change
, VTY_NEWLINE
);
2899 /* Show PollInterval */
2900 vty_out (vty
, " Poll interval %d%s", nbr_nbma
->v_poll
, VTY_NEWLINE
);
2902 /* Show poll-interval timer. */
2903 vty_out (vty
, " Poll timer due in %s%s",
2904 ospf_timer_dump (nbr_nbma
->t_poll
, timebuf
, 9), VTY_NEWLINE
);
2906 /* Show poll-interval timer thread. */
2907 vty_out (vty
, " Thread Poll Timer %s%s",
2908 nbr_nbma
->t_poll
!= NULL
? "on" : "off", VTY_NEWLINE
);
2912 show_ip_ospf_neighbor_detail_sub (struct vty
*vty
, struct ospf_interface
*oi
,
2913 struct ospf_neighbor
*nbr
)
2917 /* Show neighbor ID. */
2918 if (nbr
->state
== NSM_Attempt
&& nbr
->router_id
.s_addr
== 0)
2919 vty_out (vty
, " Neighbor %s,", "-");
2921 vty_out (vty
, " Neighbor %s,", inet_ntoa (nbr
->router_id
));
2923 /* Show interface address. */
2924 vty_out (vty
, " interface address %s%s",
2925 inet_ntoa (nbr
->address
.u
.prefix4
), VTY_NEWLINE
);
2927 vty_out (vty
, " In the area %s via interface %s%s",
2928 ospf_area_desc_string (oi
->area
), oi
->ifp
->name
, VTY_NEWLINE
);
2929 /* Show neighbor priority and state. */
2930 vty_out (vty
, " Neighbor priority is %d, State is %s,",
2931 nbr
->priority
, LOOKUP (ospf_nsm_state_msg
, nbr
->state
));
2932 /* Show state changes. */
2933 vty_out (vty
, " %d state changes%s", nbr
->state_change
, VTY_NEWLINE
);
2935 /* Show Designated Rotuer ID. */
2936 vty_out (vty
, " DR is %s,", inet_ntoa (nbr
->d_router
));
2937 /* Show Backup Designated Rotuer ID. */
2938 vty_out (vty
, " BDR is %s%s", inet_ntoa (nbr
->bd_router
), VTY_NEWLINE
);
2940 vty_out (vty
, " Options %d %s%s", nbr
->options
,
2941 ospf_options_dump (nbr
->options
), VTY_NEWLINE
);
2942 /* Show Router Dead interval timer. */
2943 vty_out (vty
, " Dead timer due in %s%s",
2944 ospf_timer_dump (nbr
->t_inactivity
, timebuf
, 9), VTY_NEWLINE
);
2945 /* Show Database Summary list. */
2946 vty_out (vty
, " Database Summary List %d%s",
2947 ospf_db_summary_count (nbr
), VTY_NEWLINE
);
2948 /* Show Link State Request list. */
2949 vty_out (vty
, " Link State Request List %ld%s",
2950 ospf_ls_request_count (nbr
), VTY_NEWLINE
);
2951 /* Show Link State Retransmission list. */
2952 vty_out (vty
, " Link State Retransmission List %ld%s",
2953 ospf_ls_retransmit_count (nbr
), VTY_NEWLINE
);
2954 /* Show inactivity timer thread. */
2955 vty_out (vty
, " Thread Inactivity Timer %s%s",
2956 nbr
->t_inactivity
!= NULL
? "on" : "off", VTY_NEWLINE
);
2957 /* Show Database Description retransmission thread. */
2958 vty_out (vty
, " Thread Database Description Retransmision %s%s",
2959 nbr
->t_db_desc
!= NULL
? "on" : "off", VTY_NEWLINE
);
2960 /* Show Link State Request Retransmission thread. */
2961 vty_out (vty
, " Thread Link State Request Retransmission %s%s",
2962 nbr
->t_ls_req
!= NULL
? "on" : "off", VTY_NEWLINE
);
2963 /* Show Link State Update Retransmission thread. */
2964 vty_out (vty
, " Thread Link State Update Retransmission %s%s%s",
2965 nbr
->t_ls_upd
!= NULL
? "on" : "off", VTY_NEWLINE
, VTY_NEWLINE
);
2968 DEFUN (show_ip_ospf_neighbor_id
,
2969 show_ip_ospf_neighbor_id_cmd
,
2970 "show ip ospf neighbor A.B.C.D",
2973 "OSPF information\n"
2978 struct listnode
*node
;
2979 struct ospf_neighbor
*nbr
;
2980 struct ospf_interface
*oi
;
2981 struct in_addr router_id
;
2984 ret
= inet_aton (argv
[0], &router_id
);
2987 vty_out (vty
, "Please specify Neighbor ID by A.B.C.D%s", VTY_NEWLINE
);
2991 ospf
= ospf_lookup ();
2994 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
2998 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
2999 if ((nbr
= ospf_nbr_lookup_by_routerid (oi
->nbrs
, &router_id
)))
3001 show_ip_ospf_neighbor_detail_sub (vty
, oi
, nbr
);
3005 /* Nothing to show. */
3009 DEFUN (show_ip_ospf_neighbor_detail
,
3010 show_ip_ospf_neighbor_detail_cmd
,
3011 "show ip ospf neighbor detail",
3014 "OSPF information\n"
3016 "detail of all neighbors\n")
3019 struct ospf_interface
*oi
;
3020 struct listnode
*node
;
3022 ospf
= ospf_lookup ();
3025 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
3029 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
3031 struct route_node
*rn
;
3032 struct ospf_neighbor
*nbr
;
3034 for (rn
= route_top (oi
->nbrs
); rn
; rn
= route_next (rn
))
3035 if ((nbr
= rn
->info
))
3036 if (nbr
!= oi
->nbr_self
)
3037 if (nbr
->state
!= NSM_Down
)
3038 show_ip_ospf_neighbor_detail_sub (vty
, oi
, nbr
);
3044 DEFUN (show_ip_ospf_neighbor_detail_all
,
3045 show_ip_ospf_neighbor_detail_all_cmd
,
3046 "show ip ospf neighbor detail all",
3049 "OSPF information\n"
3051 "detail of all neighbors\n"
3052 "include down status neighbor\n")
3055 struct listnode
*node
;
3056 struct ospf_interface
*oi
;
3058 ospf
= ospf_lookup ();
3061 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
3065 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
3067 struct route_node
*rn
;
3068 struct ospf_neighbor
*nbr
;
3069 struct ospf_nbr_nbma
*nbr_nbma
;
3071 for (rn
= route_top (oi
->nbrs
); rn
; rn
= route_next (rn
))
3072 if ((nbr
= rn
->info
))
3073 if (nbr
!= oi
->nbr_self
)
3074 if (oi
->type
== OSPF_IFTYPE_NBMA
&& nbr
->state
!= NSM_Down
)
3075 show_ip_ospf_neighbor_detail_sub (vty
, oi
, rn
->info
);
3077 if (oi
->type
== OSPF_IFTYPE_NBMA
)
3079 struct listnode
*nd
;
3081 for (ALL_LIST_ELEMENTS_RO (oi
->nbr_nbma
, nd
, nbr_nbma
))
3082 if (nbr_nbma
->nbr
== NULL
3083 || nbr_nbma
->nbr
->state
== NSM_Down
)
3084 show_ip_ospf_nbr_nbma_detail_sub (vty
, oi
, nbr_nbma
);
3091 DEFUN (show_ip_ospf_neighbor_int_detail
,
3092 show_ip_ospf_neighbor_int_detail_cmd
,
3093 "show ip ospf neighbor A.B.C.D detail",
3096 "OSPF information\n"
3098 "Interface address\n"
3099 "detail of all neighbors")
3102 struct ospf_interface
*oi
;
3103 struct in_addr addr
;
3106 ret
= inet_aton (argv
[0], &addr
);
3109 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
3114 ospf
= ospf_lookup ();
3117 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
3121 if ((oi
= ospf_if_is_configured (ospf
, &addr
)) == NULL
)
3122 vty_out (vty
, "No such interface address%s", VTY_NEWLINE
);
3125 struct route_node
*rn
;
3126 struct ospf_neighbor
*nbr
;
3128 for (rn
= route_top (oi
->nbrs
); rn
; rn
= route_next (rn
))
3129 if ((nbr
= rn
->info
))
3130 if (nbr
!= oi
->nbr_self
)
3131 if (nbr
->state
!= NSM_Down
)
3132 show_ip_ospf_neighbor_detail_sub (vty
, oi
, nbr
);
3139 /* Show functions */
3141 show_lsa_summary (struct vty
*vty
, struct ospf_lsa
*lsa
, int self
)
3143 struct router_lsa
*rl
;
3144 struct summary_lsa
*sl
;
3145 struct as_external_lsa
*asel
;
3146 struct prefix_ipv4 p
;
3149 /* If self option is set, check LSA self flag. */
3150 if (self
== 0 || IS_LSA_SELF (lsa
))
3152 /* LSA common part show. */
3153 vty_out (vty
, "%-15s ", inet_ntoa (lsa
->data
->id
));
3154 vty_out (vty
, "%-15s %4d 0x%08lx 0x%04x",
3155 inet_ntoa (lsa
->data
->adv_router
), LS_AGE (lsa
),
3156 (u_long
)ntohl (lsa
->data
->ls_seqnum
), ntohs (lsa
->data
->checksum
));
3157 /* LSA specific part show. */
3158 switch (lsa
->data
->type
)
3160 case OSPF_ROUTER_LSA
:
3161 rl
= (struct router_lsa
*) lsa
->data
;
3162 vty_out (vty
, " %-d", ntohs (rl
->links
));
3164 case OSPF_SUMMARY_LSA
:
3165 sl
= (struct summary_lsa
*) lsa
->data
;
3168 p
.prefix
= sl
->header
.id
;
3169 p
.prefixlen
= ip_masklen (sl
->mask
);
3170 apply_mask_ipv4 (&p
);
3172 vty_out (vty
, " %s/%d", inet_ntoa (p
.prefix
), p
.prefixlen
);
3174 case OSPF_AS_EXTERNAL_LSA
:
3175 case OSPF_AS_NSSA_LSA
:
3176 asel
= (struct as_external_lsa
*) lsa
->data
;
3179 p
.prefix
= asel
->header
.id
;
3180 p
.prefixlen
= ip_masklen (asel
->mask
);
3181 apply_mask_ipv4 (&p
);
3183 vty_out (vty
, " %s %s/%d [0x%lx]",
3184 IS_EXTERNAL_METRIC (asel
->e
[0].tos
) ? "E2" : "E1",
3185 inet_ntoa (p
.prefix
), p
.prefixlen
,
3186 (u_long
)ntohl (asel
->e
[0].route_tag
));
3188 case OSPF_NETWORK_LSA
:
3189 case OSPF_ASBR_SUMMARY_LSA
:
3190 #ifdef HAVE_OPAQUE_LSA
3191 case OSPF_OPAQUE_LINK_LSA
:
3192 case OSPF_OPAQUE_AREA_LSA
:
3193 case OSPF_OPAQUE_AS_LSA
:
3194 #endif /* HAVE_OPAQUE_LSA */
3198 vty_out (vty
, VTY_NEWLINE
);
3204 const char *show_database_desc
[] =
3207 "Router Link States",
3209 "Summary Link States",
3210 "ASBR-Summary Link States",
3211 "AS External Link States",
3212 "Group Membership LSA",
3213 "NSSA-external Link States",
3214 #ifdef HAVE_OPAQUE_LSA
3216 "Link-Local Opaque-LSA",
3217 "Area-Local Opaque-LSA",
3218 "AS-external Opaque-LSA",
3219 #endif /* HAVE_OPAQUE_LSA */
3222 #define SHOW_OSPF_COMMON_HEADER \
3223 "Link ID ADV Router Age Seq# CkSum"
3225 const char *show_database_header
[] =
3228 "Link ID ADV Router Age Seq# CkSum Link count",
3229 "Link ID ADV Router Age Seq# CkSum",
3230 "Link ID ADV Router Age Seq# CkSum Route",
3231 "Link ID ADV Router Age Seq# CkSum",
3232 "Link ID ADV Router Age Seq# CkSum Route",
3233 " --- header for Group Member ----",
3234 "Link ID ADV Router Age Seq# CkSum Route",
3235 #ifdef HAVE_OPAQUE_LSA
3237 "Opaque-Type/Id ADV Router Age Seq# CkSum",
3238 "Opaque-Type/Id ADV Router Age Seq# CkSum",
3239 "Opaque-Type/Id ADV Router Age Seq# CkSum",
3240 #endif /* HAVE_OPAQUE_LSA */
3243 const char *show_lsa_flags
[] =
3254 show_ip_ospf_database_header (struct vty
*vty
, struct ospf_lsa
*lsa
)
3256 struct router_lsa
*rlsa
= (struct router_lsa
*) lsa
->data
;
3258 vty_out (vty
, " LS age: %d%s", LS_AGE (lsa
), VTY_NEWLINE
);
3259 vty_out (vty
, " Options: 0x%-2x : %s%s",
3261 ospf_options_dump(lsa
->data
->options
),
3263 vty_out (vty
, " LS Flags: 0x%-2x %s%s",
3265 ((lsa
->flags
& OSPF_LSA_LOCAL_XLT
) ? "(Translated from Type-7)" : ""),
3268 if (lsa
->data
->type
== OSPF_ROUTER_LSA
)
3270 vty_out (vty
, " Flags: 0x%x" , rlsa
->flags
);
3273 vty_out (vty
, " :%s%s%s%s",
3274 IS_ROUTER_LSA_BORDER (rlsa
) ? " ABR" : "",
3275 IS_ROUTER_LSA_EXTERNAL (rlsa
) ? " ASBR" : "",
3276 IS_ROUTER_LSA_VIRTUAL (rlsa
) ? " VL-endpoint" : "",
3277 IS_ROUTER_LSA_SHORTCUT (rlsa
) ? " Shortcut" : "");
3279 vty_out (vty
, "%s", VTY_NEWLINE
);
3281 vty_out (vty
, " LS Type: %s%s",
3282 LOOKUP (ospf_lsa_type_msg
, lsa
->data
->type
), VTY_NEWLINE
);
3283 vty_out (vty
, " Link State ID: %s %s%s", inet_ntoa (lsa
->data
->id
),
3284 LOOKUP (ospf_link_state_id_type_msg
, lsa
->data
->type
), VTY_NEWLINE
);
3285 vty_out (vty
, " Advertising Router: %s%s",
3286 inet_ntoa (lsa
->data
->adv_router
), VTY_NEWLINE
);
3287 vty_out (vty
, " LS Seq Number: %08lx%s", (u_long
)ntohl (lsa
->data
->ls_seqnum
),
3289 vty_out (vty
, " Checksum: 0x%04x%s", ntohs (lsa
->data
->checksum
),
3291 vty_out (vty
, " Length: %d%s", ntohs (lsa
->data
->length
), VTY_NEWLINE
);
3294 const char *link_type_desc
[] =
3297 "another Router (point-to-point)",
3298 "a Transit Network",
3303 const char *link_id_desc
[] =
3306 "Neighboring Router ID",
3307 "Designated Router address",
3309 "Neighboring Router ID",
3312 const char *link_data_desc
[] =
3315 "Router Interface address",
3316 "Router Interface address",
3318 "Router Interface address",
3321 /* Show router-LSA each Link information. */
3323 show_ip_ospf_database_router_links (struct vty
*vty
,
3324 struct router_lsa
*rl
)
3328 len
= ntohs (rl
->header
.length
) - 4;
3329 for (i
= 0; i
< ntohs (rl
->links
) && len
> 0; len
-= 12, i
++)
3331 type
= rl
->link
[i
].type
;
3333 vty_out (vty
, " Link connected to: %s%s",
3334 link_type_desc
[type
], VTY_NEWLINE
);
3335 vty_out (vty
, " (Link ID) %s: %s%s", link_id_desc
[type
],
3336 inet_ntoa (rl
->link
[i
].link_id
), VTY_NEWLINE
);
3337 vty_out (vty
, " (Link Data) %s: %s%s", link_data_desc
[type
],
3338 inet_ntoa (rl
->link
[i
].link_data
), VTY_NEWLINE
);
3339 vty_out (vty
, " Number of TOS metrics: 0%s", VTY_NEWLINE
);
3340 vty_out (vty
, " TOS 0 Metric: %d%s",
3341 ntohs (rl
->link
[i
].metric
), VTY_NEWLINE
);
3342 vty_out (vty
, "%s", VTY_NEWLINE
);
3346 /* Show router-LSA detail information. */
3348 show_router_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3352 struct router_lsa
*rl
= (struct router_lsa
*) lsa
->data
;
3354 show_ip_ospf_database_header (vty
, lsa
);
3356 vty_out (vty
, " Number of Links: %d%s%s", ntohs (rl
->links
),
3357 VTY_NEWLINE
, VTY_NEWLINE
);
3359 show_ip_ospf_database_router_links (vty
, rl
);
3360 vty_out (vty
, "%s", VTY_NEWLINE
);
3366 /* Show network-LSA detail information. */
3368 show_network_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3374 struct network_lsa
*nl
= (struct network_lsa
*) lsa
->data
;
3376 show_ip_ospf_database_header (vty
, lsa
);
3378 vty_out (vty
, " Network Mask: /%d%s",
3379 ip_masklen (nl
->mask
), VTY_NEWLINE
);
3381 length
= ntohs (lsa
->data
->length
) - OSPF_LSA_HEADER_SIZE
- 4;
3383 for (i
= 0; length
> 0; i
++, length
-= 4)
3384 vty_out (vty
, " Attached Router: %s%s",
3385 inet_ntoa (nl
->routers
[i
]), VTY_NEWLINE
);
3387 vty_out (vty
, "%s", VTY_NEWLINE
);
3393 /* Show summary-LSA detail information. */
3395 show_summary_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3399 struct summary_lsa
*sl
= (struct summary_lsa
*) lsa
->data
;
3401 show_ip_ospf_database_header (vty
, lsa
);
3403 vty_out (vty
, " Network Mask: /%d%s", ip_masklen (sl
->mask
),
3405 vty_out (vty
, " TOS: 0 Metric: %d%s", GET_METRIC (sl
->metric
),
3407 vty_out (vty
, "%s", VTY_NEWLINE
);
3413 /* Show summary-ASBR-LSA detail information. */
3415 show_summary_asbr_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3419 struct summary_lsa
*sl
= (struct summary_lsa
*) lsa
->data
;
3421 show_ip_ospf_database_header (vty
, lsa
);
3423 vty_out (vty
, " Network Mask: /%d%s",
3424 ip_masklen (sl
->mask
), VTY_NEWLINE
);
3425 vty_out (vty
, " TOS: 0 Metric: %d%s", GET_METRIC (sl
->metric
),
3427 vty_out (vty
, "%s", VTY_NEWLINE
);
3433 /* Show AS-external-LSA detail information. */
3435 show_as_external_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3439 struct as_external_lsa
*al
= (struct as_external_lsa
*) lsa
->data
;
3441 show_ip_ospf_database_header (vty
, lsa
);
3443 vty_out (vty
, " Network Mask: /%d%s",
3444 ip_masklen (al
->mask
), VTY_NEWLINE
);
3445 vty_out (vty
, " Metric Type: %s%s",
3446 IS_EXTERNAL_METRIC (al
->e
[0].tos
) ?
3447 "2 (Larger than any link state path)" : "1", VTY_NEWLINE
);
3448 vty_out (vty
, " TOS: 0%s", VTY_NEWLINE
);
3449 vty_out (vty
, " Metric: %d%s",
3450 GET_METRIC (al
->e
[0].metric
), VTY_NEWLINE
);
3451 vty_out (vty
, " Forward Address: %s%s",
3452 inet_ntoa (al
->e
[0].fwd_addr
), VTY_NEWLINE
);
3454 vty_out (vty
, " External Route Tag: %lu%s%s",
3455 (u_long
)ntohl (al
->e
[0].route_tag
), VTY_NEWLINE
, VTY_NEWLINE
);
3461 /* N.B. This function currently seems to be unused. */
3463 show_as_external_lsa_stdvty (struct ospf_lsa
*lsa
)
3465 struct as_external_lsa
*al
= (struct as_external_lsa
*) lsa
->data
;
3467 /* show_ip_ospf_database_header (vty, lsa); */
3469 zlog_debug( " Network Mask: /%d%s",
3470 ip_masklen (al
->mask
), "\n");
3471 zlog_debug( " Metric Type: %s%s",
3472 IS_EXTERNAL_METRIC (al
->e
[0].tos
) ?
3473 "2 (Larger than any link state path)" : "1", "\n");
3474 zlog_debug( " TOS: 0%s", "\n");
3475 zlog_debug( " Metric: %d%s",
3476 GET_METRIC (al
->e
[0].metric
), "\n");
3477 zlog_debug( " Forward Address: %s%s",
3478 inet_ntoa (al
->e
[0].fwd_addr
), "\n");
3480 zlog_debug( " External Route Tag: %u%s%s",
3481 ntohl (al
->e
[0].route_tag
), "\n", "\n");
3486 /* Show AS-NSSA-LSA detail information. */
3488 show_as_nssa_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3492 struct as_external_lsa
*al
= (struct as_external_lsa
*) lsa
->data
;
3494 show_ip_ospf_database_header (vty
, lsa
);
3496 vty_out (vty
, " Network Mask: /%d%s",
3497 ip_masklen (al
->mask
), VTY_NEWLINE
);
3498 vty_out (vty
, " Metric Type: %s%s",
3499 IS_EXTERNAL_METRIC (al
->e
[0].tos
) ?
3500 "2 (Larger than any link state path)" : "1", VTY_NEWLINE
);
3501 vty_out (vty
, " TOS: 0%s", VTY_NEWLINE
);
3502 vty_out (vty
, " Metric: %d%s",
3503 GET_METRIC (al
->e
[0].metric
), VTY_NEWLINE
);
3504 vty_out (vty
, " NSSA: Forward Address: %s%s",
3505 inet_ntoa (al
->e
[0].fwd_addr
), VTY_NEWLINE
);
3507 vty_out (vty
, " External Route Tag: %u%s%s",
3508 ntohl (al
->e
[0].route_tag
), VTY_NEWLINE
, VTY_NEWLINE
);
3515 show_func_dummy (struct vty
*vty
, struct ospf_lsa
*lsa
)
3520 #ifdef HAVE_OPAQUE_LSA
3522 show_opaque_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3526 show_ip_ospf_database_header (vty
, lsa
);
3527 show_opaque_info_detail (vty
, lsa
);
3529 vty_out (vty
, "%s", VTY_NEWLINE
);
3533 #endif /* HAVE_OPAQUE_LSA */
3535 int (*show_function
[])(struct vty
*, struct ospf_lsa
*) =
3538 show_router_lsa_detail
,
3539 show_network_lsa_detail
,
3540 show_summary_lsa_detail
,
3541 show_summary_asbr_lsa_detail
,
3542 show_as_external_lsa_detail
,
3544 show_as_nssa_lsa_detail
, /* almost same as external */
3545 #ifdef HAVE_OPAQUE_LSA
3547 show_opaque_lsa_detail
,
3548 show_opaque_lsa_detail
,
3549 show_opaque_lsa_detail
,
3550 #endif /* HAVE_OPAQUE_LSA */
3554 show_lsa_prefix_set (struct vty
*vty
, struct prefix_ls
*lp
, struct in_addr
*id
,
3555 struct in_addr
*adv_router
)
3557 memset (lp
, 0, sizeof (struct prefix_ls
));
3561 else if (adv_router
== NULL
)
3570 lp
->adv_router
= *adv_router
;
3575 show_lsa_detail_proc (struct vty
*vty
, struct route_table
*rt
,
3576 struct in_addr
*id
, struct in_addr
*adv_router
)
3578 struct prefix_ls lp
;
3579 struct route_node
*rn
, *start
;
3580 struct ospf_lsa
*lsa
;
3582 show_lsa_prefix_set (vty
, &lp
, id
, adv_router
);
3583 start
= route_node_get (rt
, (struct prefix
*) &lp
);
3586 route_lock_node (start
);
3587 for (rn
= start
; rn
; rn
= route_next_until (rn
, start
))
3588 if ((lsa
= rn
->info
))
3590 if (show_function
[lsa
->data
->type
] != NULL
)
3591 show_function
[lsa
->data
->type
] (vty
, lsa
);
3593 route_unlock_node (start
);
3597 /* Show detail LSA information
3598 -- if id is NULL then show all LSAs. */
3600 show_lsa_detail (struct vty
*vty
, struct ospf
*ospf
, int type
,
3601 struct in_addr
*id
, struct in_addr
*adv_router
)
3603 struct listnode
*node
;
3604 struct ospf_area
*area
;
3608 case OSPF_AS_EXTERNAL_LSA
:
3609 #ifdef HAVE_OPAQUE_LSA
3610 case OSPF_OPAQUE_AS_LSA
:
3611 #endif /* HAVE_OPAQUE_LSA */
3612 vty_out (vty
, " %s %s%s",
3613 show_database_desc
[type
],
3614 VTY_NEWLINE
, VTY_NEWLINE
);
3615 show_lsa_detail_proc (vty
, AS_LSDB (ospf
, type
), id
, adv_router
);
3618 for (ALL_LIST_ELEMENTS_RO (ospf
->areas
, node
, area
))
3620 vty_out (vty
, "%s %s (Area %s)%s%s",
3621 VTY_NEWLINE
, show_database_desc
[type
],
3622 ospf_area_desc_string (area
), VTY_NEWLINE
, VTY_NEWLINE
);
3623 show_lsa_detail_proc (vty
, AREA_LSDB (area
, type
), id
, adv_router
);
3630 show_lsa_detail_adv_router_proc (struct vty
*vty
, struct route_table
*rt
,
3631 struct in_addr
*adv_router
)
3633 struct route_node
*rn
;
3634 struct ospf_lsa
*lsa
;
3636 for (rn
= route_top (rt
); rn
; rn
= route_next (rn
))
3637 if ((lsa
= rn
->info
))
3638 if (IPV4_ADDR_SAME (adv_router
, &lsa
->data
->adv_router
))
3640 if (CHECK_FLAG (lsa
->flags
, OSPF_LSA_LOCAL_XLT
))
3642 if (show_function
[lsa
->data
->type
] != NULL
)
3643 show_function
[lsa
->data
->type
] (vty
, lsa
);
3647 /* Show detail LSA information. */
3649 show_lsa_detail_adv_router (struct vty
*vty
, struct ospf
*ospf
, int type
,
3650 struct in_addr
*adv_router
)
3652 struct listnode
*node
;
3653 struct ospf_area
*area
;
3657 case OSPF_AS_EXTERNAL_LSA
:
3658 #ifdef HAVE_OPAQUE_LSA
3659 case OSPF_OPAQUE_AS_LSA
:
3660 #endif /* HAVE_OPAQUE_LSA */
3661 vty_out (vty
, " %s %s%s",
3662 show_database_desc
[type
],
3663 VTY_NEWLINE
, VTY_NEWLINE
);
3664 show_lsa_detail_adv_router_proc (vty
, AS_LSDB (ospf
, type
),
3668 for (ALL_LIST_ELEMENTS_RO (ospf
->areas
, node
, area
))
3670 vty_out (vty
, "%s %s (Area %s)%s%s",
3671 VTY_NEWLINE
, show_database_desc
[type
],
3672 ospf_area_desc_string (area
), VTY_NEWLINE
, VTY_NEWLINE
);
3673 show_lsa_detail_adv_router_proc (vty
, AREA_LSDB (area
, type
),
3681 show_ip_ospf_database_summary (struct vty
*vty
, struct ospf
*ospf
, int self
)
3683 struct ospf_lsa
*lsa
;
3684 struct route_node
*rn
;
3685 struct ospf_area
*area
;
3686 struct listnode
*node
;
3689 for (ALL_LIST_ELEMENTS_RO (ospf
->areas
, node
, area
))
3691 for (type
= OSPF_MIN_LSA
; type
< OSPF_MAX_LSA
; type
++)
3695 case OSPF_AS_EXTERNAL_LSA
:
3696 #ifdef HAVE_OPAQUE_LSA
3697 case OSPF_OPAQUE_AS_LSA
:
3698 #endif /* HAVE_OPAQUE_LSA */
3703 if (ospf_lsdb_count_self (area
->lsdb
, type
) > 0 ||
3704 (!self
&& ospf_lsdb_count (area
->lsdb
, type
) > 0))
3706 vty_out (vty
, " %s (Area %s)%s%s",
3707 show_database_desc
[type
],
3708 ospf_area_desc_string (area
),
3709 VTY_NEWLINE
, VTY_NEWLINE
);
3710 vty_out (vty
, "%s%s", show_database_header
[type
], VTY_NEWLINE
);
3712 LSDB_LOOP (AREA_LSDB (area
, type
), rn
, lsa
)
3713 show_lsa_summary (vty
, lsa
, self
);
3715 vty_out (vty
, "%s", VTY_NEWLINE
);
3720 for (type
= OSPF_MIN_LSA
; type
< OSPF_MAX_LSA
; type
++)
3724 case OSPF_AS_EXTERNAL_LSA
:
3725 #ifdef HAVE_OPAQUE_LSA
3726 case OSPF_OPAQUE_AS_LSA
:
3727 #endif /* HAVE_OPAQUE_LSA */
3732 if (ospf_lsdb_count_self (ospf
->lsdb
, type
) ||
3733 (!self
&& ospf_lsdb_count (ospf
->lsdb
, type
)))
3735 vty_out (vty
, " %s%s%s",
3736 show_database_desc
[type
],
3737 VTY_NEWLINE
, VTY_NEWLINE
);
3738 vty_out (vty
, "%s%s", show_database_header
[type
],
3741 LSDB_LOOP (AS_LSDB (ospf
, type
), rn
, lsa
)
3742 show_lsa_summary (vty
, lsa
, self
);
3744 vty_out (vty
, "%s", VTY_NEWLINE
);
3748 vty_out (vty
, "%s", VTY_NEWLINE
);
3752 show_ip_ospf_database_maxage (struct vty
*vty
, struct ospf
*ospf
)
3754 struct listnode
*node
;
3755 struct ospf_lsa
*lsa
;
3757 vty_out (vty
, "%s MaxAge Link States:%s%s",
3758 VTY_NEWLINE
, VTY_NEWLINE
, VTY_NEWLINE
);
3760 for (ALL_LIST_ELEMENTS_RO (ospf
->maxage_lsa
, node
, lsa
))
3762 vty_out (vty
, "Link type: %d%s", lsa
->data
->type
, VTY_NEWLINE
);
3763 vty_out (vty
, "Link State ID: %s%s",
3764 inet_ntoa (lsa
->data
->id
), VTY_NEWLINE
);
3765 vty_out (vty
, "Advertising Router: %s%s",
3766 inet_ntoa (lsa
->data
->adv_router
), VTY_NEWLINE
);
3767 vty_out (vty
, "LSA lock count: %d%s", lsa
->lock
, VTY_NEWLINE
);
3768 vty_out (vty
, "%s", VTY_NEWLINE
);
3772 #define OSPF_LSA_TYPE_NSSA_DESC "NSSA external link state\n"
3773 #define OSPF_LSA_TYPE_NSSA_CMD_STR "|nssa-external"
3775 #ifdef HAVE_OPAQUE_LSA
3776 #define OSPF_LSA_TYPE_OPAQUE_LINK_DESC "Link local Opaque-LSA\n"
3777 #define OSPF_LSA_TYPE_OPAQUE_AREA_DESC "Link area Opaque-LSA\n"
3778 #define OSPF_LSA_TYPE_OPAQUE_AS_DESC "Link AS Opaque-LSA\n"
3779 #define OSPF_LSA_TYPE_OPAQUE_CMD_STR "|opaque-link|opaque-area|opaque-as"
3780 #else /* HAVE_OPAQUE_LSA */
3781 #define OSPF_LSA_TYPE_OPAQUE_LINK_DESC ""
3782 #define OSPF_LSA_TYPE_OPAQUE_AREA_DESC ""
3783 #define OSPF_LSA_TYPE_OPAQUE_AS_DESC ""
3784 #define OSPF_LSA_TYPE_OPAQUE_CMD_STR ""
3785 #endif /* HAVE_OPAQUE_LSA */
3787 #define OSPF_LSA_TYPES_CMD_STR \
3788 "asbr-summary|external|network|router|summary" \
3789 OSPF_LSA_TYPE_NSSA_CMD_STR \
3790 OSPF_LSA_TYPE_OPAQUE_CMD_STR
3792 #define OSPF_LSA_TYPES_DESC \
3793 "ASBR summary link states\n" \
3794 "External link states\n" \
3795 "Network link states\n" \
3796 "Router link states\n" \
3797 "Network summary link states\n" \
3798 OSPF_LSA_TYPE_NSSA_DESC \
3799 OSPF_LSA_TYPE_OPAQUE_LINK_DESC \
3800 OSPF_LSA_TYPE_OPAQUE_AREA_DESC \
3801 OSPF_LSA_TYPE_OPAQUE_AS_DESC
3803 DEFUN (show_ip_ospf_database
,
3804 show_ip_ospf_database_cmd
,
3805 "show ip ospf database",
3808 "OSPF information\n"
3809 "Database summary\n")
3813 struct in_addr id
, adv_router
;
3815 ospf
= ospf_lookup ();
3819 vty_out (vty
, "%s OSPF Router with ID (%s)%s%s", VTY_NEWLINE
,
3820 inet_ntoa (ospf
->router_id
), VTY_NEWLINE
, VTY_NEWLINE
);
3825 show_ip_ospf_database_summary (vty
, ospf
, 0);
3829 /* Set database type to show. */
3830 if (strncmp (argv
[0], "r", 1) == 0)
3831 type
= OSPF_ROUTER_LSA
;
3832 else if (strncmp (argv
[0], "ne", 2) == 0)
3833 type
= OSPF_NETWORK_LSA
;
3834 else if (strncmp (argv
[0], "ns", 2) == 0)
3835 type
= OSPF_AS_NSSA_LSA
;
3836 else if (strncmp (argv
[0], "su", 2) == 0)
3837 type
= OSPF_SUMMARY_LSA
;
3838 else if (strncmp (argv
[0], "a", 1) == 0)
3839 type
= OSPF_ASBR_SUMMARY_LSA
;
3840 else if (strncmp (argv
[0], "e", 1) == 0)
3841 type
= OSPF_AS_EXTERNAL_LSA
;
3842 else if (strncmp (argv
[0], "se", 2) == 0)
3844 show_ip_ospf_database_summary (vty
, ospf
, 1);
3847 else if (strncmp (argv
[0], "m", 1) == 0)
3849 show_ip_ospf_database_maxage (vty
, ospf
);
3852 #ifdef HAVE_OPAQUE_LSA
3853 else if (strncmp (argv
[0], "opaque-l", 8) == 0)
3854 type
= OSPF_OPAQUE_LINK_LSA
;
3855 else if (strncmp (argv
[0], "opaque-ar", 9) == 0)
3856 type
= OSPF_OPAQUE_AREA_LSA
;
3857 else if (strncmp (argv
[0], "opaque-as", 9) == 0)
3858 type
= OSPF_OPAQUE_AS_LSA
;
3859 #endif /* HAVE_OPAQUE_LSA */
3863 /* `show ip ospf database LSA'. */
3865 show_lsa_detail (vty
, ospf
, type
, NULL
, NULL
);
3868 ret
= inet_aton (argv
[1], &id
);
3872 /* `show ip ospf database LSA ID'. */
3874 show_lsa_detail (vty
, ospf
, type
, &id
, NULL
);
3875 /* `show ip ospf database LSA ID adv-router ADV_ROUTER'. */
3878 if (strncmp (argv
[2], "s", 1) == 0)
3879 adv_router
= ospf
->router_id
;
3882 ret
= inet_aton (argv
[2], &adv_router
);
3886 show_lsa_detail (vty
, ospf
, type
, &id
, &adv_router
);
3893 ALIAS (show_ip_ospf_database
,
3894 show_ip_ospf_database_type_cmd
,
3895 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
"|max-age|self-originate)",
3898 "OSPF information\n"
3899 "Database summary\n"
3901 "LSAs in MaxAge list\n"
3902 "Self-originated link states\n")
3904 ALIAS (show_ip_ospf_database
,
3905 show_ip_ospf_database_type_id_cmd
,
3906 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
") A.B.C.D",
3909 "OSPF information\n"
3910 "Database summary\n"
3912 "Link State ID (as an IP address)\n")
3914 ALIAS (show_ip_ospf_database
,
3915 show_ip_ospf_database_type_id_adv_router_cmd
,
3916 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
") A.B.C.D adv-router A.B.C.D",
3919 "OSPF information\n"
3920 "Database summary\n"
3922 "Link State ID (as an IP address)\n"
3923 "Advertising Router link states\n"
3924 "Advertising Router (as an IP address)\n")
3926 ALIAS (show_ip_ospf_database
,
3927 show_ip_ospf_database_type_id_self_cmd
,
3928 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
") A.B.C.D (self-originate|)",
3931 "OSPF information\n"
3932 "Database summary\n"
3934 "Link State ID (as an IP address)\n"
3935 "Self-originated link states\n"
3938 DEFUN (show_ip_ospf_database_type_adv_router
,
3939 show_ip_ospf_database_type_adv_router_cmd
,
3940 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
") adv-router A.B.C.D",
3943 "OSPF information\n"
3944 "Database summary\n"
3946 "Advertising Router link states\n"
3947 "Advertising Router (as an IP address)\n")
3951 struct in_addr adv_router
;
3953 ospf
= ospf_lookup ();
3957 vty_out (vty
, "%s OSPF Router with ID (%s)%s%s", VTY_NEWLINE
,
3958 inet_ntoa (ospf
->router_id
), VTY_NEWLINE
, VTY_NEWLINE
);
3963 /* Set database type to show. */
3964 if (strncmp (argv
[0], "r", 1) == 0)
3965 type
= OSPF_ROUTER_LSA
;
3966 else if (strncmp (argv
[0], "ne", 2) == 0)
3967 type
= OSPF_NETWORK_LSA
;
3968 else if (strncmp (argv
[0], "ns", 2) == 0)
3969 type
= OSPF_AS_NSSA_LSA
;
3970 else if (strncmp (argv
[0], "s", 1) == 0)
3971 type
= OSPF_SUMMARY_LSA
;
3972 else if (strncmp (argv
[0], "a", 1) == 0)
3973 type
= OSPF_ASBR_SUMMARY_LSA
;
3974 else if (strncmp (argv
[0], "e", 1) == 0)
3975 type
= OSPF_AS_EXTERNAL_LSA
;
3976 #ifdef HAVE_OPAQUE_LSA
3977 else if (strncmp (argv
[0], "opaque-l", 8) == 0)
3978 type
= OSPF_OPAQUE_LINK_LSA
;
3979 else if (strncmp (argv
[0], "opaque-ar", 9) == 0)
3980 type
= OSPF_OPAQUE_AREA_LSA
;
3981 else if (strncmp (argv
[0], "opaque-as", 9) == 0)
3982 type
= OSPF_OPAQUE_AS_LSA
;
3983 #endif /* HAVE_OPAQUE_LSA */
3987 /* `show ip ospf database LSA adv-router ADV_ROUTER'. */
3988 if (strncmp (argv
[1], "s", 1) == 0)
3989 adv_router
= ospf
->router_id
;
3992 ret
= inet_aton (argv
[1], &adv_router
);
3997 show_lsa_detail_adv_router (vty
, ospf
, type
, &adv_router
);
4002 ALIAS (show_ip_ospf_database_type_adv_router
,
4003 show_ip_ospf_database_type_self_cmd
,
4004 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
") (self-originate|)",
4007 "OSPF information\n"
4008 "Database summary\n"
4010 "Self-originated link states\n")
4013 DEFUN (ip_ospf_authentication_args
,
4014 ip_ospf_authentication_args_addr_cmd
,
4015 "ip ospf authentication (null|message-digest) A.B.C.D",
4017 "OSPF interface commands\n"
4018 "Enable authentication on this interface\n"
4019 "Use null authentication\n"
4020 "Use message-digest authentication\n"
4021 "Address of interface")
4023 struct interface
*ifp
;
4024 struct in_addr addr
;
4026 struct ospf_if_params
*params
;
4029 params
= IF_DEF_PARAMS (ifp
);
4033 ret
= inet_aton(argv
[1], &addr
);
4036 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4041 params
= ospf_get_if_params (ifp
, addr
);
4042 ospf_if_update_params (ifp
, addr
);
4045 /* Handle null authentication */
4046 if ( argv
[0][0] == 'n' )
4048 SET_IF_PARAM (params
, auth_type
);
4049 params
->auth_type
= OSPF_AUTH_NULL
;
4053 /* Handle message-digest authentication */
4054 if ( argv
[0][0] == 'm' )
4056 SET_IF_PARAM (params
, auth_type
);
4057 params
->auth_type
= OSPF_AUTH_CRYPTOGRAPHIC
;
4061 vty_out (vty
, "You shouldn't get here!%s", VTY_NEWLINE
);
4065 ALIAS (ip_ospf_authentication_args
,
4066 ip_ospf_authentication_args_cmd
,
4067 "ip ospf authentication (null|message-digest)",
4069 "OSPF interface commands\n"
4070 "Enable authentication on this interface\n"
4071 "Use null authentication\n"
4072 "Use message-digest authentication\n")
4074 DEFUN (ip_ospf_authentication
,
4075 ip_ospf_authentication_addr_cmd
,
4076 "ip ospf authentication A.B.C.D",
4078 "OSPF interface commands\n"
4079 "Enable authentication on this interface\n"
4080 "Address of interface")
4082 struct interface
*ifp
;
4083 struct in_addr addr
;
4085 struct ospf_if_params
*params
;
4088 params
= IF_DEF_PARAMS (ifp
);
4092 ret
= inet_aton(argv
[1], &addr
);
4095 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4100 params
= ospf_get_if_params (ifp
, addr
);
4101 ospf_if_update_params (ifp
, addr
);
4104 SET_IF_PARAM (params
, auth_type
);
4105 params
->auth_type
= OSPF_AUTH_SIMPLE
;
4110 ALIAS (ip_ospf_authentication
,
4111 ip_ospf_authentication_cmd
,
4112 "ip ospf authentication",
4114 "OSPF interface commands\n"
4115 "Enable authentication on this interface\n")
4117 DEFUN (no_ip_ospf_authentication
,
4118 no_ip_ospf_authentication_addr_cmd
,
4119 "no ip ospf authentication A.B.C.D",
4122 "OSPF interface commands\n"
4123 "Enable authentication on this interface\n"
4124 "Address of interface")
4126 struct interface
*ifp
;
4127 struct in_addr addr
;
4129 struct ospf_if_params
*params
;
4132 params
= IF_DEF_PARAMS (ifp
);
4136 ret
= inet_aton(argv
[1], &addr
);
4139 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4144 params
= ospf_lookup_if_params (ifp
, addr
);
4149 params
->auth_type
= OSPF_AUTH_NOTSET
;
4150 UNSET_IF_PARAM (params
, auth_type
);
4152 if (params
!= IF_DEF_PARAMS (ifp
))
4154 ospf_free_if_params (ifp
, addr
);
4155 ospf_if_update_params (ifp
, addr
);
4161 ALIAS (no_ip_ospf_authentication
,
4162 no_ip_ospf_authentication_cmd
,
4163 "no ip ospf authentication",
4166 "OSPF interface commands\n"
4167 "Enable authentication on this interface\n")
4169 DEFUN (ip_ospf_authentication_key
,
4170 ip_ospf_authentication_key_addr_cmd
,
4171 "ip ospf authentication-key AUTH_KEY A.B.C.D",
4173 "OSPF interface commands\n"
4174 "Authentication password (key)\n"
4175 "The OSPF password (key)\n"
4176 "Address of interface")
4178 struct interface
*ifp
;
4179 struct in_addr addr
;
4181 struct ospf_if_params
*params
;
4184 params
= IF_DEF_PARAMS (ifp
);
4188 ret
= inet_aton(argv
[1], &addr
);
4191 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4196 params
= ospf_get_if_params (ifp
, addr
);
4197 ospf_if_update_params (ifp
, addr
);
4201 memset (params
->auth_simple
, 0, OSPF_AUTH_SIMPLE_SIZE
+ 1);
4202 strncpy ((char *) params
->auth_simple
, argv
[0], OSPF_AUTH_SIMPLE_SIZE
);
4203 SET_IF_PARAM (params
, auth_simple
);
4208 ALIAS (ip_ospf_authentication_key
,
4209 ip_ospf_authentication_key_cmd
,
4210 "ip ospf authentication-key AUTH_KEY",
4212 "OSPF interface commands\n"
4213 "Authentication password (key)\n"
4214 "The OSPF password (key)")
4216 ALIAS (ip_ospf_authentication_key
,
4217 ospf_authentication_key_cmd
,
4218 "ospf authentication-key AUTH_KEY",
4219 "OSPF interface commands\n"
4220 "Authentication password (key)\n"
4221 "The OSPF password (key)")
4223 DEFUN (no_ip_ospf_authentication_key
,
4224 no_ip_ospf_authentication_key_addr_cmd
,
4225 "no ip ospf authentication-key A.B.C.D",
4228 "OSPF interface commands\n"
4229 "Authentication password (key)\n"
4230 "Address of interface")
4232 struct interface
*ifp
;
4233 struct in_addr addr
;
4235 struct ospf_if_params
*params
;
4238 params
= IF_DEF_PARAMS (ifp
);
4242 ret
= inet_aton(argv
[1], &addr
);
4245 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4250 params
= ospf_lookup_if_params (ifp
, addr
);
4255 memset (params
->auth_simple
, 0, OSPF_AUTH_SIMPLE_SIZE
);
4256 UNSET_IF_PARAM (params
, auth_simple
);
4258 if (params
!= IF_DEF_PARAMS (ifp
))
4260 ospf_free_if_params (ifp
, addr
);
4261 ospf_if_update_params (ifp
, addr
);
4267 ALIAS (no_ip_ospf_authentication_key
,
4268 no_ip_ospf_authentication_key_cmd
,
4269 "no ip ospf authentication-key",
4272 "OSPF interface commands\n"
4273 "Authentication password (key)\n")
4275 ALIAS (no_ip_ospf_authentication_key
,
4276 no_ospf_authentication_key_cmd
,
4277 "no ospf authentication-key",
4279 "OSPF interface commands\n"
4280 "Authentication password (key)\n")
4282 DEFUN (ip_ospf_message_digest_key
,
4283 ip_ospf_message_digest_key_addr_cmd
,
4284 "ip ospf message-digest-key <1-255> md5 KEY A.B.C.D",
4286 "OSPF interface commands\n"
4287 "Message digest authentication password (key)\n"
4289 "Use MD5 algorithm\n"
4290 "The OSPF password (key)"
4291 "Address of interface")
4293 struct interface
*ifp
;
4294 struct crypt_key
*ck
;
4296 struct in_addr addr
;
4298 struct ospf_if_params
*params
;
4301 params
= IF_DEF_PARAMS (ifp
);
4305 ret
= inet_aton(argv
[2], &addr
);
4308 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4313 params
= ospf_get_if_params (ifp
, addr
);
4314 ospf_if_update_params (ifp
, addr
);
4317 key_id
= strtol (argv
[0], NULL
, 10);
4318 if (ospf_crypt_key_lookup (params
->auth_crypt
, key_id
) != NULL
)
4320 vty_out (vty
, "OSPF: Key %d already exists%s", key_id
, VTY_NEWLINE
);
4324 ck
= ospf_crypt_key_new ();
4325 ck
->key_id
= (u_char
) key_id
;
4326 memset (ck
->auth_key
, 0, OSPF_AUTH_MD5_SIZE
+1);
4327 strncpy ((char *) ck
->auth_key
, argv
[1], OSPF_AUTH_MD5_SIZE
);
4329 ospf_crypt_key_add (params
->auth_crypt
, ck
);
4330 SET_IF_PARAM (params
, auth_crypt
);
4335 ALIAS (ip_ospf_message_digest_key
,
4336 ip_ospf_message_digest_key_cmd
,
4337 "ip ospf message-digest-key <1-255> md5 KEY",
4339 "OSPF interface commands\n"
4340 "Message digest authentication password (key)\n"
4342 "Use MD5 algorithm\n"
4343 "The OSPF password (key)")
4345 ALIAS (ip_ospf_message_digest_key
,
4346 ospf_message_digest_key_cmd
,
4347 "ospf message-digest-key <1-255> md5 KEY",
4348 "OSPF interface commands\n"
4349 "Message digest authentication password (key)\n"
4351 "Use MD5 algorithm\n"
4352 "The OSPF password (key)")
4354 DEFUN (no_ip_ospf_message_digest_key
,
4355 no_ip_ospf_message_digest_key_addr_cmd
,
4356 "no ip ospf message-digest-key <1-255> A.B.C.D",
4359 "OSPF interface commands\n"
4360 "Message digest authentication password (key)\n"
4362 "Address of interface")
4364 struct interface
*ifp
;
4365 struct crypt_key
*ck
;
4367 struct in_addr addr
;
4369 struct ospf_if_params
*params
;
4372 params
= IF_DEF_PARAMS (ifp
);
4376 ret
= inet_aton(argv
[1], &addr
);
4379 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4384 params
= ospf_lookup_if_params (ifp
, addr
);
4389 key_id
= strtol (argv
[0], NULL
, 10);
4390 ck
= ospf_crypt_key_lookup (params
->auth_crypt
, key_id
);
4393 vty_out (vty
, "OSPF: Key %d does not exist%s", key_id
, VTY_NEWLINE
);
4397 ospf_crypt_key_delete (params
->auth_crypt
, key_id
);
4399 if (params
!= IF_DEF_PARAMS (ifp
))
4401 ospf_free_if_params (ifp
, addr
);
4402 ospf_if_update_params (ifp
, addr
);
4408 ALIAS (no_ip_ospf_message_digest_key
,
4409 no_ip_ospf_message_digest_key_cmd
,
4410 "no ip ospf message-digest-key <1-255>",
4413 "OSPF interface commands\n"
4414 "Message digest authentication password (key)\n"
4417 ALIAS (no_ip_ospf_message_digest_key
,
4418 no_ospf_message_digest_key_cmd
,
4419 "no ospf message-digest-key <1-255>",
4421 "OSPF interface commands\n"
4422 "Message digest authentication password (key)\n"
4425 DEFUN (ip_ospf_cost
,
4426 ip_ospf_cost_addr_cmd
,
4427 "ip ospf cost <1-65535> A.B.C.D",
4429 "OSPF interface commands\n"
4432 "Address of interface")
4434 struct interface
*ifp
= vty
->index
;
4436 struct in_addr addr
;
4438 struct ospf_if_params
*params
;
4440 params
= IF_DEF_PARAMS (ifp
);
4442 cost
= strtol (argv
[0], NULL
, 10);
4444 /* cost range is <1-65535>. */
4445 if (cost
< 1 || cost
> 65535)
4447 vty_out (vty
, "Interface output cost is invalid%s", VTY_NEWLINE
);
4453 ret
= inet_aton(argv
[1], &addr
);
4456 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4461 params
= ospf_get_if_params (ifp
, addr
);
4462 ospf_if_update_params (ifp
, addr
);
4465 SET_IF_PARAM (params
, output_cost_cmd
);
4466 params
->output_cost_cmd
= cost
;
4468 ospf_if_recalculate_output_cost (ifp
);
4473 ALIAS (ip_ospf_cost
,
4475 "ip ospf cost <1-65535>",
4477 "OSPF interface commands\n"
4481 ALIAS (ip_ospf_cost
,
4483 "ospf cost <1-65535>",
4484 "OSPF interface commands\n"
4488 DEFUN (no_ip_ospf_cost
,
4489 no_ip_ospf_cost_addr_cmd
,
4490 "no ip ospf cost A.B.C.D",
4493 "OSPF interface commands\n"
4495 "Address of interface")
4497 struct interface
*ifp
= vty
->index
;
4498 struct in_addr addr
;
4500 struct ospf_if_params
*params
;
4503 params
= IF_DEF_PARAMS (ifp
);
4507 ret
= inet_aton(argv
[0], &addr
);
4510 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4515 params
= ospf_lookup_if_params (ifp
, addr
);
4520 UNSET_IF_PARAM (params
, output_cost_cmd
);
4522 if (params
!= IF_DEF_PARAMS (ifp
))
4524 ospf_free_if_params (ifp
, addr
);
4525 ospf_if_update_params (ifp
, addr
);
4528 ospf_if_recalculate_output_cost (ifp
);
4533 ALIAS (no_ip_ospf_cost
,
4534 no_ip_ospf_cost_cmd
,
4538 "OSPF interface commands\n"
4541 ALIAS (no_ip_ospf_cost
,
4545 "OSPF interface commands\n"
4549 ospf_nbr_timer_update (struct ospf_interface
*oi
)
4551 struct route_node
*rn
;
4552 struct ospf_neighbor
*nbr
;
4554 for (rn
= route_top (oi
->nbrs
); rn
; rn
= route_next (rn
))
4555 if ((nbr
= rn
->info
))
4557 nbr
->v_inactivity
= OSPF_IF_PARAM (oi
, v_wait
);
4558 nbr
->v_db_desc
= OSPF_IF_PARAM (oi
, retransmit_interval
);
4559 nbr
->v_ls_req
= OSPF_IF_PARAM (oi
, retransmit_interval
);
4560 nbr
->v_ls_upd
= OSPF_IF_PARAM (oi
, retransmit_interval
);
4564 DEFUN (ip_ospf_dead_interval
,
4565 ip_ospf_dead_interval_addr_cmd
,
4566 "ip ospf dead-interval <1-65535> A.B.C.D",
4568 "OSPF interface commands\n"
4569 "Interval after which a neighbor is declared dead\n"
4571 "Address of interface")
4573 struct interface
*ifp
= vty
->index
;
4575 struct in_addr addr
;
4577 struct ospf_if_params
*params
;
4578 struct ospf_interface
*oi
;
4579 struct route_node
*rn
;
4582 ospf
= ospf_lookup ();
4584 params
= IF_DEF_PARAMS (ifp
);
4586 seconds
= strtol (argv
[0], NULL
, 10);
4588 /* dead_interval range is <1-65535>. */
4589 if (seconds
< 1 || seconds
> 65535)
4591 vty_out (vty
, "Router Dead Interval is invalid%s", VTY_NEWLINE
);
4597 ret
= inet_aton(argv
[1], &addr
);
4600 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4605 params
= ospf_get_if_params (ifp
, addr
);
4606 ospf_if_update_params (ifp
, addr
);
4609 SET_IF_PARAM (params
, v_wait
);
4610 params
->v_wait
= seconds
;
4612 /* Update timer values in neighbor structure. */
4617 oi
= ospf_if_lookup_by_local_addr (ospf
, ifp
, addr
);
4619 ospf_nbr_timer_update (oi
);
4624 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
4625 if ((oi
= rn
->info
))
4626 ospf_nbr_timer_update (oi
);
4632 ALIAS (ip_ospf_dead_interval
,
4633 ip_ospf_dead_interval_cmd
,
4634 "ip ospf dead-interval <1-65535>",
4636 "OSPF interface commands\n"
4637 "Interval after which a neighbor is declared dead\n"
4640 ALIAS (ip_ospf_dead_interval
,
4641 ospf_dead_interval_cmd
,
4642 "ospf dead-interval <1-65535>",
4643 "OSPF interface commands\n"
4644 "Interval after which a neighbor is declared dead\n"
4647 DEFUN (no_ip_ospf_dead_interval
,
4648 no_ip_ospf_dead_interval_addr_cmd
,
4649 "no ip ospf dead-interval A.B.C.D",
4652 "OSPF interface commands\n"
4653 "Interval after which a neighbor is declared dead\n"
4654 "Address of interface")
4656 struct interface
*ifp
= vty
->index
;
4657 struct in_addr addr
;
4659 struct ospf_if_params
*params
;
4660 struct ospf_interface
*oi
;
4661 struct route_node
*rn
;
4664 ospf
= ospf_lookup ();
4667 params
= IF_DEF_PARAMS (ifp
);
4671 ret
= inet_aton(argv
[0], &addr
);
4674 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4679 params
= ospf_lookup_if_params (ifp
, addr
);
4684 UNSET_IF_PARAM (params
, v_wait
);
4685 params
->v_wait
= OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
;
4687 if (params
!= IF_DEF_PARAMS (ifp
))
4689 ospf_free_if_params (ifp
, addr
);
4690 ospf_if_update_params (ifp
, addr
);
4693 /* Update timer values in neighbor structure. */
4698 oi
= ospf_if_lookup_by_local_addr (ospf
, ifp
, addr
);
4700 ospf_nbr_timer_update (oi
);
4705 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
4706 if ((oi
= rn
->info
))
4707 ospf_nbr_timer_update (oi
);
4713 ALIAS (no_ip_ospf_dead_interval
,
4714 no_ip_ospf_dead_interval_cmd
,
4715 "no ip ospf dead-interval",
4718 "OSPF interface commands\n"
4719 "Interval after which a neighbor is declared dead\n")
4721 ALIAS (no_ip_ospf_dead_interval
,
4722 no_ospf_dead_interval_cmd
,
4723 "no ospf dead-interval",
4725 "OSPF interface commands\n"
4726 "Interval after which a neighbor is declared dead\n")
4728 DEFUN (ip_ospf_hello_interval
,
4729 ip_ospf_hello_interval_addr_cmd
,
4730 "ip ospf hello-interval <1-65535> A.B.C.D",
4732 "OSPF interface commands\n"
4733 "Time between HELLO packets\n"
4735 "Address of interface")
4737 struct interface
*ifp
= vty
->index
;
4739 struct in_addr addr
;
4741 struct ospf_if_params
*params
;
4743 params
= IF_DEF_PARAMS (ifp
);
4745 seconds
= strtol (argv
[0], NULL
, 10);
4747 /* HelloInterval range is <1-65535>. */
4748 if (seconds
< 1 || seconds
> 65535)
4750 vty_out (vty
, "Hello Interval is invalid%s", VTY_NEWLINE
);
4756 ret
= inet_aton(argv
[1], &addr
);
4759 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4764 params
= ospf_get_if_params (ifp
, addr
);
4765 ospf_if_update_params (ifp
, addr
);
4768 SET_IF_PARAM (params
, v_hello
);
4769 params
->v_hello
= seconds
;
4774 ALIAS (ip_ospf_hello_interval
,
4775 ip_ospf_hello_interval_cmd
,
4776 "ip ospf hello-interval <1-65535>",
4778 "OSPF interface commands\n"
4779 "Time between HELLO packets\n"
4782 ALIAS (ip_ospf_hello_interval
,
4783 ospf_hello_interval_cmd
,
4784 "ospf hello-interval <1-65535>",
4785 "OSPF interface commands\n"
4786 "Time between HELLO packets\n"
4789 DEFUN (no_ip_ospf_hello_interval
,
4790 no_ip_ospf_hello_interval_addr_cmd
,
4791 "no ip ospf hello-interval A.B.C.D",
4794 "OSPF interface commands\n"
4795 "Time between HELLO packets\n"
4796 "Address of interface")
4798 struct interface
*ifp
= vty
->index
;
4799 struct in_addr addr
;
4801 struct ospf_if_params
*params
;
4804 params
= IF_DEF_PARAMS (ifp
);
4808 ret
= inet_aton(argv
[0], &addr
);
4811 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4816 params
= ospf_lookup_if_params (ifp
, addr
);
4821 UNSET_IF_PARAM (params
, v_hello
);
4822 params
->v_hello
= OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
;
4824 if (params
!= IF_DEF_PARAMS (ifp
))
4826 ospf_free_if_params (ifp
, addr
);
4827 ospf_if_update_params (ifp
, addr
);
4833 ALIAS (no_ip_ospf_hello_interval
,
4834 no_ip_ospf_hello_interval_cmd
,
4835 "no ip ospf hello-interval",
4838 "OSPF interface commands\n"
4839 "Time between HELLO packets\n")
4841 ALIAS (no_ip_ospf_hello_interval
,
4842 no_ospf_hello_interval_cmd
,
4843 "no ospf hello-interval",
4845 "OSPF interface commands\n"
4846 "Time between HELLO packets\n")
4848 DEFUN (ip_ospf_network
,
4849 ip_ospf_network_cmd
,
4850 "ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)",
4852 "OSPF interface commands\n"
4854 "Specify OSPF broadcast multi-access network\n"
4855 "Specify OSPF NBMA network\n"
4856 "Specify OSPF point-to-multipoint network\n"
4857 "Specify OSPF point-to-point network\n")
4859 struct interface
*ifp
= vty
->index
;
4860 int old_type
= IF_DEF_PARAMS (ifp
)->type
;
4861 struct route_node
*rn
;
4863 if (strncmp (argv
[0], "b", 1) == 0)
4864 IF_DEF_PARAMS (ifp
)->type
= OSPF_IFTYPE_BROADCAST
;
4865 else if (strncmp (argv
[0], "n", 1) == 0)
4866 IF_DEF_PARAMS (ifp
)->type
= OSPF_IFTYPE_NBMA
;
4867 else if (strncmp (argv
[0], "point-to-m", 10) == 0)
4868 IF_DEF_PARAMS (ifp
)->type
= OSPF_IFTYPE_POINTOMULTIPOINT
;
4869 else if (strncmp (argv
[0], "point-to-p", 10) == 0)
4870 IF_DEF_PARAMS (ifp
)->type
= OSPF_IFTYPE_POINTOPOINT
;
4872 if (IF_DEF_PARAMS (ifp
)->type
== old_type
)
4875 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), type
);
4877 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
4879 struct ospf_interface
*oi
= rn
->info
;
4884 oi
->type
= IF_DEF_PARAMS (ifp
)->type
;
4886 if (oi
->state
> ISM_Down
)
4888 OSPF_ISM_EVENT_EXECUTE (oi
, ISM_InterfaceDown
);
4889 OSPF_ISM_EVENT_EXECUTE (oi
, ISM_InterfaceUp
);
4896 ALIAS (ip_ospf_network
,
4898 "ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)",
4899 "OSPF interface commands\n"
4901 "Specify OSPF broadcast multi-access network\n"
4902 "Specify OSPF NBMA network\n"
4903 "Specify OSPF point-to-multipoint network\n"
4904 "Specify OSPF point-to-point network\n")
4906 DEFUN (no_ip_ospf_network
,
4907 no_ip_ospf_network_cmd
,
4908 "no ip ospf network",
4911 "OSPF interface commands\n"
4914 struct interface
*ifp
= vty
->index
;
4915 int old_type
= IF_DEF_PARAMS (ifp
)->type
;
4916 struct route_node
*rn
;
4918 IF_DEF_PARAMS (ifp
)->type
= ospf_default_iftype(ifp
);
4920 if (IF_DEF_PARAMS (ifp
)->type
== old_type
)
4923 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
4925 struct ospf_interface
*oi
= rn
->info
;
4930 oi
->type
= IF_DEF_PARAMS (ifp
)->type
;
4932 if (oi
->state
> ISM_Down
)
4934 OSPF_ISM_EVENT_EXECUTE (oi
, ISM_InterfaceDown
);
4935 OSPF_ISM_EVENT_EXECUTE (oi
, ISM_InterfaceUp
);
4942 ALIAS (no_ip_ospf_network
,
4943 no_ospf_network_cmd
,
4946 "OSPF interface commands\n"
4949 DEFUN (ip_ospf_priority
,
4950 ip_ospf_priority_addr_cmd
,
4951 "ip ospf priority <0-255> A.B.C.D",
4953 "OSPF interface commands\n"
4956 "Address of interface")
4958 struct interface
*ifp
= vty
->index
;
4960 struct route_node
*rn
;
4961 struct in_addr addr
;
4963 struct ospf_if_params
*params
;
4965 params
= IF_DEF_PARAMS (ifp
);
4967 priority
= strtol (argv
[0], NULL
, 10);
4969 /* Router Priority range is <0-255>. */
4970 if (priority
< 0 || priority
> 255)
4972 vty_out (vty
, "Router Priority is invalid%s", VTY_NEWLINE
);
4978 ret
= inet_aton(argv
[1], &addr
);
4981 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4986 params
= ospf_get_if_params (ifp
, addr
);
4987 ospf_if_update_params (ifp
, addr
);
4990 SET_IF_PARAM (params
, priority
);
4991 params
->priority
= priority
;
4993 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
4995 struct ospf_interface
*oi
= rn
->info
;
5001 if (PRIORITY (oi
) != OSPF_IF_PARAM (oi
, priority
))
5003 PRIORITY (oi
) = OSPF_IF_PARAM (oi
, priority
);
5004 OSPF_ISM_EVENT_SCHEDULE (oi
, ISM_NeighborChange
);
5011 ALIAS (ip_ospf_priority
,
5012 ip_ospf_priority_cmd
,
5013 "ip ospf priority <0-255>",
5015 "OSPF interface commands\n"
5019 ALIAS (ip_ospf_priority
,
5021 "ospf priority <0-255>",
5022 "OSPF interface commands\n"
5026 DEFUN (no_ip_ospf_priority
,
5027 no_ip_ospf_priority_addr_cmd
,
5028 "no ip ospf priority A.B.C.D",
5031 "OSPF interface commands\n"
5033 "Address of interface")
5035 struct interface
*ifp
= vty
->index
;
5036 struct route_node
*rn
;
5037 struct in_addr addr
;
5039 struct ospf_if_params
*params
;
5042 params
= IF_DEF_PARAMS (ifp
);
5046 ret
= inet_aton(argv
[0], &addr
);
5049 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
5054 params
= ospf_lookup_if_params (ifp
, addr
);
5059 UNSET_IF_PARAM (params
, priority
);
5060 params
->priority
= OSPF_ROUTER_PRIORITY_DEFAULT
;
5062 if (params
!= IF_DEF_PARAMS (ifp
))
5064 ospf_free_if_params (ifp
, addr
);
5065 ospf_if_update_params (ifp
, addr
);
5068 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
5070 struct ospf_interface
*oi
= rn
->info
;
5076 if (PRIORITY (oi
) != OSPF_IF_PARAM (oi
, priority
))
5078 PRIORITY (oi
) = OSPF_IF_PARAM (oi
, priority
);
5079 OSPF_ISM_EVENT_SCHEDULE (oi
, ISM_NeighborChange
);
5086 ALIAS (no_ip_ospf_priority
,
5087 no_ip_ospf_priority_cmd
,
5088 "no ip ospf priority",
5091 "OSPF interface commands\n"
5092 "Router priority\n")
5094 ALIAS (no_ip_ospf_priority
,
5095 no_ospf_priority_cmd
,
5098 "OSPF interface commands\n"
5099 "Router priority\n")
5101 DEFUN (ip_ospf_retransmit_interval
,
5102 ip_ospf_retransmit_interval_addr_cmd
,
5103 "ip ospf retransmit-interval <3-65535> A.B.C.D",
5105 "OSPF interface commands\n"
5106 "Time between retransmitting lost link state advertisements\n"
5108 "Address of interface")
5110 struct interface
*ifp
= vty
->index
;
5112 struct in_addr addr
;
5114 struct ospf_if_params
*params
;
5116 params
= IF_DEF_PARAMS (ifp
);
5117 seconds
= strtol (argv
[0], NULL
, 10);
5119 /* Retransmit Interval range is <3-65535>. */
5120 if (seconds
< 3 || seconds
> 65535)
5122 vty_out (vty
, "Retransmit Interval is invalid%s", VTY_NEWLINE
);
5129 ret
= inet_aton(argv
[1], &addr
);
5132 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
5137 params
= ospf_get_if_params (ifp
, addr
);
5138 ospf_if_update_params (ifp
, addr
);
5141 SET_IF_PARAM (params
, retransmit_interval
);
5142 params
->retransmit_interval
= seconds
;
5147 ALIAS (ip_ospf_retransmit_interval
,
5148 ip_ospf_retransmit_interval_cmd
,
5149 "ip ospf retransmit-interval <3-65535>",
5151 "OSPF interface commands\n"
5152 "Time between retransmitting lost link state advertisements\n"
5155 ALIAS (ip_ospf_retransmit_interval
,
5156 ospf_retransmit_interval_cmd
,
5157 "ospf retransmit-interval <3-65535>",
5158 "OSPF interface commands\n"
5159 "Time between retransmitting lost link state advertisements\n"
5162 DEFUN (no_ip_ospf_retransmit_interval
,
5163 no_ip_ospf_retransmit_interval_addr_cmd
,
5164 "no ip ospf retransmit-interval A.B.C.D",
5167 "OSPF interface commands\n"
5168 "Time between retransmitting lost link state advertisements\n"
5169 "Address of interface")
5171 struct interface
*ifp
= vty
->index
;
5172 struct in_addr addr
;
5174 struct ospf_if_params
*params
;
5177 params
= IF_DEF_PARAMS (ifp
);
5181 ret
= inet_aton(argv
[0], &addr
);
5184 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
5189 params
= ospf_lookup_if_params (ifp
, addr
);
5194 UNSET_IF_PARAM (params
, retransmit_interval
);
5195 params
->retransmit_interval
= OSPF_RETRANSMIT_INTERVAL_DEFAULT
;
5197 if (params
!= IF_DEF_PARAMS (ifp
))
5199 ospf_free_if_params (ifp
, addr
);
5200 ospf_if_update_params (ifp
, addr
);
5206 ALIAS (no_ip_ospf_retransmit_interval
,
5207 no_ip_ospf_retransmit_interval_cmd
,
5208 "no ip ospf retransmit-interval",
5211 "OSPF interface commands\n"
5212 "Time between retransmitting lost link state advertisements\n")
5214 ALIAS (no_ip_ospf_retransmit_interval
,
5215 no_ospf_retransmit_interval_cmd
,
5216 "no ospf retransmit-interval",
5218 "OSPF interface commands\n"
5219 "Time between retransmitting lost link state advertisements\n")
5221 DEFUN (ip_ospf_transmit_delay
,
5222 ip_ospf_transmit_delay_addr_cmd
,
5223 "ip ospf transmit-delay <1-65535> A.B.C.D",
5225 "OSPF interface commands\n"
5226 "Link state transmit delay\n"
5228 "Address of interface")
5230 struct interface
*ifp
= vty
->index
;
5232 struct in_addr addr
;
5234 struct ospf_if_params
*params
;
5236 params
= IF_DEF_PARAMS (ifp
);
5237 seconds
= strtol (argv
[0], NULL
, 10);
5239 /* Transmit Delay range is <1-65535>. */
5240 if (seconds
< 1 || seconds
> 65535)
5242 vty_out (vty
, "Transmit Delay is invalid%s", VTY_NEWLINE
);
5248 ret
= inet_aton(argv
[1], &addr
);
5251 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
5256 params
= ospf_get_if_params (ifp
, addr
);
5257 ospf_if_update_params (ifp
, addr
);
5260 SET_IF_PARAM (params
, transmit_delay
);
5261 params
->transmit_delay
= seconds
;
5266 ALIAS (ip_ospf_transmit_delay
,
5267 ip_ospf_transmit_delay_cmd
,
5268 "ip ospf transmit-delay <1-65535>",
5270 "OSPF interface commands\n"
5271 "Link state transmit delay\n"
5274 ALIAS (ip_ospf_transmit_delay
,
5275 ospf_transmit_delay_cmd
,
5276 "ospf transmit-delay <1-65535>",
5277 "OSPF interface commands\n"
5278 "Link state transmit delay\n"
5281 DEFUN (no_ip_ospf_transmit_delay
,
5282 no_ip_ospf_transmit_delay_addr_cmd
,
5283 "no ip ospf transmit-delay A.B.C.D",
5286 "OSPF interface commands\n"
5287 "Link state transmit delay\n"
5288 "Address of interface")
5290 struct interface
*ifp
= vty
->index
;
5291 struct in_addr addr
;
5293 struct ospf_if_params
*params
;
5296 params
= IF_DEF_PARAMS (ifp
);
5300 ret
= inet_aton(argv
[0], &addr
);
5303 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
5308 params
= ospf_lookup_if_params (ifp
, addr
);
5313 UNSET_IF_PARAM (params
, transmit_delay
);
5314 params
->transmit_delay
= OSPF_TRANSMIT_DELAY_DEFAULT
;
5316 if (params
!= IF_DEF_PARAMS (ifp
))
5318 ospf_free_if_params (ifp
, addr
);
5319 ospf_if_update_params (ifp
, addr
);
5325 ALIAS (no_ip_ospf_transmit_delay
,
5326 no_ip_ospf_transmit_delay_cmd
,
5327 "no ip ospf transmit-delay",
5330 "OSPF interface commands\n"
5331 "Link state transmit delay\n")
5333 ALIAS (no_ip_ospf_transmit_delay
,
5334 no_ospf_transmit_delay_cmd
,
5335 "no ospf transmit-delay",
5337 "OSPF interface commands\n"
5338 "Link state transmit delay\n")
5341 DEFUN (ospf_redistribute_source_metric_type
,
5342 ospf_redistribute_source_metric_type_routemap_cmd
,
5343 "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2) route-map WORD",
5344 "Redistribute information from another routing protocol\n"
5348 "Routing Information Protocol (RIP)\n"
5349 "Border Gateway Protocol (BGP)\n"
5350 "Metric for redistributed routes\n"
5351 "OSPF default metric\n"
5352 "OSPF exterior metric type for redistributed routes\n"
5353 "Set OSPF External Type 1 metrics\n"
5354 "Set OSPF External Type 2 metrics\n"
5355 "Route map reference\n"
5356 "Pointer to route-map entries\n")
5358 struct ospf
*ospf
= vty
->index
;
5363 /* Get distribute source. */
5364 if (!str2distribute_source (argv
[0], &source
))
5367 /* Get metric value. */
5369 if (!str2metric (argv
[1], &metric
))
5372 /* Get metric type. */
5374 if (!str2metric_type (argv
[2], &type
))
5378 ospf_routemap_set (ospf
, source
, argv
[3]);
5380 ospf_routemap_unset (ospf
, source
);
5382 return ospf_redistribute_set (ospf
, source
, type
, metric
);
5385 ALIAS (ospf_redistribute_source_metric_type
,
5386 ospf_redistribute_source_metric_type_cmd
,
5387 "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2)",
5388 "Redistribute information from another routing protocol\n"
5392 "Routing Information Protocol (RIP)\n"
5393 "Border Gateway Protocol (BGP)\n"
5394 "Metric for redistributed routes\n"
5395 "OSPF default metric\n"
5396 "OSPF exterior metric type for redistributed routes\n"
5397 "Set OSPF External Type 1 metrics\n"
5398 "Set OSPF External Type 2 metrics\n")
5400 ALIAS (ospf_redistribute_source_metric_type
,
5401 ospf_redistribute_source_metric_cmd
,
5402 "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214>",
5403 "Redistribute information from another routing protocol\n"
5407 "Routing Information Protocol (RIP)\n"
5408 "Border Gateway Protocol (BGP)\n"
5409 "Metric for redistributed routes\n"
5410 "OSPF default metric\n")
5412 DEFUN (ospf_redistribute_source_type_metric
,
5413 ospf_redistribute_source_type_metric_routemap_cmd
,
5414 "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214> route-map WORD",
5415 "Redistribute information from another routing protocol\n"
5419 "Routing Information Protocol (RIP)\n"
5420 "Border Gateway Protocol (BGP)\n"
5421 "OSPF exterior metric type for redistributed routes\n"
5422 "Set OSPF External Type 1 metrics\n"
5423 "Set OSPF External Type 2 metrics\n"
5424 "Metric for redistributed routes\n"
5425 "OSPF default metric\n"
5426 "Route map reference\n"
5427 "Pointer to route-map entries\n")
5429 struct ospf
*ospf
= vty
->index
;
5434 /* Get distribute source. */
5435 if (!str2distribute_source (argv
[0], &source
))
5438 /* Get metric value. */
5440 if (!str2metric_type (argv
[1], &type
))
5443 /* Get metric type. */
5445 if (!str2metric (argv
[2], &metric
))
5449 ospf_routemap_set (ospf
, source
, argv
[3]);
5451 ospf_routemap_unset (ospf
, source
);
5453 return ospf_redistribute_set (ospf
, source
, type
, metric
);
5456 ALIAS (ospf_redistribute_source_type_metric
,
5457 ospf_redistribute_source_type_metric_cmd
,
5458 "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214>",
5459 "Redistribute information from another routing protocol\n"
5463 "Routing Information Protocol (RIP)\n"
5464 "Border Gateway Protocol (BGP)\n"
5465 "OSPF exterior metric type for redistributed routes\n"
5466 "Set OSPF External Type 1 metrics\n"
5467 "Set OSPF External Type 2 metrics\n"
5468 "Metric for redistributed routes\n"
5469 "OSPF default metric\n")
5471 ALIAS (ospf_redistribute_source_type_metric
,
5472 ospf_redistribute_source_type_cmd
,
5473 "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)",
5474 "Redistribute information from another routing protocol\n"
5478 "Routing Information Protocol (RIP)\n"
5479 "Border Gateway Protocol (BGP)\n"
5480 "OSPF exterior metric type for redistributed routes\n"
5481 "Set OSPF External Type 1 metrics\n"
5482 "Set OSPF External Type 2 metrics\n")
5484 ALIAS (ospf_redistribute_source_type_metric
,
5485 ospf_redistribute_source_cmd
,
5486 "redistribute (kernel|connected|static|rip|bgp)",
5487 "Redistribute information from another routing protocol\n"
5491 "Routing Information Protocol (RIP)\n"
5492 "Border Gateway Protocol (BGP)\n")
5494 DEFUN (ospf_redistribute_source_metric_routemap
,
5495 ospf_redistribute_source_metric_routemap_cmd
,
5496 "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> route-map WORD",
5497 "Redistribute information from another routing protocol\n"
5501 "Routing Information Protocol (RIP)\n"
5502 "Border Gateway Protocol (BGP)\n"
5503 "Metric for redistributed routes\n"
5504 "OSPF default metric\n"
5505 "Route map reference\n"
5506 "Pointer to route-map entries\n")
5508 struct ospf
*ospf
= vty
->index
;
5512 /* Get distribute source. */
5513 if (!str2distribute_source (argv
[0], &source
))
5516 /* Get metric value. */
5518 if (!str2metric (argv
[1], &metric
))
5522 ospf_routemap_set (ospf
, source
, argv
[2]);
5524 ospf_routemap_unset (ospf
, source
);
5526 return ospf_redistribute_set (ospf
, source
, -1, metric
);
5529 DEFUN (ospf_redistribute_source_type_routemap
,
5530 ospf_redistribute_source_type_routemap_cmd
,
5531 "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map WORD",
5532 "Redistribute information from another routing protocol\n"
5536 "Routing Information Protocol (RIP)\n"
5537 "Border Gateway Protocol (BGP)\n"
5538 "OSPF exterior metric type for redistributed routes\n"
5539 "Set OSPF External Type 1 metrics\n"
5540 "Set OSPF External Type 2 metrics\n"
5541 "Route map reference\n"
5542 "Pointer to route-map entries\n")
5544 struct ospf
*ospf
= vty
->index
;
5548 /* Get distribute source. */
5549 if (!str2distribute_source (argv
[0], &source
))
5552 /* Get metric value. */
5554 if (!str2metric_type (argv
[1], &type
))
5558 ospf_routemap_set (ospf
, source
, argv
[2]);
5560 ospf_routemap_unset (ospf
, source
);
5562 return ospf_redistribute_set (ospf
, source
, type
, -1);
5565 DEFUN (ospf_redistribute_source_routemap
,
5566 ospf_redistribute_source_routemap_cmd
,
5567 "redistribute (kernel|connected|static|rip|bgp) route-map WORD",
5568 "Redistribute information from another routing protocol\n"
5572 "Routing Information Protocol (RIP)\n"
5573 "Border Gateway Protocol (BGP)\n"
5574 "Route map reference\n"
5575 "Pointer to route-map entries\n")
5577 struct ospf
*ospf
= vty
->index
;
5580 /* Get distribute source. */
5581 if (!str2distribute_source (argv
[0], &source
))
5585 ospf_routemap_set (ospf
, source
, argv
[1]);
5587 ospf_routemap_unset (ospf
, source
);
5589 return ospf_redistribute_set (ospf
, source
, -1, -1);
5592 DEFUN (no_ospf_redistribute_source
,
5593 no_ospf_redistribute_source_cmd
,
5594 "no redistribute (kernel|connected|static|rip|bgp)",
5596 "Redistribute information from another routing protocol\n"
5600 "Routing Information Protocol (RIP)\n"
5601 "Border Gateway Protocol (BGP)\n")
5603 struct ospf
*ospf
= vty
->index
;
5606 if (!str2distribute_source (argv
[0], &source
))
5609 ospf_routemap_unset (ospf
, source
);
5610 return ospf_redistribute_unset (ospf
, source
);
5613 DEFUN (ospf_distribute_list_out
,
5614 ospf_distribute_list_out_cmd
,
5615 "distribute-list WORD out (kernel|connected|static|rip|bgp)",
5616 "Filter networks in routing updates\n"
5617 "Access-list name\n"
5622 "Routing Information Protocol (RIP)\n"
5623 "Border Gateway Protocol (BGP)\n")
5625 struct ospf
*ospf
= vty
->index
;
5628 /* Get distribute source. */
5629 if (!str2distribute_source (argv
[1], &source
))
5632 return ospf_distribute_list_out_set (ospf
, source
, argv
[0]);
5635 DEFUN (no_ospf_distribute_list_out
,
5636 no_ospf_distribute_list_out_cmd
,
5637 "no distribute-list WORD out (kernel|connected|static|rip|bgp)",
5639 "Filter networks in routing updates\n"
5640 "Access-list name\n"
5645 "Routing Information Protocol (RIP)\n"
5646 "Border Gateway Protocol (BGP)\n")
5648 struct ospf
*ospf
= vty
->index
;
5651 if (!str2distribute_source (argv
[1], &source
))
5654 return ospf_distribute_list_out_unset (ospf
, source
, argv
[0]);
5657 /* Default information originate. */
5658 DEFUN (ospf_default_information_originate_metric_type_routemap
,
5659 ospf_default_information_originate_metric_type_routemap_cmd
,
5660 "default-information originate metric <0-16777214> metric-type (1|2) route-map WORD",
5661 "Control distribution of default information\n"
5662 "Distribute a default route\n"
5663 "OSPF default metric\n"
5665 "OSPF metric type for default routes\n"
5666 "Set OSPF External Type 1 metrics\n"
5667 "Set OSPF External Type 2 metrics\n"
5668 "Route map reference\n"
5669 "Pointer to route-map entries\n")
5671 struct ospf
*ospf
= vty
->index
;
5675 /* Get metric value. */
5677 if (!str2metric (argv
[0], &metric
))
5680 /* Get metric type. */
5682 if (!str2metric_type (argv
[1], &type
))
5686 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[2]);
5688 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5690 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ZEBRA
,
5694 ALIAS (ospf_default_information_originate_metric_type_routemap
,
5695 ospf_default_information_originate_metric_type_cmd
,
5696 "default-information originate metric <0-16777214> metric-type (1|2)",
5697 "Control distribution of default information\n"
5698 "Distribute a default route\n"
5699 "OSPF default metric\n"
5701 "OSPF metric type for default routes\n"
5702 "Set OSPF External Type 1 metrics\n"
5703 "Set OSPF External Type 2 metrics\n")
5705 ALIAS (ospf_default_information_originate_metric_type_routemap
,
5706 ospf_default_information_originate_metric_cmd
,
5707 "default-information originate metric <0-16777214>",
5708 "Control distribution of default information\n"
5709 "Distribute a default route\n"
5710 "OSPF default metric\n"
5713 ALIAS (ospf_default_information_originate_metric_type_routemap
,
5714 ospf_default_information_originate_cmd
,
5715 "default-information originate",
5716 "Control distribution of default information\n"
5717 "Distribute a default route\n")
5719 /* Default information originate. */
5720 DEFUN (ospf_default_information_originate_metric_routemap
,
5721 ospf_default_information_originate_metric_routemap_cmd
,
5722 "default-information originate metric <0-16777214> route-map WORD",
5723 "Control distribution of default information\n"
5724 "Distribute a default route\n"
5725 "OSPF default metric\n"
5727 "Route map reference\n"
5728 "Pointer to route-map entries\n")
5730 struct ospf
*ospf
= vty
->index
;
5733 /* Get metric value. */
5735 if (!str2metric (argv
[0], &metric
))
5739 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[1]);
5741 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5743 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ZEBRA
,
5747 /* Default information originate. */
5748 DEFUN (ospf_default_information_originate_routemap
,
5749 ospf_default_information_originate_routemap_cmd
,
5750 "default-information originate route-map WORD",
5751 "Control distribution of default information\n"
5752 "Distribute a default route\n"
5753 "Route map reference\n"
5754 "Pointer to route-map entries\n")
5756 struct ospf
*ospf
= vty
->index
;
5759 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[0]);
5761 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5763 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ZEBRA
, -1, -1);
5766 DEFUN (ospf_default_information_originate_type_metric_routemap
,
5767 ospf_default_information_originate_type_metric_routemap_cmd
,
5768 "default-information originate metric-type (1|2) metric <0-16777214> route-map WORD",
5769 "Control distribution of default information\n"
5770 "Distribute a default route\n"
5771 "OSPF metric type for default routes\n"
5772 "Set OSPF External Type 1 metrics\n"
5773 "Set OSPF External Type 2 metrics\n"
5774 "OSPF default metric\n"
5776 "Route map reference\n"
5777 "Pointer to route-map entries\n")
5779 struct ospf
*ospf
= vty
->index
;
5783 /* Get metric type. */
5785 if (!str2metric_type (argv
[0], &type
))
5788 /* Get metric value. */
5790 if (!str2metric (argv
[1], &metric
))
5794 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[2]);
5796 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5798 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ZEBRA
,
5802 ALIAS (ospf_default_information_originate_type_metric_routemap
,
5803 ospf_default_information_originate_type_metric_cmd
,
5804 "default-information originate metric-type (1|2) metric <0-16777214>",
5805 "Control distribution of default information\n"
5806 "Distribute a default route\n"
5807 "OSPF metric type for default routes\n"
5808 "Set OSPF External Type 1 metrics\n"
5809 "Set OSPF External Type 2 metrics\n"
5810 "OSPF default metric\n"
5813 ALIAS (ospf_default_information_originate_type_metric_routemap
,
5814 ospf_default_information_originate_type_cmd
,
5815 "default-information originate metric-type (1|2)",
5816 "Control distribution of default information\n"
5817 "Distribute a default route\n"
5818 "OSPF metric type for default routes\n"
5819 "Set OSPF External Type 1 metrics\n"
5820 "Set OSPF External Type 2 metrics\n")
5822 DEFUN (ospf_default_information_originate_type_routemap
,
5823 ospf_default_information_originate_type_routemap_cmd
,
5824 "default-information originate metric-type (1|2) route-map WORD",
5825 "Control distribution of default information\n"
5826 "Distribute a default route\n"
5827 "OSPF metric type for default routes\n"
5828 "Set OSPF External Type 1 metrics\n"
5829 "Set OSPF External Type 2 metrics\n"
5830 "Route map reference\n"
5831 "Pointer to route-map entries\n")
5833 struct ospf
*ospf
= vty
->index
;
5836 /* Get metric type. */
5838 if (!str2metric_type (argv
[0], &type
))
5842 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[1]);
5844 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5846 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ZEBRA
,
5850 DEFUN (ospf_default_information_originate_always_metric_type_routemap
,
5851 ospf_default_information_originate_always_metric_type_routemap_cmd
,
5852 "default-information originate always metric <0-16777214> metric-type (1|2) route-map WORD",
5853 "Control distribution of default information\n"
5854 "Distribute a default route\n"
5855 "Always advertise default route\n"
5856 "OSPF default metric\n"
5858 "OSPF metric type for default routes\n"
5859 "Set OSPF External Type 1 metrics\n"
5860 "Set OSPF External Type 2 metrics\n"
5861 "Route map reference\n"
5862 "Pointer to route-map entries\n")
5864 struct ospf
*ospf
= vty
->index
;
5868 /* Get metric value. */
5870 if (!str2metric (argv
[0], &metric
))
5873 /* Get metric type. */
5875 if (!str2metric_type (argv
[1], &type
))
5879 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[2]);
5881 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5883 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ALWAYS
,
5887 ALIAS (ospf_default_information_originate_always_metric_type_routemap
,
5888 ospf_default_information_originate_always_metric_type_cmd
,
5889 "default-information originate always metric <0-16777214> metric-type (1|2)",
5890 "Control distribution of default information\n"
5891 "Distribute a default route\n"
5892 "Always advertise default route\n"
5893 "OSPF default metric\n"
5895 "OSPF metric type for default routes\n"
5896 "Set OSPF External Type 1 metrics\n"
5897 "Set OSPF External Type 2 metrics\n")
5899 ALIAS (ospf_default_information_originate_always_metric_type_routemap
,
5900 ospf_default_information_originate_always_metric_cmd
,
5901 "default-information originate always metric <0-16777214>",
5902 "Control distribution of default information\n"
5903 "Distribute a default route\n"
5904 "Always advertise default route\n"
5905 "OSPF default metric\n"
5907 "OSPF metric type for default routes\n")
5909 ALIAS (ospf_default_information_originate_always_metric_type_routemap
,
5910 ospf_default_information_originate_always_cmd
,
5911 "default-information originate always",
5912 "Control distribution of default information\n"
5913 "Distribute a default route\n"
5914 "Always advertise default route\n")
5916 DEFUN (ospf_default_information_originate_always_metric_routemap
,
5917 ospf_default_information_originate_always_metric_routemap_cmd
,
5918 "default-information originate always metric <0-16777214> route-map WORD",
5919 "Control distribution of default information\n"
5920 "Distribute a default route\n"
5921 "Always advertise default route\n"
5922 "OSPF default metric\n"
5924 "Route map reference\n"
5925 "Pointer to route-map entries\n")
5927 struct ospf
*ospf
= vty
->index
;
5930 /* Get metric value. */
5932 if (!str2metric (argv
[0], &metric
))
5936 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[1]);
5938 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5940 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ALWAYS
,
5944 DEFUN (ospf_default_information_originate_always_routemap
,
5945 ospf_default_information_originate_always_routemap_cmd
,
5946 "default-information originate always route-map WORD",
5947 "Control distribution of default information\n"
5948 "Distribute a default route\n"
5949 "Always advertise default route\n"
5950 "Route map reference\n"
5951 "Pointer to route-map entries\n")
5953 struct ospf
*ospf
= vty
->index
;
5956 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[0]);
5958 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5960 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ALWAYS
, -1, -1);
5963 DEFUN (ospf_default_information_originate_always_type_metric_routemap
,
5964 ospf_default_information_originate_always_type_metric_routemap_cmd
,
5965 "default-information originate always metric-type (1|2) metric <0-16777214> route-map WORD",
5966 "Control distribution of default information\n"
5967 "Distribute a default route\n"
5968 "Always advertise default route\n"
5969 "OSPF metric type for default routes\n"
5970 "Set OSPF External Type 1 metrics\n"
5971 "Set OSPF External Type 2 metrics\n"
5972 "OSPF default metric\n"
5974 "Route map reference\n"
5975 "Pointer to route-map entries\n")
5977 struct ospf
*ospf
= vty
->index
;
5981 /* Get metric type. */
5983 if (!str2metric_type (argv
[0], &type
))
5986 /* Get metric value. */
5988 if (!str2metric (argv
[1], &metric
))
5992 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[2]);
5994 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5996 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ALWAYS
,
6000 ALIAS (ospf_default_information_originate_always_type_metric_routemap
,
6001 ospf_default_information_originate_always_type_metric_cmd
,
6002 "default-information originate always metric-type (1|2) metric <0-16777214>",
6003 "Control distribution of default information\n"
6004 "Distribute a default route\n"
6005 "Always advertise default route\n"
6006 "OSPF metric type for default routes\n"
6007 "Set OSPF External Type 1 metrics\n"
6008 "Set OSPF External Type 2 metrics\n"
6009 "OSPF default metric\n"
6012 ALIAS (ospf_default_information_originate_always_type_metric_routemap
,
6013 ospf_default_information_originate_always_type_cmd
,
6014 "default-information originate always metric-type (1|2)",
6015 "Control distribution of default information\n"
6016 "Distribute a default route\n"
6017 "Always advertise default route\n"
6018 "OSPF metric type for default routes\n"
6019 "Set OSPF External Type 1 metrics\n"
6020 "Set OSPF External Type 2 metrics\n")
6022 DEFUN (ospf_default_information_originate_always_type_routemap
,
6023 ospf_default_information_originate_always_type_routemap_cmd
,
6024 "default-information originate always metric-type (1|2) route-map WORD",
6025 "Control distribution of default information\n"
6026 "Distribute a default route\n"
6027 "Always advertise default route\n"
6028 "OSPF metric type for default routes\n"
6029 "Set OSPF External Type 1 metrics\n"
6030 "Set OSPF External Type 2 metrics\n"
6031 "Route map reference\n"
6032 "Pointer to route-map entries\n")
6034 struct ospf
*ospf
= vty
->index
;
6037 /* Get metric type. */
6039 if (!str2metric_type (argv
[0], &type
))
6043 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[1]);
6045 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
6047 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ALWAYS
,
6051 DEFUN (no_ospf_default_information_originate
,
6052 no_ospf_default_information_originate_cmd
,
6053 "no default-information originate",
6055 "Control distribution of default information\n"
6056 "Distribute a default route\n")
6058 struct ospf
*ospf
= vty
->index
;
6059 struct prefix_ipv4 p
;
6060 struct in_addr nexthop
;
6063 p
.prefix
.s_addr
= 0;
6066 ospf_external_lsa_flush (ospf
, DEFAULT_ROUTE
, &p
, 0, nexthop
);
6068 if (EXTERNAL_INFO (DEFAULT_ROUTE
)) {
6069 ospf_external_info_delete (DEFAULT_ROUTE
, p
);
6070 route_table_finish (EXTERNAL_INFO (DEFAULT_ROUTE
));
6071 EXTERNAL_INFO (DEFAULT_ROUTE
) = NULL
;
6074 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
6075 return ospf_redistribute_default_unset (ospf
);
6078 DEFUN (ospf_default_metric
,
6079 ospf_default_metric_cmd
,
6080 "default-metric <0-16777214>",
6081 "Set metric of redistributed routes\n"
6084 struct ospf
*ospf
= vty
->index
;
6087 if (!str2metric (argv
[0], &metric
))
6090 ospf
->default_metric
= metric
;
6095 DEFUN (no_ospf_default_metric
,
6096 no_ospf_default_metric_cmd
,
6097 "no default-metric",
6099 "Set metric of redistributed routes\n")
6101 struct ospf
*ospf
= vty
->index
;
6103 ospf
->default_metric
= -1;
6108 ALIAS (no_ospf_default_metric
,
6109 no_ospf_default_metric_val_cmd
,
6110 "no default-metric <0-16777214>",
6112 "Set metric of redistributed routes\n"
6115 DEFUN (ospf_distance
,
6118 "Define an administrative distance\n"
6119 "OSPF Administrative distance\n")
6121 struct ospf
*ospf
= vty
->index
;
6123 ospf
->distance_all
= atoi (argv
[0]);
6128 DEFUN (no_ospf_distance
,
6129 no_ospf_distance_cmd
,
6130 "no distance <1-255>",
6132 "Define an administrative distance\n"
6133 "OSPF Administrative distance\n")
6135 struct ospf
*ospf
= vty
->index
;
6137 ospf
->distance_all
= 0;
6142 DEFUN (no_ospf_distance_ospf
,
6143 no_ospf_distance_ospf_cmd
,
6146 "Define an administrative distance\n"
6147 "OSPF Administrative distance\n"
6150 struct ospf
*ospf
= vty
->index
;
6152 ospf
->distance_intra
= 0;
6153 ospf
->distance_inter
= 0;
6154 ospf
->distance_external
= 0;
6159 DEFUN (ospf_distance_ospf_intra
,
6160 ospf_distance_ospf_intra_cmd
,
6161 "distance ospf intra-area <1-255>",
6162 "Define an administrative distance\n"
6163 "OSPF Administrative distance\n"
6164 "Intra-area routes\n"
6165 "Distance for intra-area routes\n")
6167 struct ospf
*ospf
= vty
->index
;
6169 ospf
->distance_intra
= atoi (argv
[0]);
6174 DEFUN (ospf_distance_ospf_intra_inter
,
6175 ospf_distance_ospf_intra_inter_cmd
,
6176 "distance ospf intra-area <1-255> inter-area <1-255>",
6177 "Define an administrative distance\n"
6178 "OSPF Administrative distance\n"
6179 "Intra-area routes\n"
6180 "Distance for intra-area routes\n"
6181 "Inter-area routes\n"
6182 "Distance for inter-area routes\n")
6184 struct ospf
*ospf
= vty
->index
;
6186 ospf
->distance_intra
= atoi (argv
[0]);
6187 ospf
->distance_inter
= atoi (argv
[1]);
6192 DEFUN (ospf_distance_ospf_intra_external
,
6193 ospf_distance_ospf_intra_external_cmd
,
6194 "distance ospf intra-area <1-255> external <1-255>",
6195 "Define an administrative distance\n"
6196 "OSPF Administrative distance\n"
6197 "Intra-area routes\n"
6198 "Distance for intra-area routes\n"
6200 "Distance for external routes\n")
6202 struct ospf
*ospf
= vty
->index
;
6204 ospf
->distance_intra
= atoi (argv
[0]);
6205 ospf
->distance_external
= atoi (argv
[1]);
6210 DEFUN (ospf_distance_ospf_intra_inter_external
,
6211 ospf_distance_ospf_intra_inter_external_cmd
,
6212 "distance ospf intra-area <1-255> inter-area <1-255> external <1-255>",
6213 "Define an administrative distance\n"
6214 "OSPF Administrative distance\n"
6215 "Intra-area routes\n"
6216 "Distance for intra-area routes\n"
6217 "Inter-area routes\n"
6218 "Distance for inter-area routes\n"
6220 "Distance for external routes\n")
6222 struct ospf
*ospf
= vty
->index
;
6224 ospf
->distance_intra
= atoi (argv
[0]);
6225 ospf
->distance_inter
= atoi (argv
[1]);
6226 ospf
->distance_external
= atoi (argv
[2]);
6231 DEFUN (ospf_distance_ospf_intra_external_inter
,
6232 ospf_distance_ospf_intra_external_inter_cmd
,
6233 "distance ospf intra-area <1-255> external <1-255> inter-area <1-255>",
6234 "Define an administrative distance\n"
6235 "OSPF Administrative distance\n"
6236 "Intra-area routes\n"
6237 "Distance for intra-area routes\n"
6239 "Distance for external routes\n"
6240 "Inter-area routes\n"
6241 "Distance for inter-area routes\n")
6243 struct ospf
*ospf
= vty
->index
;
6245 ospf
->distance_intra
= atoi (argv
[0]);
6246 ospf
->distance_external
= atoi (argv
[1]);
6247 ospf
->distance_inter
= atoi (argv
[2]);
6252 DEFUN (ospf_distance_ospf_inter
,
6253 ospf_distance_ospf_inter_cmd
,
6254 "distance ospf inter-area <1-255>",
6255 "Define an administrative distance\n"
6256 "OSPF Administrative distance\n"
6257 "Inter-area routes\n"
6258 "Distance for inter-area routes\n")
6260 struct ospf
*ospf
= vty
->index
;
6262 ospf
->distance_inter
= atoi (argv
[0]);
6267 DEFUN (ospf_distance_ospf_inter_intra
,
6268 ospf_distance_ospf_inter_intra_cmd
,
6269 "distance ospf inter-area <1-255> intra-area <1-255>",
6270 "Define an administrative distance\n"
6271 "OSPF Administrative distance\n"
6272 "Inter-area routes\n"
6273 "Distance for inter-area routes\n"
6274 "Intra-area routes\n"
6275 "Distance for intra-area routes\n")
6277 struct ospf
*ospf
= vty
->index
;
6279 ospf
->distance_inter
= atoi (argv
[0]);
6280 ospf
->distance_intra
= atoi (argv
[1]);
6285 DEFUN (ospf_distance_ospf_inter_external
,
6286 ospf_distance_ospf_inter_external_cmd
,
6287 "distance ospf inter-area <1-255> external <1-255>",
6288 "Define an administrative distance\n"
6289 "OSPF Administrative distance\n"
6290 "Inter-area routes\n"
6291 "Distance for inter-area routes\n"
6293 "Distance for external routes\n")
6295 struct ospf
*ospf
= vty
->index
;
6297 ospf
->distance_inter
= atoi (argv
[0]);
6298 ospf
->distance_external
= atoi (argv
[1]);
6303 DEFUN (ospf_distance_ospf_inter_intra_external
,
6304 ospf_distance_ospf_inter_intra_external_cmd
,
6305 "distance ospf inter-area <1-255> intra-area <1-255> external <1-255>",
6306 "Define an administrative distance\n"
6307 "OSPF Administrative distance\n"
6308 "Inter-area routes\n"
6309 "Distance for inter-area routes\n"
6310 "Intra-area routes\n"
6311 "Distance for intra-area routes\n"
6313 "Distance for external routes\n")
6315 struct ospf
*ospf
= vty
->index
;
6317 ospf
->distance_inter
= atoi (argv
[0]);
6318 ospf
->distance_intra
= atoi (argv
[1]);
6319 ospf
->distance_external
= atoi (argv
[2]);
6324 DEFUN (ospf_distance_ospf_inter_external_intra
,
6325 ospf_distance_ospf_inter_external_intra_cmd
,
6326 "distance ospf inter-area <1-255> external <1-255> intra-area <1-255>",
6327 "Define an administrative distance\n"
6328 "OSPF Administrative distance\n"
6329 "Inter-area routes\n"
6330 "Distance for inter-area routes\n"
6332 "Distance for external routes\n"
6333 "Intra-area routes\n"
6334 "Distance for intra-area routes\n")
6336 struct ospf
*ospf
= vty
->index
;
6338 ospf
->distance_inter
= atoi (argv
[0]);
6339 ospf
->distance_external
= atoi (argv
[1]);
6340 ospf
->distance_intra
= atoi (argv
[2]);
6345 DEFUN (ospf_distance_ospf_external
,
6346 ospf_distance_ospf_external_cmd
,
6347 "distance ospf external <1-255>",
6348 "Define an administrative distance\n"
6349 "OSPF Administrative distance\n"
6351 "Distance for external routes\n")
6353 struct ospf
*ospf
= vty
->index
;
6355 ospf
->distance_external
= atoi (argv
[0]);
6360 DEFUN (ospf_distance_ospf_external_intra
,
6361 ospf_distance_ospf_external_intra_cmd
,
6362 "distance ospf external <1-255> intra-area <1-255>",
6363 "Define an administrative distance\n"
6364 "OSPF Administrative distance\n"
6366 "Distance for external routes\n"
6367 "Intra-area routes\n"
6368 "Distance for intra-area routes\n")
6370 struct ospf
*ospf
= vty
->index
;
6372 ospf
->distance_external
= atoi (argv
[0]);
6373 ospf
->distance_intra
= atoi (argv
[1]);
6378 DEFUN (ospf_distance_ospf_external_inter
,
6379 ospf_distance_ospf_external_inter_cmd
,
6380 "distance ospf external <1-255> inter-area <1-255>",
6381 "Define an administrative distance\n"
6382 "OSPF Administrative distance\n"
6384 "Distance for external routes\n"
6385 "Inter-area routes\n"
6386 "Distance for inter-area routes\n")
6388 struct ospf
*ospf
= vty
->index
;
6390 ospf
->distance_external
= atoi (argv
[0]);
6391 ospf
->distance_inter
= atoi (argv
[1]);
6396 DEFUN (ospf_distance_ospf_external_intra_inter
,
6397 ospf_distance_ospf_external_intra_inter_cmd
,
6398 "distance ospf external <1-255> intra-area <1-255> inter-area <1-255>",
6399 "Define an administrative distance\n"
6400 "OSPF Administrative distance\n"
6402 "Distance for external routes\n"
6403 "Intra-area routes\n"
6404 "Distance for intra-area routes\n"
6405 "Inter-area routes\n"
6406 "Distance for inter-area routes\n")
6408 struct ospf
*ospf
= vty
->index
;
6410 ospf
->distance_external
= atoi (argv
[0]);
6411 ospf
->distance_intra
= atoi (argv
[1]);
6412 ospf
->distance_inter
= atoi (argv
[2]);
6417 DEFUN (ospf_distance_ospf_external_inter_intra
,
6418 ospf_distance_ospf_external_inter_intra_cmd
,
6419 "distance ospf external <1-255> inter-area <1-255> intra-area <1-255>",
6420 "Define an administrative distance\n"
6421 "OSPF Administrative distance\n"
6423 "Distance for external routes\n"
6424 "Inter-area routes\n"
6425 "Distance for inter-area routes\n"
6426 "Intra-area routes\n"
6427 "Distance for intra-area routes\n")
6429 struct ospf
*ospf
= vty
->index
;
6431 ospf
->distance_external
= atoi (argv
[0]);
6432 ospf
->distance_inter
= atoi (argv
[1]);
6433 ospf
->distance_intra
= atoi (argv
[2]);
6438 DEFUN (ospf_distance_source
,
6439 ospf_distance_source_cmd
,
6440 "distance <1-255> A.B.C.D/M",
6441 "Administrative distance\n"
6443 "IP source prefix\n")
6445 struct ospf
*ospf
= vty
->index
;
6447 ospf_distance_set (vty
, ospf
, argv
[0], argv
[1], NULL
);
6452 DEFUN (no_ospf_distance_source
,
6453 no_ospf_distance_source_cmd
,
6454 "no distance <1-255> A.B.C.D/M",
6456 "Administrative distance\n"
6458 "IP source prefix\n")
6460 struct ospf
*ospf
= vty
->index
;
6462 ospf_distance_unset (vty
, ospf
, argv
[0], argv
[1], NULL
);
6467 DEFUN (ospf_distance_source_access_list
,
6468 ospf_distance_source_access_list_cmd
,
6469 "distance <1-255> A.B.C.D/M WORD",
6470 "Administrative distance\n"
6472 "IP source prefix\n"
6473 "Access list name\n")
6475 struct ospf
*ospf
= vty
->index
;
6477 ospf_distance_set (vty
, ospf
, argv
[0], argv
[1], argv
[2]);
6482 DEFUN (no_ospf_distance_source_access_list
,
6483 no_ospf_distance_source_access_list_cmd
,
6484 "no distance <1-255> A.B.C.D/M WORD",
6486 "Administrative distance\n"
6488 "IP source prefix\n"
6489 "Access list name\n")
6491 struct ospf
*ospf
= vty
->index
;
6493 ospf_distance_unset (vty
, ospf
, argv
[0], argv
[1], argv
[2]);
6499 show_ip_ospf_route_network (struct vty
*vty
, struct route_table
*rt
)
6501 struct route_node
*rn
;
6502 struct ospf_route
*or;
6503 struct listnode
*pnode
, *pnnode
;
6504 struct ospf_path
*path
;
6506 vty_out (vty
, "============ OSPF network routing table ============%s",
6509 for (rn
= route_top (rt
); rn
; rn
= route_next (rn
))
6510 if ((or = rn
->info
) != NULL
)
6513 snprintf (buf1
, 19, "%s/%d",
6514 inet_ntoa (rn
->p
.u
.prefix4
), rn
->p
.prefixlen
);
6516 switch (or->path_type
)
6518 case OSPF_PATH_INTER_AREA
:
6519 if (or->type
== OSPF_DESTINATION_NETWORK
)
6520 vty_out (vty
, "N IA %-18s [%d] area: %s%s", buf1
, or->cost
,
6521 inet_ntoa (or->u
.std
.area_id
), VTY_NEWLINE
);
6522 else if (or->type
== OSPF_DESTINATION_DISCARD
)
6523 vty_out (vty
, "D IA %-18s Discard entry%s", buf1
, VTY_NEWLINE
);
6525 case OSPF_PATH_INTRA_AREA
:
6526 vty_out (vty
, "N %-18s [%d] area: %s%s", buf1
, or->cost
,
6527 inet_ntoa (or->u
.std
.area_id
), VTY_NEWLINE
);
6533 if (or->type
== OSPF_DESTINATION_NETWORK
)
6534 for (ALL_LIST_ELEMENTS (or->paths
, pnode
, pnnode
, path
))
6536 if (path
->oi
!= NULL
)
6538 if (path
->nexthop
.s_addr
== 0)
6539 vty_out (vty
, "%24s directly attached to %s%s",
6540 "", path
->oi
->ifp
->name
, VTY_NEWLINE
);
6542 vty_out (vty
, "%24s via %s, %s%s", "",
6543 inet_ntoa (path
->nexthop
), path
->oi
->ifp
->name
,
6548 vty_out (vty
, "%s", VTY_NEWLINE
);
6552 show_ip_ospf_route_router (struct vty
*vty
, struct route_table
*rtrs
)
6554 struct route_node
*rn
;
6555 struct ospf_route
*or;
6556 struct listnode
*pnode
;
6557 struct listnode
*node
;
6558 struct ospf_path
*path
;
6560 vty_out (vty
, "============ OSPF router routing table =============%s",
6562 for (rn
= route_top (rtrs
); rn
; rn
= route_next (rn
))
6567 vty_out (vty
, "R %-15s ", inet_ntoa (rn
->p
.u
.prefix4
));
6569 for (ALL_LIST_ELEMENTS_RO ((struct list
*)rn
->info
, node
, or))
6572 vty_out (vty
, "%24s", "");
6575 vty_out (vty
, "%s [%d] area: %s",
6576 (or->path_type
== OSPF_PATH_INTER_AREA
? "IA" : " "),
6577 or->cost
, inet_ntoa (or->u
.std
.area_id
));
6579 vty_out (vty
, "%s%s%s",
6580 (or->u
.std
.flags
& ROUTER_LSA_BORDER
? ", ABR" : ""),
6581 (or->u
.std
.flags
& ROUTER_LSA_EXTERNAL
? ", ASBR" : ""),
6584 for (ALL_LIST_ELEMENTS_RO (or->paths
, pnode
, path
))
6586 if (path
->nexthop
.s_addr
== 0)
6587 vty_out (vty
, "%24s directly attached to %s%s",
6588 "", path
->oi
->ifp
->name
, VTY_NEWLINE
);
6590 vty_out (vty
, "%24s via %s, %s%s", "",
6591 inet_ntoa (path
->nexthop
), path
->oi
->ifp
->name
,
6596 vty_out (vty
, "%s", VTY_NEWLINE
);
6600 show_ip_ospf_route_external (struct vty
*vty
, struct route_table
*rt
)
6602 struct route_node
*rn
;
6603 struct ospf_route
*er
;
6604 struct listnode
*pnode
, *pnnode
;
6605 struct ospf_path
*path
;
6607 vty_out (vty
, "============ OSPF external routing table ===========%s",
6609 for (rn
= route_top (rt
); rn
; rn
= route_next (rn
))
6610 if ((er
= rn
->info
) != NULL
)
6613 snprintf (buf1
, 19, "%s/%d",
6614 inet_ntoa (rn
->p
.u
.prefix4
), rn
->p
.prefixlen
);
6616 switch (er
->path_type
)
6618 case OSPF_PATH_TYPE1_EXTERNAL
:
6619 vty_out (vty
, "N E1 %-18s [%d] tag: %u%s", buf1
,
6620 er
->cost
, er
->u
.ext
.tag
, VTY_NEWLINE
);
6622 case OSPF_PATH_TYPE2_EXTERNAL
:
6623 vty_out (vty
, "N E2 %-18s [%d/%d] tag: %u%s", buf1
, er
->cost
,
6624 er
->u
.ext
.type2_cost
, er
->u
.ext
.tag
, VTY_NEWLINE
);
6628 for (ALL_LIST_ELEMENTS (er
->paths
, pnode
, pnnode
, path
))
6630 if (path
->oi
!= NULL
)
6632 if (path
->nexthop
.s_addr
== 0)
6633 vty_out (vty
, "%24s directly attached to %s%s",
6634 "", path
->oi
->ifp
->name
, VTY_NEWLINE
);
6636 vty_out (vty
, "%24s via %s, %s%s", "",
6637 inet_ntoa (path
->nexthop
), path
->oi
->ifp
->name
,
6642 vty_out (vty
, "%s", VTY_NEWLINE
);
6645 DEFUN (show_ip_ospf_border_routers
,
6646 show_ip_ospf_border_routers_cmd
,
6647 "show ip ospf border-routers",
6650 "show all the ABR's and ASBR's\n"
6655 ospf
= ospf_lookup ();
6658 vty_out (vty
, "OSPF is not enabled%s", VTY_NEWLINE
);
6662 if (ospf
->new_table
== NULL
)
6664 vty_out (vty
, "No OSPF routing information exist%s", VTY_NEWLINE
);
6668 /* Show Network routes.
6669 show_ip_ospf_route_network (vty, ospf->new_table); */
6671 /* Show Router routes. */
6672 show_ip_ospf_route_router (vty
, ospf
->new_rtrs
);
6677 DEFUN (show_ip_ospf_route
,
6678 show_ip_ospf_route_cmd
,
6679 "show ip ospf route",
6682 "OSPF information\n"
6683 "OSPF routing table\n")
6687 ospf
= ospf_lookup ();
6690 vty_out (vty
, "OSPF is not enabled%s", VTY_NEWLINE
);
6694 if (ospf
->new_table
== NULL
)
6696 vty_out (vty
, "No OSPF routing information exist%s", VTY_NEWLINE
);
6700 /* Show Network routes. */
6701 show_ip_ospf_route_network (vty
, ospf
->new_table
);
6703 /* Show Router routes. */
6704 show_ip_ospf_route_router (vty
, ospf
->new_rtrs
);
6706 /* Show AS External routes. */
6707 show_ip_ospf_route_external (vty
, ospf
->old_external_route
);
6713 const char *ospf_abr_type_str
[] =
6722 const char *ospf_shortcut_mode_str
[] =
6731 area_id2str (char *buf
, int length
, struct ospf_area
*area
)
6733 memset (buf
, 0, length
);
6735 if (area
->format
== OSPF_AREA_ID_FORMAT_ADDRESS
)
6736 strncpy (buf
, inet_ntoa (area
->area_id
), length
);
6738 sprintf (buf
, "%lu", (unsigned long) ntohl (area
->area_id
.s_addr
));
6742 const char *ospf_int_type_str
[] =
6744 "unknown", /* should never be used. */
6748 "point-to-multipoint",
6749 "virtual-link", /* should never be used. */
6753 /* Configuration write function for ospfd. */
6755 config_write_interface (struct vty
*vty
)
6757 struct listnode
*n1
, *n2
;
6758 struct interface
*ifp
;
6759 struct crypt_key
*ck
;
6761 struct route_node
*rn
= NULL
;
6762 struct ospf_if_params
*params
;
6764 for (ALL_LIST_ELEMENTS_RO (iflist
, n1
, ifp
))
6766 if (memcmp (ifp
->name
, "VLINK", 5) == 0)
6769 vty_out (vty
, "!%s", VTY_NEWLINE
);
6770 vty_out (vty
, "interface %s%s", ifp
->name
,
6773 vty_out (vty
, " description %s%s", ifp
->desc
,
6778 params
= IF_DEF_PARAMS (ifp
);
6781 /* Interface Network print. */
6782 if (OSPF_IF_PARAM_CONFIGURED (params
, type
) &&
6783 params
->type
!= OSPF_IFTYPE_LOOPBACK
)
6785 if (params
->type
!= ospf_default_iftype(ifp
))
6787 vty_out (vty
, " ip ospf network %s",
6788 ospf_int_type_str
[params
->type
]);
6789 if (params
!= IF_DEF_PARAMS (ifp
))
6790 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6791 vty_out (vty
, "%s", VTY_NEWLINE
);
6795 /* OSPF interface authentication print */
6796 if (OSPF_IF_PARAM_CONFIGURED (params
, auth_type
) &&
6797 params
->auth_type
!= OSPF_AUTH_NOTSET
)
6799 const char *auth_str
;
6801 /* Translation tables are not that much help here due to syntax
6802 of the simple option */
6803 switch (params
->auth_type
)
6806 case OSPF_AUTH_NULL
:
6810 case OSPF_AUTH_SIMPLE
:
6814 case OSPF_AUTH_CRYPTOGRAPHIC
:
6815 auth_str
= " message-digest";
6823 vty_out (vty
, " ip ospf authentication%s", auth_str
);
6824 if (params
!= IF_DEF_PARAMS (ifp
))
6825 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6826 vty_out (vty
, "%s", VTY_NEWLINE
);
6829 /* Simple Authentication Password print. */
6830 if (OSPF_IF_PARAM_CONFIGURED (params
, auth_simple
) &&
6831 params
->auth_simple
[0] != '\0')
6833 vty_out (vty
, " ip ospf authentication-key %s",
6834 params
->auth_simple
);
6835 if (params
!= IF_DEF_PARAMS (ifp
))
6836 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6837 vty_out (vty
, "%s", VTY_NEWLINE
);
6840 /* Cryptographic Authentication Key print. */
6841 for (ALL_LIST_ELEMENTS_RO (params
->auth_crypt
, n2
, ck
))
6843 vty_out (vty
, " ip ospf message-digest-key %d md5 %s",
6844 ck
->key_id
, ck
->auth_key
);
6845 if (params
!= IF_DEF_PARAMS (ifp
))
6846 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6847 vty_out (vty
, "%s", VTY_NEWLINE
);
6850 /* Interface Output Cost print. */
6851 if (OSPF_IF_PARAM_CONFIGURED (params
, output_cost_cmd
))
6853 vty_out (vty
, " ip ospf cost %u", params
->output_cost_cmd
);
6854 if (params
!= IF_DEF_PARAMS (ifp
))
6855 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6856 vty_out (vty
, "%s", VTY_NEWLINE
);
6859 /* Hello Interval print. */
6860 if (OSPF_IF_PARAM_CONFIGURED (params
, v_hello
) &&
6861 params
->v_hello
!= OSPF_HELLO_INTERVAL_DEFAULT
)
6863 vty_out (vty
, " ip ospf hello-interval %u", params
->v_hello
);
6864 if (params
!= IF_DEF_PARAMS (ifp
))
6865 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6866 vty_out (vty
, "%s", VTY_NEWLINE
);
6870 /* Router Dead Interval print. */
6871 if (OSPF_IF_PARAM_CONFIGURED (params
, v_wait
) &&
6872 params
->v_wait
!= OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
)
6874 vty_out (vty
, " ip ospf dead-interval %u", params
->v_wait
);
6875 if (params
!= IF_DEF_PARAMS (ifp
))
6876 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6877 vty_out (vty
, "%s", VTY_NEWLINE
);
6880 /* Router Priority print. */
6881 if (OSPF_IF_PARAM_CONFIGURED (params
, priority
) &&
6882 params
->priority
!= OSPF_ROUTER_PRIORITY_DEFAULT
)
6884 vty_out (vty
, " ip ospf priority %u", params
->priority
);
6885 if (params
!= IF_DEF_PARAMS (ifp
))
6886 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6887 vty_out (vty
, "%s", VTY_NEWLINE
);
6890 /* Retransmit Interval print. */
6891 if (OSPF_IF_PARAM_CONFIGURED (params
, retransmit_interval
) &&
6892 params
->retransmit_interval
!= OSPF_RETRANSMIT_INTERVAL_DEFAULT
)
6894 vty_out (vty
, " ip ospf retransmit-interval %u",
6895 params
->retransmit_interval
);
6896 if (params
!= IF_DEF_PARAMS (ifp
))
6897 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6898 vty_out (vty
, "%s", VTY_NEWLINE
);
6901 /* Transmit Delay print. */
6902 if (OSPF_IF_PARAM_CONFIGURED (params
, transmit_delay
) &&
6903 params
->transmit_delay
!= OSPF_TRANSMIT_DELAY_DEFAULT
)
6905 vty_out (vty
, " ip ospf transmit-delay %u", params
->transmit_delay
);
6906 if (params
!= IF_DEF_PARAMS (ifp
))
6907 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6908 vty_out (vty
, "%s", VTY_NEWLINE
);
6914 rn
= route_top (IF_OIFS_PARAMS (ifp
));
6916 rn
= route_next (rn
);
6926 #ifdef HAVE_OPAQUE_LSA
6927 ospf_opaque_config_write_if (vty
, ifp
);
6928 #endif /* HAVE_OPAQUE_LSA */
6935 config_write_network_area (struct vty
*vty
, struct ospf
*ospf
)
6937 struct route_node
*rn
;
6938 u_char buf
[INET_ADDRSTRLEN
];
6940 /* `network area' print. */
6941 for (rn
= route_top (ospf
->networks
); rn
; rn
= route_next (rn
))
6944 struct ospf_network
*n
= rn
->info
;
6946 memset (buf
, 0, INET_ADDRSTRLEN
);
6948 /* Create Area ID string by specified Area ID format. */
6949 if (n
->format
== OSPF_AREA_ID_FORMAT_ADDRESS
)
6950 strncpy ((char *) buf
, inet_ntoa (n
->area_id
), INET_ADDRSTRLEN
);
6952 sprintf ((char *) buf
, "%lu",
6953 (unsigned long int) ntohl (n
->area_id
.s_addr
));
6955 /* Network print. */
6956 vty_out (vty
, " network %s/%d area %s%s",
6957 inet_ntoa (rn
->p
.u
.prefix4
), rn
->p
.prefixlen
,
6965 config_write_ospf_area (struct vty
*vty
, struct ospf
*ospf
)
6967 struct listnode
*node
;
6968 struct ospf_area
*area
;
6969 u_char buf
[INET_ADDRSTRLEN
];
6971 /* Area configuration print. */
6972 for (ALL_LIST_ELEMENTS_RO (ospf
->areas
, node
, area
))
6974 struct route_node
*rn1
;
6976 area_id2str ((char *) buf
, INET_ADDRSTRLEN
, area
);
6978 if (area
->auth_type
!= OSPF_AUTH_NULL
)
6980 if (area
->auth_type
== OSPF_AUTH_SIMPLE
)
6981 vty_out (vty
, " area %s authentication%s", buf
, VTY_NEWLINE
);
6983 vty_out (vty
, " area %s authentication message-digest%s",
6987 if (area
->shortcut_configured
!= OSPF_SHORTCUT_DEFAULT
)
6988 vty_out (vty
, " area %s shortcut %s%s", buf
,
6989 ospf_shortcut_mode_str
[area
->shortcut_configured
],
6992 if ((area
->external_routing
== OSPF_AREA_STUB
)
6993 || (area
->external_routing
== OSPF_AREA_NSSA
)
6996 if (area
->external_routing
== OSPF_AREA_STUB
)
6997 vty_out (vty
, " area %s stub", buf
);
6998 else if (area
->external_routing
== OSPF_AREA_NSSA
)
7000 vty_out (vty
, " area %s nssa", buf
);
7001 switch (area
->NSSATranslatorRole
)
7003 case OSPF_NSSA_ROLE_NEVER
:
7004 vty_out (vty
, " translate-never");
7006 case OSPF_NSSA_ROLE_ALWAYS
:
7007 vty_out (vty
, " translate-always");
7009 case OSPF_NSSA_ROLE_CANDIDATE
:
7011 vty_out (vty
, " translate-candidate");
7015 if (area
->no_summary
)
7016 vty_out (vty
, " no-summary");
7018 vty_out (vty
, "%s", VTY_NEWLINE
);
7020 if (area
->default_cost
!= 1)
7021 vty_out (vty
, " area %s default-cost %d%s", buf
,
7022 area
->default_cost
, VTY_NEWLINE
);
7025 for (rn1
= route_top (area
->ranges
); rn1
; rn1
= route_next (rn1
))
7028 struct ospf_area_range
*range
= rn1
->info
;
7030 vty_out (vty
, " area %s range %s/%d", buf
,
7031 inet_ntoa (rn1
->p
.u
.prefix4
), rn1
->p
.prefixlen
);
7033 if (range
->cost_config
!= OSPF_AREA_RANGE_COST_UNSPEC
)
7034 vty_out (vty
, " cost %d", range
->cost_config
);
7036 if (!CHECK_FLAG (range
->flags
, OSPF_AREA_RANGE_ADVERTISE
))
7037 vty_out (vty
, " not-advertise");
7039 if (CHECK_FLAG (range
->flags
, OSPF_AREA_RANGE_SUBSTITUTE
))
7040 vty_out (vty
, " substitute %s/%d",
7041 inet_ntoa (range
->subst_addr
), range
->subst_masklen
);
7043 vty_out (vty
, "%s", VTY_NEWLINE
);
7046 if (EXPORT_NAME (area
))
7047 vty_out (vty
, " area %s export-list %s%s", buf
,
7048 EXPORT_NAME (area
), VTY_NEWLINE
);
7050 if (IMPORT_NAME (area
))
7051 vty_out (vty
, " area %s import-list %s%s", buf
,
7052 IMPORT_NAME (area
), VTY_NEWLINE
);
7054 if (PREFIX_NAME_IN (area
))
7055 vty_out (vty
, " area %s filter-list prefix %s in%s", buf
,
7056 PREFIX_NAME_IN (area
), VTY_NEWLINE
);
7058 if (PREFIX_NAME_OUT (area
))
7059 vty_out (vty
, " area %s filter-list prefix %s out%s", buf
,
7060 PREFIX_NAME_OUT (area
), VTY_NEWLINE
);
7067 config_write_ospf_nbr_nbma (struct vty
*vty
, struct ospf
*ospf
)
7069 struct ospf_nbr_nbma
*nbr_nbma
;
7070 struct route_node
*rn
;
7072 /* Static Neighbor configuration print. */
7073 for (rn
= route_top (ospf
->nbr_nbma
); rn
; rn
= route_next (rn
))
7074 if ((nbr_nbma
= rn
->info
))
7076 vty_out (vty
, " neighbor %s", inet_ntoa (nbr_nbma
->addr
));
7078 if (nbr_nbma
->priority
!= OSPF_NEIGHBOR_PRIORITY_DEFAULT
)
7079 vty_out (vty
, " priority %d", nbr_nbma
->priority
);
7081 if (nbr_nbma
->v_poll
!= OSPF_POLL_INTERVAL_DEFAULT
)
7082 vty_out (vty
, " poll-interval %d", nbr_nbma
->v_poll
);
7084 vty_out (vty
, "%s", VTY_NEWLINE
);
7091 config_write_virtual_link (struct vty
*vty
, struct ospf
*ospf
)
7093 struct listnode
*node
;
7094 struct ospf_vl_data
*vl_data
;
7095 u_char buf
[INET_ADDRSTRLEN
];
7097 /* Virtual-Link print */
7098 for (ALL_LIST_ELEMENTS_RO (ospf
->vlinks
, node
, vl_data
))
7100 struct listnode
*n2
;
7101 struct crypt_key
*ck
;
7102 struct ospf_interface
*oi
;
7104 if (vl_data
!= NULL
)
7106 memset (buf
, 0, INET_ADDRSTRLEN
);
7108 if (vl_data
->format
== OSPF_AREA_ID_FORMAT_ADDRESS
)
7109 strncpy ((char *) buf
, inet_ntoa (vl_data
->vl_area_id
), INET_ADDRSTRLEN
);
7111 sprintf ((char *) buf
, "%lu",
7112 (unsigned long int) ntohl (vl_data
->vl_area_id
.s_addr
));
7113 oi
= vl_data
->vl_oi
;
7116 if (OSPF_IF_PARAM (oi
, v_hello
) != OSPF_HELLO_INTERVAL_DEFAULT
||
7117 OSPF_IF_PARAM (oi
, v_wait
) != OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
||
7118 OSPF_IF_PARAM (oi
, retransmit_interval
) != OSPF_RETRANSMIT_INTERVAL_DEFAULT
||
7119 OSPF_IF_PARAM (oi
, transmit_delay
) != OSPF_TRANSMIT_DELAY_DEFAULT
)
7120 vty_out (vty
, " area %s virtual-link %s hello-interval %d retransmit-interval %d transmit-delay %d dead-interval %d%s",
7122 inet_ntoa (vl_data
->vl_peer
),
7123 OSPF_IF_PARAM (oi
, v_hello
),
7124 OSPF_IF_PARAM (oi
, retransmit_interval
),
7125 OSPF_IF_PARAM (oi
, transmit_delay
),
7126 OSPF_IF_PARAM (oi
, v_wait
),
7129 vty_out (vty
, " area %s virtual-link %s%s", buf
,
7130 inet_ntoa (vl_data
->vl_peer
), VTY_NEWLINE
);
7132 if (IF_DEF_PARAMS (vl_data
->vl_oi
->ifp
)->auth_simple
[0] != '\0')
7133 vty_out (vty
, " area %s virtual-link %s authentication-key %s%s",
7135 inet_ntoa (vl_data
->vl_peer
),
7136 IF_DEF_PARAMS (vl_data
->vl_oi
->ifp
)->auth_simple
,
7139 for (ALL_LIST_ELEMENTS_RO (IF_DEF_PARAMS (vl_data
->vl_oi
->ifp
)->auth_crypt
,
7141 vty_out (vty
, " area %s virtual-link %s"
7142 " message-digest-key %d md5 %s%s",
7144 inet_ntoa (vl_data
->vl_peer
),
7145 ck
->key_id
, ck
->auth_key
, VTY_NEWLINE
);
7154 const char *distribute_str
[] = { "system", "kernel", "connected", "static",
7155 "rip", "ripng", "ospf", "ospf6", "isis", "bgp"};
7157 config_write_ospf_redistribute (struct vty
*vty
, struct ospf
*ospf
)
7161 /* redistribute print. */
7162 for (type
= 0; type
< ZEBRA_ROUTE_MAX
; type
++)
7163 if (type
!= zclient
->redist_default
&& zclient
->redist
[type
])
7165 vty_out (vty
, " redistribute %s", distribute_str
[type
]);
7166 if (ospf
->dmetric
[type
].value
>= 0)
7167 vty_out (vty
, " metric %d", ospf
->dmetric
[type
].value
);
7169 if (ospf
->dmetric
[type
].type
== EXTERNAL_METRIC_TYPE_1
)
7170 vty_out (vty
, " metric-type 1");
7172 if (ROUTEMAP_NAME (ospf
, type
))
7173 vty_out (vty
, " route-map %s", ROUTEMAP_NAME (ospf
, type
));
7175 vty_out (vty
, "%s", VTY_NEWLINE
);
7182 config_write_ospf_default_metric (struct vty
*vty
, struct ospf
*ospf
)
7184 if (ospf
->default_metric
!= -1)
7185 vty_out (vty
, " default-metric %d%s", ospf
->default_metric
,
7191 config_write_ospf_distribute (struct vty
*vty
, struct ospf
*ospf
)
7197 /* distribute-list print. */
7198 for (type
= 0; type
< ZEBRA_ROUTE_MAX
; type
++)
7199 if (ospf
->dlist
[type
].name
)
7200 vty_out (vty
, " distribute-list %s out %s%s",
7201 ospf
->dlist
[type
].name
,
7202 distribute_str
[type
], VTY_NEWLINE
);
7204 /* default-information print. */
7205 if (ospf
->default_originate
!= DEFAULT_ORIGINATE_NONE
)
7207 if (ospf
->default_originate
== DEFAULT_ORIGINATE_ZEBRA
)
7208 vty_out (vty
, " default-information originate");
7210 vty_out (vty
, " default-information originate always");
7212 if (ospf
->dmetric
[DEFAULT_ROUTE
].value
>= 0)
7213 vty_out (vty
, " metric %d",
7214 ospf
->dmetric
[DEFAULT_ROUTE
].value
);
7215 if (ospf
->dmetric
[DEFAULT_ROUTE
].type
== EXTERNAL_METRIC_TYPE_1
)
7216 vty_out (vty
, " metric-type 1");
7218 if (ROUTEMAP_NAME (ospf
, DEFAULT_ROUTE
))
7219 vty_out (vty
, " route-map %s",
7220 ROUTEMAP_NAME (ospf
, DEFAULT_ROUTE
));
7222 vty_out (vty
, "%s", VTY_NEWLINE
);
7231 config_write_ospf_distance (struct vty
*vty
, struct ospf
*ospf
)
7233 struct route_node
*rn
;
7234 struct ospf_distance
*odistance
;
7236 if (ospf
->distance_all
)
7237 vty_out (vty
, " distance %d%s", ospf
->distance_all
, VTY_NEWLINE
);
7239 if (ospf
->distance_intra
7240 || ospf
->distance_inter
7241 || ospf
->distance_external
)
7243 vty_out (vty
, " distance ospf");
7245 if (ospf
->distance_intra
)
7246 vty_out (vty
, " intra-area %d", ospf
->distance_intra
);
7247 if (ospf
->distance_inter
)
7248 vty_out (vty
, " inter-area %d", ospf
->distance_inter
);
7249 if (ospf
->distance_external
)
7250 vty_out (vty
, " external %d", ospf
->distance_external
);
7252 vty_out (vty
, "%s", VTY_NEWLINE
);
7255 for (rn
= route_top (ospf
->distance_table
); rn
; rn
= route_next (rn
))
7256 if ((odistance
= rn
->info
) != NULL
)
7258 vty_out (vty
, " distance %d %s/%d %s%s", odistance
->distance
,
7259 inet_ntoa (rn
->p
.u
.prefix4
), rn
->p
.prefixlen
,
7260 odistance
->access_list
? odistance
->access_list
: "",
7266 /* OSPF configuration write function. */
7268 ospf_config_write (struct vty
*vty
)
7271 struct interface
*ifp
;
7272 struct ospf_interface
*oi
;
7273 struct listnode
*node
;
7276 ospf
= ospf_lookup ();
7279 /* `router ospf' print. */
7280 vty_out (vty
, "router ospf%s", VTY_NEWLINE
);
7284 if (!ospf
->networks
)
7287 /* Router ID print. */
7288 if (ospf
->router_id_static
.s_addr
!= 0)
7289 vty_out (vty
, " ospf router-id %s%s",
7290 inet_ntoa (ospf
->router_id_static
), VTY_NEWLINE
);
7292 /* ABR type print. */
7293 if (ospf
->abr_type
!= OSPF_ABR_STAND
)
7294 vty_out (vty
, " ospf abr-type %s%s",
7295 ospf_abr_type_str
[ospf
->abr_type
], VTY_NEWLINE
);
7297 /* RFC1583 compatibility flag print -- Compatible with CISCO 12.1. */
7298 if (CHECK_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
))
7299 vty_out (vty
, " compatible rfc1583%s", VTY_NEWLINE
);
7301 /* auto-cost reference-bandwidth configuration. */
7302 if (ospf
->ref_bandwidth
!= OSPF_DEFAULT_REF_BANDWIDTH
)
7303 vty_out (vty
, " auto-cost reference-bandwidth %d%s",
7304 ospf
->ref_bandwidth
/ 1000, VTY_NEWLINE
);
7306 /* SPF timers print. */
7307 if (ospf
->spf_delay
!= OSPF_SPF_DELAY_DEFAULT
||
7308 ospf
->spf_holdtime
!= OSPF_SPF_HOLDTIME_DEFAULT
)
7309 vty_out (vty
, " timers spf %d %d%s",
7310 ospf
->spf_delay
, ospf
->spf_holdtime
, VTY_NEWLINE
);
7312 /* SPF refresh parameters print. */
7313 if (ospf
->lsa_refresh_interval
!= OSPF_LSA_REFRESH_INTERVAL_DEFAULT
)
7314 vty_out (vty
, " refresh timer %d%s",
7315 ospf
->lsa_refresh_interval
, VTY_NEWLINE
);
7317 /* Redistribute information print. */
7318 config_write_ospf_redistribute (vty
, ospf
);
7320 /* passive-interface print. */
7321 for (ALL_LIST_ELEMENTS_RO (om
->iflist
, node
, ifp
))
7322 if (IF_DEF_PARAMS (ifp
)->passive_interface
== OSPF_IF_PASSIVE
)
7323 vty_out (vty
, " passive-interface %s%s",
7324 ifp
->name
, VTY_NEWLINE
);
7326 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
7327 if (OSPF_IF_PARAM_CONFIGURED (oi
->params
, passive_interface
) &&
7328 oi
->params
->passive_interface
== OSPF_IF_PASSIVE
)
7329 vty_out (vty
, " passive-interface %s %s%s",
7331 inet_ntoa (oi
->address
->u
.prefix4
), VTY_NEWLINE
);
7333 /* Network area print. */
7334 config_write_network_area (vty
, ospf
);
7336 /* Area config print. */
7337 config_write_ospf_area (vty
, ospf
);
7339 /* static neighbor print. */
7340 config_write_ospf_nbr_nbma (vty
, ospf
);
7342 /* Virtual-Link print. */
7343 config_write_virtual_link (vty
, ospf
);
7345 /* Default metric configuration. */
7346 config_write_ospf_default_metric (vty
, ospf
);
7348 /* Distribute-list and default-information print. */
7349 config_write_ospf_distribute (vty
, ospf
);
7351 /* Distance configuration. */
7352 config_write_ospf_distance (vty
, ospf
);
7354 #ifdef HAVE_OPAQUE_LSA
7355 ospf_opaque_config_write_router (vty
, ospf
);
7356 #endif /* HAVE_OPAQUE_LSA */
7363 ospf_vty_show_init (void)
7365 /* "show ip ospf" commands. */
7366 install_element (VIEW_NODE
, &show_ip_ospf_cmd
);
7367 install_element (ENABLE_NODE
, &show_ip_ospf_cmd
);
7369 /* "show ip ospf database" commands. */
7370 install_element (VIEW_NODE
, &show_ip_ospf_database_type_cmd
);
7371 install_element (VIEW_NODE
, &show_ip_ospf_database_type_id_cmd
);
7372 install_element (VIEW_NODE
, &show_ip_ospf_database_type_id_adv_router_cmd
);
7373 install_element (VIEW_NODE
, &show_ip_ospf_database_type_adv_router_cmd
);
7374 install_element (VIEW_NODE
, &show_ip_ospf_database_type_id_self_cmd
);
7375 install_element (VIEW_NODE
, &show_ip_ospf_database_type_self_cmd
);
7376 install_element (VIEW_NODE
, &show_ip_ospf_database_cmd
);
7377 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_cmd
);
7378 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_id_cmd
);
7379 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_id_adv_router_cmd
);
7380 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_adv_router_cmd
);
7381 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_id_self_cmd
);
7382 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_self_cmd
);
7383 install_element (ENABLE_NODE
, &show_ip_ospf_database_cmd
);
7385 /* "show ip ospf interface" commands. */
7386 install_element (VIEW_NODE
, &show_ip_ospf_interface_cmd
);
7387 install_element (ENABLE_NODE
, &show_ip_ospf_interface_cmd
);
7389 /* "show ip ospf neighbor" commands. */
7390 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_int_detail_cmd
);
7391 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_int_cmd
);
7392 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_id_cmd
);
7393 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_detail_all_cmd
);
7394 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_detail_cmd
);
7395 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_cmd
);
7396 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_all_cmd
);
7397 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_int_detail_cmd
);
7398 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_int_cmd
);
7399 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_id_cmd
);
7400 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_detail_all_cmd
);
7401 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_detail_cmd
);
7402 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_cmd
);
7403 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_all_cmd
);
7405 /* "show ip ospf route" commands. */
7406 install_element (VIEW_NODE
, &show_ip_ospf_route_cmd
);
7407 install_element (ENABLE_NODE
, &show_ip_ospf_route_cmd
);
7408 install_element (VIEW_NODE
, &show_ip_ospf_border_routers_cmd
);
7409 install_element (ENABLE_NODE
, &show_ip_ospf_border_routers_cmd
);
7413 /* ospfd's interface node. */
7414 struct cmd_node interface_node
=
7421 /* Initialization of OSPF interface. */
7423 ospf_vty_if_init (void)
7425 /* Install interface node. */
7426 install_node (&interface_node
, config_write_interface
);
7428 install_element (CONFIG_NODE
, &interface_cmd
);
7429 install_element (CONFIG_NODE
, &no_interface_cmd
);
7430 install_default (INTERFACE_NODE
);
7432 /* "description" commands. */
7433 install_element (INTERFACE_NODE
, &interface_desc_cmd
);
7434 install_element (INTERFACE_NODE
, &no_interface_desc_cmd
);
7436 /* "ip ospf authentication" commands. */
7437 install_element (INTERFACE_NODE
, &ip_ospf_authentication_args_addr_cmd
);
7438 install_element (INTERFACE_NODE
, &ip_ospf_authentication_args_cmd
);
7439 install_element (INTERFACE_NODE
, &ip_ospf_authentication_addr_cmd
);
7440 install_element (INTERFACE_NODE
, &ip_ospf_authentication_cmd
);
7441 install_element (INTERFACE_NODE
, &no_ip_ospf_authentication_addr_cmd
);
7442 install_element (INTERFACE_NODE
, &no_ip_ospf_authentication_cmd
);
7443 install_element (INTERFACE_NODE
, &ip_ospf_authentication_key_addr_cmd
);
7444 install_element (INTERFACE_NODE
, &ip_ospf_authentication_key_cmd
);
7445 install_element (INTERFACE_NODE
, &no_ip_ospf_authentication_key_addr_cmd
);
7446 install_element (INTERFACE_NODE
, &no_ip_ospf_authentication_key_cmd
);
7448 /* "ip ospf message-digest-key" commands. */
7449 install_element (INTERFACE_NODE
, &ip_ospf_message_digest_key_addr_cmd
);
7450 install_element (INTERFACE_NODE
, &ip_ospf_message_digest_key_cmd
);
7451 install_element (INTERFACE_NODE
, &no_ip_ospf_message_digest_key_addr_cmd
);
7452 install_element (INTERFACE_NODE
, &no_ip_ospf_message_digest_key_cmd
);
7454 /* "ip ospf cost" commands. */
7455 install_element (INTERFACE_NODE
, &ip_ospf_cost_addr_cmd
);
7456 install_element (INTERFACE_NODE
, &ip_ospf_cost_cmd
);
7457 install_element (INTERFACE_NODE
, &no_ip_ospf_cost_addr_cmd
);
7458 install_element (INTERFACE_NODE
, &no_ip_ospf_cost_cmd
);
7460 /* "ip ospf dead-interval" commands. */
7461 install_element (INTERFACE_NODE
, &ip_ospf_dead_interval_addr_cmd
);
7462 install_element (INTERFACE_NODE
, &ip_ospf_dead_interval_cmd
);
7463 install_element (INTERFACE_NODE
, &no_ip_ospf_dead_interval_addr_cmd
);
7464 install_element (INTERFACE_NODE
, &no_ip_ospf_dead_interval_cmd
);
7466 /* "ip ospf hello-interval" commands. */
7467 install_element (INTERFACE_NODE
, &ip_ospf_hello_interval_addr_cmd
);
7468 install_element (INTERFACE_NODE
, &ip_ospf_hello_interval_cmd
);
7469 install_element (INTERFACE_NODE
, &no_ip_ospf_hello_interval_addr_cmd
);
7470 install_element (INTERFACE_NODE
, &no_ip_ospf_hello_interval_cmd
);
7472 /* "ip ospf network" commands. */
7473 install_element (INTERFACE_NODE
, &ip_ospf_network_cmd
);
7474 install_element (INTERFACE_NODE
, &no_ip_ospf_network_cmd
);
7476 /* "ip ospf priority" commands. */
7477 install_element (INTERFACE_NODE
, &ip_ospf_priority_addr_cmd
);
7478 install_element (INTERFACE_NODE
, &ip_ospf_priority_cmd
);
7479 install_element (INTERFACE_NODE
, &no_ip_ospf_priority_addr_cmd
);
7480 install_element (INTERFACE_NODE
, &no_ip_ospf_priority_cmd
);
7482 /* "ip ospf retransmit-interval" commands. */
7483 install_element (INTERFACE_NODE
, &ip_ospf_retransmit_interval_addr_cmd
);
7484 install_element (INTERFACE_NODE
, &ip_ospf_retransmit_interval_cmd
);
7485 install_element (INTERFACE_NODE
, &no_ip_ospf_retransmit_interval_addr_cmd
);
7486 install_element (INTERFACE_NODE
, &no_ip_ospf_retransmit_interval_cmd
);
7488 /* "ip ospf transmit-delay" commands. */
7489 install_element (INTERFACE_NODE
, &ip_ospf_transmit_delay_addr_cmd
);
7490 install_element (INTERFACE_NODE
, &ip_ospf_transmit_delay_cmd
);
7491 install_element (INTERFACE_NODE
, &no_ip_ospf_transmit_delay_addr_cmd
);
7492 install_element (INTERFACE_NODE
, &no_ip_ospf_transmit_delay_cmd
);
7494 /* These commands are compatibitliy for previous version. */
7495 install_element (INTERFACE_NODE
, &ospf_authentication_key_cmd
);
7496 install_element (INTERFACE_NODE
, &no_ospf_authentication_key_cmd
);
7497 install_element (INTERFACE_NODE
, &ospf_message_digest_key_cmd
);
7498 install_element (INTERFACE_NODE
, &no_ospf_message_digest_key_cmd
);
7499 install_element (INTERFACE_NODE
, &ospf_cost_cmd
);
7500 install_element (INTERFACE_NODE
, &no_ospf_cost_cmd
);
7501 install_element (INTERFACE_NODE
, &ospf_dead_interval_cmd
);
7502 install_element (INTERFACE_NODE
, &no_ospf_dead_interval_cmd
);
7503 install_element (INTERFACE_NODE
, &ospf_hello_interval_cmd
);
7504 install_element (INTERFACE_NODE
, &no_ospf_hello_interval_cmd
);
7505 install_element (INTERFACE_NODE
, &ospf_network_cmd
);
7506 install_element (INTERFACE_NODE
, &no_ospf_network_cmd
);
7507 install_element (INTERFACE_NODE
, &ospf_priority_cmd
);
7508 install_element (INTERFACE_NODE
, &no_ospf_priority_cmd
);
7509 install_element (INTERFACE_NODE
, &ospf_retransmit_interval_cmd
);
7510 install_element (INTERFACE_NODE
, &no_ospf_retransmit_interval_cmd
);
7511 install_element (INTERFACE_NODE
, &ospf_transmit_delay_cmd
);
7512 install_element (INTERFACE_NODE
, &no_ospf_transmit_delay_cmd
);
7515 /* Zebra node structure. */
7516 struct cmd_node zebra_node
=
7519 "%s(config-router)#",
7523 ospf_vty_zebra_init (void)
7525 install_element (OSPF_NODE
, &ospf_redistribute_source_type_metric_cmd
);
7526 install_element (OSPF_NODE
, &ospf_redistribute_source_metric_type_cmd
);
7527 install_element (OSPF_NODE
, &ospf_redistribute_source_type_cmd
);
7528 install_element (OSPF_NODE
, &ospf_redistribute_source_metric_cmd
);
7529 install_element (OSPF_NODE
, &ospf_redistribute_source_cmd
);
7530 install_element (OSPF_NODE
,
7531 &ospf_redistribute_source_metric_type_routemap_cmd
);
7532 install_element (OSPF_NODE
,
7533 &ospf_redistribute_source_type_metric_routemap_cmd
);
7534 install_element (OSPF_NODE
, &ospf_redistribute_source_metric_routemap_cmd
);
7535 install_element (OSPF_NODE
, &ospf_redistribute_source_type_routemap_cmd
);
7536 install_element (OSPF_NODE
, &ospf_redistribute_source_routemap_cmd
);
7538 install_element (OSPF_NODE
, &no_ospf_redistribute_source_cmd
);
7540 install_element (OSPF_NODE
, &ospf_distribute_list_out_cmd
);
7541 install_element (OSPF_NODE
, &no_ospf_distribute_list_out_cmd
);
7543 install_element (OSPF_NODE
,
7544 &ospf_default_information_originate_metric_type_cmd
);
7545 install_element (OSPF_NODE
, &ospf_default_information_originate_metric_cmd
);
7546 install_element (OSPF_NODE
,
7547 &ospf_default_information_originate_type_metric_cmd
);
7548 install_element (OSPF_NODE
, &ospf_default_information_originate_type_cmd
);
7549 install_element (OSPF_NODE
, &ospf_default_information_originate_cmd
);
7550 install_element (OSPF_NODE
,
7551 &ospf_default_information_originate_always_metric_type_cmd
);
7552 install_element (OSPF_NODE
,
7553 &ospf_default_information_originate_always_metric_cmd
);
7554 install_element (OSPF_NODE
,
7555 &ospf_default_information_originate_always_cmd
);
7556 install_element (OSPF_NODE
,
7557 &ospf_default_information_originate_always_type_metric_cmd
);
7558 install_element (OSPF_NODE
,
7559 &ospf_default_information_originate_always_type_cmd
);
7561 install_element (OSPF_NODE
,
7562 &ospf_default_information_originate_metric_type_routemap_cmd
);
7563 install_element (OSPF_NODE
,
7564 &ospf_default_information_originate_metric_routemap_cmd
);
7565 install_element (OSPF_NODE
,
7566 &ospf_default_information_originate_routemap_cmd
);
7567 install_element (OSPF_NODE
,
7568 &ospf_default_information_originate_type_metric_routemap_cmd
);
7569 install_element (OSPF_NODE
,
7570 &ospf_default_information_originate_type_routemap_cmd
);
7571 install_element (OSPF_NODE
,
7572 &ospf_default_information_originate_always_metric_type_routemap_cmd
);
7573 install_element (OSPF_NODE
,
7574 &ospf_default_information_originate_always_metric_routemap_cmd
);
7575 install_element (OSPF_NODE
,
7576 &ospf_default_information_originate_always_routemap_cmd
);
7577 install_element (OSPF_NODE
,
7578 &ospf_default_information_originate_always_type_metric_routemap_cmd
);
7579 install_element (OSPF_NODE
,
7580 &ospf_default_information_originate_always_type_routemap_cmd
);
7582 install_element (OSPF_NODE
, &no_ospf_default_information_originate_cmd
);
7584 install_element (OSPF_NODE
, &ospf_default_metric_cmd
);
7585 install_element (OSPF_NODE
, &no_ospf_default_metric_cmd
);
7586 install_element (OSPF_NODE
, &no_ospf_default_metric_val_cmd
);
7588 install_element (OSPF_NODE
, &ospf_distance_cmd
);
7589 install_element (OSPF_NODE
, &no_ospf_distance_cmd
);
7590 install_element (OSPF_NODE
, &no_ospf_distance_ospf_cmd
);
7591 install_element (OSPF_NODE
, &ospf_distance_ospf_intra_cmd
);
7592 install_element (OSPF_NODE
, &ospf_distance_ospf_intra_inter_cmd
);
7593 install_element (OSPF_NODE
, &ospf_distance_ospf_intra_external_cmd
);
7594 install_element (OSPF_NODE
, &ospf_distance_ospf_intra_inter_external_cmd
);
7595 install_element (OSPF_NODE
, &ospf_distance_ospf_intra_external_inter_cmd
);
7596 install_element (OSPF_NODE
, &ospf_distance_ospf_inter_cmd
);
7597 install_element (OSPF_NODE
, &ospf_distance_ospf_inter_intra_cmd
);
7598 install_element (OSPF_NODE
, &ospf_distance_ospf_inter_external_cmd
);
7599 install_element (OSPF_NODE
, &ospf_distance_ospf_inter_intra_external_cmd
);
7600 install_element (OSPF_NODE
, &ospf_distance_ospf_inter_external_intra_cmd
);
7601 install_element (OSPF_NODE
, &ospf_distance_ospf_external_cmd
);
7602 install_element (OSPF_NODE
, &ospf_distance_ospf_external_intra_cmd
);
7603 install_element (OSPF_NODE
, &ospf_distance_ospf_external_inter_cmd
);
7604 install_element (OSPF_NODE
, &ospf_distance_ospf_external_intra_inter_cmd
);
7605 install_element (OSPF_NODE
, &ospf_distance_ospf_external_inter_intra_cmd
);
7607 install_element (OSPF_NODE
, &ospf_distance_source_cmd
);
7608 install_element (OSPF_NODE
, &no_ospf_distance_source_cmd
);
7609 install_element (OSPF_NODE
, &ospf_distance_source_access_list_cmd
);
7610 install_element (OSPF_NODE
, &no_ospf_distance_source_access_list_cmd
);
7614 struct cmd_node ospf_node
=
7617 "%s(config-router)# ",
7622 /* Install OSPF related vty commands. */
7624 ospf_vty_init (void)
7626 /* Install ospf top node. */
7627 install_node (&ospf_node
, ospf_config_write
);
7629 /* "router ospf" commands. */
7630 install_element (CONFIG_NODE
, &router_ospf_cmd
);
7631 install_element (CONFIG_NODE
, &no_router_ospf_cmd
);
7633 install_default (OSPF_NODE
);
7635 /* "ospf router-id" commands. */
7636 install_element (OSPF_NODE
, &ospf_router_id_cmd
);
7637 install_element (OSPF_NODE
, &no_ospf_router_id_cmd
);
7638 install_element (OSPF_NODE
, &router_ospf_id_cmd
);
7639 install_element (OSPF_NODE
, &no_router_ospf_id_cmd
);
7641 /* "passive-interface" commands. */
7642 install_element (OSPF_NODE
, &ospf_passive_interface_addr_cmd
);
7643 install_element (OSPF_NODE
, &ospf_passive_interface_cmd
);
7644 install_element (OSPF_NODE
, &no_ospf_passive_interface_addr_cmd
);
7645 install_element (OSPF_NODE
, &no_ospf_passive_interface_cmd
);
7647 /* "ospf abr-type" commands. */
7648 install_element (OSPF_NODE
, &ospf_abr_type_cmd
);
7649 install_element (OSPF_NODE
, &no_ospf_abr_type_cmd
);
7651 /* "ospf rfc1583-compatible" commands. */
7652 install_element (OSPF_NODE
, &ospf_rfc1583_flag_cmd
);
7653 install_element (OSPF_NODE
, &no_ospf_rfc1583_flag_cmd
);
7654 install_element (OSPF_NODE
, &ospf_compatible_rfc1583_cmd
);
7655 install_element (OSPF_NODE
, &no_ospf_compatible_rfc1583_cmd
);
7657 /* "network area" commands. */
7658 install_element (OSPF_NODE
, &ospf_network_area_cmd
);
7659 install_element (OSPF_NODE
, &no_ospf_network_area_cmd
);
7661 /* "area authentication" commands. */
7662 install_element (OSPF_NODE
, &ospf_area_authentication_message_digest_cmd
);
7663 install_element (OSPF_NODE
, &ospf_area_authentication_cmd
);
7664 install_element (OSPF_NODE
, &no_ospf_area_authentication_cmd
);
7666 /* "area range" commands. */
7667 install_element (OSPF_NODE
, &ospf_area_range_cmd
);
7668 install_element (OSPF_NODE
, &ospf_area_range_advertise_cmd
);
7669 install_element (OSPF_NODE
, &ospf_area_range_cost_cmd
);
7670 install_element (OSPF_NODE
, &ospf_area_range_advertise_cost_cmd
);
7671 install_element (OSPF_NODE
, &ospf_area_range_not_advertise_cmd
);
7672 install_element (OSPF_NODE
, &no_ospf_area_range_cmd
);
7673 install_element (OSPF_NODE
, &no_ospf_area_range_advertise_cmd
);
7674 install_element (OSPF_NODE
, &no_ospf_area_range_cost_cmd
);
7675 install_element (OSPF_NODE
, &no_ospf_area_range_advertise_cost_cmd
);
7676 install_element (OSPF_NODE
, &ospf_area_range_substitute_cmd
);
7677 install_element (OSPF_NODE
, &no_ospf_area_range_substitute_cmd
);
7679 /* "area virtual-link" commands. */
7680 install_element (OSPF_NODE
, &ospf_area_vlink_cmd
);
7681 install_element (OSPF_NODE
, &no_ospf_area_vlink_cmd
);
7683 install_element (OSPF_NODE
, &ospf_area_vlink_param1_cmd
);
7684 install_element (OSPF_NODE
, &no_ospf_area_vlink_param1_cmd
);
7686 install_element (OSPF_NODE
, &ospf_area_vlink_param2_cmd
);
7687 install_element (OSPF_NODE
, &no_ospf_area_vlink_param2_cmd
);
7689 install_element (OSPF_NODE
, &ospf_area_vlink_param3_cmd
);
7690 install_element (OSPF_NODE
, &no_ospf_area_vlink_param3_cmd
);
7692 install_element (OSPF_NODE
, &ospf_area_vlink_param4_cmd
);
7693 install_element (OSPF_NODE
, &no_ospf_area_vlink_param4_cmd
);
7695 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_args_cmd
);
7696 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_cmd
);
7697 install_element (OSPF_NODE
, &no_ospf_area_vlink_authtype_cmd
);
7699 install_element (OSPF_NODE
, &ospf_area_vlink_md5_cmd
);
7700 install_element (OSPF_NODE
, &no_ospf_area_vlink_md5_cmd
);
7702 install_element (OSPF_NODE
, &ospf_area_vlink_authkey_cmd
);
7703 install_element (OSPF_NODE
, &no_ospf_area_vlink_authkey_cmd
);
7705 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_args_authkey_cmd
);
7706 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_authkey_cmd
);
7707 install_element (OSPF_NODE
, &no_ospf_area_vlink_authtype_authkey_cmd
);
7709 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_args_md5_cmd
);
7710 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_md5_cmd
);
7711 install_element (OSPF_NODE
, &no_ospf_area_vlink_authtype_md5_cmd
);
7713 /* "area stub" commands. */
7714 install_element (OSPF_NODE
, &ospf_area_stub_no_summary_cmd
);
7715 install_element (OSPF_NODE
, &ospf_area_stub_cmd
);
7716 install_element (OSPF_NODE
, &no_ospf_area_stub_no_summary_cmd
);
7717 install_element (OSPF_NODE
, &no_ospf_area_stub_cmd
);
7719 /* "area nssa" commands. */
7720 install_element (OSPF_NODE
, &ospf_area_nssa_cmd
);
7721 install_element (OSPF_NODE
, &ospf_area_nssa_translate_no_summary_cmd
);
7722 install_element (OSPF_NODE
, &ospf_area_nssa_translate_cmd
);
7723 install_element (OSPF_NODE
, &ospf_area_nssa_no_summary_cmd
);
7724 install_element (OSPF_NODE
, &no_ospf_area_nssa_cmd
);
7725 install_element (OSPF_NODE
, &no_ospf_area_nssa_no_summary_cmd
);
7727 install_element (OSPF_NODE
, &ospf_area_default_cost_cmd
);
7728 install_element (OSPF_NODE
, &no_ospf_area_default_cost_cmd
);
7730 install_element (OSPF_NODE
, &ospf_area_shortcut_cmd
);
7731 install_element (OSPF_NODE
, &no_ospf_area_shortcut_cmd
);
7733 install_element (OSPF_NODE
, &ospf_area_export_list_cmd
);
7734 install_element (OSPF_NODE
, &no_ospf_area_export_list_cmd
);
7736 install_element (OSPF_NODE
, &ospf_area_filter_list_cmd
);
7737 install_element (OSPF_NODE
, &no_ospf_area_filter_list_cmd
);
7739 install_element (OSPF_NODE
, &ospf_area_import_list_cmd
);
7740 install_element (OSPF_NODE
, &no_ospf_area_import_list_cmd
);
7742 install_element (OSPF_NODE
, &ospf_timers_spf_cmd
);
7743 install_element (OSPF_NODE
, &no_ospf_timers_spf_cmd
);
7745 install_element (OSPF_NODE
, &ospf_refresh_timer_cmd
);
7746 install_element (OSPF_NODE
, &no_ospf_refresh_timer_val_cmd
);
7747 install_element (OSPF_NODE
, &no_ospf_refresh_timer_cmd
);
7749 install_element (OSPF_NODE
, &ospf_auto_cost_reference_bandwidth_cmd
);
7750 install_element (OSPF_NODE
, &no_ospf_auto_cost_reference_bandwidth_cmd
);
7752 /* "neighbor" commands. */
7753 install_element (OSPF_NODE
, &ospf_neighbor_cmd
);
7754 install_element (OSPF_NODE
, &ospf_neighbor_priority_poll_interval_cmd
);
7755 install_element (OSPF_NODE
, &ospf_neighbor_priority_cmd
);
7756 install_element (OSPF_NODE
, &ospf_neighbor_poll_interval_cmd
);
7757 install_element (OSPF_NODE
, &ospf_neighbor_poll_interval_priority_cmd
);
7758 install_element (OSPF_NODE
, &no_ospf_neighbor_cmd
);
7759 install_element (OSPF_NODE
, &no_ospf_neighbor_priority_cmd
);
7760 install_element (OSPF_NODE
, &no_ospf_neighbor_poll_interval_cmd
);
7762 /* Init interface related vty commands. */
7763 ospf_vty_if_init ();
7765 /* Init zebra related vty commands. */
7766 ospf_vty_zebra_init ();