test-rtnl.c revision ee3a6a51e5b098aa0c9641ed71d275c459ad2f5a
/*-*- 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 */
}
sd_rtnl_message *m;
sd_rtnl_message *r;
unsigned int mtu = 1500;
unsigned int *mtu_reply;
void *data;
assert(m);
/* u8 test cases */
/* u32 test cases */
/* u8 read back */
/* u32 read back */
switch (type) {
// case IFLA_MTU:
// assert(*(unsigned int *) data == 65536);
// break;
// case IFLA_QDISC:
// assert(streq((char *) data, "noqueue"));
// break;
case IFLA_IFNAME:
break;
}
}
}
static void test_route(void) {
void *data;
int r;
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);
assert(sd_rtnl_message_close_container(m) >= 0);
assert(sd_rtnl_message_exit_container(m) >= 0);
assert(sd_rtnl_message_exit_container(m) >= 0);
}
static void test_match(void) {
}
int main(void) {
sd_rtnl_message *m;
sd_rtnl_message *r;
void *data;
int if_loopback;
test_match();
test_route();
assert(if_loopback > 0);
assert(m);
return EXIT_SUCCESS;
}