device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-util / nm-setting-bond.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 - 2013 Red Hat, Inc.
20  */
21
22 #ifndef NM_SETTING_BOND_H
23 #define NM_SETTING_BOND_H
24
25 #include <nm-setting.h>
26
27 G_BEGIN_DECLS
28
29 #define NM_TYPE_SETTING_BOND            (nm_setting_bond_get_type ())
30 #define NM_SETTING_BOND(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_BOND, NMSettingBond))
31 #define NM_SETTING_BOND_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_BOND, NMSettingBondClass))
32 #define NM_IS_SETTING_BOND(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_BOND))
33 #define NM_IS_SETTING_BOND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_BOND))
34 #define NM_SETTING_BOND_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_BOND, NMSettingBondClass))
35
36 #define NM_SETTING_BOND_SETTING_NAME "bond"
37
38 /**
39  * NMSettingBondError:
40  * @NM_SETTING_BOND_ERROR_UNKNOWN: unknown or unclassified error
41  * @NM_SETTING_BOND_ERROR_INVALID_PROPERTY: the property was invalid
42  * @NM_SETTING_BOND_ERROR_MISSING_PROPERTY: the property was missing and is
43  * required
44  */
45 typedef enum {
46         NM_SETTING_BOND_ERROR_UNKNOWN = 0,      /*< nick=UnknownError >*/
47         NM_SETTING_BOND_ERROR_INVALID_PROPERTY, /*< nick=InvalidProperty >*/
48         NM_SETTING_BOND_ERROR_MISSING_PROPERTY, /*< nick=MissingProperty >*/
49         NM_SETTING_BOND_ERROR_INVALID_OPTION,   /*< nick=InvalidOption >*/
50         NM_SETTING_BOND_ERROR_MISSING_OPTION,   /*< nick=MissingOption >*/
51 } NMSettingBondError;
52
53 #define NM_SETTING_BOND_ERROR nm_setting_bond_error_quark ()
54 GQuark nm_setting_bond_error_quark (void);
55
56 #define NM_SETTING_BOND_INTERFACE_NAME "interface-name"
57 #define NM_SETTING_BOND_OPTIONS "options"
58
59 /* Valid options for the 'options' property */
60 #define NM_SETTING_BOND_OPTION_MODE             "mode"
61 #define NM_SETTING_BOND_OPTION_MIIMON           "miimon"
62 #define NM_SETTING_BOND_OPTION_DOWNDELAY        "downdelay"
63 #define NM_SETTING_BOND_OPTION_UPDELAY          "updelay"
64 #define NM_SETTING_BOND_OPTION_ARP_INTERVAL     "arp_interval"
65 #define NM_SETTING_BOND_OPTION_ARP_IP_TARGET    "arp_ip_target"
66 #define NM_SETTING_BOND_OPTION_ARP_VALIDATE     "arp_validate"
67 #define NM_SETTING_BOND_OPTION_PRIMARY          "primary"
68 #define NM_SETTING_BOND_OPTION_PRIMARY_RESELECT "primary_reselect"
69 #define NM_SETTING_BOND_OPTION_FAIL_OVER_MAC    "fail_over_mac"
70 #define NM_SETTING_BOND_OPTION_USE_CARRIER      "use_carrier"
71 #define NM_SETTING_BOND_OPTION_AD_SELECT        "ad_select"
72 #define NM_SETTING_BOND_OPTION_XMIT_HASH_POLICY "xmit_hash_policy"
73 #define NM_SETTING_BOND_OPTION_RESEND_IGMP      "resend_igmp"
74 #define NM_SETTING_BOND_OPTION_LACP_RATE        "lacp_rate"
75
76 typedef struct {
77         NMSetting parent;
78 } NMSettingBond;
79
80 typedef struct {
81         NMSettingClass parent;
82
83         /* Padding for future expansion */
84         void (*_reserved1) (void);
85         void (*_reserved2) (void);
86         void (*_reserved3) (void);
87         void (*_reserved4) (void);
88 } NMSettingBondClass;
89
90 GType nm_setting_bond_get_type (void);
91
92 NMSetting *  nm_setting_bond_new                (void);
93 const char * nm_setting_bond_get_interface_name (NMSettingBond *setting);
94 guint32      nm_setting_bond_get_num_options    (NMSettingBond *setting);
95 gboolean     nm_setting_bond_get_option         (NMSettingBond *setting,
96                                                  guint32 idx,
97                                                  const char **out_name,
98                                                  const char **out_value);
99 const char * nm_setting_bond_get_option_by_name (NMSettingBond *setting,
100                                                  const char *name);
101 gboolean     nm_setting_bond_add_option         (NMSettingBond *setting,
102                                                  const char *name,
103                                                  const char *value);
104 gboolean     nm_setting_bond_remove_option      (NMSettingBond *setting,
105                                                  const char *name);
106
107 NM_AVAILABLE_IN_0_9_10
108 gboolean     nm_setting_bond_validate_option    (const char *name,
109                                                  const char *value);
110
111 const char **nm_setting_bond_get_valid_options  (NMSettingBond *setting);
112
113 const char * nm_setting_bond_get_option_default (NMSettingBond *setting,
114                                                  const char *name);
115
116 G_END_DECLS
117
118 #endif /* NM_SETTING_BOND_H */