]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
0ef6f454 LP |
2 | #pragma once |
3 | ||
3be1d7e0 TG |
4 | /*** |
5 | This file is part of systemd. | |
6 | ||
7 | Copyright 2014 Tom Gundersen <teg@jklm.no> | |
3be1d7e0 TG |
8 | ***/ |
9 | ||
634f0f98 | 10 | #include "in-addr-util.h" |
aa9f1140 | 11 | |
441e9ae4 | 12 | #include "netdev/netdev.h" |
3be1d7e0 | 13 | |
855ee1a1 SS |
14 | typedef enum Ip6TnlMode { |
15 | NETDEV_IP6_TNL_MODE_IP6IP6, | |
16 | NETDEV_IP6_TNL_MODE_IPIP6, | |
17 | NETDEV_IP6_TNL_MODE_ANYIP6, | |
18 | _NETDEV_IP6_TNL_MODE_MAX, | |
19 | _NETDEV_IP6_TNL_MODE_INVALID = -1, | |
20 | } Ip6TnlMode; | |
21 | ||
407af9dd SS |
22 | typedef enum IPv6FlowLabel { |
23 | NETDEV_IPV6_FLOWLABEL_INHERIT = 0xFFFFF + 1, | |
24 | _NETDEV_IPV6_FLOWLABEL_MAX, | |
25 | _NETDEV_IPV6_FLOWLABEL_INVALID = -1, | |
26 | } IPv6FlowLabel; | |
27 | ||
634f0f98 | 28 | typedef struct Tunnel { |
aa9f1140 TG |
29 | NetDev meta; |
30 | ||
855ee1a1 SS |
31 | uint8_t encap_limit; |
32 | ||
aa9f1140 | 33 | int family; |
6870b415 | 34 | int ipv6_flowlabel; |
3a4f3e42 | 35 | int allow_localremote; |
aa9f1140 TG |
36 | |
37 | unsigned ttl; | |
38 | unsigned tos; | |
855ee1a1 SS |
39 | unsigned flags; |
40 | ||
1d710029 SS |
41 | uint32_t key; |
42 | uint32_t ikey; | |
43 | uint32_t okey; | |
44 | ||
aa9f1140 TG |
45 | union in_addr_union local; |
46 | union in_addr_union remote; | |
855ee1a1 SS |
47 | |
48 | Ip6TnlMode ip6tnl_mode; | |
49 | ||
aa9f1140 | 50 | bool pmtudisc; |
a9b70f9d | 51 | bool copy_dscp; |
4d7fa6de | 52 | bool independent; |
634f0f98 ZJS |
53 | } Tunnel; |
54 | ||
55 | DEFINE_NETDEV_CAST(IPIP, Tunnel); | |
56 | DEFINE_NETDEV_CAST(GRE, Tunnel); | |
57 | DEFINE_NETDEV_CAST(GRETAP, Tunnel); | |
58 | DEFINE_NETDEV_CAST(IP6GRE, Tunnel); | |
59 | DEFINE_NETDEV_CAST(IP6GRETAP, Tunnel); | |
60 | DEFINE_NETDEV_CAST(SIT, Tunnel); | |
61 | DEFINE_NETDEV_CAST(VTI, Tunnel); | |
62 | DEFINE_NETDEV_CAST(VTI6, Tunnel); | |
63 | DEFINE_NETDEV_CAST(IP6TNL, Tunnel); | |
3be1d7e0 TG |
64 | extern const NetDevVTable ipip_vtable; |
65 | extern const NetDevVTable sit_vtable; | |
66 | extern const NetDevVTable vti_vtable; | |
9011ce77 | 67 | extern const NetDevVTable vti6_vtable; |
3be1d7e0 | 68 | extern const NetDevVTable gre_vtable; |
1af2536a | 69 | extern const NetDevVTable gretap_vtable; |
b16492f8 SS |
70 | extern const NetDevVTable ip6gre_vtable; |
71 | extern const NetDevVTable ip6gretap_vtable; | |
855ee1a1 SS |
72 | extern const NetDevVTable ip6tnl_vtable; |
73 | ||
74 | const char *ip6tnl_mode_to_string(Ip6TnlMode d) _const_; | |
75 | Ip6TnlMode ip6tnl_mode_from_string(const char *d) _pure_; | |
76 | ||
77 | int config_parse_ip6tnl_mode(const char *unit, const char *filename, | |
78 | unsigned line, const char *section, | |
79 | unsigned section_line, const char *lvalue, | |
80 | int ltype, const char *rvalue, void *data, | |
81 | void *userdata); | |
3b50bf80 SS |
82 | |
83 | int config_parse_tunnel_address(const char *unit, | |
84 | const char *filename, | |
85 | unsigned line, | |
86 | const char *section, | |
87 | unsigned section_line, | |
88 | const char *lvalue, | |
89 | int ltype, | |
90 | const char *rvalue, | |
91 | void *data, | |
92 | void *userdata); | |
407af9dd | 93 | |
407af9dd SS |
94 | int config_parse_ipv6_flowlabel(const char *unit, const char *filename, |
95 | unsigned line, const char *section, | |
96 | unsigned section_line, const char *lvalue, | |
97 | int ltype, const char *rvalue, void *data, | |
98 | void *userdata); | |
b4828886 SS |
99 | |
100 | int config_parse_encap_limit(const char *unit, const char *filename, | |
101 | unsigned line, const char *section, | |
102 | unsigned section_line, const char *lvalue, | |
103 | int ltype, const char *rvalue, void *data, | |
104 | void *userdata); | |
1d710029 SS |
105 | int config_parse_tunnel_key(const char *unit, const char *filename, |
106 | unsigned line, const char *section, | |
107 | unsigned section_line, const char *lvalue, | |
108 | int ltype, const char *rvalue, void *data, | |
109 | void *userdata); |