Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / rancid.aug
1 (*
2 Module: Rancid
3   Parses RANCiD router database
4
5 Author: Matt Dainty <matt@bodgit-n-scarper.com>
6
7 About: Reference
8        - man 5 router.db
9
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.
13
14 *)
15
16 module Rancid =
17   autoload xfm
18
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 ]
24
25   let lns = ( Util.empty | Util.comment_generic /#[ \t]*/ "# " | record )*
26
27   let filter = incl "/var/rancid/*/router.db"
28              . Util.stdexcl
29
30   let xfm = transform lns filter
31
32 (* Local Variables: *)
33 (* mode: caml       *)
34 (* End:             *)