shared: split and move "nm-vpn-plugin-macros.h"

This file was intended to be used by VPN plugins (by copying it).
However, it was also used internally.

Split the file, and move the internally used part to libnm-glib-aux.
The part that is only there for out of tree users, moves to
"nm-compat.h".
This commit is contained in:
Thomas Haller 2021-02-24 08:11:13 +01:00
parent ad91579bb8
commit 63622a147a
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
4 changed files with 25 additions and 21 deletions

View file

@ -426,6 +426,7 @@ src_libnm_glib_aux_libnm_glib_aux_la_SOURCES = \
src/libnm-glib-aux/nm-logging-base.c \
src/libnm-glib-aux/nm-logging-base.h \
src/libnm-glib-aux/nm-logging-fwd.h \
src/libnm-glib-aux/nm-logging-syslog.h \
src/libnm-glib-aux/nm-macros-internal.h \
src/libnm-glib-aux/nm-obj.h \
src/libnm-glib-aux/nm-random-utils.c \
@ -5522,7 +5523,6 @@ EXTRA_DIST += \
\
shared/nm-utils/nm-compat.c \
shared/nm-utils/nm-compat.h \
shared/nm-utils/nm-vpn-plugin-macros.h \
shared/meson.build \
\
src/meson.build \

View file

@ -8,6 +8,8 @@
#include "nm-setting-vpn.h"
/*****************************************************************************/
const char **_nm_setting_vpn_get_data_keys(NMSettingVpn *setting, guint *out_length);
const char **_nm_setting_vpn_get_secret_keys(NMSettingVpn *setting, guint *out_length);
@ -32,4 +34,22 @@ const char **_nm_setting_vpn_get_secret_keys(NMSettingVpn *setting, guint *out_l
_nm_setting_vpn_get_secret_keys(setting, out_length)
#endif
/*****************************************************************************/
/* possibly missing defines from newer libnm API. */
#ifndef NM_VPN_PLUGIN_CONFIG_PROXY_PAC
#define NM_VPN_PLUGIN_CONFIG_PROXY_PAC "pac"
#endif
#ifndef NM_VPN_PLUGIN_IP4_CONFIG_PRESERVE_ROUTES
#define NM_VPN_PLUGIN_IP4_CONFIG_PRESERVE_ROUTES "preserve-routes"
#endif
#ifndef NM_VPN_PLUGIN_IP6_CONFIG_PRESERVE_ROUTES
#define NM_VPN_PLUGIN_IP6_CONFIG_PRESERVE_ROUTES "preserve-routes"
#endif
/*****************************************************************************/
#endif /* __NM_COMPAT_H__ */

View file

@ -9,7 +9,7 @@
#include <stdlib.h>
#include <signal.h>
#include "nm-utils/nm-vpn-plugin-macros.h"
#include "libnm-glib-aux/nm-logging-syslog.h"
#include "nm-dhcp-helper-api.h"

View file

@ -3,8 +3,8 @@
* Copyright (C) 2016 Red Hat, Inc.
*/
#ifndef __NM_VPN_PLUGIN_MACROS_H__
#define __NM_VPN_PLUGIN_MACROS_H__
#ifndef __NM_LOGGING_SYSLOG_H__
#define __NM_LOGGING_SYSLOG_H__
#include <syslog.h>
@ -57,20 +57,4 @@ nm_utils_syslog_to_str(int syslog_level)
/*****************************************************************************/
/* possibly missing defines from newer libnm API. */
#ifndef NM_VPN_PLUGIN_CONFIG_PROXY_PAC
#define NM_VPN_PLUGIN_CONFIG_PROXY_PAC "pac"
#endif
#ifndef NM_VPN_PLUGIN_IP4_CONFIG_PRESERVE_ROUTES
#define NM_VPN_PLUGIN_IP4_CONFIG_PRESERVE_ROUTES "preserve-routes"
#endif
#ifndef NM_VPN_PLUGIN_IP6_CONFIG_PRESERVE_ROUTES
#define NM_VPN_PLUGIN_IP6_CONFIG_PRESERVE_ROUTES "preserve-routes"
#endif
/*****************************************************************************/
#endif /* __NM_VPN_PLUGIN_MACROS_H__ */
#endif /* __NM_LOGGING_SYSLOG_H__ */