summaryrefslogtreecommitdiffstats
path: root/libxtables
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-10-19 12:55:16 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-10-20 11:14:10 +0200
commitc2d9ed99316f26de2d57d9798eee50034114540b (patch)
tree888e14d5353c8fb9438cca67446e0b69b5f433be /libxtables
parent5a44360e54c455871d3576a0a4303afbfb82088f (diff)
libxtables: prefix exported new functions for etherdb lookups
To avoid symbol pollution, place them under the xt_ and xtables_ prefix name. Fixes: 31f1434dfe37 ("libxtables: Integrate getethertype.c from xtables core") Reported-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Acked-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'libxtables')
-rw-r--r--libxtables/getethertype.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libxtables/getethertype.c b/libxtables/getethertype.c
index 027ef4ad..a4c1407c 100644
--- a/libxtables/getethertype.c
+++ b/libxtables/getethertype.c
@@ -49,20 +49,20 @@
static FILE *etherf = NULL;
static char line[BUFSIZ + 1];
-static struct ethertypeent et_ent;
+static struct xt_ethertypeent et_ent;
static char *ethertype_aliases[MAXALIASES];
static int ethertype_stayopen;
-void setethertypeent(int f)
+static void setethertypeent(int f)
{
if (etherf == NULL)
- etherf = fopen(_PATH_ETHERTYPES, "r");
+ etherf = fopen(_XT_PATH_ETHERTYPES, "r");
else
rewind(etherf);
ethertype_stayopen |= f;
}
-void endethertypeent(void)
+static void endethertypeent(void)
{
if (etherf) {
fclose(etherf);
@@ -71,14 +71,15 @@ void endethertypeent(void)
ethertype_stayopen = 0;
}
-struct ethertypeent *getethertypeent(void)
+
+static struct xt_ethertypeent *getethertypeent(void)
{
char *e;
char *endptr;
register char *cp, **q;
if (etherf == NULL
- && (etherf = fopen(_PATH_ETHERTYPES, "r")) == NULL) {
+ && (etherf = fopen(_XT_PATH_ETHERTYPES, "r")) == NULL) {
return (NULL);
}
@@ -127,10 +128,9 @@ again:
return (&et_ent);
}
-
-struct ethertypeent *getethertypebyname(const char *name)
+struct xt_ethertypeent *xtables_getethertypebyname(const char *name)
{
- register struct ethertypeent *e;
+ register struct xt_ethertypeent *e;
register char **cp;
setethertypeent(ethertype_stayopen);
@@ -147,9 +147,9 @@ found:
return (e);
}
-struct ethertypeent *getethertypebynumber(int type)
+struct xt_ethertypeent *xtables_getethertypebynumber(int type)
{
- register struct ethertypeent *e;
+ register struct xt_ethertypeent *e;
setethertypeent(ethertype_stayopen);
while ((e = getethertypeent()) != NULL)