]> git.proxmox.com Git - systemd.git/blame - src/network/networkd-netdev-tunnel.h
Imported Upstream version 229
[systemd.git] / src / network / networkd-netdev-tunnel.h
CommitLineData
663996b3
MS
1/***
2 This file is part of systemd.
3
5eef597e 4 Copyright 2014 Tom Gundersen <teg@jklm.no>
663996b3
MS
5
6 systemd is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
10
11 systemd is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with systemd; If not, see <http://www.gnu.org/licenses/>.
18***/
19
5eef597e
MP
20#pragma once
21
22typedef struct Tunnel Tunnel;
23
24#include "networkd-netdev.h"
25
e735f4d4
MP
26typedef enum Ip6TnlMode {
27 NETDEV_IP6_TNL_MODE_IP6IP6,
28 NETDEV_IP6_TNL_MODE_IPIP6,
29 NETDEV_IP6_TNL_MODE_ANYIP6,
30 _NETDEV_IP6_TNL_MODE_MAX,
31 _NETDEV_IP6_TNL_MODE_INVALID = -1,
32} Ip6TnlMode;
33
7035cd9e
MP
34typedef enum IPv6FlowLabel {
35 NETDEV_IPV6_FLOWLABEL_INHERIT = 0xFFFFF + 1,
36 _NETDEV_IPV6_FLOWLABEL_MAX,
37 _NETDEV_IPV6_FLOWLABEL_INVALID = -1,
38} IPv6FlowLabel;
39
5eef597e
MP
40struct Tunnel {
41 NetDev meta;
42
e735f4d4
MP
43 uint8_t encap_limit;
44
5eef597e 45 int family;
5fd56512 46 int ipv6_flowlabel;
663996b3 47
5eef597e
MP
48 unsigned ttl;
49 unsigned tos;
e735f4d4
MP
50 unsigned flags;
51
5eef597e
MP
52 union in_addr_union local;
53 union in_addr_union remote;
e735f4d4
MP
54
55 Ip6TnlMode ip6tnl_mode;
56
5eef597e 57 bool pmtudisc;
7035cd9e 58 bool copy_dscp;
5eef597e 59};
60f067b4 60
5eef597e
MP
61extern const NetDevVTable ipip_vtable;
62extern const NetDevVTable sit_vtable;
63extern const NetDevVTable vti_vtable;
e3bff60a 64extern const NetDevVTable vti6_vtable;
5eef597e 65extern const NetDevVTable gre_vtable;
e735f4d4
MP
66extern const NetDevVTable gretap_vtable;
67extern const NetDevVTable ip6gre_vtable;
68extern const NetDevVTable ip6gretap_vtable;
69extern const NetDevVTable ip6tnl_vtable;
70
71const char *ip6tnl_mode_to_string(Ip6TnlMode d) _const_;
72Ip6TnlMode ip6tnl_mode_from_string(const char *d) _pure_;
73
74int config_parse_ip6tnl_mode(const char *unit, const char *filename,
75 unsigned line, const char *section,
76 unsigned section_line, const char *lvalue,
77 int ltype, const char *rvalue, void *data,
78 void *userdata);
7035cd9e
MP
79
80int config_parse_tunnel_address(const char *unit,
81 const char *filename,
82 unsigned line,
83 const char *section,
84 unsigned section_line,
85 const char *lvalue,
86 int ltype,
87 const char *rvalue,
88 void *data,
89 void *userdata);
90
7035cd9e
MP
91int config_parse_ipv6_flowlabel(const char *unit, const char *filename,
92 unsigned line, const char *section,
93 unsigned section_line, const char *lvalue,
94 int ltype, const char *rvalue, void *data,
95 void *userdata);
d9dfd233
MP
96
97int config_parse_encap_limit(const char *unit, const char *filename,
98 unsigned line, const char *section,
99 unsigned section_line, const char *lvalue,
100 int ltype, const char *rvalue, void *data,
101 void *userdata);