test-dhcp6-client.c revision f12ed3bf0b315fc88d5fbdf5bdca14b218c86e0c
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright (C) 2014 Intel Corporation. All rights reserved.
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 <stdbool.h>
#include <stdio.h>
#include "macro.h"
#include "sd-event.h"
#include "event-util.h"
#include "sd-dhcp6-client.h"
#include "dhcp6-protocol.h"
#include "dhcp6-internal.h"
static struct ether_addr mac_addr = {
};
static bool verbose = false;
static int test_client_basic(sd_event *e) {
if (verbose)
return 0;
}
static int test_option(sd_event *e) {
'F', 'O', 'O',
'A', 'B', 'C', 'D', 'E', 'F', 'G',
'1', '2', '3', '4', '5', '6', '7', '8', '9',
'B', 'A', 'R',
};
'F', 'O', 'O',
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
'B', 'A', 'R',
};
if (verbose)
buflen -= 3;
outlen -= 3;
&optval) >= 0);
optval) >= 0);
&optval) >= 0);
optval) >= 0);
return 0;
}
assert_se(sd_event_new(&e) >= 0);
log_open();
test_option(e);
assert_se(!sd_event_unref(e));
return 0;
}