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_UINT32 ("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 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
);
800 ospf_vl_set_timers (struct ospf_vl_data
*vl_data
,
801 struct ospf_vl_config_data
*vl_config
)
803 struct interface
*ifp
= ifp
= vl_data
->vl_oi
->ifp
;
804 /* Virtual Link data initialised to defaults, so only set
806 if (vl_config
->hello_interval
)
808 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), v_hello
);
809 IF_DEF_PARAMS (ifp
)->v_hello
= vl_config
->hello_interval
;
812 if (vl_config
->dead_interval
)
814 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), v_wait
);
815 IF_DEF_PARAMS (ifp
)->v_wait
= vl_config
->dead_interval
;
818 if (vl_config
->retransmit_interval
)
820 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), retransmit_interval
);
821 IF_DEF_PARAMS (ifp
)->retransmit_interval
= vl_config
->retransmit_interval
;
824 if (vl_config
->transmit_delay
)
826 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), transmit_delay
);
827 IF_DEF_PARAMS (ifp
)->transmit_delay
= vl_config
->transmit_delay
;
835 /* The business end of all of the above */
837 ospf_vl_set (struct ospf
*ospf
, struct ospf_vl_config_data
*vl_config
)
839 struct ospf_vl_data
*vl_data
;
842 vl_data
= ospf_find_vl_data (ospf
, vl_config
);
846 /* Process this one first as it can have a fatal result, which can
847 only logically occur if the virtual link exists already
848 Thus a command error does not result in a change to the
849 running configuration such as unexpectedly altered timer
851 ret
= ospf_vl_set_security (vl_data
, vl_config
);
852 if (ret
!= CMD_SUCCESS
)
855 /* Set any time based parameters, these area already range checked */
857 ret
= ospf_vl_set_timers (vl_data
, vl_config
);
858 if (ret
!= CMD_SUCCESS
)
865 /* This stuff exists to make specifying all the alias commands A LOT simpler
867 #define VLINK_HELPSTR_IPADDR \
868 "OSPF area parameters\n" \
869 "OSPF area ID in IP address format\n" \
870 "OSPF area ID as a decimal value\n" \
871 "Configure a virtual link\n" \
872 "Router ID of the remote ABR\n"
874 #define VLINK_HELPSTR_AUTHTYPE_SIMPLE \
875 "Enable authentication on this virtual link\n" \
878 #define VLINK_HELPSTR_AUTHTYPE_ALL \
879 VLINK_HELPSTR_AUTHTYPE_SIMPLE \
880 "Use null authentication\n" \
881 "Use message-digest authentication\n"
883 #define VLINK_HELPSTR_TIME_PARAM_NOSECS \
884 "Time between HELLO packets\n" \
885 "Time between retransmitting lost link state advertisements\n" \
886 "Link state transmit delay\n" \
887 "Interval after which a neighbor is declared dead\n"
889 #define VLINK_HELPSTR_TIME_PARAM \
890 VLINK_HELPSTR_TIME_PARAM_NOSECS \
893 #define VLINK_HELPSTR_AUTH_SIMPLE \
894 "Authentication password (key)\n" \
895 "The OSPF password (key)"
897 #define VLINK_HELPSTR_AUTH_MD5 \
898 "Message digest authentication password (key)\n" \
901 "Use MD5 algorithm\n" \
902 "The OSPF password (key)"
904 DEFUN (ospf_area_vlink
,
906 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D",
907 VLINK_HELPSTR_IPADDR
)
909 struct ospf
*ospf
= vty
->index
;
910 struct ospf_vl_config_data vl_config
;
911 char auth_key
[OSPF_AUTH_SIMPLE_SIZE
+1];
912 char md5_key
[OSPF_AUTH_MD5_SIZE
+1];
916 ospf_vl_config_data_init(&vl_config
, vty
);
918 /* Read off first 2 parameters and check them */
919 ret
= ospf_str2area_id (argv
[0], &vl_config
.area_id
, &vl_config
.format
);
922 vty_out (vty
, "OSPF area ID is invalid%s", VTY_NEWLINE
);
926 ret
= inet_aton (argv
[1], &vl_config
.vl_peer
);
929 vty_out (vty
, "Please specify valid Router ID as a.b.c.d%s",
936 /* Thats all folks! - BUGS B. strikes again!!!*/
938 return ospf_vl_set (ospf
, &vl_config
);
941 /* Deal with other parameters */
942 for (i
=2; i
< argc
; i
++)
945 /* vty_out (vty, "argv[%d] - %s%s", i, argv[i], VTY_NEWLINE); */
951 if (i
> 2 || strncmp (argv
[i
], "authentication-", 15) == 0)
953 /* authentication-key - this option can occur anywhere on
954 command line. At start of command line
955 must check for authentication option. */
956 memset (auth_key
, 0, OSPF_AUTH_SIMPLE_SIZE
+ 1);
957 strncpy (auth_key
, argv
[i
+1], OSPF_AUTH_SIMPLE_SIZE
);
958 vl_config
.auth_key
= auth_key
;
961 else if (strncmp (argv
[i
], "authentication", 14) == 0)
963 /* authentication - this option can only occur at start
965 vl_config
.auth_type
= OSPF_AUTH_SIMPLE
;
968 if (strncmp (argv
[i
+1], "n", 1) == 0)
970 /* "authentication null" */
971 vl_config
.auth_type
= OSPF_AUTH_NULL
;
974 else if (strncmp (argv
[i
+1], "m", 1) == 0
975 && strcmp (argv
[i
+1], "message-digest-") != 0)
977 /* "authentication message-digest" */
978 vl_config
.auth_type
= OSPF_AUTH_CRYPTOGRAPHIC
;
986 /* message-digest-key */
988 vl_config
.crypto_key_id
= strtol (argv
[i
], NULL
, 10);
989 if (vl_config
.crypto_key_id
< 0)
992 memset(md5_key
, 0, OSPF_AUTH_MD5_SIZE
+1);
993 strncpy (md5_key
, argv
[i
], OSPF_AUTH_MD5_SIZE
);
994 vl_config
.md5_key
= md5_key
;
1000 vl_config
.hello_interval
= strtol (argv
[i
], NULL
, 10);
1001 if (vl_config
.hello_interval
< 0)
1006 /* Retransmit Interval */
1008 vl_config
.retransmit_interval
= strtol (argv
[i
], NULL
, 10);
1009 if (vl_config
.retransmit_interval
< 0)
1014 /* Transmit Delay */
1016 vl_config
.transmit_delay
= strtol (argv
[i
], NULL
, 10);
1017 if (vl_config
.transmit_delay
< 0)
1024 vl_config
.dead_interval
= strtol (argv
[i
], NULL
, 10);
1025 if (vl_config
.dead_interval
< 0)
1032 /* Action configuration */
1034 return ospf_vl_set (ospf
, &vl_config
);
1038 DEFUN (no_ospf_area_vlink
,
1039 no_ospf_area_vlink_cmd
,
1040 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D",
1042 VLINK_HELPSTR_IPADDR
)
1044 struct ospf
*ospf
= vty
->index
;
1045 struct ospf_area
*area
;
1046 struct ospf_vl_config_data vl_config
;
1047 struct ospf_vl_data
*vl_data
= NULL
;
1048 char auth_key
[OSPF_AUTH_SIMPLE_SIZE
+1];
1052 ospf_vl_config_data_init(&vl_config
, vty
);
1054 ret
= ospf_str2area_id (argv
[0], &vl_config
.area_id
, &format
);
1057 vty_out (vty
, "OSPF area ID is invalid%s", VTY_NEWLINE
);
1061 area
= ospf_area_lookup_by_area_id (ospf
, vl_config
.area_id
);
1064 vty_out (vty
, "Area does not exist%s", VTY_NEWLINE
);
1068 ret
= inet_aton (argv
[1], &vl_config
.vl_peer
);
1071 vty_out (vty
, "Please specify valid Router ID as a.b.c.d%s",
1078 /* Basic VLink no command */
1079 /* Thats all folks! - BUGS B. strikes again!!!*/
1080 if ((vl_data
= ospf_vl_lookup (area
, vl_config
.vl_peer
)))
1081 ospf_vl_delete (ospf
, vl_data
);
1083 ospf_area_check_free (ospf
, vl_config
.area_id
);
1088 /* If we are down here, we are reseting parameters */
1090 /* Deal with other parameters */
1091 for (i
=2; i
< argc
; i
++)
1093 /* vty_out (vty, "argv[%d] - %s%s", i, argv[i], VTY_NEWLINE); */
1099 if (i
> 2 || strncmp (argv
[i
], "authentication-", 15) == 0)
1101 /* authentication-key - this option can occur anywhere on
1102 command line. At start of command line
1103 must check for authentication option. */
1104 memset (auth_key
, 0, OSPF_AUTH_SIMPLE_SIZE
+ 1);
1105 vl_config
.auth_key
= auth_key
;
1107 else if (strncmp (argv
[i
], "authentication", 14) == 0)
1109 /* authentication - this option can only occur at start
1111 vl_config
.auth_type
= OSPF_AUTH_NOTSET
;
1116 /* message-digest-key */
1117 /* Delete one key */
1119 vl_config
.crypto_key_id
= strtol (argv
[i
], NULL
, 10);
1120 if (vl_config
.crypto_key_id
< 0)
1122 vl_config
.md5_key
= NULL
;
1126 /* Hello interval */
1127 vl_config
.hello_interval
= OSPF_HELLO_INTERVAL_DEFAULT
;
1131 /* Retransmit Interval */
1132 vl_config
.retransmit_interval
= OSPF_RETRANSMIT_INTERVAL_DEFAULT
;
1136 /* Transmit Delay */
1137 vl_config
.transmit_delay
= OSPF_TRANSMIT_DELAY_DEFAULT
;
1143 vl_config
.dead_interval
= OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
;
1149 /* Action configuration */
1151 return ospf_vl_set (ospf
, &vl_config
);
1154 ALIAS (ospf_area_vlink
,
1155 ospf_area_vlink_param1_cmd
,
1156 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1157 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
1158 VLINK_HELPSTR_IPADDR
1159 VLINK_HELPSTR_TIME_PARAM
)
1161 ALIAS (no_ospf_area_vlink
,
1162 no_ospf_area_vlink_param1_cmd
,
1163 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1164 "(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
1166 VLINK_HELPSTR_IPADDR
1167 VLINK_HELPSTR_TIME_PARAM
)
1169 ALIAS (ospf_area_vlink
,
1170 ospf_area_vlink_param2_cmd
,
1171 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1172 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1173 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
1174 VLINK_HELPSTR_IPADDR
1175 VLINK_HELPSTR_TIME_PARAM
1176 VLINK_HELPSTR_TIME_PARAM
)
1178 ALIAS (no_ospf_area_vlink
,
1179 no_ospf_area_vlink_param2_cmd
,
1180 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1181 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1182 "(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
1184 VLINK_HELPSTR_IPADDR
1185 VLINK_HELPSTR_TIME_PARAM
1186 VLINK_HELPSTR_TIME_PARAM
)
1188 ALIAS (ospf_area_vlink
,
1189 ospf_area_vlink_param3_cmd
,
1190 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1191 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1192 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1193 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
1194 VLINK_HELPSTR_IPADDR
1195 VLINK_HELPSTR_TIME_PARAM
1196 VLINK_HELPSTR_TIME_PARAM
1197 VLINK_HELPSTR_TIME_PARAM
)
1199 ALIAS (no_ospf_area_vlink
,
1200 no_ospf_area_vlink_param3_cmd
,
1201 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1202 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1203 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1204 "(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
1206 VLINK_HELPSTR_IPADDR
1207 VLINK_HELPSTR_TIME_PARAM
1208 VLINK_HELPSTR_TIME_PARAM
1209 VLINK_HELPSTR_TIME_PARAM
)
1211 ALIAS (ospf_area_vlink
,
1212 ospf_area_vlink_param4_cmd
,
1213 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1214 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1215 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1216 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
1217 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
1218 VLINK_HELPSTR_IPADDR
1219 VLINK_HELPSTR_TIME_PARAM
1220 VLINK_HELPSTR_TIME_PARAM
1221 VLINK_HELPSTR_TIME_PARAM
1222 VLINK_HELPSTR_TIME_PARAM
)
1224 ALIAS (no_ospf_area_vlink
,
1225 no_ospf_area_vlink_param4_cmd
,
1226 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1227 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1228 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1229 "(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
1230 "(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
1232 VLINK_HELPSTR_IPADDR
1233 VLINK_HELPSTR_TIME_PARAM
1234 VLINK_HELPSTR_TIME_PARAM
1235 VLINK_HELPSTR_TIME_PARAM
1236 VLINK_HELPSTR_TIME_PARAM
)
1238 ALIAS (ospf_area_vlink
,
1239 ospf_area_vlink_authtype_args_cmd
,
1240 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1241 "(authentication|) (message-digest|null)",
1242 VLINK_HELPSTR_IPADDR
1243 VLINK_HELPSTR_AUTHTYPE_ALL
)
1245 ALIAS (ospf_area_vlink
,
1246 ospf_area_vlink_authtype_cmd
,
1247 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1248 "(authentication|)",
1249 VLINK_HELPSTR_IPADDR
1250 VLINK_HELPSTR_AUTHTYPE_SIMPLE
)
1252 ALIAS (no_ospf_area_vlink
,
1253 no_ospf_area_vlink_authtype_cmd
,
1254 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1255 "(authentication|)",
1257 VLINK_HELPSTR_IPADDR
1258 VLINK_HELPSTR_AUTHTYPE_SIMPLE
)
1260 ALIAS (ospf_area_vlink
,
1261 ospf_area_vlink_md5_cmd
,
1262 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1263 "(message-digest-key|) <1-255> md5 KEY",
1264 VLINK_HELPSTR_IPADDR
1265 VLINK_HELPSTR_AUTH_MD5
)
1267 ALIAS (no_ospf_area_vlink
,
1268 no_ospf_area_vlink_md5_cmd
,
1269 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1270 "(message-digest-key|) <1-255>",
1272 VLINK_HELPSTR_IPADDR
1273 VLINK_HELPSTR_AUTH_MD5
)
1275 ALIAS (ospf_area_vlink
,
1276 ospf_area_vlink_authkey_cmd
,
1277 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1278 "(authentication-key|) AUTH_KEY",
1279 VLINK_HELPSTR_IPADDR
1280 VLINK_HELPSTR_AUTH_SIMPLE
)
1282 ALIAS (no_ospf_area_vlink
,
1283 no_ospf_area_vlink_authkey_cmd
,
1284 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1285 "(authentication-key|)",
1287 VLINK_HELPSTR_IPADDR
1288 VLINK_HELPSTR_AUTH_SIMPLE
)
1290 ALIAS (ospf_area_vlink
,
1291 ospf_area_vlink_authtype_args_authkey_cmd
,
1292 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1293 "(authentication|) (message-digest|null) "
1294 "(authentication-key|) AUTH_KEY",
1295 VLINK_HELPSTR_IPADDR
1296 VLINK_HELPSTR_AUTHTYPE_ALL
1297 VLINK_HELPSTR_AUTH_SIMPLE
)
1299 ALIAS (ospf_area_vlink
,
1300 ospf_area_vlink_authtype_authkey_cmd
,
1301 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1302 "(authentication|) "
1303 "(authentication-key|) AUTH_KEY",
1304 VLINK_HELPSTR_IPADDR
1305 VLINK_HELPSTR_AUTHTYPE_SIMPLE
1306 VLINK_HELPSTR_AUTH_SIMPLE
)
1308 ALIAS (no_ospf_area_vlink
,
1309 no_ospf_area_vlink_authtype_authkey_cmd
,
1310 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1311 "(authentication|) "
1312 "(authentication-key|)",
1314 VLINK_HELPSTR_IPADDR
1315 VLINK_HELPSTR_AUTHTYPE_SIMPLE
1316 VLINK_HELPSTR_AUTH_SIMPLE
)
1318 ALIAS (ospf_area_vlink
,
1319 ospf_area_vlink_authtype_args_md5_cmd
,
1320 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1321 "(authentication|) (message-digest|null) "
1322 "(message-digest-key|) <1-255> md5 KEY",
1323 VLINK_HELPSTR_IPADDR
1324 VLINK_HELPSTR_AUTHTYPE_ALL
1325 VLINK_HELPSTR_AUTH_MD5
)
1327 ALIAS (ospf_area_vlink
,
1328 ospf_area_vlink_authtype_md5_cmd
,
1329 "area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1330 "(authentication|) "
1331 "(message-digest-key|) <1-255> md5 KEY",
1332 VLINK_HELPSTR_IPADDR
1333 VLINK_HELPSTR_AUTHTYPE_SIMPLE
1334 VLINK_HELPSTR_AUTH_MD5
)
1336 ALIAS (no_ospf_area_vlink
,
1337 no_ospf_area_vlink_authtype_md5_cmd
,
1338 "no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
1339 "(authentication|) "
1340 "(message-digest-key|)",
1342 VLINK_HELPSTR_IPADDR
1343 VLINK_HELPSTR_AUTHTYPE_SIMPLE
1344 VLINK_HELPSTR_AUTH_MD5
)
1347 DEFUN (ospf_area_shortcut
,
1348 ospf_area_shortcut_cmd
,
1349 "area (A.B.C.D|<0-4294967295>) shortcut (default|enable|disable)",
1350 "OSPF area parameters\n"
1351 "OSPF area ID in IP address format\n"
1352 "OSPF area ID as a decimal value\n"
1353 "Configure the area's shortcutting mode\n"
1354 "Set default shortcutting behavior\n"
1355 "Enable shortcutting through the area\n"
1356 "Disable shortcutting through the area\n")
1358 struct ospf
*ospf
= vty
->index
;
1359 struct ospf_area
*area
;
1360 struct in_addr area_id
;
1364 VTY_GET_OSPF_AREA_ID_NO_BB ("shortcut", area_id
, format
, argv
[0]);
1366 area
= ospf_area_get (ospf
, area_id
, format
);
1368 if (strncmp (argv
[1], "de", 2) == 0)
1369 mode
= OSPF_SHORTCUT_DEFAULT
;
1370 else if (strncmp (argv
[1], "di", 2) == 0)
1371 mode
= OSPF_SHORTCUT_DISABLE
;
1372 else if (strncmp (argv
[1], "e", 1) == 0)
1373 mode
= OSPF_SHORTCUT_ENABLE
;
1377 ospf_area_shortcut_set (ospf
, area
, mode
);
1379 if (ospf
->abr_type
!= OSPF_ABR_SHORTCUT
)
1380 vty_out (vty
, "Shortcut area setting will take effect "
1381 "only when the router is configured as Shortcut ABR%s",
1387 DEFUN (no_ospf_area_shortcut
,
1388 no_ospf_area_shortcut_cmd
,
1389 "no area (A.B.C.D|<0-4294967295>) shortcut (enable|disable)",
1391 "OSPF area parameters\n"
1392 "OSPF area ID in IP address format\n"
1393 "OSPF area ID as a decimal value\n"
1394 "Deconfigure the area's shortcutting mode\n"
1395 "Deconfigure enabled shortcutting through the area\n"
1396 "Deconfigure disabled shortcutting through the area\n")
1398 struct ospf
*ospf
= vty
->index
;
1399 struct ospf_area
*area
;
1400 struct in_addr area_id
;
1403 VTY_GET_OSPF_AREA_ID_NO_BB ("shortcut", area_id
, format
, argv
[0]);
1405 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1409 ospf_area_shortcut_unset (ospf
, area
);
1415 DEFUN (ospf_area_stub
,
1417 "area (A.B.C.D|<0-4294967295>) stub",
1418 "OSPF area parameters\n"
1419 "OSPF area ID in IP address format\n"
1420 "OSPF area ID as a decimal value\n"
1421 "Configure OSPF area as stub\n")
1423 struct ospf
*ospf
= vty
->index
;
1424 struct in_addr area_id
;
1427 VTY_GET_OSPF_AREA_ID_NO_BB ("stub", area_id
, format
, argv
[0]);
1429 ret
= ospf_area_stub_set (ospf
, area_id
);
1432 vty_out (vty
, "First deconfigure all virtual link through this area%s",
1437 ospf_area_no_summary_unset (ospf
, area_id
);
1442 DEFUN (ospf_area_stub_no_summary
,
1443 ospf_area_stub_no_summary_cmd
,
1444 "area (A.B.C.D|<0-4294967295>) stub no-summary",
1445 "OSPF stub parameters\n"
1446 "OSPF area ID in IP address format\n"
1447 "OSPF area ID as a decimal value\n"
1448 "Configure OSPF area as stub\n"
1449 "Do not inject inter-area routes into stub\n")
1451 struct ospf
*ospf
= vty
->index
;
1452 struct in_addr area_id
;
1455 VTY_GET_OSPF_AREA_ID_NO_BB ("stub", area_id
, format
, argv
[0]);
1457 ret
= ospf_area_stub_set (ospf
, area_id
);
1460 vty_out (vty
, "%% Area cannot be stub as it contains a virtual link%s",
1465 ospf_area_no_summary_set (ospf
, area_id
);
1470 DEFUN (no_ospf_area_stub
,
1471 no_ospf_area_stub_cmd
,
1472 "no area (A.B.C.D|<0-4294967295>) stub",
1474 "OSPF area parameters\n"
1475 "OSPF area ID in IP address format\n"
1476 "OSPF area ID as a decimal value\n"
1477 "Configure OSPF area as stub\n")
1479 struct ospf
*ospf
= vty
->index
;
1480 struct in_addr area_id
;
1483 VTY_GET_OSPF_AREA_ID_NO_BB ("stub", area_id
, format
, argv
[0]);
1485 ospf_area_stub_unset (ospf
, area_id
);
1486 ospf_area_no_summary_unset (ospf
, area_id
);
1491 DEFUN (no_ospf_area_stub_no_summary
,
1492 no_ospf_area_stub_no_summary_cmd
,
1493 "no area (A.B.C.D|<0-4294967295>) stub no-summary",
1495 "OSPF area parameters\n"
1496 "OSPF area ID in IP address format\n"
1497 "OSPF area ID as a decimal value\n"
1498 "Configure OSPF area as stub\n"
1499 "Do not inject inter-area routes into area\n")
1501 struct ospf
*ospf
= vty
->index
;
1502 struct in_addr area_id
;
1505 VTY_GET_OSPF_AREA_ID_NO_BB ("stub", area_id
, format
, argv
[0]);
1506 ospf_area_no_summary_unset (ospf
, area_id
);
1512 ospf_area_nssa_cmd_handler (struct vty
*vty
, int argc
, const char *argv
[],
1515 struct ospf
*ospf
= vty
->index
;
1516 struct in_addr area_id
;
1519 VTY_GET_OSPF_AREA_ID_NO_BB ("NSSA", area_id
, format
, argv
[0]);
1521 ret
= ospf_area_nssa_set (ospf
, area_id
);
1524 vty_out (vty
, "%% Area cannot be nssa as it contains a virtual link%s",
1531 if (strncmp (argv
[1], "translate-c", 11) == 0)
1532 ospf_area_nssa_translator_role_set (ospf
, area_id
,
1533 OSPF_NSSA_ROLE_CANDIDATE
);
1534 else if (strncmp (argv
[1], "translate-n", 11) == 0)
1535 ospf_area_nssa_translator_role_set (ospf
, area_id
,
1536 OSPF_NSSA_ROLE_NEVER
);
1537 else if (strncmp (argv
[1], "translate-a", 11) == 0)
1538 ospf_area_nssa_translator_role_set (ospf
, area_id
,
1539 OSPF_NSSA_ROLE_ALWAYS
);
1543 ospf_area_nssa_translator_role_set (ospf
, area_id
,
1544 OSPF_NSSA_ROLE_CANDIDATE
);
1548 ospf_area_no_summary_set (ospf
, area_id
);
1550 ospf_area_no_summary_unset (ospf
, area_id
);
1552 ospf_schedule_abr_task (ospf
);
1557 DEFUN (ospf_area_nssa_translate_no_summary
,
1558 ospf_area_nssa_translate_no_summary_cmd
,
1559 "area (A.B.C.D|<0-4294967295>) nssa (translate-candidate|translate-never|translate-always) no-summary",
1560 "OSPF area parameters\n"
1561 "OSPF area ID in IP address format\n"
1562 "OSPF area ID as a decimal value\n"
1563 "Configure OSPF area as nssa\n"
1564 "Configure NSSA-ABR for translate election (default)\n"
1565 "Configure NSSA-ABR to never translate\n"
1566 "Configure NSSA-ABR to always translate\n"
1567 "Do not inject inter-area routes into nssa\n")
1569 return ospf_area_nssa_cmd_handler (vty
, argc
, argv
, 1);
1572 DEFUN (ospf_area_nssa_translate
,
1573 ospf_area_nssa_translate_cmd
,
1574 "area (A.B.C.D|<0-4294967295>) nssa (translate-candidate|translate-never|translate-always)",
1575 "OSPF area parameters\n"
1576 "OSPF area ID in IP address format\n"
1577 "OSPF area ID as a decimal value\n"
1578 "Configure OSPF area as nssa\n"
1579 "Configure NSSA-ABR for translate election (default)\n"
1580 "Configure NSSA-ABR to never translate\n"
1581 "Configure NSSA-ABR to always translate\n")
1583 return ospf_area_nssa_cmd_handler (vty
, argc
, argv
, 0);
1586 DEFUN (ospf_area_nssa
,
1588 "area (A.B.C.D|<0-4294967295>) nssa",
1589 "OSPF area parameters\n"
1590 "OSPF area ID in IP address format\n"
1591 "OSPF area ID as a decimal value\n"
1592 "Configure OSPF area as nssa\n")
1594 return ospf_area_nssa_cmd_handler (vty
, argc
, argv
, 0);
1597 DEFUN (ospf_area_nssa_no_summary
,
1598 ospf_area_nssa_no_summary_cmd
,
1599 "area (A.B.C.D|<0-4294967295>) nssa no-summary",
1600 "OSPF area parameters\n"
1601 "OSPF area ID in IP address format\n"
1602 "OSPF area ID as a decimal value\n"
1603 "Configure OSPF area as nssa\n"
1604 "Do not inject inter-area routes into nssa\n")
1606 return ospf_area_nssa_cmd_handler (vty
, argc
, argv
, 1);
1609 DEFUN (no_ospf_area_nssa
,
1610 no_ospf_area_nssa_cmd
,
1611 "no area (A.B.C.D|<0-4294967295>) nssa",
1613 "OSPF area parameters\n"
1614 "OSPF area ID in IP address format\n"
1615 "OSPF area ID as a decimal value\n"
1616 "Configure OSPF area as nssa\n")
1618 struct ospf
*ospf
= vty
->index
;
1619 struct in_addr area_id
;
1622 VTY_GET_OSPF_AREA_ID_NO_BB ("NSSA", area_id
, format
, argv
[0]);
1624 ospf_area_nssa_unset (ospf
, area_id
);
1625 ospf_area_no_summary_unset (ospf
, area_id
);
1627 ospf_schedule_abr_task (ospf
);
1632 DEFUN (no_ospf_area_nssa_no_summary
,
1633 no_ospf_area_nssa_no_summary_cmd
,
1634 "no area (A.B.C.D|<0-4294967295>) nssa no-summary",
1636 "OSPF area parameters\n"
1637 "OSPF area ID in IP address format\n"
1638 "OSPF area ID as a decimal value\n"
1639 "Configure OSPF area as nssa\n"
1640 "Do not inject inter-area routes into nssa\n")
1642 struct ospf
*ospf
= vty
->index
;
1643 struct in_addr area_id
;
1646 VTY_GET_OSPF_AREA_ID_NO_BB ("NSSA", area_id
, format
, argv
[0]);
1647 ospf_area_no_summary_unset (ospf
, area_id
);
1652 DEFUN (ospf_area_default_cost
,
1653 ospf_area_default_cost_cmd
,
1654 "area (A.B.C.D|<0-4294967295>) default-cost <0-16777215>",
1655 "OSPF area parameters\n"
1656 "OSPF area ID in IP address format\n"
1657 "OSPF area ID as a decimal value\n"
1658 "Set the summary-default cost of a NSSA or stub area\n"
1659 "Stub's advertised default summary cost\n")
1661 struct ospf
*ospf
= vty
->index
;
1662 struct ospf_area
*area
;
1663 struct in_addr area_id
;
1667 VTY_GET_OSPF_AREA_ID_NO_BB ("default-cost", area_id
, format
, argv
[0]);
1668 VTY_GET_INTEGER_RANGE ("stub default cost", cost
, argv
[1], 0, 16777215);
1670 area
= ospf_area_get (ospf
, area_id
, format
);
1672 if (area
->external_routing
== OSPF_AREA_DEFAULT
)
1674 vty_out (vty
, "The area is neither stub, nor NSSA%s", VTY_NEWLINE
);
1678 area
->default_cost
= cost
;
1683 DEFUN (no_ospf_area_default_cost
,
1684 no_ospf_area_default_cost_cmd
,
1685 "no area (A.B.C.D|<0-4294967295>) default-cost <0-16777215>",
1687 "OSPF area parameters\n"
1688 "OSPF area ID in IP address format\n"
1689 "OSPF area ID as a decimal value\n"
1690 "Set the summary-default cost of a NSSA or stub area\n"
1691 "Stub's advertised default summary cost\n")
1693 struct ospf
*ospf
= vty
->index
;
1694 struct ospf_area
*area
;
1695 struct in_addr area_id
;
1699 VTY_GET_OSPF_AREA_ID_NO_BB ("default-cost", area_id
, format
, argv
[0]);
1700 VTY_GET_INTEGER_RANGE ("stub default cost", cost
, argv
[1], 0, 16777215);
1702 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1706 if (area
->external_routing
== OSPF_AREA_DEFAULT
)
1708 vty_out (vty
, "The area is neither stub, nor NSSA%s", VTY_NEWLINE
);
1712 area
->default_cost
= 1;
1714 ospf_area_check_free (ospf
, area_id
);
1719 DEFUN (ospf_area_export_list
,
1720 ospf_area_export_list_cmd
,
1721 "area (A.B.C.D|<0-4294967295>) export-list NAME",
1722 "OSPF area parameters\n"
1723 "OSPF area ID in IP address format\n"
1724 "OSPF area ID as a decimal value\n"
1725 "Set the filter for networks announced to other areas\n"
1726 "Name of the access-list\n")
1728 struct ospf
*ospf
= vty
->index
;
1729 struct ospf_area
*area
;
1730 struct in_addr area_id
;
1733 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1735 area
= ospf_area_get (ospf
, area_id
, format
);
1736 ospf_area_export_list_set (ospf
, area
, argv
[1]);
1741 DEFUN (no_ospf_area_export_list
,
1742 no_ospf_area_export_list_cmd
,
1743 "no area (A.B.C.D|<0-4294967295>) export-list NAME",
1745 "OSPF area parameters\n"
1746 "OSPF area ID in IP address format\n"
1747 "OSPF area ID as a decimal value\n"
1748 "Unset the filter for networks announced to other areas\n"
1749 "Name of the access-list\n")
1751 struct ospf
*ospf
= vty
->index
;
1752 struct ospf_area
*area
;
1753 struct in_addr area_id
;
1756 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1758 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1762 ospf_area_export_list_unset (ospf
, area
);
1768 DEFUN (ospf_area_import_list
,
1769 ospf_area_import_list_cmd
,
1770 "area (A.B.C.D|<0-4294967295>) import-list NAME",
1771 "OSPF area parameters\n"
1772 "OSPF area ID in IP address format\n"
1773 "OSPF area ID as a decimal value\n"
1774 "Set the filter for networks from other areas announced to the specified one\n"
1775 "Name of the access-list\n")
1777 struct ospf
*ospf
= vty
->index
;
1778 struct ospf_area
*area
;
1779 struct in_addr area_id
;
1782 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1784 area
= ospf_area_get (ospf
, area_id
, format
);
1785 ospf_area_import_list_set (ospf
, area
, argv
[1]);
1790 DEFUN (no_ospf_area_import_list
,
1791 no_ospf_area_import_list_cmd
,
1792 "no area (A.B.C.D|<0-4294967295>) import-list NAME",
1794 "OSPF area parameters\n"
1795 "OSPF area ID in IP address format\n"
1796 "OSPF area ID as a decimal value\n"
1797 "Unset the filter for networks announced to other areas\n"
1798 "Name of the access-list\n")
1800 struct ospf
*ospf
= vty
->index
;
1801 struct ospf_area
*area
;
1802 struct in_addr area_id
;
1805 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1807 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1811 ospf_area_import_list_unset (ospf
, area
);
1816 DEFUN (ospf_area_filter_list
,
1817 ospf_area_filter_list_cmd
,
1818 "area (A.B.C.D|<0-4294967295>) filter-list prefix WORD (in|out)",
1819 "OSPF area parameters\n"
1820 "OSPF area ID in IP address format\n"
1821 "OSPF area ID as a decimal value\n"
1822 "Filter networks between OSPF areas\n"
1823 "Filter prefixes between OSPF areas\n"
1824 "Name of an IP prefix-list\n"
1825 "Filter networks sent to this area\n"
1826 "Filter networks sent from this area\n")
1828 struct ospf
*ospf
= vty
->index
;
1829 struct ospf_area
*area
;
1830 struct in_addr area_id
;
1831 struct prefix_list
*plist
;
1834 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1836 area
= ospf_area_get (ospf
, area_id
, format
);
1837 plist
= prefix_list_lookup (AFI_IP
, argv
[1]);
1838 if (strncmp (argv
[2], "in", 2) == 0)
1840 PREFIX_LIST_IN (area
) = plist
;
1841 if (PREFIX_NAME_IN (area
))
1842 free (PREFIX_NAME_IN (area
));
1844 PREFIX_NAME_IN (area
) = strdup (argv
[1]);
1845 ospf_schedule_abr_task (ospf
);
1849 PREFIX_LIST_OUT (area
) = plist
;
1850 if (PREFIX_NAME_OUT (area
))
1851 free (PREFIX_NAME_OUT (area
));
1853 PREFIX_NAME_OUT (area
) = strdup (argv
[1]);
1854 ospf_schedule_abr_task (ospf
);
1860 DEFUN (no_ospf_area_filter_list
,
1861 no_ospf_area_filter_list_cmd
,
1862 "no area (A.B.C.D|<0-4294967295>) filter-list prefix WORD (in|out)",
1864 "OSPF area parameters\n"
1865 "OSPF area ID in IP address format\n"
1866 "OSPF area ID as a decimal value\n"
1867 "Filter networks between OSPF areas\n"
1868 "Filter prefixes between OSPF areas\n"
1869 "Name of an IP prefix-list\n"
1870 "Filter networks sent to this area\n"
1871 "Filter networks sent from this area\n")
1873 struct ospf
*ospf
= vty
->index
;
1874 struct ospf_area
*area
;
1875 struct in_addr area_id
;
1876 struct prefix_list
*plist
;
1879 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1881 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1882 plist
= prefix_list_lookup (AFI_IP
, argv
[1]);
1883 if (strncmp (argv
[2], "in", 2) == 0)
1885 if (PREFIX_NAME_IN (area
))
1886 if (strcmp (PREFIX_NAME_IN (area
), argv
[1]) != 0)
1889 PREFIX_LIST_IN (area
) = NULL
;
1890 if (PREFIX_NAME_IN (area
))
1891 free (PREFIX_NAME_IN (area
));
1893 PREFIX_NAME_IN (area
) = NULL
;
1895 ospf_schedule_abr_task (ospf
);
1899 if (PREFIX_NAME_OUT (area
))
1900 if (strcmp (PREFIX_NAME_OUT (area
), argv
[1]) != 0)
1903 PREFIX_LIST_OUT (area
) = NULL
;
1904 if (PREFIX_NAME_OUT (area
))
1905 free (PREFIX_NAME_OUT (area
));
1907 PREFIX_NAME_OUT (area
) = NULL
;
1909 ospf_schedule_abr_task (ospf
);
1916 DEFUN (ospf_area_authentication_message_digest
,
1917 ospf_area_authentication_message_digest_cmd
,
1918 "area (A.B.C.D|<0-4294967295>) authentication message-digest",
1919 "OSPF area parameters\n"
1920 "Enable authentication\n"
1921 "Use message-digest authentication\n")
1923 struct ospf
*ospf
= vty
->index
;
1924 struct ospf_area
*area
;
1925 struct in_addr area_id
;
1928 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1930 area
= ospf_area_get (ospf
, area_id
, format
);
1931 area
->auth_type
= OSPF_AUTH_CRYPTOGRAPHIC
;
1936 DEFUN (ospf_area_authentication
,
1937 ospf_area_authentication_cmd
,
1938 "area (A.B.C.D|<0-4294967295>) authentication",
1939 "OSPF area parameters\n"
1940 "OSPF area ID in IP address format\n"
1941 "OSPF area ID as a decimal value\n"
1942 "Enable authentication\n")
1944 struct ospf
*ospf
= vty
->index
;
1945 struct ospf_area
*area
;
1946 struct in_addr area_id
;
1949 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1951 area
= ospf_area_get (ospf
, area_id
, format
);
1952 area
->auth_type
= OSPF_AUTH_SIMPLE
;
1957 DEFUN (no_ospf_area_authentication
,
1958 no_ospf_area_authentication_cmd
,
1959 "no area (A.B.C.D|<0-4294967295>) authentication",
1961 "OSPF area parameters\n"
1962 "OSPF area ID in IP address format\n"
1963 "OSPF area ID as a decimal value\n"
1964 "Enable authentication\n")
1966 struct ospf
*ospf
= vty
->index
;
1967 struct ospf_area
*area
;
1968 struct in_addr area_id
;
1971 VTY_GET_OSPF_AREA_ID (area_id
, format
, argv
[0]);
1973 area
= ospf_area_lookup_by_area_id (ospf
, area_id
);
1977 area
->auth_type
= OSPF_AUTH_NULL
;
1979 ospf_area_check_free (ospf
, area_id
);
1985 DEFUN (ospf_abr_type
,
1987 "ospf abr-type (cisco|ibm|shortcut|standard)",
1988 "OSPF specific commands\n"
1989 "Set OSPF ABR type\n"
1990 "Alternative ABR, cisco implementation\n"
1991 "Alternative ABR, IBM implementation\n"
1993 "Standard behavior (RFC2328)\n")
1995 struct ospf
*ospf
= vty
->index
;
1996 u_char abr_type
= OSPF_ABR_UNKNOWN
;
1998 if (strncmp (argv
[0], "c", 1) == 0)
1999 abr_type
= OSPF_ABR_CISCO
;
2000 else if (strncmp (argv
[0], "i", 1) == 0)
2001 abr_type
= OSPF_ABR_IBM
;
2002 else if (strncmp (argv
[0], "sh", 2) == 0)
2003 abr_type
= OSPF_ABR_SHORTCUT
;
2004 else if (strncmp (argv
[0], "st", 2) == 0)
2005 abr_type
= OSPF_ABR_STAND
;
2009 /* If ABR type value is changed, schedule ABR task. */
2010 if (ospf
->abr_type
!= abr_type
)
2012 ospf
->abr_type
= abr_type
;
2013 ospf_schedule_abr_task (ospf
);
2019 DEFUN (no_ospf_abr_type
,
2020 no_ospf_abr_type_cmd
,
2021 "no ospf abr-type (cisco|ibm|shortcut)",
2023 "OSPF specific commands\n"
2024 "Set OSPF ABR type\n"
2025 "Alternative ABR, cisco implementation\n"
2026 "Alternative ABR, IBM implementation\n"
2029 struct ospf
*ospf
= vty
->index
;
2030 u_char abr_type
= OSPF_ABR_UNKNOWN
;
2032 if (strncmp (argv
[0], "c", 1) == 0)
2033 abr_type
= OSPF_ABR_CISCO
;
2034 else if (strncmp (argv
[0], "i", 1) == 0)
2035 abr_type
= OSPF_ABR_IBM
;
2036 else if (strncmp (argv
[0], "s", 1) == 0)
2037 abr_type
= OSPF_ABR_SHORTCUT
;
2041 /* If ABR type value is changed, schedule ABR task. */
2042 if (ospf
->abr_type
== abr_type
)
2044 ospf
->abr_type
= OSPF_ABR_STAND
;
2045 ospf_schedule_abr_task (ospf
);
2051 DEFUN (ospf_compatible_rfc1583
,
2052 ospf_compatible_rfc1583_cmd
,
2053 "compatible rfc1583",
2054 "OSPF compatibility list\n"
2055 "compatible with RFC 1583\n")
2057 struct ospf
*ospf
= vty
->index
;
2059 if (!CHECK_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
))
2061 SET_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
);
2062 ospf_spf_calculate_schedule (ospf
);
2067 DEFUN (no_ospf_compatible_rfc1583
,
2068 no_ospf_compatible_rfc1583_cmd
,
2069 "no compatible rfc1583",
2071 "OSPF compatibility list\n"
2072 "compatible with RFC 1583\n")
2074 struct ospf
*ospf
= vty
->index
;
2076 if (CHECK_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
))
2078 UNSET_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
);
2079 ospf_spf_calculate_schedule (ospf
);
2084 ALIAS (ospf_compatible_rfc1583
,
2085 ospf_rfc1583_flag_cmd
,
2086 "ospf rfc1583compatibility",
2087 "OSPF specific commands\n"
2088 "Enable the RFC1583Compatibility flag\n")
2090 ALIAS (no_ospf_compatible_rfc1583
,
2091 no_ospf_rfc1583_flag_cmd
,
2092 "no ospf rfc1583compatibility",
2094 "OSPF specific commands\n"
2095 "Disable the RFC1583Compatibility flag\n")
2097 DEFUN (ospf_timers_spf
,
2098 ospf_timers_spf_cmd
,
2099 "timers spf <0-4294967295> <0-4294967295>",
2100 "Adjust routing timers\n"
2102 "Delay between receiving a change to SPF calculation\n"
2103 "Hold time between consecutive SPF calculations\n")
2105 struct ospf
*ospf
= vty
->index
;
2106 u_int32_t delay
, hold
;
2108 VTY_GET_UINT32 ("SPF delay timer", delay
, argv
[0]);
2109 VTY_GET_UINT32 ("SPF hold timer", hold
, argv
[1]);
2111 ospf_timers_spf_set (ospf
, delay
, hold
);
2116 DEFUN (no_ospf_timers_spf
,
2117 no_ospf_timers_spf_cmd
,
2120 "Adjust routing timers\n"
2121 "OSPF SPF timers\n")
2123 struct ospf
*ospf
= vty
->index
;
2125 ospf
->spf_delay
= OSPF_SPF_DELAY_DEFAULT
;
2126 ospf
->spf_holdtime
= OSPF_SPF_HOLDTIME_DEFAULT
;
2132 DEFUN (ospf_neighbor
,
2136 "Neighbor IP address\n")
2138 struct ospf
*ospf
= vty
->index
;
2139 struct in_addr nbr_addr
;
2140 unsigned int priority
= OSPF_NEIGHBOR_PRIORITY_DEFAULT
;
2141 unsigned int interval
= OSPF_POLL_INTERVAL_DEFAULT
;
2143 VTY_GET_IPV4_ADDRESS ("neighbor address", nbr_addr
, argv
[0]);
2146 VTY_GET_INTEGER_RANGE ("neighbor priority", priority
, argv
[1], 0, 255);
2149 VTY_GET_INTEGER_RANGE ("poll interval", interval
, argv
[2], 1, 65535);
2151 ospf_nbr_nbma_set (ospf
, nbr_addr
);
2153 ospf_nbr_nbma_priority_set (ospf
, nbr_addr
, priority
);
2155 ospf_nbr_nbma_poll_interval_set (ospf
, nbr_addr
, priority
);
2160 ALIAS (ospf_neighbor
,
2161 ospf_neighbor_priority_poll_interval_cmd
,
2162 "neighbor A.B.C.D priority <0-255> poll-interval <1-65535>",
2164 "Neighbor IP address\n"
2165 "Neighbor Priority\n"
2167 "Dead Neighbor Polling interval\n"
2170 ALIAS (ospf_neighbor
,
2171 ospf_neighbor_priority_cmd
,
2172 "neighbor A.B.C.D priority <0-255>",
2174 "Neighbor IP address\n"
2175 "Neighbor Priority\n"
2178 DEFUN (ospf_neighbor_poll_interval
,
2179 ospf_neighbor_poll_interval_cmd
,
2180 "neighbor A.B.C.D poll-interval <1-65535>",
2182 "Neighbor IP address\n"
2183 "Dead Neighbor Polling interval\n"
2186 struct ospf
*ospf
= vty
->index
;
2187 struct in_addr nbr_addr
;
2188 unsigned int priority
= OSPF_NEIGHBOR_PRIORITY_DEFAULT
;
2189 unsigned int interval
= OSPF_POLL_INTERVAL_DEFAULT
;
2191 VTY_GET_IPV4_ADDRESS ("neighbor address", nbr_addr
, argv
[0]);
2194 VTY_GET_INTEGER_RANGE ("poll interval", interval
, argv
[1], 1, 65535);
2197 VTY_GET_INTEGER_RANGE ("neighbor priority", priority
, argv
[2], 0, 255);
2199 ospf_nbr_nbma_set (ospf
, nbr_addr
);
2201 ospf_nbr_nbma_poll_interval_set (ospf
, nbr_addr
, interval
);
2203 ospf_nbr_nbma_priority_set (ospf
, nbr_addr
, priority
);
2208 ALIAS (ospf_neighbor_poll_interval
,
2209 ospf_neighbor_poll_interval_priority_cmd
,
2210 "neighbor A.B.C.D poll-interval <1-65535> priority <0-255>",
2212 "Neighbor address\n"
2213 "OSPF dead-router polling interval\n"
2215 "OSPF priority of non-broadcast neighbor\n"
2218 DEFUN (no_ospf_neighbor
,
2219 no_ospf_neighbor_cmd
,
2220 "no neighbor A.B.C.D",
2223 "Neighbor IP address\n")
2225 struct ospf
*ospf
= vty
->index
;
2226 struct in_addr nbr_addr
;
2229 VTY_GET_IPV4_ADDRESS ("neighbor address", nbr_addr
, argv
[0]);
2231 ret
= ospf_nbr_nbma_unset (ospf
, nbr_addr
);
2236 ALIAS (no_ospf_neighbor
,
2237 no_ospf_neighbor_priority_cmd
,
2238 "no neighbor A.B.C.D priority <0-255>",
2241 "Neighbor IP address\n"
2242 "Neighbor Priority\n"
2245 ALIAS (no_ospf_neighbor
,
2246 no_ospf_neighbor_poll_interval_cmd
,
2247 "no neighbor A.B.C.D poll-interval <1-65535>",
2250 "Neighbor IP address\n"
2251 "Dead Neighbor Polling interval\n"
2254 ALIAS (no_ospf_neighbor
,
2255 no_ospf_neighbor_priority_pollinterval_cmd
,
2256 "no neighbor A.B.C.D priority <0-255> poll-interval <1-65535>",
2259 "Neighbor IP address\n"
2260 "Neighbor Priority\n"
2262 "Dead Neighbor Polling interval\n"
2266 DEFUN (ospf_refresh_timer
, ospf_refresh_timer_cmd
,
2267 "refresh timer <10-1800>",
2268 "Adjust refresh parameters\n"
2269 "Set refresh timer\n"
2270 "Timer value in seconds\n")
2272 struct ospf
*ospf
= vty
->index
;
2273 unsigned int interval
;
2275 VTY_GET_INTEGER_RANGE ("refresh timer", interval
, argv
[0], 10, 1800);
2276 interval
= (interval
/ 10) * 10;
2278 ospf_timers_refresh_set (ospf
, interval
);
2283 DEFUN (no_ospf_refresh_timer
, no_ospf_refresh_timer_val_cmd
,
2284 "no refresh timer <10-1800>",
2285 "Adjust refresh parameters\n"
2286 "Unset refresh timer\n"
2287 "Timer value in seconds\n")
2289 struct ospf
*ospf
= vty
->index
;
2290 unsigned int interval
;
2294 VTY_GET_INTEGER_RANGE ("refresh timer", interval
, argv
[0], 10, 1800);
2296 if (ospf
->lsa_refresh_interval
!= interval
||
2297 interval
== OSPF_LSA_REFRESH_INTERVAL_DEFAULT
)
2301 ospf_timers_refresh_unset (ospf
);
2306 ALIAS (no_ospf_refresh_timer
,
2307 no_ospf_refresh_timer_cmd
,
2309 "Adjust refresh parameters\n"
2310 "Unset refresh timer\n")
2312 DEFUN (ospf_auto_cost_reference_bandwidth
,
2313 ospf_auto_cost_reference_bandwidth_cmd
,
2314 "auto-cost reference-bandwidth <1-4294967>",
2315 "Calculate OSPF interface cost according to bandwidth\n"
2316 "Use reference bandwidth method to assign OSPF cost\n"
2317 "The reference bandwidth in terms of Mbits per second\n")
2319 struct ospf
*ospf
= vty
->index
;
2321 struct listnode
*node
;
2322 struct interface
*ifp
;
2324 refbw
= strtol (argv
[0], NULL
, 10);
2325 if (refbw
< 1 || refbw
> 4294967)
2327 vty_out (vty
, "reference-bandwidth value is invalid%s", VTY_NEWLINE
);
2331 /* If reference bandwidth is changed. */
2332 if ((refbw
* 1000) == ospf
->ref_bandwidth
)
2335 ospf
->ref_bandwidth
= refbw
* 1000;
2336 vty_out (vty
, "%% OSPF: Reference bandwidth is changed.%s", VTY_NEWLINE
);
2337 vty_out (vty
, " Please ensure reference bandwidth is consistent across all routers%s", VTY_NEWLINE
);
2339 for (ALL_LIST_ELEMENTS_RO (om
->iflist
, node
, ifp
))
2340 ospf_if_recalculate_output_cost (ifp
);
2345 DEFUN (no_ospf_auto_cost_reference_bandwidth
,
2346 no_ospf_auto_cost_reference_bandwidth_cmd
,
2347 "no auto-cost reference-bandwidth",
2349 "Calculate OSPF interface cost according to bandwidth\n"
2350 "Use reference bandwidth method to assign OSPF cost\n")
2352 struct ospf
*ospf
= vty
->index
;
2353 struct listnode
*node
, *nnode
;
2354 struct interface
*ifp
;
2356 if (ospf
->ref_bandwidth
== OSPF_DEFAULT_REF_BANDWIDTH
)
2359 ospf
->ref_bandwidth
= OSPF_DEFAULT_REF_BANDWIDTH
;
2360 vty_out (vty
, "%% OSPF: Reference bandwidth is changed.%s", VTY_NEWLINE
);
2361 vty_out (vty
, " Please ensure reference bandwidth is consistent across all routers%s", VTY_NEWLINE
);
2363 for (ALL_LIST_ELEMENTS (om
->iflist
, node
, nnode
, ifp
))
2364 ospf_if_recalculate_output_cost (ifp
);
2369 const char *ospf_abr_type_descr_str
[] =
2372 "Standard (RFC2328)",
2374 "Alternative Cisco",
2375 "Alternative Shortcut"
2378 const char *ospf_shortcut_mode_descr_str
[] =
2388 show_ip_ospf_area (struct vty
*vty
, struct ospf_area
*area
)
2391 vty_out (vty
, " Area ID: %s", inet_ntoa (area
->area_id
));
2393 /* Show Area type/mode. */
2394 if (OSPF_IS_AREA_BACKBONE (area
))
2395 vty_out (vty
, " (Backbone)%s", VTY_NEWLINE
);
2398 if (area
->external_routing
== OSPF_AREA_STUB
)
2399 vty_out (vty
, " (Stub%s%s)",
2400 area
->no_summary
? ", no summary" : "",
2401 area
->shortcut_configured
? "; " : "");
2403 else if (area
->external_routing
== OSPF_AREA_NSSA
)
2404 vty_out (vty
, " (NSSA%s%s)",
2405 area
->no_summary
? ", no summary" : "",
2406 area
->shortcut_configured
? "; " : "");
2408 vty_out (vty
, "%s", VTY_NEWLINE
);
2409 vty_out (vty
, " Shortcutting mode: %s",
2410 ospf_shortcut_mode_descr_str
[area
->shortcut_configured
]);
2411 vty_out (vty
, ", S-bit consensus: %s%s",
2412 area
->shortcut_capability
? "ok" : "no", VTY_NEWLINE
);
2415 /* Show number of interfaces. */
2416 vty_out (vty
, " Number of interfaces in this area: Total: %d, "
2417 "Active: %d%s", listcount (area
->oiflist
),
2418 area
->act_ints
, VTY_NEWLINE
);
2420 if (area
->external_routing
== OSPF_AREA_NSSA
)
2422 vty_out (vty
, " It is an NSSA configuration. %s Elected NSSA/ABR performs type-7/type-5 LSA translation. %s", VTY_NEWLINE
, VTY_NEWLINE
);
2423 if (! IS_OSPF_ABR (area
->ospf
))
2424 vty_out (vty
, " It is not ABR, therefore not Translator. %s",
2426 else if (area
->NSSATranslatorState
)
2428 vty_out (vty
, " We are an ABR and ");
2429 if (area
->NSSATranslatorRole
== OSPF_NSSA_ROLE_CANDIDATE
)
2430 vty_out (vty
, "the NSSA Elected Translator. %s",
2432 else if (area
->NSSATranslatorRole
== OSPF_NSSA_ROLE_ALWAYS
)
2433 vty_out (vty
, "always an NSSA Translator. %s",
2438 vty_out (vty
, " We are an ABR, but ");
2439 if (area
->NSSATranslatorRole
== OSPF_NSSA_ROLE_CANDIDATE
)
2440 vty_out (vty
, "not the NSSA Elected Translator. %s",
2443 vty_out (vty
, "never an NSSA Translator. %s",
2448 /* Show number of fully adjacent neighbors. */
2449 vty_out (vty
, " Number of fully adjacent neighbors in this area:"
2450 " %d%s", area
->full_nbrs
, VTY_NEWLINE
);
2452 /* Show authentication type. */
2453 vty_out (vty
, " Area has ");
2454 if (area
->auth_type
== OSPF_AUTH_NULL
)
2455 vty_out (vty
, "no authentication%s", VTY_NEWLINE
);
2456 else if (area
->auth_type
== OSPF_AUTH_SIMPLE
)
2457 vty_out (vty
, "simple password authentication%s", VTY_NEWLINE
);
2458 else if (area
->auth_type
== OSPF_AUTH_CRYPTOGRAPHIC
)
2459 vty_out (vty
, "message digest authentication%s", VTY_NEWLINE
);
2461 if (!OSPF_IS_AREA_BACKBONE (area
))
2462 vty_out (vty
, " Number of full virtual adjacencies going through"
2463 " this area: %d%s", area
->full_vls
, VTY_NEWLINE
);
2465 /* Show SPF calculation times. */
2466 vty_out (vty
, " SPF algorithm executed %d times%s",
2467 area
->spf_calculation
, VTY_NEWLINE
);
2469 /* Show number of LSA. */
2470 vty_out (vty
, " Number of LSA %ld%s", area
->lsdb
->total
, VTY_NEWLINE
);
2471 vty_out (vty
, " Number of router LSA %ld. Checksum Sum 0x%08x%s",
2472 ospf_lsdb_count (area
->lsdb
, OSPF_ROUTER_LSA
),
2473 ospf_lsdb_checksum (area
->lsdb
, OSPF_ROUTER_LSA
), VTY_NEWLINE
);
2474 vty_out (vty
, " Number of network LSA %ld. Checksum Sum 0x%08x%s",
2475 ospf_lsdb_count (area
->lsdb
, OSPF_NETWORK_LSA
),
2476 ospf_lsdb_checksum (area
->lsdb
, OSPF_NETWORK_LSA
), VTY_NEWLINE
);
2477 vty_out (vty
, " Number of summary LSA %ld. Checksum Sum 0x%08x%s",
2478 ospf_lsdb_count (area
->lsdb
, OSPF_SUMMARY_LSA
),
2479 ospf_lsdb_checksum (area
->lsdb
, OSPF_SUMMARY_LSA
), VTY_NEWLINE
);
2480 vty_out (vty
, " Number of ASBR summary LSA %ld. Checksum Sum 0x%08x%s",
2481 ospf_lsdb_count (area
->lsdb
, OSPF_ASBR_SUMMARY_LSA
),
2482 ospf_lsdb_checksum (area
->lsdb
, OSPF_ASBR_SUMMARY_LSA
), VTY_NEWLINE
);
2483 vty_out (vty
, " Number of NSSA LSA %ld. Checksum Sum 0x%08x%s",
2484 ospf_lsdb_count (area
->lsdb
, OSPF_AS_NSSA_LSA
),
2485 ospf_lsdb_checksum (area
->lsdb
, OSPF_AS_NSSA_LSA
), VTY_NEWLINE
);
2486 #ifdef HAVE_OPAQUE_LSA
2487 vty_out (vty
, " Number of opaque link LSA %ld. Checksum Sum 0x%08x%s",
2488 ospf_lsdb_count (area
->lsdb
, OSPF_OPAQUE_LINK_LSA
),
2489 ospf_lsdb_checksum (area
->lsdb
, OSPF_OPAQUE_LINK_LSA
), VTY_NEWLINE
);
2490 vty_out (vty
, " Number of opaque area LSA %ld. Checksum Sum 0x%08x%s",
2491 ospf_lsdb_count (area
->lsdb
, OSPF_OPAQUE_AREA_LSA
),
2492 ospf_lsdb_checksum (area
->lsdb
, OSPF_OPAQUE_AREA_LSA
), VTY_NEWLINE
);
2493 #endif /* HAVE_OPAQUE_LSA */
2494 vty_out (vty
, "%s", VTY_NEWLINE
);
2497 DEFUN (show_ip_ospf
,
2502 "OSPF information\n")
2504 struct listnode
*node
, *nnode
;
2505 struct ospf_area
* area
;
2508 /* Check OSPF is enable. */
2509 ospf
= ospf_lookup ();
2512 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
2516 /* Show Router ID. */
2517 vty_out (vty
, " OSPF Routing Process, Router ID: %s%s",
2518 inet_ntoa (ospf
->router_id
),
2521 /* Show capability. */
2522 vty_out (vty
, " Supports only single TOS (TOS0) routes%s", VTY_NEWLINE
);
2523 vty_out (vty
, " This implementation conforms to RFC2328%s", VTY_NEWLINE
);
2524 vty_out (vty
, " RFC1583Compatibility flag is %s%s",
2525 CHECK_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
) ?
2526 "enabled" : "disabled", VTY_NEWLINE
);
2527 #ifdef HAVE_OPAQUE_LSA
2528 vty_out (vty
, " OpaqueCapability flag is %s%s%s",
2529 CHECK_FLAG (ospf
->config
, OSPF_OPAQUE_CAPABLE
) ?
2530 "enabled" : "disabled",
2531 IS_OPAQUE_LSA_ORIGINATION_BLOCKED (ospf
->opaque
) ?
2532 " (origination blocked)" : "",
2534 #endif /* HAVE_OPAQUE_LSA */
2536 /* Show SPF timers. */
2537 vty_out (vty
, " SPF schedule delay %d secs, Hold time between two SPFs %d secs%s",
2538 ospf
->spf_delay
, ospf
->spf_holdtime
, VTY_NEWLINE
);
2540 /* Show refresh parameters. */
2541 vty_out (vty
, " Refresh timer %d secs%s",
2542 ospf
->lsa_refresh_interval
, VTY_NEWLINE
);
2544 /* Show ABR/ASBR flags. */
2545 if (CHECK_FLAG (ospf
->flags
, OSPF_FLAG_ABR
))
2546 vty_out (vty
, " This router is an ABR, ABR type is: %s%s",
2547 ospf_abr_type_descr_str
[ospf
->abr_type
], VTY_NEWLINE
);
2549 if (CHECK_FLAG (ospf
->flags
, OSPF_FLAG_ASBR
))
2550 vty_out (vty
, " This router is an ASBR "
2551 "(injecting external routing information)%s", VTY_NEWLINE
);
2553 /* Show Number of AS-external-LSAs. */
2554 vty_out (vty
, " Number of external LSA %ld. Checksum Sum 0x%08x%s",
2555 ospf_lsdb_count (ospf
->lsdb
, OSPF_AS_EXTERNAL_LSA
),
2556 ospf_lsdb_checksum (ospf
->lsdb
, OSPF_AS_EXTERNAL_LSA
), VTY_NEWLINE
);
2557 #ifdef HAVE_OPAQUE_LSA
2558 vty_out (vty
, " Number of opaque AS LSA %ld. Checksum Sum 0x%08x%s",
2559 ospf_lsdb_count (ospf
->lsdb
, OSPF_OPAQUE_AS_LSA
),
2560 ospf_lsdb_checksum (ospf
->lsdb
, OSPF_OPAQUE_AS_LSA
), VTY_NEWLINE
);
2561 #endif /* HAVE_OPAQUE_LSA */
2562 /* Show number of areas attached. */
2563 vty_out (vty
, " Number of areas attached to this router: %d%s%s",
2564 listcount (ospf
->areas
), VTY_NEWLINE
, VTY_NEWLINE
);
2566 /* Show each area status. */
2567 for (ALL_LIST_ELEMENTS (ospf
->areas
, node
, nnode
, area
))
2568 show_ip_ospf_area (vty
, area
);
2575 show_ip_ospf_interface_sub (struct vty
*vty
, struct ospf
*ospf
,
2576 struct interface
*ifp
)
2579 struct ospf_neighbor
*nbr
;
2580 struct route_node
*rn
;
2583 /* Is interface up? */
2584 vty_out (vty
, "%s is %s%s", ifp
->name
,
2585 ((is_up
= if_is_operative(ifp
)) ? "up" : "down"), VTY_NEWLINE
);
2586 vty_out (vty
, " ifindex %u, MTU %u bytes, BW %u Kbit %s%s",
2587 ifp
->ifindex
, ifp
->mtu
, ifp
->bandwidth
, if_flag_dump(ifp
->flags
),
2590 /* Is interface OSPF enabled? */
2591 if (ospf_oi_count(ifp
) == 0)
2593 vty_out (vty
, " OSPF not enabled on this interface%s", VTY_NEWLINE
);
2598 vty_out (vty
, " OSPF is enabled, but not running on this interface%s",
2603 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
2605 struct ospf_interface
*oi
= rn
->info
;
2610 /* Show OSPF interface information. */
2611 vty_out (vty
, " Internet Address %s/%d,",
2612 inet_ntoa (oi
->address
->u
.prefix4
), oi
->address
->prefixlen
);
2614 if (oi
->connected
->destination
)
2615 vty_out (vty
, " %s %s,",
2616 ((ifp
->flags
& IFF_POINTOPOINT
) ? "Peer" : "Broadcast"),
2617 inet_ntoa (oi
->connected
->destination
->u
.prefix4
));
2619 vty_out (vty
, " Area %s%s", ospf_area_desc_string (oi
->area
),
2622 vty_out (vty
, " Router ID %s, Network Type %s, Cost: %d%s",
2623 inet_ntoa (ospf
->router_id
), ospf_network_type_str
[oi
->type
],
2624 oi
->output_cost
, VTY_NEWLINE
);
2626 vty_out (vty
, " Transmit Delay is %d sec, State %s, Priority %d%s",
2627 OSPF_IF_PARAM (oi
,transmit_delay
), LOOKUP (ospf_ism_state_msg
, oi
->state
),
2628 PRIORITY (oi
), VTY_NEWLINE
);
2630 /* Show DR information. */
2631 if (DR (oi
).s_addr
== 0)
2632 vty_out (vty
, " No designated router on this network%s", VTY_NEWLINE
);
2635 nbr
= ospf_nbr_lookup_by_addr (oi
->nbrs
, &DR (oi
));
2637 vty_out (vty
, " No designated router on this network%s", VTY_NEWLINE
);
2640 vty_out (vty
, " Designated Router (ID) %s,",
2641 inet_ntoa (nbr
->router_id
));
2642 vty_out (vty
, " Interface Address %s%s",
2643 inet_ntoa (nbr
->address
.u
.prefix4
), VTY_NEWLINE
);
2647 /* Show BDR information. */
2648 if (BDR (oi
).s_addr
== 0)
2649 vty_out (vty
, " No backup designated router on this network%s",
2653 nbr
= ospf_nbr_lookup_by_addr (oi
->nbrs
, &BDR (oi
));
2655 vty_out (vty
, " No backup designated router on this network%s",
2659 vty_out (vty
, " Backup Designated Router (ID) %s,",
2660 inet_ntoa (nbr
->router_id
));
2661 vty_out (vty
, " Interface Address %s%s",
2662 inet_ntoa (nbr
->address
.u
.prefix4
), VTY_NEWLINE
);
2666 vty_out (vty
, " Multicast group memberships:");
2667 if (CHECK_FLAG(oi
->multicast_memberships
, MEMBER_ALLROUTERS
))
2668 vty_out (vty
, " OSPFAllRouters");
2669 if (CHECK_FLAG(oi
->multicast_memberships
, MEMBER_DROUTERS
))
2670 vty_out (vty
, " OSPFDesignatedRouters");
2671 if (!CHECK_FLAG(oi
->multicast_memberships
,
2672 MEMBER_ALLROUTERS
|MEMBER_DROUTERS
))
2673 vty_out (vty
, " <None>");
2674 vty_out (vty
, "%s", VTY_NEWLINE
);
2676 vty_out (vty
, " Timer intervals configured,");
2677 vty_out (vty
, " Hello %d, Dead %d, Wait %d, Retransmit %d%s",
2678 OSPF_IF_PARAM (oi
, v_hello
), OSPF_IF_PARAM (oi
, v_wait
),
2679 OSPF_IF_PARAM (oi
, v_wait
),
2680 OSPF_IF_PARAM (oi
, retransmit_interval
),
2683 if (OSPF_IF_PARAM (oi
, passive_interface
) == OSPF_IF_ACTIVE
)
2684 vty_out (vty
, " Hello due in %s%s",
2685 ospf_timer_dump (oi
->t_hello
, buf
, 9), VTY_NEWLINE
);
2686 else /* OSPF_IF_PASSIVE is set */
2687 vty_out (vty
, " No Hellos (Passive interface)%s", VTY_NEWLINE
);
2689 vty_out (vty
, " Neighbor Count is %d, Adjacent neighbor count is %d%s",
2690 ospf_nbr_count (oi
, 0), ospf_nbr_count (oi
, NSM_Full
),
2695 DEFUN (show_ip_ospf_interface
,
2696 show_ip_ospf_interface_cmd
,
2697 "show ip ospf interface [INTERFACE]",
2700 "OSPF information\n"
2701 "Interface information\n"
2704 struct interface
*ifp
;
2706 struct listnode
*node
;
2708 ospf
= ospf_lookup ();
2710 /* Show All Interfaces. */
2712 for (ALL_LIST_ELEMENTS_RO (iflist
, node
, ifp
))
2713 show_ip_ospf_interface_sub (vty
, ospf
, ifp
);
2714 /* Interface name is specified. */
2717 if ((ifp
= if_lookup_by_name (argv
[0])) == NULL
)
2718 vty_out (vty
, "No such interface name%s", VTY_NEWLINE
);
2720 show_ip_ospf_interface_sub (vty
, ospf
, ifp
);
2727 show_ip_ospf_neighbor_sub (struct vty
*vty
, struct ospf_interface
*oi
)
2729 struct route_node
*rn
;
2730 struct ospf_neighbor
*nbr
;
2734 for (rn
= route_top (oi
->nbrs
); rn
; rn
= route_next (rn
))
2735 if ((nbr
= rn
->info
))
2736 /* Do not show myself. */
2737 if (nbr
!= oi
->nbr_self
)
2738 /* Down state is not shown. */
2739 if (nbr
->state
!= NSM_Down
)
2741 ospf_nbr_state_message (nbr
, msgbuf
, 16);
2743 if (nbr
->state
== NSM_Attempt
&& nbr
->router_id
.s_addr
== 0)
2744 vty_out (vty
, "%-15s %3d %-15s %8s ",
2746 msgbuf
, ospf_timer_dump (nbr
->t_inactivity
, timebuf
, 9));
2748 vty_out (vty
, "%-15s %3d %-15s %8s ",
2749 inet_ntoa (nbr
->router_id
), nbr
->priority
,
2750 msgbuf
, ospf_timer_dump (nbr
->t_inactivity
, timebuf
, 9));
2751 vty_out (vty
, "%-15s ", inet_ntoa (nbr
->src
));
2752 vty_out (vty
, "%-15s %5ld %5ld %5d%s",
2753 IF_NAME (oi
), ospf_ls_retransmit_count (nbr
),
2754 ospf_ls_request_count (nbr
), ospf_db_summary_count (nbr
),
2759 DEFUN (show_ip_ospf_neighbor
,
2760 show_ip_ospf_neighbor_cmd
,
2761 "show ip ospf neighbor",
2764 "OSPF information\n"
2768 struct ospf_interface
*oi
;
2769 struct listnode
*node
;
2771 ospf
= ospf_lookup ();
2774 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
2778 /* Show All neighbors. */
2779 vty_out (vty
, "%sNeighbor ID Pri State Dead "
2780 "Time Address Interface RXmtL "
2781 "RqstL DBsmL%s", VTY_NEWLINE
, VTY_NEWLINE
);
2783 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
2784 show_ip_ospf_neighbor_sub (vty
, oi
);
2789 DEFUN (show_ip_ospf_neighbor_all
,
2790 show_ip_ospf_neighbor_all_cmd
,
2791 "show ip ospf neighbor all",
2794 "OSPF information\n"
2796 "include down status neighbor\n")
2798 struct ospf
*ospf
= vty
->index
;
2799 struct listnode
*node
;
2800 struct ospf_interface
*oi
;
2804 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
2808 /* Show All neighbors. */
2809 vty_out (vty
, "%sNeighbor ID Pri State Dead "
2810 "Time Address Interface RXmtL "
2811 "RqstL DBsmL%s", VTY_NEWLINE
, VTY_NEWLINE
);
2813 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
2815 struct listnode
*nbr_node
;
2816 struct ospf_nbr_nbma
*nbr_nbma
;
2818 show_ip_ospf_neighbor_sub (vty
, oi
);
2820 /* print Down neighbor status */
2821 for (ALL_LIST_ELEMENTS_RO (oi
->nbr_nbma
, nbr_node
, nbr_nbma
))
2823 if (nbr_nbma
->nbr
== NULL
2824 || nbr_nbma
->nbr
->state
== NSM_Down
)
2826 vty_out (vty
, "%-15s %3d %-15s %8s ",
2827 "-", nbr_nbma
->priority
, "Down", "-");
2828 vty_out (vty
, "%-15s %-15s %5d %5d %5d%s",
2829 inet_ntoa (nbr_nbma
->addr
), IF_NAME (oi
),
2830 0, 0, 0, VTY_NEWLINE
);
2838 DEFUN (show_ip_ospf_neighbor_int
,
2839 show_ip_ospf_neighbor_int_cmd
,
2840 "show ip ospf neighbor A.B.C.D",
2843 "OSPF information\n"
2848 struct ospf_interface
*oi
;
2849 struct in_addr addr
;
2852 ret
= inet_aton (argv
[0], &addr
);
2855 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
2860 ospf
= ospf_lookup ();
2863 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
2867 if ((oi
= ospf_if_is_configured (ospf
, &addr
)) == NULL
)
2868 vty_out (vty
, "No such interface address%s", VTY_NEWLINE
);
2871 vty_out (vty
, "%sNeighbor ID Pri State Dead "
2872 "Time Address Interface RXmtL "
2873 "RqstL DBsmL%s", VTY_NEWLINE
, VTY_NEWLINE
);
2874 show_ip_ospf_neighbor_sub (vty
, oi
);
2881 show_ip_ospf_nbr_nbma_detail_sub (struct vty
*vty
, struct ospf_interface
*oi
,
2882 struct ospf_nbr_nbma
*nbr_nbma
)
2886 /* Show neighbor ID. */
2887 vty_out (vty
, " Neighbor %s,", "-");
2889 /* Show interface address. */
2890 vty_out (vty
, " interface address %s%s",
2891 inet_ntoa (nbr_nbma
->addr
), VTY_NEWLINE
);
2893 vty_out (vty
, " In the area %s via interface %s%s",
2894 ospf_area_desc_string (oi
->area
), IF_NAME (oi
), VTY_NEWLINE
);
2895 /* Show neighbor priority and state. */
2896 vty_out (vty
, " Neighbor priority is %d, State is %s,",
2897 nbr_nbma
->priority
, "Down");
2898 /* Show state changes. */
2899 vty_out (vty
, " %d state changes%s", nbr_nbma
->state_change
, VTY_NEWLINE
);
2901 /* Show PollInterval */
2902 vty_out (vty
, " Poll interval %d%s", nbr_nbma
->v_poll
, VTY_NEWLINE
);
2904 /* Show poll-interval timer. */
2905 vty_out (vty
, " Poll timer due in %s%s",
2906 ospf_timer_dump (nbr_nbma
->t_poll
, timebuf
, 9), VTY_NEWLINE
);
2908 /* Show poll-interval timer thread. */
2909 vty_out (vty
, " Thread Poll Timer %s%s",
2910 nbr_nbma
->t_poll
!= NULL
? "on" : "off", VTY_NEWLINE
);
2914 show_ip_ospf_neighbor_detail_sub (struct vty
*vty
, struct ospf_interface
*oi
,
2915 struct ospf_neighbor
*nbr
)
2919 /* Show neighbor ID. */
2920 if (nbr
->state
== NSM_Attempt
&& nbr
->router_id
.s_addr
== 0)
2921 vty_out (vty
, " Neighbor %s,", "-");
2923 vty_out (vty
, " Neighbor %s,", inet_ntoa (nbr
->router_id
));
2925 /* Show interface address. */
2926 vty_out (vty
, " interface address %s%s",
2927 inet_ntoa (nbr
->address
.u
.prefix4
), VTY_NEWLINE
);
2929 vty_out (vty
, " In the area %s via interface %s%s",
2930 ospf_area_desc_string (oi
->area
), oi
->ifp
->name
, VTY_NEWLINE
);
2931 /* Show neighbor priority and state. */
2932 vty_out (vty
, " Neighbor priority is %d, State is %s,",
2933 nbr
->priority
, LOOKUP (ospf_nsm_state_msg
, nbr
->state
));
2934 /* Show state changes. */
2935 vty_out (vty
, " %d state changes%s", nbr
->state_change
, VTY_NEWLINE
);
2937 /* Show Designated Rotuer ID. */
2938 vty_out (vty
, " DR is %s,", inet_ntoa (nbr
->d_router
));
2939 /* Show Backup Designated Rotuer ID. */
2940 vty_out (vty
, " BDR is %s%s", inet_ntoa (nbr
->bd_router
), VTY_NEWLINE
);
2942 vty_out (vty
, " Options %d %s%s", nbr
->options
,
2943 ospf_options_dump (nbr
->options
), VTY_NEWLINE
);
2944 /* Show Router Dead interval timer. */
2945 vty_out (vty
, " Dead timer due in %s%s",
2946 ospf_timer_dump (nbr
->t_inactivity
, timebuf
, 9), VTY_NEWLINE
);
2947 /* Show Database Summary list. */
2948 vty_out (vty
, " Database Summary List %d%s",
2949 ospf_db_summary_count (nbr
), VTY_NEWLINE
);
2950 /* Show Link State Request list. */
2951 vty_out (vty
, " Link State Request List %ld%s",
2952 ospf_ls_request_count (nbr
), VTY_NEWLINE
);
2953 /* Show Link State Retransmission list. */
2954 vty_out (vty
, " Link State Retransmission List %ld%s",
2955 ospf_ls_retransmit_count (nbr
), VTY_NEWLINE
);
2956 /* Show inactivity timer thread. */
2957 vty_out (vty
, " Thread Inactivity Timer %s%s",
2958 nbr
->t_inactivity
!= NULL
? "on" : "off", VTY_NEWLINE
);
2959 /* Show Database Description retransmission thread. */
2960 vty_out (vty
, " Thread Database Description Retransmision %s%s",
2961 nbr
->t_db_desc
!= NULL
? "on" : "off", VTY_NEWLINE
);
2962 /* Show Link State Request Retransmission thread. */
2963 vty_out (vty
, " Thread Link State Request Retransmission %s%s",
2964 nbr
->t_ls_req
!= NULL
? "on" : "off", VTY_NEWLINE
);
2965 /* Show Link State Update Retransmission thread. */
2966 vty_out (vty
, " Thread Link State Update Retransmission %s%s%s",
2967 nbr
->t_ls_upd
!= NULL
? "on" : "off", VTY_NEWLINE
, VTY_NEWLINE
);
2970 DEFUN (show_ip_ospf_neighbor_id
,
2971 show_ip_ospf_neighbor_id_cmd
,
2972 "show ip ospf neighbor A.B.C.D",
2975 "OSPF information\n"
2980 struct listnode
*node
;
2981 struct ospf_neighbor
*nbr
;
2982 struct ospf_interface
*oi
;
2983 struct in_addr router_id
;
2986 ret
= inet_aton (argv
[0], &router_id
);
2989 vty_out (vty
, "Please specify Neighbor ID by A.B.C.D%s", VTY_NEWLINE
);
2993 ospf
= ospf_lookup ();
2996 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
3000 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
3001 if ((nbr
= ospf_nbr_lookup_by_routerid (oi
->nbrs
, &router_id
)))
3003 show_ip_ospf_neighbor_detail_sub (vty
, oi
, nbr
);
3007 /* Nothing to show. */
3011 DEFUN (show_ip_ospf_neighbor_detail
,
3012 show_ip_ospf_neighbor_detail_cmd
,
3013 "show ip ospf neighbor detail",
3016 "OSPF information\n"
3018 "detail of all neighbors\n")
3021 struct ospf_interface
*oi
;
3022 struct listnode
*node
;
3024 ospf
= ospf_lookup ();
3027 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
3031 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
3033 struct route_node
*rn
;
3034 struct ospf_neighbor
*nbr
;
3036 for (rn
= route_top (oi
->nbrs
); rn
; rn
= route_next (rn
))
3037 if ((nbr
= rn
->info
))
3038 if (nbr
!= oi
->nbr_self
)
3039 if (nbr
->state
!= NSM_Down
)
3040 show_ip_ospf_neighbor_detail_sub (vty
, oi
, nbr
);
3046 DEFUN (show_ip_ospf_neighbor_detail_all
,
3047 show_ip_ospf_neighbor_detail_all_cmd
,
3048 "show ip ospf neighbor detail all",
3051 "OSPF information\n"
3053 "detail of all neighbors\n"
3054 "include down status neighbor\n")
3057 struct listnode
*node
;
3058 struct ospf_interface
*oi
;
3060 ospf
= ospf_lookup ();
3063 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
3067 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
3069 struct route_node
*rn
;
3070 struct ospf_neighbor
*nbr
;
3071 struct ospf_nbr_nbma
*nbr_nbma
;
3073 for (rn
= route_top (oi
->nbrs
); rn
; rn
= route_next (rn
))
3074 if ((nbr
= rn
->info
))
3075 if (nbr
!= oi
->nbr_self
)
3076 if (oi
->type
== OSPF_IFTYPE_NBMA
&& nbr
->state
!= NSM_Down
)
3077 show_ip_ospf_neighbor_detail_sub (vty
, oi
, rn
->info
);
3079 if (oi
->type
== OSPF_IFTYPE_NBMA
)
3081 struct listnode
*nd
;
3083 for (ALL_LIST_ELEMENTS_RO (oi
->nbr_nbma
, nd
, nbr_nbma
))
3084 if (nbr_nbma
->nbr
== NULL
3085 || nbr_nbma
->nbr
->state
== NSM_Down
)
3086 show_ip_ospf_nbr_nbma_detail_sub (vty
, oi
, nbr_nbma
);
3093 DEFUN (show_ip_ospf_neighbor_int_detail
,
3094 show_ip_ospf_neighbor_int_detail_cmd
,
3095 "show ip ospf neighbor A.B.C.D detail",
3098 "OSPF information\n"
3100 "Interface address\n"
3101 "detail of all neighbors")
3104 struct ospf_interface
*oi
;
3105 struct in_addr addr
;
3108 ret
= inet_aton (argv
[0], &addr
);
3111 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
3116 ospf
= ospf_lookup ();
3119 vty_out (vty
, " OSPF Routing Process not enabled%s", VTY_NEWLINE
);
3123 if ((oi
= ospf_if_is_configured (ospf
, &addr
)) == NULL
)
3124 vty_out (vty
, "No such interface address%s", VTY_NEWLINE
);
3127 struct route_node
*rn
;
3128 struct ospf_neighbor
*nbr
;
3130 for (rn
= route_top (oi
->nbrs
); rn
; rn
= route_next (rn
))
3131 if ((nbr
= rn
->info
))
3132 if (nbr
!= oi
->nbr_self
)
3133 if (nbr
->state
!= NSM_Down
)
3134 show_ip_ospf_neighbor_detail_sub (vty
, oi
, nbr
);
3141 /* Show functions */
3143 show_lsa_summary (struct vty
*vty
, struct ospf_lsa
*lsa
, int self
)
3145 struct router_lsa
*rl
;
3146 struct summary_lsa
*sl
;
3147 struct as_external_lsa
*asel
;
3148 struct prefix_ipv4 p
;
3151 /* If self option is set, check LSA self flag. */
3152 if (self
== 0 || IS_LSA_SELF (lsa
))
3154 /* LSA common part show. */
3155 vty_out (vty
, "%-15s ", inet_ntoa (lsa
->data
->id
));
3156 vty_out (vty
, "%-15s %4d 0x%08lx 0x%04x",
3157 inet_ntoa (lsa
->data
->adv_router
), LS_AGE (lsa
),
3158 (u_long
)ntohl (lsa
->data
->ls_seqnum
), ntohs (lsa
->data
->checksum
));
3159 /* LSA specific part show. */
3160 switch (lsa
->data
->type
)
3162 case OSPF_ROUTER_LSA
:
3163 rl
= (struct router_lsa
*) lsa
->data
;
3164 vty_out (vty
, " %-d", ntohs (rl
->links
));
3166 case OSPF_SUMMARY_LSA
:
3167 sl
= (struct summary_lsa
*) lsa
->data
;
3170 p
.prefix
= sl
->header
.id
;
3171 p
.prefixlen
= ip_masklen (sl
->mask
);
3172 apply_mask_ipv4 (&p
);
3174 vty_out (vty
, " %s/%d", inet_ntoa (p
.prefix
), p
.prefixlen
);
3176 case OSPF_AS_EXTERNAL_LSA
:
3177 case OSPF_AS_NSSA_LSA
:
3178 asel
= (struct as_external_lsa
*) lsa
->data
;
3181 p
.prefix
= asel
->header
.id
;
3182 p
.prefixlen
= ip_masklen (asel
->mask
);
3183 apply_mask_ipv4 (&p
);
3185 vty_out (vty
, " %s %s/%d [0x%lx]",
3186 IS_EXTERNAL_METRIC (asel
->e
[0].tos
) ? "E2" : "E1",
3187 inet_ntoa (p
.prefix
), p
.prefixlen
,
3188 (u_long
)ntohl (asel
->e
[0].route_tag
));
3190 case OSPF_NETWORK_LSA
:
3191 case OSPF_ASBR_SUMMARY_LSA
:
3192 #ifdef HAVE_OPAQUE_LSA
3193 case OSPF_OPAQUE_LINK_LSA
:
3194 case OSPF_OPAQUE_AREA_LSA
:
3195 case OSPF_OPAQUE_AS_LSA
:
3196 #endif /* HAVE_OPAQUE_LSA */
3200 vty_out (vty
, VTY_NEWLINE
);
3206 const char *show_database_desc
[] =
3209 "Router Link States",
3211 "Summary Link States",
3212 "ASBR-Summary Link States",
3213 "AS External Link States",
3214 "Group Membership LSA",
3215 "NSSA-external Link States",
3216 #ifdef HAVE_OPAQUE_LSA
3218 "Link-Local Opaque-LSA",
3219 "Area-Local Opaque-LSA",
3220 "AS-external Opaque-LSA",
3221 #endif /* HAVE_OPAQUE_LSA */
3224 #define SHOW_OSPF_COMMON_HEADER \
3225 "Link ID ADV Router Age Seq# CkSum"
3227 const char *show_database_header
[] =
3230 "Link ID ADV Router Age Seq# CkSum Link count",
3231 "Link ID ADV Router Age Seq# CkSum",
3232 "Link ID ADV Router Age Seq# CkSum Route",
3233 "Link ID ADV Router Age Seq# CkSum",
3234 "Link ID ADV Router Age Seq# CkSum Route",
3235 " --- header for Group Member ----",
3236 "Link ID ADV Router Age Seq# CkSum Route",
3237 #ifdef HAVE_OPAQUE_LSA
3239 "Opaque-Type/Id ADV Router Age Seq# CkSum",
3240 "Opaque-Type/Id ADV Router Age Seq# CkSum",
3241 "Opaque-Type/Id ADV Router Age Seq# CkSum",
3242 #endif /* HAVE_OPAQUE_LSA */
3245 const char *show_lsa_flags
[] =
3256 show_ip_ospf_database_header (struct vty
*vty
, struct ospf_lsa
*lsa
)
3258 struct router_lsa
*rlsa
= (struct router_lsa
*) lsa
->data
;
3260 vty_out (vty
, " LS age: %d%s", LS_AGE (lsa
), VTY_NEWLINE
);
3261 vty_out (vty
, " Options: 0x%-2x : %s%s",
3263 ospf_options_dump(lsa
->data
->options
),
3265 vty_out (vty
, " LS Flags: 0x%-2x %s%s",
3267 ((lsa
->flags
& OSPF_LSA_LOCAL_XLT
) ? "(Translated from Type-7)" : ""),
3270 if (lsa
->data
->type
== OSPF_ROUTER_LSA
)
3272 vty_out (vty
, " Flags: 0x%x" , rlsa
->flags
);
3275 vty_out (vty
, " :%s%s%s%s",
3276 IS_ROUTER_LSA_BORDER (rlsa
) ? " ABR" : "",
3277 IS_ROUTER_LSA_EXTERNAL (rlsa
) ? " ASBR" : "",
3278 IS_ROUTER_LSA_VIRTUAL (rlsa
) ? " VL-endpoint" : "",
3279 IS_ROUTER_LSA_SHORTCUT (rlsa
) ? " Shortcut" : "");
3281 vty_out (vty
, "%s", VTY_NEWLINE
);
3283 vty_out (vty
, " LS Type: %s%s",
3284 LOOKUP (ospf_lsa_type_msg
, lsa
->data
->type
), VTY_NEWLINE
);
3285 vty_out (vty
, " Link State ID: %s %s%s", inet_ntoa (lsa
->data
->id
),
3286 LOOKUP (ospf_link_state_id_type_msg
, lsa
->data
->type
), VTY_NEWLINE
);
3287 vty_out (vty
, " Advertising Router: %s%s",
3288 inet_ntoa (lsa
->data
->adv_router
), VTY_NEWLINE
);
3289 vty_out (vty
, " LS Seq Number: %08lx%s", (u_long
)ntohl (lsa
->data
->ls_seqnum
),
3291 vty_out (vty
, " Checksum: 0x%04x%s", ntohs (lsa
->data
->checksum
),
3293 vty_out (vty
, " Length: %d%s", ntohs (lsa
->data
->length
), VTY_NEWLINE
);
3296 const char *link_type_desc
[] =
3299 "another Router (point-to-point)",
3300 "a Transit Network",
3305 const char *link_id_desc
[] =
3308 "Neighboring Router ID",
3309 "Designated Router address",
3311 "Neighboring Router ID",
3314 const char *link_data_desc
[] =
3317 "Router Interface address",
3318 "Router Interface address",
3320 "Router Interface address",
3323 /* Show router-LSA each Link information. */
3325 show_ip_ospf_database_router_links (struct vty
*vty
,
3326 struct router_lsa
*rl
)
3330 len
= ntohs (rl
->header
.length
) - 4;
3331 for (i
= 0; i
< ntohs (rl
->links
) && len
> 0; len
-= 12, i
++)
3333 type
= rl
->link
[i
].type
;
3335 vty_out (vty
, " Link connected to: %s%s",
3336 link_type_desc
[type
], VTY_NEWLINE
);
3337 vty_out (vty
, " (Link ID) %s: %s%s", link_id_desc
[type
],
3338 inet_ntoa (rl
->link
[i
].link_id
), VTY_NEWLINE
);
3339 vty_out (vty
, " (Link Data) %s: %s%s", link_data_desc
[type
],
3340 inet_ntoa (rl
->link
[i
].link_data
), VTY_NEWLINE
);
3341 vty_out (vty
, " Number of TOS metrics: 0%s", VTY_NEWLINE
);
3342 vty_out (vty
, " TOS 0 Metric: %d%s",
3343 ntohs (rl
->link
[i
].metric
), VTY_NEWLINE
);
3344 vty_out (vty
, "%s", VTY_NEWLINE
);
3348 /* Show router-LSA detail information. */
3350 show_router_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3354 struct router_lsa
*rl
= (struct router_lsa
*) lsa
->data
;
3356 show_ip_ospf_database_header (vty
, lsa
);
3358 vty_out (vty
, " Number of Links: %d%s%s", ntohs (rl
->links
),
3359 VTY_NEWLINE
, VTY_NEWLINE
);
3361 show_ip_ospf_database_router_links (vty
, rl
);
3362 vty_out (vty
, "%s", VTY_NEWLINE
);
3368 /* Show network-LSA detail information. */
3370 show_network_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3376 struct network_lsa
*nl
= (struct network_lsa
*) lsa
->data
;
3378 show_ip_ospf_database_header (vty
, lsa
);
3380 vty_out (vty
, " Network Mask: /%d%s",
3381 ip_masklen (nl
->mask
), VTY_NEWLINE
);
3383 length
= ntohs (lsa
->data
->length
) - OSPF_LSA_HEADER_SIZE
- 4;
3385 for (i
= 0; length
> 0; i
++, length
-= 4)
3386 vty_out (vty
, " Attached Router: %s%s",
3387 inet_ntoa (nl
->routers
[i
]), VTY_NEWLINE
);
3389 vty_out (vty
, "%s", VTY_NEWLINE
);
3395 /* Show summary-LSA detail information. */
3397 show_summary_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3401 struct summary_lsa
*sl
= (struct summary_lsa
*) lsa
->data
;
3403 show_ip_ospf_database_header (vty
, lsa
);
3405 vty_out (vty
, " Network Mask: /%d%s", ip_masklen (sl
->mask
),
3407 vty_out (vty
, " TOS: 0 Metric: %d%s", GET_METRIC (sl
->metric
),
3409 vty_out (vty
, "%s", VTY_NEWLINE
);
3415 /* Show summary-ASBR-LSA detail information. */
3417 show_summary_asbr_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3421 struct summary_lsa
*sl
= (struct summary_lsa
*) lsa
->data
;
3423 show_ip_ospf_database_header (vty
, lsa
);
3425 vty_out (vty
, " Network Mask: /%d%s",
3426 ip_masklen (sl
->mask
), VTY_NEWLINE
);
3427 vty_out (vty
, " TOS: 0 Metric: %d%s", GET_METRIC (sl
->metric
),
3429 vty_out (vty
, "%s", VTY_NEWLINE
);
3435 /* Show AS-external-LSA detail information. */
3437 show_as_external_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3441 struct as_external_lsa
*al
= (struct as_external_lsa
*) lsa
->data
;
3443 show_ip_ospf_database_header (vty
, lsa
);
3445 vty_out (vty
, " Network Mask: /%d%s",
3446 ip_masklen (al
->mask
), VTY_NEWLINE
);
3447 vty_out (vty
, " Metric Type: %s%s",
3448 IS_EXTERNAL_METRIC (al
->e
[0].tos
) ?
3449 "2 (Larger than any link state path)" : "1", VTY_NEWLINE
);
3450 vty_out (vty
, " TOS: 0%s", VTY_NEWLINE
);
3451 vty_out (vty
, " Metric: %d%s",
3452 GET_METRIC (al
->e
[0].metric
), VTY_NEWLINE
);
3453 vty_out (vty
, " Forward Address: %s%s",
3454 inet_ntoa (al
->e
[0].fwd_addr
), VTY_NEWLINE
);
3456 vty_out (vty
, " External Route Tag: %lu%s%s",
3457 (u_long
)ntohl (al
->e
[0].route_tag
), VTY_NEWLINE
, VTY_NEWLINE
);
3463 /* N.B. This function currently seems to be unused. */
3465 show_as_external_lsa_stdvty (struct ospf_lsa
*lsa
)
3467 struct as_external_lsa
*al
= (struct as_external_lsa
*) lsa
->data
;
3469 /* show_ip_ospf_database_header (vty, lsa); */
3471 zlog_debug( " Network Mask: /%d%s",
3472 ip_masklen (al
->mask
), "\n");
3473 zlog_debug( " Metric Type: %s%s",
3474 IS_EXTERNAL_METRIC (al
->e
[0].tos
) ?
3475 "2 (Larger than any link state path)" : "1", "\n");
3476 zlog_debug( " TOS: 0%s", "\n");
3477 zlog_debug( " Metric: %d%s",
3478 GET_METRIC (al
->e
[0].metric
), "\n");
3479 zlog_debug( " Forward Address: %s%s",
3480 inet_ntoa (al
->e
[0].fwd_addr
), "\n");
3482 zlog_debug( " External Route Tag: %u%s%s",
3483 ntohl (al
->e
[0].route_tag
), "\n", "\n");
3488 /* Show AS-NSSA-LSA detail information. */
3490 show_as_nssa_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3494 struct as_external_lsa
*al
= (struct as_external_lsa
*) lsa
->data
;
3496 show_ip_ospf_database_header (vty
, lsa
);
3498 vty_out (vty
, " Network Mask: /%d%s",
3499 ip_masklen (al
->mask
), VTY_NEWLINE
);
3500 vty_out (vty
, " Metric Type: %s%s",
3501 IS_EXTERNAL_METRIC (al
->e
[0].tos
) ?
3502 "2 (Larger than any link state path)" : "1", VTY_NEWLINE
);
3503 vty_out (vty
, " TOS: 0%s", VTY_NEWLINE
);
3504 vty_out (vty
, " Metric: %d%s",
3505 GET_METRIC (al
->e
[0].metric
), VTY_NEWLINE
);
3506 vty_out (vty
, " NSSA: Forward Address: %s%s",
3507 inet_ntoa (al
->e
[0].fwd_addr
), VTY_NEWLINE
);
3509 vty_out (vty
, " External Route Tag: %u%s%s",
3510 ntohl (al
->e
[0].route_tag
), VTY_NEWLINE
, VTY_NEWLINE
);
3517 show_func_dummy (struct vty
*vty
, struct ospf_lsa
*lsa
)
3522 #ifdef HAVE_OPAQUE_LSA
3524 show_opaque_lsa_detail (struct vty
*vty
, struct ospf_lsa
*lsa
)
3528 show_ip_ospf_database_header (vty
, lsa
);
3529 show_opaque_info_detail (vty
, lsa
);
3531 vty_out (vty
, "%s", VTY_NEWLINE
);
3535 #endif /* HAVE_OPAQUE_LSA */
3537 int (*show_function
[])(struct vty
*, struct ospf_lsa
*) =
3540 show_router_lsa_detail
,
3541 show_network_lsa_detail
,
3542 show_summary_lsa_detail
,
3543 show_summary_asbr_lsa_detail
,
3544 show_as_external_lsa_detail
,
3546 show_as_nssa_lsa_detail
, /* almost same as external */
3547 #ifdef HAVE_OPAQUE_LSA
3549 show_opaque_lsa_detail
,
3550 show_opaque_lsa_detail
,
3551 show_opaque_lsa_detail
,
3552 #endif /* HAVE_OPAQUE_LSA */
3556 show_lsa_prefix_set (struct vty
*vty
, struct prefix_ls
*lp
, struct in_addr
*id
,
3557 struct in_addr
*adv_router
)
3559 memset (lp
, 0, sizeof (struct prefix_ls
));
3563 else if (adv_router
== NULL
)
3572 lp
->adv_router
= *adv_router
;
3577 show_lsa_detail_proc (struct vty
*vty
, struct route_table
*rt
,
3578 struct in_addr
*id
, struct in_addr
*adv_router
)
3580 struct prefix_ls lp
;
3581 struct route_node
*rn
, *start
;
3582 struct ospf_lsa
*lsa
;
3584 show_lsa_prefix_set (vty
, &lp
, id
, adv_router
);
3585 start
= route_node_get (rt
, (struct prefix
*) &lp
);
3588 route_lock_node (start
);
3589 for (rn
= start
; rn
; rn
= route_next_until (rn
, start
))
3590 if ((lsa
= rn
->info
))
3592 if (show_function
[lsa
->data
->type
] != NULL
)
3593 show_function
[lsa
->data
->type
] (vty
, lsa
);
3595 route_unlock_node (start
);
3599 /* Show detail LSA information
3600 -- if id is NULL then show all LSAs. */
3602 show_lsa_detail (struct vty
*vty
, struct ospf
*ospf
, int type
,
3603 struct in_addr
*id
, struct in_addr
*adv_router
)
3605 struct listnode
*node
;
3606 struct ospf_area
*area
;
3610 case OSPF_AS_EXTERNAL_LSA
:
3611 #ifdef HAVE_OPAQUE_LSA
3612 case OSPF_OPAQUE_AS_LSA
:
3613 #endif /* HAVE_OPAQUE_LSA */
3614 vty_out (vty
, " %s %s%s",
3615 show_database_desc
[type
],
3616 VTY_NEWLINE
, VTY_NEWLINE
);
3617 show_lsa_detail_proc (vty
, AS_LSDB (ospf
, type
), id
, adv_router
);
3620 for (ALL_LIST_ELEMENTS_RO (ospf
->areas
, node
, area
))
3622 vty_out (vty
, "%s %s (Area %s)%s%s",
3623 VTY_NEWLINE
, show_database_desc
[type
],
3624 ospf_area_desc_string (area
), VTY_NEWLINE
, VTY_NEWLINE
);
3625 show_lsa_detail_proc (vty
, AREA_LSDB (area
, type
), id
, adv_router
);
3632 show_lsa_detail_adv_router_proc (struct vty
*vty
, struct route_table
*rt
,
3633 struct in_addr
*adv_router
)
3635 struct route_node
*rn
;
3636 struct ospf_lsa
*lsa
;
3638 for (rn
= route_top (rt
); rn
; rn
= route_next (rn
))
3639 if ((lsa
= rn
->info
))
3640 if (IPV4_ADDR_SAME (adv_router
, &lsa
->data
->adv_router
))
3642 if (CHECK_FLAG (lsa
->flags
, OSPF_LSA_LOCAL_XLT
))
3644 if (show_function
[lsa
->data
->type
] != NULL
)
3645 show_function
[lsa
->data
->type
] (vty
, lsa
);
3649 /* Show detail LSA information. */
3651 show_lsa_detail_adv_router (struct vty
*vty
, struct ospf
*ospf
, int type
,
3652 struct in_addr
*adv_router
)
3654 struct listnode
*node
;
3655 struct ospf_area
*area
;
3659 case OSPF_AS_EXTERNAL_LSA
:
3660 #ifdef HAVE_OPAQUE_LSA
3661 case OSPF_OPAQUE_AS_LSA
:
3662 #endif /* HAVE_OPAQUE_LSA */
3663 vty_out (vty
, " %s %s%s",
3664 show_database_desc
[type
],
3665 VTY_NEWLINE
, VTY_NEWLINE
);
3666 show_lsa_detail_adv_router_proc (vty
, AS_LSDB (ospf
, type
),
3670 for (ALL_LIST_ELEMENTS_RO (ospf
->areas
, node
, area
))
3672 vty_out (vty
, "%s %s (Area %s)%s%s",
3673 VTY_NEWLINE
, show_database_desc
[type
],
3674 ospf_area_desc_string (area
), VTY_NEWLINE
, VTY_NEWLINE
);
3675 show_lsa_detail_adv_router_proc (vty
, AREA_LSDB (area
, type
),
3683 show_ip_ospf_database_summary (struct vty
*vty
, struct ospf
*ospf
, int self
)
3685 struct ospf_lsa
*lsa
;
3686 struct route_node
*rn
;
3687 struct ospf_area
*area
;
3688 struct listnode
*node
;
3691 for (ALL_LIST_ELEMENTS_RO (ospf
->areas
, node
, area
))
3693 for (type
= OSPF_MIN_LSA
; type
< OSPF_MAX_LSA
; type
++)
3697 case OSPF_AS_EXTERNAL_LSA
:
3698 #ifdef HAVE_OPAQUE_LSA
3699 case OSPF_OPAQUE_AS_LSA
:
3700 #endif /* HAVE_OPAQUE_LSA */
3705 if (ospf_lsdb_count_self (area
->lsdb
, type
) > 0 ||
3706 (!self
&& ospf_lsdb_count (area
->lsdb
, type
) > 0))
3708 vty_out (vty
, " %s (Area %s)%s%s",
3709 show_database_desc
[type
],
3710 ospf_area_desc_string (area
),
3711 VTY_NEWLINE
, VTY_NEWLINE
);
3712 vty_out (vty
, "%s%s", show_database_header
[type
], VTY_NEWLINE
);
3714 LSDB_LOOP (AREA_LSDB (area
, type
), rn
, lsa
)
3715 show_lsa_summary (vty
, lsa
, self
);
3717 vty_out (vty
, "%s", VTY_NEWLINE
);
3722 for (type
= OSPF_MIN_LSA
; type
< OSPF_MAX_LSA
; type
++)
3726 case OSPF_AS_EXTERNAL_LSA
:
3727 #ifdef HAVE_OPAQUE_LSA
3728 case OSPF_OPAQUE_AS_LSA
:
3729 #endif /* HAVE_OPAQUE_LSA */
3734 if (ospf_lsdb_count_self (ospf
->lsdb
, type
) ||
3735 (!self
&& ospf_lsdb_count (ospf
->lsdb
, type
)))
3737 vty_out (vty
, " %s%s%s",
3738 show_database_desc
[type
],
3739 VTY_NEWLINE
, VTY_NEWLINE
);
3740 vty_out (vty
, "%s%s", show_database_header
[type
],
3743 LSDB_LOOP (AS_LSDB (ospf
, type
), rn
, lsa
)
3744 show_lsa_summary (vty
, lsa
, self
);
3746 vty_out (vty
, "%s", VTY_NEWLINE
);
3750 vty_out (vty
, "%s", VTY_NEWLINE
);
3754 show_ip_ospf_database_maxage (struct vty
*vty
, struct ospf
*ospf
)
3756 struct listnode
*node
;
3757 struct ospf_lsa
*lsa
;
3759 vty_out (vty
, "%s MaxAge Link States:%s%s",
3760 VTY_NEWLINE
, VTY_NEWLINE
, VTY_NEWLINE
);
3762 for (ALL_LIST_ELEMENTS_RO (ospf
->maxage_lsa
, node
, lsa
))
3764 vty_out (vty
, "Link type: %d%s", lsa
->data
->type
, VTY_NEWLINE
);
3765 vty_out (vty
, "Link State ID: %s%s",
3766 inet_ntoa (lsa
->data
->id
), VTY_NEWLINE
);
3767 vty_out (vty
, "Advertising Router: %s%s",
3768 inet_ntoa (lsa
->data
->adv_router
), VTY_NEWLINE
);
3769 vty_out (vty
, "LSA lock count: %d%s", lsa
->lock
, VTY_NEWLINE
);
3770 vty_out (vty
, "%s", VTY_NEWLINE
);
3774 #define OSPF_LSA_TYPE_NSSA_DESC "NSSA external link state\n"
3775 #define OSPF_LSA_TYPE_NSSA_CMD_STR "|nssa-external"
3777 #ifdef HAVE_OPAQUE_LSA
3778 #define OSPF_LSA_TYPE_OPAQUE_LINK_DESC "Link local Opaque-LSA\n"
3779 #define OSPF_LSA_TYPE_OPAQUE_AREA_DESC "Link area Opaque-LSA\n"
3780 #define OSPF_LSA_TYPE_OPAQUE_AS_DESC "Link AS Opaque-LSA\n"
3781 #define OSPF_LSA_TYPE_OPAQUE_CMD_STR "|opaque-link|opaque-area|opaque-as"
3782 #else /* HAVE_OPAQUE_LSA */
3783 #define OSPF_LSA_TYPE_OPAQUE_LINK_DESC ""
3784 #define OSPF_LSA_TYPE_OPAQUE_AREA_DESC ""
3785 #define OSPF_LSA_TYPE_OPAQUE_AS_DESC ""
3786 #define OSPF_LSA_TYPE_OPAQUE_CMD_STR ""
3787 #endif /* HAVE_OPAQUE_LSA */
3789 #define OSPF_LSA_TYPES_CMD_STR \
3790 "asbr-summary|external|network|router|summary" \
3791 OSPF_LSA_TYPE_NSSA_CMD_STR \
3792 OSPF_LSA_TYPE_OPAQUE_CMD_STR
3794 #define OSPF_LSA_TYPES_DESC \
3795 "ASBR summary link states\n" \
3796 "External link states\n" \
3797 "Network link states\n" \
3798 "Router link states\n" \
3799 "Network summary link states\n" \
3800 OSPF_LSA_TYPE_NSSA_DESC \
3801 OSPF_LSA_TYPE_OPAQUE_LINK_DESC \
3802 OSPF_LSA_TYPE_OPAQUE_AREA_DESC \
3803 OSPF_LSA_TYPE_OPAQUE_AS_DESC
3805 DEFUN (show_ip_ospf_database
,
3806 show_ip_ospf_database_cmd
,
3807 "show ip ospf database",
3810 "OSPF information\n"
3811 "Database summary\n")
3815 struct in_addr id
, adv_router
;
3817 ospf
= ospf_lookup ();
3821 vty_out (vty
, "%s OSPF Router with ID (%s)%s%s", VTY_NEWLINE
,
3822 inet_ntoa (ospf
->router_id
), VTY_NEWLINE
, VTY_NEWLINE
);
3827 show_ip_ospf_database_summary (vty
, ospf
, 0);
3831 /* Set database type to show. */
3832 if (strncmp (argv
[0], "r", 1) == 0)
3833 type
= OSPF_ROUTER_LSA
;
3834 else if (strncmp (argv
[0], "ne", 2) == 0)
3835 type
= OSPF_NETWORK_LSA
;
3836 else if (strncmp (argv
[0], "ns", 2) == 0)
3837 type
= OSPF_AS_NSSA_LSA
;
3838 else if (strncmp (argv
[0], "su", 2) == 0)
3839 type
= OSPF_SUMMARY_LSA
;
3840 else if (strncmp (argv
[0], "a", 1) == 0)
3841 type
= OSPF_ASBR_SUMMARY_LSA
;
3842 else if (strncmp (argv
[0], "e", 1) == 0)
3843 type
= OSPF_AS_EXTERNAL_LSA
;
3844 else if (strncmp (argv
[0], "se", 2) == 0)
3846 show_ip_ospf_database_summary (vty
, ospf
, 1);
3849 else if (strncmp (argv
[0], "m", 1) == 0)
3851 show_ip_ospf_database_maxage (vty
, ospf
);
3854 #ifdef HAVE_OPAQUE_LSA
3855 else if (strncmp (argv
[0], "opaque-l", 8) == 0)
3856 type
= OSPF_OPAQUE_LINK_LSA
;
3857 else if (strncmp (argv
[0], "opaque-ar", 9) == 0)
3858 type
= OSPF_OPAQUE_AREA_LSA
;
3859 else if (strncmp (argv
[0], "opaque-as", 9) == 0)
3860 type
= OSPF_OPAQUE_AS_LSA
;
3861 #endif /* HAVE_OPAQUE_LSA */
3865 /* `show ip ospf database LSA'. */
3867 show_lsa_detail (vty
, ospf
, type
, NULL
, NULL
);
3870 ret
= inet_aton (argv
[1], &id
);
3874 /* `show ip ospf database LSA ID'. */
3876 show_lsa_detail (vty
, ospf
, type
, &id
, NULL
);
3877 /* `show ip ospf database LSA ID adv-router ADV_ROUTER'. */
3880 if (strncmp (argv
[2], "s", 1) == 0)
3881 adv_router
= ospf
->router_id
;
3884 ret
= inet_aton (argv
[2], &adv_router
);
3888 show_lsa_detail (vty
, ospf
, type
, &id
, &adv_router
);
3895 ALIAS (show_ip_ospf_database
,
3896 show_ip_ospf_database_type_cmd
,
3897 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
"|max-age|self-originate)",
3900 "OSPF information\n"
3901 "Database summary\n"
3903 "LSAs in MaxAge list\n"
3904 "Self-originated link states\n")
3906 ALIAS (show_ip_ospf_database
,
3907 show_ip_ospf_database_type_id_cmd
,
3908 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
") A.B.C.D",
3911 "OSPF information\n"
3912 "Database summary\n"
3914 "Link State ID (as an IP address)\n")
3916 ALIAS (show_ip_ospf_database
,
3917 show_ip_ospf_database_type_id_adv_router_cmd
,
3918 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
") A.B.C.D adv-router A.B.C.D",
3921 "OSPF information\n"
3922 "Database summary\n"
3924 "Link State ID (as an IP address)\n"
3925 "Advertising Router link states\n"
3926 "Advertising Router (as an IP address)\n")
3928 ALIAS (show_ip_ospf_database
,
3929 show_ip_ospf_database_type_id_self_cmd
,
3930 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
") A.B.C.D (self-originate|)",
3933 "OSPF information\n"
3934 "Database summary\n"
3936 "Link State ID (as an IP address)\n"
3937 "Self-originated link states\n"
3940 DEFUN (show_ip_ospf_database_type_adv_router
,
3941 show_ip_ospf_database_type_adv_router_cmd
,
3942 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
") adv-router A.B.C.D",
3945 "OSPF information\n"
3946 "Database summary\n"
3948 "Advertising Router link states\n"
3949 "Advertising Router (as an IP address)\n")
3953 struct in_addr adv_router
;
3955 ospf
= ospf_lookup ();
3959 vty_out (vty
, "%s OSPF Router with ID (%s)%s%s", VTY_NEWLINE
,
3960 inet_ntoa (ospf
->router_id
), VTY_NEWLINE
, VTY_NEWLINE
);
3965 /* Set database type to show. */
3966 if (strncmp (argv
[0], "r", 1) == 0)
3967 type
= OSPF_ROUTER_LSA
;
3968 else if (strncmp (argv
[0], "ne", 2) == 0)
3969 type
= OSPF_NETWORK_LSA
;
3970 else if (strncmp (argv
[0], "ns", 2) == 0)
3971 type
= OSPF_AS_NSSA_LSA
;
3972 else if (strncmp (argv
[0], "s", 1) == 0)
3973 type
= OSPF_SUMMARY_LSA
;
3974 else if (strncmp (argv
[0], "a", 1) == 0)
3975 type
= OSPF_ASBR_SUMMARY_LSA
;
3976 else if (strncmp (argv
[0], "e", 1) == 0)
3977 type
= OSPF_AS_EXTERNAL_LSA
;
3978 #ifdef HAVE_OPAQUE_LSA
3979 else if (strncmp (argv
[0], "opaque-l", 8) == 0)
3980 type
= OSPF_OPAQUE_LINK_LSA
;
3981 else if (strncmp (argv
[0], "opaque-ar", 9) == 0)
3982 type
= OSPF_OPAQUE_AREA_LSA
;
3983 else if (strncmp (argv
[0], "opaque-as", 9) == 0)
3984 type
= OSPF_OPAQUE_AS_LSA
;
3985 #endif /* HAVE_OPAQUE_LSA */
3989 /* `show ip ospf database LSA adv-router ADV_ROUTER'. */
3990 if (strncmp (argv
[1], "s", 1) == 0)
3991 adv_router
= ospf
->router_id
;
3994 ret
= inet_aton (argv
[1], &adv_router
);
3999 show_lsa_detail_adv_router (vty
, ospf
, type
, &adv_router
);
4004 ALIAS (show_ip_ospf_database_type_adv_router
,
4005 show_ip_ospf_database_type_self_cmd
,
4006 "show ip ospf database (" OSPF_LSA_TYPES_CMD_STR
") (self-originate|)",
4009 "OSPF information\n"
4010 "Database summary\n"
4012 "Self-originated link states\n")
4015 DEFUN (ip_ospf_authentication_args
,
4016 ip_ospf_authentication_args_addr_cmd
,
4017 "ip ospf authentication (null|message-digest) A.B.C.D",
4019 "OSPF interface commands\n"
4020 "Enable authentication on this interface\n"
4021 "Use null authentication\n"
4022 "Use message-digest authentication\n"
4023 "Address of interface")
4025 struct interface
*ifp
;
4026 struct in_addr addr
;
4028 struct ospf_if_params
*params
;
4031 params
= IF_DEF_PARAMS (ifp
);
4035 ret
= inet_aton(argv
[1], &addr
);
4038 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4043 params
= ospf_get_if_params (ifp
, addr
);
4044 ospf_if_update_params (ifp
, addr
);
4047 /* Handle null authentication */
4048 if ( argv
[0][0] == 'n' )
4050 SET_IF_PARAM (params
, auth_type
);
4051 params
->auth_type
= OSPF_AUTH_NULL
;
4055 /* Handle message-digest authentication */
4056 if ( argv
[0][0] == 'm' )
4058 SET_IF_PARAM (params
, auth_type
);
4059 params
->auth_type
= OSPF_AUTH_CRYPTOGRAPHIC
;
4063 vty_out (vty
, "You shouldn't get here!%s", VTY_NEWLINE
);
4067 ALIAS (ip_ospf_authentication_args
,
4068 ip_ospf_authentication_args_cmd
,
4069 "ip ospf authentication (null|message-digest)",
4071 "OSPF interface commands\n"
4072 "Enable authentication on this interface\n"
4073 "Use null authentication\n"
4074 "Use message-digest authentication\n")
4076 DEFUN (ip_ospf_authentication
,
4077 ip_ospf_authentication_addr_cmd
,
4078 "ip ospf authentication A.B.C.D",
4080 "OSPF interface commands\n"
4081 "Enable authentication on this interface\n"
4082 "Address of interface")
4084 struct interface
*ifp
;
4085 struct in_addr addr
;
4087 struct ospf_if_params
*params
;
4090 params
= IF_DEF_PARAMS (ifp
);
4094 ret
= inet_aton(argv
[1], &addr
);
4097 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4102 params
= ospf_get_if_params (ifp
, addr
);
4103 ospf_if_update_params (ifp
, addr
);
4106 SET_IF_PARAM (params
, auth_type
);
4107 params
->auth_type
= OSPF_AUTH_SIMPLE
;
4112 ALIAS (ip_ospf_authentication
,
4113 ip_ospf_authentication_cmd
,
4114 "ip ospf authentication",
4116 "OSPF interface commands\n"
4117 "Enable authentication on this interface\n")
4119 DEFUN (no_ip_ospf_authentication
,
4120 no_ip_ospf_authentication_addr_cmd
,
4121 "no ip ospf authentication A.B.C.D",
4124 "OSPF interface commands\n"
4125 "Enable authentication on this interface\n"
4126 "Address of interface")
4128 struct interface
*ifp
;
4129 struct in_addr addr
;
4131 struct ospf_if_params
*params
;
4134 params
= IF_DEF_PARAMS (ifp
);
4138 ret
= inet_aton(argv
[1], &addr
);
4141 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4146 params
= ospf_lookup_if_params (ifp
, addr
);
4151 params
->auth_type
= OSPF_AUTH_NOTSET
;
4152 UNSET_IF_PARAM (params
, auth_type
);
4154 if (params
!= IF_DEF_PARAMS (ifp
))
4156 ospf_free_if_params (ifp
, addr
);
4157 ospf_if_update_params (ifp
, addr
);
4163 ALIAS (no_ip_ospf_authentication
,
4164 no_ip_ospf_authentication_cmd
,
4165 "no ip ospf authentication",
4168 "OSPF interface commands\n"
4169 "Enable authentication on this interface\n")
4171 DEFUN (ip_ospf_authentication_key
,
4172 ip_ospf_authentication_key_addr_cmd
,
4173 "ip ospf authentication-key AUTH_KEY A.B.C.D",
4175 "OSPF interface commands\n"
4176 "Authentication password (key)\n"
4177 "The OSPF password (key)\n"
4178 "Address of interface")
4180 struct interface
*ifp
;
4181 struct in_addr addr
;
4183 struct ospf_if_params
*params
;
4186 params
= IF_DEF_PARAMS (ifp
);
4190 ret
= inet_aton(argv
[1], &addr
);
4193 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4198 params
= ospf_get_if_params (ifp
, addr
);
4199 ospf_if_update_params (ifp
, addr
);
4203 memset (params
->auth_simple
, 0, OSPF_AUTH_SIMPLE_SIZE
+ 1);
4204 strncpy ((char *) params
->auth_simple
, argv
[0], OSPF_AUTH_SIMPLE_SIZE
);
4205 SET_IF_PARAM (params
, auth_simple
);
4210 ALIAS (ip_ospf_authentication_key
,
4211 ip_ospf_authentication_key_cmd
,
4212 "ip ospf authentication-key AUTH_KEY",
4214 "OSPF interface commands\n"
4215 "Authentication password (key)\n"
4216 "The OSPF password (key)")
4218 ALIAS (ip_ospf_authentication_key
,
4219 ospf_authentication_key_cmd
,
4220 "ospf authentication-key AUTH_KEY",
4221 "OSPF interface commands\n"
4222 "Authentication password (key)\n"
4223 "The OSPF password (key)")
4225 DEFUN (no_ip_ospf_authentication_key
,
4226 no_ip_ospf_authentication_key_addr_cmd
,
4227 "no ip ospf authentication-key A.B.C.D",
4230 "OSPF interface commands\n"
4231 "Authentication password (key)\n"
4232 "Address of interface")
4234 struct interface
*ifp
;
4235 struct in_addr addr
;
4237 struct ospf_if_params
*params
;
4240 params
= IF_DEF_PARAMS (ifp
);
4244 ret
= inet_aton(argv
[1], &addr
);
4247 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4252 params
= ospf_lookup_if_params (ifp
, addr
);
4257 memset (params
->auth_simple
, 0, OSPF_AUTH_SIMPLE_SIZE
);
4258 UNSET_IF_PARAM (params
, auth_simple
);
4260 if (params
!= IF_DEF_PARAMS (ifp
))
4262 ospf_free_if_params (ifp
, addr
);
4263 ospf_if_update_params (ifp
, addr
);
4269 ALIAS (no_ip_ospf_authentication_key
,
4270 no_ip_ospf_authentication_key_cmd
,
4271 "no ip ospf authentication-key",
4274 "OSPF interface commands\n"
4275 "Authentication password (key)\n")
4277 ALIAS (no_ip_ospf_authentication_key
,
4278 no_ospf_authentication_key_cmd
,
4279 "no ospf authentication-key",
4281 "OSPF interface commands\n"
4282 "Authentication password (key)\n")
4284 DEFUN (ip_ospf_message_digest_key
,
4285 ip_ospf_message_digest_key_addr_cmd
,
4286 "ip ospf message-digest-key <1-255> md5 KEY A.B.C.D",
4288 "OSPF interface commands\n"
4289 "Message digest authentication password (key)\n"
4291 "Use MD5 algorithm\n"
4292 "The OSPF password (key)"
4293 "Address of interface")
4295 struct interface
*ifp
;
4296 struct crypt_key
*ck
;
4298 struct in_addr addr
;
4300 struct ospf_if_params
*params
;
4303 params
= IF_DEF_PARAMS (ifp
);
4307 ret
= inet_aton(argv
[2], &addr
);
4310 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4315 params
= ospf_get_if_params (ifp
, addr
);
4316 ospf_if_update_params (ifp
, addr
);
4319 key_id
= strtol (argv
[0], NULL
, 10);
4320 if (ospf_crypt_key_lookup (params
->auth_crypt
, key_id
) != NULL
)
4322 vty_out (vty
, "OSPF: Key %d already exists%s", key_id
, VTY_NEWLINE
);
4326 ck
= ospf_crypt_key_new ();
4327 ck
->key_id
= (u_char
) key_id
;
4328 memset (ck
->auth_key
, 0, OSPF_AUTH_MD5_SIZE
+1);
4329 strncpy ((char *) ck
->auth_key
, argv
[1], OSPF_AUTH_MD5_SIZE
);
4331 ospf_crypt_key_add (params
->auth_crypt
, ck
);
4332 SET_IF_PARAM (params
, auth_crypt
);
4337 ALIAS (ip_ospf_message_digest_key
,
4338 ip_ospf_message_digest_key_cmd
,
4339 "ip ospf message-digest-key <1-255> md5 KEY",
4341 "OSPF interface commands\n"
4342 "Message digest authentication password (key)\n"
4344 "Use MD5 algorithm\n"
4345 "The OSPF password (key)")
4347 ALIAS (ip_ospf_message_digest_key
,
4348 ospf_message_digest_key_cmd
,
4349 "ospf message-digest-key <1-255> md5 KEY",
4350 "OSPF interface commands\n"
4351 "Message digest authentication password (key)\n"
4353 "Use MD5 algorithm\n"
4354 "The OSPF password (key)")
4356 DEFUN (no_ip_ospf_message_digest_key
,
4357 no_ip_ospf_message_digest_key_addr_cmd
,
4358 "no ip ospf message-digest-key <1-255> A.B.C.D",
4361 "OSPF interface commands\n"
4362 "Message digest authentication password (key)\n"
4364 "Address of interface")
4366 struct interface
*ifp
;
4367 struct crypt_key
*ck
;
4369 struct in_addr addr
;
4371 struct ospf_if_params
*params
;
4374 params
= IF_DEF_PARAMS (ifp
);
4378 ret
= inet_aton(argv
[1], &addr
);
4381 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4386 params
= ospf_lookup_if_params (ifp
, addr
);
4391 key_id
= strtol (argv
[0], NULL
, 10);
4392 ck
= ospf_crypt_key_lookup (params
->auth_crypt
, key_id
);
4395 vty_out (vty
, "OSPF: Key %d does not exist%s", key_id
, VTY_NEWLINE
);
4399 ospf_crypt_key_delete (params
->auth_crypt
, key_id
);
4401 if (params
!= IF_DEF_PARAMS (ifp
))
4403 ospf_free_if_params (ifp
, addr
);
4404 ospf_if_update_params (ifp
, addr
);
4410 ALIAS (no_ip_ospf_message_digest_key
,
4411 no_ip_ospf_message_digest_key_cmd
,
4412 "no ip ospf message-digest-key <1-255>",
4415 "OSPF interface commands\n"
4416 "Message digest authentication password (key)\n"
4419 ALIAS (no_ip_ospf_message_digest_key
,
4420 no_ospf_message_digest_key_cmd
,
4421 "no ospf message-digest-key <1-255>",
4423 "OSPF interface commands\n"
4424 "Message digest authentication password (key)\n"
4427 DEFUN (ip_ospf_cost
,
4428 ip_ospf_cost_addr_cmd
,
4429 "ip ospf cost <1-65535> A.B.C.D",
4431 "OSPF interface commands\n"
4434 "Address of interface")
4436 struct interface
*ifp
= vty
->index
;
4438 struct in_addr addr
;
4440 struct ospf_if_params
*params
;
4442 params
= IF_DEF_PARAMS (ifp
);
4444 cost
= strtol (argv
[0], NULL
, 10);
4446 /* cost range is <1-65535>. */
4447 if (cost
< 1 || cost
> 65535)
4449 vty_out (vty
, "Interface output cost is invalid%s", VTY_NEWLINE
);
4455 ret
= inet_aton(argv
[1], &addr
);
4458 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4463 params
= ospf_get_if_params (ifp
, addr
);
4464 ospf_if_update_params (ifp
, addr
);
4467 SET_IF_PARAM (params
, output_cost_cmd
);
4468 params
->output_cost_cmd
= cost
;
4470 ospf_if_recalculate_output_cost (ifp
);
4475 ALIAS (ip_ospf_cost
,
4477 "ip ospf cost <1-65535>",
4479 "OSPF interface commands\n"
4483 ALIAS (ip_ospf_cost
,
4485 "ospf cost <1-65535>",
4486 "OSPF interface commands\n"
4490 DEFUN (no_ip_ospf_cost
,
4491 no_ip_ospf_cost_addr_cmd
,
4492 "no ip ospf cost A.B.C.D",
4495 "OSPF interface commands\n"
4497 "Address of interface")
4499 struct interface
*ifp
= vty
->index
;
4500 struct in_addr addr
;
4502 struct ospf_if_params
*params
;
4505 params
= IF_DEF_PARAMS (ifp
);
4509 ret
= inet_aton(argv
[0], &addr
);
4512 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4517 params
= ospf_lookup_if_params (ifp
, addr
);
4522 UNSET_IF_PARAM (params
, output_cost_cmd
);
4524 if (params
!= IF_DEF_PARAMS (ifp
))
4526 ospf_free_if_params (ifp
, addr
);
4527 ospf_if_update_params (ifp
, addr
);
4530 ospf_if_recalculate_output_cost (ifp
);
4535 ALIAS (no_ip_ospf_cost
,
4536 no_ip_ospf_cost_cmd
,
4540 "OSPF interface commands\n"
4543 ALIAS (no_ip_ospf_cost
,
4547 "OSPF interface commands\n"
4551 ospf_nbr_timer_update (struct ospf_interface
*oi
)
4553 struct route_node
*rn
;
4554 struct ospf_neighbor
*nbr
;
4556 for (rn
= route_top (oi
->nbrs
); rn
; rn
= route_next (rn
))
4557 if ((nbr
= rn
->info
))
4559 nbr
->v_inactivity
= OSPF_IF_PARAM (oi
, v_wait
);
4560 nbr
->v_db_desc
= OSPF_IF_PARAM (oi
, retransmit_interval
);
4561 nbr
->v_ls_req
= OSPF_IF_PARAM (oi
, retransmit_interval
);
4562 nbr
->v_ls_upd
= OSPF_IF_PARAM (oi
, retransmit_interval
);
4566 DEFUN (ip_ospf_dead_interval
,
4567 ip_ospf_dead_interval_addr_cmd
,
4568 "ip ospf dead-interval <1-65535> A.B.C.D",
4570 "OSPF interface commands\n"
4571 "Interval after which a neighbor is declared dead\n"
4573 "Address of interface")
4575 struct interface
*ifp
= vty
->index
;
4577 struct in_addr addr
;
4579 struct ospf_if_params
*params
;
4580 struct ospf_interface
*oi
;
4581 struct route_node
*rn
;
4584 ospf
= ospf_lookup ();
4586 params
= IF_DEF_PARAMS (ifp
);
4588 seconds
= strtol (argv
[0], NULL
, 10);
4590 /* dead_interval range is <1-65535>. */
4591 if (seconds
< 1 || seconds
> 65535)
4593 vty_out (vty
, "Router Dead Interval is invalid%s", VTY_NEWLINE
);
4599 ret
= inet_aton(argv
[1], &addr
);
4602 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4607 params
= ospf_get_if_params (ifp
, addr
);
4608 ospf_if_update_params (ifp
, addr
);
4611 SET_IF_PARAM (params
, v_wait
);
4612 params
->v_wait
= seconds
;
4614 /* Update timer values in neighbor structure. */
4619 oi
= ospf_if_lookup_by_local_addr (ospf
, ifp
, addr
);
4621 ospf_nbr_timer_update (oi
);
4626 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
4627 if ((oi
= rn
->info
))
4628 ospf_nbr_timer_update (oi
);
4634 ALIAS (ip_ospf_dead_interval
,
4635 ip_ospf_dead_interval_cmd
,
4636 "ip ospf dead-interval <1-65535>",
4638 "OSPF interface commands\n"
4639 "Interval after which a neighbor is declared dead\n"
4642 ALIAS (ip_ospf_dead_interval
,
4643 ospf_dead_interval_cmd
,
4644 "ospf dead-interval <1-65535>",
4645 "OSPF interface commands\n"
4646 "Interval after which a neighbor is declared dead\n"
4649 DEFUN (no_ip_ospf_dead_interval
,
4650 no_ip_ospf_dead_interval_addr_cmd
,
4651 "no ip ospf dead-interval A.B.C.D",
4654 "OSPF interface commands\n"
4655 "Interval after which a neighbor is declared dead\n"
4656 "Address of interface")
4658 struct interface
*ifp
= vty
->index
;
4659 struct in_addr addr
;
4661 struct ospf_if_params
*params
;
4662 struct ospf_interface
*oi
;
4663 struct route_node
*rn
;
4666 ospf
= ospf_lookup ();
4669 params
= IF_DEF_PARAMS (ifp
);
4673 ret
= inet_aton(argv
[0], &addr
);
4676 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4681 params
= ospf_lookup_if_params (ifp
, addr
);
4686 UNSET_IF_PARAM (params
, v_wait
);
4687 params
->v_wait
= OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
;
4689 if (params
!= IF_DEF_PARAMS (ifp
))
4691 ospf_free_if_params (ifp
, addr
);
4692 ospf_if_update_params (ifp
, addr
);
4695 /* Update timer values in neighbor structure. */
4700 oi
= ospf_if_lookup_by_local_addr (ospf
, ifp
, addr
);
4702 ospf_nbr_timer_update (oi
);
4707 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
4708 if ((oi
= rn
->info
))
4709 ospf_nbr_timer_update (oi
);
4715 ALIAS (no_ip_ospf_dead_interval
,
4716 no_ip_ospf_dead_interval_cmd
,
4717 "no ip ospf dead-interval",
4720 "OSPF interface commands\n"
4721 "Interval after which a neighbor is declared dead\n")
4723 ALIAS (no_ip_ospf_dead_interval
,
4724 no_ospf_dead_interval_cmd
,
4725 "no ospf dead-interval",
4727 "OSPF interface commands\n"
4728 "Interval after which a neighbor is declared dead\n")
4730 DEFUN (ip_ospf_hello_interval
,
4731 ip_ospf_hello_interval_addr_cmd
,
4732 "ip ospf hello-interval <1-65535> A.B.C.D",
4734 "OSPF interface commands\n"
4735 "Time between HELLO packets\n"
4737 "Address of interface")
4739 struct interface
*ifp
= vty
->index
;
4741 struct in_addr addr
;
4743 struct ospf_if_params
*params
;
4745 params
= IF_DEF_PARAMS (ifp
);
4747 seconds
= strtol (argv
[0], NULL
, 10);
4749 /* HelloInterval range is <1-65535>. */
4750 if (seconds
< 1 || seconds
> 65535)
4752 vty_out (vty
, "Hello Interval is invalid%s", VTY_NEWLINE
);
4758 ret
= inet_aton(argv
[1], &addr
);
4761 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4766 params
= ospf_get_if_params (ifp
, addr
);
4767 ospf_if_update_params (ifp
, addr
);
4770 SET_IF_PARAM (params
, v_hello
);
4771 params
->v_hello
= seconds
;
4776 ALIAS (ip_ospf_hello_interval
,
4777 ip_ospf_hello_interval_cmd
,
4778 "ip ospf hello-interval <1-65535>",
4780 "OSPF interface commands\n"
4781 "Time between HELLO packets\n"
4784 ALIAS (ip_ospf_hello_interval
,
4785 ospf_hello_interval_cmd
,
4786 "ospf hello-interval <1-65535>",
4787 "OSPF interface commands\n"
4788 "Time between HELLO packets\n"
4791 DEFUN (no_ip_ospf_hello_interval
,
4792 no_ip_ospf_hello_interval_addr_cmd
,
4793 "no ip ospf hello-interval A.B.C.D",
4796 "OSPF interface commands\n"
4797 "Time between HELLO packets\n"
4798 "Address of interface")
4800 struct interface
*ifp
= vty
->index
;
4801 struct in_addr addr
;
4803 struct ospf_if_params
*params
;
4806 params
= IF_DEF_PARAMS (ifp
);
4810 ret
= inet_aton(argv
[0], &addr
);
4813 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4818 params
= ospf_lookup_if_params (ifp
, addr
);
4823 UNSET_IF_PARAM (params
, v_hello
);
4824 params
->v_hello
= OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
;
4826 if (params
!= IF_DEF_PARAMS (ifp
))
4828 ospf_free_if_params (ifp
, addr
);
4829 ospf_if_update_params (ifp
, addr
);
4835 ALIAS (no_ip_ospf_hello_interval
,
4836 no_ip_ospf_hello_interval_cmd
,
4837 "no ip ospf hello-interval",
4840 "OSPF interface commands\n"
4841 "Time between HELLO packets\n")
4843 ALIAS (no_ip_ospf_hello_interval
,
4844 no_ospf_hello_interval_cmd
,
4845 "no ospf hello-interval",
4847 "OSPF interface commands\n"
4848 "Time between HELLO packets\n")
4850 DEFUN (ip_ospf_network
,
4851 ip_ospf_network_cmd
,
4852 "ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)",
4854 "OSPF interface commands\n"
4856 "Specify OSPF broadcast multi-access network\n"
4857 "Specify OSPF NBMA network\n"
4858 "Specify OSPF point-to-multipoint network\n"
4859 "Specify OSPF point-to-point network\n")
4861 struct interface
*ifp
= vty
->index
;
4862 int old_type
= IF_DEF_PARAMS (ifp
)->type
;
4863 struct route_node
*rn
;
4865 if (strncmp (argv
[0], "b", 1) == 0)
4866 IF_DEF_PARAMS (ifp
)->type
= OSPF_IFTYPE_BROADCAST
;
4867 else if (strncmp (argv
[0], "n", 1) == 0)
4868 IF_DEF_PARAMS (ifp
)->type
= OSPF_IFTYPE_NBMA
;
4869 else if (strncmp (argv
[0], "point-to-m", 10) == 0)
4870 IF_DEF_PARAMS (ifp
)->type
= OSPF_IFTYPE_POINTOMULTIPOINT
;
4871 else if (strncmp (argv
[0], "point-to-p", 10) == 0)
4872 IF_DEF_PARAMS (ifp
)->type
= OSPF_IFTYPE_POINTOPOINT
;
4874 if (IF_DEF_PARAMS (ifp
)->type
== old_type
)
4877 SET_IF_PARAM (IF_DEF_PARAMS (ifp
), type
);
4879 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
4881 struct ospf_interface
*oi
= rn
->info
;
4886 oi
->type
= IF_DEF_PARAMS (ifp
)->type
;
4888 if (oi
->state
> ISM_Down
)
4890 OSPF_ISM_EVENT_EXECUTE (oi
, ISM_InterfaceDown
);
4891 OSPF_ISM_EVENT_EXECUTE (oi
, ISM_InterfaceUp
);
4898 ALIAS (ip_ospf_network
,
4900 "ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)",
4901 "OSPF interface commands\n"
4903 "Specify OSPF broadcast multi-access network\n"
4904 "Specify OSPF NBMA network\n"
4905 "Specify OSPF point-to-multipoint network\n"
4906 "Specify OSPF point-to-point network\n")
4908 DEFUN (no_ip_ospf_network
,
4909 no_ip_ospf_network_cmd
,
4910 "no ip ospf network",
4913 "OSPF interface commands\n"
4916 struct interface
*ifp
= vty
->index
;
4917 int old_type
= IF_DEF_PARAMS (ifp
)->type
;
4918 struct route_node
*rn
;
4920 IF_DEF_PARAMS (ifp
)->type
= ospf_default_iftype(ifp
);
4922 if (IF_DEF_PARAMS (ifp
)->type
== old_type
)
4925 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
4927 struct ospf_interface
*oi
= rn
->info
;
4932 oi
->type
= IF_DEF_PARAMS (ifp
)->type
;
4934 if (oi
->state
> ISM_Down
)
4936 OSPF_ISM_EVENT_EXECUTE (oi
, ISM_InterfaceDown
);
4937 OSPF_ISM_EVENT_EXECUTE (oi
, ISM_InterfaceUp
);
4944 ALIAS (no_ip_ospf_network
,
4945 no_ospf_network_cmd
,
4948 "OSPF interface commands\n"
4951 DEFUN (ip_ospf_priority
,
4952 ip_ospf_priority_addr_cmd
,
4953 "ip ospf priority <0-255> A.B.C.D",
4955 "OSPF interface commands\n"
4958 "Address of interface")
4960 struct interface
*ifp
= vty
->index
;
4962 struct route_node
*rn
;
4963 struct in_addr addr
;
4965 struct ospf_if_params
*params
;
4967 params
= IF_DEF_PARAMS (ifp
);
4969 priority
= strtol (argv
[0], NULL
, 10);
4971 /* Router Priority range is <0-255>. */
4972 if (priority
< 0 || priority
> 255)
4974 vty_out (vty
, "Router Priority is invalid%s", VTY_NEWLINE
);
4980 ret
= inet_aton(argv
[1], &addr
);
4983 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
4988 params
= ospf_get_if_params (ifp
, addr
);
4989 ospf_if_update_params (ifp
, addr
);
4992 SET_IF_PARAM (params
, priority
);
4993 params
->priority
= priority
;
4995 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
4997 struct ospf_interface
*oi
= rn
->info
;
5003 if (PRIORITY (oi
) != OSPF_IF_PARAM (oi
, priority
))
5005 PRIORITY (oi
) = OSPF_IF_PARAM (oi
, priority
);
5006 OSPF_ISM_EVENT_SCHEDULE (oi
, ISM_NeighborChange
);
5013 ALIAS (ip_ospf_priority
,
5014 ip_ospf_priority_cmd
,
5015 "ip ospf priority <0-255>",
5017 "OSPF interface commands\n"
5021 ALIAS (ip_ospf_priority
,
5023 "ospf priority <0-255>",
5024 "OSPF interface commands\n"
5028 DEFUN (no_ip_ospf_priority
,
5029 no_ip_ospf_priority_addr_cmd
,
5030 "no ip ospf priority A.B.C.D",
5033 "OSPF interface commands\n"
5035 "Address of interface")
5037 struct interface
*ifp
= vty
->index
;
5038 struct route_node
*rn
;
5039 struct in_addr addr
;
5041 struct ospf_if_params
*params
;
5044 params
= IF_DEF_PARAMS (ifp
);
5048 ret
= inet_aton(argv
[0], &addr
);
5051 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
5056 params
= ospf_lookup_if_params (ifp
, addr
);
5061 UNSET_IF_PARAM (params
, priority
);
5062 params
->priority
= OSPF_ROUTER_PRIORITY_DEFAULT
;
5064 if (params
!= IF_DEF_PARAMS (ifp
))
5066 ospf_free_if_params (ifp
, addr
);
5067 ospf_if_update_params (ifp
, addr
);
5070 for (rn
= route_top (IF_OIFS (ifp
)); rn
; rn
= route_next (rn
))
5072 struct ospf_interface
*oi
= rn
->info
;
5078 if (PRIORITY (oi
) != OSPF_IF_PARAM (oi
, priority
))
5080 PRIORITY (oi
) = OSPF_IF_PARAM (oi
, priority
);
5081 OSPF_ISM_EVENT_SCHEDULE (oi
, ISM_NeighborChange
);
5088 ALIAS (no_ip_ospf_priority
,
5089 no_ip_ospf_priority_cmd
,
5090 "no ip ospf priority",
5093 "OSPF interface commands\n"
5094 "Router priority\n")
5096 ALIAS (no_ip_ospf_priority
,
5097 no_ospf_priority_cmd
,
5100 "OSPF interface commands\n"
5101 "Router priority\n")
5103 DEFUN (ip_ospf_retransmit_interval
,
5104 ip_ospf_retransmit_interval_addr_cmd
,
5105 "ip ospf retransmit-interval <3-65535> A.B.C.D",
5107 "OSPF interface commands\n"
5108 "Time between retransmitting lost link state advertisements\n"
5110 "Address of interface")
5112 struct interface
*ifp
= vty
->index
;
5114 struct in_addr addr
;
5116 struct ospf_if_params
*params
;
5118 params
= IF_DEF_PARAMS (ifp
);
5119 seconds
= strtol (argv
[0], NULL
, 10);
5121 /* Retransmit Interval range is <3-65535>. */
5122 if (seconds
< 3 || seconds
> 65535)
5124 vty_out (vty
, "Retransmit Interval is invalid%s", VTY_NEWLINE
);
5131 ret
= inet_aton(argv
[1], &addr
);
5134 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
5139 params
= ospf_get_if_params (ifp
, addr
);
5140 ospf_if_update_params (ifp
, addr
);
5143 SET_IF_PARAM (params
, retransmit_interval
);
5144 params
->retransmit_interval
= seconds
;
5149 ALIAS (ip_ospf_retransmit_interval
,
5150 ip_ospf_retransmit_interval_cmd
,
5151 "ip ospf retransmit-interval <3-65535>",
5153 "OSPF interface commands\n"
5154 "Time between retransmitting lost link state advertisements\n"
5157 ALIAS (ip_ospf_retransmit_interval
,
5158 ospf_retransmit_interval_cmd
,
5159 "ospf retransmit-interval <3-65535>",
5160 "OSPF interface commands\n"
5161 "Time between retransmitting lost link state advertisements\n"
5164 DEFUN (no_ip_ospf_retransmit_interval
,
5165 no_ip_ospf_retransmit_interval_addr_cmd
,
5166 "no ip ospf retransmit-interval A.B.C.D",
5169 "OSPF interface commands\n"
5170 "Time between retransmitting lost link state advertisements\n"
5171 "Address of interface")
5173 struct interface
*ifp
= vty
->index
;
5174 struct in_addr addr
;
5176 struct ospf_if_params
*params
;
5179 params
= IF_DEF_PARAMS (ifp
);
5183 ret
= inet_aton(argv
[0], &addr
);
5186 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
5191 params
= ospf_lookup_if_params (ifp
, addr
);
5196 UNSET_IF_PARAM (params
, retransmit_interval
);
5197 params
->retransmit_interval
= OSPF_RETRANSMIT_INTERVAL_DEFAULT
;
5199 if (params
!= IF_DEF_PARAMS (ifp
))
5201 ospf_free_if_params (ifp
, addr
);
5202 ospf_if_update_params (ifp
, addr
);
5208 ALIAS (no_ip_ospf_retransmit_interval
,
5209 no_ip_ospf_retransmit_interval_cmd
,
5210 "no ip ospf retransmit-interval",
5213 "OSPF interface commands\n"
5214 "Time between retransmitting lost link state advertisements\n")
5216 ALIAS (no_ip_ospf_retransmit_interval
,
5217 no_ospf_retransmit_interval_cmd
,
5218 "no ospf retransmit-interval",
5220 "OSPF interface commands\n"
5221 "Time between retransmitting lost link state advertisements\n")
5223 DEFUN (ip_ospf_transmit_delay
,
5224 ip_ospf_transmit_delay_addr_cmd
,
5225 "ip ospf transmit-delay <1-65535> A.B.C.D",
5227 "OSPF interface commands\n"
5228 "Link state transmit delay\n"
5230 "Address of interface")
5232 struct interface
*ifp
= vty
->index
;
5234 struct in_addr addr
;
5236 struct ospf_if_params
*params
;
5238 params
= IF_DEF_PARAMS (ifp
);
5239 seconds
= strtol (argv
[0], NULL
, 10);
5241 /* Transmit Delay range is <1-65535>. */
5242 if (seconds
< 1 || seconds
> 65535)
5244 vty_out (vty
, "Transmit Delay is invalid%s", VTY_NEWLINE
);
5250 ret
= inet_aton(argv
[1], &addr
);
5253 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
5258 params
= ospf_get_if_params (ifp
, addr
);
5259 ospf_if_update_params (ifp
, addr
);
5262 SET_IF_PARAM (params
, transmit_delay
);
5263 params
->transmit_delay
= seconds
;
5268 ALIAS (ip_ospf_transmit_delay
,
5269 ip_ospf_transmit_delay_cmd
,
5270 "ip ospf transmit-delay <1-65535>",
5272 "OSPF interface commands\n"
5273 "Link state transmit delay\n"
5276 ALIAS (ip_ospf_transmit_delay
,
5277 ospf_transmit_delay_cmd
,
5278 "ospf transmit-delay <1-65535>",
5279 "OSPF interface commands\n"
5280 "Link state transmit delay\n"
5283 DEFUN (no_ip_ospf_transmit_delay
,
5284 no_ip_ospf_transmit_delay_addr_cmd
,
5285 "no ip ospf transmit-delay A.B.C.D",
5288 "OSPF interface commands\n"
5289 "Link state transmit delay\n"
5290 "Address of interface")
5292 struct interface
*ifp
= vty
->index
;
5293 struct in_addr addr
;
5295 struct ospf_if_params
*params
;
5298 params
= IF_DEF_PARAMS (ifp
);
5302 ret
= inet_aton(argv
[0], &addr
);
5305 vty_out (vty
, "Please specify interface address by A.B.C.D%s",
5310 params
= ospf_lookup_if_params (ifp
, addr
);
5315 UNSET_IF_PARAM (params
, transmit_delay
);
5316 params
->transmit_delay
= OSPF_TRANSMIT_DELAY_DEFAULT
;
5318 if (params
!= IF_DEF_PARAMS (ifp
))
5320 ospf_free_if_params (ifp
, addr
);
5321 ospf_if_update_params (ifp
, addr
);
5327 ALIAS (no_ip_ospf_transmit_delay
,
5328 no_ip_ospf_transmit_delay_cmd
,
5329 "no ip ospf transmit-delay",
5332 "OSPF interface commands\n"
5333 "Link state transmit delay\n")
5335 ALIAS (no_ip_ospf_transmit_delay
,
5336 no_ospf_transmit_delay_cmd
,
5337 "no ospf transmit-delay",
5339 "OSPF interface commands\n"
5340 "Link state transmit delay\n")
5343 DEFUN (ospf_redistribute_source_metric_type
,
5344 ospf_redistribute_source_metric_type_routemap_cmd
,
5345 "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2) route-map WORD",
5346 "Redistribute information from another routing protocol\n"
5350 "Routing Information Protocol (RIP)\n"
5351 "Border Gateway Protocol (BGP)\n"
5352 "Metric for redistributed routes\n"
5353 "OSPF default metric\n"
5354 "OSPF exterior metric type for redistributed routes\n"
5355 "Set OSPF External Type 1 metrics\n"
5356 "Set OSPF External Type 2 metrics\n"
5357 "Route map reference\n"
5358 "Pointer to route-map entries\n")
5360 struct ospf
*ospf
= vty
->index
;
5365 /* Get distribute source. */
5366 if (!str2distribute_source (argv
[0], &source
))
5369 /* Get metric value. */
5371 if (!str2metric (argv
[1], &metric
))
5374 /* Get metric type. */
5376 if (!str2metric_type (argv
[2], &type
))
5380 ospf_routemap_set (ospf
, source
, argv
[3]);
5382 ospf_routemap_unset (ospf
, source
);
5384 return ospf_redistribute_set (ospf
, source
, type
, metric
);
5387 ALIAS (ospf_redistribute_source_metric_type
,
5388 ospf_redistribute_source_metric_type_cmd
,
5389 "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2)",
5390 "Redistribute information from another routing protocol\n"
5394 "Routing Information Protocol (RIP)\n"
5395 "Border Gateway Protocol (BGP)\n"
5396 "Metric for redistributed routes\n"
5397 "OSPF default metric\n"
5398 "OSPF exterior metric type for redistributed routes\n"
5399 "Set OSPF External Type 1 metrics\n"
5400 "Set OSPF External Type 2 metrics\n")
5402 ALIAS (ospf_redistribute_source_metric_type
,
5403 ospf_redistribute_source_metric_cmd
,
5404 "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214>",
5405 "Redistribute information from another routing protocol\n"
5409 "Routing Information Protocol (RIP)\n"
5410 "Border Gateway Protocol (BGP)\n"
5411 "Metric for redistributed routes\n"
5412 "OSPF default metric\n")
5414 DEFUN (ospf_redistribute_source_type_metric
,
5415 ospf_redistribute_source_type_metric_routemap_cmd
,
5416 "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214> route-map WORD",
5417 "Redistribute information from another routing protocol\n"
5421 "Routing Information Protocol (RIP)\n"
5422 "Border Gateway Protocol (BGP)\n"
5423 "OSPF exterior metric type for redistributed routes\n"
5424 "Set OSPF External Type 1 metrics\n"
5425 "Set OSPF External Type 2 metrics\n"
5426 "Metric for redistributed routes\n"
5427 "OSPF default metric\n"
5428 "Route map reference\n"
5429 "Pointer to route-map entries\n")
5431 struct ospf
*ospf
= vty
->index
;
5436 /* Get distribute source. */
5437 if (!str2distribute_source (argv
[0], &source
))
5440 /* Get metric value. */
5442 if (!str2metric_type (argv
[1], &type
))
5445 /* Get metric type. */
5447 if (!str2metric (argv
[2], &metric
))
5451 ospf_routemap_set (ospf
, source
, argv
[3]);
5453 ospf_routemap_unset (ospf
, source
);
5455 return ospf_redistribute_set (ospf
, source
, type
, metric
);
5458 ALIAS (ospf_redistribute_source_type_metric
,
5459 ospf_redistribute_source_type_metric_cmd
,
5460 "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214>",
5461 "Redistribute information from another routing protocol\n"
5465 "Routing Information Protocol (RIP)\n"
5466 "Border Gateway Protocol (BGP)\n"
5467 "OSPF exterior metric type for redistributed routes\n"
5468 "Set OSPF External Type 1 metrics\n"
5469 "Set OSPF External Type 2 metrics\n"
5470 "Metric for redistributed routes\n"
5471 "OSPF default metric\n")
5473 ALIAS (ospf_redistribute_source_type_metric
,
5474 ospf_redistribute_source_type_cmd
,
5475 "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)",
5476 "Redistribute information from another routing protocol\n"
5480 "Routing Information Protocol (RIP)\n"
5481 "Border Gateway Protocol (BGP)\n"
5482 "OSPF exterior metric type for redistributed routes\n"
5483 "Set OSPF External Type 1 metrics\n"
5484 "Set OSPF External Type 2 metrics\n")
5486 ALIAS (ospf_redistribute_source_type_metric
,
5487 ospf_redistribute_source_cmd
,
5488 "redistribute (kernel|connected|static|rip|bgp)",
5489 "Redistribute information from another routing protocol\n"
5493 "Routing Information Protocol (RIP)\n"
5494 "Border Gateway Protocol (BGP)\n")
5496 DEFUN (ospf_redistribute_source_metric_routemap
,
5497 ospf_redistribute_source_metric_routemap_cmd
,
5498 "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> route-map WORD",
5499 "Redistribute information from another routing protocol\n"
5503 "Routing Information Protocol (RIP)\n"
5504 "Border Gateway Protocol (BGP)\n"
5505 "Metric for redistributed routes\n"
5506 "OSPF default metric\n"
5507 "Route map reference\n"
5508 "Pointer to route-map entries\n")
5510 struct ospf
*ospf
= vty
->index
;
5514 /* Get distribute source. */
5515 if (!str2distribute_source (argv
[0], &source
))
5518 /* Get metric value. */
5520 if (!str2metric (argv
[1], &metric
))
5524 ospf_routemap_set (ospf
, source
, argv
[2]);
5526 ospf_routemap_unset (ospf
, source
);
5528 return ospf_redistribute_set (ospf
, source
, -1, metric
);
5531 DEFUN (ospf_redistribute_source_type_routemap
,
5532 ospf_redistribute_source_type_routemap_cmd
,
5533 "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map WORD",
5534 "Redistribute information from another routing protocol\n"
5538 "Routing Information Protocol (RIP)\n"
5539 "Border Gateway Protocol (BGP)\n"
5540 "OSPF exterior metric type for redistributed routes\n"
5541 "Set OSPF External Type 1 metrics\n"
5542 "Set OSPF External Type 2 metrics\n"
5543 "Route map reference\n"
5544 "Pointer to route-map entries\n")
5546 struct ospf
*ospf
= vty
->index
;
5550 /* Get distribute source. */
5551 if (!str2distribute_source (argv
[0], &source
))
5554 /* Get metric value. */
5556 if (!str2metric_type (argv
[1], &type
))
5560 ospf_routemap_set (ospf
, source
, argv
[2]);
5562 ospf_routemap_unset (ospf
, source
);
5564 return ospf_redistribute_set (ospf
, source
, type
, -1);
5567 DEFUN (ospf_redistribute_source_routemap
,
5568 ospf_redistribute_source_routemap_cmd
,
5569 "redistribute (kernel|connected|static|rip|bgp) route-map WORD",
5570 "Redistribute information from another routing protocol\n"
5574 "Routing Information Protocol (RIP)\n"
5575 "Border Gateway Protocol (BGP)\n"
5576 "Route map reference\n"
5577 "Pointer to route-map entries\n")
5579 struct ospf
*ospf
= vty
->index
;
5582 /* Get distribute source. */
5583 if (!str2distribute_source (argv
[0], &source
))
5587 ospf_routemap_set (ospf
, source
, argv
[1]);
5589 ospf_routemap_unset (ospf
, source
);
5591 return ospf_redistribute_set (ospf
, source
, -1, -1);
5594 DEFUN (no_ospf_redistribute_source
,
5595 no_ospf_redistribute_source_cmd
,
5596 "no redistribute (kernel|connected|static|rip|bgp)",
5598 "Redistribute information from another routing protocol\n"
5602 "Routing Information Protocol (RIP)\n"
5603 "Border Gateway Protocol (BGP)\n")
5605 struct ospf
*ospf
= vty
->index
;
5608 if (!str2distribute_source (argv
[0], &source
))
5611 ospf_routemap_unset (ospf
, source
);
5612 return ospf_redistribute_unset (ospf
, source
);
5615 DEFUN (ospf_distribute_list_out
,
5616 ospf_distribute_list_out_cmd
,
5617 "distribute-list WORD out (kernel|connected|static|rip|bgp)",
5618 "Filter networks in routing updates\n"
5619 "Access-list name\n"
5624 "Routing Information Protocol (RIP)\n"
5625 "Border Gateway Protocol (BGP)\n")
5627 struct ospf
*ospf
= vty
->index
;
5630 /* Get distribute source. */
5631 if (!str2distribute_source (argv
[1], &source
))
5634 return ospf_distribute_list_out_set (ospf
, source
, argv
[0]);
5637 DEFUN (no_ospf_distribute_list_out
,
5638 no_ospf_distribute_list_out_cmd
,
5639 "no distribute-list WORD out (kernel|connected|static|rip|bgp)",
5641 "Filter networks in routing updates\n"
5642 "Access-list name\n"
5647 "Routing Information Protocol (RIP)\n"
5648 "Border Gateway Protocol (BGP)\n")
5650 struct ospf
*ospf
= vty
->index
;
5653 if (!str2distribute_source (argv
[1], &source
))
5656 return ospf_distribute_list_out_unset (ospf
, source
, argv
[0]);
5659 /* Default information originate. */
5660 DEFUN (ospf_default_information_originate_metric_type_routemap
,
5661 ospf_default_information_originate_metric_type_routemap_cmd
,
5662 "default-information originate metric <0-16777214> metric-type (1|2) route-map WORD",
5663 "Control distribution of default information\n"
5664 "Distribute a default route\n"
5665 "OSPF default metric\n"
5667 "OSPF metric type for default routes\n"
5668 "Set OSPF External Type 1 metrics\n"
5669 "Set OSPF External Type 2 metrics\n"
5670 "Route map reference\n"
5671 "Pointer to route-map entries\n")
5673 struct ospf
*ospf
= vty
->index
;
5677 /* Get metric value. */
5679 if (!str2metric (argv
[0], &metric
))
5682 /* Get metric type. */
5684 if (!str2metric_type (argv
[1], &type
))
5688 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[2]);
5690 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5692 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ZEBRA
,
5696 ALIAS (ospf_default_information_originate_metric_type_routemap
,
5697 ospf_default_information_originate_metric_type_cmd
,
5698 "default-information originate metric <0-16777214> metric-type (1|2)",
5699 "Control distribution of default information\n"
5700 "Distribute a default route\n"
5701 "OSPF default metric\n"
5703 "OSPF metric type for default routes\n"
5704 "Set OSPF External Type 1 metrics\n"
5705 "Set OSPF External Type 2 metrics\n")
5707 ALIAS (ospf_default_information_originate_metric_type_routemap
,
5708 ospf_default_information_originate_metric_cmd
,
5709 "default-information originate metric <0-16777214>",
5710 "Control distribution of default information\n"
5711 "Distribute a default route\n"
5712 "OSPF default metric\n"
5715 ALIAS (ospf_default_information_originate_metric_type_routemap
,
5716 ospf_default_information_originate_cmd
,
5717 "default-information originate",
5718 "Control distribution of default information\n"
5719 "Distribute a default route\n")
5721 /* Default information originate. */
5722 DEFUN (ospf_default_information_originate_metric_routemap
,
5723 ospf_default_information_originate_metric_routemap_cmd
,
5724 "default-information originate metric <0-16777214> route-map WORD",
5725 "Control distribution of default information\n"
5726 "Distribute a default route\n"
5727 "OSPF default metric\n"
5729 "Route map reference\n"
5730 "Pointer to route-map entries\n")
5732 struct ospf
*ospf
= vty
->index
;
5735 /* Get metric value. */
5737 if (!str2metric (argv
[0], &metric
))
5741 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[1]);
5743 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5745 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ZEBRA
,
5749 /* Default information originate. */
5750 DEFUN (ospf_default_information_originate_routemap
,
5751 ospf_default_information_originate_routemap_cmd
,
5752 "default-information originate route-map WORD",
5753 "Control distribution of default information\n"
5754 "Distribute a default route\n"
5755 "Route map reference\n"
5756 "Pointer to route-map entries\n")
5758 struct ospf
*ospf
= vty
->index
;
5761 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[0]);
5763 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5765 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ZEBRA
, -1, -1);
5768 DEFUN (ospf_default_information_originate_type_metric_routemap
,
5769 ospf_default_information_originate_type_metric_routemap_cmd
,
5770 "default-information originate metric-type (1|2) metric <0-16777214> route-map WORD",
5771 "Control distribution of default information\n"
5772 "Distribute a default route\n"
5773 "OSPF metric type for default routes\n"
5774 "Set OSPF External Type 1 metrics\n"
5775 "Set OSPF External Type 2 metrics\n"
5776 "OSPF default metric\n"
5778 "Route map reference\n"
5779 "Pointer to route-map entries\n")
5781 struct ospf
*ospf
= vty
->index
;
5785 /* Get metric type. */
5787 if (!str2metric_type (argv
[0], &type
))
5790 /* Get metric value. */
5792 if (!str2metric (argv
[1], &metric
))
5796 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[2]);
5798 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5800 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ZEBRA
,
5804 ALIAS (ospf_default_information_originate_type_metric_routemap
,
5805 ospf_default_information_originate_type_metric_cmd
,
5806 "default-information originate metric-type (1|2) metric <0-16777214>",
5807 "Control distribution of default information\n"
5808 "Distribute a default route\n"
5809 "OSPF metric type for default routes\n"
5810 "Set OSPF External Type 1 metrics\n"
5811 "Set OSPF External Type 2 metrics\n"
5812 "OSPF default metric\n"
5815 ALIAS (ospf_default_information_originate_type_metric_routemap
,
5816 ospf_default_information_originate_type_cmd
,
5817 "default-information originate metric-type (1|2)",
5818 "Control distribution of default information\n"
5819 "Distribute a default route\n"
5820 "OSPF metric type for default routes\n"
5821 "Set OSPF External Type 1 metrics\n"
5822 "Set OSPF External Type 2 metrics\n")
5824 DEFUN (ospf_default_information_originate_type_routemap
,
5825 ospf_default_information_originate_type_routemap_cmd
,
5826 "default-information originate metric-type (1|2) route-map WORD",
5827 "Control distribution of default information\n"
5828 "Distribute a default route\n"
5829 "OSPF metric type for default routes\n"
5830 "Set OSPF External Type 1 metrics\n"
5831 "Set OSPF External Type 2 metrics\n"
5832 "Route map reference\n"
5833 "Pointer to route-map entries\n")
5835 struct ospf
*ospf
= vty
->index
;
5838 /* Get metric type. */
5840 if (!str2metric_type (argv
[0], &type
))
5844 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[1]);
5846 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5848 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ZEBRA
,
5852 DEFUN (ospf_default_information_originate_always_metric_type_routemap
,
5853 ospf_default_information_originate_always_metric_type_routemap_cmd
,
5854 "default-information originate always metric <0-16777214> metric-type (1|2) route-map WORD",
5855 "Control distribution of default information\n"
5856 "Distribute a default route\n"
5857 "Always advertise default route\n"
5858 "OSPF default metric\n"
5860 "OSPF metric type for default routes\n"
5861 "Set OSPF External Type 1 metrics\n"
5862 "Set OSPF External Type 2 metrics\n"
5863 "Route map reference\n"
5864 "Pointer to route-map entries\n")
5866 struct ospf
*ospf
= vty
->index
;
5870 /* Get metric value. */
5872 if (!str2metric (argv
[0], &metric
))
5875 /* Get metric type. */
5877 if (!str2metric_type (argv
[1], &type
))
5881 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[2]);
5883 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5885 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ALWAYS
,
5889 ALIAS (ospf_default_information_originate_always_metric_type_routemap
,
5890 ospf_default_information_originate_always_metric_type_cmd
,
5891 "default-information originate always metric <0-16777214> metric-type (1|2)",
5892 "Control distribution of default information\n"
5893 "Distribute a default route\n"
5894 "Always advertise default route\n"
5895 "OSPF default metric\n"
5897 "OSPF metric type for default routes\n"
5898 "Set OSPF External Type 1 metrics\n"
5899 "Set OSPF External Type 2 metrics\n")
5901 ALIAS (ospf_default_information_originate_always_metric_type_routemap
,
5902 ospf_default_information_originate_always_metric_cmd
,
5903 "default-information originate always metric <0-16777214>",
5904 "Control distribution of default information\n"
5905 "Distribute a default route\n"
5906 "Always advertise default route\n"
5907 "OSPF default metric\n"
5909 "OSPF metric type for default routes\n")
5911 ALIAS (ospf_default_information_originate_always_metric_type_routemap
,
5912 ospf_default_information_originate_always_cmd
,
5913 "default-information originate always",
5914 "Control distribution of default information\n"
5915 "Distribute a default route\n"
5916 "Always advertise default route\n")
5918 DEFUN (ospf_default_information_originate_always_metric_routemap
,
5919 ospf_default_information_originate_always_metric_routemap_cmd
,
5920 "default-information originate always metric <0-16777214> route-map WORD",
5921 "Control distribution of default information\n"
5922 "Distribute a default route\n"
5923 "Always advertise default route\n"
5924 "OSPF default metric\n"
5926 "Route map reference\n"
5927 "Pointer to route-map entries\n")
5929 struct ospf
*ospf
= vty
->index
;
5932 /* Get metric value. */
5934 if (!str2metric (argv
[0], &metric
))
5938 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[1]);
5940 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5942 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ALWAYS
,
5946 DEFUN (ospf_default_information_originate_always_routemap
,
5947 ospf_default_information_originate_always_routemap_cmd
,
5948 "default-information originate always route-map WORD",
5949 "Control distribution of default information\n"
5950 "Distribute a default route\n"
5951 "Always advertise default route\n"
5952 "Route map reference\n"
5953 "Pointer to route-map entries\n")
5955 struct ospf
*ospf
= vty
->index
;
5958 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[0]);
5960 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5962 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ALWAYS
, -1, -1);
5965 DEFUN (ospf_default_information_originate_always_type_metric_routemap
,
5966 ospf_default_information_originate_always_type_metric_routemap_cmd
,
5967 "default-information originate always metric-type (1|2) metric <0-16777214> route-map WORD",
5968 "Control distribution of default information\n"
5969 "Distribute a default route\n"
5970 "Always advertise default route\n"
5971 "OSPF metric type for default routes\n"
5972 "Set OSPF External Type 1 metrics\n"
5973 "Set OSPF External Type 2 metrics\n"
5974 "OSPF default metric\n"
5976 "Route map reference\n"
5977 "Pointer to route-map entries\n")
5979 struct ospf
*ospf
= vty
->index
;
5983 /* Get metric type. */
5985 if (!str2metric_type (argv
[0], &type
))
5988 /* Get metric value. */
5990 if (!str2metric (argv
[1], &metric
))
5994 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[2]);
5996 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
5998 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ALWAYS
,
6002 ALIAS (ospf_default_information_originate_always_type_metric_routemap
,
6003 ospf_default_information_originate_always_type_metric_cmd
,
6004 "default-information originate always metric-type (1|2) metric <0-16777214>",
6005 "Control distribution of default information\n"
6006 "Distribute a default route\n"
6007 "Always advertise default route\n"
6008 "OSPF metric type for default routes\n"
6009 "Set OSPF External Type 1 metrics\n"
6010 "Set OSPF External Type 2 metrics\n"
6011 "OSPF default metric\n"
6014 ALIAS (ospf_default_information_originate_always_type_metric_routemap
,
6015 ospf_default_information_originate_always_type_cmd
,
6016 "default-information originate always metric-type (1|2)",
6017 "Control distribution of default information\n"
6018 "Distribute a default route\n"
6019 "Always advertise default route\n"
6020 "OSPF metric type for default routes\n"
6021 "Set OSPF External Type 1 metrics\n"
6022 "Set OSPF External Type 2 metrics\n")
6024 DEFUN (ospf_default_information_originate_always_type_routemap
,
6025 ospf_default_information_originate_always_type_routemap_cmd
,
6026 "default-information originate always metric-type (1|2) route-map WORD",
6027 "Control distribution of default information\n"
6028 "Distribute a default route\n"
6029 "Always advertise default route\n"
6030 "OSPF metric type for default routes\n"
6031 "Set OSPF External Type 1 metrics\n"
6032 "Set OSPF External Type 2 metrics\n"
6033 "Route map reference\n"
6034 "Pointer to route-map entries\n")
6036 struct ospf
*ospf
= vty
->index
;
6039 /* Get metric type. */
6041 if (!str2metric_type (argv
[0], &type
))
6045 ospf_routemap_set (ospf
, DEFAULT_ROUTE
, argv
[1]);
6047 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
6049 return ospf_redistribute_default_set (ospf
, DEFAULT_ORIGINATE_ALWAYS
,
6053 DEFUN (no_ospf_default_information_originate
,
6054 no_ospf_default_information_originate_cmd
,
6055 "no default-information originate",
6057 "Control distribution of default information\n"
6058 "Distribute a default route\n")
6060 struct ospf
*ospf
= vty
->index
;
6061 struct prefix_ipv4 p
;
6062 struct in_addr nexthop
;
6065 p
.prefix
.s_addr
= 0;
6068 ospf_external_lsa_flush (ospf
, DEFAULT_ROUTE
, &p
, 0, nexthop
);
6070 if (EXTERNAL_INFO (DEFAULT_ROUTE
)) {
6071 ospf_external_info_delete (DEFAULT_ROUTE
, p
);
6072 route_table_finish (EXTERNAL_INFO (DEFAULT_ROUTE
));
6073 EXTERNAL_INFO (DEFAULT_ROUTE
) = NULL
;
6076 ospf_routemap_unset (ospf
, DEFAULT_ROUTE
);
6077 return ospf_redistribute_default_unset (ospf
);
6080 DEFUN (ospf_default_metric
,
6081 ospf_default_metric_cmd
,
6082 "default-metric <0-16777214>",
6083 "Set metric of redistributed routes\n"
6086 struct ospf
*ospf
= vty
->index
;
6089 if (!str2metric (argv
[0], &metric
))
6092 ospf
->default_metric
= metric
;
6097 DEFUN (no_ospf_default_metric
,
6098 no_ospf_default_metric_cmd
,
6099 "no default-metric",
6101 "Set metric of redistributed routes\n")
6103 struct ospf
*ospf
= vty
->index
;
6105 ospf
->default_metric
= -1;
6110 ALIAS (no_ospf_default_metric
,
6111 no_ospf_default_metric_val_cmd
,
6112 "no default-metric <0-16777214>",
6114 "Set metric of redistributed routes\n"
6117 DEFUN (ospf_distance
,
6120 "Define an administrative distance\n"
6121 "OSPF Administrative distance\n")
6123 struct ospf
*ospf
= vty
->index
;
6125 ospf
->distance_all
= atoi (argv
[0]);
6130 DEFUN (no_ospf_distance
,
6131 no_ospf_distance_cmd
,
6132 "no distance <1-255>",
6134 "Define an administrative distance\n"
6135 "OSPF Administrative distance\n")
6137 struct ospf
*ospf
= vty
->index
;
6139 ospf
->distance_all
= 0;
6144 DEFUN (no_ospf_distance_ospf
,
6145 no_ospf_distance_ospf_cmd
,
6148 "Define an administrative distance\n"
6149 "OSPF Administrative distance\n"
6152 struct ospf
*ospf
= vty
->index
;
6154 ospf
->distance_intra
= 0;
6155 ospf
->distance_inter
= 0;
6156 ospf
->distance_external
= 0;
6161 DEFUN (ospf_distance_ospf_intra
,
6162 ospf_distance_ospf_intra_cmd
,
6163 "distance ospf intra-area <1-255>",
6164 "Define an administrative distance\n"
6165 "OSPF Administrative distance\n"
6166 "Intra-area routes\n"
6167 "Distance for intra-area routes\n")
6169 struct ospf
*ospf
= vty
->index
;
6171 ospf
->distance_intra
= atoi (argv
[0]);
6176 DEFUN (ospf_distance_ospf_intra_inter
,
6177 ospf_distance_ospf_intra_inter_cmd
,
6178 "distance ospf intra-area <1-255> inter-area <1-255>",
6179 "Define an administrative distance\n"
6180 "OSPF Administrative distance\n"
6181 "Intra-area routes\n"
6182 "Distance for intra-area routes\n"
6183 "Inter-area routes\n"
6184 "Distance for inter-area routes\n")
6186 struct ospf
*ospf
= vty
->index
;
6188 ospf
->distance_intra
= atoi (argv
[0]);
6189 ospf
->distance_inter
= atoi (argv
[1]);
6194 DEFUN (ospf_distance_ospf_intra_external
,
6195 ospf_distance_ospf_intra_external_cmd
,
6196 "distance ospf intra-area <1-255> external <1-255>",
6197 "Define an administrative distance\n"
6198 "OSPF Administrative distance\n"
6199 "Intra-area routes\n"
6200 "Distance for intra-area routes\n"
6202 "Distance for external routes\n")
6204 struct ospf
*ospf
= vty
->index
;
6206 ospf
->distance_intra
= atoi (argv
[0]);
6207 ospf
->distance_external
= atoi (argv
[1]);
6212 DEFUN (ospf_distance_ospf_intra_inter_external
,
6213 ospf_distance_ospf_intra_inter_external_cmd
,
6214 "distance ospf intra-area <1-255> inter-area <1-255> external <1-255>",
6215 "Define an administrative distance\n"
6216 "OSPF Administrative distance\n"
6217 "Intra-area routes\n"
6218 "Distance for intra-area routes\n"
6219 "Inter-area routes\n"
6220 "Distance for inter-area routes\n"
6222 "Distance for external routes\n")
6224 struct ospf
*ospf
= vty
->index
;
6226 ospf
->distance_intra
= atoi (argv
[0]);
6227 ospf
->distance_inter
= atoi (argv
[1]);
6228 ospf
->distance_external
= atoi (argv
[2]);
6233 DEFUN (ospf_distance_ospf_intra_external_inter
,
6234 ospf_distance_ospf_intra_external_inter_cmd
,
6235 "distance ospf intra-area <1-255> external <1-255> inter-area <1-255>",
6236 "Define an administrative distance\n"
6237 "OSPF Administrative distance\n"
6238 "Intra-area routes\n"
6239 "Distance for intra-area routes\n"
6241 "Distance for external routes\n"
6242 "Inter-area routes\n"
6243 "Distance for inter-area routes\n")
6245 struct ospf
*ospf
= vty
->index
;
6247 ospf
->distance_intra
= atoi (argv
[0]);
6248 ospf
->distance_external
= atoi (argv
[1]);
6249 ospf
->distance_inter
= atoi (argv
[2]);
6254 DEFUN (ospf_distance_ospf_inter
,
6255 ospf_distance_ospf_inter_cmd
,
6256 "distance ospf inter-area <1-255>",
6257 "Define an administrative distance\n"
6258 "OSPF Administrative distance\n"
6259 "Inter-area routes\n"
6260 "Distance for inter-area routes\n")
6262 struct ospf
*ospf
= vty
->index
;
6264 ospf
->distance_inter
= atoi (argv
[0]);
6269 DEFUN (ospf_distance_ospf_inter_intra
,
6270 ospf_distance_ospf_inter_intra_cmd
,
6271 "distance ospf inter-area <1-255> intra-area <1-255>",
6272 "Define an administrative distance\n"
6273 "OSPF Administrative distance\n"
6274 "Inter-area routes\n"
6275 "Distance for inter-area routes\n"
6276 "Intra-area routes\n"
6277 "Distance for intra-area routes\n")
6279 struct ospf
*ospf
= vty
->index
;
6281 ospf
->distance_inter
= atoi (argv
[0]);
6282 ospf
->distance_intra
= atoi (argv
[1]);
6287 DEFUN (ospf_distance_ospf_inter_external
,
6288 ospf_distance_ospf_inter_external_cmd
,
6289 "distance ospf inter-area <1-255> external <1-255>",
6290 "Define an administrative distance\n"
6291 "OSPF Administrative distance\n"
6292 "Inter-area routes\n"
6293 "Distance for inter-area routes\n"
6295 "Distance for external routes\n")
6297 struct ospf
*ospf
= vty
->index
;
6299 ospf
->distance_inter
= atoi (argv
[0]);
6300 ospf
->distance_external
= atoi (argv
[1]);
6305 DEFUN (ospf_distance_ospf_inter_intra_external
,
6306 ospf_distance_ospf_inter_intra_external_cmd
,
6307 "distance ospf inter-area <1-255> intra-area <1-255> external <1-255>",
6308 "Define an administrative distance\n"
6309 "OSPF Administrative distance\n"
6310 "Inter-area routes\n"
6311 "Distance for inter-area routes\n"
6312 "Intra-area routes\n"
6313 "Distance for intra-area routes\n"
6315 "Distance for external routes\n")
6317 struct ospf
*ospf
= vty
->index
;
6319 ospf
->distance_inter
= atoi (argv
[0]);
6320 ospf
->distance_intra
= atoi (argv
[1]);
6321 ospf
->distance_external
= atoi (argv
[2]);
6326 DEFUN (ospf_distance_ospf_inter_external_intra
,
6327 ospf_distance_ospf_inter_external_intra_cmd
,
6328 "distance ospf inter-area <1-255> external <1-255> intra-area <1-255>",
6329 "Define an administrative distance\n"
6330 "OSPF Administrative distance\n"
6331 "Inter-area routes\n"
6332 "Distance for inter-area routes\n"
6334 "Distance for external routes\n"
6335 "Intra-area routes\n"
6336 "Distance for intra-area routes\n")
6338 struct ospf
*ospf
= vty
->index
;
6340 ospf
->distance_inter
= atoi (argv
[0]);
6341 ospf
->distance_external
= atoi (argv
[1]);
6342 ospf
->distance_intra
= atoi (argv
[2]);
6347 DEFUN (ospf_distance_ospf_external
,
6348 ospf_distance_ospf_external_cmd
,
6349 "distance ospf external <1-255>",
6350 "Define an administrative distance\n"
6351 "OSPF Administrative distance\n"
6353 "Distance for external routes\n")
6355 struct ospf
*ospf
= vty
->index
;
6357 ospf
->distance_external
= atoi (argv
[0]);
6362 DEFUN (ospf_distance_ospf_external_intra
,
6363 ospf_distance_ospf_external_intra_cmd
,
6364 "distance ospf external <1-255> intra-area <1-255>",
6365 "Define an administrative distance\n"
6366 "OSPF Administrative distance\n"
6368 "Distance for external routes\n"
6369 "Intra-area routes\n"
6370 "Distance for intra-area routes\n")
6372 struct ospf
*ospf
= vty
->index
;
6374 ospf
->distance_external
= atoi (argv
[0]);
6375 ospf
->distance_intra
= atoi (argv
[1]);
6380 DEFUN (ospf_distance_ospf_external_inter
,
6381 ospf_distance_ospf_external_inter_cmd
,
6382 "distance ospf external <1-255> inter-area <1-255>",
6383 "Define an administrative distance\n"
6384 "OSPF Administrative distance\n"
6386 "Distance for external routes\n"
6387 "Inter-area routes\n"
6388 "Distance for inter-area routes\n")
6390 struct ospf
*ospf
= vty
->index
;
6392 ospf
->distance_external
= atoi (argv
[0]);
6393 ospf
->distance_inter
= atoi (argv
[1]);
6398 DEFUN (ospf_distance_ospf_external_intra_inter
,
6399 ospf_distance_ospf_external_intra_inter_cmd
,
6400 "distance ospf external <1-255> intra-area <1-255> inter-area <1-255>",
6401 "Define an administrative distance\n"
6402 "OSPF Administrative distance\n"
6404 "Distance for external routes\n"
6405 "Intra-area routes\n"
6406 "Distance for intra-area routes\n"
6407 "Inter-area routes\n"
6408 "Distance for inter-area routes\n")
6410 struct ospf
*ospf
= vty
->index
;
6412 ospf
->distance_external
= atoi (argv
[0]);
6413 ospf
->distance_intra
= atoi (argv
[1]);
6414 ospf
->distance_inter
= atoi (argv
[2]);
6419 DEFUN (ospf_distance_ospf_external_inter_intra
,
6420 ospf_distance_ospf_external_inter_intra_cmd
,
6421 "distance ospf external <1-255> inter-area <1-255> intra-area <1-255>",
6422 "Define an administrative distance\n"
6423 "OSPF Administrative distance\n"
6425 "Distance for external routes\n"
6426 "Inter-area routes\n"
6427 "Distance for inter-area routes\n"
6428 "Intra-area routes\n"
6429 "Distance for intra-area routes\n")
6431 struct ospf
*ospf
= vty
->index
;
6433 ospf
->distance_external
= atoi (argv
[0]);
6434 ospf
->distance_inter
= atoi (argv
[1]);
6435 ospf
->distance_intra
= atoi (argv
[2]);
6440 DEFUN (ospf_distance_source
,
6441 ospf_distance_source_cmd
,
6442 "distance <1-255> A.B.C.D/M",
6443 "Administrative distance\n"
6445 "IP source prefix\n")
6447 struct ospf
*ospf
= vty
->index
;
6449 ospf_distance_set (vty
, ospf
, argv
[0], argv
[1], NULL
);
6454 DEFUN (no_ospf_distance_source
,
6455 no_ospf_distance_source_cmd
,
6456 "no distance <1-255> A.B.C.D/M",
6458 "Administrative distance\n"
6460 "IP source prefix\n")
6462 struct ospf
*ospf
= vty
->index
;
6464 ospf_distance_unset (vty
, ospf
, argv
[0], argv
[1], NULL
);
6469 DEFUN (ospf_distance_source_access_list
,
6470 ospf_distance_source_access_list_cmd
,
6471 "distance <1-255> A.B.C.D/M WORD",
6472 "Administrative distance\n"
6474 "IP source prefix\n"
6475 "Access list name\n")
6477 struct ospf
*ospf
= vty
->index
;
6479 ospf_distance_set (vty
, ospf
, argv
[0], argv
[1], argv
[2]);
6484 DEFUN (no_ospf_distance_source_access_list
,
6485 no_ospf_distance_source_access_list_cmd
,
6486 "no distance <1-255> A.B.C.D/M WORD",
6488 "Administrative distance\n"
6490 "IP source prefix\n"
6491 "Access list name\n")
6493 struct ospf
*ospf
= vty
->index
;
6495 ospf_distance_unset (vty
, ospf
, argv
[0], argv
[1], argv
[2]);
6501 show_ip_ospf_route_network (struct vty
*vty
, struct route_table
*rt
)
6503 struct route_node
*rn
;
6504 struct ospf_route
*or;
6505 struct listnode
*pnode
, *pnnode
;
6506 struct ospf_path
*path
;
6508 vty_out (vty
, "============ OSPF network routing table ============%s",
6511 for (rn
= route_top (rt
); rn
; rn
= route_next (rn
))
6512 if ((or = rn
->info
) != NULL
)
6515 snprintf (buf1
, 19, "%s/%d",
6516 inet_ntoa (rn
->p
.u
.prefix4
), rn
->p
.prefixlen
);
6518 switch (or->path_type
)
6520 case OSPF_PATH_INTER_AREA
:
6521 if (or->type
== OSPF_DESTINATION_NETWORK
)
6522 vty_out (vty
, "N IA %-18s [%d] area: %s%s", buf1
, or->cost
,
6523 inet_ntoa (or->u
.std
.area_id
), VTY_NEWLINE
);
6524 else if (or->type
== OSPF_DESTINATION_DISCARD
)
6525 vty_out (vty
, "D IA %-18s Discard entry%s", buf1
, VTY_NEWLINE
);
6527 case OSPF_PATH_INTRA_AREA
:
6528 vty_out (vty
, "N %-18s [%d] area: %s%s", buf1
, or->cost
,
6529 inet_ntoa (or->u
.std
.area_id
), VTY_NEWLINE
);
6535 if (or->type
== OSPF_DESTINATION_NETWORK
)
6536 for (ALL_LIST_ELEMENTS (or->paths
, pnode
, pnnode
, path
))
6538 if (path
->oi
!= NULL
)
6540 if (path
->nexthop
.s_addr
== 0)
6541 vty_out (vty
, "%24s directly attached to %s%s",
6542 "", path
->oi
->ifp
->name
, VTY_NEWLINE
);
6544 vty_out (vty
, "%24s via %s, %s%s", "",
6545 inet_ntoa (path
->nexthop
), path
->oi
->ifp
->name
,
6550 vty_out (vty
, "%s", VTY_NEWLINE
);
6554 show_ip_ospf_route_router (struct vty
*vty
, struct route_table
*rtrs
)
6556 struct route_node
*rn
;
6557 struct ospf_route
*or;
6558 struct listnode
*pnode
;
6559 struct listnode
*node
;
6560 struct ospf_path
*path
;
6562 vty_out (vty
, "============ OSPF router routing table =============%s",
6564 for (rn
= route_top (rtrs
); rn
; rn
= route_next (rn
))
6569 vty_out (vty
, "R %-15s ", inet_ntoa (rn
->p
.u
.prefix4
));
6571 for (ALL_LIST_ELEMENTS_RO ((struct list
*)rn
->info
, node
, or))
6574 vty_out (vty
, "%24s", "");
6577 vty_out (vty
, "%s [%d] area: %s",
6578 (or->path_type
== OSPF_PATH_INTER_AREA
? "IA" : " "),
6579 or->cost
, inet_ntoa (or->u
.std
.area_id
));
6581 vty_out (vty
, "%s%s%s",
6582 (or->u
.std
.flags
& ROUTER_LSA_BORDER
? ", ABR" : ""),
6583 (or->u
.std
.flags
& ROUTER_LSA_EXTERNAL
? ", ASBR" : ""),
6586 for (ALL_LIST_ELEMENTS_RO (or->paths
, pnode
, path
))
6588 if (path
->nexthop
.s_addr
== 0)
6589 vty_out (vty
, "%24s directly attached to %s%s",
6590 "", path
->oi
->ifp
->name
, VTY_NEWLINE
);
6592 vty_out (vty
, "%24s via %s, %s%s", "",
6593 inet_ntoa (path
->nexthop
), path
->oi
->ifp
->name
,
6598 vty_out (vty
, "%s", VTY_NEWLINE
);
6602 show_ip_ospf_route_external (struct vty
*vty
, struct route_table
*rt
)
6604 struct route_node
*rn
;
6605 struct ospf_route
*er
;
6606 struct listnode
*pnode
, *pnnode
;
6607 struct ospf_path
*path
;
6609 vty_out (vty
, "============ OSPF external routing table ===========%s",
6611 for (rn
= route_top (rt
); rn
; rn
= route_next (rn
))
6612 if ((er
= rn
->info
) != NULL
)
6615 snprintf (buf1
, 19, "%s/%d",
6616 inet_ntoa (rn
->p
.u
.prefix4
), rn
->p
.prefixlen
);
6618 switch (er
->path_type
)
6620 case OSPF_PATH_TYPE1_EXTERNAL
:
6621 vty_out (vty
, "N E1 %-18s [%d] tag: %u%s", buf1
,
6622 er
->cost
, er
->u
.ext
.tag
, VTY_NEWLINE
);
6624 case OSPF_PATH_TYPE2_EXTERNAL
:
6625 vty_out (vty
, "N E2 %-18s [%d/%d] tag: %u%s", buf1
, er
->cost
,
6626 er
->u
.ext
.type2_cost
, er
->u
.ext
.tag
, VTY_NEWLINE
);
6630 for (ALL_LIST_ELEMENTS (er
->paths
, pnode
, pnnode
, path
))
6632 if (path
->oi
!= NULL
)
6634 if (path
->nexthop
.s_addr
== 0)
6635 vty_out (vty
, "%24s directly attached to %s%s",
6636 "", path
->oi
->ifp
->name
, VTY_NEWLINE
);
6638 vty_out (vty
, "%24s via %s, %s%s", "",
6639 inet_ntoa (path
->nexthop
), path
->oi
->ifp
->name
,
6644 vty_out (vty
, "%s", VTY_NEWLINE
);
6647 DEFUN (show_ip_ospf_border_routers
,
6648 show_ip_ospf_border_routers_cmd
,
6649 "show ip ospf border-routers",
6652 "show all the ABR's and ASBR's\n"
6657 ospf
= ospf_lookup ();
6660 vty_out (vty
, "OSPF is not enabled%s", VTY_NEWLINE
);
6664 if (ospf
->new_table
== NULL
)
6666 vty_out (vty
, "No OSPF routing information exist%s", VTY_NEWLINE
);
6670 /* Show Network routes.
6671 show_ip_ospf_route_network (vty, ospf->new_table); */
6673 /* Show Router routes. */
6674 show_ip_ospf_route_router (vty
, ospf
->new_rtrs
);
6679 DEFUN (show_ip_ospf_route
,
6680 show_ip_ospf_route_cmd
,
6681 "show ip ospf route",
6684 "OSPF information\n"
6685 "OSPF routing table\n")
6689 ospf
= ospf_lookup ();
6692 vty_out (vty
, "OSPF is not enabled%s", VTY_NEWLINE
);
6696 if (ospf
->new_table
== NULL
)
6698 vty_out (vty
, "No OSPF routing information exist%s", VTY_NEWLINE
);
6702 /* Show Network routes. */
6703 show_ip_ospf_route_network (vty
, ospf
->new_table
);
6705 /* Show Router routes. */
6706 show_ip_ospf_route_router (vty
, ospf
->new_rtrs
);
6708 /* Show AS External routes. */
6709 show_ip_ospf_route_external (vty
, ospf
->old_external_route
);
6715 const char *ospf_abr_type_str
[] =
6724 const char *ospf_shortcut_mode_str
[] =
6733 area_id2str (char *buf
, int length
, struct ospf_area
*area
)
6735 memset (buf
, 0, length
);
6737 if (area
->format
== OSPF_AREA_ID_FORMAT_ADDRESS
)
6738 strncpy (buf
, inet_ntoa (area
->area_id
), length
);
6740 sprintf (buf
, "%lu", (unsigned long) ntohl (area
->area_id
.s_addr
));
6744 const char *ospf_int_type_str
[] =
6746 "unknown", /* should never be used. */
6750 "point-to-multipoint",
6751 "virtual-link", /* should never be used. */
6755 /* Configuration write function for ospfd. */
6757 config_write_interface (struct vty
*vty
)
6759 struct listnode
*n1
, *n2
;
6760 struct interface
*ifp
;
6761 struct crypt_key
*ck
;
6763 struct route_node
*rn
= NULL
;
6764 struct ospf_if_params
*params
;
6766 for (ALL_LIST_ELEMENTS_RO (iflist
, n1
, ifp
))
6768 if (memcmp (ifp
->name
, "VLINK", 5) == 0)
6771 vty_out (vty
, "!%s", VTY_NEWLINE
);
6772 vty_out (vty
, "interface %s%s", ifp
->name
,
6775 vty_out (vty
, " description %s%s", ifp
->desc
,
6780 params
= IF_DEF_PARAMS (ifp
);
6783 /* Interface Network print. */
6784 if (OSPF_IF_PARAM_CONFIGURED (params
, type
) &&
6785 params
->type
!= OSPF_IFTYPE_LOOPBACK
)
6787 if (params
->type
!= ospf_default_iftype(ifp
))
6789 vty_out (vty
, " ip ospf network %s",
6790 ospf_int_type_str
[params
->type
]);
6791 if (params
!= IF_DEF_PARAMS (ifp
))
6792 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6793 vty_out (vty
, "%s", VTY_NEWLINE
);
6797 /* OSPF interface authentication print */
6798 if (OSPF_IF_PARAM_CONFIGURED (params
, auth_type
) &&
6799 params
->auth_type
!= OSPF_AUTH_NOTSET
)
6801 const char *auth_str
;
6803 /* Translation tables are not that much help here due to syntax
6804 of the simple option */
6805 switch (params
->auth_type
)
6808 case OSPF_AUTH_NULL
:
6812 case OSPF_AUTH_SIMPLE
:
6816 case OSPF_AUTH_CRYPTOGRAPHIC
:
6817 auth_str
= " message-digest";
6825 vty_out (vty
, " ip ospf authentication%s", auth_str
);
6826 if (params
!= IF_DEF_PARAMS (ifp
))
6827 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6828 vty_out (vty
, "%s", VTY_NEWLINE
);
6831 /* Simple Authentication Password print. */
6832 if (OSPF_IF_PARAM_CONFIGURED (params
, auth_simple
) &&
6833 params
->auth_simple
[0] != '\0')
6835 vty_out (vty
, " ip ospf authentication-key %s",
6836 params
->auth_simple
);
6837 if (params
!= IF_DEF_PARAMS (ifp
))
6838 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6839 vty_out (vty
, "%s", VTY_NEWLINE
);
6842 /* Cryptographic Authentication Key print. */
6843 for (ALL_LIST_ELEMENTS_RO (params
->auth_crypt
, n2
, ck
))
6845 vty_out (vty
, " ip ospf message-digest-key %d md5 %s",
6846 ck
->key_id
, ck
->auth_key
);
6847 if (params
!= IF_DEF_PARAMS (ifp
))
6848 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6849 vty_out (vty
, "%s", VTY_NEWLINE
);
6852 /* Interface Output Cost print. */
6853 if (OSPF_IF_PARAM_CONFIGURED (params
, output_cost_cmd
))
6855 vty_out (vty
, " ip ospf cost %u", params
->output_cost_cmd
);
6856 if (params
!= IF_DEF_PARAMS (ifp
))
6857 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6858 vty_out (vty
, "%s", VTY_NEWLINE
);
6861 /* Hello Interval print. */
6862 if (OSPF_IF_PARAM_CONFIGURED (params
, v_hello
) &&
6863 params
->v_hello
!= OSPF_HELLO_INTERVAL_DEFAULT
)
6865 vty_out (vty
, " ip ospf hello-interval %u", params
->v_hello
);
6866 if (params
!= IF_DEF_PARAMS (ifp
))
6867 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6868 vty_out (vty
, "%s", VTY_NEWLINE
);
6872 /* Router Dead Interval print. */
6873 if (OSPF_IF_PARAM_CONFIGURED (params
, v_wait
) &&
6874 params
->v_wait
!= OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
)
6876 vty_out (vty
, " ip ospf dead-interval %u", params
->v_wait
);
6877 if (params
!= IF_DEF_PARAMS (ifp
))
6878 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6879 vty_out (vty
, "%s", VTY_NEWLINE
);
6882 /* Router Priority print. */
6883 if (OSPF_IF_PARAM_CONFIGURED (params
, priority
) &&
6884 params
->priority
!= OSPF_ROUTER_PRIORITY_DEFAULT
)
6886 vty_out (vty
, " ip ospf priority %u", params
->priority
);
6887 if (params
!= IF_DEF_PARAMS (ifp
))
6888 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6889 vty_out (vty
, "%s", VTY_NEWLINE
);
6892 /* Retransmit Interval print. */
6893 if (OSPF_IF_PARAM_CONFIGURED (params
, retransmit_interval
) &&
6894 params
->retransmit_interval
!= OSPF_RETRANSMIT_INTERVAL_DEFAULT
)
6896 vty_out (vty
, " ip ospf retransmit-interval %u",
6897 params
->retransmit_interval
);
6898 if (params
!= IF_DEF_PARAMS (ifp
))
6899 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6900 vty_out (vty
, "%s", VTY_NEWLINE
);
6903 /* Transmit Delay print. */
6904 if (OSPF_IF_PARAM_CONFIGURED (params
, transmit_delay
) &&
6905 params
->transmit_delay
!= OSPF_TRANSMIT_DELAY_DEFAULT
)
6907 vty_out (vty
, " ip ospf transmit-delay %u", params
->transmit_delay
);
6908 if (params
!= IF_DEF_PARAMS (ifp
))
6909 vty_out (vty
, " %s", inet_ntoa (rn
->p
.u
.prefix4
));
6910 vty_out (vty
, "%s", VTY_NEWLINE
);
6916 rn
= route_top (IF_OIFS_PARAMS (ifp
));
6918 rn
= route_next (rn
);
6928 #ifdef HAVE_OPAQUE_LSA
6929 ospf_opaque_config_write_if (vty
, ifp
);
6930 #endif /* HAVE_OPAQUE_LSA */
6937 config_write_network_area (struct vty
*vty
, struct ospf
*ospf
)
6939 struct route_node
*rn
;
6940 u_char buf
[INET_ADDRSTRLEN
];
6942 /* `network area' print. */
6943 for (rn
= route_top (ospf
->networks
); rn
; rn
= route_next (rn
))
6946 struct ospf_network
*n
= rn
->info
;
6948 memset (buf
, 0, INET_ADDRSTRLEN
);
6950 /* Create Area ID string by specified Area ID format. */
6951 if (n
->format
== OSPF_AREA_ID_FORMAT_ADDRESS
)
6952 strncpy ((char *) buf
, inet_ntoa (n
->area_id
), INET_ADDRSTRLEN
);
6954 sprintf ((char *) buf
, "%lu",
6955 (unsigned long int) ntohl (n
->area_id
.s_addr
));
6957 /* Network print. */
6958 vty_out (vty
, " network %s/%d area %s%s",
6959 inet_ntoa (rn
->p
.u
.prefix4
), rn
->p
.prefixlen
,
6967 config_write_ospf_area (struct vty
*vty
, struct ospf
*ospf
)
6969 struct listnode
*node
;
6970 struct ospf_area
*area
;
6971 u_char buf
[INET_ADDRSTRLEN
];
6973 /* Area configuration print. */
6974 for (ALL_LIST_ELEMENTS_RO (ospf
->areas
, node
, area
))
6976 struct route_node
*rn1
;
6978 area_id2str ((char *) buf
, INET_ADDRSTRLEN
, area
);
6980 if (area
->auth_type
!= OSPF_AUTH_NULL
)
6982 if (area
->auth_type
== OSPF_AUTH_SIMPLE
)
6983 vty_out (vty
, " area %s authentication%s", buf
, VTY_NEWLINE
);
6985 vty_out (vty
, " area %s authentication message-digest%s",
6989 if (area
->shortcut_configured
!= OSPF_SHORTCUT_DEFAULT
)
6990 vty_out (vty
, " area %s shortcut %s%s", buf
,
6991 ospf_shortcut_mode_str
[area
->shortcut_configured
],
6994 if ((area
->external_routing
== OSPF_AREA_STUB
)
6995 || (area
->external_routing
== OSPF_AREA_NSSA
)
6998 if (area
->external_routing
== OSPF_AREA_STUB
)
6999 vty_out (vty
, " area %s stub", buf
);
7000 else if (area
->external_routing
== OSPF_AREA_NSSA
)
7002 vty_out (vty
, " area %s nssa", buf
);
7003 switch (area
->NSSATranslatorRole
)
7005 case OSPF_NSSA_ROLE_NEVER
:
7006 vty_out (vty
, " translate-never");
7008 case OSPF_NSSA_ROLE_ALWAYS
:
7009 vty_out (vty
, " translate-always");
7011 case OSPF_NSSA_ROLE_CANDIDATE
:
7013 vty_out (vty
, " translate-candidate");
7017 if (area
->no_summary
)
7018 vty_out (vty
, " no-summary");
7020 vty_out (vty
, "%s", VTY_NEWLINE
);
7022 if (area
->default_cost
!= 1)
7023 vty_out (vty
, " area %s default-cost %d%s", buf
,
7024 area
->default_cost
, VTY_NEWLINE
);
7027 for (rn1
= route_top (area
->ranges
); rn1
; rn1
= route_next (rn1
))
7030 struct ospf_area_range
*range
= rn1
->info
;
7032 vty_out (vty
, " area %s range %s/%d", buf
,
7033 inet_ntoa (rn1
->p
.u
.prefix4
), rn1
->p
.prefixlen
);
7035 if (range
->cost_config
!= OSPF_AREA_RANGE_COST_UNSPEC
)
7036 vty_out (vty
, " cost %d", range
->cost_config
);
7038 if (!CHECK_FLAG (range
->flags
, OSPF_AREA_RANGE_ADVERTISE
))
7039 vty_out (vty
, " not-advertise");
7041 if (CHECK_FLAG (range
->flags
, OSPF_AREA_RANGE_SUBSTITUTE
))
7042 vty_out (vty
, " substitute %s/%d",
7043 inet_ntoa (range
->subst_addr
), range
->subst_masklen
);
7045 vty_out (vty
, "%s", VTY_NEWLINE
);
7048 if (EXPORT_NAME (area
))
7049 vty_out (vty
, " area %s export-list %s%s", buf
,
7050 EXPORT_NAME (area
), VTY_NEWLINE
);
7052 if (IMPORT_NAME (area
))
7053 vty_out (vty
, " area %s import-list %s%s", buf
,
7054 IMPORT_NAME (area
), VTY_NEWLINE
);
7056 if (PREFIX_NAME_IN (area
))
7057 vty_out (vty
, " area %s filter-list prefix %s in%s", buf
,
7058 PREFIX_NAME_IN (area
), VTY_NEWLINE
);
7060 if (PREFIX_NAME_OUT (area
))
7061 vty_out (vty
, " area %s filter-list prefix %s out%s", buf
,
7062 PREFIX_NAME_OUT (area
), VTY_NEWLINE
);
7069 config_write_ospf_nbr_nbma (struct vty
*vty
, struct ospf
*ospf
)
7071 struct ospf_nbr_nbma
*nbr_nbma
;
7072 struct route_node
*rn
;
7074 /* Static Neighbor configuration print. */
7075 for (rn
= route_top (ospf
->nbr_nbma
); rn
; rn
= route_next (rn
))
7076 if ((nbr_nbma
= rn
->info
))
7078 vty_out (vty
, " neighbor %s", inet_ntoa (nbr_nbma
->addr
));
7080 if (nbr_nbma
->priority
!= OSPF_NEIGHBOR_PRIORITY_DEFAULT
)
7081 vty_out (vty
, " priority %d", nbr_nbma
->priority
);
7083 if (nbr_nbma
->v_poll
!= OSPF_POLL_INTERVAL_DEFAULT
)
7084 vty_out (vty
, " poll-interval %d", nbr_nbma
->v_poll
);
7086 vty_out (vty
, "%s", VTY_NEWLINE
);
7093 config_write_virtual_link (struct vty
*vty
, struct ospf
*ospf
)
7095 struct listnode
*node
;
7096 struct ospf_vl_data
*vl_data
;
7097 u_char buf
[INET_ADDRSTRLEN
];
7099 /* Virtual-Link print */
7100 for (ALL_LIST_ELEMENTS_RO (ospf
->vlinks
, node
, vl_data
))
7102 struct listnode
*n2
;
7103 struct crypt_key
*ck
;
7104 struct ospf_interface
*oi
;
7106 if (vl_data
!= NULL
)
7108 memset (buf
, 0, INET_ADDRSTRLEN
);
7110 if (vl_data
->format
== OSPF_AREA_ID_FORMAT_ADDRESS
)
7111 strncpy ((char *) buf
, inet_ntoa (vl_data
->vl_area_id
), INET_ADDRSTRLEN
);
7113 sprintf ((char *) buf
, "%lu",
7114 (unsigned long int) ntohl (vl_data
->vl_area_id
.s_addr
));
7115 oi
= vl_data
->vl_oi
;
7118 if (OSPF_IF_PARAM (oi
, v_hello
) != OSPF_HELLO_INTERVAL_DEFAULT
||
7119 OSPF_IF_PARAM (oi
, v_wait
) != OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
||
7120 OSPF_IF_PARAM (oi
, retransmit_interval
) != OSPF_RETRANSMIT_INTERVAL_DEFAULT
||
7121 OSPF_IF_PARAM (oi
, transmit_delay
) != OSPF_TRANSMIT_DELAY_DEFAULT
)
7122 vty_out (vty
, " area %s virtual-link %s hello-interval %d retransmit-interval %d transmit-delay %d dead-interval %d%s",
7124 inet_ntoa (vl_data
->vl_peer
),
7125 OSPF_IF_PARAM (oi
, v_hello
),
7126 OSPF_IF_PARAM (oi
, retransmit_interval
),
7127 OSPF_IF_PARAM (oi
, transmit_delay
),
7128 OSPF_IF_PARAM (oi
, v_wait
),
7131 vty_out (vty
, " area %s virtual-link %s%s", buf
,
7132 inet_ntoa (vl_data
->vl_peer
), VTY_NEWLINE
);
7134 if (IF_DEF_PARAMS (vl_data
->vl_oi
->ifp
)->auth_simple
[0] != '\0')
7135 vty_out (vty
, " area %s virtual-link %s authentication-key %s%s",
7137 inet_ntoa (vl_data
->vl_peer
),
7138 IF_DEF_PARAMS (vl_data
->vl_oi
->ifp
)->auth_simple
,
7141 for (ALL_LIST_ELEMENTS_RO (IF_DEF_PARAMS (vl_data
->vl_oi
->ifp
)->auth_crypt
,
7143 vty_out (vty
, " area %s virtual-link %s"
7144 " message-digest-key %d md5 %s%s",
7146 inet_ntoa (vl_data
->vl_peer
),
7147 ck
->key_id
, ck
->auth_key
, VTY_NEWLINE
);
7156 const char *distribute_str
[] = { "system", "kernel", "connected", "static",
7157 "rip", "ripng", "ospf", "ospf6", "isis", "bgp"};
7159 config_write_ospf_redistribute (struct vty
*vty
, struct ospf
*ospf
)
7163 /* redistribute print. */
7164 for (type
= 0; type
< ZEBRA_ROUTE_MAX
; type
++)
7165 if (type
!= zclient
->redist_default
&& zclient
->redist
[type
])
7167 vty_out (vty
, " redistribute %s", distribute_str
[type
]);
7168 if (ospf
->dmetric
[type
].value
>= 0)
7169 vty_out (vty
, " metric %d", ospf
->dmetric
[type
].value
);
7171 if (ospf
->dmetric
[type
].type
== EXTERNAL_METRIC_TYPE_1
)
7172 vty_out (vty
, " metric-type 1");
7174 if (ROUTEMAP_NAME (ospf
, type
))
7175 vty_out (vty
, " route-map %s", ROUTEMAP_NAME (ospf
, type
));
7177 vty_out (vty
, "%s", VTY_NEWLINE
);
7184 config_write_ospf_default_metric (struct vty
*vty
, struct ospf
*ospf
)
7186 if (ospf
->default_metric
!= -1)
7187 vty_out (vty
, " default-metric %d%s", ospf
->default_metric
,
7193 config_write_ospf_distribute (struct vty
*vty
, struct ospf
*ospf
)
7199 /* distribute-list print. */
7200 for (type
= 0; type
< ZEBRA_ROUTE_MAX
; type
++)
7201 if (ospf
->dlist
[type
].name
)
7202 vty_out (vty
, " distribute-list %s out %s%s",
7203 ospf
->dlist
[type
].name
,
7204 distribute_str
[type
], VTY_NEWLINE
);
7206 /* default-information print. */
7207 if (ospf
->default_originate
!= DEFAULT_ORIGINATE_NONE
)
7209 if (ospf
->default_originate
== DEFAULT_ORIGINATE_ZEBRA
)
7210 vty_out (vty
, " default-information originate");
7212 vty_out (vty
, " default-information originate always");
7214 if (ospf
->dmetric
[DEFAULT_ROUTE
].value
>= 0)
7215 vty_out (vty
, " metric %d",
7216 ospf
->dmetric
[DEFAULT_ROUTE
].value
);
7217 if (ospf
->dmetric
[DEFAULT_ROUTE
].type
== EXTERNAL_METRIC_TYPE_1
)
7218 vty_out (vty
, " metric-type 1");
7220 if (ROUTEMAP_NAME (ospf
, DEFAULT_ROUTE
))
7221 vty_out (vty
, " route-map %s",
7222 ROUTEMAP_NAME (ospf
, DEFAULT_ROUTE
));
7224 vty_out (vty
, "%s", VTY_NEWLINE
);
7233 config_write_ospf_distance (struct vty
*vty
, struct ospf
*ospf
)
7235 struct route_node
*rn
;
7236 struct ospf_distance
*odistance
;
7238 if (ospf
->distance_all
)
7239 vty_out (vty
, " distance %d%s", ospf
->distance_all
, VTY_NEWLINE
);
7241 if (ospf
->distance_intra
7242 || ospf
->distance_inter
7243 || ospf
->distance_external
)
7245 vty_out (vty
, " distance ospf");
7247 if (ospf
->distance_intra
)
7248 vty_out (vty
, " intra-area %d", ospf
->distance_intra
);
7249 if (ospf
->distance_inter
)
7250 vty_out (vty
, " inter-area %d", ospf
->distance_inter
);
7251 if (ospf
->distance_external
)
7252 vty_out (vty
, " external %d", ospf
->distance_external
);
7254 vty_out (vty
, "%s", VTY_NEWLINE
);
7257 for (rn
= route_top (ospf
->distance_table
); rn
; rn
= route_next (rn
))
7258 if ((odistance
= rn
->info
) != NULL
)
7260 vty_out (vty
, " distance %d %s/%d %s%s", odistance
->distance
,
7261 inet_ntoa (rn
->p
.u
.prefix4
), rn
->p
.prefixlen
,
7262 odistance
->access_list
? odistance
->access_list
: "",
7268 /* OSPF configuration write function. */
7270 ospf_config_write (struct vty
*vty
)
7273 struct interface
*ifp
;
7274 struct ospf_interface
*oi
;
7275 struct listnode
*node
;
7278 ospf
= ospf_lookup ();
7281 /* `router ospf' print. */
7282 vty_out (vty
, "router ospf%s", VTY_NEWLINE
);
7286 if (!ospf
->networks
)
7289 /* Router ID print. */
7290 if (ospf
->router_id_static
.s_addr
!= 0)
7291 vty_out (vty
, " ospf router-id %s%s",
7292 inet_ntoa (ospf
->router_id_static
), VTY_NEWLINE
);
7294 /* ABR type print. */
7295 if (ospf
->abr_type
!= OSPF_ABR_STAND
)
7296 vty_out (vty
, " ospf abr-type %s%s",
7297 ospf_abr_type_str
[ospf
->abr_type
], VTY_NEWLINE
);
7299 /* RFC1583 compatibility flag print -- Compatible with CISCO 12.1. */
7300 if (CHECK_FLAG (ospf
->config
, OSPF_RFC1583_COMPATIBLE
))
7301 vty_out (vty
, " compatible rfc1583%s", VTY_NEWLINE
);
7303 /* auto-cost reference-bandwidth configuration. */
7304 if (ospf
->ref_bandwidth
!= OSPF_DEFAULT_REF_BANDWIDTH
)
7305 vty_out (vty
, " auto-cost reference-bandwidth %d%s",
7306 ospf
->ref_bandwidth
/ 1000, VTY_NEWLINE
);
7308 /* SPF timers print. */
7309 if (ospf
->spf_delay
!= OSPF_SPF_DELAY_DEFAULT
||
7310 ospf
->spf_holdtime
!= OSPF_SPF_HOLDTIME_DEFAULT
)
7311 vty_out (vty
, " timers spf %d %d%s",
7312 ospf
->spf_delay
, ospf
->spf_holdtime
, VTY_NEWLINE
);
7314 /* SPF refresh parameters print. */
7315 if (ospf
->lsa_refresh_interval
!= OSPF_LSA_REFRESH_INTERVAL_DEFAULT
)
7316 vty_out (vty
, " refresh timer %d%s",
7317 ospf
->lsa_refresh_interval
, VTY_NEWLINE
);
7319 /* Redistribute information print. */
7320 config_write_ospf_redistribute (vty
, ospf
);
7322 /* passive-interface print. */
7323 for (ALL_LIST_ELEMENTS_RO (om
->iflist
, node
, ifp
))
7324 if (IF_DEF_PARAMS (ifp
)->passive_interface
== OSPF_IF_PASSIVE
)
7325 vty_out (vty
, " passive-interface %s%s",
7326 ifp
->name
, VTY_NEWLINE
);
7328 for (ALL_LIST_ELEMENTS_RO (ospf
->oiflist
, node
, oi
))
7329 if (OSPF_IF_PARAM_CONFIGURED (oi
->params
, passive_interface
) &&
7330 oi
->params
->passive_interface
== OSPF_IF_PASSIVE
)
7331 vty_out (vty
, " passive-interface %s %s%s",
7333 inet_ntoa (oi
->address
->u
.prefix4
), VTY_NEWLINE
);
7335 /* Network area print. */
7336 config_write_network_area (vty
, ospf
);
7338 /* Area config print. */
7339 config_write_ospf_area (vty
, ospf
);
7341 /* static neighbor print. */
7342 config_write_ospf_nbr_nbma (vty
, ospf
);
7344 /* Virtual-Link print. */
7345 config_write_virtual_link (vty
, ospf
);
7347 /* Default metric configuration. */
7348 config_write_ospf_default_metric (vty
, ospf
);
7350 /* Distribute-list and default-information print. */
7351 config_write_ospf_distribute (vty
, ospf
);
7353 /* Distance configuration. */
7354 config_write_ospf_distance (vty
, ospf
);
7356 #ifdef HAVE_OPAQUE_LSA
7357 ospf_opaque_config_write_router (vty
, ospf
);
7358 #endif /* HAVE_OPAQUE_LSA */
7365 ospf_vty_show_init ()
7367 /* "show ip ospf" commands. */
7368 install_element (VIEW_NODE
, &show_ip_ospf_cmd
);
7369 install_element (ENABLE_NODE
, &show_ip_ospf_cmd
);
7371 /* "show ip ospf database" commands. */
7372 install_element (VIEW_NODE
, &show_ip_ospf_database_type_cmd
);
7373 install_element (VIEW_NODE
, &show_ip_ospf_database_type_id_cmd
);
7374 install_element (VIEW_NODE
, &show_ip_ospf_database_type_id_adv_router_cmd
);
7375 install_element (VIEW_NODE
, &show_ip_ospf_database_type_adv_router_cmd
);
7376 install_element (VIEW_NODE
, &show_ip_ospf_database_type_id_self_cmd
);
7377 install_element (VIEW_NODE
, &show_ip_ospf_database_type_self_cmd
);
7378 install_element (VIEW_NODE
, &show_ip_ospf_database_cmd
);
7379 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_cmd
);
7380 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_id_cmd
);
7381 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_id_adv_router_cmd
);
7382 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_adv_router_cmd
);
7383 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_id_self_cmd
);
7384 install_element (ENABLE_NODE
, &show_ip_ospf_database_type_self_cmd
);
7385 install_element (ENABLE_NODE
, &show_ip_ospf_database_cmd
);
7387 /* "show ip ospf interface" commands. */
7388 install_element (VIEW_NODE
, &show_ip_ospf_interface_cmd
);
7389 install_element (ENABLE_NODE
, &show_ip_ospf_interface_cmd
);
7391 /* "show ip ospf neighbor" commands. */
7392 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_int_detail_cmd
);
7393 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_int_cmd
);
7394 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_id_cmd
);
7395 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_detail_all_cmd
);
7396 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_detail_cmd
);
7397 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_cmd
);
7398 install_element (VIEW_NODE
, &show_ip_ospf_neighbor_all_cmd
);
7399 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_int_detail_cmd
);
7400 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_int_cmd
);
7401 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_id_cmd
);
7402 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_detail_all_cmd
);
7403 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_detail_cmd
);
7404 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_cmd
);
7405 install_element (ENABLE_NODE
, &show_ip_ospf_neighbor_all_cmd
);
7407 /* "show ip ospf route" commands. */
7408 install_element (VIEW_NODE
, &show_ip_ospf_route_cmd
);
7409 install_element (ENABLE_NODE
, &show_ip_ospf_route_cmd
);
7410 install_element (VIEW_NODE
, &show_ip_ospf_border_routers_cmd
);
7411 install_element (ENABLE_NODE
, &show_ip_ospf_border_routers_cmd
);
7415 /* ospfd's interface node. */
7416 struct cmd_node interface_node
=
7423 /* Initialization of OSPF interface. */
7427 /* Install interface node. */
7428 install_node (&interface_node
, config_write_interface
);
7430 install_element (CONFIG_NODE
, &interface_cmd
);
7431 install_element (CONFIG_NODE
, &no_interface_cmd
);
7432 install_default (INTERFACE_NODE
);
7434 /* "description" commands. */
7435 install_element (INTERFACE_NODE
, &interface_desc_cmd
);
7436 install_element (INTERFACE_NODE
, &no_interface_desc_cmd
);
7438 /* "ip ospf authentication" commands. */
7439 install_element (INTERFACE_NODE
, &ip_ospf_authentication_args_addr_cmd
);
7440 install_element (INTERFACE_NODE
, &ip_ospf_authentication_args_cmd
);
7441 install_element (INTERFACE_NODE
, &ip_ospf_authentication_addr_cmd
);
7442 install_element (INTERFACE_NODE
, &ip_ospf_authentication_cmd
);
7443 install_element (INTERFACE_NODE
, &no_ip_ospf_authentication_addr_cmd
);
7444 install_element (INTERFACE_NODE
, &no_ip_ospf_authentication_cmd
);
7445 install_element (INTERFACE_NODE
, &ip_ospf_authentication_key_addr_cmd
);
7446 install_element (INTERFACE_NODE
, &ip_ospf_authentication_key_cmd
);
7447 install_element (INTERFACE_NODE
, &no_ip_ospf_authentication_key_addr_cmd
);
7448 install_element (INTERFACE_NODE
, &no_ip_ospf_authentication_key_cmd
);
7450 /* "ip ospf message-digest-key" commands. */
7451 install_element (INTERFACE_NODE
, &ip_ospf_message_digest_key_addr_cmd
);
7452 install_element (INTERFACE_NODE
, &ip_ospf_message_digest_key_cmd
);
7453 install_element (INTERFACE_NODE
, &no_ip_ospf_message_digest_key_addr_cmd
);
7454 install_element (INTERFACE_NODE
, &no_ip_ospf_message_digest_key_cmd
);
7456 /* "ip ospf cost" commands. */
7457 install_element (INTERFACE_NODE
, &ip_ospf_cost_addr_cmd
);
7458 install_element (INTERFACE_NODE
, &ip_ospf_cost_cmd
);
7459 install_element (INTERFACE_NODE
, &no_ip_ospf_cost_addr_cmd
);
7460 install_element (INTERFACE_NODE
, &no_ip_ospf_cost_cmd
);
7462 /* "ip ospf dead-interval" commands. */
7463 install_element (INTERFACE_NODE
, &ip_ospf_dead_interval_addr_cmd
);
7464 install_element (INTERFACE_NODE
, &ip_ospf_dead_interval_cmd
);
7465 install_element (INTERFACE_NODE
, &no_ip_ospf_dead_interval_addr_cmd
);
7466 install_element (INTERFACE_NODE
, &no_ip_ospf_dead_interval_cmd
);
7468 /* "ip ospf hello-interval" commands. */
7469 install_element (INTERFACE_NODE
, &ip_ospf_hello_interval_addr_cmd
);
7470 install_element (INTERFACE_NODE
, &ip_ospf_hello_interval_cmd
);
7471 install_element (INTERFACE_NODE
, &no_ip_ospf_hello_interval_addr_cmd
);
7472 install_element (INTERFACE_NODE
, &no_ip_ospf_hello_interval_cmd
);
7474 /* "ip ospf network" commands. */
7475 install_element (INTERFACE_NODE
, &ip_ospf_network_cmd
);
7476 install_element (INTERFACE_NODE
, &no_ip_ospf_network_cmd
);
7478 /* "ip ospf priority" commands. */
7479 install_element (INTERFACE_NODE
, &ip_ospf_priority_addr_cmd
);
7480 install_element (INTERFACE_NODE
, &ip_ospf_priority_cmd
);
7481 install_element (INTERFACE_NODE
, &no_ip_ospf_priority_addr_cmd
);
7482 install_element (INTERFACE_NODE
, &no_ip_ospf_priority_cmd
);
7484 /* "ip ospf retransmit-interval" commands. */
7485 install_element (INTERFACE_NODE
, &ip_ospf_retransmit_interval_addr_cmd
);
7486 install_element (INTERFACE_NODE
, &ip_ospf_retransmit_interval_cmd
);
7487 install_element (INTERFACE_NODE
, &no_ip_ospf_retransmit_interval_addr_cmd
);
7488 install_element (INTERFACE_NODE
, &no_ip_ospf_retransmit_interval_cmd
);
7490 /* "ip ospf transmit-delay" commands. */
7491 install_element (INTERFACE_NODE
, &ip_ospf_transmit_delay_addr_cmd
);
7492 install_element (INTERFACE_NODE
, &ip_ospf_transmit_delay_cmd
);
7493 install_element (INTERFACE_NODE
, &no_ip_ospf_transmit_delay_addr_cmd
);
7494 install_element (INTERFACE_NODE
, &no_ip_ospf_transmit_delay_cmd
);
7496 /* These commands are compatibitliy for previous version. */
7497 install_element (INTERFACE_NODE
, &ospf_authentication_key_cmd
);
7498 install_element (INTERFACE_NODE
, &no_ospf_authentication_key_cmd
);
7499 install_element (INTERFACE_NODE
, &ospf_message_digest_key_cmd
);
7500 install_element (INTERFACE_NODE
, &no_ospf_message_digest_key_cmd
);
7501 install_element (INTERFACE_NODE
, &ospf_cost_cmd
);
7502 install_element (INTERFACE_NODE
, &no_ospf_cost_cmd
);
7503 install_element (INTERFACE_NODE
, &ospf_dead_interval_cmd
);
7504 install_element (INTERFACE_NODE
, &no_ospf_dead_interval_cmd
);
7505 install_element (INTERFACE_NODE
, &ospf_hello_interval_cmd
);
7506 install_element (INTERFACE_NODE
, &no_ospf_hello_interval_cmd
);
7507 install_element (INTERFACE_NODE
, &ospf_network_cmd
);
7508 install_element (INTERFACE_NODE
, &no_ospf_network_cmd
);
7509 install_element (INTERFACE_NODE
, &ospf_priority_cmd
);
7510 install_element (INTERFACE_NODE
, &no_ospf_priority_cmd
);
7511 install_element (INTERFACE_NODE
, &ospf_retransmit_interval_cmd
);
7512 install_element (INTERFACE_NODE
, &no_ospf_retransmit_interval_cmd
);
7513 install_element (INTERFACE_NODE
, &ospf_transmit_delay_cmd
);
7514 install_element (INTERFACE_NODE
, &no_ospf_transmit_delay_cmd
);
7517 /* Zebra node structure. */
7518 struct cmd_node zebra_node
=
7521 "%s(config-router)#",
7525 ospf_vty_zebra_init ()
7527 install_element (OSPF_NODE
, &ospf_redistribute_source_type_metric_cmd
);
7528 install_element (OSPF_NODE
, &ospf_redistribute_source_metric_type_cmd
);
7529 install_element (OSPF_NODE
, &ospf_redistribute_source_type_cmd
);
7530 install_element (OSPF_NODE
, &ospf_redistribute_source_metric_cmd
);
7531 install_element (OSPF_NODE
, &ospf_redistribute_source_cmd
);
7532 install_element (OSPF_NODE
,
7533 &ospf_redistribute_source_metric_type_routemap_cmd
);
7534 install_element (OSPF_NODE
,
7535 &ospf_redistribute_source_type_metric_routemap_cmd
);
7536 install_element (OSPF_NODE
, &ospf_redistribute_source_metric_routemap_cmd
);
7537 install_element (OSPF_NODE
, &ospf_redistribute_source_type_routemap_cmd
);
7538 install_element (OSPF_NODE
, &ospf_redistribute_source_routemap_cmd
);
7540 install_element (OSPF_NODE
, &no_ospf_redistribute_source_cmd
);
7542 install_element (OSPF_NODE
, &ospf_distribute_list_out_cmd
);
7543 install_element (OSPF_NODE
, &no_ospf_distribute_list_out_cmd
);
7545 install_element (OSPF_NODE
,
7546 &ospf_default_information_originate_metric_type_cmd
);
7547 install_element (OSPF_NODE
, &ospf_default_information_originate_metric_cmd
);
7548 install_element (OSPF_NODE
,
7549 &ospf_default_information_originate_type_metric_cmd
);
7550 install_element (OSPF_NODE
, &ospf_default_information_originate_type_cmd
);
7551 install_element (OSPF_NODE
, &ospf_default_information_originate_cmd
);
7552 install_element (OSPF_NODE
,
7553 &ospf_default_information_originate_always_metric_type_cmd
);
7554 install_element (OSPF_NODE
,
7555 &ospf_default_information_originate_always_metric_cmd
);
7556 install_element (OSPF_NODE
,
7557 &ospf_default_information_originate_always_cmd
);
7558 install_element (OSPF_NODE
,
7559 &ospf_default_information_originate_always_type_metric_cmd
);
7560 install_element (OSPF_NODE
,
7561 &ospf_default_information_originate_always_type_cmd
);
7563 install_element (OSPF_NODE
,
7564 &ospf_default_information_originate_metric_type_routemap_cmd
);
7565 install_element (OSPF_NODE
,
7566 &ospf_default_information_originate_metric_routemap_cmd
);
7567 install_element (OSPF_NODE
,
7568 &ospf_default_information_originate_routemap_cmd
);
7569 install_element (OSPF_NODE
,
7570 &ospf_default_information_originate_type_metric_routemap_cmd
);
7571 install_element (OSPF_NODE
,
7572 &ospf_default_information_originate_type_routemap_cmd
);
7573 install_element (OSPF_NODE
,
7574 &ospf_default_information_originate_always_metric_type_routemap_cmd
);
7575 install_element (OSPF_NODE
,
7576 &ospf_default_information_originate_always_metric_routemap_cmd
);
7577 install_element (OSPF_NODE
,
7578 &ospf_default_information_originate_always_routemap_cmd
);
7579 install_element (OSPF_NODE
,
7580 &ospf_default_information_originate_always_type_metric_routemap_cmd
);
7581 install_element (OSPF_NODE
,
7582 &ospf_default_information_originate_always_type_routemap_cmd
);
7584 install_element (OSPF_NODE
, &no_ospf_default_information_originate_cmd
);
7586 install_element (OSPF_NODE
, &ospf_default_metric_cmd
);
7587 install_element (OSPF_NODE
, &no_ospf_default_metric_cmd
);
7588 install_element (OSPF_NODE
, &no_ospf_default_metric_val_cmd
);
7590 install_element (OSPF_NODE
, &ospf_distance_cmd
);
7591 install_element (OSPF_NODE
, &no_ospf_distance_cmd
);
7592 install_element (OSPF_NODE
, &no_ospf_distance_ospf_cmd
);
7593 install_element (OSPF_NODE
, &ospf_distance_ospf_intra_cmd
);
7594 install_element (OSPF_NODE
, &ospf_distance_ospf_intra_inter_cmd
);
7595 install_element (OSPF_NODE
, &ospf_distance_ospf_intra_external_cmd
);
7596 install_element (OSPF_NODE
, &ospf_distance_ospf_intra_inter_external_cmd
);
7597 install_element (OSPF_NODE
, &ospf_distance_ospf_intra_external_inter_cmd
);
7598 install_element (OSPF_NODE
, &ospf_distance_ospf_inter_cmd
);
7599 install_element (OSPF_NODE
, &ospf_distance_ospf_inter_intra_cmd
);
7600 install_element (OSPF_NODE
, &ospf_distance_ospf_inter_external_cmd
);
7601 install_element (OSPF_NODE
, &ospf_distance_ospf_inter_intra_external_cmd
);
7602 install_element (OSPF_NODE
, &ospf_distance_ospf_inter_external_intra_cmd
);
7603 install_element (OSPF_NODE
, &ospf_distance_ospf_external_cmd
);
7604 install_element (OSPF_NODE
, &ospf_distance_ospf_external_intra_cmd
);
7605 install_element (OSPF_NODE
, &ospf_distance_ospf_external_inter_cmd
);
7606 install_element (OSPF_NODE
, &ospf_distance_ospf_external_intra_inter_cmd
);
7607 install_element (OSPF_NODE
, &ospf_distance_ospf_external_inter_intra_cmd
);
7609 install_element (OSPF_NODE
, &ospf_distance_source_cmd
);
7610 install_element (OSPF_NODE
, &no_ospf_distance_source_cmd
);
7611 install_element (OSPF_NODE
, &ospf_distance_source_access_list_cmd
);
7612 install_element (OSPF_NODE
, &no_ospf_distance_source_access_list_cmd
);
7616 struct cmd_node ospf_node
=
7619 "%s(config-router)# ",
7624 /* Install OSPF related vty commands. */
7628 /* Install ospf top node. */
7629 install_node (&ospf_node
, ospf_config_write
);
7631 /* "router ospf" commands. */
7632 install_element (CONFIG_NODE
, &router_ospf_cmd
);
7633 install_element (CONFIG_NODE
, &no_router_ospf_cmd
);
7635 install_default (OSPF_NODE
);
7637 /* "ospf router-id" commands. */
7638 install_element (OSPF_NODE
, &ospf_router_id_cmd
);
7639 install_element (OSPF_NODE
, &no_ospf_router_id_cmd
);
7640 install_element (OSPF_NODE
, &router_ospf_id_cmd
);
7641 install_element (OSPF_NODE
, &no_router_ospf_id_cmd
);
7643 /* "passive-interface" commands. */
7644 install_element (OSPF_NODE
, &ospf_passive_interface_addr_cmd
);
7645 install_element (OSPF_NODE
, &ospf_passive_interface_cmd
);
7646 install_element (OSPF_NODE
, &no_ospf_passive_interface_addr_cmd
);
7647 install_element (OSPF_NODE
, &no_ospf_passive_interface_cmd
);
7649 /* "ospf abr-type" commands. */
7650 install_element (OSPF_NODE
, &ospf_abr_type_cmd
);
7651 install_element (OSPF_NODE
, &no_ospf_abr_type_cmd
);
7653 /* "ospf rfc1583-compatible" commands. */
7654 install_element (OSPF_NODE
, &ospf_rfc1583_flag_cmd
);
7655 install_element (OSPF_NODE
, &no_ospf_rfc1583_flag_cmd
);
7656 install_element (OSPF_NODE
, &ospf_compatible_rfc1583_cmd
);
7657 install_element (OSPF_NODE
, &no_ospf_compatible_rfc1583_cmd
);
7659 /* "network area" commands. */
7660 install_element (OSPF_NODE
, &ospf_network_area_cmd
);
7661 install_element (OSPF_NODE
, &no_ospf_network_area_cmd
);
7663 /* "area authentication" commands. */
7664 install_element (OSPF_NODE
, &ospf_area_authentication_message_digest_cmd
);
7665 install_element (OSPF_NODE
, &ospf_area_authentication_cmd
);
7666 install_element (OSPF_NODE
, &no_ospf_area_authentication_cmd
);
7668 /* "area range" commands. */
7669 install_element (OSPF_NODE
, &ospf_area_range_cmd
);
7670 install_element (OSPF_NODE
, &ospf_area_range_advertise_cmd
);
7671 install_element (OSPF_NODE
, &ospf_area_range_cost_cmd
);
7672 install_element (OSPF_NODE
, &ospf_area_range_advertise_cost_cmd
);
7673 install_element (OSPF_NODE
, &ospf_area_range_not_advertise_cmd
);
7674 install_element (OSPF_NODE
, &no_ospf_area_range_cmd
);
7675 install_element (OSPF_NODE
, &no_ospf_area_range_advertise_cmd
);
7676 install_element (OSPF_NODE
, &no_ospf_area_range_cost_cmd
);
7677 install_element (OSPF_NODE
, &no_ospf_area_range_advertise_cost_cmd
);
7678 install_element (OSPF_NODE
, &ospf_area_range_substitute_cmd
);
7679 install_element (OSPF_NODE
, &no_ospf_area_range_substitute_cmd
);
7681 /* "area virtual-link" commands. */
7682 install_element (OSPF_NODE
, &ospf_area_vlink_cmd
);
7683 install_element (OSPF_NODE
, &no_ospf_area_vlink_cmd
);
7685 install_element (OSPF_NODE
, &ospf_area_vlink_param1_cmd
);
7686 install_element (OSPF_NODE
, &no_ospf_area_vlink_param1_cmd
);
7688 install_element (OSPF_NODE
, &ospf_area_vlink_param2_cmd
);
7689 install_element (OSPF_NODE
, &no_ospf_area_vlink_param2_cmd
);
7691 install_element (OSPF_NODE
, &ospf_area_vlink_param3_cmd
);
7692 install_element (OSPF_NODE
, &no_ospf_area_vlink_param3_cmd
);
7694 install_element (OSPF_NODE
, &ospf_area_vlink_param4_cmd
);
7695 install_element (OSPF_NODE
, &no_ospf_area_vlink_param4_cmd
);
7697 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_args_cmd
);
7698 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_cmd
);
7699 install_element (OSPF_NODE
, &no_ospf_area_vlink_authtype_cmd
);
7701 install_element (OSPF_NODE
, &ospf_area_vlink_md5_cmd
);
7702 install_element (OSPF_NODE
, &no_ospf_area_vlink_md5_cmd
);
7704 install_element (OSPF_NODE
, &ospf_area_vlink_authkey_cmd
);
7705 install_element (OSPF_NODE
, &no_ospf_area_vlink_authkey_cmd
);
7707 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_args_authkey_cmd
);
7708 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_authkey_cmd
);
7709 install_element (OSPF_NODE
, &no_ospf_area_vlink_authtype_authkey_cmd
);
7711 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_args_md5_cmd
);
7712 install_element (OSPF_NODE
, &ospf_area_vlink_authtype_md5_cmd
);
7713 install_element (OSPF_NODE
, &no_ospf_area_vlink_authtype_md5_cmd
);
7715 /* "area stub" commands. */
7716 install_element (OSPF_NODE
, &ospf_area_stub_no_summary_cmd
);
7717 install_element (OSPF_NODE
, &ospf_area_stub_cmd
);
7718 install_element (OSPF_NODE
, &no_ospf_area_stub_no_summary_cmd
);
7719 install_element (OSPF_NODE
, &no_ospf_area_stub_cmd
);
7721 /* "area nssa" commands. */
7722 install_element (OSPF_NODE
, &ospf_area_nssa_cmd
);
7723 install_element (OSPF_NODE
, &ospf_area_nssa_translate_no_summary_cmd
);
7724 install_element (OSPF_NODE
, &ospf_area_nssa_translate_cmd
);
7725 install_element (OSPF_NODE
, &ospf_area_nssa_no_summary_cmd
);
7726 install_element (OSPF_NODE
, &no_ospf_area_nssa_cmd
);
7727 install_element (OSPF_NODE
, &no_ospf_area_nssa_no_summary_cmd
);
7729 install_element (OSPF_NODE
, &ospf_area_default_cost_cmd
);
7730 install_element (OSPF_NODE
, &no_ospf_area_default_cost_cmd
);
7732 install_element (OSPF_NODE
, &ospf_area_shortcut_cmd
);
7733 install_element (OSPF_NODE
, &no_ospf_area_shortcut_cmd
);
7735 install_element (OSPF_NODE
, &ospf_area_export_list_cmd
);
7736 install_element (OSPF_NODE
, &no_ospf_area_export_list_cmd
);
7738 install_element (OSPF_NODE
, &ospf_area_filter_list_cmd
);
7739 install_element (OSPF_NODE
, &no_ospf_area_filter_list_cmd
);
7741 install_element (OSPF_NODE
, &ospf_area_import_list_cmd
);
7742 install_element (OSPF_NODE
, &no_ospf_area_import_list_cmd
);
7744 install_element (OSPF_NODE
, &ospf_timers_spf_cmd
);
7745 install_element (OSPF_NODE
, &no_ospf_timers_spf_cmd
);
7747 install_element (OSPF_NODE
, &ospf_refresh_timer_cmd
);
7748 install_element (OSPF_NODE
, &no_ospf_refresh_timer_val_cmd
);
7749 install_element (OSPF_NODE
, &no_ospf_refresh_timer_cmd
);
7751 install_element (OSPF_NODE
, &ospf_auto_cost_reference_bandwidth_cmd
);
7752 install_element (OSPF_NODE
, &no_ospf_auto_cost_reference_bandwidth_cmd
);
7754 /* "neighbor" commands. */
7755 install_element (OSPF_NODE
, &ospf_neighbor_cmd
);
7756 install_element (OSPF_NODE
, &ospf_neighbor_priority_poll_interval_cmd
);
7757 install_element (OSPF_NODE
, &ospf_neighbor_priority_cmd
);
7758 install_element (OSPF_NODE
, &ospf_neighbor_poll_interval_cmd
);
7759 install_element (OSPF_NODE
, &ospf_neighbor_poll_interval_priority_cmd
);
7760 install_element (OSPF_NODE
, &no_ospf_neighbor_cmd
);
7761 install_element (OSPF_NODE
, &no_ospf_neighbor_priority_cmd
);
7762 install_element (OSPF_NODE
, &no_ospf_neighbor_poll_interval_cmd
);
7764 /* Init interface related vty commands. */
7765 ospf_vty_if_init ();
7767 /* Init zebra related vty commands. */
7768 ospf_vty_zebra_init ();