device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-core / nm-setting-tun.h
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
3 /*
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301 USA.
18  *
19  * Copyright 2015 Red Hat, Inc.
20  */
21
22 #ifndef __NM_SETTING_TUN_H__
23 #define __NM_SETTING_TUN_H__
24
25 #if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
26 #error "Only <NetworkManager.h> can be included directly."
27 #endif
28
29 #include "nm-setting.h"
30
31 G_BEGIN_DECLS
32
33 #define NM_TYPE_SETTING_TUN            (nm_setting_tun_get_type ())
34 #define NM_SETTING_TUN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_TUN, NMSettingTun))
35 #define NM_SETTING_TUN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_TUNCONFIG, NMSettingTunClass))
36 #define NM_IS_SETTING_TUN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_TUN))
37 #define NM_IS_SETTING_TUN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_TUN))
38 #define NM_SETTING_TUN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_TUN, NMSettingTunClass))
39
40 #define NM_SETTING_TUN_SETTING_NAME         "tun"
41
42 #define NM_SETTING_TUN_MODE                 "mode"
43 #define NM_SETTING_TUN_OWNER                "owner"
44 #define NM_SETTING_TUN_GROUP                "group"
45 #define NM_SETTING_TUN_PI                   "pi"
46 #define NM_SETTING_TUN_VNET_HDR             "vnet-hdr"
47 #define NM_SETTING_TUN_MULTI_QUEUE          "multi-queue"
48
49 /**
50  * NMSettingTunMode:
51  * @NM_SETTING_TUN_MODE_UNKNOWN: an unknown device type
52  * @NM_SETTING_TUN_MODE_TUN: a TUN device
53  * @NM_SETTING_TUN_MODE_TAP: a TAP device
54  *
55  * #NMSettingTunMode values indicate the device type (TUN/TAP)
56  */
57 typedef enum {
58         NM_SETTING_TUN_MODE_UNKNOWN    = 0,
59         NM_SETTING_TUN_MODE_TUN        = 1,
60         NM_SETTING_TUN_MODE_TAP        = 2,
61 } NMSettingTunMode;
62
63 struct _NMSettingTun {
64         NMSetting parent;
65 };
66
67 typedef struct {
68         NMSettingClass parent;
69
70         /*< private >*/
71         gpointer padding[4];
72 } NMSettingTunClass;
73
74 NM_AVAILABLE_IN_1_2
75 GType nm_setting_tun_get_type (void);
76 NM_AVAILABLE_IN_1_2
77 NMSetting *nm_setting_tun_new (void);
78
79 NM_AVAILABLE_IN_1_2
80 NMSettingTunMode nm_setting_tun_get_mode         (NMSettingTun *setting);
81 NM_AVAILABLE_IN_1_2
82 const char      *nm_setting_tun_get_owner        (NMSettingTun *setting);
83 NM_AVAILABLE_IN_1_2
84 const char      *nm_setting_tun_get_group        (NMSettingTun *setting);
85 NM_AVAILABLE_IN_1_2
86 gboolean         nm_setting_tun_get_pi           (NMSettingTun *setting);
87 NM_AVAILABLE_IN_1_2
88 gboolean         nm_setting_tun_get_vnet_hdr     (NMSettingTun *setting);
89 NM_AVAILABLE_IN_1_2
90 gboolean         nm_setting_tun_get_multi_queue  (NMSettingTun *setting);
91
92 G_END_DECLS
93
94 #endif /* __NM_SETTING_TUN_H__ */