Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tinc.aug
1 (*
2 Module: Tinc
3   Parses Tinc VPN configuration files
4
5 Author: Thomas Weißschuh <thomas.weissschuh@amadeus.com>
6
7 About: License
8   This file is licensed under the LGPL v2+, like the rest of Augeas.
9 *)
10
11 module Tinc =
12
13 autoload xfm
14
15 let no_spaces_no_equals = /[^ \t\r\n=]+/
16 let assign = del (/[ \t]*[= ][ \t]*/) " = "
17 let del_str = Util.del_str
18
19 let entry = Build.key_value_line /[A-Za-z]+/ assign (store no_spaces_no_equals)
20
21 let key_section_start = "-----BEGIN RSA PUBLIC KEY-----\n"
22 let key_section_end = "\n-----END RSA PUBLIC KEY-----"
23               (* the last line does not include a newline *)
24 let base_64 = /[A-Za-z0-9+\/=\n]+[A-Za-z0-9+\/=]/
25 let key_section = del_str key_section_start .
26                   (label "#key" . store base_64) .
27                   del_str key_section_end
28
29 (* we only support a single key section *)
30 let lns = (Util.comment | Util.empty | entry) * . [(key_section . Util.empty *)]?
31
32 let filter = incl "/etc/tinc.conf"
33            . incl "/etc/tinc/*/tinc.conf"
34            . incl "/etc/tinc/hosts/*"
35            . incl "/etc/tinc/*/hosts/*"
36
37 let xfm = transform lns filter