device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-core / 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 #if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
27 #error "Only <NetworkManager.h> can be included directly."
28 #endif
29
30 #include <nm-setting.h>
31
32 G_BEGIN_DECLS
33
34 #define NM_TYPE_SETTING_SERIAL            (nm_setting_serial_get_type ())
35 #define NM_SETTING_SERIAL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_SERIAL, NMSettingSerial))
36 #define NM_SETTING_SERIAL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_SERIAL, NMSettingSerialClass))
37 #define NM_IS_SETTING_SERIAL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_SERIAL))
38 #define NM_IS_SETTING_SERIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_SERIAL))
39 #define NM_SETTING_SERIAL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_SERIAL, NMSettingSerialClass))
40
41 #define NM_SETTING_SERIAL_SETTING_NAME "serial"
42
43 /**
44  * NMSettingSerialParity:
45  * @NM_SETTING_SERIAL_PARITY_NONE: No parity bits (default)
46  * @NM_SETTING_SERIAL_PARITY_EVEN: Even parity
47  * @NM_SETTING_SERIAL_PARITY_ODD: Odd parity
48  *
49  * The parity setting of a serial port.
50  */
51 typedef enum {
52         NM_SETTING_SERIAL_PARITY_NONE = 0,
53         NM_SETTING_SERIAL_PARITY_EVEN,
54         NM_SETTING_SERIAL_PARITY_ODD
55 } NMSettingSerialParity;
56
57 #define NM_SETTING_SERIAL_BAUD "baud"
58 #define NM_SETTING_SERIAL_BITS "bits"
59 #define NM_SETTING_SERIAL_PARITY "parity"
60 #define NM_SETTING_SERIAL_STOPBITS "stopbits"
61 #define NM_SETTING_SERIAL_SEND_DELAY "send-delay"
62
63 struct _NMSettingSerial {
64         NMSetting parent;
65 };
66
67 typedef struct {
68         NMSettingClass parent;
69
70         /*< private >*/
71         gpointer padding[4];
72 } NMSettingSerialClass;
73
74 GType nm_setting_serial_get_type (void);
75
76 NMSetting             *nm_setting_serial_new            (void);
77 guint                  nm_setting_serial_get_baud       (NMSettingSerial *setting);
78 guint                  nm_setting_serial_get_bits       (NMSettingSerial *setting);
79 NMSettingSerialParity  nm_setting_serial_get_parity     (NMSettingSerial *setting);
80 guint                  nm_setting_serial_get_stopbits   (NMSettingSerial *setting);
81 guint64                nm_setting_serial_get_send_delay (NMSettingSerial *setting);
82
83 G_END_DECLS
84
85 #endif /* __NM_SETTING_SERIAL_H__ */