1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | /* |
3 | * Copyright (C) 2015 Red Hat, Inc. |
4 | */ |
5 | |
6 | #ifndef __NM_SETTING_TUN_H__ |
7 | #define __NM_SETTING_TUN_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_TUN (nm_setting_tun_get_type()) |
18 | #define NM_SETTING_TUN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_TUN, NMSettingTun)) |
19 | #define NM_SETTING_TUN_CLASS(klass) \ |
20 | (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_TUNCONFIG, NMSettingTunClass)) |
21 | #define NM_IS_SETTING_TUN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_TUN)) |
22 | #define NM_IS_SETTING_TUN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_TUN)) |
23 | #define NM_SETTING_TUN_GET_CLASS(obj) \ |
24 | (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_TUN, NMSettingTunClass)) |
25 | |
26 | #define NM_SETTING_TUN_SETTING_NAME "tun" |
27 | |
28 | #define NM_SETTING_TUN_MODE "mode" |
29 | #define NM_SETTING_TUN_OWNER "owner" |
30 | #define NM_SETTING_TUN_GROUP "group" |
31 | #define NM_SETTING_TUN_PI "pi" |
32 | #define NM_SETTING_TUN_VNET_HDR "vnet-hdr" |
33 | #define NM_SETTING_TUN_MULTI_QUEUE "multi-queue" |
34 | |
35 | /** |
36 | * NMSettingTunMode: |
37 | * @NM_SETTING_TUN_MODE_UNKNOWN: an unknown device type |
38 | * @NM_SETTING_TUN_MODE_TUN: a TUN device |
39 | * @NM_SETTING_TUN_MODE_TAP: a TAP device |
40 | * |
41 | * #NMSettingTunMode values indicate the device type (TUN/TAP) |
42 | */ |
43 | typedef enum { |
44 | NM_SETTING_TUN_MODE_UNKNOWN = 0, |
45 | NM_SETTING_TUN_MODE_TUN = 1, |
46 | NM_SETTING_TUN_MODE_TAP = 2, |
47 | } NMSettingTunMode; |
48 | |
49 | typedef struct _NMSettingTunClass NMSettingTunClass; |
50 | |
51 | NM_AVAILABLE_IN_1_2 |
52 | GType nm_setting_tun_get_type(void); |
53 | NM_AVAILABLE_IN_1_2 |
54 | NMSetting *nm_setting_tun_new(void); |
55 | |
56 | NM_AVAILABLE_IN_1_2 |
57 | NMSettingTunMode nm_setting_tun_get_mode(NMSettingTun *setting); |
58 | NM_AVAILABLE_IN_1_2 |
59 | const char *nm_setting_tun_get_owner(NMSettingTun *setting); |
60 | NM_AVAILABLE_IN_1_2 |
61 | const char *nm_setting_tun_get_group(NMSettingTun *setting); |
62 | NM_AVAILABLE_IN_1_2 |
63 | gboolean nm_setting_tun_get_pi(NMSettingTun *setting); |
64 | NM_AVAILABLE_IN_1_2 |
65 | gboolean nm_setting_tun_get_vnet_hdr(NMSettingTun *setting); |
66 | NM_AVAILABLE_IN_1_2 |
67 | gboolean nm_setting_tun_get_multi_queue(NMSettingTun *setting); |
68 | |
69 | G_END_DECLS |
70 | |
71 | #endif /* __NM_SETTING_TUN_H__ */ |
72 | |