1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | /* |
3 | * Copyright (C) 2011 - 2015 Red Hat, Inc. |
4 | */ |
5 | |
6 | #ifndef __NM_SETTING_BRIDGE_H__ |
7 | #define __NM_SETTING_BRIDGE_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 | |
15 | G_BEGIN_DECLS |
16 | |
17 | #define NM_TYPE_SETTING_BRIDGE (nm_setting_bridge_get_type()) |
18 | #define NM_SETTING_BRIDGE(obj) \ |
19 | (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_BRIDGE, NMSettingBridge)) |
20 | #define NM_SETTING_BRIDGE_CLASS(klass) \ |
21 | (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_BRIDGE, NMSettingBridgeClass)) |
22 | #define NM_IS_SETTING_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_BRIDGE)) |
23 | #define NM_IS_SETTING_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_BRIDGE)) |
24 | #define NM_SETTING_BRIDGE_GET_CLASS(obj) \ |
25 | (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_BRIDGE, NMSettingBridgeClass)) |
26 | |
27 | #define NM_SETTING_BRIDGE_SETTING_NAME "bridge" |
28 | |
29 | #define NM_SETTING_BRIDGE_MAC_ADDRESS "mac-address" |
30 | #define NM_SETTING_BRIDGE_STP "stp" |
31 | #define NM_SETTING_BRIDGE_PRIORITY "priority" |
32 | #define NM_SETTING_BRIDGE_FORWARD_DELAY "forward-delay" |
33 | #define NM_SETTING_BRIDGE_HELLO_TIME "hello-time" |
34 | #define NM_SETTING_BRIDGE_MAX_AGE "max-age" |
35 | #define NM_SETTING_BRIDGE_AGEING_TIME "ageing-time" |
36 | #define NM_SETTING_BRIDGE_GROUP_FORWARD_MASK "group-forward-mask" |
37 | #define NM_SETTING_BRIDGE_MULTICAST_HASH_MAX "multicast-hash-max" |
38 | #define NM_SETTING_BRIDGE_MULTICAST_LAST_MEMBER_COUNT "multicast-last-member-count" |
39 | #define NM_SETTING_BRIDGE_MULTICAST_LAST_MEMBER_INTERVAL "multicast-last-member-interval" |
40 | #define NM_SETTING_BRIDGE_MULTICAST_MEMBERSHIP_INTERVAL "multicast-membership-interval" |
41 | #define NM_SETTING_BRIDGE_MULTICAST_SNOOPING "multicast-snooping" |
42 | #define NM_SETTING_BRIDGE_MULTICAST_ROUTER "multicast-router" |
43 | #define NM_SETTING_BRIDGE_MULTICAST_QUERIER "multicast-querier" |
44 | #define NM_SETTING_BRIDGE_MULTICAST_QUERIER_INTERVAL "multicast-querier-interval" |
45 | #define NM_SETTING_BRIDGE_MULTICAST_QUERY_INTERVAL "multicast-query-interval" |
46 | #define NM_SETTING_BRIDGE_MULTICAST_QUERY_RESPONSE_INTERVAL "multicast-query-response-interval" |
47 | #define NM_SETTING_BRIDGE_MULTICAST_QUERY_USE_IFADDR "multicast-query-use-ifaddr" |
48 | #define NM_SETTING_BRIDGE_MULTICAST_STARTUP_QUERY_COUNT "multicast-startup-query-count" |
49 | #define NM_SETTING_BRIDGE_MULTICAST_STARTUP_QUERY_INTERVAL "multicast-startup-query-interval" |
50 | #define NM_SETTING_BRIDGE_VLAN_FILTERING "vlan-filtering" |
51 | #define NM_SETTING_BRIDGE_VLAN_DEFAULT_PVID "vlan-default-pvid" |
52 | #define NM_SETTING_BRIDGE_VLANS "vlans" |
53 | #define NM_SETTING_BRIDGE_GROUP_ADDRESS "group-address" |
54 | #define NM_SETTING_BRIDGE_VLAN_PROTOCOL "vlan-protocol" |
55 | #define NM_SETTING_BRIDGE_VLAN_STATS_ENABLED "vlan-stats-enabled" |
56 | |
57 | #define NM_BRIDGE_VLAN_VID_MIN 1 |
58 | #define NM_BRIDGE_VLAN_VID_MAX 4094 |
59 | |
60 | typedef struct _NMSettingBridgeClass NMSettingBridgeClass; |
61 | |
62 | typedef struct _NMBridgeVlan NMBridgeVlan; |
63 | |
64 | GType nm_setting_bridge_get_type(void); |
65 | |
66 | NMSetting *nm_setting_bridge_new(void); |
67 | |
68 | const char *nm_setting_bridge_get_mac_address(NMSettingBridge *setting); |
69 | |
70 | gboolean nm_setting_bridge_get_stp(NMSettingBridge *setting); |
71 | |
72 | guint16 nm_setting_bridge_get_priority(NMSettingBridge *setting); |
73 | |
74 | guint16 nm_setting_bridge_get_forward_delay(NMSettingBridge *setting); |
75 | |
76 | guint16 nm_setting_bridge_get_hello_time(NMSettingBridge *setting); |
77 | |
78 | guint16 nm_setting_bridge_get_max_age(NMSettingBridge *setting); |
79 | |
80 | guint32 nm_setting_bridge_get_ageing_time(NMSettingBridge *setting); |
81 | NM_AVAILABLE_IN_1_10 |
82 | guint16 nm_setting_bridge_get_group_forward_mask(NMSettingBridge *setting); |
83 | |
84 | gboolean nm_setting_bridge_get_multicast_snooping(NMSettingBridge *setting); |
85 | NM_AVAILABLE_IN_1_18 |
86 | gboolean nm_setting_bridge_get_vlan_filtering(NMSettingBridge *setting); |
87 | NM_AVAILABLE_IN_1_18 |
88 | guint16 nm_setting_bridge_get_vlan_default_pvid(NMSettingBridge *setting); |
89 | NM_AVAILABLE_IN_1_18 |
90 | void nm_setting_bridge_add_vlan(NMSettingBridge *setting, NMBridgeVlan *vlan); |
91 | NM_AVAILABLE_IN_1_18 |
92 | guint nm_setting_bridge_get_num_vlans(NMSettingBridge *setting); |
93 | NM_AVAILABLE_IN_1_18 |
94 | NMBridgeVlan *nm_setting_bridge_get_vlan(NMSettingBridge *setting, guint idx); |
95 | NM_AVAILABLE_IN_1_18 |
96 | void nm_setting_bridge_remove_vlan(NMSettingBridge *setting, guint idx); |
97 | NM_AVAILABLE_IN_1_18 |
98 | gboolean |
99 | nm_setting_bridge_remove_vlan_by_vid(NMSettingBridge *setting, guint16 vid_start, guint16 vid_end); |
100 | NM_AVAILABLE_IN_1_18 |
101 | void nm_setting_bridge_clear_vlans(NMSettingBridge *setting); |
102 | |
103 | NM_AVAILABLE_IN_1_18 |
104 | GType nm_bridge_vlan_get_type(void); |
105 | NM_AVAILABLE_IN_1_18 |
106 | NMBridgeVlan *nm_bridge_vlan_new(guint16 vid_start, guint16 vid_end); |
107 | NM_AVAILABLE_IN_1_18 |
108 | NMBridgeVlan *nm_bridge_vlan_ref(NMBridgeVlan *vlan); |
109 | NM_AVAILABLE_IN_1_18 |
110 | void nm_bridge_vlan_unref(NMBridgeVlan *vlan); |
111 | NM_AVAILABLE_IN_1_18 |
112 | NMBridgeVlan *nm_bridge_vlan_new_clone(const NMBridgeVlan *vlan); |
113 | NM_AVAILABLE_IN_1_18 |
114 | int nm_bridge_vlan_cmp(const NMBridgeVlan *a, const NMBridgeVlan *b); |
115 | NM_AVAILABLE_IN_1_18 |
116 | void nm_bridge_vlan_seal(NMBridgeVlan *vlan); |
117 | NM_AVAILABLE_IN_1_18 |
118 | gboolean nm_bridge_vlan_is_sealed(const NMBridgeVlan *vlan); |
119 | NM_AVAILABLE_IN_1_18 |
120 | void nm_bridge_vlan_set_untagged(NMBridgeVlan *vlan, gboolean value); |
121 | NM_AVAILABLE_IN_1_18 |
122 | void nm_bridge_vlan_set_pvid(NMBridgeVlan *vlan, gboolean value); |
123 | NM_AVAILABLE_IN_1_18 |
124 | gboolean |
125 | nm_bridge_vlan_get_vid_range(const NMBridgeVlan *vlan, guint16 *vid_start, guint16 *vid_end); |
126 | NM_AVAILABLE_IN_1_18 |
127 | gboolean nm_bridge_vlan_is_untagged(const NMBridgeVlan *vlan); |
128 | NM_AVAILABLE_IN_1_18 |
129 | gboolean nm_bridge_vlan_is_pvid(const NMBridgeVlan *vlan); |
130 | |
131 | NM_AVAILABLE_IN_1_18 |
132 | char *nm_bridge_vlan_to_str(const NMBridgeVlan *vlan, GError **error); |
133 | NM_AVAILABLE_IN_1_18 |
134 | NMBridgeVlan *nm_bridge_vlan_from_str(const char *str, GError **error); |
135 | |
136 | NM_AVAILABLE_IN_1_24 |
137 | const char *nm_setting_bridge_get_group_address(const NMSettingBridge *setting); |
138 | |
139 | NM_AVAILABLE_IN_1_24 |
140 | const char *nm_setting_bridge_get_vlan_protocol(const NMSettingBridge *setting); |
141 | |
142 | NM_AVAILABLE_IN_1_24 |
143 | gboolean nm_setting_bridge_get_vlan_stats_enabled(const NMSettingBridge *setting); |
144 | |
145 | NM_AVAILABLE_IN_1_24 |
146 | const char *nm_setting_bridge_get_multicast_router(const NMSettingBridge *setting); |
147 | |
148 | NM_AVAILABLE_IN_1_24 |
149 | gboolean nm_setting_bridge_get_multicast_query_use_ifaddr(const NMSettingBridge *setting); |
150 | |
151 | NM_AVAILABLE_IN_1_24 |
152 | gboolean nm_setting_bridge_get_multicast_querier(const NMSettingBridge *setting); |
153 | |
154 | NM_AVAILABLE_IN_1_26 |
155 | guint32 nm_setting_bridge_get_multicast_hash_max(const NMSettingBridge *setting); |
156 | |
157 | NM_AVAILABLE_IN_1_26 |
158 | guint32 nm_setting_bridge_get_multicast_last_member_count(const NMSettingBridge *setting); |
159 | |
160 | NM_AVAILABLE_IN_1_26 |
161 | guint64 nm_setting_bridge_get_multicast_last_member_interval(const NMSettingBridge *setting); |
162 | |
163 | NM_AVAILABLE_IN_1_26 |
164 | guint64 nm_setting_bridge_get_multicast_membership_interval(const NMSettingBridge *setting); |
165 | |
166 | NM_AVAILABLE_IN_1_26 |
167 | guint64 nm_setting_bridge_get_multicast_querier_interval(const NMSettingBridge *setting); |
168 | |
169 | NM_AVAILABLE_IN_1_26 |
170 | guint64 nm_setting_bridge_get_multicast_query_interval(const NMSettingBridge *setting); |
171 | |
172 | NM_AVAILABLE_IN_1_26 |
173 | guint64 nm_setting_bridge_get_multicast_query_response_interval(const NMSettingBridge *setting); |
174 | |
175 | NM_AVAILABLE_IN_1_26 |
176 | guint32 nm_setting_bridge_get_multicast_startup_query_count(const NMSettingBridge *setting); |
177 | |
178 | NM_AVAILABLE_IN_1_26 |
179 | guint64 nm_setting_bridge_get_multicast_startup_query_interval(const NMSettingBridge *setting); |
180 | |
181 | G_END_DECLS |
182 | |
183 | #endif /* __NM_SETTING_BRIDGE_H__ */ |
184 | |