1 /* SPDX-License-Identifier: LGPL-2.1+ */
4 #include "in-addr-util.h"
6 #include "conf-parser.h"
7 #include "netdev/netdev.h"
8 #include "netdev/fou-tunnel.h"
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,
18 typedef enum IPv6FlowLabel
{
19 NETDEV_IPV6_FLOWLABEL_INHERIT
= 0xFFFFF + 1,
20 _NETDEV_IPV6_FLOWLABEL_MAX
,
21 _NETDEV_IPV6_FLOWLABEL_INVALID
= -1,
24 typedef struct Tunnel
{
31 int allow_localremote
;
42 uint32_t erspan_index
;
44 union in_addr_union local
;
45 union in_addr_union remote
;
47 Ip6TnlMode ip6tnl_mode
;
48 FooOverUDPEncapType fou_encap_type
;
55 uint16_t encap_src_port
;
56 uint16_t fou_destination_port
;
58 struct in6_addr sixrd_prefix
;
59 uint8_t sixrd_prefixlen
;
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
);
71 DEFINE_NETDEV_CAST(ERSPAN
, Tunnel
);
72 extern const NetDevVTable ipip_vtable
;
73 extern const NetDevVTable sit_vtable
;
74 extern const NetDevVTable vti_vtable
;
75 extern const NetDevVTable vti6_vtable
;
76 extern const NetDevVTable gre_vtable
;
77 extern const NetDevVTable gretap_vtable
;
78 extern const NetDevVTable ip6gre_vtable
;
79 extern const NetDevVTable ip6gretap_vtable
;
80 extern const NetDevVTable ip6tnl_vtable
;
81 extern const NetDevVTable erspan_vtable
;
83 const char *ip6tnl_mode_to_string(Ip6TnlMode d
) _const_
;
84 Ip6TnlMode
ip6tnl_mode_from_string(const char *d
) _pure_
;
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
);
91 CONFIG_PARSER_PROTOTYPE(config_parse_6rd_prefix
);