socket.h
Go to the documentation of this file.
1 /**
2  * @file socket.h
3  * @brief Socket API
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2019 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 1.9.6
29  **/
30 
31 #ifndef _SOCKET_H
32 #define _SOCKET_H
33 
34 //Forward declaration of Socket structure
35 struct _Socket;
36 #define Socket struct _Socket
37 
38 //Dependencies
39 #include "core/net.h"
40 #include "core/ip.h"
41 #include "core/tcp.h"
42 
43 //Number of sockets that can be opened simultaneously
44 #ifndef SOCKET_MAX_COUNT
45  #define SOCKET_MAX_COUNT 16
46 #elif (SOCKET_MAX_COUNT < 1)
47  #error SOCKET_MAX_COUNT parameter is not valid
48 #endif
49 
50 //Dynamic port range (lower limit)
51 #ifndef SOCKET_EPHEMERAL_PORT_MIN
52  #define SOCKET_EPHEMERAL_PORT_MIN 49152
53 #elif (SOCKET_EPHEMERAL_PORT_MIN < 1024)
54  #error SOCKET_EPHEMERAL_PORT_MIN parameter is not valid
55 #endif
56 
57 //Dynamic port range (upper limit)
58 #ifndef SOCKET_EPHEMERAL_PORT_MAX
59  #define SOCKET_EPHEMERAL_PORT_MAX 65535
60 #elif (SOCKET_EPHEMERAL_PORT_MAX <= SOCKET_EPHEMERAL_PORT_MIN || SOCKET_EPHEMERAL_PORT_MAX > 65535)
61  #error SOCKET_EPHEMERAL_PORT_MAX parameter is not valid
62 #endif
63 
64 //C++ guard
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
69 
70 /**
71  * @brief Socket types
72  **/
73 
74 typedef enum
75 {
81 } SocketType;
82 
83 
84 /**
85  * @brief IP protocols
86  **/
87 
88 typedef enum
89 {
96 
97 
98 /**
99  * @brief Ethernet protocols
100  **/
101 
102 typedef enum
103 {
110 
111 
112 /**
113  * @brief Flags used by I/O functions
114  **/
115 
116 typedef enum
117 {
127 } SocketFlags;
128 
129 
130 //The SOCKET_FLAG_BREAK macro causes the I/O functions to stop reading
131 //data whenever the specified break character is encountered
132 #define SOCKET_FLAG_BREAK(c) (SOCKET_FLAG_BREAK_CHAR | LSB(c))
133 
134 
135 /**
136  * @brief Flags used by shutdown function
137  **/
138 
139 typedef enum
140 {
145 
146 
147 /**
148  * @brief Socket events
149  **/
150 
151 typedef enum
152 {
164 } SocketEvent;
165 
166 
167 /**
168  * @brief Host types
169  **/
170 
171 typedef enum
172 {
176 } HostType;
177 
178 
179 /**
180  * @brief Name resolution protocols
181  **/
182 
183 typedef enum
184 {
191 
192 
193 /**
194  * @brief Receive queue item
195  **/
196 
197 typedef struct _SocketQueueItem
198 {
201  uint16_t srcPort;
204  size_t offset;
206 
207 
208 /**
209  * @brief Structure describing a socket
210  **/
211 
212 struct _Socket
213 {
219  uint16_t localPort;
221  uint16_t remotePort;
223  uint8_t ttl;
224  uint8_t multicastTtl;
230 
231 //TCP specific variables
232 #if (TCP_SUPPORT == ENABLED)
233  TcpState state; ///<Current state of the TCP finite state machine
234  bool_t ownedFlag; ///<The user is the owner of the TCP socket
235  bool_t closedFlag; ///<The connection has been closed properly
236  bool_t resetFlag; ///<The connection has been reset
237 
238  uint16_t smss; ///<Sender maximum segment size
239  uint16_t rmss; ///<Receiver maximum segment size
240  uint32_t iss; ///<Initial send sequence number
241  uint32_t irs; ///<Initial receive sequence number
242 
243  uint32_t sndUna; ///<Data that have been sent but not yet acknowledged
244  uint32_t sndNxt; ///<Sequence number of the next byte to be sent
245  uint16_t sndUser; ///<Amount of data buffered but not yet sent
246  uint16_t sndWnd; ///<Size of the send window
247  uint16_t maxSndWnd; ///<Maximum send window it has seen so far on the connection
248  uint32_t sndWl1; ///<Segment sequence number used for last window update
249  uint32_t sndWl2; ///<Segment acknowledgment number used for last window update
250 
251  uint32_t rcvNxt; ///<Receive next sequence number
252  uint16_t rcvUser; ///<Number of data received but not yet consumed
253  uint16_t rcvWnd; ///<Receive window
254 
255  bool_t rttBusy; ///<RTT measurement is being performed
256  uint32_t rttSeqNum; ///<Sequence number identifying a TCP segment
257  systime_t rttStartTime; ///<Round-trip start time
258  systime_t srtt; ///<Smoothed round-trip time
259  systime_t rttvar; ///<Round-trip time variation
260  systime_t rto; ///<Retransmission timeout
261 
262 #if (TCP_CONGEST_CONTROL_SUPPORT == ENABLED)
263  TcpCongestState congestState; ///<Congestion state
264  uint16_t cwnd; ///<Congestion window
265  uint16_t ssthresh; ///<Slow start threshold
266  uint_t dupAckCount; ///<Number of consecutive duplicate ACKs
267  uint_t n; ///<Number of bytes acknowledged during the whole round-trip
268  uint32_t recover; ///<NewReno modification to TCP's fast recovery algorithm
269 #endif
270 
271  TcpTxBuffer txBuffer; ///<Send buffer
272  size_t txBufferSize; ///<Size of the send buffer
273  TcpRxBuffer rxBuffer; ///<Receive buffer
274  size_t rxBufferSize; ///<Size of the receive buffer
275 
276  TcpQueueItem *retransmitQueue; ///<Retransmission queue
277  TcpTimer retransmitTimer; ///<Retransmission timer
278  uint_t retransmitCount; ///<Number of retransmissions
279 
280  TcpSynQueueItem *synQueue; ///<SYN queue for listening sockets
281  uint_t synQueueSize; ///<Maximum number of pending connections for listening sockets
282 
283  uint_t wndProbeCount; ///<Zero window probe counter
284  systime_t wndProbeInterval; ///<Interval between successive probes
285 
286  TcpTimer persistTimer; ///<Persist timer
287  TcpTimer overrideTimer; ///<Override timer
288  TcpTimer finWait2Timer; ///<FIN-WAIT-2 timer
289  TcpTimer timeWaitTimer; ///<2MSL timer
290 
291  bool_t sackPermitted; ///<SACK Permitted option received
292  TcpSackBlock sackBlock[TCP_MAX_SACK_BLOCKS]; ///<List of non-contiguous blocks that have been received
293  uint_t sackBlockCount; ///<Number of non-contiguous blocks that have been received
294 #endif
295 
296 //UDP specific variables
297 #if (UDP_SUPPORT == ENABLED || RAW_SOCKET_SUPPORT == ENABLED)
299 #endif
300 };
301 
302 
303 /**
304  * @brief Structure describing socket events
305  **/
306 
307 typedef struct
308 {
309  Socket *socket; ///<Handle to a socket to monitor
310  uint_t eventMask; ///<Requested events
311  uint_t eventFlags; ///<Returned events
313 
314 
315 //Global variables
317 
318 //Socket related functions
319 error_t socketInit(void);
320 
322 
326 
329 
330 error_t socketBind(Socket *socket, const IpAddr *localIpAddr, uint16_t localPort);
331 error_t socketConnect(Socket *socket, const IpAddr *remoteIpAddr, uint16_t remotePort);
333 Socket *socketAccept(Socket *socket, IpAddr *clientIpAddr, uint16_t *clientPort);
334 
335 error_t socketSend(Socket *socket, const void *data,
336  size_t length, size_t *written, uint_t flags);
337 
339  const void *data, size_t length, size_t *written, uint_t flags);
340 
342  size_t size, size_t *received, uint_t flags);
343 
345  void *data, size_t size, size_t *received, uint_t flags);
346 
348  IpAddr *destIpAddr, void *data, size_t size, size_t *received, uint_t flags);
349 
350 error_t socketGetLocalAddr(Socket *socket, IpAddr *localIpAddr, uint16_t *localPort);
351 error_t socketGetRemoteAddr(Socket *socket, IpAddr *remoteIpAddr, uint16_t *remotePort);
352 
354 void socketClose(Socket *socket);
355 
356 error_t socketPoll(SocketEventDesc *eventDesc, uint_t size, OsEvent *extEvent,
357  systime_t timeout);
358 
359 void socketRegisterEvents(Socket *socket, OsEvent *event, uint_t eventMask);
362 
364  const char_t *name, IpAddr *ipAddr, uint_t flags);
365 
366 //C++ guard
367 #ifdef __cplusplus
368 }
369 #endif
370 
371 #endif
SocketQueueItem * receiveQueue
Definition: socket.h:298
TcpTimer retransmitTimer
Retransmission timer.
Definition: socket.h:277
error_t socketConnect(Socket *socket, const IpAddr *remoteIpAddr, uint16_t remotePort)
Establish a connection to a specified socket.
Definition: socket.c:381
uint16_t maxSndWnd
Maximum send window it has seen so far on the connection.
Definition: socket.h:247
@ SOCKET_IP_PROTO_UDP
Definition: socket.h:93
HostType
Host types.
Definition: socket.h:171
Retransmission queue item.
Definition: tcp.h:358
@ SOCKET_ETH_PROTO_LLC
Definition: socket.h:105
uint8_t length
Definition: dtls_misc.h:149
uint32_t sndNxt
Sequence number of the next byte to be sent.
Definition: socket.h:244
HostnameResolver
Name resolution protocols.
Definition: socket.h:183
int bool_t
Definition: compiler_port.h:49
error_t socketListen(Socket *socket, uint_t backlog)
Place a socket in the listening state.
Definition: socket.c:444
@ SOCKET_FLAG_WAIT_ALL
Definition: socket.h:120
uint32_t rcvNxt
Receive next sequence number.
Definition: socket.h:251
struct _SocketQueueItem SocketQueueItem
Receive queue item.
@ HOST_NAME_RESOLVER_DNS
Definition: socket.h:186
signed int int_t
Definition: compiler_port.h:44
IP network address.
Definition: ip.h:71
uint16_t cwnd
Congestion window.
Definition: socket.h:264
TcpCongestState
TCP congestion states.
Definition: tcp.h:251
IpAddr remoteIpAddr
Definition: socket.h:220
uint8_t ttl
Definition: socket.h:223
OsEvent * userEvent
Definition: socket.h:229
@ SOCKET_FLAG_WAIT_ACK
Definition: socket.h:124
@ HOST_TYPE_ANY
Definition: socket.h:173
@ SOCKET_FLAG_DONT_ROUTE
Definition: socket.h:119
TcpTimer overrideTimer
Override timer.
Definition: socket.h:287
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:88
@ SOCKET_IP_PROTO_ICMPV6
Definition: socket.h:94
uint_t wndProbeCount
Zero window probe counter.
Definition: socket.h:283
SocketIpProtocol
IP protocols.
Definition: socket.h:88
Event object.
uint16_t sndUser
Amount of data buffered but not yet sent.
Definition: socket.h:245
uint16_t srcPort
Definition: socket.h:201
error_t socketBind(Socket *socket, const IpAddr *localIpAddr, uint16_t localPort)
Associate a local address with a socket.
Definition: socket.c:355
@ HOST_NAME_RESOLVER_LLMNR
Definition: socket.h:189
uint32_t irs
Initial receive sequence number.
Definition: socket.h:241
OsEvent event
Definition: socket.h:226
@ SOCKET_TYPE_DGRAM
Definition: socket.h:78
uint_t type
Definition: socket.h:215
uint32_t sndWl2
Segment acknowledgment number used for last window update.
Definition: socket.h:249
size_t txBufferSize
Size of the send buffer.
Definition: socket.h:272
IpAddr srcIpAddr
Definition: socket.h:200
uint_t eventFlags
Definition: socket.h:228
uint8_t multicastTtl
Definition: socket.h:224
uint16_t rmss
Receiver maximum segment size.
Definition: socket.h:239
char_t name[]
bool_t resetFlag
The connection has been reset.
Definition: socket.h:236
uint16_t destPort
Definition: tcp.h:303
uint32_t recover
NewReno modification to TCP's fast recovery algorithm.
Definition: socket.h:268
Ipv4Addr srcIpAddr
Definition: ipcp.h:77
uint_t socketGetEvents(Socket *socket)
Retrieve event flags for a specified socket.
Definition: socket.c:1042
struct _SocketQueueItem * next
Definition: socket.h:199
error_t socketSetTimeout(Socket *socket, systime_t timeout)
Set timeout value for blocking operations.
Definition: socket.c:219
systime_t srtt
Smoothed round-trip time.
Definition: socket.h:258
@ SOCKET_TYPE_STREAM
Definition: socket.h:77
SocketType
Socket types.
Definition: socket.h:74
uint_t descriptor
Definition: socket.h:214
Structure describing socket events.
Definition: socket.h:307
void socketClose(Socket *socket)
Close an existing socket.
Definition: socket.c:822
@ SOCKET_FLAG_PEEK
Definition: socket.h:118
@ SOCKET_FLAG_DELAY
Definition: socket.h:126
void socketUnregisterEvents(Socket *socket)
Unsubscribe previously registered events.
Definition: socket.c:1019
@ HOST_TYPE_IPV6
Definition: socket.h:175
error_t socketSend(Socket *socket, const void *data, size_t length, size_t *written, uint_t flags)
Send data to a connected socket.
Definition: socket.c:514
TcpRxBuffer rxBuffer
Receive buffer.
Definition: socket.h:273
TcpCongestState congestState
Congestion state.
Definition: socket.h:263
#define TCP_MAX_SACK_BLOCKS
Definition: tcp.h:208
TcpTimer finWait2Timer
FIN-WAIT-2 timer.
Definition: socket.h:288
@ SOCKET_SD_SEND
Definition: socket.h:142
systime_t rto
Retransmission timeout.
Definition: socket.h:260
TcpState
TCP FSM states.
Definition: tcp.h:231
error_t socketReceiveFrom(Socket *socket, IpAddr *srcIpAddr, uint16_t *srcPort, void *data, size_t size, size_t *received, uint_t flags)
Receive a datagram from a connectionless socket.
Definition: socket.c:629
TcpTimer timeWaitTimer
2MSL timer
Definition: socket.h:289
char_t type
error_t
Error codes.
Definition: error.h:42
IpAddr localIpAddr
Definition: socket.h:218
uint8_t protocol
uint16_t rcvWnd
Receive window.
Definition: socket.h:253
uint16_t rcvUser
Number of data received but not yet consumed.
Definition: socket.h:252
int_t socket(int_t family, int_t type, int_t protocol)
Create a socket that is bound to a specific transport service provider.
Definition: bsd_socket.c:108
@ HOST_NAME_RESOLVER_MDNS
Definition: socket.h:187
@ SOCKET_EVENT_TX_READY
Definition: socket.h:156
uint16_t remotePort
Definition: socket.h:221
uint16_t smss
Sender maximum segment size.
Definition: socket.h:238
@ SOCKET_EVENT_LINK_DOWN
Definition: socket.h:163
NetInterface * socketGetInterface(Socket *socket)
Retrieve the underlying interface.
Definition: socket.c:332
SocketShutdownFlags
Flags used by shutdown function.
Definition: socket.h:139
#define NetInterface
Definition: net.h:36
TcpTxBuffer txBuffer
Send buffer.
Definition: socket.h:271
Socket * socketAccept(Socket *socket, IpAddr *clientIpAddr, uint16_t *clientPort)
Permit an incoming connection attempt on a socket.
Definition: socket.c:481
@ SOCKET_EVENT_RX_SHUTDOWN
Definition: socket.h:161
uint16_t localPort
Definition: socket.h:219
@ SOCKET_TYPE_RAW_IP
Definition: socket.h:79
IpAddr destIpAddr
Definition: socket.h:202
TcpTimer persistTimer
Persist timer.
Definition: socket.h:286
uint_t eventMask
Definition: socket.h:227
bool_t closedFlag
The connection has been closed properly.
Definition: socket.h:235
TcpSynQueueItem * synQueue
SYN queue for listening sockets.
Definition: socket.h:280
uint16_t ssthresh
Slow start threshold.
Definition: socket.h:265
@ HOST_TYPE_IPV4
Definition: socket.h:174
@ SOCKET_EVENT_TX_DONE
Definition: socket.h:157
uint_t eventFlags
Returned events.
Definition: socket.h:311
@ SOCKET_IP_PROTO_IGMP
Definition: socket.h:91
size_t rxBufferSize
Size of the receive buffer.
Definition: socket.h:274
uint_t retransmitCount
Number of retransmissions.
Definition: socket.h:278
@ SOCKET_EVENT_LINK_UP
Definition: socket.h:162
error_t socketSetTxBufferSize(Socket *socket, size_t size)
Specify the size of the send buffer.
Definition: socket.c:244
uint_t dupAckCount
Number of consecutive duplicate ACKs.
Definition: socket.h:266
bool_t sackPermitted
SACK Permitted option received.
Definition: socket.h:291
@ SOCKET_FLAG_BREAK_CHAR
Definition: socket.h:122
Socket socketTable[SOCKET_MAX_COUNT]
Definition: socket.c:49
Receive queue item.
Definition: socket.h:197
uint32_t iss
Initial send sequence number.
Definition: socket.h:240
NetInterface * interface
Definition: socket.h:217
uint8_t flags
Definition: tcp.h:314
SocketFlags
Flags used by I/O functions.
Definition: socket.h:116
char char_t
Definition: compiler_port.h:43
error_t socketSendTo(Socket *socket, const IpAddr *destIpAddr, uint16_t destPort, const void *data, size_t length, size_t *written, uint_t flags)
Send a datagram to a specific destination.
Definition: socket.c:535
SACK block.
Definition: tcp.h:388
@ SOCKET_EVENT_TX_ACKED
Definition: socket.h:158
uint_t synQueueSize
Maximum number of pending connections for listening sockets.
Definition: socket.h:281
uint32_t sndWl1
Segment sequence number used for last window update.
Definition: socket.h:248
Socket * socketOpen(uint_t type, uint_t protocol)
Create a socket (UDP or TCP)
Definition: socket.c:95
bool_t rttBusy
RTT measurement is being performed.
Definition: socket.h:255
IPv4 and IPv6 common routines.
@ SOCKET_FLAG_NO_DELAY
Definition: socket.h:125
@ SOCKET_EVENT_RX_READY
Definition: socket.h:160
systime_t wndProbeInterval
Interval between successive probes.
Definition: socket.h:284
@ HOST_NAME_RESOLVER_ANY
Definition: socket.h:185
@ SOCKET_ETH_PROTO_IPV4
Definition: socket.h:106
@ SOCKET_IP_PROTO_ICMP
Definition: socket.h:90
TCP (Transmission Control Protocol)
@ SOCKET_EVENT_TX_SHUTDOWN
Definition: socket.h:159
error_t socketReceive(Socket *socket, void *data, size_t size, size_t *received, uint_t flags)
Receive data from a connected socket.
Definition: socket.c:609
@ SOCKET_TYPE_UNUSED
Definition: socket.h:76
@ SOCKET_ETH_PROTO_IPV6
Definition: socket.h:108
error_t socketPoll(SocketEventDesc *eventDesc, uint_t size, OsEvent *extEvent, systime_t timeout)
Wait for one of a set of sockets to become ready to perform I/O.
Definition: socket.c:882
@ SOCKET_SD_RECEIVE
Definition: socket.h:141
#define Socket
Definition: socket.h:36
@ SOCKET_ETH_PROTO_ARP
Definition: socket.h:107
@ HOST_NAME_RESOLVER_NBNS
Definition: socket.h:188
TCP timer.
Definition: tcp.h:346
error_t socketGetRemoteAddr(Socket *socket, IpAddr *remoteIpAddr, uint16_t *remotePort)
Retrieve the address of the peer to which a socket is connected.
Definition: socket.c:755
void socketRegisterEvents(Socket *socket, OsEvent *event, uint_t eventMask)
Subscribe to the specified socket events.
Definition: socket.c:968
uint16_t sndWnd
Size of the send window.
Definition: socket.h:246
@ SOCKET_TYPE_RAW_ETH
Definition: socket.h:80
SYN queue item.
Definition: tcp.h:372
error_t socketSetInterface(Socket *socket, NetInterface *interface)
Bind a socket to a particular network interface.
Definition: socket.c:312
uint32_t sndUna
Data that have been sent but not yet acknowledged.
Definition: socket.h:243
error_t socketInit(void)
Socket related initialization.
Definition: socket.c:57
TcpSackBlock sackBlock[TCP_MAX_SACK_BLOCKS]
List of non-contiguous blocks that have been received.
Definition: socket.h:292
uint_t protocol
Definition: socket.h:216
error_t socketShutdown(Socket *socket, uint_t how)
Disable reception, transmission, or both.
Definition: socket.c:785
systime_t timeout
Definition: socket.h:222
error_t socketSetRxBufferSize(Socket *socket, size_t size)
Specify the size of the receive buffer.
Definition: socket.c:278
bool_t ownedFlag
The user is the owner of the TCP socket.
Definition: socket.h:234
error_t socketGetLocalAddr(Socket *socket, IpAddr *localIpAddr, uint16_t *localPort)
Retrieve the local address for a given socket.
Definition: socket.c:728
Structure describing a socket.
Definition: socket.h:212
uint16_t srcPort
Definition: tcp.h:302
Socket * socket
Handle to a socket to monitor.
Definition: socket.h:309
@ SOCKET_EVENT_CONNECTED
Definition: socket.h:154
SocketEthProtocol
Ethernet protocols.
Definition: socket.h:102
Receive buffer.
Definition: tcp.h:411
TcpQueueItem * retransmitQueue
Retransmission queue.
Definition: socket.h:276
Transmit buffer.
Definition: tcp.h:399
unsigned int uint_t
Definition: compiler_port.h:45
systime_t rttvar
Round-trip time variation.
Definition: socket.h:259
@ SOCKET_FLAG_DONT_WAIT
Definition: socket.h:121
TCP/IP stack core.
uint8_t data[]
Definition: dtls_misc.h:176
@ SOCKET_EVENT_CLOSED
Definition: socket.h:155
TcpState state
Current state of the TCP finite state machine.
Definition: socket.h:233
uint_t sackBlockCount
Number of non-contiguous blocks that have been received.
Definition: socket.h:293
#define SOCKET_MAX_COUNT
Definition: socket.h:45
systime_t rttStartTime
Round-trip start time.
Definition: socket.h:257
@ SOCKET_SD_BOTH
Definition: socket.h:143
uint32_t rttSeqNum
Sequence number identifying a TCP segment.
Definition: socket.h:256
SocketEvent
Socket events.
Definition: socket.h:151
@ SOCKET_ETH_PROTO_ALL
Definition: socket.h:104
@ SOCKET_IP_PROTO_TCP
Definition: socket.h:92
@ SOCKET_FLAG_BREAK_CRLF
Definition: socket.h:123
uint32_t systime_t
Definition: compiler_port.h:46
uint8_t ipAddr[4]
Definition: mib_common.h:187
@ SOCKET_EVENT_TIMEOUT
Definition: socket.h:153
uint_t n
Number of bytes acknowledged during the whole round-trip.
Definition: socket.h:267
NetBuffer * buffer
Definition: socket.h:203
uint_t eventMask
Requested events.
Definition: socket.h:310
error_t socketReceiveEx(Socket *socket, IpAddr *srcIpAddr, uint16_t *srcPort, IpAddr *destIpAddr, void *data, size_t size, size_t *received, uint_t flags)
Receive a datagram.
Definition: socket.c:650
int_t errnoCode
Definition: socket.h:225
size_t offset
Definition: socket.h:204
error_t getHostByName(NetInterface *interface, const char_t *name, IpAddr *ipAddr, uint_t flags)
Resolve a host name into an IP address.
Definition: socket.c:1078
Ipv4Addr destIpAddr
Definition: ipcp.h:78