path: root/include
diff options
authorPablo Neira Ayuso <>2013-09-19 20:11:27 +0200
committerPablo Neira Ayuso <>2013-09-19 22:54:25 +0200
commit628203491deffcf01ee010152419ced8f549e57e (patch)
tree4df452f38817f1babcfa3b3b368f9d83db8a49b3 /include
parent8cabd12d31c1f02ab67bd6e2ecf32f005b2a6f87 (diff)
src: replace size_t by uint32_t in set/get interfaces
This patch breaks the ABI to shrink the size parameter from 8 to 4 bytes in x86_64. The maximum length of netlink attributes is 2 bytes, so 4 bytes as attribute payload length should be enough. After this patch, size_t is only used in the nft_*_snprintf interfaces. Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include')
2 files changed, 4 insertions, 4 deletions
diff --git a/include/libnftables/expr.h b/include/libnftables/expr.h
index 65ca1f0..b8f1d1e 100644
--- a/include/libnftables/expr.h
+++ b/include/libnftables/expr.h
@@ -19,14 +19,14 @@ struct nft_rule_expr *nft_rule_expr_alloc(const char *name);
void nft_rule_expr_free(struct nft_rule_expr *expr);
bool nft_rule_expr_is_set(const struct nft_rule_expr *expr, uint16_t type);
-void nft_rule_expr_set(struct nft_rule_expr *expr, uint16_t type, const void *data, size_t data_len);
+void nft_rule_expr_set(struct nft_rule_expr *expr, uint16_t type, const void *data, uint32_t data_len);
void nft_rule_expr_set_u8(struct nft_rule_expr *expr, uint16_t type, uint8_t data);
void nft_rule_expr_set_u16(struct nft_rule_expr *expr, uint16_t type, uint16_t data);
void nft_rule_expr_set_u32(struct nft_rule_expr *expr, uint16_t type, uint32_t data);
void nft_rule_expr_set_u64(struct nft_rule_expr *expr, uint16_t type, uint64_t data);
void nft_rule_expr_set_str(struct nft_rule_expr *expr, uint16_t type, const char *str);
-const void *nft_rule_expr_get(const struct nft_rule_expr *expr, uint16_t type, size_t *data_len);
+const void *nft_rule_expr_get(const struct nft_rule_expr *expr, uint16_t type, uint32_t *data_len);
uint8_t nft_rule_expr_get_u8(const struct nft_rule_expr *expr, uint16_t type);
uint16_t nft_rule_expr_get_u16(const struct nft_rule_expr *expr, uint16_t type);
uint32_t nft_rule_expr_get_u32(const struct nft_rule_expr *expr, uint16_t type);
diff --git a/include/libnftables/set.h b/include/libnftables/set.h
index 4c95cf9..e377826 100644
--- a/include/libnftables/set.h
+++ b/include/libnftables/set.h
@@ -88,11 +88,11 @@ void nft_set_elem_free(struct nft_set_elem *s);
void nft_set_elem_add(struct nft_set *s, struct nft_set_elem *elem);
void nft_set_elem_attr_unset(struct nft_set_elem *s, uint16_t attr);
-void nft_set_elem_attr_set(struct nft_set_elem *s, uint16_t attr, const void *data, size_t data_len);
+void nft_set_elem_attr_set(struct nft_set_elem *s, uint16_t attr, const void *data, uint32_t data_len);
void nft_set_elem_attr_set_u32(struct nft_set_elem *s, uint16_t attr, uint32_t val);
void nft_set_elem_attr_set_str(struct nft_set_elem *s, uint16_t attr, const char *str);
-const void *nft_set_elem_attr_get(struct nft_set_elem *s, uint16_t attr, size_t *data_len);
+const void *nft_set_elem_attr_get(struct nft_set_elem *s, uint16_t attr, uint32_t *data_len);
const char *nft_set_elem_attr_get_str(struct nft_set_elem *s, uint16_t attr);
uint32_t nft_set_elem_attr_get_u32(struct nft_set_elem *s, uint16_t attr);