iptparser.luadoc 1.5 KB

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