From a3e215d7f68f41556912c33b3dcf12781f6b9b59 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 24 Mar 2021 17:19:32 +0100 Subject: src: add datatype->describe() As an alternative to print the datatype values when no symbol table is available. Use it to print protocols available via getprotobynumber() which actually refers to /etc/protocols. Not very efficient, getprotobynumber() causes a series of open()/close() calls on /etc/protocols, but this is called from a non-critical path. Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1503 Signed-off-by: Pablo Neira Ayuso --- include/datatype.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/datatype.h b/include/datatype.h index 1061a389..a16f8f2b 100644 --- a/include/datatype.h +++ b/include/datatype.h @@ -164,6 +164,7 @@ struct datatype { struct error_record *(*parse)(struct parse_ctx *ctx, const struct expr *sym, struct expr **res); + void (*describe)(struct output_ctx *octx); const struct symbol_table *sym_tbl; unsigned int refcnt; }; -- cgit v1.2.3