Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@xxxxxxxxxxxxxxx> --- include/libnftables/rule.h | 2 ++ src/libnftables.map | 1 + src/rule.c | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/include/libnftables/rule.h b/include/libnftables/rule.h index a944c00..310262a 100644 --- a/include/libnftables/rule.h +++ b/include/libnftables/rule.h @@ -28,6 +28,8 @@ 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); uint64_t nft_rule_attr_get_u64(struct nft_rule *r, uint16_t attr); +uint8_t nft_rule_get_family(struct nft_rule *r); + void nft_rule_add_expr(struct nft_rule *r, struct nft_rule_expr *expr); void nft_rule_nlmsg_build_payload(struct nlmsghdr *nlh, struct nft_rule *t); diff --git a/src/libnftables.map b/src/libnftables.map index a62f200..3dad5fa 100644 --- a/src/libnftables.map +++ b/src/libnftables.map @@ -47,6 +47,7 @@ global: nft_rule_attr_get; nft_rule_attr_get_u64; nft_rule_attr_get_str; + nft_rule_get_family; nft_rule_snprintf; nft_rule_nlmsg_build_hdr; nft_rule_nlmsg_build_payload; diff --git a/src/rule.c b/src/rule.c index dd05412..0bbeeb2 100644 --- a/src/rule.c +++ b/src/rule.c @@ -140,6 +140,12 @@ uint64_t nft_rule_attr_get_u64(struct nft_rule *r, uint16_t attr) } EXPORT_SYMBOL(nft_rule_attr_get_u64); +uint8_t nft_rule_get_family(struct nft_rule *r) +{ + return r->family; +} +EXPORT_SYMBOL(nft_rule_get_family); + struct nlmsghdr * nft_rule_nlmsg_build_hdr(char *buf, uint16_t cmd, uint16_t family, uint16_t type, uint32_t seq) -- 1.8.0.2 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html