SURVIVOR: Module XML Argument Specification
Specification Argument Types
Specification
Modules that accept information via an XML document may accept arguments (ie: module specific configuration information). These arguments may be typed. Curly braces `{}` must not be used anywhere except as delimiters to the entire argument in the configuration files. Arguments must be named. The name must consist solely of alphanumeric characters, underscores, hyphens, and dots. Arguments may be typed according to the currently available set of argument types. The argument name `module` is reserved for modules that call other modules. Argument names beginning with an underscore are reserved for modules that call other modules. Argument names `debugfile` (of type file) and `debugsyslog` (of type boolean) are reserved to enable module debugging. Arguments that are not conformant cannot use the provided parsing mechanisms, may not parse correctly in the configuration files, and may not work correctly with other modules. ### Argument Types A module may insist that its arguments be typed. When the arguments are typed, run time checking is performed to verify that the arguments passed conform to the requirements of the module. While no explicit tags are required to identify types of arguments in the configuration file, the values provided must meet the criteria of the argument type. The following types are defined: boolean: The value passed must be one of true, t, yes, y, or 1 to indicate true, or false, f, no, n, or 0 to indicate false. directory: As for type string, except the argument must exist and must be a directory on the host the module is run on. extraction: The argument passed indicates a specification for extracting part of a string, and must be one of: column[x] to extract the column in position x, starting from 0, using whitespace to separate columns substr[x,y] to extract the substring beginning at the character at position x (starting from 0) of length y file: As for type string, except the argument must exist and must be a file, symlink, pipe, or socket on the host the module is run on. flags: The argument passed is a set of zero or more characters (no separators between each flag). It is recommended, but not required, that a flags argument be used with the any modifier. number: A string of characters representing a number. Only the characters `0` through `9`, `-`, and `.` are permitted. The negative sign, if used, must only appear once at the beginning of the string. The decimal point, if used, must only appear once in the string. password: As for type string. Additional features or restrictions may be added later. relation: The argument passed indicates a relative value and must be one of: For numeric values lt[x] to indicate less than x gt[x] to indicate greater than x eq[x] to indicate equal to x ne[x] to indicate not equal to x bt[x,y] to indicate between x and y (inclusive) nb[x,y] to indicate not between x and y (inclusive) For regular expressions reg[s] to indicate matching the regular expression s regv[s] to indicate not matching the regular expression s. For time comparisons tnt[x] to indicate time newer than x seconds ago tot[x] to indicate time older than x seconds ago string: A text string, conforming to the requirements outlined above. In addition, types may be modified. The following modifiers are defined: any(a,b,c,...): The value provided may be zero or more of the values a, b, c, or .... between(x,y): The value provided must be at least x and not greater than y. If either value is inf (infinity), then that bound is not checked. Only type number may use this modifier. default(x): The default value for this argument if none is provided. This modifier may only be used along with the optional modifier. list: The value provided is a list of values. When this modifier is set, multiple arguments of the same name may be provided, and each will be considered a member of the list. Without this modifier, the same argument may not be passed more than once to a module. Types boolean, flags, and relation may not use this modifier. one(a,b,c,...): The value provided must be exactly one of the values a, b, c, or .... This modifier should not be used with the list modifier. optional: The argument is optional. If not provided, the module will use its predefined default value for that argument. Parsers are provided to assist in parsing named arguments. See the appropriate module documentation. $Date: 2006/11/20 00:11:13 $ $Revision: 0.5 $ | keywords