Technical data
8. Documentation for Developers
Important: The module has to exist exactly by this name, no aliases may be used. When
using an alias do_modprobe will be called immediately.
Messages And Error Handling
log_info <Message>: Logs a message to the console and to /bootmsg.txt. If no message is
passed as a parameter log_info reads the default input. The function always returns 0.
log_warn <Message>: Logs a warning message to the console and to /bootmsg.txt, using
the string WARN: as a prefix. If no message is passed as a parameter log_warn reads the
default input. The function always returns 0.
log_error <Message>: Logs an error message to the console and to /bootmsg.txt, using the
string ERR: as a prefix. If no message is passed as a parameter log_warn reads the
default input. The function always returns a non-zero value.
set_error <Message>: Output of an error message and setting of an internal error variable
which can be checked later via is_error.
is_error: Clears the internal error variable and returns true if it was set before via set_error.
Network Functions
translate_ip_net <Value> <Variable name> [<Result variable>]:
Replaces symbolic references in parameters. At the moment the following translations
are supported:
*.*.*.*, none, default, pppoe will not be translated
any will be replaced by 0.0.0.0/0
dynamic will be replaced by the IP address of the router which represents the Internet
connection
IP_NET_x will be replaced by the network found in the configuration
IP_NET_x_IPADDR will be replaced by the IP address found in the configuration
IP_ROUTE_x will be replaced by the routed network found in the configuration
@<Hostname> will be replaced by the Hosts IP address specified in the configuration
The result of the translation is stored in the variable whose name is passed in the third
parameter, if this parameter is missing, the result is stored in the variable res. The
variable name that is passed in the second parameter is used only for error messages if
the translation fails, to enable the caller to pass the source of the value to be translated.
In case of failure a message like
Unable to translate value '<Value>' contained in <Variable name>.
will be printed.
The return value is 0 in case of success, and unequal to zero in case of errors.
334










