mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-20 19:57:44 -04:00
Create GitHub workflows to execute the WinSim demos with libslirp network interface implemented in FreeRTOS+TCP VS Static Project (#1054)
* Add libslirp to the existing FreeRTOS+TCP static project * Update demos to run with libslirp * Add ipconfigUSE_LIBSLIRP * Call developer command prompt and update meson build options --------- Co-authored-by: Xiaodong Li <xiaodonn@amazon.com>
This commit is contained in:
parent
f776f5ee4a
commit
792efb4bb7
39 changed files with 3825 additions and 137 deletions
|
@ -193,6 +193,11 @@ TickType_t xTimeOnEntering;
|
|||
|
||||
/* Add in some unique text at the front of the string. */
|
||||
sprintf( pcTransmittedString, "TxRx message number %u", ulTxCount );
|
||||
|
||||
/* Replace '\0' with '-' for string length and comparison functions */
|
||||
pcTransmittedString[ strlen( pcTransmittedString ) ] = '-';
|
||||
|
||||
printf( "\n\tSending %d bytes of data to the echo server\n", lStringLength );
|
||||
ulTxCount++;
|
||||
|
||||
/* Send the string to the socket. */
|
||||
|
@ -250,12 +255,17 @@ TickType_t xTimeOnEntering;
|
|||
{
|
||||
/* The echo reply was received without error. */
|
||||
ulTxRxCycles[ xInstance ]++;
|
||||
|
||||
/* The "Received correct data" line is used to determine if
|
||||
* this demo runs successfully on a GitHub workflow. */
|
||||
printf( "\tReceived correct data %d times.\n", ulTxRxCycles[ xInstance ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The received string did not match the transmitted
|
||||
string. */
|
||||
ulTxRxFailures[ xInstance ]++;
|
||||
printf( "\tReceived incorrect data %d times.\n", ulTxRxFailures[ xInstance ] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -306,7 +316,7 @@ TickType_t xTimeOnEntering;
|
|||
static BaseType_t prvCreateTxData( char *cBuffer, uint32_t ulBufferLength )
|
||||
{
|
||||
BaseType_t lCharactersToAdd, lCharacter;
|
||||
char cChar = '0';
|
||||
char cChar = 'A';
|
||||
const BaseType_t lMinimumLength = 60;
|
||||
uint32_t ulRandomNumber;
|
||||
|
||||
|
@ -324,12 +334,15 @@ uint32_t ulRandomNumber;
|
|||
cBuffer[ lCharacter ] = cChar;
|
||||
cChar++;
|
||||
|
||||
if( cChar > '~' )
|
||||
if( cChar > 'Z' )
|
||||
{
|
||||
cChar = '0';
|
||||
cChar = 'A';
|
||||
}
|
||||
}
|
||||
|
||||
cBuffer[ lCharacter - 1 ] = '\n';
|
||||
cBuffer[ lCharacter ] = '\0';
|
||||
|
||||
return lCharactersToAdd;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
|
@ -15,12 +15,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Statically Linked Libraries
|
|||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug_with_Libslirp|Win32 = Debug_with_Libslirp|Win32
|
||||
Debug_with_Libslirp|x64 = Debug_with_Libslirp|x64
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug_with_Libslirp|Win32.ActiveCfg = Debug_with_Libslirp|Win32
|
||||
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug_with_Libslirp|Win32.Build.0 = Debug_with_Libslirp|Win32
|
||||
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug_with_Libslirp|x64.ActiveCfg = Debug_with_Libslirp|x64
|
||||
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug_with_Libslirp|x64.Build.0 = Debug_with_Libslirp|x64
|
||||
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
@ -29,6 +35,10 @@ Global
|
|||
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|Win32.Build.0 = Release|Win32
|
||||
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|x64.ActiveCfg = Release|x64
|
||||
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|x64.Build.0 = Release|x64
|
||||
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug_with_Libslirp|Win32.ActiveCfg = Debug_with_Libslirp|Win32
|
||||
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug_with_Libslirp|Win32.Build.0 = Debug_with_Libslirp|Win32
|
||||
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug_with_Libslirp|x64.ActiveCfg = Debug_with_Libslirp|x64
|
||||
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug_with_Libslirp|x64.Build.0 = Debug_with_Libslirp|x64
|
||||
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
@ -37,6 +47,10 @@ Global
|
|||
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|Win32.Build.0 = Release|Win32
|
||||
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|x64.ActiveCfg = Release|x64
|
||||
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|x64.Build.0 = Release|x64
|
||||
{382DC80F-E278-4BC9-9DB6-59014486DA0F}.Debug_with_Libslirp|Win32.ActiveCfg = Debug_with_Libslirp|Win32
|
||||
{382DC80F-E278-4BC9-9DB6-59014486DA0F}.Debug_with_Libslirp|Win32.Build.0 = Debug_with_Libslirp|Win32
|
||||
{382DC80F-E278-4BC9-9DB6-59014486DA0F}.Debug_with_Libslirp|x64.ActiveCfg = Debug_with_Libslirp|x64
|
||||
{382DC80F-E278-4BC9-9DB6-59014486DA0F}.Debug_with_Libslirp|x64.Build.0 = Debug_with_Libslirp|x64
|
||||
{382DC80F-E278-4BC9-9DB6-59014486DA0F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{382DC80F-E278-4BC9-9DB6-59014486DA0F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{382DC80F-E278-4BC9-9DB6-59014486DA0F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
@ -45,6 +59,10 @@ Global
|
|||
{382DC80F-E278-4BC9-9DB6-59014486DA0F}.Release|Win32.Build.0 = Release|Win32
|
||||
{382DC80F-E278-4BC9-9DB6-59014486DA0F}.Release|x64.ActiveCfg = Release|x64
|
||||
{382DC80F-E278-4BC9-9DB6-59014486DA0F}.Release|x64.Build.0 = Release|x64
|
||||
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug_with_Libslirp|Win32.ActiveCfg = Debug_with_Libslirp|Win32
|
||||
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug_with_Libslirp|Win32.Build.0 = Debug_with_Libslirp|Win32
|
||||
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug_with_Libslirp|x64.ActiveCfg = Debug_with_Libslirp|x64
|
||||
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug_with_Libslirp|x64.Build.0 = Debug_with_Libslirp|x64
|
||||
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug_with_Libslirp|Win32">
|
||||
<Configuration>Debug_with_Libslirp</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug_with_Libslirp|x64">
|
||||
<Configuration>Debug_with_Libslirp</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
|
@ -32,6 +40,12 @@
|
|||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_with_Libslirp|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
|
@ -45,6 +59,12 @@
|
|||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_with_Libslirp|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
|
@ -60,12 +80,18 @@
|
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_with_Libslirp|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_with_Libslirp|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
|
@ -87,6 +113,25 @@
|
|||
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_with_Libslirp|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>ipconfigUSE_LIBSLIRP;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\ThirdParty\glib;..\..\ThirdParty\glib\build;..\..\ThirdParty\glib\build\glib;..\..\ThirdParty\glib\build\subprojects\pcre2-10.42;..\..\ThirdParty\glib\subprojects\proxy-libintl;..\..\ThirdParty\libslirp\src;.;..\..\Source\Utilities\logging;DemoTasks\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>Iphlpapi.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "..\..\ThirdParty\glib\build\glib\glib-2.0-0.dll" "$(OutDir)"
|
||||
xcopy /y /d "..\..\ThirdParty\glib\build\subprojects\proxy-libintl\intl-8.dll" "$(OutDir)"
|
||||
xcopy /y /d "..\..\ThirdParty\glib\build\subprojects\pcre2-10.42\pcre2-8-0.dll" "$(OutDir)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
@ -119,6 +164,25 @@
|
|||
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_with_Libslirp|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>ipconfigUSE_LIBSLIRP;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\ThirdParty\glib;..\..\ThirdParty\glib\build;..\..\ThirdParty\glib\build\glib;..\..\ThirdParty\glib\build\subprojects\pcre2-10.42;..\..\ThirdParty\glib\subprojects\proxy-libintl;..\..\ThirdParty\libslirp\src;.;..\..\Source\Utilities\logging;DemoTasks\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>Iphlpapi.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "..\..\ThirdParty\glib\build\glib\glib-2.0-0.dll" "$(OutDir)"
|
||||
xcopy /y /d "..\..\ThirdParty\glib\build\subprojects\proxy-libintl\intl-8.dll" "$(OutDir)"
|
||||
xcopy /y /d "..\..\ThirdParty\glib\build\subprojects\pcre2-10.42\pcre2-8-0.dll" "$(OutDir)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
|
|
@ -88,8 +88,8 @@
|
|||
* connections on the standard echo port (port 7), then echos back any data
|
||||
* received on that connection.
|
||||
*/
|
||||
#define mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS 1
|
||||
#define mainCREATE_TCP_ECHO_TASKS_SINGLE 0
|
||||
#define mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS 0
|
||||
#define mainCREATE_TCP_ECHO_TASKS_SINGLE 1
|
||||
#define mainCREATE_TCP_ECHO_SERVER_TASK 0
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -168,8 +168,14 @@ int main( void )
|
|||
FreeRTOS_debug_printf( ( "FreeRTOS_IPInit\r\n" ) );
|
||||
|
||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||
/* Initialise the interface descriptor for WinPCap. */
|
||||
|
||||
#ifdef ipconfigUSE_LIBSLIRP
|
||||
extern NetworkInterface_t* pxFillInterfaceDescriptor(BaseType_t xEMACIndex,
|
||||
NetworkInterface_t * pxInterface);
|
||||
pxFillInterfaceDescriptor( 0, &( xInterfaces[ 0 ] ) );
|
||||
#else
|
||||
pxWinPcap_FillInterfaceDescriptor( 0, &( xInterfaces[ 0 ] ) );
|
||||
#endif
|
||||
|
||||
/* === End-point 0 === */
|
||||
FreeRTOS_FillEndPoint( &( xInterfaces[ 0 ] ), &( xEndPoints[ 0 ] ), ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue