diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-03-24 17:19:32 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-03-25 12:12:13 +0100 |
commit | a3e215d7f68f41556912c33b3dcf12781f6b9b59 (patch) | |
tree | 8ed2f03a0ed14fe85634beea17ed3ab3195f4a05 /include/datatype.h | |
parent | 8e6cc9f373854ed580156ec6f01bcd97786fa9f7 (diff) |
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 <pablo@netfilter.org>
Diffstat (limited to 'include/datatype.h')
-rw-r--r-- | include/datatype.h | 1 |
1 files changed, 1 insertions, 0 deletions
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; }; |