1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301 USA.
19 * Copyright 2007 - 2014 Red Hat, Inc.
20 * Copyright 2007 - 2008 Novell, Inc.
23 #ifndef NM_SETTING_CONNECTION_H
24 #define NM_SETTING_CONNECTION_H
26 #include "nm-setting.h"
30 #define NM_TYPE_SETTING_CONNECTION (nm_setting_connection_get_type ())
31 #define NM_SETTING_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_CONNECTION, NMSettingConnection))
32 #define NM_SETTING_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionClass))
33 #define NM_IS_SETTING_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_CONNECTION))
34 #define NM_IS_SETTING_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_CONNECTION))
35 #define NM_SETTING_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionClass))
37 #define NM_SETTING_CONNECTION_SETTING_NAME "connection"
40 * NMSettingConnectionError:
41 * @NM_SETTING_CONNECTION_ERROR_UNKNOWN: unknown or unclassified error
42 * @NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY: the property's value is
44 * @NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY: a required property is not
46 * @NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND: the #NMSetting object
47 * referenced by the setting name contained in the
48 * #NMSettingConnection:type property was not present in the #NMConnection
49 * @NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED: ip configuration is not
50 * allowed to be present.
52 * Describes errors that may result from operations involving a
53 * #NMSettingConnection.
58 NM_SETTING_CONNECTION_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
59 NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY, /*< nick=InvalidProperty >*/
60 NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY, /*< nick=MissingProperty >*/
61 NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND, /*< nick=TypeSettingNotFound >*/
62 NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED, /*< nick=IpConfigNotAllowed >*/
63 } NMSettingConnectionError;
65 #define NM_SETTING_CONNECTION_ERROR nm_setting_connection_error_quark ()
66 GQuark nm_setting_connection_error_quark (void);
68 #define NM_SETTING_CONNECTION_ID "id"
69 #define NM_SETTING_CONNECTION_UUID "uuid"
70 #define NM_SETTING_CONNECTION_INTERFACE_NAME "interface-name"
71 #define NM_SETTING_CONNECTION_TYPE "type"
72 #define NM_SETTING_CONNECTION_AUTOCONNECT "autoconnect"
73 #define NM_SETTING_CONNECTION_TIMESTAMP "timestamp"
74 #define NM_SETTING_CONNECTION_READ_ONLY "read-only"
75 #define NM_SETTING_CONNECTION_PERMISSIONS "permissions"
76 #define NM_SETTING_CONNECTION_ZONE "zone"
77 #define NM_SETTING_CONNECTION_MASTER "master"
78 #define NM_SETTING_CONNECTION_SLAVE_TYPE "slave-type"
79 #define NM_SETTING_CONNECTION_SECONDARIES "secondaries"
80 #define NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT "gateway-ping-timeout"
83 * NMSettingConnection:
85 * The NMSettingConnection struct contains only private data.
86 * It should only be accessed through the functions described below.
90 } NMSettingConnection;
93 NMSettingClass parent;
95 /* Padding for future expansion */
96 void (*_reserved1) (void);
97 void (*_reserved2) (void);
98 void (*_reserved3) (void);
99 void (*_reserved4) (void);
100 } NMSettingConnectionClass;
102 GType nm_setting_connection_get_type (void);
104 NMSetting * nm_setting_connection_new (void);
105 const char *nm_setting_connection_get_id (NMSettingConnection *setting);
106 const char *nm_setting_connection_get_uuid (NMSettingConnection *setting);
107 NM_AVAILABLE_IN_0_9_10
108 const char *nm_setting_connection_get_interface_name (NMSettingConnection *setting);
109 const char *nm_setting_connection_get_connection_type (NMSettingConnection *setting);
110 gboolean nm_setting_connection_get_autoconnect (NMSettingConnection *setting);
111 guint64 nm_setting_connection_get_timestamp (NMSettingConnection *setting);
112 gboolean nm_setting_connection_get_read_only (NMSettingConnection *setting);
114 guint32 nm_setting_connection_get_num_permissions (NMSettingConnection *setting);
115 gboolean nm_setting_connection_get_permission (NMSettingConnection *setting,
117 const char **out_ptype,
118 const char **out_pitem,
119 const char **out_detail);
120 const char *nm_setting_connection_get_zone (NMSettingConnection *setting);
121 gboolean nm_setting_connection_permissions_user_allowed (NMSettingConnection *setting, const char *uname);
122 gboolean nm_setting_connection_add_permission (NMSettingConnection *setting,
126 void nm_setting_connection_remove_permission (NMSettingConnection *setting,
128 NM_AVAILABLE_IN_0_9_10
129 gboolean nm_setting_connection_remove_permission_by_value (NMSettingConnection *setting,
134 const char *nm_setting_connection_get_master (NMSettingConnection *setting);
135 gboolean nm_setting_connection_is_slave_type (NMSettingConnection *setting,
137 const char *nm_setting_connection_get_slave_type (NMSettingConnection *setting);
139 guint32 nm_setting_connection_get_num_secondaries (NMSettingConnection *setting);
140 const char *nm_setting_connection_get_secondary (NMSettingConnection *setting, guint32 idx);
141 gboolean nm_setting_connection_add_secondary (NMSettingConnection *setting, const char *sec_uuid);
142 void nm_setting_connection_remove_secondary (NMSettingConnection *setting, guint32 idx);
143 NM_AVAILABLE_IN_0_9_10
144 gboolean nm_setting_connection_remove_secondary_by_value (NMSettingConnection *setting, const char *sec_uuid);
146 NM_AVAILABLE_IN_0_9_10
147 guint32 nm_setting_connection_get_gateway_ping_timeout (NMSettingConnection *setting);
151 #endif /* NM_SETTING_CONNECTION_H */