Lines Matching full:context
77 struct net_context *context; in ZTEST() local
80 ret = net_context_get(AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, &context); in ZTEST()
84 ret = net_context_get(AF_INET6, 10, IPPROTO_UDP, &context); in ZTEST()
86 "Invalid context type test failed "); in ZTEST()
88 ret = net_context_get(AF_INET6, SOCK_DGRAM, IPPROTO_ICMPV6, &context); in ZTEST()
90 "Invalid context protocol test failed"); in ZTEST()
92 ret = net_context_get(99, SOCK_DGRAM, IPPROTO_UDP, &context); in ZTEST()
94 "Invalid context family test failed"); in ZTEST()
96 ret = net_context_get(AF_INET6, SOCK_STREAM, IPPROTO_TCP, &context); in ZTEST()
98 "Invalid context proto type test failed"); in ZTEST()
100 ret = net_context_get(AF_INET6, SOCK_DGRAM, IPPROTO_TCP, &context); in ZTEST()
102 "Invalid context proto value test failed"); in ZTEST()
106 "Invalid context value test failed "); in ZTEST()
111 struct net_context *context = NULL; in ZTEST() local
114 ret = net_context_get(AF_INET6, SOCK_DGRAM, IPPROTO_UDP, &context); in ZTEST()
116 "Context get test failed"); in ZTEST()
117 zassert_not_null(context, "Got NULL context"); in ZTEST()
119 ret = net_context_put(context); in ZTEST()
121 "Context put test failed"); in ZTEST()
123 zassert_false(net_context_is_used(context), in ZTEST()
124 "Context put check test failed"); in ZTEST()
130 struct net_context *context; in ZTEST() local
137 "context get test failed"); in ZTEST()
140 ret = net_context_get(AF_INET6, SOCK_DGRAM, IPPROTO_UDP, &context); in ZTEST()
142 "Context get extra test failed"); in ZTEST()
147 "Context put test failed"); in ZTEST()
158 "Context create IPv6 UDP test failed"); in net_ctx_create()
163 "Context create IPv6 mcast test failed "); in net_ctx_create()
168 "Context create IPv4 UDP test failed"); in net_ctx_create()
174 "Context create IPv6 TCP test failed"); in net_ctx_create()
179 "Context create IPv4 TCP test failed"); in net_ctx_create()
196 "Context bind failure test failed"); in net_ctx_bind_fail()
212 "Context bind IPv6 test failed"); in net_ctx_bind_uni_success_v6()
227 "Context bind IPv4 test failed"); in net_ctx_bind_uni_success_v4()
244 "Context bind test failed "); in net_ctx_bind_mcast_success()
251 "Context listen IPv6 TCP test failed"); in net_ctx_listen_v6()
259 "Context listen IPv4 TCP test failed"); in net_ctx_listen_v4()
263 static void connect_cb(struct net_context *context, int status, in connect_cb() argument
268 if (net_context_get_family(context) != family) { in connect_cb()
270 net_context_get_family(context), family); in connect_cb()
292 "Context connect IPv6 UDP test failed"); in net_ctx_connect_v6()
299 "Context connect IPv6 TCP test failed"); in net_ctx_connect_v6()
317 "Context connect IPv6 UDP test failed"); in net_ctx_connect_v4()
324 "Context connect IPv6 TCP test failed"); in net_ctx_connect_v4()
329 static void accept_cb(struct net_context *context, in accept_cb() argument
337 if (net_context_get_family(context) != family) { in accept_cb()
339 net_context_get_family(context), family); in accept_cb()
355 "Context accept IPv6 UDP test failed"); in net_ctx_accept_v6()
367 "Context accept IPv4 UDP test failed"); in net_ctx_accept_v4()
391 "Context put IPv6 UDP test failed."); in net_ctx_put()
395 "Context put IPv6 mcast test failed"); in net_ctx_put()
399 "Context put IPv4 UDP test failed"); in net_ctx_put()
404 "Context put IPv4 TCP test failed"); in net_ctx_put()
408 "Context put IPv6 TCP test failed"); in net_ctx_put()
412 static void send_cb(struct net_context *context, int status, void *user_data) in send_cb() argument
416 if (net_context_get_family(context) != family) { in send_cb()
418 net_context_get_family(context), family); in send_cb()
437 "Context send IPv6 UDP test failed"); in net_ctx_send_v6()
451 "Context send IPv4 UDP test failed"); in net_ctx_send_v4()
471 "Context send IPv6 UDP test failed"); in net_ctx_sendto_v6()
490 "Context send IPv4 UDP test failed"); in net_ctx_sendto_v4()
493 static void recv_cb(struct net_context *context, in recv_cb() argument
516 "Context recv IPv6 UDP test failed"); in ZTEST()
539 "Context recv IPv4 UDP test failed"); in ZTEST()
570 TC_ERROR("Context sendto IPv6 UDP wrong src " in net_ctx_sendto_v6_wrong_src()
588 "Context recv IPv6 UDP test failed"); in ZTEST()
619 TC_ERROR("Context send IPv4 UDP test failed (%d)\n", ret); in net_ctx_sendto_v4_wrong_src()
636 "Context recv IPv4 UDP test failed"); in ZTEST()
661 "Context recv IPv6 UDP test failed"); in ZTEST()
689 "Context recv IPv4 UDP test failed"); in ZTEST()
708 static void recv_cb_another(struct net_context *context, in recv_cb_another() argument
731 "Context recv reconfig IPv6 UDP test failed"); in ZTEST()
756 "Context recv reconfig IPv4 UDP test failed"); in ZTEST()
775 static void recv_cb_timeout(struct net_context *context, in recv_cb_timeout() argument
803 "Context recv UDP timeout test failed"); in timeout_thread()
977 struct net_context_test *context = dev->data; in net_context_get_mac() local
979 if (context->mac_addr[2] == 0x00) { in net_context_get_mac()
981 context->mac_addr[0] = 0x00; in net_context_get_mac()
982 context->mac_addr[1] = 0x00; in net_context_get_mac()
983 context->mac_addr[2] = 0x5E; in net_context_get_mac()
984 context->mac_addr[3] = 0x00; in net_context_get_mac()
985 context->mac_addr[4] = 0x53; in net_context_get_mac()
986 context->mac_addr[5] = sys_rand8_get(); in net_context_get_mac()
989 return context->mac_addr; in net_context_get_mac()