From: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
To: netfilter-devel@vger.kernel.org
Cc: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Subject: [libnftables PATCH] rule: Add a function to get rule's family
Date: Thu, 10 Jan 2013 16:29:05 +0200 [thread overview]
Message-ID: <1357828145-18588-1-git-send-email-tomasz.bursztyka@linux.intel.com> (raw)
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
---
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
next reply other threads:[~2013-01-10 14:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-10 14:29 Tomasz Bursztyka [this message]
2013-01-13 19:08 ` [libnftables PATCH] rule: Add a function to get rule's family Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1357828145-18588-1-git-send-email-tomasz.bursztyka@linux.intel.com \
--to=tomasz.bursztyka@linux.intel.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).