networkd-netdev-tuntap.c revision b1d4f8e154bf61b5de1b27461ef8e9c8c5e838a1
/*-*- 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 "fd-util.h"
#include "networkd-netdev-tuntap.h"
#include "user-util.h"
TunTap *t;
} else {
}
if (!t->packet_info)
if (t->one_queue)
if (t->multi_queue)
if (t->vnet_hdr)
return 0;
}
_cleanup_close_ int fd;
const char *user;
const char *group;
int r;
if (fd < 0)
if (r < 0)
else
assert(t);
if(t->user_name) {
if (r < 0)
if (r < 0)
}
if (t->group_name) {
group = t->group_name;
if (r < 0)
if (r < 0)
}
if (r < 0)
return 0;
}
int r;
if(r < 0)
return r;
}
else
assert(t);
}
return 0;
}
const NetDevVTable tun_vtable = {
.object_size = sizeof(TunTap),
.sections = "Match\0NetDev\0Tun\0",
.done = tuntap_done,
};
const NetDevVTable tap_vtable = {
.object_size = sizeof(TunTap),
.sections = "Match\0NetDev\0Tap\0",
.done = tuntap_done,
};