]>
Commit | Line | Data |
---|---|---|
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 |
10 | typedef 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 |
18 | typedef enum IPv6FlowLabel { |
19 | NETDEV_IPV6_FLOWLABEL_INHERIT = 0xFFFFF + 1, | |
20 | _NETDEV_IPV6_FLOWLABEL_MAX, | |
21 | _NETDEV_IPV6_FLOWLABEL_INVALID = -1, | |
22 | } IPv6FlowLabel; | |
23 | ||
634f0f98 | 24 | typedef 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 | ||
62 | DEFINE_NETDEV_CAST(IPIP, Tunnel); | |
63 | DEFINE_NETDEV_CAST(GRE, Tunnel); | |
64 | DEFINE_NETDEV_CAST(GRETAP, Tunnel); | |
65 | DEFINE_NETDEV_CAST(IP6GRE, Tunnel); | |
66 | DEFINE_NETDEV_CAST(IP6GRETAP, Tunnel); | |
67 | DEFINE_NETDEV_CAST(SIT, Tunnel); | |
68 | DEFINE_NETDEV_CAST(VTI, Tunnel); | |
69 | DEFINE_NETDEV_CAST(VTI6, Tunnel); | |
70 | DEFINE_NETDEV_CAST(IP6TNL, Tunnel); | |
2266864b | 71 | DEFINE_NETDEV_CAST(ERSPAN, Tunnel); |
3be1d7e0 TG |
72 | extern const NetDevVTable ipip_vtable; |
73 | extern const NetDevVTable sit_vtable; | |
74 | extern const NetDevVTable vti_vtable; | |
9011ce77 | 75 | extern const NetDevVTable vti6_vtable; |
3be1d7e0 | 76 | extern const NetDevVTable gre_vtable; |
1af2536a | 77 | extern const NetDevVTable gretap_vtable; |
b16492f8 SS |
78 | extern const NetDevVTable ip6gre_vtable; |
79 | extern const NetDevVTable ip6gretap_vtable; | |
855ee1a1 | 80 | extern const NetDevVTable ip6tnl_vtable; |
2266864b | 81 | extern const NetDevVTable erspan_vtable; |
855ee1a1 SS |
82 | |
83 | const char *ip6tnl_mode_to_string(Ip6TnlMode d) _const_; | |
84 | Ip6TnlMode ip6tnl_mode_from_string(const char *d) _pure_; | |
85 | ||
538f15cf YW |
86 | CONFIG_PARSER_PROTOTYPE(config_parse_ip6tnl_mode); |
87 | CONFIG_PARSER_PROTOTYPE(config_parse_tunnel_address); | |
88 | CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_flowlabel); | |
89 | CONFIG_PARSER_PROTOTYPE(config_parse_encap_limit); | |
90 | CONFIG_PARSER_PROTOTYPE(config_parse_tunnel_key); | |
d067cab3 | 91 | CONFIG_PARSER_PROTOTYPE(config_parse_6rd_prefix); |