From 206d98a54305a1178c7d9c5e234699813f8c6f5a Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 7 Sep 2015 17:56:47 +0200 Subject: src: rename nftnl_rule_expr to nftnl_expr Use a shorter name for this, morever this can be used from sets so the _rule_ is misleading. Signed-off-by: Pablo Neira Ayuso --- src/expr/match.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src/expr/match.c') diff --git a/src/expr/match.c b/src/expr/match.c index 1a550cc..ddecb43 100644 --- a/src/expr/match.c +++ b/src/expr/match.c @@ -35,7 +35,7 @@ struct nftnl_expr_match { }; static int -nftnl_rule_expr_match_set(struct nftnl_rule_expr *e, uint16_t type, +nftnl_expr_match_set(struct nftnl_expr *e, uint16_t type, const void *data, uint32_t data_len) { struct nftnl_expr_match *mt = nftnl_expr_data(e); @@ -62,7 +62,7 @@ nftnl_rule_expr_match_set(struct nftnl_rule_expr *e, uint16_t type, } static const void * -nftnl_rule_expr_match_get(const struct nftnl_rule_expr *e, uint16_t type, +nftnl_expr_match_get(const struct nftnl_expr *e, uint16_t type, uint32_t *data_len) { struct nftnl_expr_match *mt = nftnl_expr_data(e); @@ -81,7 +81,7 @@ nftnl_rule_expr_match_get(const struct nftnl_rule_expr *e, uint16_t type, return NULL; } -static int nftnl_rule_expr_match_cb(const struct nlattr *attr, void *data) +static int nftnl_expr_match_cb(const struct nlattr *attr, void *data) { const struct nlattr **tb = data; int type = mnl_attr_get_type(attr); @@ -109,7 +109,7 @@ static int nftnl_rule_expr_match_cb(const struct nlattr *attr, void *data) } static void -nftnl_rule_expr_match_build(struct nlmsghdr *nlh, struct nftnl_rule_expr *e) +nftnl_expr_match_build(struct nlmsghdr *nlh, struct nftnl_expr *e) { struct nftnl_expr_match *mt = nftnl_expr_data(e); @@ -121,12 +121,12 @@ nftnl_rule_expr_match_build(struct nlmsghdr *nlh, struct nftnl_rule_expr *e) mnl_attr_put(nlh, NFTA_MATCH_INFO, mt->data_len, mt->data); } -static int nftnl_rule_expr_match_parse(struct nftnl_rule_expr *e, struct nlattr *attr) +static int nftnl_expr_match_parse(struct nftnl_expr *e, struct nlattr *attr) { struct nftnl_expr_match *match = nftnl_expr_data(e); struct nlattr *tb[NFTA_MATCH_MAX+1] = {}; - if (mnl_attr_parse_nested(attr, nftnl_rule_expr_match_cb, tb) < 0) + if (mnl_attr_parse_nested(attr, nftnl_expr_match_cb, tb) < 0) return -1; if (tb[NFTA_MATCH_NAME]) { @@ -164,7 +164,7 @@ static int nftnl_rule_expr_match_parse(struct nftnl_rule_expr *e, struct nlattr return 0; } -static int nftnl_rule_expr_match_json_parse(struct nftnl_rule_expr *e, json_t *root, +static int nftnl_expr_match_json_parse(struct nftnl_expr *e, json_t *root, struct nftnl_parse_err *err) { #ifdef JSON_PARSING @@ -172,7 +172,7 @@ static int nftnl_rule_expr_match_json_parse(struct nftnl_rule_expr *e, json_t *r name = nftnl_jansson_parse_str(root, "name", err); if (name != NULL) - nftnl_rule_expr_set_str(e, NFTNL_EXPR_MT_NAME, name); + nftnl_expr_set_str(e, NFTNL_EXPR_MT_NAME, name); return 0; #else @@ -182,7 +182,7 @@ static int nftnl_rule_expr_match_json_parse(struct nftnl_rule_expr *e, json_t *r } -static int nftnl_rule_expr_match_xml_parse(struct nftnl_rule_expr *e, mxml_node_t *tree, +static int nftnl_expr_match_xml_parse(struct nftnl_expr *e, mxml_node_t *tree, struct nftnl_parse_err *err) { #ifdef XML_PARSING @@ -191,7 +191,7 @@ static int nftnl_rule_expr_match_xml_parse(struct nftnl_rule_expr *e, mxml_node_ name = nftnl_mxml_str_parse(tree, "name", MXML_DESCEND_FIRST, NFTNL_XML_MAND, err); if (name != NULL) - nftnl_rule_expr_set_str(e, NFTNL_EXPR_MT_NAME, name); + nftnl_expr_set_str(e, NFTNL_EXPR_MT_NAME, name); /* mt->info is ignored until other solution is reached */ @@ -202,8 +202,8 @@ static int nftnl_rule_expr_match_xml_parse(struct nftnl_rule_expr *e, mxml_node_ #endif } -static int nftnl_rule_expr_match_export(char *buf, size_t size, - struct nftnl_rule_expr *e, int type) +static int nftnl_expr_match_export(char *buf, size_t size, + struct nftnl_expr *e, int type) { struct nftnl_expr_match *mt = nftnl_expr_data(e); NFTNL_BUF_INIT(b, buf, size); @@ -215,8 +215,8 @@ static int nftnl_rule_expr_match_export(char *buf, size_t size, } static int -nftnl_rule_expr_match_snprintf(char *buf, size_t len, uint32_t type, - uint32_t flags, struct nftnl_rule_expr *e) +nftnl_expr_match_snprintf(char *buf, size_t len, uint32_t type, + uint32_t flags, struct nftnl_expr *e) { struct nftnl_expr_match *match = nftnl_expr_data(e); @@ -226,14 +226,14 @@ nftnl_rule_expr_match_snprintf(char *buf, size_t len, uint32_t type, match->name, match->rev); case NFTNL_OUTPUT_XML: case NFTNL_OUTPUT_JSON: - return nftnl_rule_expr_match_export(buf, len, e, type); + return nftnl_expr_match_export(buf, len, e, type); default: break; } return -1; } -static void nftnl_rule_expr_match_free(struct nftnl_rule_expr *e) +static void nftnl_expr_match_free(struct nftnl_expr *e) { struct nftnl_expr_match *match = nftnl_expr_data(e); @@ -244,12 +244,12 @@ struct expr_ops expr_ops_match = { .name = "match", .alloc_len = sizeof(struct nftnl_expr_match), .max_attr = NFTA_MATCH_MAX, - .free = nftnl_rule_expr_match_free, - .set = nftnl_rule_expr_match_set, - .get = nftnl_rule_expr_match_get, - .parse = nftnl_rule_expr_match_parse, - .build = nftnl_rule_expr_match_build, - .snprintf = nftnl_rule_expr_match_snprintf, - .xml_parse = nftnl_rule_expr_match_xml_parse, - .json_parse = nftnl_rule_expr_match_json_parse, + .free = nftnl_expr_match_free, + .set = nftnl_expr_match_set, + .get = nftnl_expr_match_get, + .parse = nftnl_expr_match_parse, + .build = nftnl_expr_match_build, + .snprintf = nftnl_expr_match_snprintf, + .xml_parse = nftnl_expr_match_xml_parse, + .json_parse = nftnl_expr_match_json_parse, }; -- cgit v1.2.3