test-rtnl.c revision fc25d7f8050f262fa6cafeb2a1032e6eb3e7b412
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2013 Tom Gundersen <teg@jklm.no>
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 <linux/rtnetlink.h>
#include "util.h"
#include "macro.h"
#include "sd-rtnl.h"
#include "socket-util.h"
#include "rtnl-util.h"
#include "event-util.h"
unsigned int mtu = 1450;
void *data;
/* we'd really like to test NEWLINK, but let's not mess with the running kernel */
}
static void test_route(void) {
void *data;
int r;
RTN_UNICAST, 0, &req);
if (r < 0) {
return;
}
if (r < 0) {
return;
}
if (r < 0) {
return;
}
}
static void test_multiple(void) {
}
void *data;
assert(m);
switch (type) {
// case IFLA_MTU:
// assert(*(unsigned int *) data == 65536);
// break;
// case IFLA_QDISC:
// assert(streq((char *) data, "noqueue"));
// break;
case IFLA_IFNAME:
break;
}
}
return 1;
}
static void test_event_loop(int ifindex) {
char *ifname;
}
(*counter) --;
return sd_rtnl_message_get_errno(m);
}
static void test_async(int ifindex) {
char *ifname;
}
int counter = 0;
counter ++;
counter ++;
while (counter > 0) {
}
}
static void test_container(void) {
void *data;
assert(sd_rtnl_message_close_container(m) >= 0);
/* TODO: add support for entering containers
assert(sd_rtnl_message_read(m, &type, &data) > 0);
assert(type == IFLA_INFO_KIND);
assert(streq("kind", (char *) data));
assert(sd_rtnl_message_read(m, &type, &data) == 0);
*/
}
static void test_match(void) {
}
int main(void) {
sd_rtnl_message *m;
sd_rtnl_message *r;
void *data;
int if_loopback;
unsigned int mtu = 0;
unsigned int *mtu_reply;
test_match();
test_route();
assert(if_loopback > 0);
assert(m);
assert(m);
switch (type) {
// case IFLA_MTU:
// assert(*(unsigned int *) data == 65536);
// break;
// case IFLA_QDISC:
// assert(streq((char *) data, "noqueue"));
// break;
case IFLA_IFNAME:
break;
}
}
return EXIT_SUCCESS;
}