From 5119e2508a1568d86e1eb1b83264d5b1389ccd50 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 27 Nov 2023 21:11:44 +0100 Subject: [PATCH] include: add "nl-aux-xfrm" helpers --- Makefile.am | 1 + include/nl-aux-xfrm/README.md | 18 ++++++++++++++++++ include/nl-aux-xfrm/nl-xfrm.h | 26 ++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 include/nl-aux-xfrm/README.md create mode 100644 include/nl-aux-xfrm/nl-xfrm.h 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__ */