[PATCH nft] src: use new definitions from libnftnl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use new definitions in libnftnl, so we can consider getting rid of them
at some point.

Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 src/netlink.c             |  4 ++--
 src/netlink_delinearize.c |  4 ++--
 src/netlink_linearize.c   | 14 +++++++-------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/netlink.c b/src/netlink.c
index f82d4fa..cf24c8a 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -1502,10 +1502,10 @@ static int netlink_delinearize_setelem(struct nftnl_set_elem *nlse,
 		data = nftnl_set_elem_get(nlse, NFTNL_SET_ELEM_USERDATA, &len);
 		expr->comment = udata_get_comment(data, len);
 	}
-	if (nftnl_set_elem_is_set(nlse, NFT_SET_ELEM_ATTR_EXPR)) {
+	if (nftnl_set_elem_is_set(nlse, NFTNL_SET_ELEM_EXPR)) {
 		const struct nftnl_expr *nle;
 
-		nle = nftnl_set_elem_get(nlse, NFT_SET_ELEM_ATTR_EXPR, NULL);
+		nle = nftnl_set_elem_get(nlse, NFTNL_SET_ELEM_EXPR, NULL);
 		expr->stmt = netlink_parse_set_expr(set, nle);
 	}
 
diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index 9e26078..7735699 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -433,7 +433,7 @@ static void netlink_parse_payload_stmt(struct netlink_parse_ctx *ctx,
 	expr = payload_expr_alloc(loc, NULL, 0);
 	payload_init_raw(expr, base, offset, len);
 
-	sreg = netlink_parse_register(nle, NFT_EXPR_PAYLOAD_SREG);
+	sreg = netlink_parse_register(nle, NFTNL_EXPR_PAYLOAD_SREG);
 	val  = netlink_get_register(ctx, loc, sreg);
 	stmt = payload_stmt_alloc(loc, expr, val);
 
@@ -444,7 +444,7 @@ static void netlink_parse_payload(struct netlink_parse_ctx *ctx,
 				  const struct location *loc,
 				  const struct nftnl_expr *nle)
 {
-	if (nftnl_expr_is_set(nle, NFT_EXPR_PAYLOAD_DREG))
+	if (nftnl_expr_is_set(nle, NFTNL_EXPR_PAYLOAD_DREG))
 		netlink_parse_payload_expr(ctx, loc, nle);
 	else
 		netlink_parse_payload_stmt(ctx, loc, nle);
diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
index 98c22d8..01a85d0 100644
--- a/src/netlink_linearize.c
+++ b/src/netlink_linearize.c
@@ -116,7 +116,7 @@ static void netlink_gen_payload(struct netlink_linearize_ctx *ctx,
 			   expr->payload.base - 1);
 	nftnl_expr_set_u32(nle, NFTNL_EXPR_PAYLOAD_OFFSET,
 			   expr->payload.offset / BITS_PER_BYTE);
-	nftnl_expr_set_u32(nle, NFT_EXPR_PAYLOAD_LEN,
+	nftnl_expr_set_u32(nle, NFTNL_EXPR_PAYLOAD_LEN,
 			   div_round_up(expr->len, BITS_PER_BYTE));
 
 	nftnl_rule_add_expr(ctx->nlr, nle);
@@ -1054,14 +1054,14 @@ static void netlink_gen_flow_stmt(struct netlink_linearize_ctx *ctx,
 		op = NFT_DYNSET_OP_ADD;
 
 	nle = alloc_nft_expr("dynset");
-	netlink_put_register(nle, NFT_EXPR_DYNSET_SREG_KEY, sreg_key);
+	netlink_put_register(nle, NFTNL_EXPR_DYNSET_SREG_KEY, sreg_key);
 	if (stmt->flow.key->timeout)
-		nftnl_expr_set_u64(nle, NFT_EXPR_DYNSET_TIMEOUT,
+		nftnl_expr_set_u64(nle, NFTNL_EXPR_DYNSET_TIMEOUT,
 				   stmt->flow.key->timeout);
-	nftnl_expr_set_u32(nle, NFT_EXPR_DYNSET_OP, op);
-	nftnl_expr_set_str(nle, NFT_EXPR_DYNSET_SET_NAME, set->handle.set);
-	nftnl_expr_set_u32(nle, NFT_EXPR_DYNSET_SET_ID, set->handle.set_id);
-	nftnl_expr_set(nle, NFT_EXPR_DYNSET_EXPR,
+	nftnl_expr_set_u32(nle, NFTNL_EXPR_DYNSET_OP, op);
+	nftnl_expr_set_str(nle, NFTNL_EXPR_DYNSET_SET_NAME, set->handle.set);
+	nftnl_expr_set_u32(nle, NFTNL_EXPR_DYNSET_SET_ID, set->handle.set_id);
+	nftnl_expr_set(nle, NFTNL_EXPR_DYNSET_EXPR,
 		       netlink_gen_stmt_stateful(ctx, stmt->flow.stmt), 0);
 	nftnl_rule_add_expr(ctx->nlr, nle);
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux