2014-07-06 16:07:34 +04:00
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd .
Copyright 2014 Tom Gundersen < teg @ jklm . no >
systemd is free software ; you can redistribute it and / or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation ; either version 2.1 of the License , or
( at your option ) any later version .
systemd is distributed in the hope that it will be useful , but
WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public License
along with systemd ; If not , see < http : //www.gnu.org/licenses/>.
* * */
# pragma once
2014-07-16 15:17:10 +04:00
typedef struct Tunnel Tunnel ;
2014-07-06 16:07:34 +04:00
# include "networkd-netdev.h"
2015-01-16 22:09:10 +03:00
typedef enum Ip6TnlMode {
NETDEV_IP6_TNL_MODE_IP6IP6 ,
NETDEV_IP6_TNL_MODE_IPIP6 ,
NETDEV_IP6_TNL_MODE_ANYIP6 ,
_NETDEV_IP6_TNL_MODE_MAX ,
_NETDEV_IP6_TNL_MODE_INVALID = - 1 ,
} Ip6TnlMode ;
2015-07-21 07:36:44 +03:00
typedef enum IPv6FlowLabel {
NETDEV_IPV6_FLOWLABEL_INHERIT = 0xFFFFF + 1 ,
_NETDEV_IPV6_FLOWLABEL_MAX ,
_NETDEV_IPV6_FLOWLABEL_INVALID = - 1 ,
} IPv6FlowLabel ;
2014-07-16 15:17:10 +04:00
struct Tunnel {
NetDev meta ;
2015-01-16 22:09:10 +03:00
uint8_t encap_limit ;
2014-07-16 15:17:10 +04:00
int family ;
2015-07-29 19:34:28 +03:00
int ipv6_flowlabel ;
2014-07-16 15:17:10 +04:00
unsigned ttl ;
unsigned tos ;
2015-01-16 22:09:10 +03:00
unsigned flags ;
2014-07-16 15:17:10 +04:00
union in_addr_union local ;
union in_addr_union remote ;
2015-01-16 22:09:10 +03:00
Ip6TnlMode ip6tnl_mode ;
2014-07-16 15:17:10 +04:00
bool pmtudisc ;
2015-07-25 05:26:00 +03:00
bool copy_dscp ;
2014-07-16 15:17:10 +04:00
} ;
2014-07-06 16:07:34 +04:00
extern const NetDevVTable ipip_vtable ;
extern const NetDevVTable sit_vtable ;
extern const NetDevVTable vti_vtable ;
2015-04-22 11:44:55 +03:00
extern const NetDevVTable vti6_vtable ;
2014-07-06 16:07:34 +04:00
extern const NetDevVTable gre_vtable ;
2014-12-20 11:05:06 +03:00
extern const NetDevVTable gretap_vtable ;
2015-01-18 20:54:24 +03:00
extern const NetDevVTable ip6gre_vtable ;
extern const NetDevVTable ip6gretap_vtable ;
2015-01-16 22:09:10 +03:00
extern const NetDevVTable ip6tnl_vtable ;
const char * ip6tnl_mode_to_string ( Ip6TnlMode d ) _const_ ;
Ip6TnlMode ip6tnl_mode_from_string ( const char * d ) _pure_ ;
int config_parse_ip6tnl_mode ( const char * unit , const char * filename ,
unsigned line , const char * section ,
unsigned section_line , const char * lvalue ,
int ltype , const char * rvalue , void * data ,
void * userdata ) ;
2015-07-16 17:46:53 +03:00
int config_parse_tunnel_address ( const char * unit ,
const char * filename ,
unsigned line ,
const char * section ,
unsigned section_line ,
const char * lvalue ,
int ltype ,
const char * rvalue ,
void * data ,
void * userdata ) ;
2015-07-21 07:36:44 +03:00
int config_parse_ipv6_flowlabel ( const char * unit , const char * filename ,
unsigned line , const char * section ,
unsigned section_line , const char * lvalue ,
int ltype , const char * rvalue , void * data ,
void * userdata ) ;
2015-08-31 10:51:44 +03:00
int config_parse_encap_limit ( const char * unit , const char * filename ,
unsigned line , const char * section ,
unsigned section_line , const char * lvalue ,
int ltype , const char * rvalue , void * data ,
void * userdata ) ;