Initial commit

This commit is contained in:
alexpete
2021-03-05 11:26:34 -08:00
commit a10351f38d
27091 changed files with 5521199 additions and 0 deletions
@@ -0,0 +1,15 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <GridMate/Carrier/SocketDriver_Windows.h>
@@ -0,0 +1,47 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <GridMate_Traits_Platform.h>
#include <AzCore/std/base.h>
#include <WinSock2.h>
#include <ws2tcpip.h>
#include <Mswsock.h>
#ifdef WSAID_MULTIPLE_RIO
#define AZ_SOCKET_RIO_SUPPORT
#endif
struct sockaddr_in;
struct sockaddr;
struct addrinfo;
AZ_PUSH_DISABLE_WARNING(4800, "-Wunknown-warning-option")
#include <VersionHelpers.h>
AZ_POP_DISABLE_WARNING
#define SO_NBIO FIONBIO
#define AZ_EWOULDBLOCK WSAEWOULDBLOCK
#define AZ_EINPROGRESS WSAEINPROGRESS
#define AZ_ECONNREFUSED WSAECONNREFUSED
#define AZ_EALREADY WSAEALREADY
#define AZ_EISCONN WSAEISCONN
#define AZ_ENETUNREACH WSAENETUNREACH
#define AZ_ETIMEDOUT WSAETIMEDOUT
namespace GridMate
{
namespace Platform
{
using SocketType_Platform = AZStd::size_t;
}
}
@@ -0,0 +1,38 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <GridMate_Traits_Platform.h>
#include <GridMate/Carrier/Utils.h>
#include <GridMate/Carrier/Driver.h>
#include <AzCore/PlatformIncl.h>
#include <WinSock2.h>
#include <Ws2tcpip.h>
namespace GridMate
{
const char* GridMate::Utils::GetBroadcastAddress(int familyType)
{
if (familyType == Driver::BSD_AF_INET6)
{
return "FF02::1";
}
else if (familyType == Driver::BSD_AF_INET)
{
return "255.255.255.255";
}
else
{
return "";
}
}
}
@@ -0,0 +1,41 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <GridMate/String/string.h>
#include <WinSock2.h>
#include <stdlib.h>
namespace GridMate
{
namespace Platform
{
void AssignExtendedName(GridMate::string& extendedName)
{
char hostName[64];
gethostname(hostName, AZ_ARRAY_SIZE(hostName));
char procPath[256];
char procName[256];
DWORD ret = GetModuleFileName(NULL, procPath, 256);
if (ret > 0)
{
::_splitpath_s(procPath, 0, 0, 0, 0, procName, 256, 0, 0);
}
else
{
azsnprintf(procName, AZ_ARRAY_SIZE(procName), "Unknown");
}
extendedName = GridMate::string::format("%s::%s", hostName, procName);
}
}
}
@@ -0,0 +1,14 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <GridMate/Session/Session_Windows.h>
@@ -0,0 +1,14 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/PlatformIncl.h>
@@ -0,0 +1,14 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <GridMate_Traits_Windows.h>
@@ -0,0 +1,18 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#define AZ_TRAIT_GRIDMATE_ENABLE_OPENSSL 1
#define AZ_TRAIT_GRIDMATE_MAX_PACKET_SEND_SIZE 1400
#define AZ_TRAIT_GRIDMATE_MESSAGE_NO_SIGNAL 0
#define AZ_TRAIT_GRIDMATE_SECURE_SOCKET_DRIVER_HOOK_ENABLED 1
#define AZ_TRAIT_GRIDMATE_SOCKET_IPV6_SUPPORT_EXTENSION 0
@@ -0,0 +1,21 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# Platform specific cmake file for configuring target compiler/link properties
# based on the active platform
# NOTE: functions in cmake are global, therefore adding functions to this file
# is being avoided to prevent overriding functions declared in other targets platfrom
# specific cmake files
set(LY_BUILD_DEPENDENCIES
PRIVATE
ws2_32
)
@@ -0,0 +1,23 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
set(FILES
../Common/WinAPI/GridMate/Carrier/SocketDriver_WinAPI.cpp
../Common/WinAPI/GridMate/Carrier/Utils_WinAPI.cpp
GridMate/Carrier/SocketDriver_Platform.h
GridMate/Carrier/SocketDriver_Windows.h
GridMate/Carrier/Utils_Windows.cpp
GridMate/Session/LANSession_Windows.cpp
GridMate/Session/Session_Platform.h
GridMate/Session/Session_Windows.h
GridMate_Traits_Platform.h
GridMate_Traits_Windows.h
)