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/masq.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/expr/masq.c') diff --git a/src/expr/masq.c b/src/expr/masq.c index ee49151..01512b4 100644 --- a/src/expr/masq.c +++ b/src/expr/masq.c @@ -25,7 +25,7 @@ struct nftnl_expr_masq { }; static int -nftnl_rule_expr_masq_set(struct nftnl_rule_expr *e, uint16_t type, +nftnl_expr_masq_set(struct nftnl_expr *e, uint16_t type, const void *data, uint32_t data_len) { struct nftnl_expr_masq *masq = nftnl_expr_data(e); @@ -41,7 +41,7 @@ nftnl_rule_expr_masq_set(struct nftnl_rule_expr *e, uint16_t type, } static const void * -nftnl_rule_expr_masq_get(const struct nftnl_rule_expr *e, uint16_t type, +nftnl_expr_masq_get(const struct nftnl_expr *e, uint16_t type, uint32_t *data_len) { struct nftnl_expr_masq *masq = nftnl_expr_data(e); @@ -54,7 +54,7 @@ nftnl_rule_expr_masq_get(const struct nftnl_rule_expr *e, uint16_t type, return NULL; } -static int nftnl_rule_expr_masq_cb(const struct nlattr *attr, void *data) +static int nftnl_expr_masq_cb(const struct nlattr *attr, void *data) { const struct nlattr **tb = data; int type = mnl_attr_get_type(attr); @@ -74,7 +74,7 @@ static int nftnl_rule_expr_masq_cb(const struct nlattr *attr, void *data) } static void -nftnl_rule_expr_masq_build(struct nlmsghdr *nlh, struct nftnl_rule_expr *e) +nftnl_expr_masq_build(struct nlmsghdr *nlh, struct nftnl_expr *e) { struct nftnl_expr_masq *masq = nftnl_expr_data(e); @@ -83,12 +83,12 @@ nftnl_rule_expr_masq_build(struct nlmsghdr *nlh, struct nftnl_rule_expr *e) } static int -nftnl_rule_expr_masq_parse(struct nftnl_rule_expr *e, struct nlattr *attr) +nftnl_expr_masq_parse(struct nftnl_expr *e, struct nlattr *attr) { struct nftnl_expr_masq *masq = nftnl_expr_data(e); struct nlattr *tb[NFTA_MASQ_MAX+1] = {}; - if (mnl_attr_parse_nested(attr, nftnl_rule_expr_masq_cb, tb) < 0) + if (mnl_attr_parse_nested(attr, nftnl_expr_masq_cb, tb) < 0) return -1; if (tb[NFTA_MASQ_FLAGS]) { @@ -100,7 +100,7 @@ nftnl_rule_expr_masq_parse(struct nftnl_rule_expr *e, struct nlattr *attr) } static int -nftnl_rule_expr_masq_json_parse(struct nftnl_rule_expr *e, json_t *root, +nftnl_expr_masq_json_parse(struct nftnl_expr *e, json_t *root, struct nftnl_parse_err *err) { #ifdef JSON_PARSING @@ -108,7 +108,7 @@ nftnl_rule_expr_masq_json_parse(struct nftnl_rule_expr *e, json_t *root, if (nftnl_jansson_parse_val(root, "flags", NFTNL_TYPE_U32, &flags, err) == 0) - nftnl_rule_expr_set_u32(e, NFTNL_EXPR_MASQ_FLAGS, flags); + nftnl_expr_set_u32(e, NFTNL_EXPR_MASQ_FLAGS, flags); return 0; #else @@ -118,7 +118,7 @@ nftnl_rule_expr_masq_json_parse(struct nftnl_rule_expr *e, json_t *root, } static int -nftnl_rule_expr_masq_xml_parse(struct nftnl_rule_expr *e, mxml_node_t *tree, +nftnl_expr_masq_xml_parse(struct nftnl_expr *e, mxml_node_t *tree, struct nftnl_parse_err *err) { #ifdef XML_PARSING @@ -126,7 +126,7 @@ nftnl_rule_expr_masq_xml_parse(struct nftnl_rule_expr *e, mxml_node_t *tree, if (nftnl_mxml_num_parse(tree, "flags", MXML_DESCEND_FIRST, BASE_DEC, &flags, NFTNL_TYPE_U32, NFTNL_XML_MAND, err) == 0) - nftnl_rule_expr_set_u32(e, NFTNL_EXPR_MASQ_FLAGS, flags); + nftnl_expr_set_u32(e, NFTNL_EXPR_MASQ_FLAGS, flags); return 0; #else @@ -134,8 +134,8 @@ nftnl_rule_expr_masq_xml_parse(struct nftnl_rule_expr *e, mxml_node_t *tree, return -1; #endif } -static int nftnl_rule_expr_masq_export(char *buf, size_t size, - struct nftnl_rule_expr *e, int type) +static int nftnl_expr_masq_export(char *buf, size_t size, + struct nftnl_expr *e, int type) { struct nftnl_expr_masq *masq = nftnl_expr_data(e); NFTNL_BUF_INIT(b, buf, size); @@ -146,8 +146,8 @@ static int nftnl_rule_expr_masq_export(char *buf, size_t size, return nftnl_buf_done(&b); } -static int nftnl_rule_expr_masq_snprintf_default(char *buf, size_t len, - struct nftnl_rule_expr *e) +static int nftnl_expr_masq_snprintf_default(char *buf, size_t len, + struct nftnl_expr *e) { struct nftnl_expr_masq *masq = nftnl_expr_data(e); @@ -157,15 +157,15 @@ static int nftnl_rule_expr_masq_snprintf_default(char *buf, size_t len, return 0; } -static int nftnl_rule_expr_masq_snprintf(char *buf, size_t len, uint32_t type, - uint32_t flags, struct nftnl_rule_expr *e) +static int nftnl_expr_masq_snprintf(char *buf, size_t len, uint32_t type, + uint32_t flags, struct nftnl_expr *e) { switch (type) { case NFTNL_OUTPUT_DEFAULT: - return nftnl_rule_expr_masq_snprintf_default(buf, len, e); + return nftnl_expr_masq_snprintf_default(buf, len, e); case NFTNL_OUTPUT_XML: case NFTNL_OUTPUT_JSON: - return nftnl_rule_expr_masq_export(buf, len, e, type); + return nftnl_expr_masq_export(buf, len, e, type); default: break; } @@ -176,11 +176,11 @@ struct expr_ops expr_ops_masq = { .name = "masq", .alloc_len = sizeof(struct nftnl_expr_masq), .max_attr = NFTA_MASQ_MAX, - .set = nftnl_rule_expr_masq_set, - .get = nftnl_rule_expr_masq_get, - .parse = nftnl_rule_expr_masq_parse, - .build = nftnl_rule_expr_masq_build, - .snprintf = nftnl_rule_expr_masq_snprintf, - .xml_parse = nftnl_rule_expr_masq_xml_parse, - .json_parse = nftnl_rule_expr_masq_json_parse, + .set = nftnl_expr_masq_set, + .get = nftnl_expr_masq_get, + .parse = nftnl_expr_masq_parse, + .build = nftnl_expr_masq_build, + .snprintf = nftnl_expr_masq_snprintf, + .xml_parse = nftnl_expr_masq_xml_parse, + .json_parse = nftnl_expr_masq_json_parse, }; -- cgit v1.2.3