ReactOS 0.4.16-dev-297-gc569aee
test_ip6.c
Go to the documentation of this file.
1#include "test_ip6.h"
2
3#include "lwip/ethip6.h"
4#include "lwip/ip6.h"
5#include "lwip/icmp6.h"
6#include "lwip/inet_chksum.h"
7#include "lwip/nd6.h"
8#include "lwip/stats.h"
10#include "lwip/prot/ip.h"
11#include "lwip/prot/ip6.h"
12
13#include "lwip/tcpip.h"
14
15#if LWIP_IPV6 /* allow to build the unit tests without IPv6 support */
16
17static struct netif test_netif6;
18static int linkoutput_ctr;
19static int linkoutput_byte_ctr;
20
21static err_t
23{
24 fail_unless(netif == &test_netif6);
25 fail_unless(p != NULL);
27 linkoutput_byte_ctr += p->tot_len;
28 return ERR_OK;
29}
30
31static err_t
33{
34 fail_unless(netif != NULL);
36 netif->output_ip6 = ethip6_output;
37 netif->mtu = 1500;
40 return ERR_OK;
41}
42
43static void
45{
46 struct netif *n;
47 fail_unless(netif_default == NULL);
49 fail_unless(n == &test_netif6);
50 netif_set_default(&test_netif6);
51}
52
53static void
55{
56 fail_unless(netif_default == &test_netif6);
57 netif_remove(&test_netif6);
58}
59
60static void
61ip6_test_handle_timers(int count)
62{
63 int i;
64 for (i = 0; i < count; i++) {
65 nd6_tmr();
66 }
67}
68
69/* Setups/teardown functions */
70
71static void
72ip6_setup(void)
73{
75 lwip_check_ensure_no_alloc(SKIP_POOL(MEMP_SYS_TIMEOUT));
76}
77
78static void
79ip6_teardown(void)
80{
81 if (netif_list->loop_first != NULL) {
82 pbuf_free(netif_list->loop_first);
83 netif_list->loop_first = NULL;
84 }
85 netif_list->loop_last = NULL;
86 /* poll until all memory is released... */
87 tcpip_thread_poll_one();
89 lwip_check_ensure_no_alloc(SKIP_POOL(MEMP_SYS_TIMEOUT));
90}
91
92
93/* Test functions */
94
95static void
96test_ip6_ll_addr_iter(int expected_ctr1, int expected_ctr2)
97{
98 fail_unless(linkoutput_ctr == 0);
99
100 /* test that nothing is sent with link uo but netif down */
101 netif_set_link_up(&test_netif6);
102 ip6_test_handle_timers(500);
103 fail_unless(linkoutput_ctr == 0);
104 netif_set_link_down(&test_netif6);
105 fail_unless(linkoutput_ctr == 0);
106
107 /* test that nothing is sent with link down but netif up */
108 netif_set_up(&test_netif6);
109 ip6_test_handle_timers(500);
110 fail_unless(linkoutput_ctr == 0);
111 netif_set_down(&test_netif6);
112 fail_unless(linkoutput_ctr == 0);
113
114 /* test what is sent with link up + netif up */
115 netif_set_link_up(&test_netif6);
116 netif_set_up(&test_netif6);
117 ip6_test_handle_timers(500);
118 fail_unless(linkoutput_ctr == expected_ctr1);
119 netif_set_down(&test_netif6);
120 netif_set_link_down(&test_netif6);
121 fail_unless(linkoutput_ctr == expected_ctr1);
122 linkoutput_ctr = 0;
123
124 netif_set_up(&test_netif6);
125 netif_set_link_up(&test_netif6);
126 ip6_test_handle_timers(500);
127 fail_unless(linkoutput_ctr == expected_ctr2);
128 netif_set_link_down(&test_netif6);
129 netif_set_down(&test_netif6);
130 fail_unless(linkoutput_ctr == expected_ctr2);
131 linkoutput_ctr = 0;
132}
133
134START_TEST(test_ip6_ll_addr)
135{
136 LWIP_UNUSED_ARG(_i);
137
138 linkoutput_ctr = 0;
139
140 /* test without link-local address */
141 test_ip6_ll_addr_iter(0, 0);
142
143 /* test with link-local address */
144 netif_create_ip6_linklocal_address(&test_netif6, 1);
145 test_ip6_ll_addr_iter(3 + LWIP_IPV6_DUP_DETECT_ATTEMPTS + LWIP_IPV6_MLD, 3);
146}
147END_TEST
148
149START_TEST(test_ip6_aton_ipv4mapped)
150{
151 int ret;
153 ip6_addr_t addr6;
154 const ip_addr_t addr_expected = IPADDR6_INIT_HOST(0, 0, 0xFFFF, 0xD4CC65D2);
155 const char *full_ipv6_addr = "0:0:0:0:0:FFFF:D4CC:65D2";
156 const char *shortened_ipv6_addr = "::FFFF:D4CC:65D2";
157 const char *full_ipv4_mapped_addr = "0:0:0:0:0:FFFF:212.204.101.210";
158 const char *shortened_ipv4_mapped_addr = "::FFFF:212.204.101.210";
159 const char *bogus_ipv4_mapped_addr = "::FFFF:212.204.101.2101";
160 LWIP_UNUSED_ARG(_i);
161
162 /* check IPv6 representation */
163 memset(&addr6, 0, sizeof(addr6));
164 ret = ip6addr_aton(full_ipv6_addr, &addr6);
165 fail_unless(ret == 1);
166 fail_unless(memcmp(&addr6, &addr_expected, 16) == 0);
167 memset(&addr, 0, sizeof(addr));
168 ret = ipaddr_aton(full_ipv6_addr, &addr);
169 fail_unless(ret == 1);
170 fail_unless(memcmp(&addr, &addr_expected, 16) == 0);
171
172 /* check shortened IPv6 representation */
173 memset(&addr6, 0, sizeof(addr6));
174 ret = ip6addr_aton(shortened_ipv6_addr, &addr6);
175 fail_unless(ret == 1);
176 fail_unless(memcmp(&addr6, &addr_expected, 16) == 0);
177 memset(&addr, 0, sizeof(addr));
178 ret = ipaddr_aton(shortened_ipv6_addr, &addr);
179 fail_unless(ret == 1);
180 fail_unless(memcmp(&addr, &addr_expected, 16) == 0);
181
182 /* checked shortened mixed representation */
183 memset(&addr6, 0, sizeof(addr6));
184 ret = ip6addr_aton(shortened_ipv4_mapped_addr, &addr6);
185 fail_unless(ret == 1);
186 fail_unless(memcmp(&addr6, &addr_expected, 16) == 0);
187 memset(&addr, 0, sizeof(addr));
188 ret = ipaddr_aton(shortened_ipv4_mapped_addr, &addr);
189 fail_unless(ret == 1);
190 fail_unless(memcmp(&addr, &addr_expected, 16) == 0);
191
192 /* checked mixed representation */
193 memset(&addr6, 0, sizeof(addr6));
194 ret = ip6addr_aton(full_ipv4_mapped_addr, &addr6);
195 fail_unless(ret == 1);
196 fail_unless(memcmp(&addr6, &addr_expected, 16) == 0);
197 memset(&addr, 0, sizeof(addr));
198 ret = ipaddr_aton(full_ipv4_mapped_addr, &addr);
199 fail_unless(ret == 1);
200 fail_unless(memcmp(&addr, &addr_expected, 16) == 0);
201
202 /* checked bogus mixed representation */
203 memset(&addr6, 0, sizeof(addr6));
204 ret = ip6addr_aton(bogus_ipv4_mapped_addr, &addr6);
205 fail_unless(ret == 0);
206 memset(&addr, 0, sizeof(addr));
207 ret = ipaddr_aton(bogus_ipv4_mapped_addr, &addr);
208 fail_unless(ret == 0);
209}
210END_TEST
211
212START_TEST(test_ip6_ntoa_ipv4mapped)
213{
214 const ip_addr_t addr = IPADDR6_INIT_HOST(0, 0, 0xFFFF, 0xD4CC65D2);
215 char buf[128];
216 char *str;
217 LWIP_UNUSED_ARG(_i);
218
219 str = ip6addr_ntoa_r(ip_2_ip6(&addr), buf, sizeof(buf));
220 fail_unless(str == buf);
221 fail_unless(!strcmp(str, "::FFFF:212.204.101.210"));
222}
223END_TEST
224
225struct test_addr_and_str {
227 const char *str;
228};
229
230START_TEST(test_ip6_ntoa)
231{
232 struct test_addr_and_str tests[] = {
233 {IPADDR6_INIT_HOST(0xfe800000, 0x00000000, 0xb2a1a2ff, 0xfea3a4a5), "FE80::B2A1:A2FF:FEA3:A4A5"}, /* test shortened zeros */
234 {IPADDR6_INIT_HOST(0xfe800000, 0xff000000, 0xb2a1a2ff, 0xfea3a4a5), "FE80:0:FF00:0:B2A1:A2FF:FEA3:A4A5"}, /* don't omit single zero blocks */
235 {IPADDR6_INIT_HOST(0xfe800000, 0xff000000, 0xb2000000, 0x0000a4a5), "FE80:0:FF00:0:B200::A4A5"}, /* omit longest zero block */
236 };
237 char buf[128];
238 char *str;
239 size_t i;
240 LWIP_UNUSED_ARG(_i);
241
242 for (i = 0; i < LWIP_ARRAYSIZE(tests); i++) {
243 str = ip6addr_ntoa_r(ip_2_ip6(&tests[i].addr), buf, sizeof(buf));
244 fail_unless(str == buf);
245 fail_unless(!strcmp(str, tests[i].str));
246 }
247}
248END_TEST
249
250START_TEST(test_ip6_lladdr)
251{
252 u8_t zeros[128];
253 const u8_t test_mac_addr[6] = {0xb0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5};
254 const u32_t expected_ip6_addr_1[4] = {PP_HTONL(0xfe800000), 0, PP_HTONL(0xb2a1a2ff), PP_HTONL(0xfea3a4a5)};
255 const u32_t expected_ip6_addr_2[4] = {PP_HTONL(0xfe800000), 0, PP_HTONL(0x0000b0a1), PP_HTONL(0xa2a3a4a5)};
256 LWIP_UNUSED_ARG(_i);
257 memset(zeros, 0, sizeof(zeros));
258
259 fail_unless(test_netif6.hwaddr_len == 6);
260 fail_unless(!memcmp(test_netif6.hwaddr, zeros, 6));
261
262 fail_unless(test_netif6.ip6_addr_state[0] == 0);
263 fail_unless(!memcmp(netif_ip6_addr(&test_netif6, 0), zeros, sizeof(ip6_addr_t)));
264
265 /* set specific mac addr */
266 memcpy(test_netif6.hwaddr, test_mac_addr, 6);
267
268 /* create link-local addr based on mac (EUI-48) */
269 netif_create_ip6_linklocal_address(&test_netif6, 1);
270 fail_unless(IP_IS_V6(&test_netif6.ip6_addr[0]));
271 fail_unless(!memcmp(&netif_ip6_addr(&test_netif6, 0)->addr, expected_ip6_addr_1, 16));
272#if LWIP_IPV6_SCOPES
273 fail_unless(netif_ip6_addr(&test_netif6, 0)->zone == (test_netif6.num + 1));
274#endif
275 /* reset address */
276 memset(&test_netif6.ip6_addr[0], 0, sizeof(ip6_addr_t));
277 test_netif6.ip6_addr_state[0] = 0;
278
279 /* create link-local addr based interface ID */
280 netif_create_ip6_linklocal_address(&test_netif6, 0);
281 fail_unless(IP_IS_V6(&test_netif6.ip6_addr[0]));
282 fail_unless(!memcmp(&netif_ip6_addr(&test_netif6, 0)->addr, expected_ip6_addr_2, 16));
283#if LWIP_IPV6_SCOPES
284 fail_unless(netif_ip6_addr(&test_netif6, 0)->zone == (test_netif6.num + 1));
285#endif
286 /* reset address */
287 memset(&test_netif6.ip6_addr[0], 0, sizeof(ip6_addr_t));
288 test_netif6.ip6_addr_state[0] = 0;
289
290 /* reset mac address */
291 memset(&test_netif6.hwaddr, 0, sizeof(test_netif6.hwaddr));
292}
293END_TEST
294
295static struct pbuf *cloned_pbuf = NULL;
296static err_t clone_output(struct netif *netif, struct pbuf *p, const ip6_addr_t *addr) {
299 cloned_pbuf = pbuf_clone(PBUF_RAW, PBUF_RAM, p);
300 return ERR_OK;
301}
302
303/* Reproduces bug #58553 */
304START_TEST(test_ip6_dest_unreachable_chained_pbuf)
305{
306
307 ip_addr_t my_addr = IPADDR6_INIT_HOST(0x20010db8, 0x0, 0x0, 0x1);
308 ip_addr_t peer_addr = IPADDR6_INIT_HOST(0x20010db8, 0x0, 0x0, 0x4);
309 /* Create chained pbuf with UDP data that will get destination unreachable */
310 u8_t udp_hdr[] = {
311 0x60, 0x00, 0x27, 0x03, 0x00, 0x2d, 0x11, 0x40,
312 0x20, 0x01, 0x0d, 0xb8, 0x00, 0x00, 0x00, 0x00,
313 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
314 0x20, 0x01, 0x0d, 0xb8, 0x00, 0x00, 0x00, 0x00,
315 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
316 0x01, 0xff, 0x03, 0xff, 0x00, 0x2d, 0x00, 0x00,
317 };
318 struct pbuf *header = pbuf_alloc(PBUF_RAW, sizeof(udp_hdr), PBUF_ROM);
319 u8_t udp_payload[] = "abcdefghijklmnopqrstuvwxyz0123456789";
320 struct pbuf *data = pbuf_alloc(PBUF_RAW, sizeof(udp_payload), PBUF_ROM);
321 u8_t *icmpptr;
322 struct ip6_hdr *outhdr;
323 struct icmp6_hdr *icmp6hdr;
324 LWIP_UNUSED_ARG(_i);
325
326 fail_unless(header);
327 header->payload = udp_hdr;
328 fail_unless(data);
329 data->payload = udp_payload;
331 data = NULL;
332
333 /* Configure and enable local address */
334 netif_set_up(&test_netif6);
335 netif_ip6_addr_set(&test_netif6, 0, ip_2_ip6(&my_addr));
336 netif_ip6_addr_set_state(&test_netif6, 0, IP6_ADDR_VALID);
337 test_netif6.output_ip6 = clone_output;
338
339 /* Process packet and send ICMPv6 reply for unreachable UDP port */
340 ip6_input(header, &test_netif6);
341 header = NULL;
342
343 /* Verify ICMP reply packet contents */
344 fail_unless(cloned_pbuf);
345 fail_unless(cloned_pbuf->len == IP6_HLEN + ICMP6_HLEN + sizeof(udp_hdr) + sizeof(udp_payload));
346 outhdr = (struct ip6_hdr*) cloned_pbuf->payload;
347 fail_unless(ip6_addr_packed_eq(ip_2_ip6(&my_addr), &outhdr->src, IP6_NO_ZONE));
348 fail_unless(ip6_addr_packed_eq(ip_2_ip6(&peer_addr), &outhdr->dest, IP6_NO_ZONE));
349 icmpptr = &((u8_t*)cloned_pbuf->payload)[IP6_HLEN];
350 icmp6hdr = (struct icmp6_hdr*) icmpptr;
351 fail_unless(icmp6hdr->type == ICMP6_TYPE_DUR);
352 fail_unless(icmp6hdr->code == ICMP6_DUR_PORT);
353 fail_unless(icmp6hdr->data == lwip_htonl(0));
354 icmpptr += ICMP6_HLEN;
355 fail_unless(memcmp(icmpptr, udp_hdr, sizeof(udp_hdr)) == 0, "mismatch in copied ip6/udp header");
356 icmpptr += sizeof(udp_hdr);
357 fail_unless(memcmp(icmpptr, udp_payload, sizeof(udp_payload)) == 0, "mismatch in copied udp payload");
358 pbuf_free(cloned_pbuf);
359}
360END_TEST
361
362/* Reproduces bug #57374 */
363START_TEST(test_ip6_frag_pbuf_len_assert)
364{
365 ip_addr_t my_addr = IPADDR6_INIT_HOST(0x20010db8, 0x0, 0x0, 0x1);
366 ip_addr_t peer_addr = IPADDR6_INIT_HOST(0x20010db8, 0x0, 0x0, 0x4);
367 struct pbuf *payload, *hdr;
368 err_t err;
369 int i;
370 LWIP_UNUSED_ARG(_i);
371
372 /* Configure and enable local address */
373 test_netif6.mtu = 1500;
374 netif_set_up(&test_netif6);
375 netif_ip6_addr_set(&test_netif6, 0, ip_2_ip6(&my_addr));
376 netif_ip6_addr_set_state(&test_netif6, 0, IP6_ADDR_VALID);
377
378 /* Create packet with lots of small pbufs around mtu limit */
380 fail_unless(payload != NULL);
381 for (i = 0; i < 16; i++) {
382 struct pbuf *p = pbuf_alloc(PBUF_RAW, 32, PBUF_RAM);
383 fail_unless(p != NULL);
385 }
386 /* Prefix with header like UDP would */
388 fail_unless(hdr != NULL);
390
391 /* Send it and don't crash while fragmenting */
392 err = ip6_output_if_src(hdr, ip_2_ip6(&my_addr), ip_2_ip6(&peer_addr), 15, 0, IP_PROTO_UDP, &test_netif6);
393 fail_unless(err == ERR_OK);
394
395 pbuf_free(hdr);
397}
398END_TEST
399
400static err_t direct_output(struct netif *netif, struct pbuf *p, const ip6_addr_t *addr) {
402 return netif->linkoutput(netif, p);
403}
404
405START_TEST(test_ip6_frag)
406{
407 ip_addr_t my_addr = IPADDR6_INIT_HOST(0x20010db8, 0x0, 0x0, 0x1);
408 ip_addr_t peer_addr = IPADDR6_INIT_HOST(0x20010db8, 0x0, 0x0, 0x4);
409 struct pbuf *data;
410 err_t err;
411 LWIP_UNUSED_ARG(_i);
412
413 /* Configure and enable local address */
414 test_netif6.mtu = 1500;
415 netif_set_up(&test_netif6);
416 netif_ip6_addr_set(&test_netif6, 0, ip_2_ip6(&my_addr));
417 netif_ip6_addr_set_state(&test_netif6, 0, IP6_ADDR_VALID);
418 test_netif6.output_ip6 = direct_output;
419 /* Reset counters after multicast traffic */
420 linkoutput_ctr = 0;
422
423 /* Verify that 8000 byte payload is split into six packets */
425 fail_unless(data != NULL);
426 err = ip6_output_if_src(data, ip_2_ip6(&my_addr), ip_2_ip6(&peer_addr),
427 15, 0, IP_PROTO_UDP, &test_netif6);
428 fail_unless(err == ERR_OK);
429 fail_unless(linkoutput_ctr == 6);
430 fail_unless(linkoutput_byte_ctr == (8000 + (6 * (IP6_HLEN + IP6_FRAG_HLEN))));
432}
433END_TEST
434
436Suite *
437ip6_suite(void)
438{
439 testfunc tests[] = {
440 TESTFUNC(test_ip6_ll_addr),
441 TESTFUNC(test_ip6_aton_ipv4mapped),
442 TESTFUNC(test_ip6_ntoa_ipv4mapped),
443 TESTFUNC(test_ip6_ntoa),
444 TESTFUNC(test_ip6_lladdr),
445 TESTFUNC(test_ip6_dest_unreachable_chained_pbuf),
446 TESTFUNC(test_ip6_frag_pbuf_len_assert),
447 TESTFUNC(test_ip6_frag)
448 };
449 return create_suite("IPv6", tests, sizeof(tests)/sizeof(testfunc), ip6_setup, ip6_teardown);
450}
451
452#else /* LWIP_IPV6 */
453
454/* allow to build the unit tests without IPv6 support */
455START_TEST(test_ip6_dummy)
456{
457 LWIP_UNUSED_ARG(_i);
458}
459END_TEST
460
461Suite *
463{
464 testfunc tests[] = {
465 TESTFUNC(test_ip6_dummy),
466 };
467 return create_suite("IPv6", tests, sizeof(tests)/sizeof(testfunc), NULL, NULL);
468}
469#endif /* LWIP_IPV6 */
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define START_TEST(x)
Definition: atltest.h:75
#define LWIP_ARRAYSIZE(x)
Definition: def.h:69
#define lwip_htonl(x)
Definition: def.h:88
#define PP_HTONL(x)
Definition: def.h:92
#define NULL
Definition: types.h:112
#define IP_PROTO_UDP
Definition: ip.h:48
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble n
Definition: glext.h:7729
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum const GLvoid * addr
Definition: glext.h:9621
GLfloat GLfloat p
Definition: glext.h:8902
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
uint32_t u32_t
Definition: arch.h:129
uint8_t u8_t
Definition: arch.h:125
#define LWIP_UNUSED_ARG(x)
Definition: arch.h:373
s8_t err_t
Definition: err.h:96
@ ERR_OK
Definition: err.h:55
#define LWIP_IPV6_DUP_DETECT_ATTEMPTS
Definition: opt.h:2541
#define LWIP_IPV6_MLD
Definition: opt.h:2590
#define NETIF_FLAG_ETHERNET
Definition: netif.h:101
#define NETIF_FLAG_MLD6
Definition: netif.h:107
#define NETIF_FLAG_BROADCAST
Definition: netif.h:87
void netif_set_link_down(struct netif *netif)
Definition: netif.c:1056
void netif_set_down(struct netif *netif)
Definition: netif.c:949
void netif_remove(struct netif *netif)
Definition: netif.c:764
void netif_set_default(struct netif *netif)
Definition: netif.c:849
void netif_set_link_up(struct netif *netif)
Definition: netif.c:1018
void netif_set_up(struct netif *netif)
Definition: netif.c:871
struct netif * netif_add_noaddr(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input)
Definition: netif.c:250
void pbuf_cat(struct pbuf *h, struct pbuf *t)
Definition: pbuf.c:855
void pbuf_chain(struct pbuf *h, struct pbuf *t)
Definition: pbuf.c:897
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
Definition: pbuf.c:224
u8_t pbuf_free(struct pbuf *p)
Definition: pbuf.c:727
struct pbuf * pbuf_clone(pbuf_layer layer, pbuf_type type, struct pbuf *p)
Definition: pbuf.c:1337
@ PBUF_ROM
Definition: pbuf.h:156
@ PBUF_RAM
Definition: pbuf.h:152
@ PBUF_POOL
Definition: pbuf.h:167
@ PBUF_RAW
Definition: pbuf.h:111
@ PBUF_IP
Definition: pbuf.h:97
#define ip_2_ip6(ipaddr)
Definition: ip_addr.h:356
ip6_addr_t ip_addr_t
Definition: ip_addr.h:344
#define ipaddr_aton(cp, addr)
Definition: ip_addr.h:387
#define IP_IS_V6(ipaddr)
Definition: ip_addr.h:350
#define IPADDR6_INIT_HOST(a, b, c, d)
Definition: ip_addr.h:346
char hdr[14]
Definition: iptest.cpp:33
#define ETH_HWADDR_LEN
Definition: ethernet.h:51
Suite * create_suite(const char *name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown)
#define SKIP_POOL(x)
Definition: lwip_check.h:48
void lwip_check_ensure_no_alloc(unsigned int skip)
#define TESTFUNC(x)
Definition: lwip_check.h:22
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static struct test_info tests[]
DWORD zone
Definition: sec_mgr.c:1754
struct netif * netif_list
Definition: netif.c:113
struct netif * netif_default
Definition: netif.c:115
@ ICMP6_DUR_PORT
Definition: icmp6.h:108
#define ICMP6_HLEN
Definition: icmp6.h:149
@ ICMP6_TYPE_DUR
Definition: icmp6.h:49
#define IP6_FRAG_HLEN
Definition: ip6.h:205
#define IP6_HLEN
Definition: ip6.h:64
#define err(...)
const WCHAR * str
#define memset(x, y, z)
Definition: compat.h:39
Definition: ip6.h:82
Definition: netif.h:269
u8_t flags
Definition: netif.h:354
u16_t mtu
Definition: netif.h:344
netif_linkoutput_fn linkoutput
Definition: netif.h:308
u8_t hwaddr_len
Definition: netif.h:352
Definition: pbuf.h:186
u16_t len
Definition: pbuf.h:203
void * payload
Definition: pbuf.h:191
Definition: udp.h:53
static err_t default_netif_linkoutput(struct netif *netif, struct pbuf *p)
Definition: test_etharp.c:37
static err_t default_netif_init(struct netif *netif)
Definition: test_etharp.c:46
static void default_netif_add(void)
Definition: test_etharp.c:58
static void default_netif_remove(void)
Definition: test_etharp.c:71
static int linkoutput_ctr
Definition: test_etharp.c:23
static int linkoutput_byte_ctr
Definition: test_ip4.c:20
END_TEST Suite * ip6_suite(void)
Definition: test_ip6.c:462
int ret