src: remove scaffolding around deprecated parser functions
Pablo Neira Ayuso
maintainerPATCH 1/1 src: remove scaffolding around deprecated parser functions
nftnl_.*_do_parse() are of no use anymore, remove them.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/object.c | 30 ++++++------------------------ src/rule.c | 29 ++++++----------------------- src/set.c | 30 ++++++------------------------ src/table.c | 26 ++++++-------------------- 4 files changed, 24 insertions(+), 91 deletions(-)
src/object.c +6 -24
@@ -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,
src/rule.c +6 -23
@@ -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,
src/set.c +6 -24
@@ -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,
src/table.c +6 -20
@@ -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,
Signature · 1 line
2.30.2