1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | /* |
3 | * Copyright (C) 2015 Red Hat, Inc. |
4 | */ |
5 | |
6 | #ifndef __NM_SETTING_MACVLAN_H__ |
7 | #define __NM_SETTING_MACVLAN_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_MACVLAN (nm_setting_macvlan_get_type()) |
18 | #define NM_SETTING_MACVLAN(obj) \ |
19 | (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_MACVLAN, NMSettingMacvlan)) |
20 | #define NM_SETTING_MACVLAN_CLASS(klass) \ |
21 | (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_MACVLANCONFIG, NMSettingMacvlanClass)) |
22 | #define NM_IS_SETTING_MACVLAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_MACVLAN)) |
23 | #define NM_IS_SETTING_MACVLAN_CLASS(klass) \ |
24 | (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_MACVLAN)) |
25 | #define NM_SETTING_MACVLAN_GET_CLASS(obj) \ |
26 | (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_MACVLAN, NMSettingMacvlanClass)) |
27 | |
28 | #define NM_SETTING_MACVLAN_SETTING_NAME "macvlan" |
29 | |
30 | #define NM_SETTING_MACVLAN_PARENT "parent" |
31 | #define NM_SETTING_MACVLAN_MODE "mode" |
32 | #define NM_SETTING_MACVLAN_PROMISCUOUS "promiscuous" |
33 | #define NM_SETTING_MACVLAN_TAP "tap" |
34 | |
35 | typedef struct _NMSettingMacvlanClass NMSettingMacvlanClass; |
36 | |
37 | /** |
38 | * NMSettingMacvlanMode: |
39 | * @NM_SETTING_MACVLAN_MODE_UNKNOWN: unknown/unset mode |
40 | * @NM_SETTING_MACVLAN_MODE_VEPA: Virtual Ethernet Port Aggregator mode |
41 | * @NM_SETTING_MACVLAN_MODE_BRIDGE: bridge mode |
42 | * @NM_SETTING_MACVLAN_MODE_PRIVATE: private mode |
43 | * @NM_SETTING_MACVLAN_MODE_PASSTHRU: passthru mode |
44 | * @NM_SETTING_MACVLAN_MODE_SOURCE: source mode |
45 | **/ |
46 | typedef enum { |
47 | NM_SETTING_MACVLAN_MODE_UNKNOWN = 0, |
48 | NM_SETTING_MACVLAN_MODE_VEPA = 1, |
49 | NM_SETTING_MACVLAN_MODE_BRIDGE = 2, |
50 | NM_SETTING_MACVLAN_MODE_PRIVATE = 3, |
51 | NM_SETTING_MACVLAN_MODE_PASSTHRU = 4, |
52 | NM_SETTING_MACVLAN_MODE_SOURCE = 5, |
53 | _NM_SETTING_MACVLAN_MODE_NUM, /*< skip >*/ |
54 | NM_SETTING_MACVLAN_MODE_LAST = _NM_SETTING_MACVLAN_MODE_NUM - 1, /*< skip >*/ |
55 | } NMSettingMacvlanMode; |
56 | |
57 | NM_AVAILABLE_IN_1_2 |
58 | GType nm_setting_macvlan_get_type(void); |
59 | NM_AVAILABLE_IN_1_2 |
60 | NMSetting *nm_setting_macvlan_new(void); |
61 | |
62 | NM_AVAILABLE_IN_1_2 |
63 | const char *nm_setting_macvlan_get_parent(NMSettingMacvlan *setting); |
64 | NM_AVAILABLE_IN_1_2 |
65 | NMSettingMacvlanMode nm_setting_macvlan_get_mode(NMSettingMacvlan *setting); |
66 | NM_AVAILABLE_IN_1_2 |
67 | gboolean nm_setting_macvlan_get_promiscuous(NMSettingMacvlan *setting); |
68 | NM_AVAILABLE_IN_1_2 |
69 | gboolean nm_setting_macvlan_get_tap(NMSettingMacvlan *setting); |
70 | |
71 | G_END_DECLS |
72 | |
73 | #endif /* __NM_SETTING_MACVLAN_H__ */ |
74 | |