I | |
identifier | |
ignore, Xymon_Alerting | |
include | |
include_dir, Nrpe | |
includedir, Sudoers | |
includes, Xinetd | |
indent | |
indented_entry, IniFile | |
indented_title, IniFile | |
indented_title_label, IniFile | |
inherit, Yaml | |
input_device, Xorg | |
install_remove, Modprobe | |
integer, Erlang | |
ip_port, Keepalived | |
ip6_dotint, Resolv | |
ipaddr | |
ipaddr_or_hostname, Pg_Hba | |
ipdev, Keepalived | |
ipv4, Networks | |
istepslew, Chrony | |
item, Nrpe | |
item_re, Nrpe | |
J | |
job_identifier, Anacron | |
K | |
kernel | |
kernel_args, Grub | |
kernel_parameters, Erlang | |
key_comment, Authorized_Keys | |
key_opt_rtable_line, Ntpd | |
key_opt_value_line, BootConf | |
key_opt_weight_rtable_line, Ntpd | |
key_options, Authorized_Keys | |
key_type, Authorized_Keys | |
key_value | |
key_value_line | |
key_value_line_comment | |
key_value_line_regexp, Nslcd | |
key_value_line_regexp_opt_map, Nslcd | |
key_ws_value | |
keyword, Ntpd | |
knode, Test_Xml | |
kv | |
kw_arg, Grub | |
kw_boot_arg, Grub | |
kw_menu_arg, Grub | |
kw_pres, Grub | |
kw_word, Xymon_Alerting | |
kw_word_filters_opt, Xymon_Alerting |
The left hand side of a definition
let identifier = /[a-zA-Z0-9_-]+/
let identifier = entry_str "Identifier" /[iI]dentifier/
The ignore recipient definition
let ignore = flag_filters_opt "IGNORE"
A file inclusion /!\ The manpage is not clear on the syntax
let include = [ indent . key "#include" . Sep.space . store Rx.fspath . eol ]
An include line starting with a “+” and a map name
let include = [ seq "entry" . store "+" . Util.del_opt_ws "" . [ label "map" . store map_name ] . Util.eol ]
let include = Build.key_value_line "include" Sep.space (store Rx.fspath)
An include entry.
let include = [ key "include" . [ label "file" . eq . store word . eol ] ]
Includes another file at this position
let include = [ key ".include" . Util.del_ws_spc . sto_value . (eol_comment|eol) ]
let include = [ key "include" . ws . store_word . eol ]
include_dir=/path/to/dir/
let include_dir = [ key "include_dir" . [ label "dir" . eq . store word . eol ] ]
let includedir = [ key /#include(dir)?/ . Sep.space . store Rx.fspath . eol ]
It would be nice if we could use the directories given in include and includedir directives to parse additional files instead of hardcoding all the places where xinetd config files can be found; but that is currently not possible, and implementing that has a good amount of hairy corner cases to consider.
let includes = Build.key_value_line /include(dir)?/ Sep.space (store Rx.no_spaces)
An indentation
let indent = Util.indent
let indent = Util.indent
let indent = Util.indent
let indent = Util.indent
the imposed indent is 2 spaces
let indent = del /[ \t]+/ " "
Generic INI File entry that might be indented with an arbitrary amount of whitespace
let indented_entry (kw:regexp) (sep:lens) (comment:lens) = entry_generic (Util.indent . key kw) sep comment_re comment
Title for record.
let indented_title (kw:regexp) = Util.indent . title kw
Title for record.
let indented_title_label (name:string) (kw:regexp) = Util.indent . title_label name kw
let input_device = [ indent . del /[iI]nput[dD]evice/ "InputDevice" . label "InputDevice" . sep_spc . quoted_non_empty_string_val . [ label "option" . sep_spc . quoted_non_empty_string_val ]* . eol ]
Store a Rx.integer
let integer = store Rx.integer
An IP space port pair
let ip_port = [ label "ip" . sto_word ] . sep_spc . [ label "port" . sto_num ]
ip6-dotint option, which supports negation
let ip6_dotint = let negate = [ del "no-" "no-" . label "negate" ] in [ negate? . key "ip6-dotint" ]
An IP address or range with an optional mask
let ipaddr = label "ipaddr" . store /[0-9.-]+/ . prefixlen?
An IP address or range with an optional mask
let ipaddr = [label "ipaddr" . store Rx.ip . netmask?]
let ipaddr_or_hostname = ipaddr | hostname
A device for IP addresses
let ipdev = [ key "dev" . sep_spc . sto_word ]
A network IP, trailing .0 may be omitted
let ipv4 = let dot = "." in let digits = /(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/ in digits . (dot . digits . (dot . digits . (dot . digits)?)?)?
initstepslew has specific syntax
let istepslew = [ Util.indent . key "initstepslew" . space . [ label "threshold" . store number ] . ( space . store_address )+ . eol ]
regular entries
let item = [ key item_re . eq . store word . eol ]
let item_re = /[^#=\n\t\/ ]+/ - (/command\[[^]\/\n]+\]/ | "include" | "include_dir")
The job_identifier for an entry
let job_identifier = [ label "job-identifier" . store Rx.word ]
Core Erlang kernel app configuration
let kernel = application "kernel" kernel_parameters
let kernel = [ command /kernel\$?/ "\t" . (spc . ([switch "type" . eq . store /[a-z]+/] |[switch "no-mem-option"]))* . spc . kernel_args ]
Parse the file name and args on a kernel or module line.
let kernel_args = let arg = /[A-Za-z0-9_.$-]+/ - /type|no-mem-option/ in store /(\([a-z0-9,]+\))?\/[^ \t\n]*/ . (spc . multiboot_arg)? . (spc . [ key arg . (eq. store /([^ \t\n])*/)?])* . eol
Config parameters accepted for kernel app
let kernel_parameters = value "browser_cmd" path | value "dist_auto_connect" (store /never|once/) | value "error_logger" (store /tty|false|silent/) | value "net_setuptime" integer | value "net_ticktime" integer | value "shutdown_timeout" integer | value "sync_nodes_timeout" integer | value "start_dist_ac" boolean | value "start_boot_server" boolean | value "start_disk_log" boolean | value "start_pg2" boolean | value "start_timer" boolean
let key_comment = [ label "comment" . store Rx.space_in ]
A subnode with a keyword, an optional routing table id and an end of line.
let key_opt_rtable_line (kw:regexp) (sto:lens) = let rtable = [ Util.del_str "rtable" . space . label "rtable" . store rtable_re ] in [ key kw . space . sto . (space . rtable)? . eol ]
A subnode with a keyword, an optional part consisting of a separator and a storing lens, and an end of line
let key_opt_value_line (kw:regexp) (sto:lens) = [ key kw . (space . sto)? . eol ]
A subnode with a keyword, an optional routing table id, an optional weight-value and an end of line.
let key_opt_weight_rtable_line (kw:regexp) (sto:lens) = let rtable = [ Util.del_str "rtable" . space . label "rtable" . store rtable_re ] in let weight = [ Util.del_str "weight" . space . label "weight" . store weight_re ] in [ key kw . space . sto . (space . weight)? . (space . rtable)? . eol ]
A list of key options
let key_options = [ label "options" . Build.opt_list option Sep.comma ]
let key_type = let key_type_re = /ecdsa-sha2-nistp[0-9]+/ | /ssh-[a-z0-9]+/ in [ label "type" . store key_type_re ]
Same as key_value_line, but does not end with an end of line
let key_value (kw: regexp) (sep:lens) (sto:lens) = [ key kw . sep . sto ]
let key_value = Build.key_value Rx.word Sep.equal (store Rx.word)
A subnode with a keyword, a separator and a storing lens, and an end of line
let key_value_line (kw:regexp) (sep:lens) (sto:lens) = [ key kw . sep . sto . eol ]
let key_value_line = Build.key_value_line Rx.word Sep.equal (store Rx.word)
Same as key_value_line, but allows to have a comment in the end of a line and an end of line
let key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) = [ key kw . sep . sto . (eol|comment) ]
let key_value_line_comment = Build.key_value_line_comment Rx.word Sep.equal (store Rx.word) Util.comment
A simple configuration option but specifying the regex for the value.
let key_value_line_regexp (kw:string) (sto:regexp) = Build.key_value_line kw spc (store sto)
A mapped configuration but the MAP value is optional as in scope [MAP] value`.
let key_value_line_regexp_opt_map (kw:string) (sto:regexp) = ( key_value_line_regexp kw sto | mapped_entry kw sto )
Store a key/value pair where key and value are separated by whitespace and the value goes to the end of the line.
let key_ws_value (kw:regexp) = key_value_line kw Util.del_ws_spc (store Rx.space_in)
let key_ws_value = Build.key_ws_value Rx.word
let keyword = listen | server | servers | sensor
A simple flag function
let knode (r:regexp) = [ key r ]
let kv = [ indent . key key_re . del sep " " . store value_re . eol ]
options with only one arg can be directly mapped to key = value
let kv = [ Util.indent . key simple_keys . space . (store no_space) . eol ]
A key-value pair, supporting flags and empty values
let kv = [ key /[A-Za-z0-9:_.-]+/ . (Sep.equal . store (Rx.space_in?))? . Util.eol ]
let kw_arg (kw:regexp) (indent:string) (dflt_sep:string) = [ command kw indent . value_sep dflt_sep . value_to_eol . eol ]
let kw_boot_arg (kw:regexp) = kw_arg kw "\t" " "
let kw_menu_arg (kw:regexp) = kw_arg kw "" " "
let kw_pres (kw:string) = [ opt_ws . key kw . eol ]
A key=value value
let kw_word (kw:regexp) = Build.key_value kw equal store_word
A kw_word entry with optional filters
let kw_word_filters_opt (kw:string) = [ key kw . equal . store_word . filters_opt ]