Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / networkmanager.aug
1 (*
2 Module: NetworkManager
3   Parses /etc/NetworkManager/system-connections/* files which are GLib
4   key-value setting files.
5
6 Author: Raphael Pinson <raphael.pinson@camptocamp.com>
7
8 About: License
9    This file is licenced under the LGPL v2+, like the rest of Augeas.
10
11 About: Lens Usage
12    To be documented
13
14 About: Configuration files
15    This lens applies to /etc/NetworkManager/system-connections/*. See <filter>.
16
17 About: Examples
18    The <Test_NetworkManager> file contains various examples and tests.
19 *)
20
21 module NetworkManager =
22 autoload xfm
23
24 (************************************************************************
25  * INI File settings
26  *
27  * GLib only supports "# as commentary and "=" as separator
28  *************************************************************************)
29 let comment    = IniFile.comment "#" "#"
30 let sep        = Sep.equal
31 let eol        = Util.eol
32
33 (************************************************************************
34  *                        ENTRY
35  * GLib entries can contain semicolons, entry names can contain spaces and
36  * brackets
37  *
38  * At least entry for WPA-PSK definition can contain all printable ASCII
39  * characters including '#', ' ' and others. Comments following the entry
40  * are no option for this reason.
41  *************************************************************************)
42 (* Variable: entry_re *)
43 let entry_re   = /[A-Za-z][A-Za-z0-9:._\(\) \t-]+/
44
45 (* Lens: entry *)
46 let entry   = [ key entry_re . sep
47                 . IniFile.sto_to_eol? . eol ]
48               | comment
49
50 (************************************************************************
51  *                        RECORD
52  * GLib uses standard INI File records
53  *************************************************************************)
54 let title   = IniFile.indented_title IniFile.record_re
55 let record  = IniFile.record title entry
56
57
58 (************************************************************************
59  *                        LENS & FILTER
60  * GLib uses standard INI File records
61  *************************************************************************)
62 let lns     = IniFile.lns record comment
63
64 (* Variable: filter *)
65 let filter = incl "/etc/NetworkManager/system-connections/*"
66
67 let xfm = transform lns filter