]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_interface.c
convert <1-255> to (1-255), ()s to <>s, etc
[mirror_frr.git] / ospf6d / ospf6_interface.c
index f4835d05322c7fa1bd032e0b443396b5babbfe85..2b7d180a8f21ea836117d18f3d7b43b0807cedd8 100644 (file)
@@ -986,6 +986,16 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp)
 }
 
 /* show interface */
+/*
+ * CHECK ME - The following ALIASes need to be implemented in this DEFUN
+ * "show ipv6 ospf6 interface",
+ *     SHOW_STR
+ *     IP6_STR
+ *     OSPF6_STR
+ *     INTERFACE_STR
+ *     
+ *
+ */
 DEFUN (show_ipv6_ospf6_interface,
        show_ipv6_ospf6_interface_ifname_cmd,
        "show ipv6 ospf6 interface IFNAME",
@@ -1001,10 +1011,10 @@ DEFUN (show_ipv6_ospf6_interface,
 
   if (argc)
     {
-      ifp = if_lookup_by_name (argv[0]);
+      ifp = if_lookup_by_name (argv[4]->arg);
       if (ifp == NULL)
         {
-          vty_out (vty, "No such Interface: %s%s", argv[0],
+          vty_out (vty, "No such Interface: %s%s", argv[4]->arg,
                    VNL);
           return CMD_WARNING;
         }
@@ -1019,15 +1029,34 @@ DEFUN (show_ipv6_ospf6_interface,
   return CMD_SUCCESS;
 }
 
-ALIAS (show_ipv6_ospf6_interface,
-       show_ipv6_ospf6_interface_cmd,
-       "show ipv6 ospf6 interface",
-       SHOW_STR
-       IP6_STR
-       OSPF6_STR
-       INTERFACE_STR
-       )
 
+/*
+ * CHECK ME - The following ALIASes need to be implemented in this DEFUN
+ * "show ipv6 ospf6 interface IFNAME prefix (X:X::X:X|X:X::X:X/M|detail)",
+ *     SHOW_STR
+ *     IP6_STR
+ *     OSPF6_STR
+ *     INTERFACE_STR
+ *     IFNAME_STR
+ *     "Display connected prefixes to advertise\n"
+ *     OSPF6_ROUTE_ADDRESS_STR
+ *     OSPF6_ROUTE_PREFIX_STR
+ *     "Display details of the prefixes\n"
+ *     
+ *
+ * "show ipv6 ospf6 interface IFNAME prefix X:X::X:X/M (match|detail)",
+ *     SHOW_STR
+ *     IP6_STR
+ *     OSPF6_STR
+ *     INTERFACE_STR
+ *     IFNAME_STR
+ *     "Display connected prefixes to advertise\n"
+ *     OSPF6_ROUTE_PREFIX_STR
+ *     OSPF6_ROUTE_MATCH_STR
+ *     "Display details of the prefixes\n"
+ *     
+ *
+ */
 DEFUN (show_ipv6_ospf6_interface_ifname_prefix,
        show_ipv6_ospf6_interface_ifname_prefix_cmd,
        "show ipv6 ospf6 interface IFNAME prefix",
@@ -1042,17 +1071,17 @@ DEFUN (show_ipv6_ospf6_interface_ifname_prefix,
   struct interface *ifp;
   struct ospf6_interface *oi;
 
-  ifp = if_lookup_by_name (argv[0]);
+  ifp = if_lookup_by_name (argv[4]->arg);
   if (ifp == NULL)
     {
-      vty_out (vty, "No such Interface: %s%s", argv[0], VNL);
+      vty_out (vty, "No such Interface: %s%s", argv[4]->arg, VNL);
       return CMD_WARNING;
     }
 
   oi = ifp->info;
   if (oi == NULL)
     {
-      vty_out (vty, "OSPFv3 is not enabled on %s%s", argv[0], VNL);
+      vty_out (vty, "OSPFv3 is not enabled on %s%s", argv[4]->arg, VNL);
       return CMD_WARNING;
     }
 
@@ -1063,34 +1092,33 @@ DEFUN (show_ipv6_ospf6_interface_ifname_prefix,
   return CMD_SUCCESS;
 }
 
-ALIAS (show_ipv6_ospf6_interface_ifname_prefix,
-       show_ipv6_ospf6_interface_ifname_prefix_detail_cmd,
-       "show ipv6 ospf6 interface IFNAME prefix (X:X::X:X|X:X::X:X/M|detail)",
-       SHOW_STR
-       IP6_STR
-       OSPF6_STR
-       INTERFACE_STR
-       IFNAME_STR
-       "Display connected prefixes to advertise\n"
-       OSPF6_ROUTE_ADDRESS_STR
-       OSPF6_ROUTE_PREFIX_STR
-       "Display details of the prefixes\n"
-       )
 
-ALIAS (show_ipv6_ospf6_interface_ifname_prefix,
-       show_ipv6_ospf6_interface_ifname_prefix_match_cmd,
-       "show ipv6 ospf6 interface IFNAME prefix X:X::X:X/M (match|detail)",
-       SHOW_STR
-       IP6_STR
-       OSPF6_STR
-       INTERFACE_STR
-       IFNAME_STR
-       "Display connected prefixes to advertise\n"
-       OSPF6_ROUTE_PREFIX_STR
-       OSPF6_ROUTE_MATCH_STR
-       "Display details of the prefixes\n"
-       )
 
+/*
+ * CHECK ME - The following ALIASes need to be implemented in this DEFUN
+ * "show ipv6 ospf6 interface prefix X:X::X:X/M (match|detail)",
+ *     SHOW_STR
+ *     IP6_STR
+ *     OSPF6_STR
+ *     INTERFACE_STR
+ *     "Display connected prefixes to advertise\n"
+ *     OSPF6_ROUTE_PREFIX_STR
+ *     OSPF6_ROUTE_MATCH_STR
+ *     "Display details of the prefixes\n"
+ *     
+ *
+ * "show ipv6 ospf6 interface prefix (X:X::X:X|X:X::X:X/M|detail)",
+ *     SHOW_STR
+ *     IP6_STR
+ *     OSPF6_STR
+ *     INTERFACE_STR
+ *     "Display connected prefixes to advertise\n"
+ *     OSPF6_ROUTE_ADDRESS_STR
+ *     OSPF6_ROUTE_PREFIX_STR
+ *     "Display details of the prefixes\n"
+ *     
+ *
+ */
 DEFUN (show_ipv6_ospf6_interface_prefix,
        show_ipv6_ospf6_interface_prefix_cmd,
        "show ipv6 ospf6 interface prefix",
@@ -1117,37 +1145,13 @@ DEFUN (show_ipv6_ospf6_interface_prefix,
   return CMD_SUCCESS;
 }
 
-ALIAS (show_ipv6_ospf6_interface_prefix,
-       show_ipv6_ospf6_interface_prefix_detail_cmd,
-       "show ipv6 ospf6 interface prefix (X:X::X:X|X:X::X:X/M|detail)",
-       SHOW_STR
-       IP6_STR
-       OSPF6_STR
-       INTERFACE_STR
-       "Display connected prefixes to advertise\n"
-       OSPF6_ROUTE_ADDRESS_STR
-       OSPF6_ROUTE_PREFIX_STR
-       "Display details of the prefixes\n"
-       )
 
-ALIAS (show_ipv6_ospf6_interface_prefix,
-       show_ipv6_ospf6_interface_prefix_match_cmd,
-       "show ipv6 ospf6 interface prefix X:X::X:X/M (match|detail)",
-       SHOW_STR
-       IP6_STR
-       OSPF6_STR
-       INTERFACE_STR
-       "Display connected prefixes to advertise\n"
-       OSPF6_ROUTE_PREFIX_STR
-       OSPF6_ROUTE_MATCH_STR
-       "Display details of the prefixes\n"
-       )
 
 
 /* interface variable set command */
 DEFUN (ipv6_ospf6_ifmtu,
        ipv6_ospf6_ifmtu_cmd,
-       "ipv6 ospf6 ifmtu <1-65535>",
+       "ipv6 ospf6 ifmtu (1-65535)",
        IP6_STR
        OSPF6_STR
        "Interface MTU\n"
@@ -1168,7 +1172,7 @@ DEFUN (ipv6_ospf6_ifmtu,
     oi = ospf6_interface_create (ifp);
   assert (oi);
 
-  ifmtu = strtol (argv[0], NULL, 10);
+  ifmtu = strtol (argv[3]->arg, NULL, 10);
 
   if (oi->ifmtu == ifmtu)
     return CMD_SUCCESS;
@@ -1255,7 +1259,7 @@ DEFUN (no_ipv6_ospf6_ifmtu,
 
 DEFUN (ipv6_ospf6_cost,
        ipv6_ospf6_cost_cmd,
-       "ipv6 ospf6 cost <1-65535>",
+       "ipv6 ospf6 cost (1-65535)",
        IP6_STR
        OSPF6_STR
        "Interface cost\n"
@@ -1274,7 +1278,7 @@ DEFUN (ipv6_ospf6_cost,
     oi = ospf6_interface_create (ifp);
   assert (oi);
 
-  lcost = strtol (argv[0], NULL, 10);
+  lcost = strtol (argv[3]->arg, NULL, 10);
 
   if (lcost > UINT32_MAX)
     {
@@ -1322,7 +1326,7 @@ DEFUN (no_ipv6_ospf6_cost,
 
 DEFUN (auto_cost_reference_bandwidth,
        auto_cost_reference_bandwidth_cmd,
-       "auto-cost reference-bandwidth <1-4294967>",
+       "auto-cost reference-bandwidth (1-4294967)",
        "Calculate OSPF interface cost according to bandwidth\n"
        "Use reference bandwidth method to assign OSPF cost\n"
        "The reference bandwidth in terms of Mbits per second\n")
@@ -1333,7 +1337,7 @@ DEFUN (auto_cost_reference_bandwidth,
   struct listnode *i, *j;
   u_int32_t refbw;
 
-  refbw = strtol (argv[0], NULL, 10);
+  refbw = strtol (argv[2]->arg, NULL, 10);
   if (refbw < 1 || refbw > 4294967)
     {
       vty_out (vty, "reference-bandwidth value is invalid%s", VTY_NEWLINE);
@@ -1352,6 +1356,15 @@ DEFUN (auto_cost_reference_bandwidth,
   return CMD_SUCCESS;
 }
 
+/*
+ * CHECK ME - The following ALIASes need to be implemented in this DEFUN
+ * "no auto-cost reference-bandwidth <1-4294967>",
+ *     NO_STR
+ *     "Calculate OSPF interface cost according to bandwidth\n"
+ *     "Use reference bandwidth method to assign OSPF cost\n"
+ *     "The reference bandwidth in terms of Mbits per second\n"
+ *
+ */
 DEFUN (no_auto_cost_reference_bandwidth,
        no_auto_cost_reference_bandwidth_cmd,
        "no auto-cost reference-bandwidth",
@@ -1375,17 +1388,10 @@ DEFUN (no_auto_cost_reference_bandwidth,
   return CMD_SUCCESS;
 }
 
-ALIAS (no_auto_cost_reference_bandwidth,
-       no_auto_cost_reference_bandwidth_val_cmd,
-       "no auto-cost reference-bandwidth <1-4294967>",
-       NO_STR
-       "Calculate OSPF interface cost according to bandwidth\n"
-       "Use reference bandwidth method to assign OSPF cost\n"
-       "The reference bandwidth in terms of Mbits per second\n")
 
 DEFUN (ipv6_ospf6_hellointerval,
        ipv6_ospf6_hellointerval_cmd,
-       "ipv6 ospf6 hello-interval <1-65535>",
+       "ipv6 ospf6 hello-interval (1-65535)",
        IP6_STR
        OSPF6_STR
        "Interval time of Hello packets\n"
@@ -1403,14 +1409,14 @@ DEFUN (ipv6_ospf6_hellointerval,
     oi = ospf6_interface_create (ifp);
   assert (oi);
 
-  oi->hello_interval = strtol (argv[0], NULL, 10);
+  oi->hello_interval = strtol (argv[3]->arg, NULL, 10);
   return CMD_SUCCESS;
 }
 
 /* interface variable set command */
 DEFUN (ipv6_ospf6_deadinterval,
        ipv6_ospf6_deadinterval_cmd,
-       "ipv6 ospf6 dead-interval <1-65535>",
+       "ipv6 ospf6 dead-interval (1-65535)",
        IP6_STR
        OSPF6_STR
        "Interval time after which a neighbor is declared down\n"
@@ -1428,14 +1434,14 @@ DEFUN (ipv6_ospf6_deadinterval,
     oi = ospf6_interface_create (ifp);
   assert (oi);
 
-  oi->dead_interval = strtol (argv[0], NULL, 10);
+  oi->dead_interval = strtol (argv[3]->arg, NULL, 10);
   return CMD_SUCCESS;
 }
 
 /* interface variable set command */
 DEFUN (ipv6_ospf6_transmitdelay,
        ipv6_ospf6_transmitdelay_cmd,
-       "ipv6 ospf6 transmit-delay <1-3600>",
+       "ipv6 ospf6 transmit-delay (1-3600)",
        IP6_STR
        OSPF6_STR
        "Transmit delay of this interface\n"
@@ -1453,14 +1459,14 @@ DEFUN (ipv6_ospf6_transmitdelay,
     oi = ospf6_interface_create (ifp);
   assert (oi);
 
-  oi->transdelay = strtol (argv[0], NULL, 10);
+  oi->transdelay = strtol (argv[3]->arg, NULL, 10);
   return CMD_SUCCESS;
 }
 
 /* interface variable set command */
 DEFUN (ipv6_ospf6_retransmitinterval,
        ipv6_ospf6_retransmitinterval_cmd,
-       "ipv6 ospf6 retransmit-interval <1-65535>",
+       "ipv6 ospf6 retransmit-interval (1-65535)",
        IP6_STR
        OSPF6_STR
        "Time between retransmitting lost link state advertisements\n"
@@ -1478,14 +1484,14 @@ DEFUN (ipv6_ospf6_retransmitinterval,
     oi = ospf6_interface_create (ifp);
   assert (oi);
 
-  oi->rxmt_interval = strtol (argv[0], NULL, 10);
+  oi->rxmt_interval = strtol (argv[3]->arg, NULL, 10);
   return CMD_SUCCESS;
 }
 
 /* interface variable set command */
 DEFUN (ipv6_ospf6_priority,
        ipv6_ospf6_priority_cmd,
-       "ipv6 ospf6 priority <0-255>",
+       "ipv6 ospf6 priority (0-255)",
        IP6_STR
        OSPF6_STR
        "Router priority\n"
@@ -1503,7 +1509,7 @@ DEFUN (ipv6_ospf6_priority,
     oi = ospf6_interface_create (ifp);
   assert (oi);
 
-  oi->priority = strtol (argv[0], NULL, 10);
+  oi->priority = strtol (argv[3]->arg, NULL, 10);
 
   if (oi->area &&
       (oi->state == OSPF6_INTERFACE_DROTHER ||
@@ -1516,7 +1522,7 @@ DEFUN (ipv6_ospf6_priority,
 
 DEFUN (ipv6_ospf6_instance,
        ipv6_ospf6_instance_cmd,
-       "ipv6 ospf6 instance-id <0-255>",
+       "ipv6 ospf6 instance-id (0-255)",
        IP6_STR
        OSPF6_STR
        "Instance ID for this interface\n"
@@ -1534,7 +1540,7 @@ DEFUN (ipv6_ospf6_instance,
     oi = ospf6_interface_create (ifp);
   assert (oi);
 
-  oi->instance_id = strtol (argv[0], NULL, 10);
+  oi->instance_id = strtol (argv[3]->arg, NULL, 10);
   return CMD_SUCCESS;
 }
 
@@ -1671,7 +1677,7 @@ DEFUN (ipv6_ospf6_advertise_prefix_list,
 
   if (oi->plist_name)
     XFREE (MTYPE_CFG_PLIST_NAME, oi->plist_name);
-  oi->plist_name = XSTRDUP (MTYPE_CFG_PLIST_NAME, argv[0]);
+  oi->plist_name = XSTRDUP (MTYPE_CFG_PLIST_NAME, argv[4]->arg);
 
   ospf6_interface_connected_route_update (oi->interface);
 
@@ -1734,7 +1740,7 @@ DEFUN (no_ipv6_ospf6_advertise_prefix_list,
 
 DEFUN (ipv6_ospf6_network,
        ipv6_ospf6_network_cmd,
-       "ipv6 ospf6 network (broadcast|point-to-point)",
+       "ipv6 ospf6 network <broadcast|point-to-point>",
        IP6_STR
        OSPF6_STR
        "Network Type\n"
@@ -1754,14 +1760,14 @@ DEFUN (ipv6_ospf6_network,
   }
   assert (oi);
 
-  if (strncmp (argv[0], "b", 1) == 0)
+  if (strncmp (argv[3]->arg, "b", 1) == 0)
     {
       if (oi->type == OSPF_IFTYPE_BROADCAST)
        return CMD_SUCCESS;
 
       oi->type = OSPF_IFTYPE_BROADCAST;
     }
-    else if (strncmp (argv[0], "point-to-p", 10) == 0)
+    else if (strncmp (argv[3]->arg, "point-to-p", 10) == 0)
       {
        if (oi->type == OSPF_IFTYPE_POINTOPOINT) {
          return CMD_SUCCESS;
@@ -1899,22 +1905,12 @@ ospf6_interface_init (void)
   /* Install interface node. */
   install_node (&interface_node, config_write_ospf6_interface);
 
-  install_element (VIEW_NODE, &show_ipv6_ospf6_interface_cmd);
   install_element (VIEW_NODE, &show_ipv6_ospf6_interface_prefix_cmd);
-  install_element (VIEW_NODE, &show_ipv6_ospf6_interface_prefix_detail_cmd);
-  install_element (VIEW_NODE, &show_ipv6_ospf6_interface_prefix_match_cmd);
   install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_cmd);
   install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_cmd);
-  install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd);
-  install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd);
-  install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_cmd);
   install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_cmd);
-  install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_detail_cmd);
-  install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_match_cmd);
   install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_cmd);
   install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_cmd);
-  install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd);
-  install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd);
 
   install_element (CONFIG_NODE, &interface_cmd);
   install_default (INTERFACE_NODE);
@@ -1946,7 +1942,6 @@ ospf6_interface_init (void)
   /* reference bandwidth commands */
   install_element (OSPF6_NODE, &auto_cost_reference_bandwidth_cmd);
   install_element (OSPF6_NODE, &no_auto_cost_reference_bandwidth_cmd);
-  install_element (OSPF6_NODE, &no_auto_cost_reference_bandwidth_val_cmd);
 }
 
 /* Clear the specified interface structure */
@@ -1992,9 +1987,9 @@ DEFUN (clear_ipv6_ospf6_interface,
     }
   else /* Interface name is specified. */
     {
-      if ((ifp = if_lookup_by_name (argv[0])) == NULL)
+      if ((ifp = if_lookup_by_name (argv[4]->arg)) == NULL)
         {
-          vty_out (vty, "No such Interface: %s%s", argv[0], VNL);
+          vty_out (vty, "No such Interface: %s%s", argv[4]->arg, VNL);
           return CMD_WARNING;
         }
       ospf6_interface_clear (vty, ifp);