summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/nft-chain-test.c3
-rw-r--r--tests/nft-expr_bitwise-test.c6
-rw-r--r--tests/nft-expr_byteorder-test.c2
-rw-r--r--tests/nft-expr_cmp-test.c2
-rw-r--r--tests/nft-expr_counter-test.c2
-rw-r--r--tests/nft-expr_ct-test.c2
-rw-r--r--tests/nft-expr_dup-test.c2
-rw-r--r--tests/nft-expr_exthdr-test.c2
-rw-r--r--tests/nft-expr_fwd-test.c2
-rw-r--r--tests/nft-expr_hash-test.c2
-rw-r--r--tests/nft-expr_immediate-test.c2
-rw-r--r--tests/nft-expr_limit-test.c2
-rw-r--r--tests/nft-expr_log-test.c2
-rw-r--r--tests/nft-expr_lookup-test.c2
-rw-r--r--tests/nft-expr_masq-test.c2
-rw-r--r--tests/nft-expr_match-test.c2
-rw-r--r--tests/nft-expr_meta-test.c2
-rw-r--r--tests/nft-expr_nat-test.c2
-rw-r--r--tests/nft-expr_numgen-test.c2
-rw-r--r--tests/nft-expr_objref-test.c2
-rw-r--r--tests/nft-expr_payload-test.c2
-rw-r--r--tests/nft-expr_queue-test.c2
-rw-r--r--tests/nft-expr_quota-test.c2
-rw-r--r--tests/nft-expr_range-test.c2
-rw-r--r--tests/nft-expr_redir-test.c2
-rw-r--r--tests/nft-expr_reject-test.c2
-rw-r--r--tests/nft-expr_target-test.c2
-rw-r--r--tests/nft-rule-test.c10
-rw-r--r--tests/nft-set-test.c2
-rw-r--r--tests/nft-table-test.c5
30 files changed, 41 insertions, 35 deletions
diff --git a/tests/nft-chain-test.c b/tests/nft-chain-test.c
index d678d46..35a65be 100644
--- a/tests/nft-chain-test.c
+++ b/tests/nft-chain-test.c
@@ -89,8 +89,7 @@ int main(int argc, char *argv[])
nftnl_chain_set_str(a, NFTNL_CHAIN_DEV, "eth0");
/* cmd extracted from include/linux/netfilter/nf_tables.h */
- nlh = nftnl_chain_nlmsg_build_hdr(buf, NFT_MSG_NEWCHAIN, AF_INET,
- 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWCHAIN, AF_INET, 0, 1234);
nftnl_chain_nlmsg_build_payload(nlh, a);
if (nftnl_chain_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_bitwise-test.c b/tests/nft-expr_bitwise-test.c
index f134728..44c4bf0 100644
--- a/tests/nft-expr_bitwise-test.c
+++ b/tests/nft-expr_bitwise-test.c
@@ -129,7 +129,7 @@ static void test_bool(void)
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
@@ -183,7 +183,7 @@ static void test_lshift(void)
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
@@ -237,7 +237,7 @@ static void test_rshift(void)
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_byteorder-test.c b/tests/nft-expr_byteorder-test.c
index 5994e5b..30e64c0 100644
--- a/tests/nft-expr_byteorder-test.c
+++ b/tests/nft-expr_byteorder-test.c
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_cmp-test.c b/tests/nft-expr_cmp-test.c
index ec00bb9..0bab67b 100644
--- a/tests/nft-expr_cmp-test.c
+++ b/tests/nft-expr_cmp-test.c
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_counter-test.c b/tests/nft-expr_counter-test.c
index 519bc1f..81c3fe1 100644
--- a/tests/nft-expr_counter-test.c
+++ b/tests/nft-expr_counter-test.c
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
nftnl_expr_set_u64(ex, NFTNL_EXPR_CTR_PACKETS, 0xf0123456789abcde);
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_ct-test.c b/tests/nft-expr_ct-test.c
index e98fbab..548a426 100644
--- a/tests/nft-expr_ct-test.c
+++ b/tests/nft-expr_ct-test.c
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_dup-test.c b/tests/nft-expr_dup-test.c
index 3c37d4a..0c5df9a 100644
--- a/tests/nft-expr_dup-test.c
+++ b/tests/nft-expr_dup-test.c
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_exthdr-test.c b/tests/nft-expr_exthdr-test.c
index fef2dd0..b2c72b7 100644
--- a/tests/nft-expr_exthdr-test.c
+++ b/tests/nft-expr_exthdr-test.c
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
print_err("parsing problems");
diff --git a/tests/nft-expr_fwd-test.c b/tests/nft-expr_fwd-test.c
index 4fdf53d..825dad3 100644
--- a/tests/nft-expr_fwd-test.c
+++ b/tests/nft-expr_fwd-test.c
@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_hash-test.c b/tests/nft-expr_hash-test.c
index 7be6e9e..6644bb7 100644
--- a/tests/nft-expr_hash-test.c
+++ b/tests/nft-expr_hash-test.c
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
print_err("parsing problems");
diff --git a/tests/nft-expr_immediate-test.c b/tests/nft-expr_immediate-test.c
index c25eedb..5027813 100644
--- a/tests/nft-expr_immediate-test.c
+++ b/tests/nft-expr_immediate-test.c
@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex_val);
nftnl_rule_add_expr(a, ex_ver);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_limit-test.c b/tests/nft-expr_limit-test.c
index 2838941..38aaf56 100644
--- a/tests/nft-expr_limit-test.c
+++ b/tests/nft-expr_limit-test.c
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_log-test.c b/tests/nft-expr_log-test.c
index b7aa302..275ffae 100644
--- a/tests/nft-expr_log-test.c
+++ b/tests/nft-expr_log-test.c
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
print_err("parsing problems");
diff --git a/tests/nft-expr_lookup-test.c b/tests/nft-expr_lookup-test.c
index 9e6e051..9b70525 100644
--- a/tests/nft-expr_lookup-test.c
+++ b/tests/nft-expr_lookup-test.c
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_masq-test.c b/tests/nft-expr_masq-test.c
index 3f9903d..0917914 100644
--- a/tests/nft-expr_masq-test.c
+++ b/tests/nft-expr_masq-test.c
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_match-test.c b/tests/nft-expr_match-test.c
index 39a49d8..fdeacc4 100644
--- a/tests/nft-expr_match-test.c
+++ b/tests/nft-expr_match-test.c
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
nftnl_expr_set(ex, NFTNL_EXPR_MT_INFO, strdup(data), sizeof(data));
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_meta-test.c b/tests/nft-expr_meta-test.c
index 8fb7873..2f03fb1 100644
--- a/tests/nft-expr_meta-test.c
+++ b/tests/nft-expr_meta-test.c
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
print_err("parsing problems");
diff --git a/tests/nft-expr_nat-test.c b/tests/nft-expr_nat-test.c
index fd3a488..3a365dd 100644
--- a/tests/nft-expr_nat-test.c
+++ b/tests/nft-expr_nat-test.c
@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_numgen-test.c b/tests/nft-expr_numgen-test.c
index 0d0a3bb..94df50f 100644
--- a/tests/nft-expr_numgen-test.c
+++ b/tests/nft-expr_numgen-test.c
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
print_err("parsing problems");
diff --git a/tests/nft-expr_objref-test.c b/tests/nft-expr_objref-test.c
index 08e27ce..9e698df 100644
--- a/tests/nft-expr_objref-test.c
+++ b/tests/nft-expr_objref-test.c
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
b = nftnl_rule_alloc();
if (a == NULL || b == NULL)
print_err("OOM");
- ex = nftnl_expr_alloc("lookup");
+ ex = nftnl_expr_alloc("objref");
if (ex == NULL)
print_err("OOM");
diff --git a/tests/nft-expr_payload-test.c b/tests/nft-expr_payload-test.c
index 371372c..aec1710 100644
--- a/tests/nft-expr_payload-test.c
+++ b/tests/nft-expr_payload-test.c
@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
print_err("parsing problems");
diff --git a/tests/nft-expr_queue-test.c b/tests/nft-expr_queue-test.c
index 81d7dd2..d007b98 100644
--- a/tests/nft-expr_queue-test.c
+++ b/tests/nft-expr_queue-test.c
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_quota-test.c b/tests/nft-expr_quota-test.c
index 2320551..a3eb2e3 100644
--- a/tests/nft-expr_quota-test.c
+++ b/tests/nft-expr_quota-test.c
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
nftnl_expr_set_u32(ex, NFTNL_EXPR_QUOTA_FLAGS, 0x12345678);
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_range-test.c b/tests/nft-expr_range-test.c
index b92dfc0..6ef896b 100644
--- a/tests/nft-expr_range-test.c
+++ b/tests/nft-expr_range-test.c
@@ -75,7 +75,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_redir-test.c b/tests/nft-expr_redir-test.c
index 6c8caec..8e1f30c 100644
--- a/tests/nft-expr_redir-test.c
+++ b/tests/nft-expr_redir-test.c
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_reject-test.c b/tests/nft-expr_reject-test.c
index d8189ea..049401d 100644
--- a/tests/nft-expr_reject-test.c
+++ b/tests/nft-expr_reject-test.c
@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-expr_target-test.c b/tests/nft-expr_target-test.c
index ba56b27..a517206 100644
--- a/tests/nft-expr_target-test.c
+++ b/tests/nft-expr_target-test.c
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
nftnl_expr_set(ex, NFTNL_EXPR_TG_INFO, strdup(data), sizeof(data));
nftnl_rule_add_expr(a, ex);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-rule-test.c b/tests/nft-rule-test.c
index dee3530..3a92223 100644
--- a/tests/nft-rule-test.c
+++ b/tests/nft-rule-test.c
@@ -48,6 +48,12 @@ static void cmp_nftnl_rule(struct nftnl_rule *a, struct nftnl_rule *b)
if (nftnl_rule_get_u32(a, NFTNL_RULE_COMPAT_FLAGS) !=
nftnl_rule_get_u32(b, NFTNL_RULE_COMPAT_FLAGS))
print_err("Rule compat_flags mismatches");
+ if (nftnl_rule_get_u32(a, NFTNL_RULE_ID) !=
+ nftnl_rule_get_u32(b, NFTNL_RULE_ID))
+ print_err("Rule id mismatches");
+ if (nftnl_rule_get_u32(a, NFTNL_RULE_POSITION_ID) !=
+ nftnl_rule_get_u32(b, NFTNL_RULE_POSITION_ID))
+ print_err("Rule position_id mismatches");
if (nftnl_rule_get_u64(a, NFTNL_RULE_POSITION) !=
nftnl_rule_get_u64(b, NFTNL_RULE_POSITION))
print_err("Rule compat_position mismatches");
@@ -84,13 +90,15 @@ int main(int argc, char *argv[])
nftnl_rule_set_u64(a, NFTNL_RULE_HANDLE, 0x1234567812345678);
nftnl_rule_set_u32(a, NFTNL_RULE_COMPAT_PROTO, 0x12345678);
nftnl_rule_set_u32(a, NFTNL_RULE_COMPAT_FLAGS, 0x12345678);
+ nftnl_rule_set_u32(a, NFTNL_RULE_ID, 0x12345678);
+ nftnl_rule_set_u32(a, NFTNL_RULE_POSITION_ID, 0x12345678);
nftnl_rule_set_u64(a, NFTNL_RULE_POSITION, 0x1234567812345678);
nftnl_rule_set_data(a, NFTNL_RULE_USERDATA,
nftnl_udata_buf_data(udata),
nftnl_udata_buf_len(udata));
nftnl_udata_buf_free(udata);
- nlh = nftnl_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234);
nftnl_rule_nlmsg_build_payload(nlh, a);
if (nftnl_rule_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-set-test.c b/tests/nft-set-test.c
index 173c17f..66916fe 100644
--- a/tests/nft-set-test.c
+++ b/tests/nft-set-test.c
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
nftnl_set_set_str(a, NFTNL_SET_USERDATA, "testing user data");
/* cmd extracted from include/linux/netfilter/nf_tables.h */
- nlh = nftnl_set_nlmsg_build_hdr(buf, NFT_MSG_NEWSET, AF_INET, 0, 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWSET, AF_INET, 0, 1234);
nftnl_set_nlmsg_build_payload(nlh, a);
if (nftnl_set_nlmsg_parse(nlh, b) < 0)
diff --git a/tests/nft-table-test.c b/tests/nft-table-test.c
index 1031ffe..53cf3d1 100644
--- a/tests/nft-table-test.c
+++ b/tests/nft-table-test.c
@@ -34,7 +34,7 @@ static void cmp_nftnl_table(struct nftnl_table *a, struct nftnl_table *b)
print_err("table flags mismatches");
if (nftnl_table_get_u32(a, NFTNL_TABLE_FAMILY) !=
nftnl_table_get_u32(b, NFTNL_TABLE_FAMILY))
- print_err("tabke family mismatches");
+ print_err("table family mismatches");
}
int main(int argc, char *argv[])
@@ -55,8 +55,7 @@ int main(int argc, char *argv[])
nftnl_table_set_u32(a, NFTNL_TABLE_FLAGS, 0);
/* cmd extracted from include/linux/netfilter/nf_tables.h */
- nlh = nftnl_table_nlmsg_build_hdr(buf, NFT_MSG_NEWTABLE, AF_INET, 0,
- 1234);
+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_NEWTABLE, AF_INET, 0, 1234);
nftnl_table_nlmsg_build_payload(nlh, a);
if (nftnl_table_nlmsg_parse(nlh, b) < 0)