1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | /* |
3 | * Copyright (C) 2012 Red Hat, Inc. |
4 | */ |
5 | |
6 | #ifndef __NM_SETTING_BRIDGE_PORT_H__ |
7 | #define __NM_SETTING_BRIDGE_PORT_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 | #include "nm-setting-bridge.h" |
15 | |
16 | G_BEGIN_DECLS |
17 | |
18 | #define NM_TYPE_SETTING_BRIDGE_PORT (nm_setting_bridge_port_get_type()) |
19 | #define NM_SETTING_BRIDGE_PORT(obj) \ |
20 | (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_BRIDGE_PORT, NMSettingBridgePort)) |
21 | #define NM_SETTING_BRIDGE_PORT_CLASS(klass) \ |
22 | (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_BRIDGE_PORT, NMSettingBridgePortClass)) |
23 | #define NM_IS_SETTING_BRIDGE_PORT(obj) \ |
24 | (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_BRIDGE_PORT)) |
25 | #define NM_IS_SETTING_BRIDGE_PORT_CLASS(klass) \ |
26 | (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_BRIDGE_PORT)) |
27 | #define NM_SETTING_BRIDGE_PORT_GET_CLASS(obj) \ |
28 | (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_BRIDGE_PORT, NMSettingBridgePortClass)) |
29 | |
30 | #define NM_SETTING_BRIDGE_PORT_SETTING_NAME "bridge-port" |
31 | |
32 | #define NM_SETTING_BRIDGE_PORT_PRIORITY "priority" |
33 | #define NM_SETTING_BRIDGE_PORT_PATH_COST "path-cost" |
34 | #define NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE "hairpin-mode" |
35 | #define NM_SETTING_BRIDGE_PORT_VLANS "vlans" |
36 | |
37 | typedef struct _NMSettingBridgePortClass NMSettingBridgePortClass; |
38 | |
39 | GType nm_setting_bridge_port_get_type(void); |
40 | |
41 | NMSetting *nm_setting_bridge_port_new(void); |
42 | |
43 | guint16 nm_setting_bridge_port_get_priority(NMSettingBridgePort *setting); |
44 | |
45 | guint16 nm_setting_bridge_port_get_path_cost(NMSettingBridgePort *setting); |
46 | |
47 | gboolean nm_setting_bridge_port_get_hairpin_mode(NMSettingBridgePort *setting); |
48 | |
49 | NM_AVAILABLE_IN_1_18 |
50 | void nm_setting_bridge_port_add_vlan(NMSettingBridgePort *setting, NMBridgeVlan *vlan); |
51 | NM_AVAILABLE_IN_1_18 |
52 | guint nm_setting_bridge_port_get_num_vlans(NMSettingBridgePort *setting); |
53 | NM_AVAILABLE_IN_1_18 |
54 | NMBridgeVlan *nm_setting_bridge_port_get_vlan(NMSettingBridgePort *setting, guint idx); |
55 | NM_AVAILABLE_IN_1_18 |
56 | void nm_setting_bridge_port_remove_vlan(NMSettingBridgePort *setting, guint idx); |
57 | NM_AVAILABLE_IN_1_18 |
58 | gboolean nm_setting_bridge_port_remove_vlan_by_vid(NMSettingBridgePort *setting, |
59 | guint16 vid_start, |
60 | guint16 vid_end); |
61 | NM_AVAILABLE_IN_1_18 |
62 | void nm_setting_bridge_port_clear_vlans(NMSettingBridgePort *setting); |
63 | |
64 | G_END_DECLS |
65 | |
66 | #endif /* __NM_SETTING_BRIDGE_PORT_H__ */ |
67 | |