chiark / gitweb /
rules: simplify mmc RPMB handling
[elogind.git] / src / network / networkd-netdev-tunnel.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 /***
4   This file is part of systemd.
5
6   Copyright 2014 Tom Gundersen <teg@jklm.no>
7
8   systemd is free software; you can redistribute it and/or modify it
9   under the terms of the GNU Lesser General Public License as published by
10   the Free Software Foundation; either version 2.1 of the License, or
11   (at your option) any later version.
12
13   systemd is distributed in the hope that it will be useful, but
14   WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   Lesser General Public License for more details.
17
18   You should have received a copy of the GNU Lesser General Public License
19   along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #pragma once
23
24 typedef struct Tunnel Tunnel;
25
26 #include "networkd-netdev.h"
27
28 typedef enum Ip6TnlMode {
29         NETDEV_IP6_TNL_MODE_IP6IP6,
30         NETDEV_IP6_TNL_MODE_IPIP6,
31         NETDEV_IP6_TNL_MODE_ANYIP6,
32         _NETDEV_IP6_TNL_MODE_MAX,
33         _NETDEV_IP6_TNL_MODE_INVALID = -1,
34 } Ip6TnlMode;
35
36 struct Tunnel {
37         NetDev meta;
38
39         uint8_t encap_limit;
40
41         int family;
42
43         unsigned ttl;
44         unsigned tos;
45         unsigned flags;
46
47         union in_addr_union local;
48         union in_addr_union remote;
49
50         Ip6TnlMode ip6tnl_mode;
51
52         bool pmtudisc;
53 };
54
55 extern const NetDevVTable ipip_vtable;
56 extern const NetDevVTable sit_vtable;
57 extern const NetDevVTable vti_vtable;
58 extern const NetDevVTable gre_vtable;
59 extern const NetDevVTable gretap_vtable;
60 extern const NetDevVTable ip6gre_vtable;
61 extern const NetDevVTable ip6gretap_vtable;
62 extern const NetDevVTable ip6tnl_vtable;
63
64 const char *ip6tnl_mode_to_string(Ip6TnlMode d) _const_;
65 Ip6TnlMode ip6tnl_mode_from_string(const char *d) _pure_;
66
67 int config_parse_ip6tnl_mode(const char *unit, const char *filename,
68                              unsigned line, const char *section,
69                              unsigned section_line, const char *lvalue,
70                              int ltype, const char *rvalue, void *data,
71                              void *userdata);