diff options
Diffstat (limited to 'libnm-util/nm-connection.h')
-rw-r--r-- | libnm-util/nm-connection.h | 95 |
1 files changed, 37 insertions, 58 deletions
diff --git a/libnm-util/nm-connection.h b/libnm-util/nm-connection.h index 87b053c10..83d62d9b1 100644 --- a/libnm-util/nm-connection.h +++ b/libnm-util/nm-connection.h @@ -30,22 +30,6 @@ #include <glib-object.h> #include <nm-setting.h> -#include <nm-setting-8021x.h> -#include <nm-setting-bluetooth.h> -#include <nm-setting-cdma.h> -#include <nm-setting-connection.h> -#include <nm-setting-gsm.h> -#include <nm-setting-ip4-config.h> -#include <nm-setting-ip6-config.h> -#include <nm-setting-olpc-mesh.h> -#include <nm-setting-ppp.h> -#include <nm-setting-pppoe.h> -#include <nm-setting-vpn.h> -#include <nm-setting-wimax.h> -#include <nm-setting-wired.h> -#include <nm-setting-wireless.h> -#include <nm-setting-wireless-security.h> - G_BEGIN_DECLS #define NM_TYPE_CONNECTION (nm_connection_get_type ()) @@ -55,6 +39,23 @@ G_BEGIN_DECLS #define NM_IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_CONNECTION)) #define NM_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CONNECTION, NMConnectionClass)) +/** + * NMConnectionScope: + * @NM_CONNECTION_SCOPE_UNKNOWN: scope not known or not yet set + * @NM_CONNECTION_SCOPE_SYSTEM: connection is provided by the system settings + * service + * @NM_CONNECTION_SCOPE_USER: connection is provided by a user settings service + * + * Connection scope indicated what settings service, if any, provides the + * connection. + * + **/ +typedef enum { + NM_CONNECTION_SCOPE_UNKNOWN = 0, + NM_CONNECTION_SCOPE_SYSTEM, + NM_CONNECTION_SCOPE_USER +} NMConnectionScope; + /** * NMConnectionError: @@ -62,10 +63,6 @@ G_BEGIN_DECLS * @NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND: the #NMConnection object * did not contain the required #NMSettingConnection object, which must be * present for all connections - * @NM_CONNECTION_ERROR_CONNECTION_TYPE_INVALID: the 'type' property of the - * 'connection' setting did not point to a valid connection base type; ie - * it was not a hardware-related setting like #NMSettingWired or - * #NMSettingWireless. * * Describes errors that may result from operations involving a #NMConnection. * @@ -73,8 +70,7 @@ G_BEGIN_DECLS typedef enum { NM_CONNECTION_ERROR_UNKNOWN = 0, - NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND, - NM_CONNECTION_ERROR_CONNECTION_TYPE_INVALID + NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND } NMConnectionError; #define NM_TYPE_CONNECTION_ERROR (nm_connection_error_get_type ()) @@ -83,6 +79,7 @@ GType nm_connection_error_get_type (void); #define NM_CONNECTION_ERROR nm_connection_error_quark () GQuark nm_connection_error_quark (void); +#define NM_CONNECTION_SCOPE "scope" #define NM_CONNECTION_PATH "path" /** @@ -110,10 +107,8 @@ NMConnection *nm_connection_new_from_hash (GHashTable *hash, GError **error); NMConnection *nm_connection_duplicate (NMConnection *connection); -NMSetting *nm_connection_create_setting (const char *name); - void nm_connection_add_setting (NMConnection *connection, - NMSetting *setting); + NMSetting *setting); void nm_connection_remove_setting (NMConnection *connection, GType setting_type); @@ -122,7 +117,7 @@ NMSetting *nm_connection_get_setting (NMConnection *connection, GType setting_type); NMSetting *nm_connection_get_setting_by_name (NMConnection *connection, - const char *name); + const char *name); gboolean nm_connection_replace_settings (NMConnection *connection, GHashTable *new_settings, @@ -149,44 +144,28 @@ gboolean nm_connection_update_secrets (NMConnection *connection, GHashTable *setting_secrets, GError **error); -void nm_connection_set_path (NMConnection *connection, - const char *path); +void nm_connection_set_scope (NMConnection *connection, + NMConnectionScope scope); -const char * nm_connection_get_path (NMConnection *connection); +NMConnectionScope nm_connection_get_scope (NMConnection *connection); -void nm_connection_for_each_setting_value (NMConnection *connection, - NMSettingValueIterFn func, - gpointer user_data); +void nm_connection_set_path (NMConnection *connection, + const char *path); -GHashTable *nm_connection_to_hash (NMConnection *connection, - NMSettingHashFlags flags); +const char * nm_connection_get_path (NMConnection *connection); + +void nm_connection_for_each_setting_value (NMConnection *connection, + NMSettingValueIterFn func, + gpointer user_data); +GHashTable *nm_connection_to_hash (NMConnection *connection); void nm_connection_dump (NMConnection *connection); -GType nm_connection_lookup_setting_type (const char *name); - -GType nm_connection_lookup_setting_type_by_quark (GQuark error_quark); - -/* Helpers */ -const char * nm_connection_get_uuid (NMConnection *connection); - -const char * nm_connection_get_id (NMConnection *connection); - -NMSetting8021x * nm_connection_get_setting_802_1x (NMConnection *connection); -NMSettingBluetooth * nm_connection_get_setting_bluetooth (NMConnection *connection); -NMSettingCdma * nm_connection_get_setting_cdma (NMConnection *connection); -NMSettingConnection * nm_connection_get_setting_connection (NMConnection *connection); -NMSettingGsm * nm_connection_get_setting_gsm (NMConnection *connection); -NMSettingIP4Config * nm_connection_get_setting_ip4_config (NMConnection *connection); -NMSettingIP6Config * nm_connection_get_setting_ip6_config (NMConnection *connection); -NMSettingOlpcMesh * nm_connection_get_setting_olpc_mesh (NMConnection *connection); -NMSettingPPP * nm_connection_get_setting_ppp (NMConnection *connection); -NMSettingPPPOE * nm_connection_get_setting_pppoe (NMConnection *connection); -NMSettingVPN * nm_connection_get_setting_vpn (NMConnection *connection); -NMSettingWimax * nm_connection_get_setting_wimax (NMConnection *connection); -NMSettingWired * nm_connection_get_setting_wired (NMConnection *connection); -NMSettingWireless * nm_connection_get_setting_wireless (NMConnection *connection); -NMSettingWirelessSecurity *nm_connection_get_setting_wireless_security (NMConnection *connection); +NMSetting *nm_connection_create_setting (const char *name); + +GType nm_connection_lookup_setting_type (const char *name); + +GType nm_connection_lookup_setting_type_by_quark (GQuark error_quark); G_END_DECLS |