summaryrefslogtreecommitdiffstats
path: root/src/libnfnetlink.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-06-11 16:47:40 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2009-06-11 16:47:40 +0200
commit8bdef47e4cfa16f87ed503af066d00ff2d5a0366 (patch)
treef7651adad4d37fb1f389749602635c863afba5a9 /src/libnfnetlink.c
parentfa21ff22411bbbb226d3e18acf4a45cb38d8db0e (diff)
nfnl: add nfnl_addattr8() function
This patch adds the function nfnl_addattr8() as it has been requested by Jozsef Kadlecsik, he needs it for his Netlink-port of ipset. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/libnfnetlink.c')
-rw-r--r--src/libnfnetlink.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
index c1c4477..b048d2b 100644
--- a/src/libnfnetlink.c
+++ b/src/libnfnetlink.c
@@ -853,6 +853,23 @@ int nfnl_nfa_addattr_l(struct nfattr *nfa, int maxlen, int type,
}
/**
+ * nfnl_addattr8 - Add u_int8_t attribute to nlmsghdr
+ *
+ * @n: netlink message header to which attribute is to be added
+ * @maxlen: maximum length of netlink message header
+ * @type: type of new attribute
+ * @data: content of new attribute
+ */
+int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+{
+ assert(n);
+ assert(maxlen > 0);
+ assert(type >= 0);
+
+ return nfnl_addattr_l(n, maxlen, type, &data, sizeof(data));
+}
+
+/**
* nfnl_nfa_addattr16 - Add u_int16_t attribute to struct nfattr
*
* @nfa: struct nfattr