Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MSVC solution/projects, fix many warnings, and small enhancements. #695

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
39a8ce1
makefile (compiler flags) changes
axelriet Jan 9, 2024
218ffc4
main -> __cdecl and nmake file tweaks
axelriet Jan 9, 2024
050f3de
build settings
axelriet Jan 10, 2024
ab89a04
build settings
axelriet Jan 10, 2024
ad00f6c
Fix all /W4 warnings
axelriet Jan 11, 2024
de11df3
More /W4 fixes
axelriet Jan 11, 2024
42d5c4f
.sln + 1 program
axelriet Jan 11, 2024
8cd3892
Tidy-up + added client.exe
axelriet Jan 11, 2024
b185eb1
added client_upcall + daytime_server
axelriet Jan 11, 2024
18b408e
BUGFIX: usrsctp_getpaddrs() and usrsctp_getladdrs() must initialize t…
axelriet Jan 11, 2024
2b85472
Ignore /msvc/*.vcxproj.user
axelriet Jan 11, 2024
3d9365f
Added discard_server and discard_server_upcall projects
axelriet Jan 12, 2024
bdf6443
Added more programs
axelriet Jan 12, 2024
808ed57
Completed msvc solution and project files
axelriet Jan 12, 2024
32909ad
Added fuzzer projects
axelriet Jan 12, 2024
1e79367
MSVC Tidy-up
axelriet Jan 12, 2024
96999cd
EnablePREfast
axelriet Jan 12, 2024
b4883fc
Make sctp_userspace_set_threadname() work on Windows.
axelriet Jan 12, 2024
54f8f8a
Merge branch 'sctplab:master' into master
axelriet Jan 12, 2024
f75e5f5
Restore original *.nmake
axelriet Jan 13, 2024
dc7984c
Restore .gitignore programs/*
axelriet Jan 13, 2024
c322688
Removed all calls to CreateThread() and TerminateThread() - Implement…
axelriet Jan 13, 2024
4b1e497
Replace loop calling rand_s() in read_random() with single call to ei…
axelriet Jan 14, 2024
b5a094e
Use CryptoAPI for SHA-1 on Windows
axelriet Jan 18, 2024
b187c27
Simplify the random number generation/caching.
axelriet Jan 18, 2024
5e79645
Implemented proper locking around the random_store; Cache 1K numbers.
axelriet Jan 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.ko
*.obj
*.elf
*.pdb
*.ipdb

# Precompiled Headers
*.gch
Expand Down Expand Up @@ -82,3 +84,10 @@ callgrind.out*

# cmake build
/build

# MSVC build and IDE artifacts
/bin
/lib
/obj
/msvc/.vs
/msvc/*.vcxproj.user
5 changes: 4 additions & 1 deletion fuzzer/fuzzer_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ initialize_fuzzer(void) {


int
LLVMFuzzerTestOneInput(const uint8_t* data, size_t data_size)
#ifdef _MSC_VER
__cdecl
#endif
LLVMFuzzerTestOneInput (const uint8_t *data, size_t data_size)
{
static int initialized;
char *fuzz_packet_buffer;
Expand Down
5 changes: 4 additions & 1 deletion fuzzer/fuzzer_fragment.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ initialize_fuzzer(void) {
}

int
LLVMFuzzerTestOneInput(const uint8_t* data, size_t data_size)
#ifdef _MSC_VER
__cdecl
#endif
LLVMFuzzerTestOneInput (const uint8_t *data, size_t data_size)
{
static int initialized;
char *fuzz_packet_buffer;
Expand Down
5 changes: 4 additions & 1 deletion fuzzer/fuzzer_listen.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ init_fuzzer(void) {
}

int
LLVMFuzzerTestOneInput(const uint8_t* data, size_t data_size)
#ifdef _MSC_VER
__cdecl
#endif
LLVMFuzzerTestOneInput (const uint8_t *data, size_t data_size)
{
init_fuzzer();

Expand Down
3 changes: 3 additions & 0 deletions fuzzer/pcap2corpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ get_filter(int argc, char *argv[])
}

int
#ifdef _MSC_VER
__cdecl
#endif
main(int argc, char *argv[])
{
char errbuf[PCAP_ERRBUF_SIZE];
Expand Down
166 changes: 166 additions & 0 deletions msvc/chargen_server_upcall.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{6f50aa5b-3ed7-46b9-b4eb-cb41f9e46b9f}</ProjectGuid>
<RootNamespace>chargenserverupcall</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<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 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 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>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)..\bin\$(Platform)\$(Configuration)\</OutDir>
<LinkIncremental>false</LinkIncremental>
<IntDir>$(SolutionDir)..\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)..\bin\$(Platform)\$(Configuration)\</OutDir>
<LinkIncremental>false</LinkIncremental>
<IntDir>$(SolutionDir)..\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)..\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)..\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;SCTP_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>$(SolutionDir)..\usrsctplib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<CallingConvention>VectorCall</CallingConvention>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(SolutionDir)..\lib\$(Platform)\$(Configuration)\usrsctp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<CallingConvention>VectorCall</CallingConvention>
<AdditionalIncludeDirectories>$(SolutionDir)..\usrsctplib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(SolutionDir)..\lib\$(Platform)\$(Configuration)\usrsctp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\programs\chargen_server_upcall.c" />
<ClCompile Include="..\programs\programs_helper.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
4 changes: 4 additions & 0 deletions msvc/chargen_server_upcall.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
Loading