summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-07-31 13:31:34 (GMT)
committerThomas Haller <thaller@redhat.com>2023-07-31 13:34:32 (GMT)
commit8b2074aa0489f8445bc144e666055901bb0f48a2 (patch)
treee8264f91fcec9c25732299cf99307926bd0a1591
parentfd470c069edc6edc26e3b0783137fb1c319ae100 (diff)
downloadlibnl-8b2074aa0489f8445bc144e666055901bb0f48a2.zip
libnl-8b2074aa0489f8445bc144e666055901bb0f48a2.tar.gz
libnl-8b2074aa0489f8445bc144e666055901bb0f48a2.tar.bz2
include: move "include/netlink-private/route/utils.h" to nl-intern-route
This header has a very specific purpose. To give access to the unit tests to some internals. It only is usable to parts that statically link with libnl-route-3 sources (e.g. "tests/check-direct") and libnl-route-3 itself. The point is that the symbol there is not exported by the libnl-route-3 shared library, so a test that dynamically links against libnl-route-3 couldn't access them. Hence the internal purpose of static linking the test with libnl-route-3 sources, and a special header for that. Move "include/netlink-private/route/utils.h" to a separate place, to make that usage clearer.
-rw-r--r--Makefile.am6
-rw-r--r--include/nl-intern-route/README.md7
-rw-r--r--include/nl-intern-route/nl-intern-route.h (renamed from include/netlink-private/route/utils.h)0
-rw-r--r--lib/route/link/inet6.c2
-rw-r--r--tests/check-direct.c2
5 files changed, 12 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index 6aad3d4..7eae255 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -278,7 +278,6 @@ noinst_HEADERS = \
include/netlink-private/route/link/sriov.h \
include/netlink-private/route/nexthop-encap.h \
include/netlink-private/route/tc-api.h \
- include/netlink-private/route/utils.h \
include/netlink-private/socket.h \
include/netlink-private/tc.h \
include/netlink-private/types.h \
@@ -380,6 +379,7 @@ lib_libnl_3_la_LDFLAGS = \
lib_LTLIBRARIES += lib/libnl-route-3.la
lib_libnl_route_3_la_SOURCES = \
+ include/nl-intern-route/nl-intern-route.h \
lib/fib_lookup/lookup.c \
lib/fib_lookup/request.c \
lib/route/act.c \
@@ -408,8 +408,8 @@ lib_libnl_route_3_la_SOURCES = \
lib/route/link.c \
lib/route/link/api.c \
lib/route/link/bonding.c \
- lib/route/link/bridge_info.c \
lib/route/link/bridge.c \
+ lib/route/link/bridge_info.c \
lib/route/link/can.c \
lib/route/link/dummy.c \
lib/route/link/geneve.c \
@@ -439,8 +439,8 @@ lib_libnl_route_3_la_SOURCES = \
lib/route/neightbl.c \
lib/route/netconf.c \
lib/route/nexthop.c \
- lib/route/nh.c \
lib/route/nexthop_encap.c \
+ lib/route/nh.c \
lib/route/nh_encap_mpls.c \
lib/route/pktloc.c \
lib/route/qdisc.c \
diff --git a/include/nl-intern-route/README.md b/include/nl-intern-route/README.md
new file mode 100644
index 0000000..c36f476
--- /dev/null
+++ b/include/nl-intern-route/README.md
@@ -0,0 +1,7 @@
+include/nl-intern-route
+=======================
+
+This contains headers that extend the libnl-route-3 API with internal helpers.
+It is only usable to components that statically link with the libnl-route-3
+source. That means libnl-route-3 sources itself (lib/libnl-route-3.la)
+and the unit tests.
diff --git a/include/netlink-private/route/utils.h b/include/nl-intern-route/nl-intern-route.h
index 65ff531..65ff531 100644
--- a/include/netlink-private/route/utils.h
+++ b/include/nl-intern-route/nl-intern-route.h
diff --git a/lib/route/link/inet6.c b/lib/route/link/inet6.c
index 52c6358..67a031c 100644
--- a/lib/route/link/inet6.c
+++ b/lib/route/link/inet6.c
@@ -10,8 +10,8 @@
#include <netlink/route/link/inet6.h>
#include <netlink-private/route/link/api.h>
-#include "netlink-private/route/utils.h"
#include "base/nl-base-utils.h"
+#include "nl-intern-route/nl-intern-route.h"
#define I6_ADDR_GEN_MODE_UNKNOWN UINT8_MAX
diff --git a/tests/check-direct.c b/tests/check-direct.c
index 547111b..c634484 100644
--- a/tests/check-direct.c
+++ b/tests/check-direct.c
@@ -4,9 +4,9 @@
#include "linux/snmp.h"
#include "base/nl-base-utils.h"
-#include "netlink-private/route/utils.h"
#include "netlink/route/link.h"
+#include "nl-intern-route/nl-intern-route.h"
START_TEST(static_checks)
{