diff --git a/clients/cli/general.c b/clients/cli/general.c index f39351dba..280630c19 100644 --- a/clients/cli/general.c +++ b/clients/cli/general.c @@ -25,6 +25,7 @@ #include "polkit-agent.h" #include "utils.h" #include "general.h" +#include "nm-common-macros.h" #include "devices.h" #include "connections.h" @@ -387,20 +388,6 @@ show_nm_status (NmCli *nmc, const char *pretty_header_name, const char *print_fl return TRUE; } -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIMAX "org.freedesktop.NetworkManager.enable-disable-wimax" -#define NM_AUTH_PERMISSION_SLEEP_WAKE "org.freedesktop.NetworkManager.sleep-wake" -#define NM_AUTH_PERMISSION_NETWORK_CONTROL "org.freedesktop.NetworkManager.network-control" -#define NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED "org.freedesktop.NetworkManager.wifi.share.protected" -#define NM_AUTH_PERMISSION_WIFI_SHARE_OPEN "org.freedesktop.NetworkManager.wifi.share.open" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_SYSTEM "org.freedesktop.NetworkManager.settings.modify.system" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN "org.freedesktop.NetworkManager.settings.modify.own" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME "org.freedesktop.NetworkManager.settings.modify.hostname" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS "org.freedesktop.NetworkManager.settings.modify.global-dns" -#define NM_AUTH_PERMISSION_RELOAD "org.freedesktop.NetworkManager.reload" - static const char * permission_to_string (NMClientPermission perm) { diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index a956a3bc9..bf3191f5b 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -27,6 +27,7 @@ #include #include "nm-utils.h" +#include "nm-common-macros.h" #include "nm-device-ethernet.h" #include "nm-device-wifi.h" @@ -208,20 +209,6 @@ register_properties (NMClient *client) property_info); } -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIMAX "org.freedesktop.NetworkManager.enable-disable-wimax" -#define NM_AUTH_PERMISSION_SLEEP_WAKE "org.freedesktop.NetworkManager.sleep-wake" -#define NM_AUTH_PERMISSION_NETWORK_CONTROL "org.freedesktop.NetworkManager.network-control" -#define NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED "org.freedesktop.NetworkManager.wifi.share.protected" -#define NM_AUTH_PERMISSION_WIFI_SHARE_OPEN "org.freedesktop.NetworkManager.wifi.share.open" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_SYSTEM "org.freedesktop.NetworkManager.settings.modify.system" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN "org.freedesktop.NetworkManager.settings.modify.own" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME "org.freedesktop.NetworkManager.settings.modify.hostname" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS "org.freedesktop.NetworkManager.settings.modify.global-dns" -#define NM_AUTH_PERMISSION_RELOAD "org.freedesktop.NetworkManager.reload" - static NMClientPermission nm_permission_to_client (const char *nm) { diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c index 6d1270f03..27bd4ca67 100644 --- a/libnm/nm-manager.c +++ b/libnm/nm-manager.c @@ -26,6 +26,7 @@ #include #include "nm-utils.h" +#include "nm-common-macros.h" #include "nm-device-ethernet.h" #include "nm-device-wifi.h" #include "nm-device-private.h" @@ -202,20 +203,6 @@ init_dbus (NMObject *object) G_CALLBACK (manager_recheck_permissions), object); } -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIMAX "org.freedesktop.NetworkManager.enable-disable-wimax" -#define NM_AUTH_PERMISSION_SLEEP_WAKE "org.freedesktop.NetworkManager.sleep-wake" -#define NM_AUTH_PERMISSION_NETWORK_CONTROL "org.freedesktop.NetworkManager.network-control" -#define NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED "org.freedesktop.NetworkManager.wifi.share.protected" -#define NM_AUTH_PERMISSION_WIFI_SHARE_OPEN "org.freedesktop.NetworkManager.wifi.share.open" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_SYSTEM "org.freedesktop.NetworkManager.settings.modify.system" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN "org.freedesktop.NetworkManager.settings.modify.own" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME "org.freedesktop.NetworkManager.settings.modify.hostname" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS "org.freedesktop.NetworkManager.settings.modify.global-dns" -#define NM_AUTH_PERMISSION_RELOAD "org.freedesktop.NetworkManager.reload" - static NMClientPermission nm_permission_to_client (const char *nm) { diff --git a/shared/nm-common-macros.h b/shared/nm-common-macros.h index d7050aab7..922117c3f 100644 --- a/shared/nm-common-macros.h +++ b/shared/nm-common-macros.h @@ -24,4 +24,20 @@ /******************************************************************************/ +#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network" +#define NM_AUTH_PERMISSION_SLEEP_WAKE "org.freedesktop.NetworkManager.sleep-wake" +#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi" +#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan" +#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIMAX "org.freedesktop.NetworkManager.enable-disable-wimax" +#define NM_AUTH_PERMISSION_NETWORK_CONTROL "org.freedesktop.NetworkManager.network-control" +#define NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED "org.freedesktop.NetworkManager.wifi.share.protected" +#define NM_AUTH_PERMISSION_WIFI_SHARE_OPEN "org.freedesktop.NetworkManager.wifi.share.open" +#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_SYSTEM "org.freedesktop.NetworkManager.settings.modify.system" +#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN "org.freedesktop.NetworkManager.settings.modify.own" +#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME "org.freedesktop.NetworkManager.settings.modify.hostname" +#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS "org.freedesktop.NetworkManager.settings.modify.global-dns" +#define NM_AUTH_PERMISSION_RELOAD "org.freedesktop.NetworkManager.reload" + +/******************************************************************************/ + #endif /* __NM_COMMON_MACROS_H__ */ diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 09ed25c56..9894872b8 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -23,6 +23,7 @@ #include "NetworkManagerUtils.h" +#include "nm-common-macros.h" #include "nm-utils.h" #include "nm-setting-connection.h" #include "nm-setting-ip4-config.h" diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 88cebe488..c066b3114 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -36,6 +36,7 @@ #include #include +#include "nm-common-macros.h" #include "nm-device-private.h" #include "NetworkManagerUtils.h" #include "nm-manager.h" diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index 9e511a098..a88d6ebdb 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -28,6 +28,7 @@ #include #include +#include "nm-common-macros.h" #include "nm-device.h" #include "nm-device-private.h" #include "nm-utils.h" diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c index 7f84fe4d6..2b7847b2d 100644 --- a/src/nm-active-connection.c +++ b/src/nm-active-connection.c @@ -21,6 +21,8 @@ #include "nm-default.h" #include "nm-active-connection.h" + +#include "nm-common-macros.h" #include "nm-dbus-interface.h" #include "nm-device.h" #include "nm-settings-connection.h" diff --git a/src/nm-auth-utils.c b/src/nm-auth-utils.c index 928e88b0c..e1761cab7 100644 --- a/src/nm-auth-utils.c +++ b/src/nm-auth-utils.c @@ -20,10 +20,11 @@ #include "nm-default.h" +#include "nm-auth-utils.h" + #include #include "nm-setting-connection.h" -#include "nm-auth-utils.h" #include "nm-auth-subject.h" #include "nm-auth-manager.h" #include "nm-session-monitor.h" diff --git a/src/nm-auth-utils.h b/src/nm-auth-utils.h index c88eeaec1..89ed79ccb 100644 --- a/src/nm-auth-utils.h +++ b/src/nm-auth-utils.h @@ -21,23 +21,7 @@ #ifndef __NETWORKMANAGER_MANAGER_AUTH_H__ #define __NETWORKMANAGER_MANAGER_AUTH_H__ -#include -#include "nm-default.h" - -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network" -#define NM_AUTH_PERMISSION_SLEEP_WAKE "org.freedesktop.NetworkManager.sleep-wake" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan" -#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIMAX "org.freedesktop.NetworkManager.enable-disable-wimax" -#define NM_AUTH_PERMISSION_NETWORK_CONTROL "org.freedesktop.NetworkManager.network-control" -#define NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED "org.freedesktop.NetworkManager.wifi.share.protected" -#define NM_AUTH_PERMISSION_WIFI_SHARE_OPEN "org.freedesktop.NetworkManager.wifi.share.open" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_SYSTEM "org.freedesktop.NetworkManager.settings.modify.system" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN "org.freedesktop.NetworkManager.settings.modify.own" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME "org.freedesktop.NetworkManager.settings.modify.hostname" -#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS "org.freedesktop.NetworkManager.settings.modify.global-dns" -#define NM_AUTH_PERMISSION_RELOAD "org.freedesktop.NetworkManager.reload" - +#include "nm-connection.h" typedef struct NMAuthChain NMAuthChain; diff --git a/src/nm-manager.c b/src/nm-manager.c index c49a026e1..e8fe5b8a8 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -29,6 +29,7 @@ #include #include +#include "nm-common-macros.h" #include "nm-bus-manager.h" #include "nm-vpn-manager.h" #include "nm-device.h" diff --git a/src/settings/nm-agent-manager.c b/src/settings/nm-agent-manager.c index 48a7da7b0..54ca2f55c 100644 --- a/src/settings/nm-agent-manager.c +++ b/src/settings/nm-agent-manager.c @@ -20,11 +20,13 @@ #include "nm-default.h" +#include "nm-agent-manager.h" + #include #include +#include "nm-common-macros.h" #include "nm-dbus-interface.h" -#include "nm-agent-manager.h" #include "nm-secret-agent.h" #include "nm-auth-utils.h" #include "nm-setting-vpn.h" diff --git a/src/settings/nm-agent-manager.h b/src/settings/nm-agent-manager.h index 2f5055372..8240a2b51 100644 --- a/src/settings/nm-agent-manager.h +++ b/src/settings/nm-agent-manager.h @@ -21,7 +21,7 @@ #ifndef __NETWORKMANAGER_AGENT_MANAGER_H__ #define __NETWORKMANAGER_AGENT_MANAGER_H__ -#include +#include "nm-connection.h" #include "nm-exported-object.h" #include "nm-secret-agent.h" diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index ebcf17f88..f22807d34 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -21,10 +21,12 @@ #include "nm-default.h" +#include "nm-settings-connection.h" + #include +#include "nm-common-macros.h" #include "nm-dbus-interface.h" -#include "nm-settings-connection.h" #include "nm-session-monitor.h" #include "nm-auth-utils.h" #include "nm-auth-subject.h" diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index fab5383c7..a11696fd6 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -38,6 +38,7 @@ #include #endif +#include "nm-common-macros.h" #include "nm-dbus-interface.h" #include "nm-connection.h" #include "nm-setting-8021x.h"