device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-util / nm-setting-gsm.h
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
3 /*
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.
8  *
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.
13  *
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.
18  *
19  * Copyright 2007 - 2011 Red Hat, Inc.
20  * Copyright 2007 - 2008 Novell, Inc.
21  */
22
23 #ifndef NM_SETTING_GSM_H
24 #define NM_SETTING_GSM_H
25
26 #include <nm-setting.h>
27
28 G_BEGIN_DECLS
29
30 #define NM_TYPE_SETTING_GSM            (nm_setting_gsm_get_type ())
31 #define NM_SETTING_GSM(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_GSM, NMSettingGsm))
32 #define NM_SETTING_GSM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_GSM, NMSettingGsmClass))
33 #define NM_IS_SETTING_GSM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_GSM))
34 #define NM_IS_SETTING_GSM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_GSM))
35 #define NM_SETTING_GSM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_GSM, NMSettingGsmClass))
36
37 #define NM_SETTING_GSM_SETTING_NAME "gsm"
38
39 /**
40  * NMSettingGsmError:
41  * @NM_SETTING_GSM_ERROR_UNKNOWN: unknown or unclassified error
42  * @NM_SETTING_GSM_ERROR_INVALID_PROPERTY: the property was invalid
43  * @NM_SETTING_GSM_ERROR_MISSING_PROPERTY: the property was missing and is
44  * required
45  * @NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING: the required #NMSettingSerial
46  * is missing in the connection
47  */
48 typedef enum {
49         NM_SETTING_GSM_ERROR_UNKNOWN = 0,           /*< nick=UnknownError >*/
50         NM_SETTING_GSM_ERROR_INVALID_PROPERTY,      /*< nick=InvalidProperty >*/
51         NM_SETTING_GSM_ERROR_MISSING_PROPERTY,      /*< nick=MissingProperty >*/
52         NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING /*< nick=MissingSerialSetting >*/
53 } NMSettingGsmError;
54
55 #define NM_SETTING_GSM_ERROR nm_setting_gsm_error_quark ()
56 GQuark nm_setting_gsm_error_quark (void);
57
58 #define NM_SETTING_GSM_NUMBER         "number"
59 #define NM_SETTING_GSM_USERNAME       "username"
60 #define NM_SETTING_GSM_PASSWORD       "password"
61 #define NM_SETTING_GSM_PASSWORD_FLAGS "password-flags"
62 #define NM_SETTING_GSM_APN            "apn"
63 #define NM_SETTING_GSM_NETWORK_ID     "network-id"
64 #define NM_SETTING_GSM_PIN            "pin"
65 #define NM_SETTING_GSM_PIN_FLAGS      "pin-flags"
66 #define NM_SETTING_GSM_HOME_ONLY      "home-only"
67
68 /* Deprecated */
69 #define NM_SETTING_GSM_ALLOWED_BANDS  "allowed-bands"
70 #define NM_SETTING_GSM_NETWORK_TYPE   "network-type"
71
72 /**
73  * NMSettingGsmNetworkType:
74  * @NM_SETTING_GSM_NETWORK_TYPE_ANY: any access technology may be used
75  * @NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA: only 3G-type (UMTS and HSPA)
76  * technologies may be used
77  * @NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE: only 2G-type (GPRS and EDGE)
78  * technologies may be used
79  * @NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA: 3G-type technologies are
80  * preferred but 2G-type technologies may be used as a fallback
81  * @NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE: 2G-type technologies are
82  * preferred but 3G-type technologies may be used as a fallback
83  * @NM_SETTING_GSM_NETWORK_TYPE_PREFER_4G: 4G/LTE-type technologies are
84  * preferred but 3G/2/-type technologies may be used as a fallback
85  * @NM_SETTING_GSM_NETWORK_TYPE_4G: only 4G/LTE type
86  * technologies may be used
87  *
88  * #NMSettingGsmNetworkType values indicate the allowed access technologies
89  * the device may use when connecting to this network.
90  *
91  * Deprecated: 0.9.10: No longer used.
92  */
93 typedef enum {
94         NM_SETTING_GSM_NETWORK_TYPE_ANY = -1,
95         NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA = 0,
96         NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE = 1,
97         NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA = 2,
98         NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE = 3,
99         NM_SETTING_GSM_NETWORK_TYPE_PREFER_4G = 4,
100         NM_SETTING_GSM_NETWORK_TYPE_4G = 5
101 } NMSettingGsmNetworkType;
102
103 /**
104  * NMSettingGsmNetworkBand:
105  * @NM_SETTING_GSM_BAND_UNKNOWN: unknown or no band specified
106  * @NM_SETTING_GSM_BAND_ANY: any band is allowed
107  * @NM_SETTING_GSM_BAND_EGSM: 900 MHz original GSM band
108  * @NM_SETTING_GSM_BAND_DCS: 1800 MHz DCS band
109  * @NM_SETTING_GSM_BAND_PCS: US 1900 MHz PCS band
110  * @NM_SETTING_GSM_BAND_G850: US 850 MHz Cellular band
111  * @NM_SETTING_GSM_BAND_U2100: WCDMA 3GPP UMTS 2100 MHz (Class I)
112  * @NM_SETTING_GSM_BAND_U1800: WCDMA 3GPP UMTS 1800 MHz (Class III)
113  * @NM_SETTING_GSM_BAND_U17IV: WCDMA 3GPP AWS 1700/2100 MHz (Class IV)
114  * @NM_SETTING_GSM_BAND_U800: WCDMA 3GPP UMTS 800 MHz (Class VI)
115  * @NM_SETTING_GSM_BAND_U850: WCDMA 3GPP UMTS 850 MHz (Class V)
116  * @NM_SETTING_GSM_BAND_U900: WCDMA 3GPP UMTS 900 MHz (Class VIII)
117  * @NM_SETTING_GSM_BAND_U17IX: WCDMA 3GPP UMTS 1700 MHz (Class IX)
118  * @NM_SETTING_GSM_BAND_U1900: WCDMA 3GPP UMTS 1900 MHz (Class II)
119  * @NM_SETTING_GSM_BAND_U2600: WCDMA 3GPP UMTS 2600 MHz (Class VII, internal)
120  *
121  * #NMSettingGsmNetworkBand values indicate the allowed frequency bands
122  * the device may use when connecting to this network.
123  *
124  * Deprecated: 0.9.10: No longer used.
125  */
126 typedef enum {
127         NM_SETTING_GSM_BAND_UNKNOWN      = 0x00000000,
128         NM_SETTING_GSM_BAND_ANY          = 0x00000001,
129         NM_SETTING_GSM_BAND_EGSM         = 0x00000002, /*  900 MHz */
130         NM_SETTING_GSM_BAND_DCS          = 0x00000004, /* 1800 MHz */
131         NM_SETTING_GSM_BAND_PCS          = 0x00000008, /* 1900 MHz */
132         NM_SETTING_GSM_BAND_G850         = 0x00000010, /*  850 MHz */
133         NM_SETTING_GSM_BAND_U2100        = 0x00000020, /* WCDMA 3GPP UMTS 2100 MHz     (Class I) */
134         NM_SETTING_GSM_BAND_U1800        = 0x00000040, /* WCDMA 3GPP UMTS 1800 MHz     (Class III) */
135         NM_SETTING_GSM_BAND_U17IV        = 0x00000080, /* WCDMA 3GPP AWS 1700/2100 MHz (Class IV) */
136         NM_SETTING_GSM_BAND_U800         = 0x00000100, /* WCDMA 3GPP UMTS 800 MHz      (Class VI) */
137         NM_SETTING_GSM_BAND_U850         = 0x00000200, /* WCDMA 3GPP UMTS 850 MHz      (Class V) */
138         NM_SETTING_GSM_BAND_U900         = 0x00000400, /* WCDMA 3GPP UMTS 900 MHz      (Class VIII) */
139         NM_SETTING_GSM_BAND_U17IX        = 0x00000800, /* WCDMA 3GPP UMTS 1700 MHz     (Class IX) */
140         NM_SETTING_GSM_BAND_U1900        = 0x00001000, /* WCDMA 3GPP UMTS 1900 MHz     (Class II) */
141         NM_SETTING_GSM_BAND_U2600        = 0x00002000, /* WCDMA 3GPP UMTS 2600 MHz     (Class VII, internal) */
142 } NMSettingGsmNetworkBand;
143
144 /**
145  * NM_SETTING_GSM_BANDS_MAX:
146  *
147  * #NM_SETTING_GSM_BANDS_MAX macro indicate the maximal value that can be used
148  * as the allowed frequency bands (#NMSettingGsm:allowed-bands property).
149  *
150  * Deprecated: 0.9.10: No longer used.
151  */
152 #define NM_SETTING_GSM_BANDS_MAX (  NM_SETTING_GSM_BAND_UNKNOWN \
153                                   | NM_SETTING_GSM_BAND_ANY \
154                                   | NM_SETTING_GSM_BAND_EGSM \
155                                   | NM_SETTING_GSM_BAND_DCS \
156                                   | NM_SETTING_GSM_BAND_PCS \
157                                   | NM_SETTING_GSM_BAND_G850 \
158                                   | NM_SETTING_GSM_BAND_U2100 \
159                                   | NM_SETTING_GSM_BAND_U1800 \
160                                   | NM_SETTING_GSM_BAND_U17IV \
161                                   | NM_SETTING_GSM_BAND_U800 \
162                                   | NM_SETTING_GSM_BAND_U850 \
163                                   | NM_SETTING_GSM_BAND_U900 \
164                                   | NM_SETTING_GSM_BAND_U17IX \
165                                   | NM_SETTING_GSM_BAND_U1900 \
166                                   | NM_SETTING_GSM_BAND_U2600)
167
168 typedef struct {
169         NMSetting parent;
170 } NMSettingGsm;
171
172 typedef struct {
173         NMSettingClass parent;
174
175         /* Padding for future expansion */
176         void (*_reserved1) (void);
177         void (*_reserved2) (void);
178         void (*_reserved3) (void);
179         void (*_reserved4) (void);
180 } NMSettingGsmClass;
181
182 GType nm_setting_gsm_get_type (void);
183
184 NMSetting *nm_setting_gsm_new                (void);
185 const char *nm_setting_gsm_get_number        (NMSettingGsm *setting);
186 const char *nm_setting_gsm_get_username      (NMSettingGsm *setting);
187 const char *nm_setting_gsm_get_password      (NMSettingGsm *setting);
188 const char *nm_setting_gsm_get_apn           (NMSettingGsm *setting);
189 const char *nm_setting_gsm_get_network_id    (NMSettingGsm *setting);
190 const char *nm_setting_gsm_get_pin           (NMSettingGsm *setting);
191 gboolean    nm_setting_gsm_get_home_only     (NMSettingGsm *setting);
192
193 NMSettingSecretFlags nm_setting_gsm_get_pin_flags      (NMSettingGsm *setting);
194 NMSettingSecretFlags nm_setting_gsm_get_password_flags (NMSettingGsm *setting);
195
196 /* Deprecated */
197 NM_DEPRECATED_IN_0_9_10
198 int     nm_setting_gsm_get_network_type  (NMSettingGsm *setting);
199 NM_DEPRECATED_IN_0_9_10
200 guint32 nm_setting_gsm_get_allowed_bands (NMSettingGsm *setting);
201
202 G_END_DECLS
203
204 #endif /* NM_SETTING_GSM_H */