diff options
Diffstat (limited to 'libnm-core/nm-vpn-dbus-interface.h')
| -rw-r--r-- | libnm-core/nm-vpn-dbus-interface.h | 144 |
1 files changed, 77 insertions, 67 deletions
diff --git a/libnm-core/nm-vpn-dbus-interface.h b/libnm-core/nm-vpn-dbus-interface.h index 8d2aaabc..fc72c4fa 100644 --- a/libnm-core/nm-vpn-dbus-interface.h +++ b/libnm-core/nm-vpn-dbus-interface.h @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright (C) 2004 Red Hat, Inc. */ @@ -15,27 +15,29 @@ #include "nm-dbus-interface.h" #ifndef NM_VERSION_H -#define NM_DEPRECATED_IN_1_8_FOR(n) + #define NM_DEPRECATED_IN_1_8_FOR(n) #endif /* * dbus services details */ -#define NM_DBUS_PATH_VPN "/org/freedesktop/NetworkManager/VPN/Manager" -#define NM_DBUS_INTERFACE_VPN "org.freedesktop.NetworkManager.VPN.Manager" +#define NM_DBUS_PATH_VPN "/org/freedesktop/NetworkManager/VPN/Manager" +#define NM_DBUS_INTERFACE_VPN "org.freedesktop.NetworkManager.VPN.Manager" -#define NM_DBUS_PATH_VPN_CONNECTION "/org/freedesktop/NetworkManager/VPN/Connection" -#define NM_DBUS_INTERFACE_VPN_CONNECTION "org.freedesktop.NetworkManager.VPN.Connection" +#define NM_DBUS_PATH_VPN_CONNECTION "/org/freedesktop/NetworkManager/VPN/Connection" +#define NM_DBUS_INTERFACE_VPN_CONNECTION "org.freedesktop.NetworkManager.VPN.Connection" -#define NM_VPN_DBUS_PLUGIN_PATH "/org/freedesktop/NetworkManager/VPN/Plugin" -#define NM_VPN_DBUS_PLUGIN_INTERFACE "org.freedesktop.NetworkManager.VPN.Plugin" +#define NM_VPN_DBUS_PLUGIN_PATH "/org/freedesktop/NetworkManager/VPN/Plugin" +#define NM_VPN_DBUS_PLUGIN_INTERFACE "org.freedesktop.NetworkManager.VPN.Plugin" /* * VPN Errors */ -#define NM_DBUS_NO_ACTIVE_VPN_CONNECTION "org.freedesktop.NetworkManager.VPNConnections.NoActiveVPNConnection" -#define NM_DBUS_NO_VPN_CONNECTIONS "org.freedesktop.NetworkManager.VPNConnections.NoVPNConnections" -#define NM_DBUS_INVALID_VPN_CONNECTION "org.freedesktop.NetworkManager.VPNConnections.InvalidVPNConnection" +#define NM_DBUS_NO_ACTIVE_VPN_CONNECTION \ + "org.freedesktop.NetworkManager.VPNConnections.NoActiveVPNConnection" +#define NM_DBUS_NO_VPN_CONNECTIONS "org.freedesktop.NetworkManager.VPNConnections.NoVPNConnections" +#define NM_DBUS_INVALID_VPN_CONNECTION \ + "org.freedesktop.NetworkManager.VPNConnections.InvalidVPNConnection" #define NM_DBUS_VPN_ERROR_PREFIX "org.freedesktop.NetworkManager.VPN.Error" #define NM_DBUS_VPN_STARTING_IN_PROGRESS "StartingInProgress" @@ -71,13 +73,13 @@ * VPN daemon states */ typedef enum { - NM_VPN_SERVICE_STATE_UNKNOWN = 0, - NM_VPN_SERVICE_STATE_INIT, - NM_VPN_SERVICE_STATE_SHUTDOWN, - NM_VPN_SERVICE_STATE_STARTING, - NM_VPN_SERVICE_STATE_STARTED, - NM_VPN_SERVICE_STATE_STOPPING, - NM_VPN_SERVICE_STATE_STOPPED + NM_VPN_SERVICE_STATE_UNKNOWN = 0, + NM_VPN_SERVICE_STATE_INIT, + NM_VPN_SERVICE_STATE_SHUTDOWN, + NM_VPN_SERVICE_STATE_STARTING, + NM_VPN_SERVICE_STATE_STARTED, + NM_VPN_SERVICE_STATE_STOPPING, + NM_VPN_SERVICE_STATE_STOPPED } NMVpnServiceState; /** @@ -98,14 +100,14 @@ typedef enum { * VPN connection states */ typedef enum { - NM_VPN_CONNECTION_STATE_UNKNOWN = 0, - NM_VPN_CONNECTION_STATE_PREPARE, - NM_VPN_CONNECTION_STATE_NEED_AUTH, - NM_VPN_CONNECTION_STATE_CONNECT, - NM_VPN_CONNECTION_STATE_IP_CONFIG_GET, - NM_VPN_CONNECTION_STATE_ACTIVATED, - NM_VPN_CONNECTION_STATE_FAILED, - NM_VPN_CONNECTION_STATE_DISCONNECTED + NM_VPN_CONNECTION_STATE_UNKNOWN = 0, + NM_VPN_CONNECTION_STATE_PREPARE, + NM_VPN_CONNECTION_STATE_NEED_AUTH, + NM_VPN_CONNECTION_STATE_CONNECT, + NM_VPN_CONNECTION_STATE_IP_CONFIG_GET, + NM_VPN_CONNECTION_STATE_ACTIVATED, + NM_VPN_CONNECTION_STATE_FAILED, + NM_VPN_CONNECTION_STATE_DISCONNECTED } NMVpnConnectionState; /** @@ -139,18 +141,26 @@ typedef enum { */ NM_DEPRECATED_IN_1_8_FOR(NMActiveConnectionStateReason) typedef enum { - NM_VPN_CONNECTION_STATE_REASON_UNKNOWN = NM_ACTIVE_CONNECTION_STATE_REASON_UNKNOWN, - NM_VPN_CONNECTION_STATE_REASON_NONE = NM_ACTIVE_CONNECTION_STATE_REASON_NONE, - NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED = NM_ACTIVE_CONNECTION_STATE_REASON_USER_DISCONNECTED, - NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED = NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED, - NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED = NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_STOPPED, - NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID = NM_ACTIVE_CONNECTION_STATE_REASON_IP_CONFIG_INVALID, - NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT = NM_ACTIVE_CONNECTION_STATE_REASON_CONNECT_TIMEOUT, - NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT = NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT, - NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED = NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_START_FAILED, - NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS = NM_ACTIVE_CONNECTION_STATE_REASON_NO_SECRETS, - NM_VPN_CONNECTION_STATE_REASON_LOGIN_FAILED = NM_ACTIVE_CONNECTION_STATE_REASON_LOGIN_FAILED, - NM_VPN_CONNECTION_STATE_REASON_CONNECTION_REMOVED = NM_ACTIVE_CONNECTION_STATE_REASON_CONNECTION_REMOVED, + NM_VPN_CONNECTION_STATE_REASON_UNKNOWN = NM_ACTIVE_CONNECTION_STATE_REASON_UNKNOWN, + NM_VPN_CONNECTION_STATE_REASON_NONE = NM_ACTIVE_CONNECTION_STATE_REASON_NONE, + NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED = + NM_ACTIVE_CONNECTION_STATE_REASON_USER_DISCONNECTED, + NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED = + NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED, + NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED = + NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_STOPPED, + NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID = + NM_ACTIVE_CONNECTION_STATE_REASON_IP_CONFIG_INVALID, + NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT = + NM_ACTIVE_CONNECTION_STATE_REASON_CONNECT_TIMEOUT, + NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT = + NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT, + NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED = + NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_START_FAILED, + NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS = NM_ACTIVE_CONNECTION_STATE_REASON_NO_SECRETS, + NM_VPN_CONNECTION_STATE_REASON_LOGIN_FAILED = NM_ACTIVE_CONNECTION_STATE_REASON_LOGIN_FAILED, + NM_VPN_CONNECTION_STATE_REASON_CONNECTION_REMOVED = + NM_ACTIVE_CONNECTION_STATE_REASON_CONNECTION_REMOVED, } NMVpnConnectionStateReason; /** @@ -163,42 +173,42 @@ typedef enum { * VPN plugin failure reasons */ typedef enum { - NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED, - NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED, - NM_VPN_PLUGIN_FAILURE_BAD_IP_CONFIG + NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED, + NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED, + NM_VPN_PLUGIN_FAILURE_BAD_IP_CONFIG } NMVpnPluginFailure; #ifndef NM_VERSION_H -#undef NM_DEPRECATED_IN_1_8_FOR + #undef NM_DEPRECATED_IN_1_8_FOR #endif /*** Generic config ***/ /* string: VPN interface name (tun0, tap0, etc) */ -#define NM_VPN_PLUGIN_CONFIG_TUNDEV "tundev" +#define NM_VPN_PLUGIN_CONFIG_TUNDEV "tundev" /* string: Proxy PAC */ -#define NM_VPN_PLUGIN_CONFIG_PROXY_PAC "pac" +#define NM_VPN_PLUGIN_CONFIG_PROXY_PAC "pac" /* string: Login message */ -#define NM_VPN_PLUGIN_CONFIG_BANNER "banner" +#define NM_VPN_PLUGIN_CONFIG_BANNER "banner" /* uint32 / array of uint8: IP address of the public external VPN gateway (network byte order) */ #define NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY "gateway" /* uint32: Maximum Transfer Unit that the VPN interface should use */ -#define NM_VPN_PLUGIN_CONFIG_MTU "mtu" +#define NM_VPN_PLUGIN_CONFIG_MTU "mtu" /* boolean: Has IP4 configuration? */ -#define NM_VPN_PLUGIN_CONFIG_HAS_IP4 "has-ip4" +#define NM_VPN_PLUGIN_CONFIG_HAS_IP4 "has-ip4" /* boolean: Has IP6 configuration? */ -#define NM_VPN_PLUGIN_CONFIG_HAS_IP6 "has-ip6" +#define NM_VPN_PLUGIN_CONFIG_HAS_IP6 "has-ip6" /* boolean: If %TRUE the VPN plugin can persist/reconnect the connection over * link changes and VPN server dropouts. */ -#define NM_VPN_PLUGIN_CAN_PERSIST "can-persist" +#define NM_VPN_PLUGIN_CAN_PERSIST "can-persist" /*** Ip4Config ***/ @@ -208,35 +218,35 @@ typedef enum { #define NM_VPN_PLUGIN_IP4_CONFIG_INT_GATEWAY "internal-gateway" /* uint32: internal IP address of the local VPN interface (network byte order) */ -#define NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS "address" +#define NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS "address" /* uint32: IP address of the other side of Point-to-Point connection if the VPN * uses Point-to-Point configuration. (network byte order) */ -#define NM_VPN_PLUGIN_IP4_CONFIG_PTP "ptp" +#define NM_VPN_PLUGIN_IP4_CONFIG_PTP "ptp" /* uint32: IP prefix of the VPN interface; 1 - 32 inclusive */ -#define NM_VPN_PLUGIN_IP4_CONFIG_PREFIX "prefix" +#define NM_VPN_PLUGIN_IP4_CONFIG_PREFIX "prefix" /* array of uint32: IP addresses of DNS servers for the VPN (network byte order) */ -#define NM_VPN_PLUGIN_IP4_CONFIG_DNS "dns" +#define NM_VPN_PLUGIN_IP4_CONFIG_DNS "dns" /* array of uint32: IP addresses of NBNS/WINS servers for the VPN (network byte order) */ -#define NM_VPN_PLUGIN_IP4_CONFIG_NBNS "nbns" +#define NM_VPN_PLUGIN_IP4_CONFIG_NBNS "nbns" /* uint32: Message Segment Size that the VPN interface should use */ -#define NM_VPN_PLUGIN_IP4_CONFIG_MSS "mss" +#define NM_VPN_PLUGIN_IP4_CONFIG_MSS "mss" /* string: DNS domain name */ -#define NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN "domain" +#define NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN "domain" /* array of strings: DNS domain names */ -#define NM_VPN_PLUGIN_IP4_CONFIG_DOMAINS "domains" +#define NM_VPN_PLUGIN_IP4_CONFIG_DOMAINS "domains" /* [ip4 routes]: custom routes the client should apply, in the format used * by nm_utils_ip4_routes_to/from_gvalue */ -#define NM_VPN_PLUGIN_IP4_CONFIG_ROUTES "routes" +#define NM_VPN_PLUGIN_IP4_CONFIG_ROUTES "routes" /* whether the previous IP4 routing configuration should be preserved. */ #define NM_VPN_PLUGIN_IP4_CONFIG_PRESERVE_ROUTES "preserve-routes" @@ -245,7 +255,7 @@ typedef enum { #define NM_VPN_PLUGIN_IP4_CONFIG_NEVER_DEFAULT "never-default" /* Deprecated */ -#define NM_VPN_PLUGIN_IP4_CONFIG_GATEWAY NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY +#define NM_VPN_PLUGIN_IP4_CONFIG_GATEWAY NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY /* Legacy IP4 items; these are included in the IP4 config by older plugins, * but in the generic config by newer plugins. @@ -264,32 +274,32 @@ typedef enum { #define NM_VPN_PLUGIN_IP6_CONFIG_INT_GATEWAY "internal-gateway" /* array of uint8: internal IP address of the local VPN interface (network byte order) */ -#define NM_VPN_PLUGIN_IP6_CONFIG_ADDRESS "address" +#define NM_VPN_PLUGIN_IP6_CONFIG_ADDRESS "address" /* array of uint8: IP address of the other side of Point-to-Point connection if the VPN * uses Point-to-Point configuration. (network byte order) */ -#define NM_VPN_PLUGIN_IP6_CONFIG_PTP "ptp" +#define NM_VPN_PLUGIN_IP6_CONFIG_PTP "ptp" /* uint32: prefix length of the VPN interface; 1 - 128 inclusive */ -#define NM_VPN_PLUGIN_IP6_CONFIG_PREFIX "prefix" +#define NM_VPN_PLUGIN_IP6_CONFIG_PREFIX "prefix" /* array of array of uint8: IP addresses of DNS servers for the VPN (network byte order) */ -#define NM_VPN_PLUGIN_IP6_CONFIG_DNS "dns" +#define NM_VPN_PLUGIN_IP6_CONFIG_DNS "dns" /* uint32: Message Segment Size that the VPN interface should use */ -#define NM_VPN_PLUGIN_IP6_CONFIG_MSS "mss" +#define NM_VPN_PLUGIN_IP6_CONFIG_MSS "mss" /* string: DNS domain name */ -#define NM_VPN_PLUGIN_IP6_CONFIG_DOMAIN "domain" +#define NM_VPN_PLUGIN_IP6_CONFIG_DOMAIN "domain" /* array of strings: DNS domain names */ -#define NM_VPN_PLUGIN_IP6_CONFIG_DOMAINS "domains" +#define NM_VPN_PLUGIN_IP6_CONFIG_DOMAINS "domains" /* [ip6 routes]: custom routes the client should apply, in the format used * by nm_utils_ip6_routes_to/from_gvalue */ -#define NM_VPN_PLUGIN_IP6_CONFIG_ROUTES "routes" +#define NM_VPN_PLUGIN_IP6_CONFIG_ROUTES "routes" /* whether the previous IP6 routing configuration should be preserved. */ #define NM_VPN_PLUGIN_IP6_CONFIG_PRESERVE_ROUTES "preserve-routes" |