summaryrefslogtreecommitdiffstats
path: root/src/expr/meta.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/meta.c')
-rw-r--r--src/expr/meta.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/expr/meta.c b/src/expr/meta.c
index 98f7588..546b225 100644
--- a/src/expr/meta.c
+++ b/src/expr/meta.c
@@ -32,7 +32,7 @@ struct nftnl_expr_meta {
};
static int
-nftnl_rule_expr_meta_set(struct nftnl_rule_expr *e, uint16_t type,
+nftnl_expr_meta_set(struct nftnl_expr *e, uint16_t type,
const void *data, uint32_t data_len)
{
struct nftnl_expr_meta *meta = nftnl_expr_data(e);
@@ -54,7 +54,7 @@ nftnl_rule_expr_meta_set(struct nftnl_rule_expr *e, uint16_t type,
}
static const void *
-nftnl_rule_expr_meta_get(const struct nftnl_rule_expr *e, uint16_t type,
+nftnl_expr_meta_get(const struct nftnl_expr *e, uint16_t type,
uint32_t *data_len)
{
struct nftnl_expr_meta *meta = nftnl_expr_data(e);
@@ -73,7 +73,7 @@ nftnl_rule_expr_meta_get(const struct nftnl_rule_expr *e, uint16_t type,
return NULL;
}
-static int nftnl_rule_expr_meta_cb(const struct nlattr *attr, void *data)
+static int nftnl_expr_meta_cb(const struct nlattr *attr, void *data)
{
const struct nlattr **tb = data;
int type = mnl_attr_get_type(attr);
@@ -95,7 +95,7 @@ static int nftnl_rule_expr_meta_cb(const struct nlattr *attr, void *data)
}
static void
-nftnl_rule_expr_meta_build(struct nlmsghdr *nlh, struct nftnl_rule_expr *e)
+nftnl_expr_meta_build(struct nlmsghdr *nlh, struct nftnl_expr *e)
{
struct nftnl_expr_meta *meta = nftnl_expr_data(e);
@@ -108,12 +108,12 @@ nftnl_rule_expr_meta_build(struct nlmsghdr *nlh, struct nftnl_rule_expr *e)
}
static int
-nftnl_rule_expr_meta_parse(struct nftnl_rule_expr *e, struct nlattr *attr)
+nftnl_expr_meta_parse(struct nftnl_expr *e, struct nlattr *attr)
{
struct nftnl_expr_meta *meta = nftnl_expr_data(e);
struct nlattr *tb[NFTA_META_MAX+1] = {};
- if (mnl_attr_parse_nested(attr, nftnl_rule_expr_meta_cb, tb) < 0)
+ if (mnl_attr_parse_nested(attr, nftnl_expr_meta_cb, tb) < 0)
return -1;
if (tb[NFTA_META_KEY]) {
@@ -180,7 +180,7 @@ static inline int str2meta_key(const char *str)
return -1;
}
-static int nftnl_rule_expr_meta_json_parse(struct nftnl_rule_expr *e, json_t *root,
+static int nftnl_expr_meta_json_parse(struct nftnl_expr *e, json_t *root,
struct nftnl_parse_err *err)
{
#ifdef JSON_PARSING
@@ -192,19 +192,19 @@ static int nftnl_rule_expr_meta_json_parse(struct nftnl_rule_expr *e, json_t *ro
if (key_str != NULL) {
key = str2meta_key(key_str);
if (key >= 0)
- nftnl_rule_expr_set_u32(e, NFTNL_EXPR_META_KEY, key);
+ nftnl_expr_set_u32(e, NFTNL_EXPR_META_KEY, key);
}
if (nftnl_jansson_node_exist(root, "dreg")) {
if (nftnl_jansson_parse_reg(root, "dreg", NFTNL_TYPE_U32, &reg,
err) == 0)
- nftnl_rule_expr_set_u32(e, NFTNL_EXPR_META_DREG, reg);
+ nftnl_expr_set_u32(e, NFTNL_EXPR_META_DREG, reg);
}
if (nftnl_jansson_node_exist(root, "sreg")) {
if (nftnl_jansson_parse_reg(root, "sreg", NFTNL_TYPE_U32, &reg,
err) == 0)
- nftnl_rule_expr_set_u32(e, NFTNL_EXPR_META_SREG, reg);
+ nftnl_expr_set_u32(e, NFTNL_EXPR_META_SREG, reg);
}
return 0;
@@ -215,7 +215,7 @@ static int nftnl_rule_expr_meta_json_parse(struct nftnl_rule_expr *e, json_t *ro
}
-static int nftnl_rule_expr_meta_xml_parse(struct nftnl_rule_expr *e, mxml_node_t *tree,
+static int nftnl_expr_meta_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
struct nftnl_parse_err *err)
{
#ifdef XML_PARSING
@@ -228,16 +228,16 @@ static int nftnl_rule_expr_meta_xml_parse(struct nftnl_rule_expr *e, mxml_node_t
if (key_str != NULL) {
key = str2meta_key(key_str);
if (key >= 0)
- nftnl_rule_expr_set_u32(e, NFTNL_EXPR_META_KEY, key);
+ nftnl_expr_set_u32(e, NFTNL_EXPR_META_KEY, key);
}
if (nftnl_mxml_reg_parse(tree, "dreg", &dreg, MXML_DESCEND_FIRST,
NFTNL_XML_OPT, err) == 0)
- nftnl_rule_expr_set_u32(e, NFTNL_EXPR_META_DREG, dreg);
+ nftnl_expr_set_u32(e, NFTNL_EXPR_META_DREG, dreg);
if (nftnl_mxml_reg_parse(tree, "sreg", &sreg, MXML_DESCEND_FIRST,
NFTNL_XML_OPT, err) == 0)
- nftnl_rule_expr_set_u32(e, NFTNL_EXPR_META_SREG, sreg);
+ nftnl_expr_set_u32(e, NFTNL_EXPR_META_SREG, sreg);
return 0;
#else
@@ -247,8 +247,8 @@ static int nftnl_rule_expr_meta_xml_parse(struct nftnl_rule_expr *e, mxml_node_t
}
static int
-nftnl_rule_expr_meta_snprintf_default(char *buf, size_t len,
- struct nftnl_rule_expr *e)
+nftnl_expr_meta_snprintf_default(char *buf, size_t len,
+ struct nftnl_expr *e)
{
struct nftnl_expr_meta *meta = nftnl_expr_data(e);
@@ -263,8 +263,8 @@ nftnl_rule_expr_meta_snprintf_default(char *buf, size_t len,
return 0;
}
-static int nftnl_rule_expr_meta_export(char *buf, size_t size,
- struct nftnl_rule_expr *e, int type)
+static int nftnl_expr_meta_export(char *buf, size_t size,
+ struct nftnl_expr *e, int type)
{
struct nftnl_expr_meta *meta = nftnl_expr_data(e);
NFTNL_BUF_INIT(b, buf, size);
@@ -280,15 +280,15 @@ static int nftnl_rule_expr_meta_export(char *buf, size_t size,
}
static int
-nftnl_rule_expr_meta_snprintf(char *buf, size_t len, uint32_t type,
- uint32_t flags, struct nftnl_rule_expr *e)
+nftnl_expr_meta_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_meta_snprintf_default(buf, len, e);
+ return nftnl_expr_meta_snprintf_default(buf, len, e);
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON:
- return nftnl_rule_expr_meta_export(buf, len, e, type);
+ return nftnl_expr_meta_export(buf, len, e, type);
default:
break;
}
@@ -299,11 +299,11 @@ struct expr_ops expr_ops_meta = {
.name = "meta",
.alloc_len = sizeof(struct nftnl_expr_meta),
.max_attr = NFTA_META_MAX,
- .set = nftnl_rule_expr_meta_set,
- .get = nftnl_rule_expr_meta_get,
- .parse = nftnl_rule_expr_meta_parse,
- .build = nftnl_rule_expr_meta_build,
- .snprintf = nftnl_rule_expr_meta_snprintf,
- .xml_parse = nftnl_rule_expr_meta_xml_parse,
- .json_parse = nftnl_rule_expr_meta_json_parse,
+ .set = nftnl_expr_meta_set,
+ .get = nftnl_expr_meta_get,
+ .parse = nftnl_expr_meta_parse,
+ .build = nftnl_expr_meta_build,
+ .snprintf = nftnl_expr_meta_snprintf,
+ .xml_parse = nftnl_expr_meta_xml_parse,
+ .json_parse = nftnl_expr_meta_json_parse,
};