055801a59489d929e57ea8355a2ae4a42042836c
[NetworkManager.git] / libnm-core / 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 #if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
26 #error "Only <NetworkManager.h> can be included directly."
27 #endif
28
29 #include <nm-setting.h>
30
31 G_BEGIN_DECLS
32
33 #define NM_TYPE_SETTING_BOND            (nm_setting_bond_get_type ())
34 #define NM_SETTING_BOND(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_BOND, NMSettingBond))
35 #define NM_SETTING_BOND_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_BOND, NMSettingBondClass))
36 #define NM_IS_SETTING_BOND(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_BOND))
37 #define NM_IS_SETTING_BOND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_BOND))
38 #define NM_SETTING_BOND_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_BOND, NMSettingBondClass))
39
40 #define NM_SETTING_BOND_SETTING_NAME "bond"
41
42 #define NM_SETTING_BOND_OPTIONS "options"
43
44 /* Valid options for the 'options' property */
45 #define NM_SETTING_BOND_OPTION_MODE             "mode"
46 #define NM_SETTING_BOND_OPTION_MIIMON           "miimon"
47 #define NM_SETTING_BOND_OPTION_DOWNDELAY        "downdelay"
48 #define NM_SETTING_BOND_OPTION_UPDELAY          "updelay"
49 #define NM_SETTING_BOND_OPTION_ARP_INTERVAL     "arp_interval"
50 #define NM_SETTING_BOND_OPTION_ARP_IP_TARGET    "arp_ip_target"
51 #define NM_SETTING_BOND_OPTION_ARP_VALIDATE     "arp_validate"
52 #define NM_SETTING_BOND_OPTION_PRIMARY          "primary"
53 #define NM_SETTING_BOND_OPTION_PRIMARY_RESELECT "primary_reselect"
54 #define NM_SETTING_BOND_OPTION_FAIL_OVER_MAC    "fail_over_mac"
55 #define NM_SETTING_BOND_OPTION_USE_CARRIER      "use_carrier"
56 #define NM_SETTING_BOND_OPTION_AD_SELECT        "ad_select"
57 #define NM_SETTING_BOND_OPTION_XMIT_HASH_POLICY "xmit_hash_policy"
58 #define NM_SETTING_BOND_OPTION_RESEND_IGMP      "resend_igmp"
59 #define NM_SETTING_BOND_OPTION_LACP_RATE        "lacp_rate"
60
61 struct _NMSettingBond {
62         NMSetting parent;
63 };
64
65 typedef struct {
66         NMSettingClass parent;
67
68         /*< private >*/
69         gpointer padding[4];
70 } NMSettingBondClass;
71
72 GType nm_setting_bond_get_type (void);
73
74 NMSetting *  nm_setting_bond_new                (void);
75 guint32      nm_setting_bond_get_num_options    (NMSettingBond *setting);
76 gboolean     nm_setting_bond_get_option         (NMSettingBond *setting,
77                                                  guint32 idx,
78                                                  const char **out_name,
79                                                  const char **out_value);
80 const char * nm_setting_bond_get_option_by_name (NMSettingBond *setting,
81                                                  const char *name);
82 gboolean     nm_setting_bond_add_option         (NMSettingBond *setting,
83                                                  const char *name,
84                                                  const char *value);
85 gboolean     nm_setting_bond_remove_option      (NMSettingBond *setting,
86                                                  const char *name);
87
88 gboolean     nm_setting_bond_validate_option    (const char *name,
89                                                  const char *value);
90
91 const char **nm_setting_bond_get_valid_options  (NMSettingBond *setting);
92
93 const char * nm_setting_bond_get_option_default (NMSettingBond *setting,
94                                                  const char *name);
95
96 G_END_DECLS
97
98 #endif /* __NM_SETTING_BOND_H__ */