Merge pull request #464 from remakeelectric/pulls/list-operations
[project/luci.git] / modules / luci-base / luasrc / sys / iptparser.luadoc
1 ---[[
2 LuCI iptables parser and query library
3
4 @cstyle instance
5 ]]
6 module "luci.sys.iptparser"
7
8 ---[[
9 Create a new iptables parser object.
10
11 @class  function
12 @name   IptParser
13 @param  family  Number specifying the address family. 4 for IPv4, 6 for IPv6
14 @return IptParser instance
15 ]]
16
17 ---[[
18 Find all firewall rules that match the given criteria. Expects a table with
19
20 search criteria as only argument. If args is nil or an empty table then all
21 rules will be returned.
22 ]]
23
24 ---[[
25 Rebuild the internal lookup table, for example when rules have changed
26
27 through external commands.
28 @class function
29 @name IptParser.resync
30 @return nothing
31 ]]
32
33 ---[[
34 Find the names of all tables.
35
36 @class function
37 @name IptParser.tables
38 @return         Table of table names.
39 ]]
40
41 ---[[
42 Find the names of all chains within the given table name.
43
44 @class function
45 @name IptParser.chains
46 @param table    String containing the table name
47 @return         Table of chain names in the order they occur.
48 ]]
49
50 ---[[
51 Return the given firewall chain within the given table name.
52
53 @class function
54 @name IptParser.chain
55 @param table    String containing the table name
56 @param chain    String containing the chain name
57 @return         Table containing the fields "policy", "packets", "bytes"
58 --                              and "rules". The "rules" field is a table of rule tables.
59 ]]
60
61 ---[[
62 Test whether the given target points to a custom chain.
63
64 @class function
65 @name IptParser.is_custom_target
66 @param target   String containing the target action
67 @return                 Boolean indicating whether target is a custom chain.
68 ]]
69