diff options
-rw-r--r-- | ospf6d/ospf6_area.c | 78 | ||||
-rw-r--r-- | ospf6d/ospf6_asbr.c | 28 | ||||
-rw-r--r-- | ospf6d/ospf6_bfd.c | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_interface.c | 38 | ||||
-rw-r--r-- | ospf6d/ospf6_intra.c | 4 | ||||
-rw-r--r-- | ospf6d/ospf6_lsa.c | 20 | ||||
-rw-r--r-- | ospf6d/ospf6_message.c | 36 | ||||
-rw-r--r-- | ospf6d/ospf6_neighbor.c | 16 | ||||
-rw-r--r-- | ospf6d/ospf6_route.c | 52 | ||||
-rw-r--r-- | ospf6d/ospf6_route.h | 4 | ||||
-rw-r--r-- | ospf6d/ospf6_spf.c | 6 | ||||
-rw-r--r-- | ospf6d/ospf6_top.c | 75 | ||||
-rw-r--r-- | ospf6d/ospf6_zebra.c | 8 | ||||
-rw-r--r-- | ospf6d/ospf6d.c | 133 | ||||
-rwxr-xr-x | tools/argv_translator.py | 2 |
15 files changed, 216 insertions, 286 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index 490d4d251..cd11cd2a8 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -448,12 +448,12 @@ DEFUN (area_range, struct ospf6_route *range; u_int32_t cost = OSPF_AREA_RANGE_COST_UNSPEC; - OSPF6_CMD_AREA_GET (argv[0], oa); + OSPF6_CMD_AREA_GET (argv[1]->arg, oa); - ret = str2prefix (argv[1], &prefix); + ret = str2prefix (argv[3]->arg, &prefix); if (ret != 1 || prefix.family != AF_INET6) { - vty_out (vty, "Malformed argument: %s%s", argv[1], VNL); + vty_out (vty, "Malformed argument: %s%s", argv[3]->arg, VNL); return CMD_SUCCESS; } @@ -471,24 +471,24 @@ DEFUN (area_range, if (argc > 2) { - if (strcmp (argv[2], "not-advertise") == 0) + if (strcmp (argv[4]->arg, "not-advertise") == 0) { SET_FLAG (range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE); } - else if (strcmp (argv[2], "advertise") == 0) + else if (strcmp (argv[4]->arg, "advertise") == 0) { UNSET_FLAG (range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE); } else { - VTY_GET_INTEGER_RANGE ("cost", cost, argv[2], 0, OSPF_LS_INFINITY); + VTY_GET_INTEGER_RANGE ("cost", cost, argv[5]->arg, 0, OSPF_LS_INFINITY); UNSET_FLAG (range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE); } } range->path.u.cost_config = cost; - zlog_debug ("%s: for prefix %s, flag = %x\n", __func__, argv[1], range->flag); + zlog_debug ("%s: for prefix %s, flag = %x\n", __func__, argv[3]->arg, range->flag); if (range->rnode == NULL) { ospf6_route_add (range, oa->range_table); @@ -546,21 +546,21 @@ DEFUN (no_area_range, struct prefix prefix; struct ospf6_route *range, *route; - OSPF6_CMD_AREA_GET (argv[0], oa); + OSPF6_CMD_AREA_GET (argv[2]->arg, oa); argc--; argv++; - ret = str2prefix (argv[0], &prefix); + ret = str2prefix (argv[2]->arg, &prefix); if (ret != 1 || prefix.family != AF_INET6) { - vty_out (vty, "Malformed argument: %s%s", argv[0], VNL); + vty_out (vty, "Malformed argument: %s%s", argv[2]->arg, VNL); return CMD_SUCCESS; } range = ospf6_route_lookup (&prefix, oa->range_table); if (range == NULL) { - vty_out (vty, "Range %s does not exists.%s", argv[0], VNL); + vty_out (vty, "Range %s does not exists.%s", argv[2]->arg, VNL); return CMD_SUCCESS; } @@ -680,18 +680,18 @@ DEFUN (area_filter_list, struct ospf6_area *area; struct prefix_list *plist; - OSPF6_CMD_AREA_GET (argv[0], area); + OSPF6_CMD_AREA_GET (argv[1]->arg, area); argc--; argv++; - plist = prefix_list_lookup (AFI_IP6, argv[0]); - if (strncmp (argv[1], "in", 2) == 0) + plist = prefix_list_lookup (AFI_IP6, argv[1]->arg); + if (strncmp (argv[4]->arg, "in", 2) == 0) { PREFIX_LIST_IN (area) = plist; if (PREFIX_NAME_IN (area)) free (PREFIX_NAME_IN (area)); - PREFIX_NAME_IN (area) = strdup (argv[0]); + PREFIX_NAME_IN (area) = strdup (argv[1]->arg); ospf6_abr_reimport (area); } else @@ -700,7 +700,7 @@ DEFUN (area_filter_list, if (PREFIX_NAME_OUT (area)) free (PREFIX_NAME_OUT (area)); - PREFIX_NAME_OUT (area) = strdup (argv[0]); + PREFIX_NAME_OUT (area) = strdup (argv[1]->arg); ospf6_abr_enable_area (area); } @@ -721,14 +721,14 @@ DEFUN (no_area_filter_list, { struct ospf6_area *area; - OSPF6_CMD_AREA_GET (argv[0], area); + OSPF6_CMD_AREA_GET (argv[2]->arg, area); argc--; argv++; - if (strncmp (argv[1], "in", 2) == 0) + if (strncmp (argv[5]->arg, "in", 2) == 0) { if (PREFIX_NAME_IN (area)) - if (strcmp (PREFIX_NAME_IN (area), argv[0]) != 0) + if (strcmp (PREFIX_NAME_IN (area), argv[2]->arg) != 0) return CMD_SUCCESS; PREFIX_LIST_IN (area) = NULL; @@ -741,7 +741,7 @@ DEFUN (no_area_filter_list, else { if (PREFIX_NAME_OUT (area)) - if (strcmp (PREFIX_NAME_OUT (area), argv[0]) != 0) + if (strcmp (PREFIX_NAME_OUT (area), argv[2]->arg) != 0) return CMD_SUCCESS; PREFIX_LIST_OUT (area) = NULL; @@ -766,16 +766,16 @@ DEFUN (area_import_list, struct ospf6_area *area; struct access_list *list; - OSPF6_CMD_AREA_GET(argv[0], area); + OSPF6_CMD_AREA_GET(argv[1]->arg, area); - list = access_list_lookup (AFI_IP6, argv[1]); + list = access_list_lookup (AFI_IP6, argv[3]->arg); IMPORT_LIST (area) = list; if (IMPORT_NAME (area)) free (IMPORT_NAME (area)); - IMPORT_NAME (area) = strdup (argv[1]); + IMPORT_NAME (area) = strdup (argv[3]->arg); ospf6_abr_reimport (area); return CMD_SUCCESS; @@ -791,7 +791,7 @@ DEFUN (no_area_import_list, { struct ospf6_area *area; - OSPF6_CMD_AREA_GET(argv[0], area); + OSPF6_CMD_AREA_GET(argv[2]->arg, area); IMPORT_LIST (area) = 0; @@ -815,16 +815,16 @@ DEFUN (area_export_list, struct ospf6_area *area; struct access_list *list; - OSPF6_CMD_AREA_GET(argv[0], area); + OSPF6_CMD_AREA_GET(argv[1]->arg, area); - list = access_list_lookup (AFI_IP6, argv[1]); + list = access_list_lookup (AFI_IP6, argv[3]->arg); EXPORT_LIST (area) = list; if (EXPORT_NAME (area)) free (EXPORT_NAME (area)); - EXPORT_NAME (area) = strdup (argv[1]); + EXPORT_NAME (area) = strdup (argv[3]->arg); ospf6_abr_enable_area (area); return CMD_SUCCESS; @@ -840,7 +840,7 @@ DEFUN (no_area_export_list, { struct ospf6_area *area; - OSPF6_CMD_AREA_GET(argv[0], area); + OSPF6_CMD_AREA_GET(argv[2]->arg, area); EXPORT_LIST (area) = 0; @@ -909,15 +909,15 @@ DEFUN (show_ipv6_ospf6_area_spf_tree, ospf6_linkstate_prefix (ospf6->router_id, htonl (0), &prefix); - if (inet_pton (AF_INET, argv[0], &area_id) != 1) + if (inet_pton (AF_INET, argv[4]->arg, &area_id) != 1) { - vty_out (vty, "Malformed Area-ID: %s%s", argv[0], VNL); + vty_out (vty, "Malformed Area-ID: %s%s", argv[4]->arg, VNL); return CMD_SUCCESS; } oa = ospf6_area_lookup (area_id, ospf6); if (oa == NULL) { - vty_out (vty, "No such Area: %s%s", argv[0], VNL); + vty_out (vty, "No such Area: %s%s", argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -955,18 +955,18 @@ DEFUN (show_ipv6_ospf6_simulate_spf_tree_root, OSPF6_CMD_CHECK_RUNNING (); - inet_pton (AF_INET, argv[0], &router_id); + inet_pton (AF_INET, argv[5]->arg, &router_id); ospf6_linkstate_prefix (router_id, htonl (0), &prefix); - if (inet_pton (AF_INET, argv[1], &area_id) != 1) + if (inet_pton (AF_INET, argv[7]->arg, &area_id) != 1) { - vty_out (vty, "Malformed Area-ID: %s%s", argv[1], VNL); + vty_out (vty, "Malformed Area-ID: %s%s", argv[7]->arg, VNL); return CMD_SUCCESS; } oa = ospf6_area_lookup (area_id, ospf6); if (oa == NULL) { - vty_out (vty, "No such Area: %s%s", argv[1], VNL); + vty_out (vty, "No such Area: %s%s", argv[7]->arg, VNL); return CMD_SUCCESS; } @@ -1004,7 +1004,7 @@ DEFUN (ospf6_area_stub, { struct ospf6_area *area; - OSPF6_CMD_AREA_GET(argv[0], area); + OSPF6_CMD_AREA_GET(argv[1]->arg, area); if (!ospf6_area_stub_set (ospf6, area)) { @@ -1029,7 +1029,7 @@ DEFUN (ospf6_area_stub_no_summary, { struct ospf6_area *area; - OSPF6_CMD_AREA_GET(argv[0], area); + OSPF6_CMD_AREA_GET(argv[1]->arg, area); if (!ospf6_area_stub_set (ospf6, area)) { @@ -1054,7 +1054,7 @@ DEFUN (no_ospf6_area_stub, { struct ospf6_area *area; - OSPF6_CMD_AREA_GET(argv[0], area); + OSPF6_CMD_AREA_GET(argv[2]->arg, area); ospf6_area_stub_unset (ospf6, area); ospf6_area_no_summary_unset (ospf6, area); @@ -1074,7 +1074,7 @@ DEFUN (no_ospf6_area_stub_no_summary, { struct ospf6_area *area; - OSPF6_CMD_AREA_GET(argv[0], area); + OSPF6_CMD_AREA_GET(argv[2]->arg, area); ospf6_area_stub_unset (ospf6, area); ospf6_area_no_summary_unset (ospf6, area); diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 208d3b8c4..f513e68f7 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -649,7 +649,7 @@ DEFUN (ospf6_redistribute, { int type; - type = proto_redistnum(AFI_IP6, argv[0]); + type = proto_redistnum(AFI_IP6, argv[2]->arg); if (type < 0 || type == ZEBRA_ROUTE_OSPF6) return CMD_WARNING; @@ -669,12 +669,12 @@ DEFUN (ospf6_redistribute_routemap, { int type; - type = proto_redistnum(AFI_IP6, argv[0]); + type = proto_redistnum(AFI_IP6, argv[1]->arg); if (type < 0 || type == ZEBRA_ROUTE_OSPF6) return CMD_WARNING; ospf6_asbr_redistribute_unset (type); - ospf6_asbr_routemap_set (type, argv[1]); + ospf6_asbr_routemap_set (type, argv[3]->arg); ospf6_asbr_redistribute_set (type); return CMD_SUCCESS; } @@ -689,7 +689,7 @@ DEFUN (no_ospf6_redistribute, { int type; - type = proto_redistnum(AFI_IP6, argv[0]); + type = proto_redistnum(AFI_IP6, argv[3]->arg); if (type < 0 || type == ZEBRA_ROUTE_OSPF6) return CMD_WARNING; @@ -1018,7 +1018,7 @@ DEFUN (ospf6_routemap_match_address_prefixlist, "IPv6 prefix-list name\n") { int ret = route_map_add_match ((struct route_map_index *) vty->index, - "ipv6 address prefix-list", argv[0]); + "ipv6 address prefix-list", argv[4]->arg); return route_map_command_status (vty, ret); } @@ -1034,7 +1034,7 @@ DEFUN (ospf6_routemap_no_match_address_prefixlist, "IPv6 prefix-list name\n") { int ret = route_map_delete_match ((struct route_map_index *) vty->index, - "ipv6 address prefix-list", argv[0]); + "ipv6 address prefix-list", argv[5]->arg); return route_map_command_status (vty, ret); } @@ -1047,7 +1047,7 @@ DEFUN (ospf6_routemap_match_interface, "Interface name\n") { return route_map_add_match ((struct route_map_index *) vty->index, - "interface", argv[0]); + "interface", argv[2]->arg); } /* "no match interface WORD" */ @@ -1059,7 +1059,7 @@ DEFUN (ospf6_routemap_no_match_interface, "Match first hop interface of route\n") { int ret = route_map_delete_match ((struct route_map_index *) vty->index, - "interface", (argc == 0) ? NULL : argv[0]); + "interface", argv[3]->arg); return route_map_command_status (vty, ret); } @@ -1081,7 +1081,7 @@ DEFUN (ospf6_routemap_set_metric_type, "OSPF6 external type 2 metric\n") { int ret = route_map_add_set ((struct route_map_index *) vty->index, - "metric-type", argv[0]); + "metric-type", argv[2]->arg); return route_map_command_status (vty, ret); } @@ -1096,7 +1096,7 @@ DEFUN (ospf6_routemap_no_set_metric_type, "OSPF6 external type 2 metric\n") { int ret = route_map_delete_set ((struct route_map_index *) vty->index, - "metric-type", argv[0]); + "metric-type", argv[3]->arg); return route_map_command_status (vty, ret); } @@ -1109,7 +1109,7 @@ DEFUN (set_metric, "Metric value\n") { int ret = route_map_add_set ((struct route_map_index *) vty->index, - "metric", argv[0]); + "metric", argv[2]->arg); return route_map_command_status (vty, ret); } @@ -1128,7 +1128,7 @@ DEFUN (no_set_metric, "metric", NULL); else ret = route_map_delete_set ((struct route_map_index *) vty->index, - "metric", argv[0]); + "metric", argv[3]->arg); return route_map_command_status (vty, ret); } @@ -1149,7 +1149,7 @@ DEFUN (ospf6_routemap_set_forwarding, "IPv6 Address\n") { int ret = route_map_add_set ((struct route_map_index *) vty->index, - "forwarding-address", argv[0]); + "forwarding-address", argv[2]->arg); return route_map_command_status (vty, ret); } @@ -1163,7 +1163,7 @@ DEFUN (ospf6_routemap_no_set_forwarding, "IPv6 Address\n") { int ret = route_map_delete_set ((struct route_map_index *) vty->index, - "forwarding-address", argv[0]); + "forwarding-address", argv[3]->arg); return route_map_command_status (vty, ret); } diff --git a/ospf6d/ospf6_bfd.c b/ospf6d/ospf6_bfd.c index f9bb6f003..29368cb9b 100644 --- a/ospf6d/ospf6_bfd.c +++ b/ospf6d/ospf6_bfd.c @@ -369,7 +369,7 @@ DEFUN (ipv6_ospf6_bfd_param, oi = ospf6_interface_create (ifp); assert (oi); - if ((ret = bfd_validate_param (vty, argv[0], argv[1], argv[2], &dm_val, + if ((ret = bfd_validate_param (vty, argv[3]->arg, argv[4]->arg, argv[5]->arg, &dm_val, &rx_val, &tx_val)) != CMD_SUCCESS) return ret; diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index f4835d053..e53fb2180 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -1001,10 +1001,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; } @@ -1042,17 +1042,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; } @@ -1168,7 +1168,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; @@ -1274,7 +1274,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) { @@ -1333,7 +1333,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); @@ -1403,7 +1403,7 @@ 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; } @@ -1428,7 +1428,7 @@ 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; } @@ -1453,7 +1453,7 @@ 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; } @@ -1478,7 +1478,7 @@ 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; } @@ -1503,7 +1503,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 || @@ -1534,7 +1534,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 +1671,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); @@ -1754,14 +1754,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; @@ -1992,9 +1992,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); diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index 5b92212da..6ed46f5cd 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -1731,7 +1731,7 @@ DEFUN (debug_ospf6_brouter_router, ) { u_int32_t router_id; - inet_pton (AF_INET, argv[0], &router_id); + inet_pton (AF_INET, argv[4]->arg, &router_id); OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ON (router_id); return CMD_SUCCESS; } @@ -1761,7 +1761,7 @@ DEFUN (debug_ospf6_brouter_area, ) { u_int32_t area_id; - inet_pton (AF_INET, argv[0], &area_id); + inet_pton (AF_INET, argv[4]->arg, &area_id); OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ON (area_id); return CMD_SUCCESS; } diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 35e5a9154..fbc72d6fe 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -835,9 +835,9 @@ DEFUN (debug_ospf6_lsa_type, handler = vector_slot (ospf6_lsa_handler_vector, i); if (handler == NULL) continue; - if (strncmp (argv[0], ospf6_lsa_handler_name(handler), strlen(argv[0])) == 0) + if (strncmp (argv[3]->arg, ospf6_lsa_handler_name(handler), strlen(argv[3]->arg)) == 0) break; - if (! strcasecmp (argv[0], handler->name)) + if (! strcasecmp (argv[3]->arg, handler->name)) break; handler = NULL; } @@ -847,11 +847,11 @@ DEFUN (debug_ospf6_lsa_type, if (argc >= 2) { - if (! strcmp (argv[1], "originate")) + if (! strcmp (argv[4]->arg, "originate")) SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE); - if (! strcmp (argv[1], "examine")) + if (! strcmp (argv[4]->arg, "examine")) SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN); - if (! strcmp (argv[1], "flooding")) + if (! strcmp (argv[4]->arg, "flooding")) SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD); } else @@ -889,9 +889,9 @@ DEFUN (no_debug_ospf6_lsa_type, handler = vector_slot (ospf6_lsa_handler_vector, i); if (handler == NULL) continue; - if (strncmp (argv[0], ospf6_lsa_handler_name(handler), strlen(argv[0])) == 0) + if (strncmp (argv[4]->arg, ospf6_lsa_handler_name(handler), strlen(argv[4]->arg)) == 0) break; - if (! strcasecmp (argv[0], handler->name)) + if (! strcasecmp (argv[4]->arg, handler->name)) break; } @@ -900,11 +900,11 @@ DEFUN (no_debug_ospf6_lsa_type, if (argc >= 2) { - if (! strcmp (argv[1], "originate")) + if (! strcmp (argv[5]->arg, "originate")) UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE); - if (! strcmp (argv[1], "examine")) + if (! strcmp (argv[5]->arg, "examine")) UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN); - if (! strcmp (argv[1], "flooding")) + if (! strcmp (argv[5]->arg, "flooding")) UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD); } else diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index b0e94288b..adaef2f9f 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -2360,26 +2360,26 @@ DEFUN (debug_ospf6_message, assert (argc > 0); /* check type */ - if (! strncmp (argv[0], "u", 1)) + if (! strncmp (argv[3]->arg, "u", 1)) type = OSPF6_MESSAGE_TYPE_UNKNOWN; - else if (! strncmp (argv[0], "h", 1)) + else if (! strncmp (argv[3]->arg, "h", 1)) type = OSPF6_MESSAGE_TYPE_HELLO; - else if (! strncmp (argv[0], "d", 1)) + else if (! strncmp (argv[3]->arg, "d", 1)) type = OSPF6_MESSAGE_TYPE_DBDESC; - else if (! strncmp (argv[0], "lsr", 3)) + else if (! strncmp (argv[3]->arg, "lsr", 3)) type = OSPF6_MESSAGE_TYPE_LSREQ; - else if (! strncmp (argv[0], "lsu", 3)) + else if (! strncmp (argv[3]->arg, "lsu", 3)) type = OSPF6_MESSAGE_TYPE_LSUPDATE; - else if (! strncmp (argv[0], "lsa", 3)) + else if (! strncmp (argv[3]->arg, "lsa", 3)) type = OSPF6_MESSAGE_TYPE_LSACK; - else if (! strncmp (argv[0], "a", 1)) + else if (! strncmp (argv[3]->arg, "a", 1)) type = OSPF6_MESSAGE_TYPE_ALL; if (argc == 1) level = OSPF6_DEBUG_MESSAGE_SEND | OSPF6_DEBUG_MESSAGE_RECV; - else if (! strncmp (argv[1], "s", 1)) + else if (! strncmp (argv[4]->arg, "s", 1)) level = OSPF6_DEBUG_MESSAGE_SEND; - else if (! strncmp (argv[1], "r", 1)) + else if (! strncmp (argv[4]->arg, "r", 1)) level = OSPF6_DEBUG_MESSAGE_RECV; if (type == OSPF6_MESSAGE_TYPE_ALL) @@ -2434,26 +2434,26 @@ DEFUN (no_debug_ospf6_message, assert (argc > 0); /* check type */ - if (! strncmp (argv[0], "u", 1)) + if (! strncmp (argv[4]->arg, "u", 1)) type = OSPF6_MESSAGE_TYPE_UNKNOWN; - else if (! strncmp (argv[0], "h", 1)) + else if (! strncmp (argv[4]->arg, "h", 1)) type = OSPF6_MESSAGE_TYPE_HELLO; - else if (! strncmp (argv[0], "d", 1)) + else if (! strncmp (argv[4]->arg, "d", 1)) type = OSPF6_MESSAGE_TYPE_DBDESC; - else if (! strncmp (argv[0], "lsr", 3)) + else if (! strncmp (argv[4]->arg, "lsr", 3)) type = OSPF6_MESSAGE_TYPE_LSREQ; - else if (! strncmp (argv[0], "lsu", 3)) + else if (! strncmp (argv[4]->arg, "lsu", 3)) type = OSPF6_MESSAGE_TYPE_LSUPDATE; - else if (! strncmp (argv[0], "lsa", 3)) + else if (! strncmp (argv[4]->arg, "lsa", 3)) type = OSPF6_MESSAGE_TYPE_LSACK; - else if (! strncmp (argv[0], "a", 1)) + else if (! strncmp (argv[4]->arg, "a", 1)) type = OSPF6_MESSAGE_TYPE_ALL; if (argc == 1) level = OSPF6_DEBUG_MESSAGE_SEND | OSPF6_DEBUG_MESSAGE_RECV; - else if (! strncmp (argv[1], "s", 1)) + else if (! strncmp (argv[5]->arg, "s", 1)) level = OSPF6_DEBUG_MESSAGE_SEND; - else if (! strncmp (argv[1], "r", 1)) + else if (! strncmp (argv[5]->arg, "r", 1)) level = OSPF6_DEBUG_MESSAGE_RECV; if (type == OSPF6_MESSAGE_TYPE_ALL) diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c index 9b0285eee..3e0977162 100644 --- a/ospf6d/ospf6_neighbor.c +++ b/ospf6d/ospf6_neighbor.c @@ -847,9 +847,9 @@ DEFUN (show_ipv6_ospf6_neighbor, if (argc) { - if (! strncmp (argv[0], "de", 2)) + if (! strncmp (argv[4]->arg, "de", 2)) showfunc = ospf6_neighbor_show_detail; - else if (! strncmp (argv[0], "dr", 2)) + else if (! strncmp (argv[4]->arg, "dr", 2)) showfunc = ospf6_neighbor_show_drchoice; } @@ -901,9 +901,9 @@ DEFUN (show_ipv6_ospf6_neighbor_one, OSPF6_CMD_CHECK_RUNNING (); showfunc = ospf6_neighbor_show_detail; - if ((inet_pton (AF_INET, argv[0], &router_id)) != 1) + if ((inet_pton (AF_INET, argv[4]->arg, &router_id)) != 1) { - vty_out (vty, "Router-ID is not parsable: %s%s", argv[0], + vty_out (vty, "Router-ID is not parsable: %s%s", argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -936,9 +936,9 @@ DEFUN (debug_ospf6_neighbor, unsigned char level = 0; if (argc) { - if (! strncmp (argv[0], "s", 1)) + if (! strncmp (argv[3]->arg, "s", 1)) level = OSPF6_DEBUG_NEIGHBOR_STATE; - if (! strncmp (argv[0], "e", 1)) + if (! strncmp (argv[3]->arg, "e", 1)) level = OSPF6_DEBUG_NEIGHBOR_EVENT; } else @@ -970,9 +970,9 @@ DEFUN (no_debug_ospf6_neighbor, unsigned char level = 0; if (argc) { - if (! strncmp (argv[0], "s", 1)) + if (! strncmp (argv[4]->arg, "s", 1)) level = OSPF6_DEBUG_NEIGHBOR_STATE; - if (! strncmp (argv[0], "e", 1)) + if (! strncmp (argv[4]->arg, "e", 1)) level = OSPF6_DEBUG_NEIGHBOR_EVENT; } else diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 5172eee48..d5267354a 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -1298,7 +1298,7 @@ ospf6_route_show_table (struct vty *vty, int detail, } int -ospf6_route_table_show (struct vty *vty, int argc, const char *argv[], +ospf6_route_table_show (struct vty *vty, int argc, struct cmd_token **argv, struct ospf6_route_table *table) { int summary = 0; @@ -1314,58 +1314,58 @@ ospf6_route_table_show (struct vty *vty, int argc, const char *argv[], for (i = 0; i < argc; i++) { - if (! strcmp (argv[i], "summary")) + if (! strcmp (argv[i]->arg, "summary")) { summary++; continue; } - if (! strcmp (argv[i], "intra-area")) + if (! strcmp (argv[i]->arg, "intra-area")) { type = OSPF6_PATH_TYPE_INTRA; continue; } - if (! strcmp (argv[i], "inter-area")) + if (! strcmp (argv[i]->arg, "inter-area")) { type = OSPF6_PATH_TYPE_INTER; continue; } - if (! strcmp (argv[i], "external-1")) + if (! strcmp (argv[i]->arg, "external-1")) { type = OSPF6_PATH_TYPE_EXTERNAL1; continue; } - if (! strcmp (argv[i], "external-2")) + if (! strcmp (argv[i]->arg, "external-2")) { type = OSPF6_PATH_TYPE_EXTERNAL2; continue; } - if (! strcmp (argv[i], "detail")) + if (! strcmp (argv[i]->arg, "detail")) { detail++; continue; } - if (! strcmp (argv[i], "match")) + if (! strcmp (argv[i]->arg, "match")) { match++; continue; } - ret = str2prefix (argv[i], &prefix); + ret = str2prefix (argv[i]->arg, &prefix); if (ret == 1 && prefix.family == AF_INET6) { isprefix++; - if (strchr (argv[i], '/')) + if (strchr (argv[i]->arg, '/')) slash++; continue; } - vty_out (vty, "Malformed argument: %s%s", argv[i], VNL); + vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); return CMD_SUCCESS; } @@ -1473,7 +1473,7 @@ ospf6_linkstate_show_table (struct vty *vty, int detail, } int -ospf6_linkstate_table_show (struct vty *vty, int argc, const char *argv[], +ospf6_linkstate_table_show (struct vty *vty, int argc, struct cmd_token **argv, struct ospf6_route_table *table) { int detail = 0; @@ -1488,7 +1488,7 @@ ospf6_linkstate_table_show (struct vty *vty, int argc, const char *argv[], for (i = 0; i < argc; i++) { - if (! strcmp (argv[i], "detail")) + if (! strcmp (argv[i]->arg, "detail")) { detail++; continue; @@ -1496,29 +1496,29 @@ ospf6_linkstate_table_show (struct vty *vty, int argc, const char *argv[], if (! is_router) { - ret = str2prefix (argv[i], &router); + ret = str2prefix (argv[i]->arg, &router); if (ret == 1 && router.family == AF_INET) { is_router++; continue; } - vty_out (vty, "Malformed argument: %s%s", argv[i], VNL); + vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); return CMD_SUCCESS; } if (! is_id) { - ret = str2prefix (argv[i], &id); + ret = str2prefix (argv[i]->arg, &id); if (ret == 1 && id.family == AF_INET) { is_id++; continue; } - vty_out (vty, "Malformed argument: %s%s", argv[i], VNL); + vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); return CMD_SUCCESS; } - vty_out (vty, "Malformed argument: %s%s", argv[i], VNL); + vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); return CMD_SUCCESS; } @@ -1575,13 +1575,13 @@ DEFUN (debug_ospf6_route, { unsigned char level = 0; - if (! strncmp (argv[0], "table", 5)) + if (! strncmp (argv[3]->arg, "table", 5)) level = OSPF6_DEBUG_ROUTE_TABLE; - else if (! strncmp (argv[0], "intra", 5)) + else if (! strncmp (argv[3]->arg, "intra", 5)) level = OSPF6_DEBUG_ROUTE_INTRA; - else if (! strncmp (argv[0], "inter", 5)) + else if (! strncmp (argv[3]->arg, "inter", 5)) level = OSPF6_DEBUG_ROUTE_INTER; - else if (! strncmp (argv[0], "memor", 5)) + else if (! strncmp (argv[3]->arg, "memor", 5)) level = OSPF6_DEBUG_ROUTE_MEMORY; OSPF6_DEBUG_ROUTE_ON (level); return CMD_SUCCESS; @@ -1599,13 +1599,13 @@ DEFUN (no_debug_ospf6_route, { unsigned char level = 0; - if (! strncmp (argv[0], "table", 5)) + if (! strncmp (argv[4]->arg, "table", 5)) level = OSPF6_DEBUG_ROUTE_TABLE; - else if (! strncmp (argv[0], "intra", 5)) + else if (! strncmp (argv[4]->arg, "intra", 5)) level = OSPF6_DEBUG_ROUTE_INTRA; - else if (! strncmp (argv[0], "inter", 5)) + else if (! strncmp (argv[4]->arg, "inter", 5)) level = OSPF6_DEBUG_ROUTE_INTER; - else if (! strncmp (argv[0], "memor", 5)) + else if (! strncmp (argv[4]->arg, "memor", 5)) level = OSPF6_DEBUG_ROUTE_MEMORY; OSPF6_DEBUG_ROUTE_OFF (level); return CMD_SUCCESS; diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h index 610b0970b..8c5ca4eb2 100644 --- a/ospf6d/ospf6_route.h +++ b/ospf6d/ospf6_route.h @@ -328,10 +328,10 @@ extern void ospf6_route_dump (struct ospf6_route_table *table); extern void ospf6_route_show (struct vty *vty, struct ospf6_route *route); extern void ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route); -extern int ospf6_route_table_show (struct vty *, int, const char *[], +extern int ospf6_route_table_show (struct vty *, int, struct cmd_token **, struct ospf6_route_table *); extern int ospf6_linkstate_table_show (struct vty *vty, int argc, - const char *argv[], + struct cmd_token **argv, struct ospf6_route_table *table); extern void ospf6_brouter_show_header (struct vty *vty); diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 957988b53..fe5006b24 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -893,9 +893,9 @@ DEFUN (ospf6_timers_throttle_spf, return CMD_WARNING; } - VTY_GET_INTEGER_RANGE ("SPF delay timer", delay, argv[0], 0, 600000); - VTY_GET_INTEGER_RANGE ("SPF hold timer", hold, argv[1], 0, 600000); - VTY_GET_INTEGER_RANGE ("SPF max-hold timer", max, argv[2], 0, 600000); + VTY_GET_INTEGER_RANGE ("SPF delay timer", delay, argv[3]->arg, 0, 600000); + VTY_GET_INTEGER_RANGE ("SPF hold timer", hold, argv[4]->arg, 0, 600000); + VTY_GET_INTEGER_RANGE ("SPF max-hold timer", max, argv[5]->arg, 0, 600000); return ospf6_timers_spf_set (vty, delay, hold, max); } diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 7feced007..e04f22fd0 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -330,10 +330,10 @@ DEFUN (ospf6_router_id, o = (struct ospf6 *) vty->index; - ret = inet_pton (AF_INET, argv[0], &router_id); + ret = inet_pton (AF_INET, argv[1]->arg, &router_id); if (ret == 0) { - vty_out (vty, "malformed OSPF Router-ID: %s%s", argv[0], VNL); + vty_out (vty, "malformed OSPF Router-ID: %s%s", argv[1]->arg, VNL); return CMD_SUCCESS; } @@ -416,7 +416,7 @@ DEFUN (ospf6_timers_lsa, return CMD_WARNING; } - VTY_GET_INTEGER ("LSA min-arrival", minarrival, argv[0]); + VTY_GET_INTEGER ("LSA min-arrival", minarrival, argv[3]->arg); ospf->lsa_minarrival = minarrival; @@ -439,7 +439,7 @@ DEFUN (no_ospf6_timers_lsa, if (argc) { - VTY_GET_INTEGER ("LSA min-arrival", minarrival, argv[0]); + VTY_GET_INTEGER ("LSA min-arrival", minarrival, argv[4]->arg); if (ospf->lsa_minarrival != minarrival || minarrival == OSPF_MIN_LS_ARRIVAL) @@ -478,7 +478,7 @@ DEFUN (ospf6_interface_area, o = (struct ospf6 *) vty->index; /* find/create ospf6 interface */ - ifp = if_get_by_name (argv[0]); + ifp = if_get_by_name (argv[1]->arg); oi = (struct ospf6_interface *) ifp->info; if (oi == NULL) oi = ospf6_interface_create (ifp); @@ -490,9 +490,9 @@ DEFUN (ospf6_interface_area, } /* parse Area-ID */ - if (inet_pton (AF_INET, argv[1], &area_id) != 1) + if (inet_pton (AF_INET, argv[3]->arg, &area_id) != 1) { - vty_out (vty, "Invalid Area-ID: %s%s", argv[1], VNL); + vty_out (vty, "Invalid Area-ID: %s%s", argv[3]->arg, VNL); return CMD_SUCCESS; } @@ -536,10 +536,10 @@ DEFUN (no_ospf6_interface_area, struct interface *ifp; u_int32_t area_id; - ifp = if_lookup_by_name (argv[0]); + ifp = if_lookup_by_name (argv[2]->arg); if (ifp == NULL) { - vty_out (vty, "No such interface %s%s", argv[0], VNL); + vty_out (vty, "No such interface %s%s", argv[2]->arg, VNL); return CMD_SUCCESS; } @@ -551,16 +551,16 @@ DEFUN (no_ospf6_interface_area, } /* parse Area-ID */ - if (inet_pton (AF_INET, argv[1], &area_id) != 1) + if (inet_pton (AF_INET, argv[4]->arg, &area_id) != 1) { - vty_out (vty, "Invalid Area-ID: %s%s", argv[1], VNL); + vty_out (vty, "Invalid Area-ID: %s%s", argv[4]->arg, VNL); return CMD_SUCCESS; } /* Verify Area */ if (oi->area == NULL) { - vty_out (vty, "No such Area-ID: %s%s", argv[1], VNL); + vty_out (vty, "No such Area-ID: %s%s", argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -813,19 +813,9 @@ DEFUN (show_ipv6_ospf6_route_match, "Display routes which match the specified route\n" ) { - const char *sargv[CMD_ARGC_MAX]; - int i, sargc; - OSPF6_CMD_CHECK_RUNNING (); - /* copy argv to sargv and then append "match" */ - for (i = 0; i < argc; i++) - sargv[i] = argv[i]; - sargc = argc; - sargv[sargc++] = "match"; - sargv[sargc] = NULL; - - ospf6_route_table_show (vty, sargc, sargv, ospf6->route_table); + ospf6_route_table_show (vty, argc, argv, ospf6->route_table); return CMD_SUCCESS; } @@ -841,20 +831,9 @@ DEFUN (show_ipv6_ospf6_route_match_detail, "Detailed information\n" ) { - const char *sargv[CMD_ARGC_MAX]; - int i, sargc; - - /* copy argv to sargv and then append "match" and "detail" */ - for (i = 0; i < argc; i++) - sargv[i] = argv[i]; - sargc = argc; - sargv[sargc++] = "match"; - sargv[sargc++] = "detail"; - sargv[sargc] = NULL; - OSPF6_CMD_CHECK_RUNNING (); - ospf6_route_table_show (vty, sargc, sargv, ospf6->route_table); + ospf6_route_table_show (vty, argc, argv, ospf6->route_table); return CMD_SUCCESS; } @@ -869,18 +848,6 @@ ALIAS (show_ipv6_ospf6_route_match, "Display routes longer than the specified route\n" ) -DEFUN (show_ipv6_ospf6_route_match_detail, - show_ipv6_ospf6_route_longer_detail_cmd, - "show ipv6 ospf6 route X:X::X:X/M longer detail", - SHOW_STR - IP6_STR - OSPF6_STR - ROUTE_STR - "Specify IPv6 prefix\n" - "Display routes longer than the specified route\n" - "Detailed information\n" - ); - ALIAS (show_ipv6_ospf6_route, show_ipv6_ospf6_route_type_cmd, "show ipv6 ospf6 route (intra-area|inter-area|external-1|external-2)", @@ -908,19 +875,9 @@ DEFUN (show_ipv6_ospf6_route_type_detail, "Detailed information\n" ) { - const char *sargv[CMD_ARGC_MAX]; - int i, sargc; - - /* copy argv to sargv and then append "detail" */ - for (i = 0; i < argc; i++) - sargv[i] = argv[i]; - sargc = argc; - sargv[sargc++] = "detail"; - sargv[sargc] = NULL; - OSPF6_CMD_CHECK_RUNNING (); - ospf6_route_table_show (vty, sargc, sargv, ospf6->route_table); + ospf6_route_table_show (vty, argc, argv, ospf6->route_table); return CMD_SUCCESS; } @@ -1012,7 +969,6 @@ ospf6_top_init (void) install_element (VIEW_NODE, &show_ipv6_ospf6_route_match_cmd); install_element (VIEW_NODE, &show_ipv6_ospf6_route_match_detail_cmd); install_element (VIEW_NODE, &show_ipv6_ospf6_route_longer_cmd); - install_element (VIEW_NODE, &show_ipv6_ospf6_route_longer_detail_cmd); install_element (VIEW_NODE, &show_ipv6_ospf6_route_type_cmd); install_element (VIEW_NODE, &show_ipv6_ospf6_route_type_detail_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_route_cmd); @@ -1020,7 +976,6 @@ ospf6_top_init (void) install_element (ENABLE_NODE, &show_ipv6_ospf6_route_match_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_route_match_detail_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_route_longer_cmd); - install_element (ENABLE_NODE, &show_ipv6_ospf6_route_longer_detail_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_route_type_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_route_type_detail_cmd); diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 77ea01e53..1e22a3517 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -721,9 +721,9 @@ DEFUN (debug_ospf6_zebra_sendrecv, if (argc) { - if (! strncmp (argv[0], "s", 1)) + if (! strncmp (argv[3]->arg, "s", 1)) level = OSPF6_DEBUG_ZEBRA_SEND; - else if (! strncmp (argv[0], "r", 1)) + else if (! strncmp (argv[3]->arg, "r", 1)) level = OSPF6_DEBUG_ZEBRA_RECV; } else @@ -757,9 +757,9 @@ DEFUN (no_debug_ospf6_zebra_sendrecv, if (argc) { - if (! strncmp (argv[0], "s", 1)) + if (! strncmp (argv[4]->arg, "s", 1)) level = OSPF6_DEBUG_ZEBRA_SEND; - else if (! strncmp (argv[0], "r", 1)) + else if (! strncmp (argv[4]->arg, "r", 1)) level = OSPF6_DEBUG_ZEBRA_RECV; } else diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index a60c5b082..ecd0c0471 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -126,16 +126,16 @@ config_write_ospf6_debug (struct vty *vty) "%s AS Scoped Link State Database%s%s" static int -parse_show_level (int argc, const char *argv[]) +parse_show_level (int argc, struct cmd_token **argv) { int level = 0; if (argc) { - if (! strncmp (argv[0], "de", 2)) + if (! strncmp (argv[0]->arg, "de", 2)) level = OSPF6_LSDB_SHOW_LEVEL_DETAIL; - else if (! strncmp (argv[0], "du", 2)) + else if (! strncmp (argv[0]->arg, "du", 2)) level = OSPF6_LSDB_SHOW_LEVEL_DUMP; - else if (! strncmp (argv[0], "in", 2)) + else if (! strncmp (argv[0]->arg, "in", 2)) level = OSPF6_LSDB_SHOW_LEVEL_INTERNAL; } else @@ -144,23 +144,23 @@ parse_show_level (int argc, const char *argv[]) } static u_int16_t -parse_type_spec (int argc, const char *argv[]) +parse_type_spec (int argc, struct cmd_token **argv) { u_int16_t type = 0; assert (argc); - if (! strcmp (argv[0], "router")) + if (! strcmp (argv[0]->arg, "router")) type = htons (OSPF6_LSTYPE_ROUTER); - else if (! strcmp (argv[0], "network")) + else if (! strcmp (argv[0]->arg, "network")) type = htons (OSPF6_LSTYPE_NETWORK); - else if (! strcmp (argv[0], "as-external")) + else if (! strcmp (argv[0]->arg, "as-external")) type = htons (OSPF6_LSTYPE_AS_EXTERNAL); - else if (! strcmp (argv[0], "intra-prefix")) + else if (! strcmp (argv[0]->arg, "intra-prefix")) type = htons (OSPF6_LSTYPE_INTRA_PREFIX); - else if (! strcmp (argv[0], "inter-router")) + else if (! strcmp (argv[0]->arg, "inter-router")) type = htons (OSPF6_LSTYPE_INTER_ROUTER); - else if (! strcmp (argv[0], "inter-prefix")) + else if (! strcmp (argv[0]->arg, "inter-prefix")) type = htons (OSPF6_LSTYPE_INTER_PREFIX); - else if (! strcmp (argv[0], "link")) + else if (! strcmp (argv[0]->arg, "link")) type = htons (OSPF6_LSTYPE_LINK); return type; } @@ -221,9 +221,7 @@ ALIAS (show_ipv6_ospf6_database, DEFUN (show_ipv6_ospf6_database_type, show_ipv6_ospf6_database_type_cmd, - "show ipv6 ospf6 database " - "(router|network|inter-prefix|inter-router|as-external|" - "group-membership|type-7|link|intra-prefix)", + "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix)", SHOW_STR IPV6_STR OSPF6_STR @@ -333,10 +331,10 @@ DEFUN (show_ipv6_ospf6_database_id, OSPF6_CMD_CHECK_RUNNING (); - if ((inet_pton (AF_INET, argv[0], &id)) != 1) + if ((inet_pton (AF_INET, argv[5]->arg, &id)) != 1) { vty_out (vty, "Link State ID is not parsable: %s%s", - argv[0], VNL); + argv[5]->arg, VNL); return CMD_SUCCESS; } @@ -429,10 +427,10 @@ DEFUN (show_ipv6_ospf6_database_router, OSPF6_CMD_CHECK_RUNNING (); - if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) + if ((inet_pton (AF_INET, argv[6]->arg, &adv_router)) != 1) { vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + argv[6]->arg, VNL); return CMD_SUCCESS; } @@ -507,9 +505,7 @@ ALIAS (show_ipv6_ospf6_database_router, DEFUN (show_ipv6_ospf6_database_type_id, show_ipv6_ospf6_database_type_id_cmd, - "show ipv6 ospf6 database " - "(router|network|inter-prefix|inter-router|as-external|" - "group-membership|type-7|link|intra-prefix) A.B.C.D", + "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) A.B.C.D", SHOW_STR IPV6_STR OSPF6_STR @@ -540,10 +536,10 @@ DEFUN (show_ipv6_ospf6_database_type_id, argc--; argv++; - if ((inet_pton (AF_INET, argv[0], &id)) != 1) + if ((inet_pton (AF_INET, argv[4]->arg, &id)) != 1) { vty_out (vty, "Link state ID is not parsable: %s%s", - argv[0], VNL); + argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -662,9 +658,7 @@ ALIAS (show_ipv6_ospf6_database_type_id, DEFUN (show_ipv6_ospf6_database_type_router, show_ipv6_ospf6_database_type_router_cmd, - "show ipv6 ospf6 database " - "(router|network|inter-prefix|inter-router|as-external|" - "group-membership|type-7|link|intra-prefix) * A.B.C.D", + "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) * A.B.C.D", SHOW_STR IPV6_STR OSPF6_STR @@ -696,10 +690,10 @@ DEFUN (show_ipv6_ospf6_database_type_router, argc--; argv++; - if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) + if ((inet_pton (AF_INET, argv[4]->arg, &adv_router)) != 1) { vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -839,20 +833,20 @@ DEFUN (show_ipv6_ospf6_database_id_router, OSPF6_CMD_CHECK_RUNNING (); - if ((inet_pton (AF_INET, argv[0], &id)) != 1) + if ((inet_pton (AF_INET, argv[5]->arg, &id)) != 1) { vty_out (vty, "Link state ID is not parsable: %s%s", - argv[0], VNL); + argv[5]->arg, VNL); return CMD_SUCCESS; } argc--; argv++; - if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) + if ((inet_pton (AF_INET, argv[5]->arg, &adv_router)) != 1) { vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + argv[5]->arg, VNL); return CMD_SUCCESS; } @@ -922,20 +916,20 @@ DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id, OSPF6_CMD_CHECK_RUNNING (); - if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) + if ((inet_pton (AF_INET, argv[5]->arg, &adv_router)) != 1) { vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + argv[5]->arg, VNL); return CMD_SUCCESS; } argc--; argv++; - if ((inet_pton (AF_INET, argv[0], &id)) != 1) + if ((inet_pton (AF_INET, argv[5]->arg, &id)) != 1) { vty_out (vty, "Link state ID is not parsable: %s%s", - argv[0], VNL); + argv[5]->arg, VNL); return CMD_SUCCESS; } @@ -985,9 +979,7 @@ ALIAS (show_ipv6_ospf6_database_adv_router_linkstate_id, DEFUN (show_ipv6_ospf6_database_type_id_router, show_ipv6_ospf6_database_type_id_router_cmd, - "show ipv6 ospf6 database " - "(router|network|inter-prefix|inter-router|as-external|" - "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D", + "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D", SHOW_STR IPV6_STR OSPF6_STR @@ -1020,20 +1012,20 @@ DEFUN (show_ipv6_ospf6_database_type_id_router, argc--; argv++; - if ((inet_pton (AF_INET, argv[0], &id)) != 1) + if ((inet_pton (AF_INET, argv[4]->arg, &id)) != 1) { vty_out (vty, "Link state ID is not parsable: %s%s", - argv[0], VNL); + argv[4]->arg, VNL); return CMD_SUCCESS; } argc--; argv++; - if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) + if ((inet_pton (AF_INET, argv[4]->arg, &adv_router)) != 1) { vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -1104,10 +1096,7 @@ ALIAS (show_ipv6_ospf6_database_type_id_router, DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id, show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd, - "show ipv6 ospf6 database " - "(router|network|inter-prefix|inter-router|as-external|" - "group-membership|type-7|link|intra-prefix) " - "adv-router A.B.C.D linkstate-id A.B.C.D", + "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) adv-router A.B.C.D linkstate-id A.B.C.D", SHOW_STR IPV6_STR OSPF6_STR @@ -1142,20 +1131,20 @@ DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id, argc--; argv++; - if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) + if ((inet_pton (AF_INET, argv[4]->arg, &adv_router)) != 1) { vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + argv[4]->arg, VNL); return CMD_SUCCESS; } argc--; argv++; - if ((inet_pton (AF_INET, argv[0], &id)) != 1) + if ((inet_pton (AF_INET, argv[4]->arg, &id)) != 1) { vty_out (vty, "Link state ID is not parsable: %s%s", - argv[0], VNL); + argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -1287,9 +1276,7 @@ ALIAS (show_ipv6_ospf6_database_self_originated, DEFUN (show_ipv6_ospf6_database_type_self_originated, show_ipv6_ospf6_database_type_self_originated_cmd, - "show ipv6 ospf6 database " - "(router|network|inter-prefix|inter-router|as-external|" - "group-membership|type-7|link|intra-prefix) self-originated", + "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) self-originated", SHOW_STR IPV6_STR OSPF6_STR @@ -1386,10 +1373,7 @@ ALIAS (show_ipv6_ospf6_database_type_self_originated, DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id, show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd, - "show ipv6 ospf6 database " - "(router|network|inter-prefix|inter-router|as-external|" - "group-membership|type-7|link|intra-prefix) self-originated " - "linkstate-id A.B.C.D", + "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) self-originated linkstate-id A.B.C.D", SHOW_STR IPV6_STR OSPF6_STR @@ -1423,10 +1407,10 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id, argc--; argv++; - if ((inet_pton (AF_INET, argv[0], &id)) != 1) + if ((inet_pton (AF_INET, argv[4]->arg, &id)) != 1) { vty_out (vty, "Link State ID is not parsable: %s%s", - argv[0], VNL); + argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -1501,9 +1485,7 @@ ALIAS (show_ipv6_ospf6_database_type_self_originated_linkstate_id, DEFUN (show_ipv6_ospf6_database_type_id_self_originated, show_ipv6_ospf6_database_type_id_self_originated_cmd, - "show ipv6 ospf6 database " - "(router|network|inter-prefix|inter-router|as-external|" - "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated", + "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) A.B.C.D self-originated", SHOW_STR IPV6_STR OSPF6_STR @@ -1536,10 +1518,10 @@ DEFUN (show_ipv6_ospf6_database_type_id_self_originated, argc--; argv++; - if ((inet_pton (AF_INET, argv[0], &id)) != 1) + if ((inet_pton (AF_INET, argv[4]->arg, &id)) != 1) { vty_out (vty, "Link State ID is not parsable: %s%s", - argv[0], VNL); + argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -1629,7 +1611,7 @@ DEFUN (show_ipv6_ospf6_border_routers, OSPF6_CMD_CHECK_RUNNING (); - if (argc && ! strcmp ("detail", argv[0])) + if (argc && ! strcmp ("detail", argv[4]->arg)) { showfunc = ospf6_route_show_detail; argc--; @@ -1640,9 +1622,9 @@ DEFUN (show_ipv6_ospf6_border_routers, if (argc) { - if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) + if ((inet_pton (AF_INET, argv[4]->arg, &adv_router)) != 1) { - vty_out (vty, "Router ID is not parsable: %s%s", argv[0], VNL); + vty_out (vty, "Router ID is not parsable: %s%s", argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -1650,7 +1632,7 @@ DEFUN (show_ipv6_ospf6_border_routers, ro = ospf6_route_lookup (&prefix, ospf6->brouter_table); if (!ro) { - vty_out (vty, "No Route found for Router ID: %s%s", argv[0], VNL); + vty_out (vty, "No Route found for Router ID: %s%s", argv[4]->arg, VNL); return CMD_SUCCESS; } @@ -1736,25 +1718,16 @@ DEFUN (show_ipv6_ospf6_linkstate_detail, "Display linkstate routing table\n" ) { - const char *sargv[CMD_ARGC_MAX]; - int i, sargc; struct listnode *node; struct ospf6_area *oa; OSPF6_CMD_CHECK_RUNNING (); - /* copy argv to sargv and then append "detail" */ - for (i = 0; i < argc; i++) - sargv[i] = argv[i]; - sargc = argc; - sargv[sargc++] = "detail"; - sargv[sargc] = NULL; - for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) { vty_out (vty, "%s SPF Result in Area %s%s%s", VNL, oa->name, VNL, VNL); - ospf6_linkstate_table_show (vty, sargc, sargv, oa->spf_table); + ospf6_linkstate_table_show (vty, argc, argv, oa->spf_table); } vty_out (vty, "%s", VNL); diff --git a/tools/argv_translator.py b/tools/argv_translator.py index ba3766425..57cc28bbb 100755 --- a/tools/argv_translator.py +++ b/tools/argv_translator.py @@ -201,6 +201,7 @@ def update_argvs(filename): line = line.replace('" QUAGGA_IP6_PROTOCOL_MAP_STR_ZEBRA "', '(kernel|connected|static|ripng|ospf6|isis|bgp|table|any)') line = line.replace('" QUAGGA_REDIST_STR_RIPNGD "', '(kernel|connected|static|ospf6|isis|bgp|table)') line = line.replace('" QUAGGA_REDIST_STR_RIPD "', '(kernel|connected|static|ospf|isis|bgp|pim|table)') + line = line.replace('" QUAGGA_REDIST_STR_OSPF6D "', '(kernel|connected|static|ripng|isis|bgp|table)') # endswith line = line.replace('" CMD_AS_RANGE,', ' <1-4294967295>",') @@ -229,6 +230,7 @@ def update_argvs(filename): line = line.replace('" PIM_CMD_IP_IGMP_QUERY_INTERVAL,', ' ip igmp query-interval",') line = line.replace('" PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC,', ' ip igmp query-max-response-time-dsec",') line = line.replace('" PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME,', ' ip igmp query-max-response-time",') + line = line.replace('" QUAGGA_REDIST_STR_OSPF6D,', ' (kernel|connected|static|ripng|isis|bgp|table)",') # startswith line = line.replace('LISTEN_RANGE_CMD "', '"bgp listen range (A.B.C.D/M|X:X::X:X/M) ') |