device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-util / nm-setting-wired.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 - 2014 Red Hat, Inc.
20  * Copyright 2007 - 2008 Novell, Inc.
21  */
22
23 #ifndef NM_SETTING_WIRED_H
24 #define NM_SETTING_WIRED_H
25
26 #include <nm-setting.h>
27
28 G_BEGIN_DECLS
29
30 #define NM_TYPE_SETTING_WIRED            (nm_setting_wired_get_type ())
31 #define NM_SETTING_WIRED(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_WIRED, NMSettingWired))
32 #define NM_SETTING_WIRED_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_WIRED, NMSettingWiredClass))
33 #define NM_IS_SETTING_WIRED(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_WIRED))
34 #define NM_IS_SETTING_WIRED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_WIRED))
35 #define NM_SETTING_WIRED_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_WIRED, NMSettingWiredClass))
36
37 #define NM_SETTING_WIRED_SETTING_NAME "802-3-ethernet"
38
39 /**
40  * NMSettingWiredError:
41  * @NM_SETTING_WIRED_ERROR_UNKNOWN: unknown or unclassified error
42  * @NM_SETTING_WIRED_ERROR_INVALID_PROPERTY: the property was invalid
43  * @NM_SETTING_WIRED_ERROR_MISSING_PROPERTY: the property was missing and is
44  * required
45  */
46 typedef enum {
47         NM_SETTING_WIRED_ERROR_UNKNOWN = 0,      /*< nick=UnknownError >*/
48         NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, /*< nick=InvalidProperty >*/
49         NM_SETTING_WIRED_ERROR_MISSING_PROPERTY  /*< nick=MissingProperty >*/
50 } NMSettingWiredError;
51
52 #define NM_SETTING_WIRED_ERROR nm_setting_wired_error_quark ()
53 GQuark nm_setting_wired_error_quark (void);
54
55 #define NM_SETTING_WIRED_PORT "port"
56 #define NM_SETTING_WIRED_SPEED "speed"
57 #define NM_SETTING_WIRED_DUPLEX "duplex"
58 #define NM_SETTING_WIRED_AUTO_NEGOTIATE "auto-negotiate"
59 #define NM_SETTING_WIRED_MAC_ADDRESS "mac-address"
60 #define NM_SETTING_WIRED_CLONED_MAC_ADDRESS "cloned-mac-address"
61 #define NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST "mac-address-blacklist"
62 #define NM_SETTING_WIRED_MTU "mtu"
63 #define NM_SETTING_WIRED_S390_SUBCHANNELS "s390-subchannels"
64 #define NM_SETTING_WIRED_S390_NETTYPE "s390-nettype"
65 #define NM_SETTING_WIRED_S390_OPTIONS "s390-options"
66
67 typedef struct {
68         NMSetting parent;
69 } NMSettingWired;
70
71 typedef struct {
72         NMSettingClass parent;
73
74         /* Padding for future expansion */
75         void (*_reserved1) (void);
76         void (*_reserved2) (void);
77         void (*_reserved3) (void);
78         void (*_reserved4) (void);
79 } NMSettingWiredClass;
80
81 GType nm_setting_wired_get_type (void);
82
83 NMSetting *       nm_setting_wired_new                  (void);
84 const char *      nm_setting_wired_get_port             (NMSettingWired *setting);
85 guint32           nm_setting_wired_get_speed            (NMSettingWired *setting);
86 const char *      nm_setting_wired_get_duplex           (NMSettingWired *setting);
87 gboolean          nm_setting_wired_get_auto_negotiate   (NMSettingWired *setting);
88 const GByteArray *nm_setting_wired_get_mac_address      (NMSettingWired *setting);
89 const GByteArray *nm_setting_wired_get_cloned_mac_address (NMSettingWired *setting);
90
91 const GSList     *nm_setting_wired_get_mac_address_blacklist   (NMSettingWired *setting);
92 NM_AVAILABLE_IN_0_9_10
93 guint32           nm_setting_wired_get_num_mac_blacklist_items (NMSettingWired *setting);
94 NM_AVAILABLE_IN_0_9_10
95 const char *      nm_setting_wired_get_mac_blacklist_item      (NMSettingWired *setting,
96                                                                 guint32 idx);
97 NM_AVAILABLE_IN_0_9_10
98 gboolean          nm_setting_wired_add_mac_blacklist_item      (NMSettingWired *setting,
99                                                                 const char *mac);
100 NM_AVAILABLE_IN_0_9_10
101 void              nm_setting_wired_remove_mac_blacklist_item   (NMSettingWired *setting,
102                                                                 guint32 idx);
103 NM_AVAILABLE_IN_0_9_10
104 gboolean          nm_setting_wired_remove_mac_blacklist_item_by_value (NMSettingWired *setting,
105                                                                        const char *mac);
106 NM_AVAILABLE_IN_0_9_10
107 void              nm_setting_wired_clear_mac_blacklist_items   (NMSettingWired *setting);
108
109 guint32           nm_setting_wired_get_mtu              (NMSettingWired *setting);
110
111 const GPtrArray * nm_setting_wired_get_s390_subchannels (NMSettingWired *setting);
112 const char *      nm_setting_wired_get_s390_nettype     (NMSettingWired *setting);
113
114 guint32           nm_setting_wired_get_num_s390_options (NMSettingWired *setting);
115 gboolean          nm_setting_wired_get_s390_option      (NMSettingWired *setting,
116                                                          guint32 idx,
117                                                          const char **out_key,
118                                                          const char **out_value);
119 const char *      nm_setting_wired_get_s390_option_by_key (NMSettingWired *setting,
120                                                            const char *key);
121 gboolean          nm_setting_wired_add_s390_option      (NMSettingWired *setting,
122                                                          const char *key,
123                                                          const char *value);
124 gboolean          nm_setting_wired_remove_s390_option   (NMSettingWired *setting,
125                                                          const char *key);
126 NM_AVAILABLE_IN_0_9_10
127 const char **     nm_setting_wired_get_valid_s390_options (NMSettingWired *setting);
128
129 G_END_DECLS
130
131 #endif /* NM_SETTING_WIRED_H */