Imported Upstream version 1.7.0
[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 (* Variable: entry_re *)
39 let entry_re   = /[A-Za-z][A-Za-z0-9:._\(\) \t-]+/
40
41 (* Lens: entry *)
42 let entry   = [ key entry_re . sep
43                 . Quote.double_opt? . eol ]
44               | comment
45
46 (************************************************************************
47  *                        RECORD
48  * GLib uses standard INI File records
49  *************************************************************************)
50 let title   = IniFile.indented_title IniFile.record_re
51 let record  = IniFile.record title entry
52
53
54 (************************************************************************
55  *                        LENS & FILTER
56  * GLib uses standard INI File records
57  *************************************************************************)
58 let lns     = IniFile.lns record comment
59
60 (* Variable: filter *)
61 let filter = incl "/etc/NetworkManager/system-connections/*"
62
63 let xfm = transform lns filter