]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/network/netdev/tunnel.h
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / network / netdev / tunnel.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
0ef6f454
LP
2#pragma once
3
634f0f98 4#include "in-addr-util.h"
aa9f1140 5
d067cab3 6#include "conf-parser.h"
441e9ae4 7#include "netdev/netdev.h"
53cb501a 8#include "netdev/fou-tunnel.h"
3be1d7e0 9
855ee1a1
SS
10typedef enum Ip6TnlMode {
11 NETDEV_IP6_TNL_MODE_IP6IP6,
12 NETDEV_IP6_TNL_MODE_IPIP6,
13 NETDEV_IP6_TNL_MODE_ANYIP6,
14 _NETDEV_IP6_TNL_MODE_MAX,
15 _NETDEV_IP6_TNL_MODE_INVALID = -1,
16} Ip6TnlMode;
17
407af9dd
SS
18typedef enum IPv6FlowLabel {
19 NETDEV_IPV6_FLOWLABEL_INHERIT = 0xFFFFF + 1,
20 _NETDEV_IPV6_FLOWLABEL_MAX,
21 _NETDEV_IPV6_FLOWLABEL_INVALID = -1,
22} IPv6FlowLabel;
23
634f0f98 24typedef struct Tunnel {
aa9f1140
TG
25 NetDev meta;
26
855ee1a1
SS
27 uint8_t encap_limit;
28
aa9f1140 29 int family;
6870b415 30 int ipv6_flowlabel;
3a4f3e42 31 int allow_localremote;
2266864b 32 int erspan_sequence;
918049ad 33 int isatap;
aa9f1140
TG
34
35 unsigned ttl;
36 unsigned tos;
855ee1a1
SS
37 unsigned flags;
38
1d710029
SS
39 uint32_t key;
40 uint32_t ikey;
41 uint32_t okey;
2266864b 42 uint32_t erspan_index;
1d710029 43
aa9f1140
TG
44 union in_addr_union local;
45 union in_addr_union remote;
855ee1a1
SS
46
47 Ip6TnlMode ip6tnl_mode;
53cb501a 48 FooOverUDPEncapType fou_encap_type;
855ee1a1 49
aa9f1140 50 bool pmtudisc;
a9b70f9d 51 bool copy_dscp;
4d7fa6de 52 bool independent;
53cb501a
SS
53 bool fou_tunnel;
54
55 uint16_t encap_src_port;
56 uint16_t fou_destination_port;
d067cab3
DA
57
58 struct in6_addr sixrd_prefix;
59 uint8_t sixrd_prefixlen;
634f0f98
ZJS
60} Tunnel;
61
62DEFINE_NETDEV_CAST(IPIP, Tunnel);
63DEFINE_NETDEV_CAST(GRE, Tunnel);
64DEFINE_NETDEV_CAST(GRETAP, Tunnel);
65DEFINE_NETDEV_CAST(IP6GRE, Tunnel);
66DEFINE_NETDEV_CAST(IP6GRETAP, Tunnel);
67DEFINE_NETDEV_CAST(SIT, Tunnel);
68DEFINE_NETDEV_CAST(VTI, Tunnel);
69DEFINE_NETDEV_CAST(VTI6, Tunnel);
70DEFINE_NETDEV_CAST(IP6TNL, Tunnel);
2266864b 71DEFINE_NETDEV_CAST(ERSPAN, Tunnel);
3be1d7e0
TG
72extern const NetDevVTable ipip_vtable;
73extern const NetDevVTable sit_vtable;
74extern const NetDevVTable vti_vtable;
9011ce77 75extern const NetDevVTable vti6_vtable;
3be1d7e0 76extern const NetDevVTable gre_vtable;
1af2536a 77extern const NetDevVTable gretap_vtable;
b16492f8
SS
78extern const NetDevVTable ip6gre_vtable;
79extern const NetDevVTable ip6gretap_vtable;
855ee1a1 80extern const NetDevVTable ip6tnl_vtable;
2266864b 81extern const NetDevVTable erspan_vtable;
855ee1a1
SS
82
83const char *ip6tnl_mode_to_string(Ip6TnlMode d) _const_;
84Ip6TnlMode ip6tnl_mode_from_string(const char *d) _pure_;
85
538f15cf
YW
86CONFIG_PARSER_PROTOTYPE(config_parse_ip6tnl_mode);
87CONFIG_PARSER_PROTOTYPE(config_parse_tunnel_address);
88CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_flowlabel);
89CONFIG_PARSER_PROTOTYPE(config_parse_encap_limit);
90CONFIG_PARSER_PROTOTYPE(config_parse_tunnel_key);
d067cab3 91CONFIG_PARSER_PROTOTYPE(config_parse_6rd_prefix);