device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-glib / nm-device-modem.h
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the
15  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  * Boston, MA 02110-1301 USA.
17  *
18  * Copyright 2011 - 2012 Red Hat, Inc.
19  * Copyright 2008 Novell, Inc.
20  */
21
22 #ifndef NM_DEVICE_MODEM_H
23 #define NM_DEVICE_MODEM_H
24
25 #include "nm-device.h"
26
27 G_BEGIN_DECLS
28
29 #define NM_TYPE_DEVICE_MODEM            (nm_device_modem_get_type ())
30 #define NM_DEVICE_MODEM(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_MODEM, NMDeviceModem))
31 #define NM_DEVICE_MODEM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_MODEM, NMDeviceModemClass))
32 #define NM_IS_DEVICE_MODEM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_MODEM))
33 #define NM_IS_DEVICE_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_MODEM))
34 #define NM_DEVICE_MODEM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_MODEM, NMDeviceModemClass))
35
36 /**
37  * NMDeviceModemError:
38  * @NM_DEVICE_MODEM_ERROR_UNKNOWN: unknown or unclassified error
39  * @NM_DEVICE_MODEM_ERROR_NOT_MODEM_CONNECTION: the connection was not of modem type
40  * @NM_DEVICE_MODEM_ERROR_INVALID_MODEM_CONNECTION: the modem connection was invalid
41  * @NM_DEVICE_MODEM_ERROR_MISSING_DEVICE_CAPS: the device missed required capabilities
42  */
43 typedef enum {
44         NM_DEVICE_MODEM_ERROR_UNKNOWN = 0,              /*< nick=UnknownError >*/
45         NM_DEVICE_MODEM_ERROR_NOT_MODEM_CONNECTION,     /*< nick=NotModemConnection >*/
46         NM_DEVICE_MODEM_ERROR_INVALID_MODEM_CONNECTION, /*< nick=InvalidModemConnection >*/
47         NM_DEVICE_MODEM_ERROR_MISSING_DEVICE_CAPS,      /*< nick=MissingDeviceCaps >*/
48 } NMDeviceModemError;
49
50 #define NM_DEVICE_MODEM_ERROR nm_device_modem_error_quark ()
51 GQuark nm_device_modem_error_quark (void);
52
53 #define NM_DEVICE_MODEM_MODEM_CAPABILITIES   "modem-capabilities"
54 #define NM_DEVICE_MODEM_CURRENT_CAPABILITIES "current-capabilities"
55
56 typedef struct {
57         NMDevice parent;
58 } NMDeviceModem;
59
60 typedef struct {
61         NMDeviceClass parent;
62
63         /* Padding for future expansion */
64         void (*_reserved1) (void);
65         void (*_reserved2) (void);
66         void (*_reserved3) (void);
67         void (*_reserved4) (void);
68         void (*_reserved5) (void);
69         void (*_reserved6) (void);
70 } NMDeviceModemClass;
71
72 GType nm_device_modem_get_type (void);
73
74 NMDeviceModemCapabilities nm_device_modem_get_modem_capabilities (NMDeviceModem *self);
75 NMDeviceModemCapabilities nm_device_modem_get_current_capabilities (NMDeviceModem *self);
76
77 G_END_DECLS
78
79 #endif /* NM_DEVICE_MODEM_H */