device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-util / nm-setting-serial.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 - 2008 Red Hat, Inc.
20  * Copyright 2007 - 2008 Novell, Inc.
21  */
22
23 #ifndef NM_SETTING_SERIAL_H
24 #define NM_SETTING_SERIAL_H
25
26 #include <nm-setting.h>
27
28 G_BEGIN_DECLS
29
30 #define NM_TYPE_SETTING_SERIAL            (nm_setting_serial_get_type ())
31 #define NM_SETTING_SERIAL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_SERIAL, NMSettingSerial))
32 #define NM_SETTING_SERIAL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_SERIAL, NMSettingSerialClass))
33 #define NM_IS_SETTING_SERIAL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_SERIAL))
34 #define NM_IS_SETTING_SERIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_SERIAL))
35 #define NM_SETTING_SERIAL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_SERIAL, NMSettingSerialClass))
36
37 #define NM_SETTING_SERIAL_SETTING_NAME "serial"
38
39 /**
40  * NMSettingSerialError:
41  * @NM_SETTING_SERIAL_ERROR_UNKNOWN: unknown or unclassified error
42  * @NM_SETTING_SERIAL_ERROR_INVALID_PROPERTY: the property was invalid
43  * @NM_SETTING_SERIAL_ERROR_MISSING_PROPERTY: the property was missing and is
44  * required
45  * @NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING: one of the properties of the
46  * setting requires the connection to contain an #NMSettingPPP setting
47  */
48 typedef enum {
49         NM_SETTING_SERIAL_ERROR_UNKNOWN = 0,        /*< nick=UnknownError >*/
50         NM_SETTING_SERIAL_ERROR_INVALID_PROPERTY,   /*< nick=InvalidProperty >*/
51         NM_SETTING_SERIAL_ERROR_MISSING_PROPERTY,   /*< nick=MissingProperty >*/
52         NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING /*< nick=MissingPPPSetting >*/
53 } NMSettingSerialError;
54
55 #define NM_SETTING_SERIAL_ERROR nm_setting_serial_error_quark ()
56 GQuark nm_setting_serial_error_quark (void);
57
58 #define NM_SETTING_SERIAL_BAUD "baud"
59 #define NM_SETTING_SERIAL_BITS "bits"
60 #define NM_SETTING_SERIAL_PARITY "parity"
61 #define NM_SETTING_SERIAL_STOPBITS "stopbits"
62 #define NM_SETTING_SERIAL_SEND_DELAY "send-delay"
63
64 typedef struct {
65         NMSetting parent;
66 } NMSettingSerial;
67
68 typedef struct {
69         NMSettingClass parent;
70
71         /* Padding for future expansion */
72         void (*_reserved1) (void);
73         void (*_reserved2) (void);
74         void (*_reserved3) (void);
75         void (*_reserved4) (void);
76 } NMSettingSerialClass;
77
78 GType nm_setting_serial_get_type (void);
79
80 NMSetting *nm_setting_serial_new            (void);
81 guint      nm_setting_serial_get_baud       (NMSettingSerial *setting);
82 guint      nm_setting_serial_get_bits       (NMSettingSerial *setting);
83 char       nm_setting_serial_get_parity     (NMSettingSerial *setting);
84 guint      nm_setting_serial_get_stopbits   (NMSettingSerial *setting);
85 guint64    nm_setting_serial_get_send_delay (NMSettingSerial *setting);
86
87 G_END_DECLS
88
89 #endif /* NM_SETTING_SERIAL_H */