3 Parses RANCiD router database
5 Author: Matt Dainty <matt@bodgit-n-scarper.com>
10 Each line represents a record consisting of a number of ';'-separated fields
11 the first of which is the IP/Hostname of the device, followed by the type, its
12 state and optionally a comment.
19 let sep = Util.del_str ";"
20 let field = /[^;#\n]+/
21 let comment = [ label "comment" . store /[^;#\n]*/ ]
22 let eol = Util.del_str "\n"
23 let record = [ label "device" . store field . sep . [ label "type" . store field ] . sep . [ label "state" . store field ] . ( sep . comment )? . eol ]
25 let lns = ( Util.empty | Util.comment_generic /#[ \t]*/ "# " | record )*
27 let filter = incl "/var/rancid/*/router.db"
30 let xfm = transform lns filter
32 (* Local Variables: *)