From abae556c886d94751128c0deb0feee9589fda4c3 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 19 Oct 2018 13:06:53 +0200 Subject: libxtables: expose new etherdb lookup function through libxtables API This is used from extensions and included in libxtables, so we have to make them public. Fixes: 31f1434dfe37 ("libxtables: Integrate getethertype.c from xtables core") Reported-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Acked-by: Phil Sutter --- include/xtables.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/xtables.h') diff --git a/include/xtables.h b/include/xtables.h index bf169b08..8fb8843a 100644 --- a/include/xtables.h +++ b/include/xtables.h @@ -521,6 +521,18 @@ extern void xtables_ip6parse_any(const char *, struct in6_addr **, extern void xtables_ip6parse_multiple(const char *, struct in6_addr **, struct in6_addr **, unsigned int *); +/* Absolute file name for network data base files. */ +#define XT_PATH_ETHERTYPES "/etc/ethertypes" + +struct xt_ethertypeent { + char *e_name; /* Official ethernet type name. */ + char **e_aliases; /* Alias list. */ + int e_ethertype; /* Ethernet type number. */ +}; + +extern struct xt_ethertypeent *xtables_getethertypebyname(const char *name); +extern struct xt_ethertypeent *xtables_getethertypebynumber(int ethertype); + /** * Print the specified value to standard output, quoting dangerous * characters if required. -- cgit v1.2.3