summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-11-27 21:11:44 +0100
committerThomas Haller <thaller@redhat.com>2023-11-29 16:03:41 +0100
commit01bd8fb01fb0fe4a0132fad6edbe2ab62a57ae8d (patch)
tree329e891ab0c041e513223b6a2f869042abe0361c
parent49c20efaa783449dca424cc50e4ee4b2fc5351cc (diff)
downloadlibnl-01bd8fb01fb0fe4a0132fad6edbe2ab62a57ae8d.tar.gz
include: add "nl-aux-xfrm" helpers
-rw-r--r--Makefile.am1
-rw-r--r--include/nl-aux-xfrm/README.md18
-rw-r--r--include/nl-aux-xfrm/nl-xfrm.h26
3 files changed, 45 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 0e5998ae..ff2ce329 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -315,6 +315,7 @@ noinst_HEADERS = \
include/linux-private/linux/xfrm.h \
include/nl-aux-core/nl-core.h \
include/nl-aux-route/nl-route.h \
+ include/nl-aux-xfrm/nl-xfrm.h \
include/nl-default.h \
include/nl-priv-dynamic-core/cache-api.h \
include/nl-priv-dynamic-core/nl-core.h \
diff --git a/include/nl-aux-xfrm/README.md b/include/nl-aux-xfrm/README.md
new file mode 100644
index 00000000..9a4b6e2f
--- /dev/null
+++ b/include/nl-aux-xfrm/README.md
@@ -0,0 +1,18 @@
+include/nl-aux-xfrm
+===================
+
+This contains private/internal helpers that depend on the public libnl-3 (core)
+and libnl-xfrm-3.
+
+Itself, it must only rely on C, include/base/ and public headers of libnl-3 (core)
+and libnl-xfrm-3.
+
+They can be used by all internal code that uses the public API of both libnl-3 (core)
+and libnl-xfrm-3.
+
+It can also be used by lib/xfrm itself (that is, the implementation of
+libnl-xfrm-3).
+
+It must not be used in public headers, it's internal only.
+
+Currently this is header-only, it does not require any additional linking.
diff --git a/include/nl-aux-xfrm/nl-xfrm.h b/include/nl-aux-xfrm/nl-xfrm.h
new file mode 100644
index 00000000..0f7e7a71
--- /dev/null
+++ b/include/nl-aux-xfrm/nl-xfrm.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: LGPL-2.1-only */
+
+#ifndef __NETLINK_NL_AUX_XFRM_NL_XFRM_H__
+#define __NETLINK_NL_AUX_XFRM_NL_XFRM_H__
+
+#include "base/nl-base-utils.h"
+
+struct xfrmnl_sp;
+void xfrmnl_sp_put(struct xfrmnl_sp *sp);
+#define _nl_auto_xfrmnl_sp _nl_auto(_nl_auto_xfrmnl_sp_fcn)
+_NL_AUTO_DEFINE_FCN_TYPED0(struct xfrmnl_sp *, _nl_auto_xfrmnl_sp_fcn,
+ xfrmnl_sp_put);
+
+struct xfrmnl_sa;
+void xfrmnl_sa_put(struct xfrmnl_sa *sa);
+#define _nl_auto_xfrmnl_sa _nl_auto(_nl_auto_xfrmnl_sa_fcn)
+_NL_AUTO_DEFINE_FCN_TYPED0(struct xfrmnl_sa *, _nl_auto_xfrmnl_sa_fcn,
+ xfrmnl_sa_put);
+
+struct xfrmnl_ae;
+void xfrmnl_ae_put(struct xfrmnl_ae *ae);
+#define _nl_auto_xfrmnl_ae _nl_auto(_nl_auto_xfrmnl_ae_fcn)
+_NL_AUTO_DEFINE_FCN_TYPED0(struct xfrmnl_ae *, _nl_auto_xfrmnl_ae_fcn,
+ xfrmnl_ae_put);
+
+#endif /* __NETLINK_NL_AUX_XFRM_NL_XFRM_H__ */