Blame libnm-core/nm-vpn-dbus-interface.h

Packit Service 87a54e
/* SPDX-License-Identifier: LGPL-2.1-or-later */
Packit 5756e2
/*
Packit 5756e2
 * Copyright (C) 2004 Red Hat, Inc.
Packit 5756e2
 */
Packit 5756e2
Packit 5756e2
/* D-Bus-related definitions for NetworkManager VPN plugins.
Packit 5756e2
 *
Packit 5756e2
 * Note that although this header is installed as part of libnm, it is also
Packit 5756e2
 * used by some external code that does not link to libnm.
Packit 5756e2
 */
Packit 5756e2
Packit 5756e2
#ifndef __NM_VPN_DBUS_INTERFACE_H__
Packit 5756e2
#define __NM_VPN_DBUS_INTERFACE_H__
Packit 5756e2
Packit 5756e2
#include "nm-dbus-interface.h"
Packit 5756e2
Packit 5756e2
#ifndef NM_VERSION_H
Packit Service a1bd4f
    #define NM_DEPRECATED_IN_1_8_FOR(n)
Packit 5756e2
#endif
Packit 5756e2
Packit 5756e2
/*
Packit 5756e2
 * dbus services details
Packit 5756e2
 */
Packit Service a1bd4f
#define NM_DBUS_PATH_VPN      "/org/freedesktop/NetworkManager/VPN/Manager"
Packit Service a1bd4f
#define NM_DBUS_INTERFACE_VPN "org.freedesktop.NetworkManager.VPN.Manager"
Packit 5756e2
Packit Service a1bd4f
#define NM_DBUS_PATH_VPN_CONNECTION      "/org/freedesktop/NetworkManager/VPN/Connection"
Packit Service a1bd4f
#define NM_DBUS_INTERFACE_VPN_CONNECTION "org.freedesktop.NetworkManager.VPN.Connection"
Packit 5756e2
Packit Service a1bd4f
#define NM_VPN_DBUS_PLUGIN_PATH      "/org/freedesktop/NetworkManager/VPN/Plugin"
Packit Service a1bd4f
#define NM_VPN_DBUS_PLUGIN_INTERFACE "org.freedesktop.NetworkManager.VPN.Plugin"
Packit 5756e2
Packit 5756e2
/*
Packit 5756e2
 * VPN Errors
Packit 5756e2
 */
Packit Service a1bd4f
#define NM_DBUS_NO_ACTIVE_VPN_CONNECTION \
Packit Service a1bd4f
    "org.freedesktop.NetworkManager.VPNConnections.NoActiveVPNConnection"
Packit Service a1bd4f
#define NM_DBUS_NO_VPN_CONNECTIONS "org.freedesktop.NetworkManager.VPNConnections.NoVPNConnections"
Packit Service a1bd4f
#define NM_DBUS_INVALID_VPN_CONNECTION \
Packit Service a1bd4f
    "org.freedesktop.NetworkManager.VPNConnections.InvalidVPNConnection"
Packit 5756e2
Packit 5756e2
#define NM_DBUS_VPN_ERROR_PREFIX              "org.freedesktop.NetworkManager.VPN.Error"
Packit 5756e2
#define NM_DBUS_VPN_STARTING_IN_PROGRESS      "StartingInProgress"
Packit 5756e2
#define NM_DBUS_VPN_ALREADY_STARTED           "AlreadyStarted"
Packit 5756e2
#define NM_DBUS_VPN_STOPPING_IN_PROGRESS      "StoppingInProgress"
Packit 5756e2
#define NM_DBUS_VPN_ALREADY_STOPPED           "AlreadyStopped"
Packit 5756e2
#define NM_DBUS_VPN_WRONG_STATE               "WrongState"
Packit 5756e2
#define NM_DBUS_VPN_BAD_ARGUMENTS             "BadArguments"
Packit 5756e2
#define NM_DBUS_VPN_INTERACTIVE_NOT_SUPPORTED "InteractiveNotSupported"
Packit 5756e2
Packit 5756e2
/*
Packit 5756e2
 * VPN daemon signals
Packit 5756e2
 */
Packit 5756e2
#define NM_DBUS_VPN_SIGNAL_LOGIN_BANNER   "LoginBanner"
Packit 5756e2
#define NM_DBUS_VPN_SIGNAL_LOGIN_FAILED   "LoginFailed"
Packit 5756e2
#define NM_DBUS_VPN_SIGNAL_LAUNCH_FAILED  "LaunchFailed"
Packit 5756e2
#define NM_DBUS_VPN_SIGNAL_CONNECT_FAILED "ConnectFailed"
Packit 5756e2
#define NM_DBUS_VPN_SIGNAL_VPN_CONFIG_BAD "VPNConfigBad"
Packit 5756e2
#define NM_DBUS_VPN_SIGNAL_IP_CONFIG_BAD  "IPConfigBad"
Packit 5756e2
#define NM_DBUS_VPN_SIGNAL_STATE_CHANGE   "StateChange"
Packit 5756e2
#define NM_DBUS_VPN_SIGNAL_IP4_CONFIG     "IP4Config"
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * NMVpnServiceState:
Packit 5756e2
 * @NM_VPN_SERVICE_STATE_UNKNOWN: The state of the VPN plugin is unknown.
Packit 5756e2
 * @NM_VPN_SERVICE_STATE_INIT: The VPN plugin is initialized.
Packit 5756e2
 * @NM_VPN_SERVICE_STATE_SHUTDOWN: Not used.
Packit 5756e2
 * @NM_VPN_SERVICE_STATE_STARTING: The plugin is attempting to connect to a VPN server.
Packit 5756e2
 * @NM_VPN_SERVICE_STATE_STARTED: The plugin has connected to a VPN server.
Packit 5756e2
 * @NM_VPN_SERVICE_STATE_STOPPING: The plugin is disconnecting from the VPN server.
Packit 5756e2
 * @NM_VPN_SERVICE_STATE_STOPPED: The plugin has disconnected from the VPN server.
Packit 5756e2
 *
Packit 5756e2
 * VPN daemon states
Packit 5756e2
 */
Packit 5756e2
typedef enum {
Packit Service a1bd4f
    NM_VPN_SERVICE_STATE_UNKNOWN = 0,
Packit Service a1bd4f
    NM_VPN_SERVICE_STATE_INIT,
Packit Service a1bd4f
    NM_VPN_SERVICE_STATE_SHUTDOWN,
Packit Service a1bd4f
    NM_VPN_SERVICE_STATE_STARTING,
Packit Service a1bd4f
    NM_VPN_SERVICE_STATE_STARTED,
Packit Service a1bd4f
    NM_VPN_SERVICE_STATE_STOPPING,
Packit Service a1bd4f
    NM_VPN_SERVICE_STATE_STOPPED
Packit 5756e2
} NMVpnServiceState;
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * NMVpnConnectionState:
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_UNKNOWN: The state of the VPN connection is
Packit 5756e2
 *   unknown.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_PREPARE: The VPN connection is preparing to
Packit 5756e2
 *   connect.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_NEED_AUTH: The VPN connection needs authorization
Packit 5756e2
 *   credentials.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_CONNECT: The VPN connection is being established.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_IP_CONFIG_GET: The VPN connection is getting an IP
Packit 5756e2
 *   address.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_ACTIVATED: The VPN connection is active.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_FAILED: The VPN connection failed.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_DISCONNECTED: The VPN connection is disconnected.
Packit 5756e2
 *
Packit 5756e2
 * VPN connection states
Packit 5756e2
 */
Packit 5756e2
typedef enum {
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_UNKNOWN = 0,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_PREPARE,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_NEED_AUTH,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_CONNECT,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_IP_CONFIG_GET,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_ACTIVATED,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_FAILED,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_DISCONNECTED
Packit 5756e2
} NMVpnConnectionState;
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * NMVpnConnectionStateReason:
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_UNKNOWN: The reason for the VPN connection
Packit 5756e2
 *   state change is unknown.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_NONE: No reason was given for the VPN
Packit 5756e2
 *   connection state change.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED: The VPN connection changed
Packit 5756e2
 *   state because the user disconnected it.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED: The VPN connection
Packit 5756e2
 *   changed state because the device it was using was disconnected.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED: The service providing the
Packit 5756e2
 *   VPN connection was stopped.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID: The IP config of the VPN
Packit 5756e2
 *   connection was invalid.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT: The connection attempt to
Packit 5756e2
 *   the VPN service timed out.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT: A timeout occurred
Packit 5756e2
 *   while starting the service providing the VPN connection.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED: Starting the service
Packit 5756e2
 *   starting the service providing the VPN connection failed.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS: Necessary secrets for the VPN
Packit 5756e2
 *   connection were not provided.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_LOGIN_FAILED: Authentication to the VPN
Packit 5756e2
 *   server failed.
Packit 5756e2
 * @NM_VPN_CONNECTION_STATE_REASON_CONNECTION_REMOVED: The connection was
Packit 5756e2
 *   deleted from settings.
Packit 5756e2
 *
Packit 5756e2
 * VPN connection state reasons
Packit 5756e2
 */
Packit 5756e2
NM_DEPRECATED_IN_1_8_FOR(NMActiveConnectionStateReason)
Packit 5756e2
typedef enum {
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_UNKNOWN = NM_ACTIVE_CONNECTION_STATE_REASON_UNKNOWN,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_NONE    = NM_ACTIVE_CONNECTION_STATE_REASON_NONE,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED =
Packit Service a1bd4f
        NM_ACTIVE_CONNECTION_STATE_REASON_USER_DISCONNECTED,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED =
Packit Service a1bd4f
        NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED =
Packit Service a1bd4f
        NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_STOPPED,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID =
Packit Service a1bd4f
        NM_ACTIVE_CONNECTION_STATE_REASON_IP_CONFIG_INVALID,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT =
Packit Service a1bd4f
        NM_ACTIVE_CONNECTION_STATE_REASON_CONNECT_TIMEOUT,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT =
Packit Service a1bd4f
        NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED =
Packit Service a1bd4f
        NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_START_FAILED,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS   = NM_ACTIVE_CONNECTION_STATE_REASON_NO_SECRETS,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_LOGIN_FAILED = NM_ACTIVE_CONNECTION_STATE_REASON_LOGIN_FAILED,
Packit Service a1bd4f
    NM_VPN_CONNECTION_STATE_REASON_CONNECTION_REMOVED =
Packit Service a1bd4f
        NM_ACTIVE_CONNECTION_STATE_REASON_CONNECTION_REMOVED,
Packit 5756e2
} NMVpnConnectionStateReason;
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * NMVpnPluginFailure:
Packit 5756e2
 * @NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED: Login failed.
Packit 5756e2
 * @NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED: Connect failed.
Packit 5756e2
 * @NM_VPN_PLUGIN_FAILURE_BAD_IP_CONFIG: Invalid IP configuration returned from
Packit 5756e2
 *   the VPN plugin.
Packit 5756e2
 *
Packit 5756e2
 * VPN plugin failure reasons
Packit 5756e2
 */
Packit 5756e2
typedef enum {
Packit Service a1bd4f
    NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED,
Packit Service a1bd4f
    NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED,
Packit Service a1bd4f
    NM_VPN_PLUGIN_FAILURE_BAD_IP_CONFIG
Packit 5756e2
} NMVpnPluginFailure;
Packit 5756e2
Packit 5756e2
#ifndef NM_VERSION_H
Packit Service a1bd4f
    #undef NM_DEPRECATED_IN_1_8_FOR
Packit 5756e2
#endif
Packit 5756e2
Packit 5756e2
/*** Generic config ***/
Packit 5756e2
Packit 5756e2
/* string: VPN interface name (tun0, tap0, etc) */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_CONFIG_TUNDEV "tundev"
Packit 5756e2
Packit 5756e2
/* string: Proxy PAC */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_CONFIG_PROXY_PAC "pac"
Packit 5756e2
Packit 5756e2
/* string: Login message */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_CONFIG_BANNER "banner"
Packit 5756e2
Packit 5756e2
/* uint32 / array of uint8: IP address of the public external VPN gateway (network byte order) */
Packit 5756e2
#define NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY "gateway"
Packit 5756e2
Packit 5756e2
/* uint32: Maximum Transfer Unit that the VPN interface should use */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_CONFIG_MTU "mtu"
Packit 5756e2
Packit 5756e2
/* boolean: Has IP4 configuration? */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_CONFIG_HAS_IP4 "has-ip4"
Packit 5756e2
Packit 5756e2
/* boolean: Has IP6 configuration? */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_CONFIG_HAS_IP6 "has-ip6"
Packit 5756e2
Packit 5756e2
/* boolean: If %TRUE the VPN plugin can persist/reconnect the connection over
Packit 5756e2
 * link changes and VPN server dropouts.
Packit 5756e2
 */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_CAN_PERSIST "can-persist"
Packit 5756e2
Packit 5756e2
/*** Ip4Config ***/
Packit 5756e2
Packit 5756e2
/* uint32: IP address of the internal gateway of the subnet the VPN interface is
Packit 5756e2
 *         on, if the VPN uses subnet configuration (network byte order)
Packit 5756e2
 */
Packit 5756e2
#define NM_VPN_PLUGIN_IP4_CONFIG_INT_GATEWAY "internal-gateway"
Packit 5756e2
Packit 5756e2
/* uint32: internal IP address of the local VPN interface (network byte order) */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS "address"
Packit 5756e2
Packit 5756e2
/* uint32: IP address of the other side of Point-to-Point connection if the VPN
Packit 5756e2
 *         uses Point-to-Point configuration. (network byte order)
Packit 5756e2
 */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP4_CONFIG_PTP "ptp"
Packit 5756e2
Packit 5756e2
/* uint32: IP prefix of the VPN interface; 1 - 32 inclusive */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP4_CONFIG_PREFIX "prefix"
Packit 5756e2
Packit 5756e2
/* array of uint32: IP addresses of DNS servers for the VPN (network byte order) */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP4_CONFIG_DNS "dns"
Packit 5756e2
Packit 5756e2
/* array of uint32: IP addresses of NBNS/WINS servers for the VPN (network byte order) */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP4_CONFIG_NBNS "nbns"
Packit 5756e2
Packit 5756e2
/* uint32: Message Segment Size that the VPN interface should use */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP4_CONFIG_MSS "mss"
Packit 5756e2
Packit 5756e2
/* string: DNS domain name */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN "domain"
Packit 5756e2
Packit 5756e2
/* array of strings: DNS domain names */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP4_CONFIG_DOMAINS "domains"
Packit 5756e2
Packit 5756e2
/* [ip4 routes]: custom routes the client should apply, in the format used
Packit 5756e2
 *         by nm_utils_ip4_routes_to/from_gvalue
Packit 5756e2
 */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP4_CONFIG_ROUTES "routes"
Packit 5756e2
Packit 5756e2
/* whether the previous IP4 routing configuration should be preserved. */
Packit 5756e2
#define NM_VPN_PLUGIN_IP4_CONFIG_PRESERVE_ROUTES "preserve-routes"
Packit 5756e2
Packit 5756e2
/* boolean: prevent this VPN connection from ever getting the default route */
Packit 5756e2
#define NM_VPN_PLUGIN_IP4_CONFIG_NEVER_DEFAULT "never-default"
Packit 5756e2
Packit 5756e2
/* Deprecated */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP4_CONFIG_GATEWAY NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY
Packit 5756e2
Packit 5756e2
/* Legacy IP4 items; these are included in the IP4 config by older plugins,
Packit 5756e2
 * but in the generic config by newer plugins.
Packit 5756e2
 */
Packit 5756e2
Packit 5756e2
#define NM_VPN_PLUGIN_IP4_CONFIG_BANNER      NM_VPN_PLUGIN_CONFIG_BANNER
Packit 5756e2
#define NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY
Packit 5756e2
#define NM_VPN_PLUGIN_IP4_CONFIG_MTU         NM_VPN_PLUGIN_CONFIG_MTU
Packit 5756e2
#define NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV      NM_VPN_PLUGIN_CONFIG_TUNDEV
Packit 5756e2
Packit 5756e2
/*** Ip6Config ***/
Packit 5756e2
Packit 5756e2
/* array of uint8: IP address of the internal gateway of the subnet the VPN interface is
Packit 5756e2
 *         on, if the VPN uses subnet configuration (network byte order)
Packit 5756e2
 */
Packit 5756e2
#define NM_VPN_PLUGIN_IP6_CONFIG_INT_GATEWAY "internal-gateway"
Packit 5756e2
Packit 5756e2
/* array of uint8: internal IP address of the local VPN interface (network byte order) */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP6_CONFIG_ADDRESS "address"
Packit 5756e2
Packit 5756e2
/* array of uint8: IP address of the other side of Point-to-Point connection if the VPN
Packit 5756e2
 *         uses Point-to-Point configuration. (network byte order)
Packit 5756e2
 */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP6_CONFIG_PTP "ptp"
Packit 5756e2
Packit 5756e2
/* uint32: prefix length of the VPN interface; 1 - 128 inclusive */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP6_CONFIG_PREFIX "prefix"
Packit 5756e2
Packit 5756e2
/* array of array of uint8: IP addresses of DNS servers for the VPN (network byte order) */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP6_CONFIG_DNS "dns"
Packit 5756e2
Packit 5756e2
/* uint32: Message Segment Size that the VPN interface should use */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP6_CONFIG_MSS "mss"
Packit 5756e2
Packit 5756e2
/* string: DNS domain name */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP6_CONFIG_DOMAIN "domain"
Packit 5756e2
Packit 5756e2
/* array of strings: DNS domain names */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP6_CONFIG_DOMAINS "domains"
Packit 5756e2
Packit 5756e2
/* [ip6 routes]: custom routes the client should apply, in the format used
Packit 5756e2
 *         by nm_utils_ip6_routes_to/from_gvalue
Packit 5756e2
 */
Packit Service a1bd4f
#define NM_VPN_PLUGIN_IP6_CONFIG_ROUTES "routes"
Packit 5756e2
Packit 5756e2
/* whether the previous IP6 routing configuration should be preserved. */
Packit 5756e2
#define NM_VPN_PLUGIN_IP6_CONFIG_PRESERVE_ROUTES "preserve-routes"
Packit 5756e2
Packit 5756e2
/* boolean: prevent this VPN connection from ever getting the default route */
Packit 5756e2
#define NM_VPN_PLUGIN_IP6_CONFIG_NEVER_DEFAULT "never-default"
Packit 5756e2
Packit 5756e2
#endif /* __NM_VPN_DBUS_INTERFACE_H__ */