1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2015 Red Hat, Inc.
4 */
5
6#ifndef __NM_SETTING_IP_TUNNEL_H__
7#define __NM_SETTING_IP_TUNNEL_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_IP_TUNNEL (nm_setting_ip_tunnel_get_type())
18#define NM_SETTING_IP_TUNNEL(obj) \
19 (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_IP_TUNNEL, NMSettingIPTunnel))
20#define NM_SETTING_IP_TUNNEL_CLASS(klass) \
21 (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_IP_TUNNEL, NMSettingIPTunnelClass))
22#define NM_IS_SETTING_IP_TUNNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_IP_TUNNEL))
23#define NM_IS_SETTING_IP_TUNNEL_CLASS(klass) \
24 (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_IP_TUNNEL))
25#define NM_SETTING_IP_TUNNEL_GET_CLASS(obj) \
26 (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_IP_TUNNEL, NMSettingIPTunnelClass))
27
28#define NM_SETTING_IP_TUNNEL_SETTING_NAME "ip-tunnel"
29
30#define NM_SETTING_IP_TUNNEL_PARENT "parent"
31#define NM_SETTING_IP_TUNNEL_MODE "mode"
32#define NM_SETTING_IP_TUNNEL_LOCAL "local"
33#define NM_SETTING_IP_TUNNEL_REMOTE "remote"
34#define NM_SETTING_IP_TUNNEL_TTL "ttl"
35#define NM_SETTING_IP_TUNNEL_TOS "tos"
36#define NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY "path-mtu-discovery"
37#define NM_SETTING_IP_TUNNEL_INPUT_KEY "input-key"
38#define NM_SETTING_IP_TUNNEL_OUTPUT_KEY "output-key"
39#define NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT "encapsulation-limit"
40#define NM_SETTING_IP_TUNNEL_FLOW_LABEL "flow-label"
41#define NM_SETTING_IP_TUNNEL_MTU "mtu"
42#define NM_SETTING_IP_TUNNEL_FLAGS "flags"
43
44typedef struct _NMSettingIPTunnelClass NMSettingIPTunnelClass;
45
46/*
47 * NMIPTunnelFlags:
48 * @NM_IP_TUNNEL_FLAG_NONE: no flag
49 * @NM_IP_TUNNEL_FLAG_IP6_IGN_ENCAP_LIMIT: don't add encapsulation limit
50 * if one isn't present in inner packet
51 * @NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_TCLASS: copy the traffic class field
52 * from the inner packet
53 * @NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FLOWLABEL: copy the flowlabel from the
54 * inner packet
55 * @NM_IP_TUNNEL_FLAG_IP6_MIP6_DEV: used for Mobile IPv6
56 * @NM_IP_TUNNEL_FLAG_IP6_RCV_DSCP_COPY: copy DSCP from the outer packet
57 * @NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FWMARK: copy fwmark from inner packet
58 *
59 * IP tunnel flags.
60 *
61 * Since: 1.12
62 */
63typedef enum { /*< flags, prefix=NM_IP_TUNNEL_FLAG >*/
64 NM_IP_TUNNEL_FLAG_NONE = 0x0,
65 NM_IP_TUNNEL_FLAG_IP6_IGN_ENCAP_LIMIT = 0x1,
66 NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_TCLASS = 0x2,
67 NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FLOWLABEL = 0x4,
68 NM_IP_TUNNEL_FLAG_IP6_MIP6_DEV = 0x8,
69 NM_IP_TUNNEL_FLAG_IP6_RCV_DSCP_COPY = 0x10,
70 NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FWMARK = 0x20,
71} NMIPTunnelFlags;
72
73NM_AVAILABLE_IN_1_2
74GType nm_setting_ip_tunnel_get_type(void);
75
76NM_AVAILABLE_IN_1_2
77NMSetting *nm_setting_ip_tunnel_new(void);
78
79NM_AVAILABLE_IN_1_2
80const char *nm_setting_ip_tunnel_get_parent(NMSettingIPTunnel *setting);
81NM_AVAILABLE_IN_1_2
82NMIPTunnelMode nm_setting_ip_tunnel_get_mode(NMSettingIPTunnel *setting);
83NM_AVAILABLE_IN_1_2
84const char *nm_setting_ip_tunnel_get_local(NMSettingIPTunnel *setting);
85NM_AVAILABLE_IN_1_2
86const char *nm_setting_ip_tunnel_get_remote(NMSettingIPTunnel *setting);
87NM_AVAILABLE_IN_1_2
88guint nm_setting_ip_tunnel_get_ttl(NMSettingIPTunnel *setting);
89NM_AVAILABLE_IN_1_2
90guint nm_setting_ip_tunnel_get_tos(NMSettingIPTunnel *setting);
91NM_AVAILABLE_IN_1_2
92gboolean nm_setting_ip_tunnel_get_path_mtu_discovery(NMSettingIPTunnel *setting);
93NM_AVAILABLE_IN_1_2
94const char *nm_setting_ip_tunnel_get_input_key(NMSettingIPTunnel *setting);
95NM_AVAILABLE_IN_1_2
96const char *nm_setting_ip_tunnel_get_output_key(NMSettingIPTunnel *setting);
97NM_AVAILABLE_IN_1_2
98guint nm_setting_ip_tunnel_get_encapsulation_limit(NMSettingIPTunnel *setting);
99NM_AVAILABLE_IN_1_2
100guint nm_setting_ip_tunnel_get_flow_label(NMSettingIPTunnel *setting);
101NM_AVAILABLE_IN_1_2
102guint nm_setting_ip_tunnel_get_mtu(NMSettingIPTunnel *setting);
103NM_AVAILABLE_IN_1_12
104NMIPTunnelFlags nm_setting_ip_tunnel_get_flags(NMSettingIPTunnel *setting);
105
106G_END_DECLS
107
108#endif /* __NM_SETTING_IP_TUNNEL_H__ */
109

source code of include/libnm/nm-setting-ip-tunnel.h