From 707ad229d48f2ba7920541527b755b155ddedcda Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Tue, 22 Oct 2019 21:58:53 +0100 Subject: 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 Signed-off-by: Phil Sutter --- py/nftables.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) 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. -- cgit v1.2.3