bond: add some missing options
[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 #define NM_SETTING_BOND_OPTION_ACTIVE_SLAVE      "active_slave"
61 #define NM_SETTING_BOND_OPTION_AD_ACTOR_SYS_PRIO "ad_actor_sys_prio"
62 #define NM_SETTING_BOND_OPTION_AD_ACTOR_SYSTEM   "ad_actor_system"
63 #define NM_SETTING_BOND_OPTION_AD_USER_PORT_KEY  "ad_user_port_key"
64 #define NM_SETTING_BOND_OPTION_ALL_SLAVES_ACTIVE "all_slaves_active"
65 #define NM_SETTING_BOND_OPTION_ARP_ALL_TARGETS   "arp_all_targets"
66 #define NM_SETTING_BOND_OPTION_MIN_LINKS         "min_links"
67 #define NM_SETTING_BOND_OPTION_NUM_GRAT_ARP      "num_grat_arp"
68 #define NM_SETTING_BOND_OPTION_NUM_UNSOL_NA      "num_unsol_na"
69 #define NM_SETTING_BOND_OPTION_PACKETS_PER_SLAVE "packets_per_slave"
70 #define NM_SETTING_BOND_OPTION_TLB_DYNAMIC_LB    "tlb_dynamic_lb"
71 #define NM_SETTING_BOND_OPTION_LP_INTERVAL       "lp_interval"
72
73 struct _NMSettingBond {
74         NMSetting parent;
75 };
76
77 typedef struct {
78         NMSettingClass parent;
79
80         /*< private >*/
81         gpointer padding[4];
82 } NMSettingBondClass;
83
84 GType nm_setting_bond_get_type (void);
85
86 NMSetting *  nm_setting_bond_new                (void);
87 guint32      nm_setting_bond_get_num_options    (NMSettingBond *setting);
88 gboolean     nm_setting_bond_get_option         (NMSettingBond *setting,
89                                                  guint32 idx,
90                                                  const char **out_name,
91                                                  const char **out_value);
92 const char * nm_setting_bond_get_option_by_name (NMSettingBond *setting,
93                                                  const char *name);
94 gboolean     nm_setting_bond_add_option         (NMSettingBond *setting,
95                                                  const char *name,
96                                                  const char *value);
97 gboolean     nm_setting_bond_remove_option      (NMSettingBond *setting,
98                                                  const char *name);
99
100 gboolean     nm_setting_bond_validate_option    (const char *name,
101                                                  const char *value);
102
103 const char **nm_setting_bond_get_valid_options  (NMSettingBond *setting);
104
105 const char * nm_setting_bond_get_option_default (NMSettingBond *setting,
106                                                  const char *name);
107
108 G_END_DECLS
109
110 #endif /* __NM_SETTING_BOND_H__ */