summaryrefslogtreecommitdiff
path: root/lib/vty.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vty.h')
-rw-r--r--lib/vty.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/vty.h b/lib/vty.h
index a76b9f5a17..b4a55180d3 100644
--- a/lib/vty.h
+++ b/lib/vty.h
@@ -182,6 +182,15 @@ struct vty_arg
/* Small macro to determine newline is newline only or linefeed needed. */
#define VTYNL ((vty->type == VTY_TERM) ? "\r\n" : "\n")
+/* for compatibility */
+#define VTY_NEWLINE VTYNL
+#define VTY_GET_INTEGER(desc,v,str) {(v)=strtoul ((str), NULL, 10);}
+#define VTY_GET_INTEGER_RANGE(desc,v,str,min,max) {(v)=strtoul ((str), NULL, 10);}
+#define VTY_GET_ULONG(desc,v,str) {(v)=strtoul ((str), NULL, 10);}
+#define VTY_GET_ULL(desc,v,str) {(v)=strtoull ((str), NULL, 10);}
+#define VTY_GET_IPV4_ADDRESS(desc,v,str) inet_aton ((str), &(v))
+#define VTY_GET_IPV4_PREFIX(desc,v,str) str2prefix_ipv4 ((str), &(v))
+
/* Default time out value */
#define VTY_TIMEOUT_DEFAULT 600