]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/netdev/vxlan.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / network / netdev / vxlan.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright 2014 Tom Gundersen <teg@jklm.no>
8
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
13
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21 ***/
22
23 typedef struct VxLan VxLan;
24
25 #include "in-addr-util.h"
26 #include "netdev/netdev.h"
27
28 #define VXLAN_VID_MAX (1u << 24) - 1
29 #define VXLAN_FLOW_LABEL_MAX_MASK 0xFFFFFU
30
31 struct VxLan {
32 NetDev meta;
33
34 uint64_t id;
35
36 int remote_family;
37 int local_family;
38
39 union in_addr_union remote;
40 union in_addr_union local;
41
42 unsigned tos;
43 unsigned ttl;
44 unsigned max_fdb;
45 unsigned flow_label;
46
47 uint16_t dest_port;
48
49 usec_t fdb_ageing;
50
51 bool learning;
52 bool arp_proxy;
53 bool route_short_circuit;
54 bool l2miss;
55 bool l3miss;
56 bool udpcsum;
57 bool udp6zerocsumtx;
58 bool udp6zerocsumrx;
59 bool remote_csum_tx;
60 bool remote_csum_rx;
61 bool group_policy;
62
63 struct ifla_vxlan_port_range port_range;
64 };
65
66 DEFINE_NETDEV_CAST(VXLAN, VxLan);
67 extern const NetDevVTable vxlan_vtable;
68
69 int config_parse_vxlan_address(const char *unit,
70 const char *filename,
71 unsigned line,
72 const char *section,
73 unsigned section_line,
74 const char *lvalue,
75 int ltype,
76 const char *rvalue,
77 void *data,
78 void *userdata);
79 int config_parse_port_range(const char *unit,
80 const char *filename,
81 unsigned line,
82 const char *section,
83 unsigned section_line,
84 const char *lvalue,
85 int ltype,
86 const char *rvalue,
87 void *data,
88 void *userdata);
89
90 int config_parse_flow_label(const char *unit,
91 const char *filename,
92 unsigned line,
93 const char *section,
94 unsigned section_line,
95 const char *lvalue,
96 int ltype,
97 const char *rvalue,
98 void *data,
99 void *userdata);