diff options
author | Phil Sutter <phil@nwl.cc> | 2023-12-22 17:00:44 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2024-01-02 18:29:51 +0100 |
commit | 17cef81a8d1d119f457a01214a86e2c0e883ce8f (patch) | |
tree | bec6cf88905a9895e6fdffad9e63c2905effde4f /src/ct.c | |
parent | d9badd39deb7e2f9509be75e83477ab0a0bf2740 (diff) |
datatype: Describe rt symbol tables
Implement a symbol_table_print() wrapper for the run-time populated
rt_symbol_tables which formats output similar to expr_describe() and
includes the data source.
Since these tables reside in struct output_ctx there is no implicit
connection between data type and therefore providing callbacks for
relevant datat types which feed the data into said wrapper is a simpler
solution than extending expr_describe() itself.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src/ct.c')
-rw-r--r-- | src/ct.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -216,10 +216,17 @@ static struct error_record *ct_label_type_parse(struct parse_ctx *ctx, return NULL; } +static void ct_label_type_describe(struct output_ctx *octx) +{ + rt_symbol_table_describe(octx, CONNLABEL_CONF, + octx->tbl.ct_label, &ct_label_type); +} + const struct datatype ct_label_type = { .type = TYPE_CT_LABEL, .name = "ct_label", .desc = "conntrack label", + .describe = ct_label_type_describe, .byteorder = BYTEORDER_HOST_ENDIAN, .size = CT_LABEL_BIT_SIZE, .basetype = &bitmask_type, |