summaryrefslogtreecommitdiffstats
path: root/py/nftables.py
diff options
context:
space:
mode:
authorJeremy Sowden <jeremy@azazel.net>2019-10-22 21:58:53 +0100
committerPhil Sutter <phil@nwl.cc>2019-10-24 11:12:49 +0200
commit707ad229d48f2ba7920541527b755b155ddedcda (patch)
treea5621de6c31cea41c27b9b70fa5c61f2979f9f8a /py/nftables.py
parent459ec9aafbbc655b054321557a5a58dbdca8185e (diff)
py: add missing output flags.
`terse` and `numeric_time` are missing from the `output_flags` dict. Add them and getters and setters for them. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'py/nftables.py')
-rw-r--r--py/nftables.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/py/nftables.py b/py/nftables.py
index 81e57567..48eb54fe 100644
--- a/py/nftables.py
+++ b/py/nftables.py
@@ -58,6 +58,8 @@ class Nftables:
"numeric_proto": (1 << 7),
"numeric_prio": (1 << 8),
"numeric_symbol": (1 << 9),
+ "numeric_time": (1 << 10),
+ "terse": (1 << 11),
}
validator = None
@@ -305,6 +307,39 @@ class Nftables:
"""
return self.__set_output_flag("numeric_symbol", val)
+ def get_numeric_time_output(self):
+ """Get current status of numeric times output flag.
+
+ Returns a boolean value indicating the status.
+ """
+ return self.__get_output_flag("numeric_time")
+
+ def set_numeric_time_output(self, val):
+ """Set numeric times output flag.
+
+ Accepts a boolean turning numeric representation of time values
+ in output either on or off.
+
+ Returns the previous value.
+ """
+ return self.__set_output_flag("numeric_time", val)
+
+ def get_terse_output(self):
+ """Get the current state of terse output.
+
+ Returns a boolean indicating whether terse output is active or not.
+ """
+ return self.__get_output_flag("terse")
+
+ def set_terse_output(self, val):
+ """Enable or disable terse output.
+
+ Accepts a boolean turning terse output either on or off.
+
+ Returns the previous value.
+ """
+ return self.__set_output_flag("terse", val)
+
def get_debug(self):
"""Get currently active debug flags.