Logical expressions |
Logical expressions are operations of function call united by the following operators: && - conjunction (logical AND), || - disjunction (logical OR), ! - negation (logical NOT). To group operations and change their priority, use brackets.
Syntax of BOOL_EXPR logical expressions is as follows: func_name() | COMPARE | Where BOOL_EXPR is a logical expression, func_name() is a call of function with the func_name name, and COMPARE is one of the comparison operations listed below. The function must be defined in the [def] section. Comparison operation can be one of the following:
The following comparison operations are supported for variables of the string type:
== and ~ operations are case insensitive. The following comparison operations are supported for variables of the cidr type:
If both arguments of <<= operation have undefined value, the operation result is true. If only one parameter has undefined value, the operation result is false. The following comparison operations are supported for variables of the time type:
Every operation has a certain priority relative to other operations. Sorted in descending order, comparison operation priority is as follows: 1.! ("logical NOT") 2.< ("less than"), <= ("less than or equal to"), > ("greater than"), >= ("greater than or equal to") 3.== ("equal to"), != ("not equal to"), ~ ("matches"), <<= ("belongs to") 4.&& ("logical AND") 5.|| ("logical OR") Operations listed in the same line have equal priority and are processed from left to right. For certain operations, reading of a value array from a file (specified with the file: prefix) is available. Lines beginning with the "#" or ";" characters as well as with empty lines are skipped when reading values. The content of the file:FILE_NAME file is read while the configuration file is processed. Thus, after changing content of the file that contains values (or a path to such a file), force drweb-icapd to reread its configuration (for example, by sending the drweb-icapd daemon SIGHUP signal). |