1c475ec862e06fdc6174fc6147afaf0972b0a69c
2 * @file kernel_interface_test.h
4 * @brief Tests for the kernel_interface_t class.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 #include "kernel_interface_test.h"
27 #include <threads/kernel_interface.h>
28 #include <utils/allocator.h>
29 #include <utils/logger.h>
30 #include <network/host.h>
34 * described in Header-File
36 void test_kernel_interface(tester_t
*tester
)
38 kernel_interface_t
*kernel_interface
;
43 u_int8_t enc_key_bytes
[] = {
44 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
45 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08
48 u_int8_t inc_key_bytes
[] = {
49 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
50 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08
53 chunk_t enc_key
,inc_key
;
54 enc_key
.ptr
= enc_key_bytes
;
55 enc_key
.len
= sizeof(enc_key_bytes
);
56 inc_key
.ptr
= inc_key_bytes
;
57 inc_key
.len
= sizeof(inc_key_bytes
);
61 kernel_interface
= kernel_interface_create();
63 me
= host_create(AF_INET
, "152.96.193.130", 500);
64 other
= host_create(AF_INET
, "152.96.193.130", 500);
68 //status = kernel_interface->get_spi(kernel_interface, me, other, 51, TRUE, &spi);
69 //status |= kernel_interface->get_spi(kernel_interface, me, other, 50, TRUE, &spi);
70 //tester->assert_true(tester, status == SUCCESS, "spi get");
72 status
= kernel_interface
->add_sa(kernel_interface
, me
, other
, spi
, 50, TRUE
, ENCR_AES_CBC
, 16, enc_key
,AUTH_HMAC_MD5_96
,16,inc_key
,FALSE
);
73 tester
->assert_true(tester
, status
== SUCCESS
, "build sa");
77 other
->destroy(other
);
79 kernel_interface
->destroy(kernel_interface
);