Zephyr Project API  3.1.0
A Scalable Open Source RTOS
net_context.h
Go to the documentation of this file.
1
7/*
8 * Copyright (c) 2016 Intel Corporation
9 * Copyright (c) 2021 Nordic Semiconductor
10 *
11 * SPDX-License-Identifier: Apache-2.0
12 */
13
14#ifndef ZEPHYR_INCLUDE_NET_NET_CONTEXT_H_
15#define ZEPHYR_INCLUDE_NET_NET_CONTEXT_H_
16
24#include <zephyr/kernel.h>
25#include <zephyr/sys/atomic.h>
26
27#include <zephyr/net/net_ip.h>
28#include <zephyr/net/net_if.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
36#define NET_CONTEXT_IN_USE BIT(0)
37
47};
48
54#define NET_CONTEXT_FAMILY (BIT(3) | BIT(4) | BIT(5))
55
57#define NET_CONTEXT_TYPE (BIT(6) | BIT(7))
58
60#define NET_CONTEXT_REMOTE_ADDR_SET BIT(8)
61
63#define NET_CONTEXT_ACCEPTING_SOCK BIT(9)
64
66#define NET_CONTEXT_CLOSING_SOCK BIT(10)
67
68/* Context is bound to a specific interface */
69#define NET_CONTEXT_BOUND_TO_IFACE BIT(11)
70
71struct net_context;
72
93typedef void (*net_context_recv_cb_t)(struct net_context *context,
94 struct net_pkt *pkt,
95 union net_ip_header *ip_hdr,
96 union net_proto_header *proto_hdr,
97 int status,
98 void *user_data);
99
114typedef void (*net_context_send_cb_t)(struct net_context *context,
115 int status,
116 void *user_data);
117
134typedef void (*net_tcp_accept_cb_t)(struct net_context *new_context,
135 struct sockaddr *addr,
136 socklen_t addrlen,
137 int status,
138 void *user_data);
139
161typedef void (*net_context_connect_cb_t)(struct net_context *context,
162 int status,
163 void *user_data);
164
165/* The net_pkt_get_slab_func_t is here in order to avoid circular
166 * dependency between net_pkt.h and net_context.h
167 */
176typedef struct k_mem_slab *(*net_pkt_get_slab_func_t)(void);
177
178/* The net_pkt_get_pool_func_t is here in order to avoid circular
179 * dependency between net_pkt.h and net_context.h
180 */
189typedef struct net_buf_pool *(*net_pkt_get_pool_func_t)(void);
190
191struct net_tcp;
192
193struct net_conn_handle;
194
201__net_socket struct net_context {
208
212
215 struct k_mutex lock;
216
220 struct sockaddr_ptr local;
221
226
228 struct net_conn_handle *conn_handler;
229
234
239
244
245#if defined(CONFIG_NET_CONTEXT_NET_PKT_POOL)
249
252 net_pkt_get_pool_func_t data_pool;
253#endif /* CONFIG_NET_CONTEXT_NET_PKT_POOL */
254
255#if defined(CONFIG_NET_TCP)
257 void *tcp;
258#endif /* CONFIG_NET_TCP */
259
260#if defined(CONFIG_NET_CONTEXT_SYNC_RECV)
264 struct k_sem recv_data_wait;
265#endif /* CONFIG_NET_CONTEXT_SYNC_RECV */
266
267#if defined(CONFIG_NET_SOCKETS)
269 void *socket_data;
270
272 union {
273 struct k_fifo recv_q;
274 struct k_fifo accept_q;
275 };
276
277 struct {
279 struct k_condvar recv;
280
282 struct k_mutex *lock;
283 } cond;
284#endif /* CONFIG_NET_SOCKETS */
285
286#if defined(CONFIG_NET_OFFLOAD)
288 void *offload_context;
289#endif /* CONFIG_NET_OFFLOAD */
290
291#if defined(CONFIG_NET_SOCKETS_CAN)
292 int can_filter_id;
293#endif /* CONFIG_NET_SOCKETS_CAN */
294
296 struct {
297#if defined(CONFIG_NET_CONTEXT_PRIORITY)
299 uint8_t priority;
300#endif
301#if defined(CONFIG_NET_CONTEXT_TXTIME)
302 bool txtime;
303#endif
304#if defined(CONFIG_SOCKS)
305 struct {
306 struct sockaddr addr;
307 socklen_t addrlen;
308 } proxy;
309#endif
310#if defined(CONFIG_NET_CONTEXT_RCVTIMEO)
311 k_timeout_t rcvtimeo;
312#endif
313#if defined(CONFIG_NET_CONTEXT_SNDTIMEO)
314 k_timeout_t sndtimeo;
315#endif
316#if defined(CONFIG_NET_CONTEXT_RCVBUF)
317 uint16_t rcvbuf;
318#endif
319#if defined(CONFIG_NET_CONTEXT_SNDBUF)
320 uint16_t sndbuf;
321#endif
323
326
329
332
334 union {
337 };
338
339#if defined(CONFIG_SOCKS)
340 bool proxy_enabled;
341#endif
342
343};
344
345static inline bool net_context_is_used(struct net_context *context)
346{
347 NET_ASSERT(context);
348
349 return context->flags & NET_CONTEXT_IN_USE;
350}
351
352static inline bool net_context_is_bound_to_iface(struct net_context *context)
353{
354 NET_ASSERT(context);
355
356 return context->flags & NET_CONTEXT_BOUND_TO_IFACE;
357}
358
366static inline bool net_context_is_accepting(struct net_context *context)
367{
368 NET_ASSERT(context);
369
370 return context->flags & NET_CONTEXT_ACCEPTING_SOCK;
371}
372
379static inline void net_context_set_accepting(struct net_context *context,
380 bool accepting)
381{
382 NET_ASSERT(context);
383
384 if (accepting) {
386 } else {
387 context->flags &= ~NET_CONTEXT_ACCEPTING_SOCK;
388 }
389}
390
398static inline bool net_context_is_closing(struct net_context *context)
399{
400 NET_ASSERT(context);
401
402 return context->flags & NET_CONTEXT_CLOSING_SOCK;
403}
404
411static inline void net_context_set_closing(struct net_context *context,
412 bool closing)
413{
414 NET_ASSERT(context);
415
416 if (closing) {
418 } else {
419 context->flags &= ~NET_CONTEXT_CLOSING_SOCK;
420 }
421}
422
423#define NET_CONTEXT_STATE_SHIFT 1
424#define NET_CONTEXT_STATE_MASK 0x03
425
435static inline
437{
438 NET_ASSERT(context);
439
440 return (enum net_context_state)
441 ((context->flags >> NET_CONTEXT_STATE_SHIFT) &
443}
444
453static inline void net_context_set_state(struct net_context *context,
455{
456 NET_ASSERT(context);
457
459 context->flags |= ((state & NET_CONTEXT_STATE_MASK) <<
461}
462
473static inline sa_family_t net_context_get_family(struct net_context *context)
474{
475 NET_ASSERT(context);
476
477 return ((context->flags & NET_CONTEXT_FAMILY) >> 3);
478}
479
489static inline void net_context_set_family(struct net_context *context,
490 sa_family_t family)
491{
492 uint8_t flag = 0U;
493
494 NET_ASSERT(context);
495
496 if (family == AF_UNSPEC || family == AF_INET || family == AF_INET6 ||
497 family == AF_PACKET || family == AF_CAN) {
498 /* Family is in BIT(4), BIT(5) and BIT(6) */
499 flag = family << 3;
500 }
501
502 context->flags |= flag;
503}
504
515static inline
517{
518 NET_ASSERT(context);
519
520 return (enum net_sock_type)((context->flags & NET_CONTEXT_TYPE) >> 6);
521}
522
532static inline void net_context_set_type(struct net_context *context,
533 enum net_sock_type type)
534{
535 uint16_t flag = 0U;
536
537 NET_ASSERT(context);
538
539 if (type == SOCK_DGRAM || type == SOCK_STREAM || type == SOCK_RAW) {
540 /* Type is in BIT(6) and BIT(7)*/
541 flag = type << 6;
542 }
543
544 context->flags |= flag;
545}
546
555#if defined(CONFIG_NET_SOCKETS_CAN)
556static inline void net_context_set_filter_id(struct net_context *context,
557 int filter_id)
558{
559 NET_ASSERT(context);
560
561 context->can_filter_id = filter_id;
562}
563#else
564static inline void net_context_set_filter_id(struct net_context *context,
565 int filter_id)
566{
567 ARG_UNUSED(context);
568 ARG_UNUSED(filter_id);
569}
570#endif
571
581#if defined(CONFIG_NET_SOCKETS_CAN)
582static inline int net_context_get_filter_id(struct net_context *context)
583{
584 NET_ASSERT(context);
585
586 return context->can_filter_id;
587}
588#else
589static inline int net_context_get_filter_id(struct net_context *context)
590{
591 ARG_UNUSED(context);
592
593 return -1;
594}
595#endif
596
607static inline uint16_t net_context_get_ip_proto(struct net_context *context)
608{
609 return context->proto;
610}
611
622static inline void net_context_set_ip_proto(struct net_context *context,
623 uint16_t proto)
624{
625 context->proto = proto;
626}
627
638static inline
640{
641 NET_ASSERT(context);
642
643 return net_if_get_by_index(context->iface);
644}
645
654static inline void net_context_set_iface(struct net_context *context,
655 struct net_if *iface)
656{
657 NET_ASSERT(iface);
658
659 context->iface = net_if_get_by_iface(iface);
660}
661
662static inline uint8_t net_context_get_ipv4_ttl(struct net_context *context)
663{
664 return context->ipv4_ttl;
665}
666
667static inline void net_context_set_ipv4_ttl(struct net_context *context,
668 uint8_t ttl)
669{
670 context->ipv4_ttl = ttl;
671}
672
674{
675 return context->ipv6_hop_limit;
676}
677
678static inline void net_context_set_ipv6_hop_limit(struct net_context *context,
679 uint8_t hop_limit)
680{
681 context->ipv6_hop_limit = hop_limit;
682}
683
684#if defined(CONFIG_SOCKS)
685static inline void net_context_set_proxy_enabled(struct net_context *context,
686 bool enable)
687{
688 context->proxy_enabled = enable;
689}
690
691static inline bool net_context_is_proxy_enabled(struct net_context *context)
692{
693 return context->proxy_enabled;
694}
695#else
696static inline void net_context_set_proxy_enabled(struct net_context *context,
697 bool enable)
698{
699 ARG_UNUSED(context);
700 ARG_UNUSED(enable);
701}
702
703static inline bool net_context_is_proxy_enabled(struct net_context *context)
704{
705 return false;
706}
707#endif
708
727 enum net_sock_type type,
728 uint16_t ip_proto,
729 struct net_context **context);
730
744int net_context_put(struct net_context *context);
745
758int net_context_ref(struct net_context *context);
759
773int net_context_unref(struct net_context *context);
774
785#if defined(CONFIG_NET_IPV4)
786int net_context_create_ipv4_new(struct net_context *context,
787 struct net_pkt *pkt,
788 const struct in_addr *src,
789 const struct in_addr *dst);
790#else
791static inline int net_context_create_ipv4_new(struct net_context *context,
792 struct net_pkt *pkt,
793 const struct in_addr *src,
794 const struct in_addr *dst)
795{
796 return -1;
797}
798#endif /* CONFIG_NET_IPV4 */
799
810#if defined(CONFIG_NET_IPV6)
811int net_context_create_ipv6_new(struct net_context *context,
812 struct net_pkt *pkt,
813 const struct in6_addr *src,
814 const struct in6_addr *dst);
815#else
816static inline int net_context_create_ipv6_new(struct net_context *context,
817 struct net_pkt *pkt,
818 const struct in6_addr *src,
819 const struct in6_addr *dst)
820{
821 return -1;
822}
823#endif /* CONFIG_NET_IPV6 */
824
836int net_context_bind(struct net_context *context,
837 const struct sockaddr *addr,
838 socklen_t addrlen);
839
850int net_context_listen(struct net_context *context,
851 int backlog);
852
882 const struct sockaddr *addr,
883 socklen_t addrlen,
886 void *user_data);
887
913int net_context_accept(struct net_context *context,
916 void *user_data);
917
937int net_context_send(struct net_context *context,
938 const void *buf,
939 size_t len,
942 void *user_data);
943
965int net_context_sendto(struct net_context *context,
966 const void *buf,
967 size_t len,
968 const struct sockaddr *dst_addr,
969 socklen_t addrlen,
972 void *user_data);
973
993 const struct msghdr *msghdr,
994 int flags,
997 void *user_data);
998
1035int net_context_recv(struct net_context *context,
1038 void *user_data);
1039
1061 int32_t delta);
1062
1071};
1072
1084 enum net_context_option option,
1085 const void *value, size_t len);
1086
1098 enum net_context_option option,
1099 void *value, size_t *len);
1100
1108typedef void (*net_context_cb_t)(struct net_context *context, void *user_data);
1109
1118
1139#if defined(CONFIG_NET_CONTEXT_NET_PKT_POOL)
1140static inline void net_context_setup_pools(struct net_context *context,
1142 net_pkt_get_pool_func_t data_pool)
1143{
1144 NET_ASSERT(context);
1145
1146 context->tx_slab = tx_slab;
1147 context->data_pool = data_pool;
1148}
1149#else
1150#define net_context_setup_pools(context, tx_pool, data_pool)
1151#endif
1152
1167 uint16_t local_port, const struct sockaddr *local_addr);
1168
1169#ifdef __cplusplus
1170}
1171#endif
1172
1177#endif /* ZEPHYR_INCLUDE_NET_NET_CONTEXT_H_ */
long atomic_t
Definition: atomic.h:22
ZTEST_BMEM int timeout
Definition: main.c:31
unsigned short int sa_family_t
Definition: net_ip.h:164
#define AF_CAN
Definition: net_ip.h:56
#define AF_INET
Definition: net_ip.h:53
#define AF_INET6
Definition: net_ip.h:54
#define AF_PACKET
Definition: net_ip.h:55
net_sock_type
Definition: net_ip.h:84
size_t socklen_t
Definition: net_ip.h:167
#define AF_UNSPEC
Definition: net_ip.h:52
net_ip_protocol
Definition: net_ip.h:62
@ SOCK_DGRAM
Definition: net_ip.h:86
@ SOCK_RAW
Definition: net_ip.h:87
@ SOCK_STREAM
Definition: net_ip.h:85
static void net_context_set_type(struct net_context *context, enum net_sock_type type)
Set context type for this network context.
Definition: net_context.h:532
void(* net_context_cb_t)(struct net_context *context, void *user_data)
Callback used while iterating over network contexts.
Definition: net_context.h:1108
void(* net_context_recv_cb_t)(struct net_context *context, struct net_pkt *pkt, union net_ip_header *ip_hdr, union net_proto_header *proto_hdr, int status, void *user_data)
Network data receive callback.
Definition: net_context.h:93
static void net_context_set_ipv6_hop_limit(struct net_context *context, uint8_t hop_limit)
Definition: net_context.h:678
int net_context_unref(struct net_context *context)
Decrement the reference count to a network context.
int net_context_bind(struct net_context *context, const struct sockaddr *addr, socklen_t addrlen)
Assign a socket a local address.
static void net_context_set_iface(struct net_context *context, struct net_if *iface)
Set network interface for this context.
Definition: net_context.h:654
static void net_context_set_ipv4_ttl(struct net_context *context, uint8_t ttl)
Definition: net_context.h:667
int net_context_accept(struct net_context *context, net_tcp_accept_cb_t cb, k_timeout_t timeout, void *user_data)
Accept a network connection attempt.
int net_context_put(struct net_context *context)
Close and unref a network context.
static enum net_sock_type net_context_get_type(struct net_context *context)
Get context type for this network context.
Definition: net_context.h:516
static bool net_context_is_accepting(struct net_context *context)
Is this context is accepting data now.
Definition: net_context.h:366
static sa_family_t net_context_get_family(struct net_context *context)
Get address family for this network context.
Definition: net_context.h:473
static bool net_context_is_bound_to_iface(struct net_context *context)
Definition: net_context.h:352
static void net_context_set_filter_id(struct net_context *context, int filter_id)
Set CAN filter id for this network context.
Definition: net_context.h:564
void(* net_tcp_accept_cb_t)(struct net_context *new_context, struct sockaddr *addr, socklen_t addrlen, int status, void *user_data)
Accept callback.
Definition: net_context.h:134
static void net_context_set_ip_proto(struct net_context *context, uint16_t proto)
Set context IP protocol for this network context.
Definition: net_context.h:622
int net_context_listen(struct net_context *context, int backlog)
Mark the context as a listening one.
static bool net_context_is_used(struct net_context *context)
Definition: net_context.h:345
int net_context_sendmsg(struct net_context *context, const struct msghdr *msghdr, int flags, net_context_send_cb_t cb, k_timeout_t timeout, void *user_data)
Send data in iovec to a peer specified in msghdr struct.
struct k_mem_slab *(* net_pkt_get_slab_func_t)(void)
Function that is called to get the slab that is used for net_pkt allocations.
Definition: net_context.h:176
int net_context_ref(struct net_context *context)
Take a reference count to a net_context, preventing destruction.
static uint16_t net_context_get_ip_proto(struct net_context *context)
Get context IP protocol for this network context.
Definition: net_context.h:607
void(* net_context_send_cb_t)(struct net_context *context, int status, void *user_data)
Network data send callback.
Definition: net_context.h:114
static enum net_context_state net_context_get_state(struct net_context *context)
Get state for this network context.
Definition: net_context.h:436
struct net_buf_pool *(* net_pkt_get_pool_func_t)(void)
Function that is called to get the pool that is used for net_buf allocations.
Definition: net_context.h:189
int net_context_connect(struct net_context *context, const struct sockaddr *addr, socklen_t addrlen, net_context_connect_cb_t cb, k_timeout_t timeout, void *user_data)
Create a network connection.
static bool net_context_is_proxy_enabled(struct net_context *context)
Definition: net_context.h:703
#define NET_CONTEXT_IN_USE
Definition: net_context.h:36
static void net_context_set_accepting(struct net_context *context, bool accepting)
Set this context to accept data now.
Definition: net_context.h:379
net_context_state
Definition: net_context.h:39
bool net_context_port_in_use(enum net_ip_protocol ip_proto, uint16_t local_port, const struct sockaddr *local_addr)
Check if a port is in use (bound)
static void net_context_set_family(struct net_context *context, sa_family_t family)
Set address family for this network context.
Definition: net_context.h:489
static int net_context_create_ipv6_new(struct net_context *context, struct net_pkt *pkt, const struct in6_addr *src, const struct in6_addr *dst)
Create IPv6 packet in provided net_pkt from context.
Definition: net_context.h:816
static int net_context_create_ipv4_new(struct net_context *context, struct net_pkt *pkt, const struct in_addr *src, const struct in_addr *dst)
Create IPv4 packet in provided net_pkt from context.
Definition: net_context.h:791
int net_context_recv(struct net_context *context, net_context_recv_cb_t cb, k_timeout_t timeout, void *user_data)
Receive network data from a peer specified by context.
static int net_context_get_filter_id(struct net_context *context)
Get CAN filter id for this network context.
Definition: net_context.h:589
#define NET_CONTEXT_CLOSING_SOCK
Definition: net_context.h:66
static uint8_t net_context_get_ipv6_hop_limit(struct net_context *context)
Definition: net_context.h:673
static void net_context_set_closing(struct net_context *context, bool closing)
Set this context to closing.
Definition: net_context.h:411
static void net_context_set_proxy_enabled(struct net_context *context, bool enable)
Definition: net_context.h:696
static uint8_t net_context_get_ipv4_ttl(struct net_context *context)
Definition: net_context.h:662
#define NET_CONTEXT_BOUND_TO_IFACE
Definition: net_context.h:69
void(* net_context_connect_cb_t)(struct net_context *context, int status, void *user_data)
Connection callback.
Definition: net_context.h:161
static void net_context_set_state(struct net_context *context, enum net_context_state state)
Set state for this network context.
Definition: net_context.h:453
net_context_option
Definition: net_context.h:1063
int net_context_update_recv_wnd(struct net_context *context, int32_t delta)
Update TCP receive window for context.
void net_context_foreach(net_context_cb_t cb, void *user_data)
Go through all the network connections and call callback for each network context.
int net_context_set_option(struct net_context *context, enum net_context_option option, const void *value, size_t len)
Set an connection option for this context.
#define NET_CONTEXT_STATE_MASK
Definition: net_context.h:424
int net_context_send(struct net_context *context, const void *buf, size_t len, net_context_send_cb_t cb, k_timeout_t timeout, void *user_data)
Send data to a peer.
static bool net_context_is_closing(struct net_context *context)
Is this context closing.
Definition: net_context.h:398
#define NET_CONTEXT_FAMILY
Definition: net_context.h:54
#define NET_CONTEXT_TYPE
Definition: net_context.h:57
#define NET_CONTEXT_STATE_SHIFT
Definition: net_context.h:423
#define net_context_setup_pools(context, tx_pool, data_pool)
Set custom network buffer pools for context send operations.
Definition: net_context.h:1150
int net_context_get(sa_family_t family, enum net_sock_type type, uint16_t ip_proto, struct net_context **context)
Get network context.
#define NET_CONTEXT_ACCEPTING_SOCK
Definition: net_context.h:63
int net_context_get_option(struct net_context *context, enum net_context_option option, void *value, size_t *len)
Get connection option value for this context.
int net_context_sendto(struct net_context *context, const void *buf, size_t len, const struct sockaddr *dst_addr, socklen_t addrlen, net_context_send_cb_t cb, k_timeout_t timeout, void *user_data)
Send data to a peer specified by address.
static struct net_if * net_context_get_iface(struct net_context *context)
Get network interface for this context.
Definition: net_context.h:639
@ NET_CONTEXT_CONNECTED
Definition: net_context.h:45
@ NET_CONTEXT_IDLE
Definition: net_context.h:40
@ NET_CONTEXT_CONNECTING
Definition: net_context.h:43
@ NET_CONTEXT_READY
Definition: net_context.h:44
@ NET_CONTEXT_UNCONNECTED
Definition: net_context.h:41
@ NET_CONTEXT_CONFIGURING
Definition: net_context.h:42
@ NET_CONTEXT_LISTENING
Definition: net_context.h:46
@ NET_OPT_SNDBUF
Definition: net_context.h:1070
@ NET_OPT_PRIORITY
Definition: net_context.h:1064
@ NET_OPT_RCVTIMEO
Definition: net_context.h:1067
@ NET_OPT_TXTIME
Definition: net_context.h:1065
@ NET_OPT_SNDTIMEO
Definition: net_context.h:1068
@ NET_OPT_SOCKS5
Definition: net_context.h:1066
@ NET_OPT_RCVBUF
Definition: net_context.h:1069
int net_if_get_by_iface(struct net_if *iface)
Get interface index according to pointer.
struct net_if * net_if_get_by_index(int index)
Get interface according to index.
flags
Definition: http_parser.h:131
state
Definition: http_parser_state.h:29
Public kernel APIs.
Public API for network interface.
IPv6 and IPv4 definitions.
Network statistics.
static ssize_t recv(int sock, void *buf, size_t max_len, int flags)
Definition: socket.h:66
__INT32_TYPE__ int32_t
Definition: stdint.h:74
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
__INT8_TYPE__ int8_t
Definition: stdint.h:72
Definition: net_ip.h:139
Definition: net_ip.h:151
Definition: kernel.h:2807
Definition: kernel.h:2186
Definition: kernel.h:2699
Kernel timeout type.
Definition: sys_clock.h:65
Definition: net_ip.h:235
Network buffer pool representation.
Definition: buf.h:982
Definition: net_context.h:201
atomic_t refcount
Definition: net_context.h:211
void * user_data
Definition: net_context.h:207
uint16_t flags
Definition: net_context.h:328
net_context_send_cb_t send_cb
Definition: net_context.h:238
struct sockaddr remote
Definition: net_context.h:225
struct k_mutex lock
Definition: net_context.h:215
struct sockaddr_ptr local
Definition: net_context.h:220
struct net_context::@199 options
uint8_t ipv4_ttl
Definition: net_context.h:336
net_context_connect_cb_t connect_cb
Definition: net_context.h:243
struct net_conn_handle * conn_handler
Definition: net_context.h:228
uint16_t proto
Definition: net_context.h:325
int8_t iface
Definition: net_context.h:331
void * tcp
Definition: net_context.h:257
net_context_recv_cb_t recv_cb
Definition: net_context.h:233
uint8_t ipv6_hop_limit
Definition: net_context.h:335
Network Interface structure.
Definition: net_if.h:478
Network packet.
Definition: net_pkt.h:59
Definition: net_ip.h:341
static uint32_t flag[3]
Definition: thread_competition.c:23
static const intptr_t user_data[5]
Definition: main.c:590