path: root/include/libnftables
diff options
authorPablo Neira Ayuso <>2013-04-14 14:34:53 +0200
committerPablo Neira Ayuso <>2013-04-14 15:30:56 +0200
commit00ea30a840c0a7620b3a227198ded78b49d7e67e (patch)
tree5017f332a0ca606bfb915715a11a149e28605385 /include/libnftables
parent5ff34f1434c6e7af8762de826c02f05ecd109783 (diff)
src: constify nft_*_attr_set and nft_*_attr_set_str
Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include/libnftables')
4 files changed, 7 insertions, 7 deletions
diff --git a/include/libnftables/expr.h b/include/libnftables/expr.h
index 6d5d4e3..2478998 100644
--- a/include/libnftables/expr.h
+++ b/include/libnftables/expr.h
@@ -19,7 +19,7 @@ void nft_rule_expr_set(struct nft_rule_expr *expr, uint16_t type, const void *da
void nft_rule_expr_set_u8(struct nft_rule_expr *expr, uint16_t type, uint8_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, char *str);
+void nft_rule_expr_set_str(struct nft_rule_expr *expr, uint16_t type, const char *str);
const void *nft_rule_expr_get(struct nft_rule_expr *expr, uint16_t type, size_t *data_len);
uint8_t nft_rule_expr_get_u8(struct nft_rule_expr *expr, uint16_t type);
diff --git a/include/libnftables/rule.h b/include/libnftables/rule.h
index 50222c5..50944cd 100644
--- a/include/libnftables/rule.h
+++ b/include/libnftables/rule.h
@@ -23,10 +23,10 @@ enum {
-void nft_rule_attr_set(struct nft_rule *r, uint16_t attr, void *data);
+void nft_rule_attr_set(struct nft_rule *r, uint16_t attr, const void *data);
void nft_rule_attr_set_u32(struct nft_rule *r, uint16_t attr, uint32_t val);
void nft_rule_attr_set_u64(struct nft_rule *r, uint16_t attr, uint64_t val);
-void nft_rule_attr_set_str(struct nft_rule *r, uint16_t attr, char *str);
+void nft_rule_attr_set_str(struct nft_rule *r, uint16_t attr, const char *str);
void *nft_rule_attr_get(struct nft_rule *r, uint16_t attr);
const char *nft_rule_attr_get_str(struct nft_rule *r, uint16_t attr);
diff --git a/include/libnftables/set.h b/include/libnftables/set.h
index 53c067b..53c2947 100644
--- a/include/libnftables/set.h
+++ b/include/libnftables/set.h
@@ -16,9 +16,9 @@ struct nft_set;
struct nft_set *nft_set_alloc(void);
void nft_set_free(struct nft_set *s);
-void nft_set_attr_set(struct nft_set *s, uint16_t attr, void *data);
+void nft_set_attr_set(struct nft_set *s, uint16_t attr, const void *data);
void nft_set_attr_set_u32(struct nft_set *s, uint16_t attr, uint32_t val);
-void nft_set_attr_set_str(struct nft_set *s, uint16_t attr, char *str);
+void nft_set_attr_set_str(struct nft_set *s, uint16_t attr, const char *str);
void *nft_set_attr_get(struct nft_set *s, uint16_t attr);
const char *nft_set_attr_get_str(struct nft_set *s, uint16_t attr);
@@ -63,7 +63,7 @@ void nft_set_elem_add(struct nft_set *s, struct nft_set_elem *elem);
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_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, char *str);
+void nft_set_elem_attr_set_str(struct nft_set_elem *s, uint16_t attr, const char *str);
void *nft_set_elem_attr_get(struct nft_set_elem *s, uint16_t attr, size_t *data_len);
const char *nft_set_elem_attr_get_str(struct nft_set_elem *s, uint16_t attr);
diff --git a/include/libnftables/table.h b/include/libnftables/table.h
index f367bb8..c50650f 100644
--- a/include/libnftables/table.h
+++ b/include/libnftables/table.h
@@ -18,7 +18,7 @@ enum {
-void nft_table_attr_set(struct nft_table *t, uint16_t attr, void *data);
+void nft_table_attr_set(struct nft_table *t, uint16_t attr, const void *data);
const void *nft_table_attr_get(struct nft_table *t, uint16_t attr);
void nft_table_attr_set_u32(struct nft_table *t, uint16_t attr, uint32_t data);