all: move NM_AUTH_PERMISSION_* defines to "nm-common-macros.h" header

This commit is contained in:
Thomas Haller
2016-06-01 12:31:36 +02:00
parent ed551a4633
commit 8e54cfdb27
15 changed files with 36 additions and 63 deletions

View File

@@ -25,6 +25,7 @@
#include "polkit-agent.h" #include "polkit-agent.h"
#include "utils.h" #include "utils.h"
#include "general.h" #include "general.h"
#include "nm-common-macros.h"
#include "devices.h" #include "devices.h"
#include "connections.h" #include "connections.h"
@@ -387,20 +388,6 @@ show_nm_status (NmCli *nmc, const char *pretty_header_name, const char *print_fl
return TRUE; 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 * static const char *
permission_to_string (NMClientPermission perm) permission_to_string (NMClientPermission perm)
{ {

View File

@@ -27,6 +27,7 @@
#include <string.h> #include <string.h>
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-common-macros.h"
#include "nm-device-ethernet.h" #include "nm-device-ethernet.h"
#include "nm-device-wifi.h" #include "nm-device-wifi.h"
@@ -208,20 +209,6 @@ register_properties (NMClient *client)
property_info); 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 static NMClientPermission
nm_permission_to_client (const char *nm) nm_permission_to_client (const char *nm)
{ {

View File

@@ -26,6 +26,7 @@
#include <string.h> #include <string.h>
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-common-macros.h"
#include "nm-device-ethernet.h" #include "nm-device-ethernet.h"
#include "nm-device-wifi.h" #include "nm-device-wifi.h"
#include "nm-device-private.h" #include "nm-device-private.h"
@@ -202,20 +203,6 @@ init_dbus (NMObject *object)
G_CALLBACK (manager_recheck_permissions), 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 static NMClientPermission
nm_permission_to_client (const char *nm) nm_permission_to_client (const char *nm)
{ {

View File

@@ -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__ */ #endif /* __NM_COMMON_MACROS_H__ */

View File

@@ -23,6 +23,7 @@
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-common-macros.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-setting-connection.h" #include "nm-setting-connection.h"
#include "nm-setting-ip4-config.h" #include "nm-setting-ip4-config.h"

View File

@@ -36,6 +36,7 @@
#include <netlink/route/addr.h> #include <netlink/route/addr.h>
#include <linux/if_addr.h> #include <linux/if_addr.h>
#include "nm-common-macros.h"
#include "nm-device-private.h" #include "nm-device-private.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-manager.h" #include "nm-manager.h"

View File

@@ -28,6 +28,7 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include "nm-common-macros.h"
#include "nm-device.h" #include "nm-device.h"
#include "nm-device-private.h" #include "nm-device-private.h"
#include "nm-utils.h" #include "nm-utils.h"

View File

@@ -21,6 +21,8 @@
#include "nm-default.h" #include "nm-default.h"
#include "nm-active-connection.h" #include "nm-active-connection.h"
#include "nm-common-macros.h"
#include "nm-dbus-interface.h" #include "nm-dbus-interface.h"
#include "nm-device.h" #include "nm-device.h"
#include "nm-settings-connection.h" #include "nm-settings-connection.h"

View File

@@ -20,10 +20,11 @@
#include "nm-default.h" #include "nm-default.h"
#include "nm-auth-utils.h"
#include <string.h> #include <string.h>
#include "nm-setting-connection.h" #include "nm-setting-connection.h"
#include "nm-auth-utils.h"
#include "nm-auth-subject.h" #include "nm-auth-subject.h"
#include "nm-auth-manager.h" #include "nm-auth-manager.h"
#include "nm-session-monitor.h" #include "nm-session-monitor.h"

View File

@@ -21,23 +21,7 @@
#ifndef __NETWORKMANAGER_MANAGER_AUTH_H__ #ifndef __NETWORKMANAGER_MANAGER_AUTH_H__
#define __NETWORKMANAGER_MANAGER_AUTH_H__ #define __NETWORKMANAGER_MANAGER_AUTH_H__
#include <nm-connection.h> #include "nm-connection.h"
#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"
typedef struct NMAuthChain NMAuthChain; typedef struct NMAuthChain NMAuthChain;

View File

@@ -29,6 +29,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "nm-common-macros.h"
#include "nm-bus-manager.h" #include "nm-bus-manager.h"
#include "nm-vpn-manager.h" #include "nm-vpn-manager.h"
#include "nm-device.h" #include "nm-device.h"

View File

@@ -20,11 +20,13 @@
#include "nm-default.h" #include "nm-default.h"
#include "nm-agent-manager.h"
#include <string.h> #include <string.h>
#include <pwd.h> #include <pwd.h>
#include "nm-common-macros.h"
#include "nm-dbus-interface.h" #include "nm-dbus-interface.h"
#include "nm-agent-manager.h"
#include "nm-secret-agent.h" #include "nm-secret-agent.h"
#include "nm-auth-utils.h" #include "nm-auth-utils.h"
#include "nm-setting-vpn.h" #include "nm-setting-vpn.h"

View File

@@ -21,7 +21,7 @@
#ifndef __NETWORKMANAGER_AGENT_MANAGER_H__ #ifndef __NETWORKMANAGER_AGENT_MANAGER_H__
#define __NETWORKMANAGER_AGENT_MANAGER_H__ #define __NETWORKMANAGER_AGENT_MANAGER_H__
#include <nm-connection.h> #include "nm-connection.h"
#include "nm-exported-object.h" #include "nm-exported-object.h"
#include "nm-secret-agent.h" #include "nm-secret-agent.h"

View File

@@ -21,10 +21,12 @@
#include "nm-default.h" #include "nm-default.h"
#include "nm-settings-connection.h"
#include <string.h> #include <string.h>
#include "nm-common-macros.h"
#include "nm-dbus-interface.h" #include "nm-dbus-interface.h"
#include "nm-settings-connection.h"
#include "nm-session-monitor.h" #include "nm-session-monitor.h"
#include "nm-auth-utils.h" #include "nm-auth-utils.h"
#include "nm-auth-subject.h" #include "nm-auth-subject.h"

View File

@@ -38,6 +38,7 @@
#include <selinux/selinux.h> #include <selinux/selinux.h>
#endif #endif
#include "nm-common-macros.h"
#include "nm-dbus-interface.h" #include "nm-dbus-interface.h"
#include "nm-connection.h" #include "nm-connection.h"
#include "nm-setting-8021x.h" #include "nm-setting-8021x.h"