Imported Upstream version 1.7.0
[platform/upstream/augeas.git] / lenses / netmasks.aug
1 (*
2 Module: Netmasks
3   Parses /etc/inet/netmasks on Solaris
4
5 Author: Dominic Cleal <dcleal@redhat.com>
6
7 About: Reference
8   This lens tries to keep as close as possible to `man 4 netmasks` where possible.
9
10 About: Licence
11   This file is licensed under the LGPL v2+, like the rest of Augeas.
12
13 About: Lens Usage
14
15 About: Configuration files
16   This lens applies to /etc/netmasks and /etc/inet/netmasks. See <filter>.
17 *)
18
19 module Netmasks =
20 autoload xfm
21
22 (************************************************************************
23  * Group:                 USEFUL PRIMITIVES
24  ************************************************************************)
25
26 (* View: comment *)
27 let comment = Util.comment
28
29 (* View: comment_or_eol *)
30 let comment_or_eol = Util.comment_or_eol
31
32 (* View: indent *)
33 let indent  = Util.indent
34
35 (* View: empty *)
36 let empty   = Util.empty
37
38 (* View: sep
39     The separator for network/mask entries *)
40 let sep     = Util.del_ws_tab
41
42 (************************************************************************
43  * Group:                     ENTRIES
44  ************************************************************************)
45
46 (* View: entry
47    Network / netmask line *)
48 let entry = [ seq "network" . indent .
49                 [ label "network" . store Rx.ipv4 ] . sep .
50                 [ label "netmask" . store Rx.ipv4 ] . comment_or_eol ]
51
52 (************************************************************************
53  * Group:                     LENS
54  ************************************************************************)
55
56 (* View: lns *)
57 let lns = ( empty
58           | comment
59           | entry )*
60
61 (* Variable: filter *)
62 let filter = (incl "/etc/netmasks"
63             . incl "/etc/inet/netmasks")
64
65 let xfm = transform lns filter