Lines Matching +full:0 +full:x02

26 static uint8_t lladdr1[] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
27 static uint8_t lladdr2[] = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 };
57 if (memcmp(pkt->frags->data, lladdr1, sizeof(lladdr1)) == 0) { in eth_fake_send()
68 zassert_equal(ret, 0, "Cannot receive data (%d)", ret); in eth_fake_send()
70 return 0; in eth_fake_send()
85 if (net_addr_pton(AF_INET, ctx->ip_address, &addr) == 0) { in eth_fake_iface_init()
86 net_if_ipv4_addr_add(iface, &addr, NET_ADDR_MANUAL, 0); in eth_fake_iface_init()
111 zassert_true(sock >= 0, "Cannot create packet socket (%d)", -errno); in setup_socket()
120 memset(&addr, 0, sizeof(addr)); in bind_socket()
143 if (memcmp(link_addr->addr, lladdr1, sizeof(lladdr1)) != 0 && in iface_cb()
144 memcmp(link_addr->addr, lladdr2, sizeof(lladdr2)) != 0) { in iface_cb()
160 fl = zsock_fcntl(fd, F_GETFL, 0); in setblocking()
180 zassert_true(sock >= 0, "Cannot create DGRAM (UDP) socket (%d)", sock); in prepare_udp_socket()
189 zassert_equal(ret, 0, "Cannot bind DGRAM (UDP) socket (%d)", -errno); in prepare_udp_socket()
196 struct user_data ud = { 0 }; in __test_packet_sockets()
205 zassert_true(*sock1 >= 0, "Cannot create 1st socket (%d)", *sock1); in __test_packet_sockets()
208 zassert_true(*sock2 >= 0, "Cannot create 2nd socket (%d)", *sock2); in __test_packet_sockets()
211 zassert_equal(ret, 0, "Cannot bind 1st socket (%d)", -errno); in __test_packet_sockets()
214 zassert_equal(ret, 0, "Cannot bind 2nd socket (%d)", -errno); in __test_packet_sockets()
228 ssize_t sent = 0; in ZTEST()
245 0, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); in ZTEST()
251 memset(&data_to_receive, 0, sizeof(data_to_receive)); in ZTEST()
252 errno = 0; in ZTEST()
257 0, (struct sockaddr *)&sockaddr, &addrlen); in ZTEST()
265 memset(&data_to_receive, 0, sizeof(data_to_receive)); in ZTEST()
266 memset(&src, 0, sizeof(src)); in ZTEST()
268 errno = 0; in ZTEST()
274 ret = zsock_recvfrom(sock1, data_to_receive, sizeof(data_to_receive), 0, in ZTEST()
301 uint8_t data_to_send[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; in ZTEST()
304 struct user_data ud = { 0 }; in ZTEST()
315 zassert_true(sock1 >= 0, "Cannot create 1st socket (%d)", sock1); in ZTEST()
318 zassert_true(sock2 >= 0, "Cannot create 2nd socket (%d)", sock2); in ZTEST()
321 zassert_equal(ret, 0, "Cannot bind 1st socket (%d)", -errno); in ZTEST()
324 zassert_equal(ret, 0, "Cannot bind 2nd socket (%d)", -errno); in ZTEST()
329 memset(&dst, 0, sizeof(dst)); in ZTEST()
334 ret = zsock_sendto(sock2, data_to_send, sizeof(data_to_send), 0, in ZTEST()
340 memset(&src, 0, sizeof(src)); in ZTEST()
342 errno = 0; in ZTEST()
343 iter = 0; in ZTEST()
346 0, (struct sockaddr *)&src, &addrlen); in ZTEST()
349 } while (ret < 0 && errno == EAGAIN && iter < max_iter); in ZTEST()
363 ret = zsock_sendto(sock2, data_to_send, sizeof(data_to_send), 0, in ZTEST()
369 memset(&src, 0, sizeof(src)); in ZTEST()
371 ret = zsock_recvfrom(sock1, data_to_receive, sizeof(data_to_receive), 0, in ZTEST()
376 memset(&src, 0, sizeof(src)); in ZTEST()
378 errno = 0; in ZTEST()
379 iter = 0; in ZTEST()
382 0, (struct sockaddr *)&src, &addrlen); in ZTEST()
385 } while (ret < 0 && errno == EAGAIN && iter < max_iter); in ZTEST()
398 uint8_t data_to_send[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; in ZTEST()
401 struct user_data ud = { 0 }; in ZTEST()
406 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* Dst ll addr */ in ZTEST()
407 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* Src ll addr */ in ZTEST()
408 ETH_P_IP >> 8, ETH_P_IP & 0xFF, /* EtherType */ in ZTEST()
409 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 /* Payload */ in ZTEST()
412 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* Dst ll addr */ in ZTEST()
413 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* Src ll addr */ in ZTEST()
414 ETH_P_IP >> 8, ETH_P_IP & 0xFF, /* EtherType */ in ZTEST()
415 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 /* Payload */ in ZTEST()
425 zassert_true(sock1 >= 0, "Cannot create 1st socket (%d)", sock1); in ZTEST()
428 zassert_true(sock2 >= 0, "Cannot create 2nd socket (%d)", sock2); in ZTEST()
431 zassert_equal(ret, 0, "Cannot bind 1st socket (%d)", -errno); in ZTEST()
434 zassert_equal(ret, 0, "Cannot bind 2nd socket (%d)", -errno); in ZTEST()
439 memset(&dst, 0, sizeof(dst)); in ZTEST()
446 ret = zsock_sendto(sock1, data_to_send, sizeof(data_to_send), 0, in ZTEST()
452 memset(&src, 0, sizeof(src)); in ZTEST()
454 errno = 0; in ZTEST()
455 iter = 0; in ZTEST()
458 0, (struct sockaddr *)&src, &addrlen); in ZTEST()
461 } while (ret < 0 && errno == EAGAIN && iter < max_iter); in ZTEST()
470 memset(&dst, 0, sizeof(dst)); in ZTEST()
476 ret = zsock_sendto(sock2, send_payload_raw, sizeof(send_payload_raw), 0, in ZTEST()
482 memset(&src, 0, sizeof(src)); in ZTEST()
484 errno = 0; in ZTEST()
485 iter = 0; in ZTEST()
488 0, (struct sockaddr *)&src, &addrlen); in ZTEST()
491 } while (ret < 0 && errno == EAGAIN && iter < max_iter); in ZTEST()
504 uint8_t data_to_send[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; in ZTEST()
507 struct user_data ud = { 0 }; in ZTEST()
512 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* Dst ll addr */ in ZTEST()
513 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* Src ll addr */ in ZTEST()
514 ETH_P_IP >> 8, ETH_P_IP & 0xFF, /* EtherType */ in ZTEST()
515 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 /* Payload */ in ZTEST()
524 zassert_true(sock1 >= 0, "Cannot create 1st socket (%d)", sock1); in ZTEST()
527 zassert_true(sock2 >= 0, "Cannot create 2nd socket (%d)", sock2); in ZTEST()
530 zassert_true(sock3 >= 0, "Cannot create 2nd socket (%d)", sock3); in ZTEST()
533 zassert_equal(ret, 0, "Cannot bind 1st socket (%d)", -errno); in ZTEST()
536 zassert_equal(ret, 0, "Cannot bind 2nd socket (%d)", -errno); in ZTEST()
539 zassert_equal(ret, 0, "Cannot bind 2nd socket (%d)", -errno); in ZTEST()
545 memset(&dst, 0, sizeof(dst)); in ZTEST()
550 ret = zsock_sendto(sock1, data_to_send, sizeof(data_to_send), 0, in ZTEST()
556 memset(&src, 0, sizeof(src)); in ZTEST()
560 errno = 0; in ZTEST()
561 iter = 0; in ZTEST()
564 0, (struct sockaddr *)&src, &addrlen); in ZTEST()
567 } while (ret < 0 && errno == EAGAIN && iter < max_iter); in ZTEST()
576 memset(&src, 0, sizeof(src)); in ZTEST()
578 errno = 0; in ZTEST()
579 iter = 0; in ZTEST()
582 0, (struct sockaddr *)&src, &addrlen); in ZTEST()
585 } while (ret < 0 && errno == EAGAIN && iter < max_iter); in ZTEST()