device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-util / nm-setting-bridge.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 2011 - 2012 Red Hat, Inc.
20  */
21
22 #ifndef NM_SETTING_BRIDGE_H
23 #define NM_SETTING_BRIDGE_H
24
25 #include <nm-setting.h>
26
27 G_BEGIN_DECLS
28
29 #define NM_TYPE_SETTING_BRIDGE            (nm_setting_bridge_get_type ())
30 #define NM_SETTING_BRIDGE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_BRIDGE, NMSettingBridge))
31 #define NM_SETTING_BRIDGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_BRIDGE, NMSettingBridgeClass))
32 #define NM_IS_SETTING_BRIDGE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_BRIDGE))
33 #define NM_IS_SETTING_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_BRIDGE))
34 #define NM_SETTING_BRIDGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_BRIDGE, NMSettingBridgeClass))
35
36 #define NM_SETTING_BRIDGE_SETTING_NAME "bridge"
37
38 /**
39  * NMSettingBridgeError:
40  * @NM_SETTING_BRIDGE_ERROR_UNKNOWN: unknown or unclassified error
41  * @NM_SETTING_BRIDGE_ERROR_INVALID_PROPERTY: the property was invalid
42  * @NM_SETTING_BRIDGE_ERROR_MISSING_PROPERTY: the property was missing and is
43  * required
44  *
45  * Since: 0.9.8
46  */
47 typedef enum {
48         NM_SETTING_BRIDGE_ERROR_UNKNOWN = 0,      /*< nick=UnknownError >*/
49         NM_SETTING_BRIDGE_ERROR_INVALID_PROPERTY, /*< nick=InvalidProperty >*/
50         NM_SETTING_BRIDGE_ERROR_MISSING_PROPERTY, /*< nick=MissingProperty >*/
51 } NMSettingBridgeError;
52
53 #define NM_SETTING_BRIDGE_ERROR nm_setting_bridge_error_quark ()
54 GQuark nm_setting_bridge_error_quark (void);
55
56 #define NM_SETTING_BRIDGE_INTERFACE_NAME "interface-name"
57 #define NM_SETTING_BRIDGE_MAC_ADDRESS    "mac-address"
58 #define NM_SETTING_BRIDGE_STP            "stp"
59 #define NM_SETTING_BRIDGE_PRIORITY       "priority"
60 #define NM_SETTING_BRIDGE_FORWARD_DELAY  "forward-delay"
61 #define NM_SETTING_BRIDGE_HELLO_TIME     "hello-time"
62 #define NM_SETTING_BRIDGE_MAX_AGE        "max-age"
63 #define NM_SETTING_BRIDGE_AGEING_TIME    "ageing-time"
64
65 typedef struct {
66         NMSetting parent;
67 } NMSettingBridge;
68
69 typedef struct {
70         NMSettingClass parent;
71
72         /* Padding for future expansion */
73         void (*_reserved1) (void);
74         void (*_reserved2) (void);
75         void (*_reserved3) (void);
76         void (*_reserved4) (void);
77 } NMSettingBridgeClass;
78
79 GType nm_setting_bridge_get_type (void);
80
81 NMSetting *  nm_setting_bridge_new                (void);
82
83 const char * nm_setting_bridge_get_interface_name (NMSettingBridge *setting);
84
85 NM_AVAILABLE_IN_0_9_10
86 const GByteArray *nm_setting_bridge_get_mac_address (NMSettingBridge *setting);
87
88 gboolean     nm_setting_bridge_get_stp            (NMSettingBridge *setting);
89
90 guint16      nm_setting_bridge_get_priority       (NMSettingBridge *setting);
91
92 guint16      nm_setting_bridge_get_forward_delay  (NMSettingBridge *setting);
93
94 guint16      nm_setting_bridge_get_hello_time     (NMSettingBridge *setting);
95
96 guint16      nm_setting_bridge_get_max_age        (NMSettingBridge *setting);
97
98 guint32      nm_setting_bridge_get_ageing_time    (NMSettingBridge *setting);
99
100 G_END_DECLS
101
102 #endif /* NM_SETTING_BRIDGE_H */