summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael McTernan <Michael.McTernan.2001@cs.bris.ac.uk>2011-12-16 16:05:52 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2011-12-16 16:05:52 (GMT)
commit7b57ff4436f3e672076e6f5440954a958ba04ab3 (patch)
tree4365b7e4f18c1dfc4b12e9533da51549e84d37c1
parentbe2a557918af86cc55b3426f97664503fe7e265f (diff)
downloadbusybox-7b57ff4436f3e672076e6f5440954a958ba04ab3.tar.gz
busybox-7b57ff4436f3e672076e6f5440954a958ba04ab3.tar.bz2
udhcp: finish support of classless static routes
function old new delta udhcp_str2optset 415 532 +117 Signed-off-by: Michael McTernan <Michael.McTernan.2001@cs.bris.ac.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--examples/udhcp/udhcpd.conf6
-rw-r--r--include/xatonum.h9
2 files changed, 13 insertions, 2 deletions
diff --git a/examples/udhcp/udhcpd.conf b/examples/udhcp/udhcpd.conf
index cd2957c..eca44c0 100644
--- a/examples/udhcp/udhcpd.conf
+++ b/examples/udhcp/udhcpd.conf
@@ -68,6 +68,8 @@ opt wins 192.168.10.10
option dns 129.219.13.81 # appended to above DNS servers for a total of 3
option domain local
option lease 864000 # default: 10 days
+option msstaticroutes 10.0.0.0/8 10.127.0.1 # single static route
+option staticroutes 10.0.0.0/8 10.127.0.1, 10.11.12.0/24 10.11.12.1
# Arbitrary option in hex form:
option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4"
@@ -101,6 +103,8 @@ option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4"
#opt swapsrv IP
# Options specifying routes
#opt routes IP_PAIR_LIST
+#opt staticroutes STATIC_ROUTES # RFC 3442 classless static route option
+#opt msstaticroutes STATIC_ROUTES # same, using MS option number
# Obsolete options, no longer supported
#opt logsrv IP_LIST # 704/UDP log server (not syslog!)
#opt namesrv IP_LIST # IEN 116 name server, obsolete (August 1979!!!)
@@ -109,5 +113,3 @@ option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4"
# TODO: in development
#opt userclass STRING # RFC 3004. set of LASCII strings. "I am a printer" etc
#opt sipserv STRING LIST # RFC 3361. flag byte, then: 0: domain names, 1: IP addrs
-#opt staticroutes STATIC_ROUTES
-#opt msstaticroutes STATIC_ROUTES
diff --git a/include/xatonum.h b/include/xatonum.h
index 6f76a3c..45ebbfc 100644
--- a/include/xatonum.h
+++ b/include/xatonum.h
@@ -168,6 +168,15 @@ uint32_t bb_strtou32(const char *arg, char **endp, int base)
return bb_strtoul(arg, endp, base);
return BUG_bb_strtou32_unimplemented();
}
+static ALWAYS_INLINE
+int32_t bb_strtoi32(const char *arg, char **endp, int base)
+{
+ if (sizeof(int32_t) == sizeof(int))
+ return bb_strtoi(arg, endp, base);
+ if (sizeof(int32_t) == sizeof(long))
+ return bb_strtol(arg, endp, base);
+ return BUG_bb_strtou32_unimplemented();
+}
/* Floating point */