summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/chain.c10
-rw-r--r--src/expr/byteorder.c2
-rw-r--r--src/expr/cmp.c2
-rw-r--r--src/expr/ct.c2
-rw-r--r--src/expr/data_reg.c9
-rw-r--r--src/expr/exthdr.c2
-rw-r--r--src/expr/log.c2
-rw-r--r--src/expr/lookup.c2
-rw-r--r--src/expr/match.c2
-rw-r--r--src/expr/meta.c2
-rw-r--r--src/expr/nat.c4
-rw-r--r--src/expr/payload.c2
-rw-r--r--src/expr/target.c2
-rw-r--r--src/internal.h2
-rw-r--r--src/jansson.c10
-rw-r--r--src/rule.c4
-rw-r--r--src/table.c2
17 files changed, 30 insertions, 31 deletions
diff --git a/src/chain.c b/src/chain.c
index 93896c9..57b2284 100644
--- a/src/chain.c
+++ b/src/chain.c
@@ -497,7 +497,7 @@ static int nft_chain_json_parse(struct nft_chain *c, const char *json)
if (root == NULL)
return -1;
- valstr = nft_jansson_value_parse_str(root, "name");
+ valstr = nft_jansson_parse_str(root, "name");
if (valstr == NULL)
goto err;
@@ -526,7 +526,7 @@ static int nft_chain_json_parse(struct nft_chain *c, const char *json)
nft_chain_attr_set_u32(c, NFT_CHAIN_ATTR_FAMILY, val32);
- valstr = nft_jansson_value_parse_str(root, "table");
+ valstr = nft_jansson_parse_str(root, "table");
if (valstr == NULL)
goto err;
@@ -534,7 +534,7 @@ static int nft_chain_json_parse(struct nft_chain *c, const char *json)
nft_chain_attr_set_str(c, NFT_CHAIN_ATTR_TABLE, valstr);
if (nft_jansson_node_exist(root, "hooknum")) {
- valstr = nft_jansson_value_parse_str(root, "type");
+ valstr = nft_jansson_parse_str(root, "type");
if (valstr == NULL)
goto err;
@@ -547,7 +547,7 @@ static int nft_chain_json_parse(struct nft_chain *c, const char *json)
nft_chain_attr_set_s32(c, NFT_CHAIN_ATTR_PRIO, val32);
- valstr = nft_jansson_value_parse_str(root, "hooknum");
+ valstr = nft_jansson_parse_str(root, "hooknum");
if (valstr == NULL)
goto err;
@@ -557,7 +557,7 @@ static int nft_chain_json_parse(struct nft_chain *c, const char *json)
nft_chain_attr_set_u32(c, NFT_CHAIN_ATTR_HOOKNUM, val32);
- valstr = nft_jansson_value_parse_str(root, "policy");
+ valstr = nft_jansson_parse_str(root, "policy");
if (valstr == NULL)
goto err;
diff --git a/src/expr/byteorder.c b/src/expr/byteorder.c
index f596ff3..dab9061 100644
--- a/src/expr/byteorder.c
+++ b/src/expr/byteorder.c
@@ -213,7 +213,7 @@ nft_rule_expr_byteorder_json_parse(struct nft_rule_expr *e, json_t *root)
nft_rule_expr_set_u32(e, NFT_EXPR_BYTEORDER_DREG, uval32);
- op = nft_jansson_value_parse_str(root, "op");
+ op = nft_jansson_parse_str(root, "op");
if (op == NULL)
return -1;
diff --git a/src/expr/cmp.c b/src/expr/cmp.c
index 16be540..71f8e60 100644
--- a/src/expr/cmp.c
+++ b/src/expr/cmp.c
@@ -188,7 +188,7 @@ static int nft_rule_expr_cmp_json_parse(struct nft_rule_expr *e, json_t *root)
nft_rule_expr_set_u32(e, NFT_EXPR_CMP_SREG, uval32);
- op = nft_jansson_value_parse_str(root, "op");
+ op = nft_jansson_parse_str(root, "op");
if (op == NULL)
return -1;
diff --git a/src/expr/ct.c b/src/expr/ct.c
index c131e67..79c4f05 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -192,7 +192,7 @@ static int nft_rule_expr_ct_json_parse(struct nft_rule_expr *e, json_t *root)
nft_rule_expr_set_u32(e, NFT_EXPR_CT_DREG, reg);
if (nft_jansson_node_exist(root, "key")) {
- key_str = nft_jansson_value_parse_str(root, "key");
+ key_str = nft_jansson_parse_str(root, "key");
if (key_str == NULL)
return -1;
diff --git a/src/expr/data_reg.c b/src/expr/data_reg.c
index d0e1a83..3b6a87a 100644
--- a/src/expr/data_reg.c
+++ b/src/expr/data_reg.c
@@ -32,7 +32,7 @@ static int nft_data_reg_verdict_json_parse(union nft_data_reg *reg, json_t *data
int verdict;
const char *verdict_str;
- verdict_str = nft_jansson_value_parse_str(data, "verdict");
+ verdict_str = nft_jansson_parse_str(data, "verdict");
if (verdict_str == NULL)
return -1;
@@ -47,7 +47,7 @@ static int nft_data_reg_verdict_json_parse(union nft_data_reg *reg, json_t *data
static int nft_data_reg_chain_json_parse(union nft_data_reg *reg, json_t *data)
{
- reg->chain = strdup(nft_jansson_value_parse_str(data, "chain"));
+ reg->chain = strdup(nft_jansson_parse_str(data, "chain"));
if (reg->chain == NULL) {
return -1;
}
@@ -82,10 +82,9 @@ int nft_data_reg_json_parse(union nft_data_reg *reg, json_t *data)
const char *type;
- type = nft_jansson_value_parse_str(data, "type");
- if (type == NULL) {
+ type = nft_jansson_parse_str(data, "type");
+ if (type == NULL)
return -1;
- }
/* Select what type of parsing is needed */
if (strcmp(type, "value") == 0) {
diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c
index 8d4e8b7..b0705b5 100644
--- a/src/expr/exthdr.c
+++ b/src/expr/exthdr.c
@@ -206,7 +206,7 @@ nft_rule_expr_exthdr_json_parse(struct nft_rule_expr *e, json_t *root)
nft_rule_expr_set_u32(e, NFT_EXPR_EXTHDR_DREG, uval32);
- exthdr_type = nft_jansson_value_parse_str(root, "exthdr_type");
+ exthdr_type = nft_jansson_parse_str(root, "exthdr_type");
if (exthdr_type == NULL)
return -1;
diff --git a/src/expr/log.c b/src/expr/log.c
index 1dfea1b..8858e5b 100644
--- a/src/expr/log.c
+++ b/src/expr/log.c
@@ -163,7 +163,7 @@ static int nft_rule_expr_log_json_parse(struct nft_rule_expr *e, json_t *root)
uint32_t snaplen;
uint16_t uval16;
- prefix = nft_jansson_value_parse_str(root, "prefix");
+ prefix = nft_jansson_parse_str(root, "prefix");
if (prefix == NULL)
return -1;
diff --git a/src/expr/lookup.c b/src/expr/lookup.c
index 34f484c..cbc4d42 100644
--- a/src/expr/lookup.c
+++ b/src/expr/lookup.c
@@ -149,7 +149,7 @@ nft_rule_expr_lookup_json_parse(struct nft_rule_expr *e, json_t *root)
const char *set_name;
int32_t reg;
- set_name = nft_jansson_value_parse_str(root, "set");
+ set_name = nft_jansson_parse_str(root, "set");
if (set_name == NULL)
return -1;
diff --git a/src/expr/match.c b/src/expr/match.c
index 763e11e..b18d594 100644
--- a/src/expr/match.c
+++ b/src/expr/match.c
@@ -175,7 +175,7 @@ static int nft_rule_expr_match_json_parse(struct nft_rule_expr *e, json_t *root)
#ifdef JSON_PARSING
const char *name;
- name = nft_jansson_value_parse_str(root, "name");
+ name = nft_jansson_parse_str(root, "name");
if (name == NULL)
return -1;
diff --git a/src/expr/meta.c b/src/expr/meta.c
index 84b8ba8..bbe5496 100644
--- a/src/expr/meta.c
+++ b/src/expr/meta.c
@@ -172,7 +172,7 @@ static int nft_rule_expr_meta_json_parse(struct nft_rule_expr *e, json_t *root)
nft_rule_expr_set_u32(e, NFT_EXPR_META_DREG, reg);
- key_str = nft_jansson_value_parse_str(root, "key");
+ key_str = nft_jansson_parse_str(root, "key");
if (key_str == NULL)
return -1;
diff --git a/src/expr/nat.c b/src/expr/nat.c
index 312594f..6cde333 100644
--- a/src/expr/nat.c
+++ b/src/expr/nat.c
@@ -203,7 +203,7 @@ static int nft_rule_expr_nat_json_parse(struct nft_rule_expr *e, json_t *root)
uint32_t reg;
int val32;
- nat_type = nft_jansson_value_parse_str(root, "nat_type");
+ nat_type = nft_jansson_parse_str(root, "nat_type");
if (nat_type == NULL)
return -1;
@@ -213,7 +213,7 @@ static int nft_rule_expr_nat_json_parse(struct nft_rule_expr *e, json_t *root)
nft_rule_expr_set_u32(e, NFT_EXPR_NAT_TYPE, val32);
- family_str = nft_jansson_value_parse_str(root, "family");
+ family_str = nft_jansson_parse_str(root, "family");
if (family_str == NULL)
return -1;
diff --git a/src/expr/payload.c b/src/expr/payload.c
index 84346a1..161b0d9 100644
--- a/src/expr/payload.c
+++ b/src/expr/payload.c
@@ -206,7 +206,7 @@ nft_rule_expr_payload_json_parse(struct nft_rule_expr *e, json_t *root)
nft_rule_expr_set_u32(e, NFT_EXPR_PAYLOAD_DREG, reg);
- base_str = nft_jansson_value_parse_str(root, "base");
+ base_str = nft_jansson_parse_str(root, "base");
if (base_str == NULL)
return -1;
diff --git a/src/expr/target.c b/src/expr/target.c
index ede4830..a6645ff 100644
--- a/src/expr/target.c
+++ b/src/expr/target.c
@@ -176,7 +176,7 @@ nft_rule_expr_target_json_parse(struct nft_rule_expr *e, json_t *root)
#ifdef JSON_PARSING
const char *name;
- name = nft_jansson_value_parse_str(root, "name");
+ name = nft_jansson_parse_str(root, "name");
if (name == NULL)
return -1;
diff --git a/src/internal.h b/src/internal.h
index 5cf899a..e614a67 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -46,7 +46,7 @@ int nft_mxml_set_elem_parse(mxml_node_t *node, struct nft_set_elem *e);
#include <jansson.h>
int nft_jansson_value_parse_val(json_t *root, const char *tag,
int type, void *out);
-const char *nft_jansson_value_parse_str(json_t *root, const char *tag);
+const char *nft_jansson_parse_str(json_t *root, const char *tag);
bool nft_jansson_node_exist(json_t *root, const char *tag);
json_t *nft_jansson_create_root(const char *json, json_error_t *err);
json_t *nft_jansson_get_node(json_t *root, const char *tag);
diff --git a/src/jansson.c b/src/jansson.c
index f2b2f00..e9a1315 100644
--- a/src/jansson.c
+++ b/src/jansson.c
@@ -42,7 +42,7 @@ static int nft_jansson_load_int_node(json_t *root, const char *tag,
return 0;
}
-const char *nft_jansson_value_parse_str(json_t *root, const char *tag)
+const char *nft_jansson_parse_str(json_t *root, const char *tag)
{
json_t *node;
const char *val;
@@ -112,7 +112,7 @@ int nft_jansson_parse_family(json_t *root, void *out)
const char *str;
int family;
- str = nft_jansson_value_parse_str(root, "family");
+ str = nft_jansson_parse_str(root, "family");
if (str == NULL)
return -1;
@@ -145,7 +145,7 @@ int nft_jansson_str2num(json_t *root, const char *tag, int base,
{
const char *str;
- str = nft_jansson_value_parse_str(root, tag);
+ str = nft_jansson_parse_str(root, tag);
if (str == NULL)
return -1;
@@ -158,7 +158,7 @@ struct nft_rule_expr *nft_jansson_expr_parse(json_t *root)
const char *type;
int ret;
- type = nft_jansson_value_parse_str(root, "type");
+ type = nft_jansson_parse_str(root, "type");
if (type == NULL)
return NULL;
@@ -197,7 +197,7 @@ int nft_jansson_data_reg_parse(json_t *root, const char *tag,
return -1;
}
- type = nft_jansson_value_parse_str(data, "type");
+ type = nft_jansson_parse_str(data, "type");
if (type == NULL)
return -1;
diff --git a/src/rule.c b/src/rule.c
index aca88d0..432637a 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -499,13 +499,13 @@ static int nft_rule_json_parse(struct nft_rule *r, const char *json)
nft_rule_attr_set_u32(r, NFT_RULE_ATTR_FAMILY, family);
- str = nft_jansson_value_parse_str(root, "table");
+ str = nft_jansson_parse_str(root, "table");
if (str == NULL)
goto err;
nft_rule_attr_set_str(r, NFT_RULE_ATTR_TABLE, str);
- str = nft_jansson_value_parse_str(root, "chain");
+ str = nft_jansson_parse_str(root, "chain");
if (str == NULL)
goto err;
diff --git a/src/table.c b/src/table.c
index a096da7..6fb22c3 100644
--- a/src/table.c
+++ b/src/table.c
@@ -283,7 +283,7 @@ static int nft_table_json_parse(struct nft_table *t, const char *json)
if (root == NULL)
return -1;
- str = nft_jansson_value_parse_str(root, "name");
+ str = nft_jansson_parse_str(root, "name");
if (str == NULL)
goto err;