summaryrefslogtreecommitdiffstats
path: root/babeld/babel_interface.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-06-27 20:47:03 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-06-27 21:04:41 +0200
commitfacfee22f55631992113af5606cf8ade069684b3 (patch)
treeb7ca477d3a90724929f2af749b09bdd6306ae8a6 /babeld/babel_interface.c
parentMerge pull request #757 from donaldsharp/extract_sort (diff)
downloadfrr-facfee22f55631992113af5606cf8ade069684b3.tar.xz
frr-facfee22f55631992113af5606cf8ade069684b3.zip
*: remove VTY_GET_*
CLI validates input tokens, so there's no need to do it in handler functions anymore. spatch follows ---------------- @getull@ expression v; expression str; @@ <... - VTY_GET_ULL(..., v, str) + v = strtoull (str, NULL, 10) ...> @getul@ expression v; expression str; @@ <... - VTY_GET_ULONG(..., v, str) + v = strtoul (str, NULL, 10) ...> @getintrange@ expression name; expression v; expression str; @@ <... - VTY_GET_INTEGER_RANGE(name, v, str, ...) + v = strtoul (str, NULL, 10) ...> @getint@ expression v; expression str; @@ <... - VTY_GET_INTEGER(..., v, str) + v = strtoul (str, NULL, 10) ...> @getv4@ expression v; expression str; @@ <... - VTY_GET_IPV4_ADDRESS(..., v, str) + inet_aton (str, &v) ...> @getv4pfx@ expression v; expression str; @@ <... - VTY_GET_IPV4_PREFIX(..., v, str) + str2prefix_ipv4 (str, &v) ...> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'babeld/babel_interface.c')
-rw-r--r--babeld/babel_interface.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 718e918bb..3f589df0a 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -430,7 +430,7 @@ DEFUN (babel_set_hello_interval,
babel_interface_nfo *babel_ifp;
int interval;
- VTY_GET_INTEGER_RANGE("milliseconds", interval, argv[2]->arg, 20, 10 * 0xFFFE);
+ interval = strtoul(argv[2]->arg, NULL, 10);
babel_ifp = babel_get_if_nfo(ifp);
assert (babel_ifp != NULL);
@@ -451,7 +451,7 @@ DEFUN (babel_set_update_interval,
babel_interface_nfo *babel_ifp;
int interval;
- VTY_GET_INTEGER_RANGE("milliseconds", interval, argv[2]->arg, 20, 10 * 0xFFFE);
+ interval = strtoul(argv[2]->arg, NULL, 10);
babel_ifp = babel_get_if_nfo(ifp);
assert (babel_ifp != NULL);
@@ -471,7 +471,7 @@ DEFUN (babel_set_rxcost,
babel_interface_nfo *babel_ifp;
int rxcost;
- VTY_GET_INTEGER_RANGE("units", rxcost, argv[2]->arg, 1, 0x10000 - 1);
+ rxcost = strtoul(argv[2]->arg, NULL, 10);
babel_ifp = babel_get_if_nfo(ifp);
assert (babel_ifp != NULL);
@@ -491,7 +491,7 @@ DEFUN (babel_set_rtt_decay,
babel_interface_nfo *babel_ifp;
int decay;
- VTY_GET_INTEGER_RANGE("units", decay, argv[2]->arg, 1, 256);
+ decay = strtoul(argv[2]->arg, NULL, 10);
babel_ifp = babel_get_if_nfo(ifp);
assert (babel_ifp != NULL);
@@ -511,7 +511,7 @@ DEFUN (babel_set_rtt_min,
babel_interface_nfo *babel_ifp;
int rtt;
- VTY_GET_INTEGER_RANGE("milliseconds", rtt, argv[2]->arg, 1, 65535);
+ rtt = strtoul(argv[2]->arg, NULL, 10);
babel_ifp = babel_get_if_nfo(ifp);
assert (babel_ifp != NULL);
@@ -531,7 +531,7 @@ DEFUN (babel_set_rtt_max,
babel_interface_nfo *babel_ifp;
int rtt;
- VTY_GET_INTEGER_RANGE("milliseconds", rtt, argv[2]->arg, 1, 65535);
+ rtt = strtoul(argv[2]->arg, NULL, 10);
babel_ifp = babel_get_if_nfo(ifp);
assert (babel_ifp != NULL);
@@ -551,7 +551,7 @@ DEFUN (babel_set_max_rtt_penalty,
babel_interface_nfo *babel_ifp;
int penalty;
- VTY_GET_INTEGER_RANGE("milliseconds", penalty, argv[2]->arg, 0, 65535);
+ penalty = strtoul(argv[2]->arg, NULL, 10);
babel_ifp = babel_get_if_nfo(ifp);
assert (babel_ifp != NULL);
@@ -604,7 +604,7 @@ DEFUN (babel_set_channel,
babel_interface_nfo *babel_ifp;
int channel;
- VTY_GET_INTEGER_RANGE("channel", channel, argv[2]->arg, 1, 254);
+ channel = strtoul(argv[2]->arg, NULL, 10);
babel_ifp = babel_get_if_nfo(ifp);
assert (babel_ifp != NULL);