path: root/include/libnftnl
diff options
authorPablo Neira Ayuso <>2015-09-07 17:56:47 +0200
committerPablo Neira Ayuso <>2015-09-07 20:00:57 +0200
commit206d98a54305a1178c7d9c5e234699813f8c6f5a (patch)
treecf4a1335eb6724cfbdb3a8caa5346a78758d9506 /include/libnftnl
parent96807c4c05e1e76b8bbf00d874a28a279e7d2840 (diff)
src: rename nftnl_rule_expr to nftnl_expr
Use a shorter name for this, morever this can be used from sets so the _rule_ is misleading. Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include/libnftnl')
2 files changed, 27 insertions, 27 deletions
diff --git a/include/libnftnl/expr.h b/include/libnftnl/expr.h
index c0c8259..0600860 100644
--- a/include/libnftnl/expr.h
+++ b/include/libnftnl/expr.h
@@ -9,34 +9,34 @@
extern "C" {
-struct nftnl_rule_expr;
+struct nftnl_expr;
enum {
-struct nftnl_rule_expr *nftnl_rule_expr_alloc(const char *name);
-void nftnl_rule_expr_free(struct nftnl_rule_expr *expr);
+struct nftnl_expr *nftnl_expr_alloc(const char *name);
+void nftnl_expr_free(struct nftnl_expr *expr);
-bool nftnl_rule_expr_is_set(const struct nftnl_rule_expr *expr, uint16_t type);
-void nftnl_rule_expr_set(struct nftnl_rule_expr *expr, uint16_t type, const void *data, uint32_t data_len);
-#define nftnl_rule_expr_set_data nftnl_rule_expr_set
-void nftnl_rule_expr_set_u8(struct nftnl_rule_expr *expr, uint16_t type, uint8_t data);
-void nftnl_rule_expr_set_u16(struct nftnl_rule_expr *expr, uint16_t type, uint16_t data);
-void nftnl_rule_expr_set_u32(struct nftnl_rule_expr *expr, uint16_t type, uint32_t data);
-void nftnl_rule_expr_set_u64(struct nftnl_rule_expr *expr, uint16_t type, uint64_t data);
-void nftnl_rule_expr_set_str(struct nftnl_rule_expr *expr, uint16_t type, const char *str);
+bool nftnl_expr_is_set(const struct nftnl_expr *expr, uint16_t type);
+void nftnl_expr_set(struct nftnl_expr *expr, uint16_t type, const void *data, uint32_t data_len);
+#define nftnl_expr_set_data nftnl_expr_set
+void nftnl_expr_set_u8(struct nftnl_expr *expr, uint16_t type, uint8_t data);
+void nftnl_expr_set_u16(struct nftnl_expr *expr, uint16_t type, uint16_t data);
+void nftnl_expr_set_u32(struct nftnl_expr *expr, uint16_t type, uint32_t data);
+void nftnl_expr_set_u64(struct nftnl_expr *expr, uint16_t type, uint64_t data);
+void nftnl_expr_set_str(struct nftnl_expr *expr, uint16_t type, const char *str);
-const void *nftnl_rule_expr_get(const struct nftnl_rule_expr *expr, uint16_t type, uint32_t *data_len);
-#define nftnl_rule_expr_get_data nftnl_rule_expr_get
-uint8_t nftnl_rule_expr_get_u8(const struct nftnl_rule_expr *expr, uint16_t type);
-uint16_t nftnl_rule_expr_get_u16(const struct nftnl_rule_expr *expr, uint16_t type);
-uint32_t nftnl_rule_expr_get_u32(const struct nftnl_rule_expr *expr, uint16_t type);
-uint64_t nftnl_rule_expr_get_u64(const struct nftnl_rule_expr *expr, uint16_t type);
-const char *nftnl_rule_expr_get_str(const struct nftnl_rule_expr *expr, uint16_t type);
+const void *nftnl_expr_get(const struct nftnl_expr *expr, uint16_t type, uint32_t *data_len);
+#define nftnl_expr_get_data nftnl_expr_get
+uint8_t nftnl_expr_get_u8(const struct nftnl_expr *expr, uint16_t type);
+uint16_t nftnl_expr_get_u16(const struct nftnl_expr *expr, uint16_t type);
+uint32_t nftnl_expr_get_u32(const struct nftnl_expr *expr, uint16_t type);
+uint64_t nftnl_expr_get_u64(const struct nftnl_expr *expr, uint16_t type);
+const char *nftnl_expr_get_str(const struct nftnl_expr *expr, uint16_t type);
-int nftnl_rule_expr_snprintf(char *buf, size_t buflen, struct nftnl_rule_expr *expr, uint32_t type, uint32_t flags);
+int nftnl_expr_snprintf(char *buf, size_t buflen, struct nftnl_expr *expr, uint32_t type, uint32_t flags);
enum {
diff --git a/include/libnftnl/rule.h b/include/libnftnl/rule.h
index c1bfcb6..f5f8555 100644
--- a/include/libnftnl/rule.h
+++ b/include/libnftnl/rule.h
@@ -13,7 +13,7 @@ extern "C" {
struct nftnl_rule;
-struct nftnl_rule_expr;
+struct nftnl_expr;
struct nftnl_rule *nftnl_rule_alloc(void);
void nftnl_rule_free(struct nftnl_rule *);
@@ -48,7 +48,7 @@ uint8_t nftnl_rule_attr_get_u8(const struct nftnl_rule *r, uint16_t attr);
uint32_t nftnl_rule_attr_get_u32(const struct nftnl_rule *r, uint16_t attr);
uint64_t nftnl_rule_attr_get_u64(const struct nftnl_rule *r, uint16_t attr);
-void nftnl_rule_add_expr(struct nftnl_rule *r, struct nftnl_rule_expr *expr);
+void nftnl_rule_add_expr(struct nftnl_rule *r, struct nftnl_expr *expr);
struct nlmsghdr;
@@ -64,15 +64,15 @@ int nftnl_rule_fprintf(FILE *fp, struct nftnl_rule *r, uint32_t type, uint32_t f
#define nftnl_rule_nlmsg_build_hdr nftnl_nlmsg_build_hdr
int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *t);
-int nftnl_rule_expr_foreach(struct nftnl_rule *r,
- int (*cb)(struct nftnl_rule_expr *e, void *data),
+int nftnl_expr_foreach(struct nftnl_rule *r,
+ int (*cb)(struct nftnl_expr *e, void *data),
void *data);
-struct nftnl_rule_expr_iter;
+struct nftnl_expr_iter;
-struct nftnl_rule_expr_iter *nftnl_rule_expr_iter_create(struct nftnl_rule *r);
-struct nftnl_rule_expr *nftnl_rule_expr_iter_next(struct nftnl_rule_expr_iter *iter);
-void nftnl_rule_expr_iter_destroy(struct nftnl_rule_expr_iter *iter);
+struct nftnl_expr_iter *nftnl_expr_iter_create(struct nftnl_rule *r);
+struct nftnl_expr *nftnl_expr_iter_next(struct nftnl_expr_iter *iter);
+void nftnl_expr_iter_destroy(struct nftnl_expr_iter *iter);
struct nftnl_rule_list;