Functions: [def] section |
Functions can be used in any logical expressions; however, each function must be predefined in the [def] section before use. In one section, several functions can be defined. Moreover, you can specify several [def] sections in the configuration file (functions defined in different sections are combined into one list while reading configuration). Function definition syntax: func_name_1 = { BOOL_EXPR } where BOOL_EXPR is a logical expression. All functions return a Boolean value, arguments are not supported. In fact, a function is just a shorthand notation for an expression. Example: Definition of the is_localhost and local_ip functions: these functions are to be true if the request was sent from one of the specified IP addresses or from one of the IP addresses listed in the file. [def] Definition of a worktime() function: if the current system time is between 9:30 and 13:00 or 14:00 and 18:15, the function is to be true. [def] |