]>
Commit | Line | Data |
---|---|---|
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 | ||
22 | typedef struct Tunnel Tunnel; | |
23 | ||
24 | #include "networkd-netdev.h" | |
25 | ||
e735f4d4 MP |
26 | typedef 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 |
34 | typedef 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 |
40 | struct 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 |
61 | extern const NetDevVTable ipip_vtable; |
62 | extern const NetDevVTable sit_vtable; | |
63 | extern const NetDevVTable vti_vtable; | |
e3bff60a | 64 | extern const NetDevVTable vti6_vtable; |
5eef597e | 65 | extern const NetDevVTable gre_vtable; |
e735f4d4 MP |
66 | extern const NetDevVTable gretap_vtable; |
67 | extern const NetDevVTable ip6gre_vtable; | |
68 | extern const NetDevVTable ip6gretap_vtable; | |
69 | extern const NetDevVTable ip6tnl_vtable; | |
70 | ||
71 | const char *ip6tnl_mode_to_string(Ip6TnlMode d) _const_; | |
72 | Ip6TnlMode ip6tnl_mode_from_string(const char *d) _pure_; | |
73 | ||
74 | int 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 | |
80 | int 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 |
91 | int 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 | |
97 | int 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); |