networkd-netdev-vxlan.c revision ea0288d17c0713eea601ea6c7715a649842d229d
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2014 Susant Sahani
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/>.
***/
#include "sd-netlink.h"
#include "conf-parser.h"
#include "alloc-util.h"
#include "parse-util.h"
#include "missing.h"
#include "networkd-link.h"
#include "networkd-netdev-vxlan.h"
VxLan *v;
int r;
assert(m);
assert(v);
if (v->id <= VXLAN_VID_MAX) {
if (r < 0)
}
if (r < 0)
if (r < 0)
if(v->ttl) {
if (r < 0)
}
if(v->tos) {
if (r < 0)
}
if (r < 0)
if (r < 0)
if (r < 0)
if (r < 0)
if (r < 0)
if(v->fdb_ageing) {
if (r < 0)
}
if (v->max_fdb) {
if (r < 0)
}
if (r < 0)
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_UDP_ZERO_CSUM6_TX attribute: %m");
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_UDP_ZERO_CSUM6_RX attribute: %m");
if (r < 0)
struct ifla_vxlan_port_range port_range;
if (r < 0)
}
if (v->group_policy) {
if (r < 0)
}
return r;
}
int config_parse_vxlan_group_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) {
int r, f;
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r, "vxlan multicast group address is invalid, ignoring assignment: %s", rvalue);
return 0;
}
log_syntax(unit, LOG_ERR, filename, line, 0, "vxlan multicast group incompatible, ignoring assignment: %s", rvalue);
return 0;
}
v->family = f;
return 0;
}
int config_parse_port_range(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) {
int r;
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to extract VXLAN port range, ignoring: %s", rvalue);
return 0;
}
if (r == 0)
return 0;
if (r < 0) {
return 0;
}
"Failed to parse VXLAN port range '%s'. Port should be greater than 0 and less than 65535.", word);
return 0;
}
return 0;
}
return 0;
}
int config_parse_destination_port(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) {
int r;
if (r < 0 || port <= 0) {
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse VXLAN destination port '%s'.", rvalue);
return 0;
}
return 0;
}
assert(v);
if (v->id > VXLAN_VID_MAX) {
return -EINVAL;
}
return 0;
}
VxLan *v;
assert(v);
v->learning = true;
v->udpcsum = false;
v->udp6zerocsumtx = false;
v->udp6zerocsumrx = false;
}
const NetDevVTable vxlan_vtable = {
.object_size = sizeof(VxLan),
.init = vxlan_init,
.sections = "Match\0NetDev\0VXLAN\0",
};