networkd-netdev-vxlan.c revision 00e8d83a5a6fce20443b53bc42066bc756d5caeb
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2014 Susant Sahani <susant@redhat.com>
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-rtnl.h"
#include "networkd-netdev-vxlan.h"
#include "networkd-link.h"
#include "conf-parser.h"
#include "missing.h"
int r;
assert(v);
assert(m);
if (v->id <= VXLAN_VID_MAX) {
if (r < 0) {
"Could not append IFLA_VXLAN_ID attribute: %s",
strerror(-r));
return r;
}
}
if (r < 0) {
"Could not append IFLA_VXLAN_GROUP attribute: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not append IFLA_VXLAN_LINK attribute: %s",
strerror(-r));
return r;
}
if(v->ttl) {
if (r < 0) {
"Could not append IFLA_VXLAN_TTL attribute: %s",
strerror(-r));
return r;
}
}
if(v->tos) {
if (r < 0) {
"Could not append IFLA_VXLAN_TOS attribute: %s",
strerror(-r));
return r;
}
}
if (r < 0) {
"Could not append IFLA_VXLAN_LEARNING attribute: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not append IFLA_VXLAN_RSC attribute: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not append IFLA_VXLAN_PROXY attribute: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not append IFLA_VXLAN_L2MISS attribute: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not append IFLA_VXLAN_L3MISS attribute: %s",
strerror(-r));
return r;
}
if(v->fdb_ageing) {
if (r < 0) {
"Could not append IFLA_VXLAN_AGEING attribute: %s",
strerror(-r));
return r;
}
}
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) {
"vxlan multicast group address is invalid, ignoring assignment: %s", rvalue);
return 0;
}
"vxlan multicast group incompatible, ignoring assignment: %s", rvalue);
return 0;
}
v->family = f;
return 0;
}
assert(v);
if (v->id > VXLAN_VID_MAX) {
return -EINVAL;
}
return 0;
}
assert(v);
v->learning = true;
}
const NetDevVTable vxlan_vtable = {
.object_size = sizeof(VxLan),
.init = vxlan_init,
.sections = "Match\0NetDev\0VXLAN\0",
};