diff options
author | Patrick McHardy <kaber@trash.net> | 2015-04-12 20:17:52 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2015-04-14 07:56:51 +0100 |
commit | 5ea54b224a11358b6ae90b519979e09a655292e7 (patch) | |
tree | 69f2668544067e9bb91c78aed54df60abdeea2ba /include | |
parent | 242978b5c98c98c125c73ae76abd76e0e672d769 (diff) |
expr: seperate expression parsing and building functions
The expression build function currently assumes to be only used from
rule context and actually builds rule attributes. Fix that and only
build the expression. Also it seems to have been exported by accident,
undo that.
Additionally, move the expression parsing function from rule parsing
and also remove any assumptions about being used in rule context.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/expr.h | 6 | ||||
-rw-r--r-- | include/libnftnl/expr.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/include/expr.h b/include/expr.h index ed41105..a4333c6 100644 --- a/include/expr.h +++ b/include/expr.h @@ -10,4 +10,10 @@ struct nft_rule_expr { uint8_t data[]; }; +struct nlmsghdr; + +void nft_rule_expr_build_payload(struct nlmsghdr *nlh, struct nft_rule_expr *expr); +struct nft_rule_expr *nft_rule_expr_parse(struct nlattr *attr); + + #endif diff --git a/include/libnftnl/expr.h b/include/libnftnl/expr.h index 7bc0273..14daa83 100644 --- a/include/libnftnl/expr.h +++ b/include/libnftnl/expr.h @@ -36,10 +36,6 @@ uint32_t nft_rule_expr_get_u32(const struct nft_rule_expr *expr, uint16_t type); uint64_t nft_rule_expr_get_u64(const struct nft_rule_expr *expr, uint16_t type); const char *nft_rule_expr_get_str(const struct nft_rule_expr *expr, uint16_t type); -struct nlmsghdr; - -void nft_rule_expr_build_payload(struct nlmsghdr *nlh, struct nft_rule_expr *expr); - int nft_rule_expr_snprintf(char *buf, size_t buflen, struct nft_rule_expr *expr, uint32_t type, uint32_t flags); enum { |