device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-core / nm-setting-macvlan.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_MACVLAN_H__
23 #define __NM_SETTING_MACVLAN_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_MACVLAN            (nm_setting_macvlan_get_type ())
34 #define NM_SETTING_MACVLAN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_MACVLAN, NMSettingMacvlan))
35 #define NM_SETTING_MACVLAN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_MACVLANCONFIG, NMSettingMacvlanClass))
36 #define NM_IS_SETTING_MACVLAN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_MACVLAN))
37 #define NM_IS_SETTING_MACVLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_MACVLAN))
38 #define NM_SETTING_MACVLAN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_MACVLAN, NMSettingMacvlanClass))
39
40 #define NM_SETTING_MACVLAN_SETTING_NAME         "macvlan"
41
42 #define NM_SETTING_MACVLAN_PARENT               "parent"
43 #define NM_SETTING_MACVLAN_MODE                 "mode"
44 #define NM_SETTING_MACVLAN_PROMISCUOUS          "promiscuous"
45 #define NM_SETTING_MACVLAN_TAP                  "tap"
46
47 struct _NMSettingMacvlan {
48         NMSetting parent;
49 };
50
51 typedef struct {
52         NMSettingClass parent;
53
54         /*< private >*/
55         gpointer padding[4];
56 } NMSettingMacvlanClass;
57
58 /**
59  * NMSettingMacvlanMode:
60  * @NM_SETTING_MACVLAN_MODE_UNKNOWN: unknown/unset mode
61  * @NM_SETTING_MACVLAN_MODE_VEPA: Virtual Ethernet Port Aggregator mode
62  * @NM_SETTING_MACVLAN_MODE_BRIDGE: bridge mode
63  * @NM_SETTING_MACVLAN_MODE_PRIVATE: private mode
64  * @NM_SETTING_MACVLAN_MODE_PASSTHRU: passthru mode
65  * @NM_SETTING_MACVLAN_MODE_SOURCE: source mode
66  **/
67 typedef enum {
68         NM_SETTING_MACVLAN_MODE_UNKNOWN   = 0,
69         NM_SETTING_MACVLAN_MODE_VEPA      = 1,
70         NM_SETTING_MACVLAN_MODE_BRIDGE    = 2,
71         NM_SETTING_MACVLAN_MODE_PRIVATE   = 3,
72         NM_SETTING_MACVLAN_MODE_PASSTHRU  = 4,
73         NM_SETTING_MACVLAN_MODE_SOURCE    = 5,
74         _NM_SETTING_MACVLAN_MODE_NUM,     /*< skip >*/
75         NM_SETTING_MACVLAN_MODE_LAST      = _NM_SETTING_MACVLAN_MODE_NUM - 1, /*< skip >*/
76 } NMSettingMacvlanMode;
77
78 NM_AVAILABLE_IN_1_2
79 GType nm_setting_macvlan_get_type (void);
80 NM_AVAILABLE_IN_1_2
81 NMSetting *nm_setting_macvlan_new (void);
82
83 NM_AVAILABLE_IN_1_2
84 const char          *nm_setting_macvlan_get_parent (NMSettingMacvlan *setting);
85 NM_AVAILABLE_IN_1_2
86 NMSettingMacvlanMode nm_setting_macvlan_get_mode (NMSettingMacvlan *setting);
87 NM_AVAILABLE_IN_1_2
88 gboolean             nm_setting_macvlan_get_promiscuous (NMSettingMacvlan *setting);
89 NM_AVAILABLE_IN_1_2
90 gboolean             nm_setting_macvlan_get_tap (NMSettingMacvlan *setting);
91
92 G_END_DECLS
93
94 #endif /* __NM_SETTING_MACVLAN_H__ */