summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCorubba Smith <corubba@gmx.de>2025-03-27 00:06:18 +0100
committerFlorian Westphal <fw@strlen.de>2025-05-20 12:46:00 +0200
commitb039c9c9d2b8dcdd9accd1cba35a5119d48babf2 (patch)
tree83f8c2880c122cd77cb65d1ac1d3603f650c6b17 /include
parent1fe54ec39a071ea3b06e6883e542dfdcf40d2840 (diff)
ulogd: add linux namespace helper
The new namespace helper provides an internal stable interface for plugins to use for switching various linux namespaces. Currently only network namespaces are supported/implemented, but can easily be extended if needed. autoconf will enable it automatically if the required symbols are available. If ulogd is compiled without namespace support, the functions will simply return an error, there is no need for conditional compilation or special handling in plugin code. Signed-off-by: Corubba Smith <corubba@gmx.de> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include')
-rw-r--r--include/ulogd/Makefile.am4
-rw-r--r--include/ulogd/namespace.h8
2 files changed, 11 insertions, 1 deletions
diff --git a/include/ulogd/Makefile.am b/include/ulogd/Makefile.am
index e4b41c4..65d74ba 100644
--- a/include/ulogd/Makefile.am
+++ b/include/ulogd/Makefile.am
@@ -1 +1,3 @@
-noinst_HEADERS = conffile.h db.h ipfix_protocol.h linuxlist.h ulogd.h printpkt.h printflow.h common.h linux_rbtree.h timer.h slist.h hash.h jhash.h addr.h
+noinst_HEADERS = addr.h common.h conffile.h db.h hash.h ipfix_protocol.h \
+ jhash.h linux_rbtree.h linuxlist.h namespace.h printflow.h \
+ printpkt.h slist.h timer.h ulogd.h
diff --git a/include/ulogd/namespace.h b/include/ulogd/namespace.h
new file mode 100644
index 0000000..48e2e9a
--- /dev/null
+++ b/include/ulogd/namespace.h
@@ -0,0 +1,8 @@
+#ifndef _NAMESPACE_H_
+#define _NAMESPACE_H_
+
+int join_netns_fd(const int target_netns_fd, int *const source_netns_fd_ptr);
+int join_netns_path(const char *const target_netns_path,
+ int *const source_netns_fd_ptr);
+
+#endif