summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-05-21 21:23:47 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2009-05-21 21:23:47 +0200
commit2114ff20f8dbc2845e7d75f3c404337c061ebca5 (patch)
tree928ab927ad7d562d63c498d14353c7c9e8262777 /src
parent5186605c9361493ec43379a55a5422a2a25c802d (diff)
nfnl: add nfnl_portid() to get the Netlink portID of a socket
This patch adds the new interface nfnl_portid() to retrieve the Netlink portID that has been assigned to a given socket. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/libnfnetlink.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
index a836de1..c1c4477 100644
--- a/src/libnfnetlink.c
+++ b/src/libnfnetlink.c
@@ -131,6 +131,16 @@ int nfnl_fd(struct nfnl_handle *h)
return h->fd;
}
+/**
+ * nfnl_portid - returns the Netlink port ID of this socket
+ * @h: nfnetlink handler
+ */
+unsigned int nfnl_portid(const struct nfnl_handle *h)
+{
+ assert(h);
+ return h->local.nl_pid;
+}
+
static int recalc_rebind_subscriptions(struct nfnl_handle *nfnlh)
{
int i, err;