validate: range and base arguments for numeric types, new types hexstring, regexp and uci
- make uinteger and integer types more strict, they will not accept
leading spaces or plus signs anymore
- add optional base argument to uinteger and integer data types, e.g.
integer(16) will accept -af or 0xaf, a base of 0 (the default) will
use the underlying heuristics of strtol() / strtoul()
- add optional min and max options to string() datatype, e.g.
string(3) only accepts strings longer than 3 chars, string(8, 63)
will accept strings between 8 and 63 characters in length
- add hexstring([minlen [, maxlen]]) type which will accept
long hex encoded strings whose length must be a multiple of 2
- add regexp(pattern) type which applies an extended POSIX regular
expression on the value to test. The given pattern is implicitely
anchored, e.g. regexp("[a-z]+") will match /^[a-z]+$/
- add uci(package, {@type|name}[, option]) type which tests the input
against selected uci values, e.g.
* uci("network", "@interface") would allow values that match
the name of any section of type "interface" in /e/c/network
* uci("network", "@interface", "ifname") would allow any value
that matches one of the ifnames in any section of type
interface in /e/c/network
* uci("system", "ntp", "server") would allow any value that
matches on of the servers in the "server" option of the "ntp"
section in /e/c/system
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>