1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2011 - 2013 Red Hat, Inc.
4 */
5
6#ifndef __NM_SETTING_BOND_H__
7#define __NM_SETTING_BOND_H__
8
9#if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION)
10#error "Only <NetworkManager.h> can be included directly."
11#endif
12
13#include "nm-setting.h"
14
15G_BEGIN_DECLS
16
17#define NM_TYPE_SETTING_BOND (nm_setting_bond_get_type())
18#define NM_SETTING_BOND(obj) \
19 (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_BOND, NMSettingBond))
20#define NM_SETTING_BOND_CLASS(klass) \
21 (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_BOND, NMSettingBondClass))
22#define NM_IS_SETTING_BOND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_BOND))
23#define NM_IS_SETTING_BOND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_BOND))
24#define NM_SETTING_BOND_GET_CLASS(obj) \
25 (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_BOND, NMSettingBondClass))
26
27#define NM_SETTING_BOND_SETTING_NAME "bond"
28
29#define NM_SETTING_BOND_OPTIONS "options"
30
31/* Valid options for the 'options' property */
32#define NM_SETTING_BOND_OPTION_MODE "mode"
33#define NM_SETTING_BOND_OPTION_MIIMON "miimon"
34#define NM_SETTING_BOND_OPTION_DOWNDELAY "downdelay"
35#define NM_SETTING_BOND_OPTION_UPDELAY "updelay"
36#define NM_SETTING_BOND_OPTION_ARP_INTERVAL "arp_interval"
37#define NM_SETTING_BOND_OPTION_ARP_IP_TARGET "arp_ip_target"
38#define NM_SETTING_BOND_OPTION_ARP_VALIDATE "arp_validate"
39#define NM_SETTING_BOND_OPTION_PRIMARY "primary"
40#define NM_SETTING_BOND_OPTION_BALANCE_SLB "balance-slb"
41#define NM_SETTING_BOND_OPTION_PRIMARY_RESELECT "primary_reselect"
42#define NM_SETTING_BOND_OPTION_FAIL_OVER_MAC "fail_over_mac"
43#define NM_SETTING_BOND_OPTION_USE_CARRIER "use_carrier"
44#define NM_SETTING_BOND_OPTION_AD_SELECT "ad_select"
45#define NM_SETTING_BOND_OPTION_XMIT_HASH_POLICY "xmit_hash_policy"
46#define NM_SETTING_BOND_OPTION_RESEND_IGMP "resend_igmp"
47#define NM_SETTING_BOND_OPTION_LACP_RATE "lacp_rate"
48#define NM_SETTING_BOND_OPTION_ACTIVE_SLAVE "active_slave"
49#define NM_SETTING_BOND_OPTION_AD_ACTOR_SYS_PRIO "ad_actor_sys_prio"
50#define NM_SETTING_BOND_OPTION_AD_ACTOR_SYSTEM "ad_actor_system"
51#define NM_SETTING_BOND_OPTION_AD_USER_PORT_KEY "ad_user_port_key"
52#define NM_SETTING_BOND_OPTION_ALL_SLAVES_ACTIVE "all_slaves_active"
53#define NM_SETTING_BOND_OPTION_ARP_ALL_TARGETS "arp_all_targets"
54#define NM_SETTING_BOND_OPTION_MIN_LINKS "min_links"
55#define NM_SETTING_BOND_OPTION_NUM_GRAT_ARP "num_grat_arp"
56#define NM_SETTING_BOND_OPTION_NUM_UNSOL_NA "num_unsol_na"
57#define NM_SETTING_BOND_OPTION_PACKETS_PER_SLAVE "packets_per_slave"
58#define NM_SETTING_BOND_OPTION_TLB_DYNAMIC_LB "tlb_dynamic_lb"
59#define NM_SETTING_BOND_OPTION_LP_INTERVAL "lp_interval"
60#define NM_SETTING_BOND_OPTION_PEER_NOTIF_DELAY "peer_notif_delay"
61#define NM_SETTING_BOND_OPTION_ARP_MISSED_MAX "arp_missed_max"
62#define NM_SETTING_BOND_OPTION_LACP_ACTIVE "lacp_active"
63#define NM_SETTING_BOND_OPTION_NS_IP6_TARGET "ns_ip6_target"
64
65typedef struct _NMSettingBondClass NMSettingBondClass;
66
67GType nm_setting_bond_get_type(void);
68
69NMSetting *nm_setting_bond_new(void);
70guint32 nm_setting_bond_get_num_options(NMSettingBond *setting);
71gboolean nm_setting_bond_get_option(NMSettingBond *setting,
72 guint32 idx,
73 const char **out_name,
74 const char **out_value);
75const char *nm_setting_bond_get_option_by_name(NMSettingBond *setting, const char *name);
76gboolean nm_setting_bond_add_option(NMSettingBond *setting, const char *name, const char *value);
77gboolean nm_setting_bond_remove_option(NMSettingBond *setting, const char *name);
78
79gboolean nm_setting_bond_validate_option(const char *name, const char *value);
80
81const char **nm_setting_bond_get_valid_options(NMSettingBond *setting);
82
83const char *nm_setting_bond_get_option_default(NMSettingBond *setting, const char *name);
84
85NM_AVAILABLE_IN_1_24
86const char *nm_setting_bond_get_option_normalized(NMSettingBond *setting, const char *name);
87
88G_END_DECLS
89
90#endif /* __NM_SETTING_BOND_H__ */
91

source code of include/libnm/nm-setting-bond.h