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_PRIMARY_RESELECT "primary_reselect"
41#define NM_SETTING_BOND_OPTION_FAIL_OVER_MAC "fail_over_mac"
42#define NM_SETTING_BOND_OPTION_USE_CARRIER "use_carrier"
43#define NM_SETTING_BOND_OPTION_AD_SELECT "ad_select"
44#define NM_SETTING_BOND_OPTION_XMIT_HASH_POLICY "xmit_hash_policy"
45#define NM_SETTING_BOND_OPTION_RESEND_IGMP "resend_igmp"
46#define NM_SETTING_BOND_OPTION_LACP_RATE "lacp_rate"
47#define NM_SETTING_BOND_OPTION_ACTIVE_SLAVE "active_slave"
48#define NM_SETTING_BOND_OPTION_AD_ACTOR_SYS_PRIO "ad_actor_sys_prio"
49#define NM_SETTING_BOND_OPTION_AD_ACTOR_SYSTEM "ad_actor_system"
50#define NM_SETTING_BOND_OPTION_AD_USER_PORT_KEY "ad_user_port_key"
51#define NM_SETTING_BOND_OPTION_ALL_SLAVES_ACTIVE "all_slaves_active"
52#define NM_SETTING_BOND_OPTION_ARP_ALL_TARGETS "arp_all_targets"
53#define NM_SETTING_BOND_OPTION_MIN_LINKS "min_links"
54#define NM_SETTING_BOND_OPTION_NUM_GRAT_ARP "num_grat_arp"
55#define NM_SETTING_BOND_OPTION_NUM_UNSOL_NA "num_unsol_na"
56#define NM_SETTING_BOND_OPTION_PACKETS_PER_SLAVE "packets_per_slave"
57#define NM_SETTING_BOND_OPTION_TLB_DYNAMIC_LB "tlb_dynamic_lb"
58#define NM_SETTING_BOND_OPTION_LP_INTERVAL "lp_interval"
59#define NM_SETTING_BOND_OPTION_PEER_NOTIF_DELAY "peer_notif_delay"
60
61typedef struct _NMSettingBondClass NMSettingBondClass;
62
63GType nm_setting_bond_get_type(void);
64
65NMSetting *nm_setting_bond_new(void);
66guint32 nm_setting_bond_get_num_options(NMSettingBond *setting);
67gboolean nm_setting_bond_get_option(NMSettingBond *setting,
68 guint32 idx,
69 const char **out_name,
70 const char **out_value);
71const char *nm_setting_bond_get_option_by_name(NMSettingBond *setting, const char *name);
72gboolean nm_setting_bond_add_option(NMSettingBond *setting, const char *name, const char *value);
73gboolean nm_setting_bond_remove_option(NMSettingBond *setting, const char *name);
74
75gboolean nm_setting_bond_validate_option(const char *name, const char *value);
76
77const char **nm_setting_bond_get_valid_options(NMSettingBond *setting);
78
79const char *nm_setting_bond_get_option_default(NMSettingBond *setting, const char *name);
80
81NM_AVAILABLE_IN_1_24
82const char *nm_setting_bond_get_option_normalized(NMSettingBond *setting, const char *name);
83
84G_END_DECLS
85
86#endif /* __NM_SETTING_BOND_H__ */
87

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