diff options
Diffstat (limited to 'zebra/zebra_routemap.c')
| -rw-r--r-- | zebra/zebra_routemap.c | 140 |
1 files changed, 66 insertions, 74 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 6ec43e592c..c4f417d883 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -73,10 +73,10 @@ zebra_route_match_add(struct vty *vty, switch (ret) { case RMAP_RULE_MISSING: - vty_out (vty, "%% Zebra Can't find rule.%s", VTY_NEWLINE); + vty_outln (vty, "%% Zebra Can't find rule."); return CMD_WARNING; case RMAP_COMPILE_ERROR: - vty_out (vty, "%% Zebra Argument is malformed.%s", VTY_NEWLINE); + vty_outln (vty, "%% Zebra Argument is malformed."); return CMD_WARNING; } } @@ -121,10 +121,10 @@ zebra_route_match_delete (struct vty *vty, switch (ret) { case RMAP_RULE_MISSING: - vty_out (vty, "%% Zebra Can't find rule.%s", VTY_NEWLINE); + vty_outln (vty, "%% Zebra Can't find rule."); return CMD_WARNING; case RMAP_COMPILE_ERROR: - vty_out (vty, "%% Zebra Argument is malformed.%s", VTY_NEWLINE); + vty_outln (vty, "%% Zebra Argument is malformed."); return CMD_WARNING; } } @@ -302,7 +302,7 @@ DEFUN (match_source_protocol, i = proto_name2num(proto); if (i < 0) { - vty_out (vty, "invalid protocol name \"%s\"%s", proto, VTY_NEWLINE); + vty_outln (vty, "invalid protocol name \"%s\"", proto); return CMD_WARNING; } return zebra_route_match_add (vty, "source-protocol", proto, RMAP_EVENT_MATCH_ADDED); @@ -350,7 +350,7 @@ DEFUN (set_src, { if (inet_pton(AF_INET6, argv[idx_ip]->arg, &src.ipv6) != 1) { - vty_out (vty, "%% not a valid IPv4/v6 address%s", VTY_NEWLINE); + vty_outln (vty, "%% not a valid IPv4/v6 address"); return CMD_WARNING; } @@ -367,7 +367,7 @@ DEFUN (set_src, if (!zebra_check_addr(&p)) { - vty_out (vty, "%% not a valid source IPv4/v6 address%s", VTY_NEWLINE); + vty_outln (vty, "%% not a valid source IPv4/v6 address"); return CMD_WARNING; } @@ -386,7 +386,7 @@ DEFUN (set_src, if (!pif) { - vty_out (vty, "%% not a local address%s", VTY_NEWLINE); + vty_outln (vty, "%% not a local address"); return CMD_WARNING; } @@ -419,7 +419,7 @@ DEFUN (zebra_route_map_timer, int idx_number = 3; u_int32_t rmap_delay_timer; - VTY_GET_INTEGER_RANGE ("delay-timer", rmap_delay_timer, argv[idx_number]->arg, 0, 600); + rmap_delay_timer = strtoul(argv[idx_number]->arg, NULL, 10); zebra_route_map_set_delay_timer(rmap_delay_timer); return (CMD_SUCCESS); @@ -459,7 +459,7 @@ DEFUN (ip_protocol, i = proto_name2num(proto); if (i < 0) { - vty_out (vty, "invalid protocol name \"%s\"%s", proto, VTY_NEWLINE); + vty_outln (vty, "invalid protocol name \"%s\"", proto); return CMD_WARNING; } if (proto_rm[AFI_IP][i]) @@ -500,7 +500,7 @@ DEFUN (no_ip_protocol, if (i < 0) { - vty_out (vty, "invalid protocol name \"%s\"%s", proto, VTY_NEWLINE); + vty_outln (vty, "invalid protocol name \"%s\"", proto); return CMD_WARNING; } @@ -529,22 +529,20 @@ DEFUN (show_ip_protocol, { int i; - vty_out(vty, "Protocol : route-map %s", VTY_NEWLINE); - vty_out(vty, "------------------------%s", VTY_NEWLINE); + vty_outln (vty, "Protocol : route-map "); + vty_outln (vty, "------------------------"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (proto_rm[AFI_IP][i]) - vty_out (vty, "%-10s : %-10s%s", zebra_route_string(i), - proto_rm[AFI_IP][i], - VTY_NEWLINE); + vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + proto_rm[AFI_IP][i]); else - vty_out (vty, "%-10s : none%s", zebra_route_string(i), VTY_NEWLINE); + vty_outln (vty, "%-10s : none", zebra_route_string(i)); } if (proto_rm[AFI_IP][i]) - vty_out (vty, "%-10s : %-10s%s", "any", proto_rm[AFI_IP][i], - VTY_NEWLINE); + vty_outln (vty, "%-10s : %-10s", "any",proto_rm[AFI_IP][i]); else - vty_out (vty, "%-10s : none%s", "any", VTY_NEWLINE); + vty_outln (vty, "%-10s : none", "any"); return CMD_SUCCESS; } @@ -568,7 +566,7 @@ DEFUN (ipv6_protocol, i = proto_name2num(proto); if (i < 0) { - vty_out (vty, "invalid protocol name \"%s\"%s", proto, VTY_NEWLINE); + vty_outln (vty, "invalid protocol name \"%s\"", proto); return CMD_WARNING; } if (proto_rm[AFI_IP6][i]) @@ -608,7 +606,7 @@ DEFUN (no_ipv6_protocol, i = proto_name2num(proto); if (i < 0) { - vty_out (vty, "invalid protocol name \"%s\"%s", proto, VTY_NEWLINE); + vty_outln (vty, "invalid protocol name \"%s\"", proto); return CMD_WARNING; } if (!proto_rm[AFI_IP6][i]) @@ -637,22 +635,20 @@ DEFUN (show_ipv6_protocol, { int i; - vty_out(vty, "Protocol : route-map %s", VTY_NEWLINE); - vty_out(vty, "------------------------%s", VTY_NEWLINE); + vty_outln (vty, "Protocol : route-map "); + vty_outln (vty, "------------------------"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (proto_rm[AFI_IP6][i]) - vty_out (vty, "%-10s : %-10s%s", zebra_route_string(i), - proto_rm[AFI_IP6][i], - VTY_NEWLINE); + vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + proto_rm[AFI_IP6][i]); else - vty_out (vty, "%-10s : none%s", zebra_route_string(i), VTY_NEWLINE); + vty_outln (vty, "%-10s : none", zebra_route_string(i)); } if (proto_rm[AFI_IP6][i]) - vty_out (vty, "%-10s : %-10s%s", "any", proto_rm[AFI_IP6][i], - VTY_NEWLINE); + vty_outln (vty, "%-10s : %-10s", "any",proto_rm[AFI_IP6][i]); else - vty_out (vty, "%-10s : none%s", "any", VTY_NEWLINE); + vty_outln (vty, "%-10s : none", "any"); return CMD_SUCCESS; } @@ -676,7 +672,7 @@ DEFUN (ip_protocol_nht_rmap, i = proto_name2num(proto); if (i < 0) { - vty_out (vty, "invalid protocol name \"%s\"%s", proto, VTY_NEWLINE); + vty_outln (vty, "invalid protocol name \"%s\"", proto); return CMD_WARNING; } if (nht_rm[AFI_IP][i]) @@ -711,7 +707,7 @@ DEFUN (no_ip_protocol_nht_rmap, if (i < 0) { - vty_out (vty, "invalid protocol name \"%s\"%s", proto, VTY_NEWLINE); + vty_outln (vty, "invalid protocol name \"%s\"", proto); return CMD_WARNING; } @@ -737,22 +733,20 @@ DEFUN (show_ip_protocol_nht, { int i; - vty_out(vty, "Protocol : route-map %s", VTY_NEWLINE); - vty_out(vty, "------------------------%s", VTY_NEWLINE); + vty_outln (vty, "Protocol : route-map "); + vty_outln (vty, "------------------------"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (nht_rm[AFI_IP][i]) - vty_out (vty, "%-10s : %-10s%s", zebra_route_string(i), - nht_rm[AFI_IP][i], - VTY_NEWLINE); + vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + nht_rm[AFI_IP][i]); else - vty_out (vty, "%-10s : none%s", zebra_route_string(i), VTY_NEWLINE); + vty_outln (vty, "%-10s : none", zebra_route_string(i)); } if (nht_rm[AFI_IP][i]) - vty_out (vty, "%-10s : %-10s%s", "any", nht_rm[AFI_IP][i], - VTY_NEWLINE); + vty_outln (vty, "%-10s : %-10s", "any",nht_rm[AFI_IP][i]); else - vty_out (vty, "%-10s : none%s", "any", VTY_NEWLINE); + vty_outln (vty, "%-10s : none", "any"); return CMD_SUCCESS; } @@ -776,7 +770,7 @@ DEFUN (ipv6_protocol_nht_rmap, i = proto_name2num(proto); if (i < 0) { - vty_out (vty, "invalid protocol name \"%s\"%s", proto, VTY_NEWLINE); + vty_outln (vty, "invalid protocol name \"%s\"", proto); return CMD_WARNING; } if (nht_rm[AFI_IP6][i]) @@ -807,13 +801,13 @@ DEFUN (no_ipv6_protocol_nht_rmap, i = proto_name2num(proto); if (i < 0) { - vty_out (vty, "invalid protocol name \"%s\"%s", proto, VTY_NEWLINE); + vty_outln (vty, "invalid protocol name \"%s\"", proto); return CMD_WARNING; } if (nht_rm[AFI_IP6][i] && rmap && strcmp(rmap, nht_rm[AFI_IP6][i])) { - vty_out (vty, "invalid route-map \"%s\"%s", rmap, VTY_NEWLINE); + vty_outln (vty, "invalid route-map \"%s\"", rmap); return CMD_WARNING; } @@ -838,22 +832,20 @@ DEFUN (show_ipv6_protocol_nht, { int i; - vty_out(vty, "Protocol : route-map %s", VTY_NEWLINE); - vty_out(vty, "------------------------%s", VTY_NEWLINE); + vty_outln (vty, "Protocol : route-map "); + vty_outln (vty, "------------------------"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (nht_rm[AFI_IP6][i]) - vty_out (vty, "%-10s : %-10s%s", zebra_route_string(i), - nht_rm[AFI_IP6][i], - VTY_NEWLINE); + vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + nht_rm[AFI_IP6][i]); else - vty_out (vty, "%-10s : none%s", zebra_route_string(i), VTY_NEWLINE); + vty_outln (vty, "%-10s : none", zebra_route_string(i)); } if (nht_rm[AFI_IP][i]) - vty_out (vty, "%-10s : %-10s%s", "any", nht_rm[AFI_IP6][i], - VTY_NEWLINE); + vty_outln (vty, "%-10s : %-10s", "any",nht_rm[AFI_IP6][i]); else - vty_out (vty, "%-10s : none%s", "any", VTY_NEWLINE); + vty_outln (vty, "%-10s : none", "any"); return CMD_SUCCESS; } @@ -1302,8 +1294,8 @@ void zebra_route_map_write_delay_timer (struct vty *vty) { if (vty && (zebra_rmap_update_timer != ZEBRA_RMAP_DEFAULT_UPDATE_TIMER)) - vty_out (vty, "zebra route-map delay-timer %d%s", zebra_rmap_update_timer, - VTY_NEWLINE); + vty_outln (vty, "zebra route-map delay-timer %d", + zebra_rmap_update_timer); return; } @@ -1439,41 +1431,41 @@ zebra_routemap_config_write_protocol (struct vty *vty) for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (proto_rm[AFI_IP][i]) - vty_out (vty, "ip protocol %s route-map %s%s", zebra_route_string(i), - proto_rm[AFI_IP][i], VTY_NEWLINE); + vty_outln (vty, "ip protocol %s route-map %s", zebra_route_string(i), + proto_rm[AFI_IP][i]); if (proto_rm[AFI_IP6][i]) - vty_out (vty, "ipv6 protocol %s route-map %s%s", zebra_route_string(i), - proto_rm[AFI_IP6][i], VTY_NEWLINE); + vty_outln (vty, "ipv6 protocol %s route-map %s", zebra_route_string(i), + proto_rm[AFI_IP6][i]); if (nht_rm[AFI_IP][i]) - vty_out (vty, "ip nht %s route-map %s%s", zebra_route_string(i), - nht_rm[AFI_IP][i], VTY_NEWLINE); + vty_outln (vty, "ip nht %s route-map %s", zebra_route_string(i), + nht_rm[AFI_IP][i]); if (nht_rm[AFI_IP6][i]) - vty_out (vty, "ipv6 nht %s route-map %s%s", zebra_route_string(i), - nht_rm[AFI_IP6][i], VTY_NEWLINE); + vty_outln (vty, "ipv6 nht %s route-map %s", zebra_route_string(i), + nht_rm[AFI_IP6][i]); } if (proto_rm[AFI_IP][ZEBRA_ROUTE_MAX]) - vty_out (vty, "ip protocol %s route-map %s%s", "any", - proto_rm[AFI_IP][ZEBRA_ROUTE_MAX], VTY_NEWLINE); + vty_outln (vty, "ip protocol %s route-map %s", "any", + proto_rm[AFI_IP][ZEBRA_ROUTE_MAX]); if (proto_rm[AFI_IP6][ZEBRA_ROUTE_MAX]) - vty_out (vty, "ipv6 protocol %s route-map %s%s", "any", - proto_rm[AFI_IP6][ZEBRA_ROUTE_MAX], VTY_NEWLINE); + vty_outln (vty, "ipv6 protocol %s route-map %s", "any", + proto_rm[AFI_IP6][ZEBRA_ROUTE_MAX]); if (nht_rm[AFI_IP][ZEBRA_ROUTE_MAX]) - vty_out (vty, "ip nht %s route-map %s%s", "any", - nht_rm[AFI_IP][ZEBRA_ROUTE_MAX], VTY_NEWLINE); + vty_outln (vty, "ip nht %s route-map %s", "any", + nht_rm[AFI_IP][ZEBRA_ROUTE_MAX]); if (nht_rm[AFI_IP6][ZEBRA_ROUTE_MAX]) - vty_out (vty, "ipv6 nht %s route-map %s%s", "any", - nht_rm[AFI_IP6][ZEBRA_ROUTE_MAX], VTY_NEWLINE); + vty_outln (vty, "ipv6 nht %s route-map %s", "any", + nht_rm[AFI_IP6][ZEBRA_ROUTE_MAX]); if (zebra_rmap_update_timer != ZEBRA_RMAP_DEFAULT_UPDATE_TIMER) - vty_out (vty, "zebra route-map delay-timer %d%s", zebra_rmap_update_timer, - VTY_NEWLINE); + vty_outln (vty, "zebra route-map delay-timer %d", + zebra_rmap_update_timer); } void |
