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/immediate.c | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'src/expr/immediate.c') diff --git a/src/expr/immediate.c b/src/expr/immediate.c index 4f3960a..c2fb9ad 100644 --- a/src/expr/immediate.c +++ b/src/expr/immediate.c @@ -26,7 +26,7 @@ struct nftnl_expr_immediate { }; static int -nftnl_rule_expr_immediate_set(struct nftnl_rule_expr *e, uint16_t type, +nftnl_expr_immediate_set(struct nftnl_expr *e, uint16_t type, const void *data, uint32_t data_len) { struct nftnl_expr_immediate *imm = nftnl_expr_data(e); @@ -55,7 +55,7 @@ nftnl_rule_expr_immediate_set(struct nftnl_rule_expr *e, uint16_t type, } static const void * -nftnl_rule_expr_immediate_get(const struct nftnl_rule_expr *e, uint16_t type, +nftnl_expr_immediate_get(const struct nftnl_expr *e, uint16_t type, uint32_t *data_len) { struct nftnl_expr_immediate *imm = nftnl_expr_data(e); @@ -77,7 +77,7 @@ nftnl_rule_expr_immediate_get(const struct nftnl_rule_expr *e, uint16_t type, return NULL; } -static int nftnl_rule_expr_immediate_cb(const struct nlattr *attr, void *data) +static int nftnl_expr_immediate_cb(const struct nlattr *attr, void *data) { const struct nlattr **tb = data; int type = mnl_attr_get_type(attr); @@ -101,7 +101,7 @@ static int nftnl_rule_expr_immediate_cb(const struct nlattr *attr, void *data) } static void -nftnl_rule_expr_immediate_build(struct nlmsghdr *nlh, struct nftnl_rule_expr *e) +nftnl_expr_immediate_build(struct nlmsghdr *nlh, struct nftnl_expr *e) { struct nftnl_expr_immediate *imm = nftnl_expr_data(e); @@ -131,13 +131,13 @@ nftnl_rule_expr_immediate_build(struct nlmsghdr *nlh, struct nftnl_rule_expr *e) } static int -nftnl_rule_expr_immediate_parse(struct nftnl_rule_expr *e, struct nlattr *attr) +nftnl_expr_immediate_parse(struct nftnl_expr *e, struct nlattr *attr) { struct nftnl_expr_immediate *imm = nftnl_expr_data(e); struct nlattr *tb[NFTA_IMMEDIATE_MAX+1] = {}; int ret = 0; - if (mnl_attr_parse_nested(attr, nftnl_rule_expr_immediate_cb, tb) < 0) + if (mnl_attr_parse_nested(attr, nftnl_expr_immediate_cb, tb) < 0) return -1; if (tb[NFTA_IMMEDIATE_DREG]) { @@ -172,7 +172,7 @@ nftnl_rule_expr_immediate_parse(struct nftnl_rule_expr *e, struct nlattr *attr) } static int -nftnl_rule_expr_immediate_json_parse(struct nftnl_rule_expr *e, json_t *root, +nftnl_expr_immediate_json_parse(struct nftnl_expr *e, json_t *root, struct nftnl_parse_err *err) { #ifdef JSON_PARSING @@ -181,7 +181,7 @@ nftnl_rule_expr_immediate_json_parse(struct nftnl_rule_expr *e, json_t *root, uint32_t reg; if (nftnl_jansson_parse_reg(root, "dreg", NFTNL_TYPE_U32, ®, err) == 0) - nftnl_rule_expr_set_u32(e, NFTNL_EXPR_IMM_DREG, reg); + nftnl_expr_set_u32(e, NFTNL_EXPR_IMM_DREG, reg); datareg_type = nftnl_jansson_data_reg_parse(root, "data", &imm->data, err); @@ -208,7 +208,7 @@ nftnl_rule_expr_immediate_json_parse(struct nftnl_rule_expr *e, json_t *root, } static int -nftnl_rule_expr_immediate_xml_parse(struct nftnl_rule_expr *e, mxml_node_t *tree, +nftnl_expr_immediate_xml_parse(struct nftnl_expr *e, mxml_node_t *tree, struct nftnl_parse_err *err) { #ifdef XML_PARSING @@ -218,7 +218,7 @@ nftnl_rule_expr_immediate_xml_parse(struct nftnl_rule_expr *e, mxml_node_t *tree if (nftnl_mxml_reg_parse(tree, "dreg", ®, MXML_DESCEND_FIRST, NFTNL_XML_MAND, err) == 0) - nftnl_rule_expr_set_u32(e, NFTNL_EXPR_IMM_DREG, reg); + nftnl_expr_set_u32(e, NFTNL_EXPR_IMM_DREG, reg); datareg_type = nftnl_mxml_data_reg_parse(tree, "data", &imm->data, NFTNL_XML_MAND, err); @@ -246,7 +246,7 @@ nftnl_rule_expr_immediate_xml_parse(struct nftnl_rule_expr *e, mxml_node_t *tree } static int -nftnl_rule_expr_immediate_export(char *buf, size_t size, struct nftnl_rule_expr *e, +nftnl_expr_immediate_export(char *buf, size_t size, struct nftnl_expr *e, int type) { struct nftnl_expr_immediate *imm = nftnl_expr_data(e); @@ -265,8 +265,8 @@ nftnl_rule_expr_immediate_export(char *buf, size_t size, struct nftnl_rule_expr } static int -nftnl_rule_expr_immediate_snprintf_default(char *buf, size_t len, - struct nftnl_rule_expr *e, uint32_t flags) +nftnl_expr_immediate_snprintf_default(char *buf, size_t len, + struct nftnl_expr *e, uint32_t flags) { int size = len, offset = 0, ret; struct nftnl_expr_immediate *imm = nftnl_expr_data(e); @@ -294,22 +294,22 @@ nftnl_rule_expr_immediate_snprintf_default(char *buf, size_t len, } static int -nftnl_rule_expr_immediate_snprintf(char *buf, size_t len, uint32_t type, - uint32_t flags, struct nftnl_rule_expr *e) +nftnl_expr_immediate_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_immediate_snprintf_default(buf, len, e, flags); + return nftnl_expr_immediate_snprintf_default(buf, len, e, flags); case NFTNL_OUTPUT_XML: case NFTNL_OUTPUT_JSON: - return nftnl_rule_expr_immediate_export(buf, len, e, type); + return nftnl_expr_immediate_export(buf, len, e, type); default: break; } return -1; } -static void nftnl_rule_expr_immediate_free(struct nftnl_rule_expr *e) +static void nftnl_expr_immediate_free(struct nftnl_expr *e) { struct nftnl_expr_immediate *imm = nftnl_expr_data(e); @@ -321,12 +321,12 @@ struct expr_ops expr_ops_immediate = { .name = "immediate", .alloc_len = sizeof(struct nftnl_expr_immediate), .max_attr = NFTA_IMMEDIATE_MAX, - .free = nftnl_rule_expr_immediate_free, - .set = nftnl_rule_expr_immediate_set, - .get = nftnl_rule_expr_immediate_get, - .parse = nftnl_rule_expr_immediate_parse, - .build = nftnl_rule_expr_immediate_build, - .snprintf = nftnl_rule_expr_immediate_snprintf, - .xml_parse = nftnl_rule_expr_immediate_xml_parse, - .json_parse = nftnl_rule_expr_immediate_json_parse, + .free = nftnl_expr_immediate_free, + .set = nftnl_expr_immediate_set, + .get = nftnl_expr_immediate_get, + .parse = nftnl_expr_immediate_parse, + .build = nftnl_expr_immediate_build, + .snprintf = nftnl_expr_immediate_snprintf, + .xml_parse = nftnl_expr_immediate_xml_parse, + .json_parse = nftnl_expr_immediate_json_parse, }; -- cgit v1.2.3