diff options
author | Phil Sutter <phil@nwl.cc> | 2021-03-09 11:36:03 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2021-03-15 12:23:15 +0100 |
commit | 483050de7ceb60515541a7e83d07b8fdb7a2faf5 (patch) | |
tree | 66a2b7eb17e924686faa756ddc4b06fa6aa351b3 /src/expr/data_reg.c | |
parent | f4ad4d3879cead150e86c279ac8e4770e4b167b1 (diff) |
expr/data_reg: Drop output_format parameter
The function nftnl_data_reg_snprintf is exclusively called with
NFTNL_OUTPUT_DEFAULT as parameter, others are not supported - just drop
it.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src/expr/data_reg.c')
-rw-r--r-- | src/expr/data_reg.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/src/expr/data_reg.c b/src/expr/data_reg.c index d3ccc61..bafdc6f 100644 --- a/src/expr/data_reg.c +++ b/src/expr/data_reg.c @@ -63,38 +63,19 @@ nftnl_data_reg_verdict_snprintf_def(char *buf, size_t size, int nftnl_data_reg_snprintf(char *buf, size_t size, const union nftnl_data_reg *reg, - uint32_t output_format, uint32_t flags, - int reg_type) + uint32_t flags, int reg_type) { switch(reg_type) { case DATA_VALUE: - switch(output_format) { - case NFTNL_OUTPUT_DEFAULT: - return nftnl_data_reg_value_snprintf_default(buf, size, - reg, flags); - case NFTNL_OUTPUT_JSON: - case NFTNL_OUTPUT_XML: - default: - break; - } - break; + return nftnl_data_reg_value_snprintf_default(buf, size, + reg, flags); case DATA_VERDICT: case DATA_CHAIN: - switch(output_format) { - case NFTNL_OUTPUT_DEFAULT: - return nftnl_data_reg_verdict_snprintf_def(buf, size, - reg, flags); - case NFTNL_OUTPUT_JSON: - case NFTNL_OUTPUT_XML: - default: - break; - } - break; + return nftnl_data_reg_verdict_snprintf_def(buf, size, + reg, flags); default: - break; + return -1; } - - return -1; } static int nftnl_data_parse_cb(const struct nlattr *attr, void *data) |