summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2024-09-25 12:42:08 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2024-09-25 12:44:02 +0200
commita347296209c2de2ce5c4ee0f76a285f859e89fea (patch)
tree84460aa549ebab4279965cbd00e22b5e0c63ad9e /src
parent83930cea4130b6232af36bb869b67f829db534ed (diff)
src: remove scaffolding around deprecated parser functions
nftnl_.*_do_parse() are of no use anymore, remove them. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/object.c30
-rw-r--r--src/rule.c29
-rw-r--r--src/set.c30
-rw-r--r--src/table.c26
4 files changed, 24 insertions, 91 deletions
diff --git a/src/object.c b/src/object.c
index 19cb7d0..9d15031 100644
--- a/src/object.c
+++ b/src/object.c
@@ -386,40 +386,22 @@ int nftnl_obj_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_obj *obj)
return 0;
}
-static int nftnl_obj_do_parse(struct nftnl_obj *obj, enum nftnl_parse_type type,
- const void *data, struct nftnl_parse_err *err,
- enum nftnl_parse_input input)
-{
- struct nftnl_parse_err perr = {};
- int ret;
-
- switch (type) {
- case NFTNL_PARSE_JSON:
- case NFTNL_PARSE_XML:
- default:
- ret = -1;
- errno = EOPNOTSUPP;
- break;
- }
-
- if (err != NULL)
- *err = perr;
-
- return ret;
-}
-
EXPORT_SYMBOL(nftnl_obj_parse);
int nftnl_obj_parse(struct nftnl_obj *obj, enum nftnl_parse_type type,
const char *data, struct nftnl_parse_err *err)
{
- return nftnl_obj_do_parse(obj, type, data, err, NFTNL_PARSE_BUFFER);
+ errno = EOPNOTSUPP;
+
+ return -1;
}
EXPORT_SYMBOL(nftnl_obj_parse_file);
int nftnl_obj_parse_file(struct nftnl_obj *obj, enum nftnl_parse_type type,
FILE *fp, struct nftnl_parse_err *err)
{
- return nftnl_obj_do_parse(obj, type, fp, err, NFTNL_PARSE_FILE);
+ errno = EOPNOTSUPP;
+
+ return -1;
}
static int nftnl_obj_snprintf_dflt(char *buf, size_t remain,
diff --git a/src/rule.c b/src/rule.c
index e16e2c1..811d5a2 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -500,39 +500,22 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
return 0;
}
-static int nftnl_rule_do_parse(struct nftnl_rule *r, enum nftnl_parse_type type,
- const void *data, struct nftnl_parse_err *err,
- enum nftnl_parse_input input)
-{
- int ret;
- struct nftnl_parse_err perr = {};
-
- switch (type) {
- case NFTNL_PARSE_JSON:
- case NFTNL_PARSE_XML:
- default:
- ret = -1;
- errno = EOPNOTSUPP;
- break;
- }
- if (err != NULL)
- *err = perr;
-
- return ret;
-}
-
EXPORT_SYMBOL(nftnl_rule_parse);
int nftnl_rule_parse(struct nftnl_rule *r, enum nftnl_parse_type type,
const char *data, struct nftnl_parse_err *err)
{
- return nftnl_rule_do_parse(r, type, data, err, NFTNL_PARSE_BUFFER);
+ errno = EOPNOTSUPP;
+
+ return -1;
}
EXPORT_SYMBOL(nftnl_rule_parse_file);
int nftnl_rule_parse_file(struct nftnl_rule *r, enum nftnl_parse_type type,
FILE *fp, struct nftnl_parse_err *err)
{
- return nftnl_rule_do_parse(r, type, fp, err, NFTNL_PARSE_FILE);
+ errno = EOPNOTSUPP;
+
+ return -1;
}
static int nftnl_rule_snprintf_default(char *buf, size_t remain,
diff --git a/src/set.c b/src/set.c
index 07e332d..75ad64e 100644
--- a/src/set.c
+++ b/src/set.c
@@ -753,40 +753,22 @@ out_set_expr:
return -1;
}
-static int nftnl_set_do_parse(struct nftnl_set *s, enum nftnl_parse_type type,
- const void *data, struct nftnl_parse_err *err,
- enum nftnl_parse_input input)
-{
- int ret;
- struct nftnl_parse_err perr = {};
-
- switch (type) {
- case NFTNL_PARSE_JSON:
- case NFTNL_PARSE_XML:
- default:
- ret = -1;
- errno = EOPNOTSUPP;
- break;
- }
-
- if (err != NULL)
- *err = perr;
-
- return ret;
-}
-
EXPORT_SYMBOL(nftnl_set_parse);
int nftnl_set_parse(struct nftnl_set *s, enum nftnl_parse_type type,
const char *data, struct nftnl_parse_err *err)
{
- return nftnl_set_do_parse(s, type, data, err, NFTNL_PARSE_BUFFER);
+ errno = EOPNOTSUPP;
+
+ return -1;
}
EXPORT_SYMBOL(nftnl_set_parse_file);
int nftnl_set_parse_file(struct nftnl_set *s, enum nftnl_parse_type type,
FILE *fp, struct nftnl_parse_err *err)
{
- return nftnl_set_do_parse(s, type, fp, err, NFTNL_PARSE_FILE);
+ errno = EOPNOTSUPP;
+
+ return -1;
}
static int nftnl_set_snprintf_default(char *buf, size_t remain,
diff --git a/src/table.c b/src/table.c
index 1a5f6f3..b1b164c 100644
--- a/src/table.c
+++ b/src/table.c
@@ -327,36 +327,22 @@ int nftnl_table_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_table *t)
return 0;
}
-static int nftnl_table_do_parse(struct nftnl_table *t, enum nftnl_parse_type type,
- const void *data, struct nftnl_parse_err *err,
- enum nftnl_parse_input input)
-{
- int ret;
-
- switch (type) {
- case NFTNL_PARSE_JSON:
- case NFTNL_PARSE_XML:
- default:
- ret = -1;
- errno = EOPNOTSUPP;
- break;
- }
-
- return ret;
-}
-
EXPORT_SYMBOL(nftnl_table_parse);
int nftnl_table_parse(struct nftnl_table *t, enum nftnl_parse_type type,
const char *data, struct nftnl_parse_err *err)
{
- return nftnl_table_do_parse(t, type, data, err, NFTNL_PARSE_BUFFER);
+ errno = EOPNOTSUPP;
+
+ return -1;
}
EXPORT_SYMBOL(nftnl_table_parse_file);
int nftnl_table_parse_file(struct nftnl_table *t, enum nftnl_parse_type type,
FILE *fp, struct nftnl_parse_err *err)
{
- return nftnl_table_do_parse(t, type, fp, err, NFTNL_PARSE_FILE);
+ errno = EOPNOTSUPP;
+
+ return -1;
}
static int nftnl_table_snprintf_default(char *buf, size_t size,