3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen/***
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen This file is part of systemd.
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen Copyright 2014 Tom Gundersen <teg@jklm.no>
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen systemd is free software; you can redistribute it and/or modify it
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen under the terms of the GNU Lesser General Public License as published by
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen the Free Software Foundation; either version 2.1 of the License, or
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen (at your option) any later version.
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen systemd is distributed in the hope that it will be useful, but
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen WITHOUT ANY WARRANTY; without even the implied warranty of
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen Lesser General Public License for more details.
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen You should have received a copy of the GNU Lesser General Public License
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen***/
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen#pragma once
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersentypedef struct VxLan VxLan;
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen#include "in-addr-util.h"
71d35b6b5563817dfbe757ab9e3b9f018b2db491Thomas Hindoe Paaboel Andersen#include "networkd-netdev.h"
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen#define VXLAN_VID_MAX (1u << 24) - 1
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersen
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersenstruct VxLan {
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen NetDev meta;
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen uint64_t id;
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani int family;
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen union in_addr_union group;
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen unsigned tos;
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen unsigned ttl;
3dbcf5795730047478079da6243fbcab9fe22842Susant Sahani unsigned max_fdb;
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani uint16_t dest_port;
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani usec_t fdb_ageing;
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen bool learning;
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani bool arp_proxy;
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani bool route_short_circuit;
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani bool l2miss;
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani bool l3miss;
cffacc741cb79f63999720525ceaa65aae01a542Susant Sahani bool udpcsum;
cffacc741cb79f63999720525ceaa65aae01a542Susant Sahani bool udp6zerocsumtx;
cffacc741cb79f63999720525ceaa65aae01a542Susant Sahani bool udp6zerocsumrx;
ea84fd5cb327508ae2b4e9ab8ebf3c09f7471d27Susant Sahani bool group_policy;
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani struct ifla_vxlan_port_range port_range;
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen};
aa9f11405829fd4755fef28602a7167dba3ddc89Tom Gundersen
3be1d7e0c5bf60658d34eb6311d4e77c6803578cTom Gundersenextern const NetDevVTable vxlan_vtable;
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahani
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahaniint config_parse_vxlan_group_address(const char *unit,
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahani const char *filename,
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahani unsigned line,
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahani const char *section,
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahani unsigned section_line,
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahani const char *lvalue,
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahani int ltype,
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahani const char *rvalue,
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahani void *data,
a94d64d256d1a2b73c578116f341824eb5d0fab1Susant Sahani void *userdata);
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahaniint config_parse_port_range(const char *unit,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani const char *filename,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani unsigned line,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani const char *section,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani unsigned section_line,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani const char *lvalue,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani int ltype,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani const char *rvalue,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani void *data,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani void *userdata);
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahaniint config_parse_destination_port(const char *unit,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani const char *filename,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani unsigned line,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani const char *section,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani unsigned section_line,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani const char *lvalue,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani int ltype,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani const char *rvalue,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani void *data,
ea0288d17c0713eea601ea6c7715a649842d229dSusant Sahani void *userdata);