From 00ea30a840c0a7620b3a227198ded78b49d7e67e Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 14 Apr 2013 14:34:53 +0200 Subject: src: constify nft_*_attr_set and nft_*_attr_set_str Signed-off-by: Pablo Neira Ayuso --- include/libnftables/expr.h | 2 +- include/libnftables/rule.h | 4 ++-- include/libnftables/set.h | 6 +++--- include/libnftables/table.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include/libnftables') 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 { NFT_RULE_ATTR_COMPAT_FLAGS, }; -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 { NFT_TABLE_ATTR_FLAGS, }; -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); -- cgit v1.2.3