Free (GPLv2) TCP/IP stack developed by TASS Belgium

Dependents:   lpc1768-picotcp-demo ZeroMQ_PicoTCP_Publisher_demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test ... more

PicoTCP. Copyright (c) 2013 TASS Belgium NV.

Released under the GNU General Public License, version 2.

Different licensing models may exist, at the sole discretion of the Copyright holders.

Official homepage: http://www.picotcp.com

Bug tracker: https://github.com/tass-belgium/picotcp/issues

Development steps:

  • initial integration with mbed RTOS
  • generic mbed Ethernet driver
  • high performance NXP LPC1768 specific Ethernet driver
  • Multi-threading support for mbed RTOS
  • Berkeley sockets and integration with the New Socket API
  • Fork of the apps running on top of the New Socket API
  • Scheduling optimizations
  • Debugging/benchmarking/testing

Demo application (measuring TCP sender performance):

Import programlpc1768-picotcp-demo

A PicoTCP demo app testing the ethernet throughput on the lpc1768 mbed board.

Committer:
tass
Date:
Mon Sep 28 13:16:18 2015 +0200
Revision:
152:a3d286bf94e5
Parent:
149:5f4cb161cec3
Child:
154:6c0e92a80c4a
Mercurial: latest development version of PicoTCP

Who changed what in which revision?

UserRevisionLine numberNew contents of line
TASS Belgium NV 131:4758606c9316 1 /*********************************************************************
tass 152:a3d286bf94e5 2 PicoTCP. Copyright (c) 2012-2015 Altran Intelligent Systems. Some rights reserved.
TASS Belgium NV 131:4758606c9316 3 See LICENSE and COPYING for usage.
tass 73:dfb737147f6e 4
TASS Belgium NV 131:4758606c9316 5 *********************************************************************/
tass picotcp@tass.be 149:5f4cb161cec3 6 #ifndef INCLUDE_PICO_SOCKET
tass picotcp@tass.be 149:5f4cb161cec3 7 #define INCLUDE_PICO_SOCKET
tass 68:0847e35d08a6 8 #include "pico_queue.h"
tass 68:0847e35d08a6 9 #include "pico_addressing.h"
tass 68:0847e35d08a6 10 #include "pico_config.h"
tass 68:0847e35d08a6 11 #include "pico_protocol.h"
tass picotcp@tass.be 149:5f4cb161cec3 12 #include "pico_tree.h"
tass 68:0847e35d08a6 13
TASS Belgium NV 131:4758606c9316 14 #ifdef __linux__
tass picotcp@tass.be 137:a1c8bfa9d691 15 #define PICO_DEFAULT_SOCKETQ (16 * 1024) /* Linux host, so we want full throttle */
tass 73:dfb737147f6e 16 #else
tass 152:a3d286bf94e5 17 #define PICO_DEFAULT_SOCKETQ (6 * 1024) /* seems like an acceptable default for small embedded systems */
tass 73:dfb737147f6e 18 #endif
tass 68:0847e35d08a6 19
tass 68:0847e35d08a6 20 #define PICO_SHUT_RD 1
tass 68:0847e35d08a6 21 #define PICO_SHUT_WR 2
tass 68:0847e35d08a6 22 #define PICO_SHUT_RDWR 3
tass 68:0847e35d08a6 23
tass 152:a3d286bf94e5 24 #ifdef PICO_SUPPORT_IPV4
tass 152:a3d286bf94e5 25 # define IS_SOCK_IPV4(s) ((s->net == &pico_proto_ipv4))
tass 152:a3d286bf94e5 26 #else
tass 152:a3d286bf94e5 27 # define IS_SOCK_IPV4(s) (0)
tass 152:a3d286bf94e5 28 #endif
tass 152:a3d286bf94e5 29
tass 152:a3d286bf94e5 30 #ifdef PICO_SUPPORT_IPV6
tass 152:a3d286bf94e5 31 # define IS_SOCK_IPV6(s) ((s->net == &pico_proto_ipv6))
tass 152:a3d286bf94e5 32 #else
tass 152:a3d286bf94e5 33 # define IS_SOCK_IPV6(s) (0)
tass 152:a3d286bf94e5 34 #endif
tass 152:a3d286bf94e5 35
tass 152:a3d286bf94e5 36
tass picotcp@tass.be 149:5f4cb161cec3 37 struct pico_sockport
tass picotcp@tass.be 149:5f4cb161cec3 38 {
tass picotcp@tass.be 149:5f4cb161cec3 39 struct pico_tree socks; /* how you make the connection ? */
tass picotcp@tass.be 149:5f4cb161cec3 40 uint16_t number;
tass picotcp@tass.be 149:5f4cb161cec3 41 uint16_t proto;
tass picotcp@tass.be 149:5f4cb161cec3 42 };
tass picotcp@tass.be 149:5f4cb161cec3 43
tass 68:0847e35d08a6 44
tass 68:0847e35d08a6 45 struct pico_socket {
TASS Belgium NV 131:4758606c9316 46 struct pico_protocol *proto;
TASS Belgium NV 131:4758606c9316 47 struct pico_protocol *net;
tass 68:0847e35d08a6 48
tass picotcp@tass.be 149:5f4cb161cec3 49 union pico_address local_addr;
tass picotcp@tass.be 149:5f4cb161cec3 50 union pico_address remote_addr;
tass 68:0847e35d08a6 51
TASS Belgium NV 131:4758606c9316 52 uint16_t local_port;
TASS Belgium NV 131:4758606c9316 53 uint16_t remote_port;
tass 68:0847e35d08a6 54
TASS Belgium NV 131:4758606c9316 55 struct pico_queue q_in;
TASS Belgium NV 131:4758606c9316 56 struct pico_queue q_out;
tass 68:0847e35d08a6 57
TASS Belgium NV 131:4758606c9316 58 void (*wakeup)(uint16_t ev, struct pico_socket *s);
tass 68:0847e35d08a6 59
tass 68:0847e35d08a6 60
tass 68:0847e35d08a6 61 #ifdef PICO_SUPPORT_TCP
TASS Belgium NV 131:4758606c9316 62 /* For the TCP backlog queue */
TASS Belgium NV 131:4758606c9316 63 struct pico_socket *backlog;
TASS Belgium NV 131:4758606c9316 64 struct pico_socket *next;
TASS Belgium NV 131:4758606c9316 65 struct pico_socket *parent;
tass picotcp@tass.be 149:5f4cb161cec3 66 uint16_t max_backlog;
tass picotcp@tass.be 149:5f4cb161cec3 67 uint16_t number_of_pending_conn;
tass 68:0847e35d08a6 68 #endif
tass 68:0847e35d08a6 69 #ifdef PICO_SUPPORT_MCAST
TASS Belgium NV 131:4758606c9316 70 struct pico_tree *MCASTListen;
tass 152:a3d286bf94e5 71 #ifdef PICO_SUPPORT_IPV6
tass 152:a3d286bf94e5 72 struct pico_tree *MCASTListen_ipv6;
tass 152:a3d286bf94e5 73 #endif
tass 68:0847e35d08a6 74 #endif
TASS Belgium NV 131:4758606c9316 75 uint16_t ev_pending;
tass 68:0847e35d08a6 76
TASS Belgium NV 131:4758606c9316 77 struct pico_device *dev;
tass 68:0847e35d08a6 78
TASS Belgium NV 131:4758606c9316 79 /* Private field. */
TASS Belgium NV 131:4758606c9316 80 int id;
TASS Belgium NV 131:4758606c9316 81 uint16_t state;
TASS Belgium NV 131:4758606c9316 82 uint16_t opt_flags;
TASS Belgium NV 131:4758606c9316 83 pico_time timestamp;
TASS Belgium NV 131:4758606c9316 84 void *priv;
tass 68:0847e35d08a6 85 };
tass 68:0847e35d08a6 86
tass picotcp@tass.be 149:5f4cb161cec3 87 struct pico_remote_endpoint {
tass picotcp@tass.be 149:5f4cb161cec3 88 union pico_address remote_addr;
TASS Belgium NV 131:4758606c9316 89 uint16_t remote_port;
tass 68:0847e35d08a6 90 };
tass 68:0847e35d08a6 91
tass 68:0847e35d08a6 92
tass 68:0847e35d08a6 93 /* request struct for multicast socket opt */
tass 152:a3d286bf94e5 94 // Deprecated!
tass 68:0847e35d08a6 95 struct pico_ip_mreq {
TASS Belgium NV 131:4758606c9316 96 struct pico_ip4 mcast_group_addr;
TASS Belgium NV 131:4758606c9316 97 struct pico_ip4 mcast_link_addr;
tass 68:0847e35d08a6 98 };
tass 68:0847e35d08a6 99
tass 68:0847e35d08a6 100 struct pico_ip_mreq_source {
TASS Belgium NV 131:4758606c9316 101 struct pico_ip4 mcast_group_addr;
TASS Belgium NV 131:4758606c9316 102 struct pico_ip4 mcast_source_addr;
TASS Belgium NV 131:4758606c9316 103 struct pico_ip4 mcast_link_addr;
tass 68:0847e35d08a6 104 };
tass 152:a3d286bf94e5 105 // [end] Deprecated
tass 152:a3d286bf94e5 106 // Use this instead:
tass 152:a3d286bf94e5 107 struct pico_mreq {
tass 152:a3d286bf94e5 108 union pico_address mcast_group_addr;
tass 152:a3d286bf94e5 109 union pico_address mcast_link_addr;
tass 152:a3d286bf94e5 110 };
tass 152:a3d286bf94e5 111 struct pico_mreq_source {
tass 152:a3d286bf94e5 112 union pico_address mcast_group_addr;
tass 152:a3d286bf94e5 113 union pico_address mcast_source_addr;
tass 152:a3d286bf94e5 114 union pico_address mcast_link_addr;
tass 152:a3d286bf94e5 115 };
tass 152:a3d286bf94e5 116
tass 68:0847e35d08a6 117
tass picotcp@tass.be 149:5f4cb161cec3 118 #define PICO_SOCKET_STATE_UNDEFINED 0x0000u
tass picotcp@tass.be 149:5f4cb161cec3 119 #define PICO_SOCKET_STATE_SHUT_LOCAL 0x0001u
tass picotcp@tass.be 149:5f4cb161cec3 120 #define PICO_SOCKET_STATE_SHUT_REMOTE 0x0002u
tass picotcp@tass.be 149:5f4cb161cec3 121 #define PICO_SOCKET_STATE_BOUND 0x0004u
tass picotcp@tass.be 149:5f4cb161cec3 122 #define PICO_SOCKET_STATE_CONNECTED 0x0008u
tass picotcp@tass.be 149:5f4cb161cec3 123 #define PICO_SOCKET_STATE_CLOSING 0x0010u
tass picotcp@tass.be 149:5f4cb161cec3 124 #define PICO_SOCKET_STATE_CLOSED 0x0020u
tass 68:0847e35d08a6 125
tass picotcp@tass.be 149:5f4cb161cec3 126 # define PICO_SOCKET_STATE_TCP 0xFF00u
tass picotcp@tass.be 149:5f4cb161cec3 127 # define PICO_SOCKET_STATE_TCP_UNDEF 0x00FFu
tass picotcp@tass.be 149:5f4cb161cec3 128 # define PICO_SOCKET_STATE_TCP_CLOSED 0x0100u
tass picotcp@tass.be 149:5f4cb161cec3 129 # define PICO_SOCKET_STATE_TCP_LISTEN 0x0200u
tass picotcp@tass.be 149:5f4cb161cec3 130 # define PICO_SOCKET_STATE_TCP_SYN_SENT 0x0300u
tass picotcp@tass.be 149:5f4cb161cec3 131 # define PICO_SOCKET_STATE_TCP_SYN_RECV 0x0400u
tass picotcp@tass.be 149:5f4cb161cec3 132 # define PICO_SOCKET_STATE_TCP_ESTABLISHED 0x0500u
tass picotcp@tass.be 149:5f4cb161cec3 133 # define PICO_SOCKET_STATE_TCP_CLOSE_WAIT 0x0600u
tass picotcp@tass.be 149:5f4cb161cec3 134 # define PICO_SOCKET_STATE_TCP_LAST_ACK 0x0700u
tass picotcp@tass.be 149:5f4cb161cec3 135 # define PICO_SOCKET_STATE_TCP_FIN_WAIT1 0x0800u
tass picotcp@tass.be 149:5f4cb161cec3 136 # define PICO_SOCKET_STATE_TCP_FIN_WAIT2 0x0900u
tass picotcp@tass.be 149:5f4cb161cec3 137 # define PICO_SOCKET_STATE_TCP_CLOSING 0x0a00u
tass picotcp@tass.be 149:5f4cb161cec3 138 # define PICO_SOCKET_STATE_TCP_TIME_WAIT 0x0b00u
tass picotcp@tass.be 149:5f4cb161cec3 139 # define PICO_SOCKET_STATE_TCP_ARRAYSIZ 0x0cu
tass 68:0847e35d08a6 140
tass picotcp@tass.be 149:5f4cb161cec3 141
tass picotcp@tass.be 149:5f4cb161cec3 142 /* Socket options */
tass 68:0847e35d08a6 143 # define PICO_TCP_NODELAY 1
tass picotcp@tass.be 149:5f4cb161cec3 144 # define PICO_SOCKET_OPT_TCPNODELAY 0x0000u
tass 68:0847e35d08a6 145
tass 68:0847e35d08a6 146 # define PICO_IP_MULTICAST_EXCLUDE 0
tass 68:0847e35d08a6 147 # define PICO_IP_MULTICAST_INCLUDE 1
tass 68:0847e35d08a6 148 # define PICO_IP_MULTICAST_IF 32
tass 68:0847e35d08a6 149 # define PICO_IP_MULTICAST_TTL 33
tass 68:0847e35d08a6 150 # define PICO_IP_MULTICAST_LOOP 34
tass 68:0847e35d08a6 151 # define PICO_IP_ADD_MEMBERSHIP 35
tass 68:0847e35d08a6 152 # define PICO_IP_DROP_MEMBERSHIP 36
tass 68:0847e35d08a6 153 # define PICO_IP_UNBLOCK_SOURCE 37
tass 68:0847e35d08a6 154 # define PICO_IP_BLOCK_SOURCE 38
tass 68:0847e35d08a6 155 # define PICO_IP_ADD_SOURCE_MEMBERSHIP 39
tass 68:0847e35d08a6 156 # define PICO_IP_DROP_SOURCE_MEMBERSHIP 40
tass 68:0847e35d08a6 157
tass 68:0847e35d08a6 158 # define PICO_SOCKET_OPT_MULTICAST_LOOP 1
tass 152:a3d286bf94e5 159 # define PICO_SOCKET_OPT_KEEPIDLE 4
tass 152:a3d286bf94e5 160 # define PICO_SOCKET_OPT_KEEPINTVL 5
tass 152:a3d286bf94e5 161 # define PICO_SOCKET_OPT_KEEPCNT 6
tass 152:a3d286bf94e5 162
tass 152:a3d286bf94e5 163 #define PICO_SOCKET_OPT_LINGER 13
tass 68:0847e35d08a6 164
tass picotcp@tass.be 149:5f4cb161cec3 165 # define PICO_SOCKET_OPT_RCVBUF 52
tass picotcp@tass.be 149:5f4cb161cec3 166 # define PICO_SOCKET_OPT_SNDBUF 53
tass picotcp@tass.be 149:5f4cb161cec3 167
tass 152:a3d286bf94e5 168
tass picotcp@tass.be 149:5f4cb161cec3 169 /* Constants */
tass 68:0847e35d08a6 170 # define PICO_IP_DEFAULT_MULTICAST_TTL 1
tass 68:0847e35d08a6 171 # define PICO_IP_DEFAULT_MULTICAST_LOOP 1
tass 68:0847e35d08a6 172
tass 152:a3d286bf94e5 173 #define PICO_SOCKET_TIMEOUT 5000u /* 5 seconds */
tass 152:a3d286bf94e5 174 #define PICO_SOCKET_LINGER_TIMEOUT 3000u /* 3 seconds */
TASS Belgium NV 131:4758606c9316 175 #define PICO_SOCKET_BOUND_TIMEOUT 30000u /* 30 seconds */
tass 68:0847e35d08a6 176
tass picotcp@tass.be 149:5f4cb161cec3 177 #define PICO_SOCKET_SHUTDOWN_WRITE 0x01u
tass picotcp@tass.be 149:5f4cb161cec3 178 #define PICO_SOCKET_SHUTDOWN_READ 0x02u
tass 68:0847e35d08a6 179 #define TCPSTATE(s) ((s)->state & PICO_SOCKET_STATE_TCP)
tass 68:0847e35d08a6 180
tass picotcp@tass.be 149:5f4cb161cec3 181 #define PICO_SOCK_EV_RD 1u
tass picotcp@tass.be 149:5f4cb161cec3 182 #define PICO_SOCK_EV_WR 2u
tass picotcp@tass.be 149:5f4cb161cec3 183 #define PICO_SOCK_EV_CONN 4u
tass picotcp@tass.be 149:5f4cb161cec3 184 #define PICO_SOCK_EV_CLOSE 8u
tass picotcp@tass.be 149:5f4cb161cec3 185 #define PICO_SOCK_EV_FIN 0x10u
tass picotcp@tass.be 149:5f4cb161cec3 186 #define PICO_SOCK_EV_ERR 0x80u
tass 68:0847e35d08a6 187
tass 152:a3d286bf94e5 188 struct pico_msginfo {
tass 152:a3d286bf94e5 189 struct pico_device *dev;
tass 152:a3d286bf94e5 190 uint8_t ttl;
tass 152:a3d286bf94e5 191 uint8_t tos;
tass 152:a3d286bf94e5 192 };
tass 68:0847e35d08a6 193
tass 68:0847e35d08a6 194 struct pico_socket *pico_socket_open(uint16_t net, uint16_t proto, void (*wakeup)(uint16_t ev, struct pico_socket *s));
tass 68:0847e35d08a6 195
tass 68:0847e35d08a6 196 int pico_socket_read(struct pico_socket *s, void *buf, int len);
tass 68:0847e35d08a6 197 int pico_socket_write(struct pico_socket *s, const void *buf, int len);
tass 68:0847e35d08a6 198
tass 68:0847e35d08a6 199 int pico_socket_sendto(struct pico_socket *s, const void *buf, int len, void *dst, uint16_t remote_port);
tass 152:a3d286bf94e5 200 int pico_socket_sendto_extended(struct pico_socket *s, const void *buf, const int len,
tass 152:a3d286bf94e5 201 void *dst, uint16_t remote_port, struct pico_msginfo *msginfo);
tass 152:a3d286bf94e5 202
tass 68:0847e35d08a6 203 int pico_socket_recvfrom(struct pico_socket *s, void *buf, int len, void *orig, uint16_t *local_port);
tass 152:a3d286bf94e5 204 int pico_socket_recvfrom_extended(struct pico_socket *s, void *buf, int len, void *orig,
tass 152:a3d286bf94e5 205 uint16_t *remote_port, struct pico_msginfo *msginfo);
tass 68:0847e35d08a6 206
tass 68:0847e35d08a6 207 int pico_socket_send(struct pico_socket *s, const void *buf, int len);
tass 68:0847e35d08a6 208 int pico_socket_recv(struct pico_socket *s, void *buf, int len);
tass 68:0847e35d08a6 209
tass 68:0847e35d08a6 210 int pico_socket_bind(struct pico_socket *s, void *local_addr, uint16_t *port);
tass picotcp@tass.be 149:5f4cb161cec3 211 int pico_socket_getname(struct pico_socket *s, void *local_addr, uint16_t *port, uint16_t *proto);
tass 152:a3d286bf94e5 212 int pico_socket_getpeername(struct pico_socket *s, void *remote_addr, uint16_t *port, uint16_t *proto);
tass picotcp@tass.be 149:5f4cb161cec3 213
tass 68:0847e35d08a6 214 int pico_socket_connect(struct pico_socket *s, const void *srv_addr, uint16_t remote_port);
tass 68:0847e35d08a6 215 int pico_socket_listen(struct pico_socket *s, const int backlog);
tass 68:0847e35d08a6 216 struct pico_socket *pico_socket_accept(struct pico_socket *s, void *orig, uint16_t *port);
tass 70:cd218dd180e5 217 int8_t pico_socket_del(struct pico_socket *s);
tass 68:0847e35d08a6 218
tass 68:0847e35d08a6 219 int pico_socket_setoption(struct pico_socket *s, int option, void *value);
tass 68:0847e35d08a6 220 int pico_socket_getoption(struct pico_socket *s, int option, void *value);
tass 68:0847e35d08a6 221
tass 68:0847e35d08a6 222 int pico_socket_shutdown(struct pico_socket *s, int mode);
tass 68:0847e35d08a6 223 int pico_socket_close(struct pico_socket *s);
tass 68:0847e35d08a6 224
tass 70:cd218dd180e5 225 struct pico_frame *pico_socket_frame_alloc(struct pico_socket *s, uint16_t len);
tass 68:0847e35d08a6 226
tass 68:0847e35d08a6 227 #ifdef PICO_SUPPORT_IPV4
tass 68:0847e35d08a6 228 # define is_sock_ipv4(x) (x->net == &pico_proto_ipv4)
tass 68:0847e35d08a6 229 #else
tass 68:0847e35d08a6 230 # define is_sock_ipv4(x) (0)
tass 68:0847e35d08a6 231 #endif
tass 68:0847e35d08a6 232
tass 68:0847e35d08a6 233 #ifdef PICO_SUPPORT_IPV6
tass 68:0847e35d08a6 234 # define is_sock_ipv6(x) (x->net == &pico_proto_ipv6)
tass 68:0847e35d08a6 235 #else
tass 68:0847e35d08a6 236 # define is_sock_ipv6(x) (0)
tass 68:0847e35d08a6 237 #endif
tass 68:0847e35d08a6 238
tass 68:0847e35d08a6 239 #ifdef PICO_SUPPORT_UDP
tass 152:a3d286bf94e5 240 # define is_sock_udp(x) (x->proto == &pico_proto_udp)
tass 68:0847e35d08a6 241 #else
tass 68:0847e35d08a6 242 # define is_sock_udp(x) (0)
tass 68:0847e35d08a6 243 #endif
tass 68:0847e35d08a6 244
tass 68:0847e35d08a6 245 #ifdef PICO_SUPPORT_TCP
tass 152:a3d286bf94e5 246 # define is_sock_tcp(x) (x->proto == &pico_proto_tcp)
tass 68:0847e35d08a6 247 #else
tass 68:0847e35d08a6 248 # define is_sock_tcp(x) (0)
tass 68:0847e35d08a6 249 #endif
tass 68:0847e35d08a6 250
tass 68:0847e35d08a6 251 /* Interface towards transport protocol */
tass 68:0847e35d08a6 252 int pico_transport_process_in(struct pico_protocol *self, struct pico_frame *f);
tass 68:0847e35d08a6 253 struct pico_socket *pico_socket_clone(struct pico_socket *facsimile);
tass 70:cd218dd180e5 254 int8_t pico_socket_add(struct pico_socket *s);
tass 68:0847e35d08a6 255 int pico_transport_error(struct pico_frame *f, uint8_t proto, int code);
tass 68:0847e35d08a6 256
tass 68:0847e35d08a6 257 /* Socket loop */
tass 68:0847e35d08a6 258 int pico_sockets_loop(int loop_score);
TASS Belgium NV 131:4758606c9316 259 struct pico_socket*pico_sockets_find(uint16_t local, uint16_t remote);
tass 68:0847e35d08a6 260 /* Port check */
tass 68:0847e35d08a6 261 int pico_is_port_free(uint16_t proto, uint16_t port, void *addr, void *net);
tass 68:0847e35d08a6 262
tass picotcp@tass.be 149:5f4cb161cec3 263 struct pico_sockport *pico_get_sockport(uint16_t proto, uint16_t port);
tass picotcp@tass.be 149:5f4cb161cec3 264
tass 152:a3d286bf94e5 265 uint32_t pico_socket_get_mss(struct pico_socket *s);
tass picotcp@tass.be 149:5f4cb161cec3 266 int pico_socket_set_family(struct pico_socket *s, uint16_t family);
tass picotcp@tass.be 149:5f4cb161cec3 267
tass 152:a3d286bf94e5 268 int pico_count_sockets(uint8_t proto);
tass 152:a3d286bf94e5 269
tass picotcp@tass.be 149:5f4cb161cec3 270 #define PICO_SOCKET_SETOPT_EN(socket, index) (socket->opt_flags |= (1 << index))
tass picotcp@tass.be 149:5f4cb161cec3 271 #define PICO_SOCKET_SETOPT_DIS(socket, index) (socket->opt_flags &= (uint16_t) ~(1 << index))
tass picotcp@tass.be 149:5f4cb161cec3 272 #define PICO_SOCKET_GETOPT(socket, index) ((socket->opt_flags & (1u << index)) != 0)
tass picotcp@tass.be 149:5f4cb161cec3 273
tass 68:0847e35d08a6 274
tass 68:0847e35d08a6 275 #endif