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
15G_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
35typedef 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 **/
46typedef 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
57NM_AVAILABLE_IN_1_2
58GType nm_setting_macvlan_get_type(void);
59NM_AVAILABLE_IN_1_2
60NMSetting *nm_setting_macvlan_new(void);
61
62NM_AVAILABLE_IN_1_2
63const char *nm_setting_macvlan_get_parent(NMSettingMacvlan *setting);
64NM_AVAILABLE_IN_1_2
65NMSettingMacvlanMode nm_setting_macvlan_get_mode(NMSettingMacvlan *setting);
66NM_AVAILABLE_IN_1_2
67gboolean nm_setting_macvlan_get_promiscuous(NMSettingMacvlan *setting);
68NM_AVAILABLE_IN_1_2
69gboolean nm_setting_macvlan_get_tap(NMSettingMacvlan *setting);
70
71G_END_DECLS
72
73#endif /* __NM_SETTING_MACVLAN_H__ */
74

source code of include/libnm/nm-setting-macvlan.h