Skip to content

Commit

Permalink
include: add "nl-aux-xfrm" helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
thom311 committed Nov 28, 2023
1 parent 5180c83 commit 5119e25
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
18 changes: 18 additions & 0 deletions include/nl-aux-xfrm/README.md
Original file line number Diff line number Diff line change
@@ -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.
26 changes: 26 additions & 0 deletions include/nl-aux-xfrm/nl-xfrm.h
Original file line number Diff line number Diff line change
@@ -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__ */

0 comments on commit 5119e25

Please sign in to comment.