Technical data
8. Documentation for Developers
be referenced in the file check/<PACKAGE>.txt. check/base.exp for example at the
moment contains definitions for the known tests and check/isdn.exp a definition for the
variable ISDN_CIRC_x_ROUTE (the absence of this check was the trigger for the changes).
The syntax is as follows (again, double quotes can be used if needed):
<Name> = '<Regular Expression>' : '<Error Message>'
as an example check/base.exp:
NOTEMPTY = '.*[^ ]+.*' : 'should not be empty'
YESNO = 'yes|no' : 'only yes or no are allowed'
NUMERIC = '0|[1-9][0-9]*' : 'should be numeric (decimal)'
OCTET = '1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]'
: 'should be a value between 0 and 255'
IPADDR = '((RE:OCTET)\.){3}(RE:OCTET)' : 'invalid ipv4 address'
EIPADDR = '()|(RE:IPADDR)'
: 'should be empty or contain a valid ipv4 address'
NOBLANK = '[^ ]+' : 'should not contain spaces'
DIALMODE = 'auto|manual|off' : 'only auto, manual or off are allowed'
NETWORKS = '(RE:NETWORK)([[:space:]]+(RE:NETWORK))*'
: 'no valid network specification, should be one or more
network address(es) followed by a CIDR netmask,
for instance 192.168.6.0/24'
The regular expressions can also include already existing definitions by a reference. These
are then pasted to substitute the reference. This makes it easier to construct regular
expressions. The references are inserted by ’(RE: Reference)’. (See the definition of the
term NETWORKS above for an appropriate example.)
The error messages tend to be too long. Therefore, they may be displayed on multiple
lines. The lines afterwards always have to start with a space or tab then. When reading
the file check/<PACKAGE>.exp superfluous whitespaces are reduced to one and tabs are
replaced by spaces. An entry in check/<PACKAGE>.exp could look like this:
NUM_HEX = '0x[[:xdigit:]]+'
: 'should be a hexadecimal number
(a number starting with "0x")'
2. Regular expressions directly in the check file check/<PACKAGE>.txt
Some expressions occur but once and are not worth defining a regular expression in a
check/<PACKAGE>.exp file. You can simply write this expression to the check file for
example:
# Variable OPT_VARIABLE VARIABLE_N VALUE
MOUNT_BOOT - - RE:ro|rw|no
MOUNT_BOOT can only take the value “ro”, “rw” or “no”, everything else will be denied.
If you want to refer to existing regular expressions, simply add a reference via ‘(RE:...)”.
Example:
# Variable OPT_VARIABLE VARIABLE_N VALUE
LOGIP_LOGDIR OPT_LOGIP - RE:(RE:ABS_PATH)|auto
294










