Skip to content

Commit 301ed58

Browse files
Merging IPv6 demo changes to main (FreeRTOS#1028)
* Add IPv6 Demo (FreeRTOS#937) * Add demo changes * Update kernel and library paths * Update main.c * Run uncrustify * Fix spell checker * CI check file headers update * Add IPv6/v4 UDP echo server with zero copy/non-zero copy versions * Add VS proj file changes to include the UDP echo sample code * readme update --------- Co-authored-by: Tony Josi <[email protected]> * Update Backward Compatibility Flag (FreeRTOS#954) * Update Backward Compatibility Flag * Update FreeRTOS_GetUDPPayloadBuffer_ByIPType * Update FreeRTOS_IPStart to FreeRTOS_IPInit_Multi * Update Application APIs * Remove ipconfigCOMPATIBLE_WITH_SINGLE * Update Static Lib files (FreeRTOS#956) * Update Static Lib files * making vApplicationIPNetworkEventHook backward compatible in demos * Update CI check file headers --------- Co-authored-by: Tony Josi <[email protected]> * Add WinPCap NetworkInterface Changes (FreeRTOS#958) * Update winpcap network interface * Run uncrustify * Update function to include NetworkInterface_t parameters * Adding compatibility for xApplicationDNSQueryHook with latest dev branch for old demos (FreeRTOS#957) * adding compatibility for xApplicationDNSQueryHook with latest dev branch * adding tcp echo server source * removing unused sub demos * fix build issues (FreeRTOS#969) * Update demo to latest +TCP dev/IPv6_integration (FreeRTOS#978) * remove macro namings * rename sin_addr to sin_address.ulIP_IPv4 for ipv6 demo * replace in6addr_any with FreeRTOS_in6addr_any * replace mainCREATE_UDP_ECHO_SERVER_TASK with mainCREATE_UDP_ECHO_TASKS_SINGLE * handle removal of sin_addr macro to sin_address.ulIP_IPv4 * updating +TCP repo to latest dev/IPv6_integration * minor update to more clear code * more sin_addr to sin_address.ulIP_IPv4 replacements * fix makefiles for qemu and posix demos * review feedback changes * Update FreeRTOS-Plus-TCP for RC2 * Change from PR (FreeRTOS#994) * Update FreeRTOS-Plus-TCP for RC2 * Update copyright * Ignore WinPCap for files header check failure. * Update checker * Update manifest * Point manifest to latest commit * Fix Spell-checker * Update doxygen * Update xApplicationDHCPHook for backward compatibility (FreeRTOS#999) * Update xApplicationDHCPHook for backward compatability * Update IPv6 * Update VisualStudio Static Project files * Update pxEndPoint error (FreeRTOS#1002) * Update IPv6 demo ReadMe (FreeRTOS#1004) * Update ReadMe * Update setup requirement * Update UDP demo info * Update comment * TCP demo changes post build separation (FreeRTOS#1011) * adding sin_family to dest adddr for FreeRTOS_sendto * updating FreeRTOS_bind to input sin_family post build separation changes * updating FreeRTOS_connect to input sin_family post build separation changes * minor fix * updating copyright year * updating file headers * updating +TCP submodule * updating file headers * updating file headers * updating manifest file to have latest +TCP submodule hash * Fix issue with posix demo while running with ipconfigIPv4_BACKWARD_COMPATIBLE enabled for +TCP stack (FreeRTOS#1027) * Update the submodule pointer to IPv6 main * Update manifest with latest TCP commit * Update file checker exception * Ignore Visual studio project file from file header checker --------- Co-authored-by: Tony Josi <[email protected]>
1 parent 8f3233e commit 301ed58

File tree

83 files changed

+12120
-1068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+12120
-1068
lines changed

.github/scripts/core_checker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@
278278
r'FreeRTOS\-Plus/Demo/Common/WinPCap/.*',
279279
r'FreeRTOS\-Plus/Source/FreeRTOS-Plus-Trace/.*',
280280
r'FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Trace_Recorder_Configuration/.*',
281+
r'FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/common/WinPCap/.*',
282+
r'FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/common/WinPCap/pcap/.*',
283+
r'FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo/FreeRTOS_Plus_TCP_IPv6_Multi.props',
281284
r'FreeRTOS/Demo/lwIP_AVR32_UC3/.*',
282285
r'FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/.*',
283286
r'FreeRTOS/Demo/CORTEX_LM3S102_GCC/makedefs',

FreeRTOS-Plus/Demo/Common/Demo_IP_Protocols/Common/FreeRTOS_TCP_server.c

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* FreeRTOS+TCP V2.0.3
3-
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* FreeRTOS V202212.00
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy of
66
* this software and associated documentation files (the "Software"), to deal in
@@ -19,8 +19,9 @@
1919
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2020
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
*
22-
* https://aws.amazon.com/freertos
2322
* https://www.FreeRTOS.org
23+
* https://github.com/FreeRTOS
24+
*
2425
*/
2526

2627

@@ -91,8 +92,18 @@ SocketSet_t xSocketSet;
9192

9293
if( xSocket != FREERTOS_INVALID_SOCKET )
9394
{
94-
xAddress.sin_addr = FreeRTOS_GetIPAddress(); // Single NIC, currently not used
95+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
96+
{
97+
xAddress.sin_address.ulIP_IPv4 = FreeRTOS_GetIPAddress(); /* Single NIC, currently not used */
98+
}
99+
#else
100+
{
101+
xAddress.sin_addr = FreeRTOS_GetIPAddress(); /* Single NIC, currently not used */
102+
}
103+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
104+
95105
xAddress.sin_port = FreeRTOS_htons( xPortNumber );
106+
xAddress.sin_family = FREERTOS_AF_INET;
96107

97108
FreeRTOS_bind( xSocket, &xAddress, sizeof( xAddress ) );
98109
FreeRTOS_listen( xSocket, pxConfigs[ xIndex ].xBackLog );
@@ -209,7 +220,15 @@ const char *pcType = "Unknown";
209220
{
210221
struct freertos_sockaddr xRemoteAddress;
211222
FreeRTOS_GetRemoteAddress( pxClient->xSocket, &xRemoteAddress );
212-
FreeRTOS_printf( ( "TPC-server: new %s client %xip\n", pcType, (unsigned)FreeRTOS_ntohl( xRemoteAddress.sin_addr ) ) );
223+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
224+
{
225+
FreeRTOS_printf( ( "TPC-server: new %s client %xip\n", pcType, (unsigned)FreeRTOS_ntohl( xRemoteAddress.sin_address.ulIP_IPv4 ) ) );
226+
}
227+
#else
228+
{
229+
FreeRTOS_printf( ( "TPC-server: new %s client %xip\n", pcType, (unsigned)FreeRTOS_ntohl( xRemoteAddress.sin_addr ) ) );
230+
}
231+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
213232
}
214233

215234
/* Remove compiler warnings in case FreeRTOS_printf() is not used. */

FreeRTOS-Plus/Demo/Common/Demo_IP_Protocols/FTP/FreeRTOS_FTP_server.c

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
/*
2-
*!
3-
*! The protocols implemented in this file are intended to be demo quality only,
4-
*! and not for production devices.
5-
*!
6-
*
7-
* FreeRTOS+TCP V2.0.3
8-
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* FreeRTOS V202212.00
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
94
*
105
* Permission is hereby granted, free of charge, to any person obtaining a copy of
116
* this software and associated documentation files (the "Software"), to deal in
@@ -24,8 +19,16 @@
2419
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2520
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2621
*
27-
* https://aws.amazon.com/freertos
2822
* https://www.FreeRTOS.org
23+
* https://github.com/FreeRTOS
24+
*
25+
*/
26+
27+
/*
28+
*!
29+
*! The protocols implemented in this file are intended to be demo quality only,
30+
*! and not for production devices.
31+
*!
2932
*/
3033

3134
/* Standard includes. */
@@ -585,8 +588,18 @@ BaseType_t xResult = 0;
585588
FreeRTOS_GetLocalAddress( pxClient->xTransferSocket, &xLocalAddress );
586589
FreeRTOS_GetRemoteAddress( pxClient->xSocket, &xRemoteAddress );
587590

588-
ulIP = FreeRTOS_ntohl( xLocalAddress.sin_addr );
589-
pxClient->ulClientIP = FreeRTOS_ntohl( xRemoteAddress.sin_addr );
591+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
592+
{
593+
ulIP = FreeRTOS_ntohl( xLocalAddress.sin_address.ulIP_IPv4 );
594+
pxClient->ulClientIP = FreeRTOS_ntohl( xRemoteAddress.sin_address.ulIP_IPv4 );
595+
}
596+
#else
597+
{
598+
ulIP = FreeRTOS_ntohl( xLocalAddress.sin_addr );
599+
pxClient->ulClientIP = FreeRTOS_ntohl( xRemoteAddress.sin_addr );
600+
}
601+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
602+
590603
ulPort = FreeRTOS_ntohs( xLocalAddress.sin_port );
591604

592605
pxClient->usClientPort = FreeRTOS_ntohs( xRemoteAddress.sin_port );
@@ -852,8 +865,19 @@ BaseType_t xResult;
852865
#if( ipconfigFTP_TX_BUFSIZE > 0 )
853866
WinProperties_t xWinProps;
854867
#endif
855-
xAddress.sin_addr = FreeRTOS_GetIPAddress( ); /* Single NIC, currently not used */
868+
869+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
870+
{
871+
xAddress.sin_address.ulIP_IPv4 = FreeRTOS_GetIPAddress( ); /* Single NIC, currently not used */
872+
}
873+
#else
874+
{
875+
xAddress.sin_addr = FreeRTOS_GetIPAddress( ); /* Single NIC, currently not used */
876+
}
877+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
878+
856879
xAddress.sin_port = FreeRTOS_htons( 0 ); /* Bind to any available port number */
880+
xAddress.sin_family = FREERTOS_AF_INET;
857881

858882
BaseType_t xBindResult;
859883
xBindResult = FreeRTOS_bind( xSocket, &xAddress, sizeof( xAddress ) );
@@ -929,10 +953,22 @@ BaseType_t xResult;
929953
}
930954
else
931955
{
932-
struct freertos_sockaddr xAddress;
956+
struct freertos_sockaddr xAddress;
957+
958+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
959+
{
960+
xAddress.sin_address.ulIP_IPv4 = FreeRTOS_htonl( pxClient->ulClientIP );
961+
}
962+
#else
963+
{
964+
xAddress.sin_addr = FreeRTOS_htonl( pxClient->ulClientIP );
965+
}
966+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
933967

934-
xAddress.sin_addr = FreeRTOS_htonl( pxClient->ulClientIP );
968+
935969
xAddress.sin_port = FreeRTOS_htons( pxClient->usClientPort );
970+
xAddress.sin_family = FREERTOS_AF_INET;
971+
936972
/* Start an active connection for this data socket */
937973
xResult = FreeRTOS_connect( pxClient->xTransferSocket, &xAddress, sizeof( xAddress ) );
938974
}

FreeRTOS-Plus/Demo/Common/Demo_IP_Protocols/NTP/NTPDemo.c

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
/*
2-
*!
3-
*! The protocols implemented in this file are intended to be demo quality only,
4-
*! and not for production devices.
5-
*!
6-
*
7-
* FreeRTOS+TCP V2.0.3
8-
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* FreeRTOS V202212.00
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
94
*
105
* Permission is hereby granted, free of charge, to any person obtaining a copy of
116
* this software and associated documentation files (the "Software"), to deal in
@@ -24,11 +19,17 @@
2419
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2520
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2621
*
27-
* https://aws.amazon.com/freertos
2822
* https://www.FreeRTOS.org
23+
* https://github.com/FreeRTOS
24+
*
2925
*/
3026

3127
/*
28+
*!
29+
*! The protocols implemented in this file are intended to be demo quality only,
30+
*! and not for production devices.
31+
*!
32+
*
3233
* NTPDemo.c
3334
*
3435
* An example of how to lookup a domain using DNS
@@ -149,8 +150,18 @@ void vStartNTPTask( uint16_t usTaskStackSize, UBaseType_t uxTaskPriority )
149150
BaseType_t xReceiveTimeOut = pdMS_TO_TICKS( 5000 );
150151
#endif
151152

152-
xAddress.sin_addr = 0ul;
153+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
154+
{
155+
xAddress.sin_address.ulIP_IPv4 = 0ul;
156+
}
157+
#else
158+
{
159+
xAddress.sin_addr = 0ul;
160+
}
161+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
162+
153163
xAddress.sin_port = FreeRTOS_htons( NTP_PORT );
164+
xAddress.sin_family = FREERTOS_AF_INET;
154165

155166
FreeRTOS_bind( xUDPSocket, &xAddress, sizeof( xAddress ) );
156167
FreeRTOS_setsockopt( xUDPSocket, 0, FREERTOS_SO_RCVTIMEO, &xReceiveTimeOut, sizeof( xReceiveTimeOut ) );
@@ -386,10 +397,23 @@ struct freertos_sockaddr xAddress;
386397
char pcBuf[16];
387398

388399
prvNTPPacketInit( );
389-
xAddress.sin_addr = ulIPAddressFound;
390-
xAddress.sin_port = FreeRTOS_htons( NTP_PORT );
391400

392-
FreeRTOS_inet_ntoa( xAddress.sin_addr, pcBuf );
401+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
402+
{
403+
xAddress.sin_address.ulIP_IPv4 = ulIPAddressFound;
404+
xAddress.sin_port = FreeRTOS_htons( NTP_PORT );
405+
FreeRTOS_inet_ntoa( xAddress.sin_address.ulIP_IPv4, pcBuf );
406+
}
407+
#else
408+
{
409+
xAddress.sin_addr = ulIPAddressFound;
410+
xAddress.sin_port = FreeRTOS_htons( NTP_PORT );
411+
FreeRTOS_inet_ntoa( xAddress.sin_addr, pcBuf );
412+
}
413+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
414+
415+
xAddress.sin_family = FREERTOS_AF_INET;
416+
393417
FreeRTOS_printf( ( "Sending UDP message to %s:%u\n",
394418
pcBuf,
395419
FreeRTOS_ntohs( xAddress.sin_port ) ) );

FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/UDP-Related-CLI-commands.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,44 +266,44 @@ uint32_t ulAddress;
266266
switch( xIndex )
267267
{
268268
case 0 :
269-
#if defined( FREERTOS_PLUS_TCP_VERSION ) && ( FREERTOS_PLUS_TCP_VERSION >= 10 )
269+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
270270
FreeRTOS_GetEndPointConfiguration( &ulAddress, NULL, NULL, NULL, pxNetworkEndPoints );
271271
#else
272272
FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );
273-
#endif
273+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
274274
sprintf( pcWriteBuffer, "\r\nIP address " );
275275
xReturn = pdTRUE;
276276
xIndex++;
277277
break;
278278

279279
case 1 :
280-
#if defined( FREERTOS_PLUS_TCP_VERSION ) && ( FREERTOS_PLUS_TCP_VERSION >= 10 )
280+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
281281
FreeRTOS_GetEndPointConfiguration( NULL, &ulAddress, NULL, NULL, pxNetworkEndPoints );
282282
#else
283283
FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );
284-
#endif
284+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
285285
sprintf( pcWriteBuffer, "\r\nNet mask " );
286286
xReturn = pdTRUE;
287287
xIndex++;
288288
break;
289289

290290
case 2 :
291-
#if defined( FREERTOS_PLUS_TCP_VERSION ) && ( FREERTOS_PLUS_TCP_VERSION >= 10 )
291+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
292292
FreeRTOS_GetEndPointConfiguration( NULL, NULL, &ulAddress, NULL, pxNetworkEndPoints );
293293
#else
294294
FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );
295-
#endif
295+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
296296
sprintf( pcWriteBuffer, "\r\nGateway address " );
297297
xReturn = pdTRUE;
298298
xIndex++;
299299
break;
300300

301301
case 3 :
302-
#if defined( FREERTOS_PLUS_TCP_VERSION ) && ( FREERTOS_PLUS_TCP_VERSION >= 10 )
302+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
303303
FreeRTOS_GetEndPointConfiguration( NULL, NULL, NULL, &ulAddress, pxNetworkEndPoints );
304304
#else
305305
FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );
306-
#endif
306+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
307307
sprintf( pcWriteBuffer, "\r\nDNS server address " );
308308
xReturn = pdTRUE;
309309
xIndex++;

FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/CLI-commands.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -565,44 +565,44 @@ uint32_t ulAddress;
565565
switch( xIndex )
566566
{
567567
case 0 :
568-
#if defined( FREERTOS_PLUS_TCP_VERSION ) && ( FREERTOS_PLUS_TCP_VERSION >= 10 )
568+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
569569
FreeRTOS_GetEndPointConfiguration( &ulAddress, NULL, NULL, NULL, pxNetworkEndPoints );
570570
#else
571571
FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );
572-
#endif
572+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
573573
sprintf( pcWriteBuffer, "\r\nIP address " );
574574
xReturn = pdTRUE;
575575
xIndex++;
576576
break;
577577

578578
case 1 :
579-
#if defined( FREERTOS_PLUS_TCP_VERSION ) && ( FREERTOS_PLUS_TCP_VERSION >= 10 )
579+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
580580
FreeRTOS_GetEndPointConfiguration( NULL, &ulAddress, NULL, NULL, pxNetworkEndPoints );
581581
#else
582582
FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );
583-
#endif
583+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
584584
sprintf( pcWriteBuffer, "\r\nNet mask " );
585585
xReturn = pdTRUE;
586586
xIndex++;
587587
break;
588588

589589
case 2 :
590-
#if defined( FREERTOS_PLUS_TCP_VERSION ) && ( FREERTOS_PLUS_TCP_VERSION >= 10 )
590+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
591591
FreeRTOS_GetEndPointConfiguration( NULL, NULL, &ulAddress, NULL, pxNetworkEndPoints );
592592
#else
593593
FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );
594-
#endif
594+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
595595
sprintf( pcWriteBuffer, "\r\nGateway address " );
596596
xReturn = pdTRUE;
597597
xIndex++;
598598
break;
599599

600600
case 3 :
601-
#if defined( FREERTOS_PLUS_TCP_VERSION ) && ( FREERTOS_PLUS_TCP_VERSION >= 10 )
601+
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
602602
FreeRTOS_GetEndPointConfiguration( NULL, NULL, NULL, &ulAddress, pxNetworkEndPoints );
603603
#else
604604
FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );
605-
#endif
605+
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
606606
sprintf( pcWriteBuffer, "\r\nDNS server address " );
607607
xReturn = pdTRUE;
608608
xIndex++;

FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/UDPCommandServer.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FreeRTOS V202212.00
3-
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy of
66
* this software and associated documentation files (the "Software"), to deal in
@@ -20,7 +20,7 @@
2020
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
*
2222
* https://www.FreeRTOS.org
23-
* https://aws.amazon.com/freertos
23+
* https://github.com/FreeRTOS
2424
*
2525
*/
2626

@@ -190,6 +190,7 @@ xSocket_t xSocket = FREERTOS_INVALID_SOCKET;
190190

191191
/* Set family and port. */
192192
xServer.sin_port = FreeRTOS_htons( usPort );
193+
xServer.sin_family = FREERTOS_AF_INET;
193194

194195
/* Bind the address to the socket. */
195196
if( FreeRTOS_bind( xSocket, &xServer, sizeof( xServer ) ) == -1 )

0 commit comments

Comments
 (0)