diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 44fd9ca1260..0d2f1e26789 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -30,7 +30,8 @@ jobs: build: name: ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} runs-on: windows-2022 - timeout-minutes: 30 + # A cold vcpkg binary cache builds all dependencies from source. + timeout-minutes: 120 env: VCPKG_FILE_CACHE: ${{ github.workspace }}\vcpkg-bincache @@ -115,6 +116,8 @@ jobs: $triplet = "x86-windows" if ("${{ inputs.preset }}" -like "x64*") { $triplet = "x64-windows" } + # Must match VCPKG_TARGET_TRIPLET in the win32-vcpkg presets. + if ("${{ inputs.preset }}" -like "win32-vcpkg*") { $triplet = "x86-windows-static-md" } "baseline=$baseline" >> $env:GITHUB_OUTPUT "triplet=$triplet" >> $env:GITHUB_OUTPUT @@ -137,6 +140,8 @@ jobs: with: runVcpkgInstall: false doNotCache: true + # Only the root manifest; ports/ holds overlay port manifests without a baseline. + vcpkgJsonGlob: vcpkg.json - name: Configure vcpkg to use cached directory if: startsWith(inputs.preset, 'win32') @@ -178,7 +183,7 @@ jobs: - name: Save vcpkg binary cache # Only one job should save to avoid "Unable to reserve cache" conflicts. - if: ${{ startsWith(inputs.preset, 'win32') && steps.vcpkg_cache.outputs.cache-hit != 'true' && inputs.game == 'Generals' && inputs.preset == 'win32-vcpkg-debug' }} + if: ${{ startsWith(inputs.preset, 'win32') && steps.vcpkg_cache.outputs.cache-hit != 'true' && inputs.game == 'GeneralsMD' && inputs.preset == 'win32-vcpkg' }} uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: ${{ github.workspace }}\vcpkg-bincache diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 879fd40a079..7c54e4412a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,24 +135,17 @@ jobs: strategy: matrix: include: - - preset: "win32" + # Generals Online networking deps (curl, GameNetworkingSockets, sentry) come from vcpkg, + # so only the vcpkg presets can build GeneralsMD. + - preset: "win32-vcpkg" tools: false extras: true - - preset: "win32-profile" + - preset: "win32-vcpkg-profile" tools: false extras: true - - preset: "win32-debug" + - preset: "win32-vcpkg-debug" tools: false extras: true - #- preset: "win32-vcpkg" - # tools: true - # extras: true - #- preset: "win32-vcpkg-profile" - # tools: true - # extras: true - #- preset: "win32-vcpkg-debug" - # tools: true - # extras: true fail-fast: false uses: ./.github/workflows/build-toolchain.yml with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 12d9bcff104..39062e3fbe6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,16 +63,6 @@ else() endif() include(cmake/config.cmake) - -if(RTS_BUILD_ZEROHOUR AND NOT IS_VS6_BUILD) - if(NOT VCPKG_TOOLCHAIN) - message(FATAL_ERROR - "Zero Hour networking dependencies require the vcpkg toolchain. " - "Configure with -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake.") - endif() - include(cmake/networking.cmake) -endif() - include(cmake/gamespy.cmake) include(cmake/lzhl.cmake) include(cmake/stb.cmake) diff --git a/CMakePresets.json b/CMakePresets.json index cc5dc627448..c2ffb5b390b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -148,6 +148,8 @@ "strategy": "external" }, "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x86-windows-static-md", + "VCPKG_INSTALL_OPTIONS": "--x-buildtrees-root=$env{LOCALAPPDATA}/vcpkg/bt", "RTS_FLAGS": "/W3" }, "vendor": { diff --git a/GeneralsMD/CMakeLists.txt b/GeneralsMD/CMakeLists.txt index 1285409e7fc..b40c0373a14 100644 --- a/GeneralsMD/CMakeLists.txt +++ b/GeneralsMD/CMakeLists.txt @@ -42,6 +42,17 @@ endif() if(RTS_INSTALL_PREFIX_ZEROHOUR) install(TARGETS z_generals RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}") install(FILES $ DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL) + if(EXISTS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/sentry-native/crashpad_handler.exe") + # sentry's crashpad backend needs this watcher executable next to the game (see Main/CMakeLists.txt). + install(PROGRAMS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/sentry-native/crashpad_handler.exe" + DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}") + endif() + if(WIN32) + # discord-rpc.dll is copied next to the build output in Main/CMakeLists.txt. + set(DISCORD_RPC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Code/GameEngine/Source/GameNetwork/GeneralsOnline/Vendor/DiscordRPC") + install(FILES "${DISCORD_RPC_DIR}/discord-rpc.dll" DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}") + install(FILES "${DISCORD_RPC_DIR}/LICENSE.txt" DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" RENAME discord-rpc-LICENSE.txt) + endif() if(TARGET z_worldbuilder) install(TARGETS z_worldbuilder RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}") diff --git a/GeneralsMD/Code/GameEngine/CMakeLists.txt b/GeneralsMD/Code/GameEngine/CMakeLists.txt index a772ff00ae8..a84c0935e98 100644 --- a/GeneralsMD/Code/GameEngine/CMakeLists.txt +++ b/GeneralsMD/Code/GameEngine/CMakeLists.txt @@ -1160,29 +1160,6 @@ set(GAMEENGINE_SRC Include/GameNetwork/GeneralsOnline/HTTP/HTTPRequest.h Include/GameNetwork/GeneralsOnline/NextGenTransport.h Include/GameNetwork/GeneralsOnline/PluginInterfaces.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingmessages.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingsockets.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingutils.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steam_api_common.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamclientpublic.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingcustomsignaling.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingsockets.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingsockets_flat.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingtypes.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamtypes.h - Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamuniverse.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/curl.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/curlver.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/easy.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/header.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/mprintf.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/multi.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/options.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/stdcheaders.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/system.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/typecheck-gcc.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/urlapi.h - Include/GameNetwork/GeneralsOnline/Vendor/libcurl/websockets.h Source/GameNetwork/GeneralsOnline/DiscordRichPresence.cpp Source/GameNetwork/GeneralsOnline/NGMP_Helpers.cpp Source/GameNetwork/GeneralsOnline/NGMPGame.cpp @@ -1222,8 +1199,6 @@ add_library(z_gameengine STATIC) target_sources(z_gameengine PRIVATE ${GAMEENGINE_SRC}) -target_compile_definitions(z_gameengine PRIVATE GAMESPY_IMPORT_DATA) - target_include_directories(z_gameengine PUBLIC Include @@ -1244,14 +1219,17 @@ target_link_libraries(z_gameengine PUBLIC z_wwvegas ) +# Generals Online networking dependencies, provided by vcpkg (see vcpkg.json). if(NOT IS_VS6_BUILD) + find_package(CURL CONFIG REQUIRED) + find_package(GameNetworkingSockets CONFIG REQUIRED) + find_package(sentry CONFIG REQUIRED) + target_link_libraries(z_gameengine PUBLIC CURL::libcurl - GameNetworkingSockets::shared + GameNetworkingSockets::GameNetworkingSockets_s sentry::sentry ) -else() - target_compile_definitions(z_gameengine PRIVATE RTS_USE_LEGACY_NETWORK_VENDOR) endif() target_precompile_headers(z_gameengine PRIVATE diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/HTTP/HTTPManager.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/HTTP/HTTPManager.h index ad97c3e384c..57a4c498928 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/HTTP/HTTPManager.h +++ b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/HTTP/HTTPManager.h @@ -37,16 +37,6 @@ class HTTPManager void Tick(); - static void SetCACertStoreBad() - { - m_bCACertBad.store(true); - } - - static bool IsCACertStoreBad() - { - return m_bCACertBad.load(); - } - void SetProtocolInUse(EIPProtocolVersion proto) { m_sProtocolInUse.store(proto); @@ -84,8 +74,6 @@ class HTTPManager std::atomic m_sProtocolInUse = EIPProtocolVersion::DONT_CARE; - static std::atomic m_bCACertBad; - bool m_bProxyEnabled = false; std::string m_strProxyAddr; uint16_t m_proxyPort; diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/NextGenTransport.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/NextGenTransport.h index a2ef3747f66..71814f94ee7 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/NextGenTransport.h +++ b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/NextGenTransport.h @@ -1,7 +1,5 @@ #pragma once -#define STEAMNETWORKINGSOCKETS_STATIC_LINK 1 - #include "GameNetwork/udp.h" #include "GameNetwork/NetworkDefs.h" #include "GameNetwork/Transport.h" @@ -9,15 +7,6 @@ #include -#ifdef RTS_USE_LEGACY_NETWORK_VENDOR -#pragma comment(lib, "ValveNetworkingSockets/GameNetworkingSockets.lib") -#pragma comment(lib, "ValveNetworkingSockets/abseil_dll.lib") -#pragma comment(lib, "ValveNetworkingSockets/libcrypto.lib") -#pragma comment(lib, "ValveNetworkingSockets/libprotobuf.lib") -#pragma comment(lib, "ValveNetworkingSockets/libssl.lib") -#pragma comment(lib, "ValveNetworkingSockets/steamwebrtc.lib") -#pragma comment(lib, "ValveNetworkingSockets/webrtc-lite.lib") -#endif #pragma comment(lib, "Secur32.lib") // Struct to track retry state for outgoing packets diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/OnlineServices_Init.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/OnlineServices_Init.h index 4a8561377e6..64ce3dfe1bc 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/OnlineServices_Init.h +++ b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/OnlineServices_Init.h @@ -38,12 +38,7 @@ struct S3ScreenshotEntry #include #include -#ifdef RTS_USE_LEGACY_NETWORK_VENDOR -#pragma comment(lib, "libcurl/libcurl.lib") -#include "GameNetwork/GeneralsOnline/Vendor/libcurl/curl.h" -#else #include -#endif #include #include #include "GeneralsOnline_Settings.h" diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingmessages.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingmessages.h deleted file mode 100644 index b7a2cd0e554..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingmessages.h +++ /dev/null @@ -1,198 +0,0 @@ -//====== Copyright Valve Corporation, All rights reserved. ==================== - -#ifndef ISTEAMNETWORKINGMESSAGES -#define ISTEAMNETWORKINGMESSAGES -#pragma once - -#include "steamnetworkingtypes.h" -#include "steam_api_common.h" - -//----------------------------------------------------------------------------- -/// The non-connection-oriented interface to send and receive messages -/// (whether they be "clients" or "servers"). -/// -/// ISteamNetworkingSockets is connection-oriented (like TCP), meaning you -/// need to listen and connect, and then you send messages using a connection -/// handle. ISteamNetworkingMessages is more like UDP, in that you can just send -/// messages to arbitrary peers at any time. The underlying connections are -/// established implicitly. -/// -/// Under the hood ISteamNetworkingMessages works on top of the ISteamNetworkingSockets -/// code, so you get the same routing and messaging efficiency. The difference is -/// mainly in your responsibility to explicitly establish a connection and -/// the type of feedback you get about the state of the connection. Both -/// interfaces can do "P2P" communications, and both support both unreliable -/// and reliable messages, fragmentation and reassembly. -/// -/// The primary purpose of this interface is to be "like UDP", so that UDP-based code -/// can be ported easily to take advantage of relayed connections. If you find -/// yourself needing more low level information or control, or to be able to better -/// handle failure, then you probably need to use ISteamNetworkingSockets directly. -/// Also, note that if your main goal is to obtain a connection between two peers -/// without concerning yourself with assigning roles of "client" and "server", -/// you may find the symmetric connection mode of ISteamNetworkingSockets useful. -/// (See k_ESteamNetworkingConfig_SymmetricConnect.) -/// -class ISteamNetworkingMessages -{ -public: - /// Sends a message to the specified host. If we don't already have a session with that user, - /// a session is implicitly created. There might be some handshaking that needs to happen - /// before we can actually begin sending message data. If this handshaking fails and we can't - /// get through, an error will be posted via the callback SteamNetworkingMessagesSessionFailed_t. - /// There is no notification when the operation succeeds. (You should have the peer send a reply - /// for this purpose.) - /// - /// Sending a message to a host will also implicitly accept any incoming connection from that host. - /// - /// nSendFlags is a bitmask of k_nSteamNetworkingSend_xxx options - /// - /// nRemoteChannel is a routing number you can use to help route message to different systems. - /// You'll have to call ReceiveMessagesOnChannel() with the same channel number in order to retrieve - /// the data on the other end. - /// - /// Using different channels to talk to the same user will still use the same underlying - /// connection, saving on resources. If you don't need this feature, use 0. - /// Otherwise, small integers are the most efficient. - /// - /// It is guaranteed that reliable messages to the same host on the same channel - /// will be be received by the remote host (if they are received at all) exactly once, - /// and in the same order that they were sent. - /// - /// NO other order guarantees exist! In particular, unreliable messages may be dropped, - /// received out of order with respect to each other and with respect to reliable data, - /// or may be received multiple times. Messages on different channels are *not* guaranteed - /// to be received in the order they were sent. - /// - /// A note for those familiar with TCP/IP ports, or converting an existing codebase that - /// opened multiple sockets: You might notice that there is only one channel, and with - /// TCP/IP each endpoint has a port number. You can think of the channel number as the - /// *destination* port. If you need each message to also include a "source port" (so the - /// recipient can route the reply), then just put that in your message. That is essentially - /// how UDP works! - /// - /// Returns: - /// - k_EREsultOK on success. - /// - k_EResultNoConnection, if the session has failed or was closed by the peer and - /// k_nSteamNetworkingSend_AutoRestartBrokenSession was not specified. (You can - /// use GetSessionConnectionInfo to get the details.) In order to acknowledge the - /// broken session and start a new one, you must call CloseSessionWithUser, or you may - /// repeat the call with k_nSteamNetworkingSend_AutoRestartBrokenSession. See - /// k_nSteamNetworkingSend_AutoRestartBrokenSession for more details. - /// - See ISteamNetworkingSockets::SendMessageToConnection for more possible return values - virtual EResult SendMessageToUser( const SteamNetworkingIdentity &identityRemote, const void *pubData, uint32 cubData, int nSendFlags, int nRemoteChannel ) = 0; - - /// Reads the next message that has been sent from another user via SendMessageToUser() on the given channel. - /// Returns number of messages returned into your list. (0 if no message are available on that channel.) - /// - /// When you're done with the message object(s), make sure and call SteamNetworkingMessage_t::Release()! - virtual int ReceiveMessagesOnChannel( int nLocalChannel, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; - - /// Call this in response to a SteamNetworkingMessagesSessionRequest_t callback. - /// SteamNetworkingMessagesSessionRequest_t are posted when a user tries to send you a message, - /// and you haven't tried to talk to them first. If you don't want to talk to them, just ignore - /// the request. If the user continues to send you messages, SteamNetworkingMessagesSessionRequest_t - /// callbacks will continue to be posted periodically. - /// - /// Returns false if there is no session with the user pending or otherwise. If there is an - /// existing active session, this function will return true, even if it is not pending. - /// - /// Calling SendMessageToUser() will implicitly accepts any pending session request to that user. - virtual bool AcceptSessionWithUser( const SteamNetworkingIdentity &identityRemote ) = 0; - - /// Call this when you're done talking to a user to immediately free up resources under-the-hood. - /// If the remote user tries to send data to you again, another SteamNetworkingMessagesSessionRequest_t - /// callback will be posted. - /// - /// Note that sessions that go unused for a few minutes are automatically timed out. - virtual bool CloseSessionWithUser( const SteamNetworkingIdentity &identityRemote ) = 0; - - /// Call this when you're done talking to a user on a specific channel. Once all - /// open channels to a user have been closed, the open session to the user will be - /// closed, and any new data from this user will trigger a - /// SteamSteamNetworkingMessagesSessionRequest_t callback - virtual bool CloseChannelWithUser( const SteamNetworkingIdentity &identityRemote, int nLocalChannel ) = 0; - - /// Returns information about the latest state of a connection, if any, with the given peer. - /// Primarily intended for debugging purposes, but can also be used to get more detailed - /// failure information. (See SendMessageToUser and k_nSteamNetworkingSend_AutoRestartBrokenSession.) - /// - /// Returns the value of SteamNetConnectionInfo_t::m_eState, or k_ESteamNetworkingConnectionState_None - /// if no connection exists with specified peer. You may pass nullptr for either parameter if - /// you do not need the corresponding details. Note that sessions time out after a while, - /// so if a connection fails, or SendMessageToUser returns k_EResultNoConnection, you cannot wait - /// indefinitely to obtain the reason for failure. - virtual ESteamNetworkingConnectionState GetSessionConnectionInfo( const SteamNetworkingIdentity &identityRemote, SteamNetConnectionInfo_t *pConnectionInfo, SteamNetConnectionRealTimeStatus_t *pQuickStatus ) = 0; -}; -#define STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "SteamNetworkingMessages002" - -// -// Callbacks -// - -#pragma pack( push, 1 ) - -/// Posted when a remote host is sending us a message, and we do not already have a session with them -struct SteamNetworkingMessagesSessionRequest_t -{ - enum { k_iCallback = k_iSteamNetworkingMessagesCallbacks + 1 }; - SteamNetworkingIdentity m_identityRemote; // user who wants to talk to us -}; - -/// Posted when we fail to establish a connection, or we detect that communications -/// have been disrupted it an unusual way. There is no notification when a peer proactively -/// closes the session. ("Closed by peer" is not a concept of UDP-style communications, and -/// SteamNetworkingMessages is primarily intended to make porting UDP code easy.) -/// -/// Remember: callbacks are asynchronous. See notes on SendMessageToUser, -/// and k_nSteamNetworkingSend_AutoRestartBrokenSession in particular. -/// -/// Also, if a session times out due to inactivity, no callbacks will be posted. The only -/// way to detect that this is happening is that querying the session state may return -/// none, connecting, and findingroute again. -struct SteamNetworkingMessagesSessionFailed_t -{ - enum { k_iCallback = k_iSteamNetworkingMessagesCallbacks + 2 }; - - /// Detailed info about the session that failed. - /// SteamNetConnectionInfo_t::m_identityRemote indicates who this session - /// was with. - SteamNetConnectionInfo_t m_info; -}; - -#pragma pack(pop) - -// Global accessors - -// Using standalone lib -#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB - - static_assert( STEAMNETWORKINGMESSAGES_INTERFACE_VERSION[25] == '2', "Version mismatch" ); - - STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingMessages *SteamNetworkingMessages_LibV2(); - inline ISteamNetworkingMessages *SteamNetworkingMessages_Lib() { return SteamNetworkingMessages_LibV2(); } - - // If running in context of steam, we also define a gameserver instance. - STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingMessages *SteamGameServerNetworkingMessages_LibV2(); - inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages_Lib() { return SteamGameServerNetworkingMessages_LibV2(); } - - #ifndef STEAMNETWORKINGSOCKETS_STEAMAPI - inline ISteamNetworkingMessages *SteamNetworkingMessages() { return SteamNetworkingMessages_LibV2(); } - inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages() { return SteamGameServerNetworkingMessages_LibV2(); } - #endif -#endif - -// Using Steamworks SDK -#ifdef STEAMNETWORKINGSOCKETS_STEAMAPI - - // Steamworks SDK - STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworkingMessages *, SteamNetworkingMessages_SteamAPI, STEAMNETWORKINGMESSAGES_INTERFACE_VERSION ); - STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworkingMessages *, SteamGameServerNetworkingMessages_SteamAPI, STEAMNETWORKINGMESSAGES_INTERFACE_VERSION ); - - #ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB - inline ISteamNetworkingMessages *SteamNetworkingMessages() { return SteamNetworkingMessages_SteamAPI(); } - inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages() { return SteamGameServerNetworkingMessages_SteamAPI(); } - #endif -#endif - -#endif // ISTEAMNETWORKINGMESSAGES diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingsockets.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingsockets.h deleted file mode 100644 index 9b7ec652177..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingsockets.h +++ /dev/null @@ -1,1034 +0,0 @@ -//====== Copyright Valve Corporation, All rights reserved. ==================== - -#ifndef ISTEAMNETWORKINGSOCKETS -#define ISTEAMNETWORKINGSOCKETS -#pragma once - -#include "steamnetworkingtypes.h" -#include "steam_api_common.h" -#include - -struct SteamNetAuthenticationStatus_t; -struct SteamNetworkingFakeIPResult_t; -class ISteamNetworkingConnectionSignaling; -class ISteamNetworkingSignalingRecvContext; -class ISteamNetworkingFakeUDPPort; - -//----------------------------------------------------------------------------- -/// Lower level networking API. -/// -/// - Connection-oriented API (like TCP, not UDP). When sending and receiving -/// messages, a connection handle is used. (For a UDP-style interface, where -/// the peer is identified by their address with each send/recv call, see -/// ISteamNetworkingMessages.) The typical pattern is for a "server" to "listen" -/// on a "listen socket." A "client" will "connect" to the server, and the -/// server will "accept" the connection. If you have a symmetric situation -/// where either peer may initiate the connection and server/client roles are -/// not clearly defined, check out k_ESteamNetworkingConfig_SymmetricConnect. -/// - But unlike TCP, it's message-oriented, not stream-oriented. -/// - Mix of reliable and unreliable messages -/// - Fragmentation and reassembly -/// - Supports connectivity over plain UDP -/// - Also supports SDR ("Steam Datagram Relay") connections, which are -/// addressed by the identity of the peer. There is a "P2P" use case and -/// a "hosted dedicated server" use case. -/// -/// Note that neither of the terms "connection" nor "socket" necessarily correspond -/// one-to-one with an underlying UDP socket. An attempt has been made to -/// keep the semantics as similar to the standard socket model when appropriate, -/// but some deviations do exist. -/// -/// See also: ISteamNetworkingMessages, the UDP-style interface. This API might be -/// easier to use, especially when porting existing UDP code. -class ISteamNetworkingSockets -{ -public: - - /// Creates a "server" socket that listens for clients to connect to by - /// calling ConnectByIPAddress, over ordinary UDP (IPv4 or IPv6) - /// - /// You must select a specific local port to listen on and set it - /// the port field of the local address. - /// - /// Usually you will set the IP portion of the address to zero (SteamNetworkingIPAddr::Clear()). - /// This means that you will not bind to any particular local interface (i.e. the same - /// as INADDR_ANY in plain socket code). Furthermore, if possible the socket will be bound - /// in "dual stack" mode, which means that it can accept both IPv4 and IPv6 client connections. - /// If you really do wish to bind a particular interface, then set the local address to the - /// appropriate IPv4 or IPv6 IP. - /// - /// If you need to set any initial config options, pass them here. See - /// SteamNetworkingConfigValue_t for more about why this is preferable to - /// setting the options "immediately" after creation. - /// - /// When a client attempts to connect, a SteamNetConnectionStatusChangedCallback_t - /// will be posted. The connection will be in the connecting state. - virtual HSteamListenSocket CreateListenSocketIP( const SteamNetworkingIPAddr &localAddress, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; - - /// Creates a connection and begins talking to a "server" over UDP at the - /// given IPv4 or IPv6 address. The remote host must be listening with a - /// matching call to CreateListenSocketIP on the specified port. - /// - /// A SteamNetConnectionStatusChangedCallback_t callback will be triggered when we start - /// connecting, and then another one on either timeout or successful connection. - /// - /// If the server does not have any identity configured, then their network address - /// will be the only identity in use. Or, the network host may provide a platform-specific - /// identity with or without a valid certificate to authenticate that identity. (These - /// details will be contained in the SteamNetConnectionStatusChangedCallback_t.) It's - /// up to your application to decide whether to allow the connection. - /// - /// By default, all connections will get basic encryption sufficient to prevent - /// casual eavesdropping. But note that without certificates (or a shared secret - /// distributed through some other out-of-band mechanism), you don't have any - /// way of knowing who is actually on the other end, and thus are vulnerable to - /// man-in-the-middle attacks. - /// - /// If you need to set any initial config options, pass them here. See - /// SteamNetworkingConfigValue_t for more about why this is preferable to - /// setting the options "immediately" after creation. - virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; - - /// Like CreateListenSocketIP, but clients will connect using ConnectP2P. - /// - /// nLocalVirtualPort specifies how clients can connect to this socket using - /// ConnectP2P. It's very common for applications to only have one listening socket; - /// in that case, use zero. If you need to open multiple listen sockets and have clients - /// be able to connect to one or the other, then nLocalVirtualPort should be a small - /// integer (<1000) unique to each listen socket you create. - /// - /// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess() - /// when your app initializes. - /// - /// If you are listening on a dedicated servers in known data center, - /// then you can listen using this function instead of CreateHostedDedicatedServerListenSocket, - /// to allow clients to connect without a ticket. Any user that owns - /// the app and is signed into Steam will be able to attempt to connect to - /// your server. Also, a connection attempt may require the client to - /// be connected to Steam, which is one more moving part that may fail. When - /// tickets are used, then once a ticket is obtained, a client can connect to - /// your server even if they got disconnected from Steam or Steam is offline. - /// - /// If you need to set any initial config options, pass them here. See - /// SteamNetworkingConfigValue_t for more about why this is preferable to - /// setting the options "immediately" after creation. - virtual HSteamListenSocket CreateListenSocketP2P( int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; - - /// Begin connecting to a peer that is identified using a platform-specific identifier. - /// This uses the default rendezvous service, which depends on the platform and library - /// configuration. (E.g. on Steam, it goes through the steam backend.) - /// - /// If you need to set any initial config options, pass them here. See - /// SteamNetworkingConfigValue_t for more about why this is preferable to - /// setting the options "immediately" after creation. - /// - /// To use your own signaling service, see: - /// - ConnectP2PCustomSignaling - /// - k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling - virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; - - /// Accept an incoming connection that has been received on a listen socket. - /// - /// When a connection attempt is received (perhaps after a few basic handshake - /// packets have been exchanged to prevent trivial spoofing), a connection interface - /// object is created in the k_ESteamNetworkingConnectionState_Connecting state - /// and a SteamNetConnectionStatusChangedCallback_t is posted. At this point, your - /// application MUST either accept or close the connection. (It may not ignore it.) - /// Accepting the connection will transition it either into the connected state, - /// or the finding route state, depending on the connection type. - /// - /// You should take action within a second or two, because accepting the connection is - /// what actually sends the reply notifying the client that they are connected. If you - /// delay taking action, from the client's perspective it is the same as the network - /// being unresponsive, and the client may timeout the connection attempt. In other - /// words, the client cannot distinguish between a delay caused by network problems - /// and a delay caused by the application. - /// - /// This means that if your application goes for more than a few seconds without - /// processing callbacks (for example, while loading a map), then there is a chance - /// that a client may attempt to connect in that interval and fail due to timeout. - /// - /// If the application does not respond to the connection attempt in a timely manner, - /// and we stop receiving communication from the client, the connection attempt will - /// be timed out locally, transitioning the connection to the - /// k_ESteamNetworkingConnectionState_ProblemDetectedLocally state. The client may also - /// close the connection before it is accepted, and a transition to the - /// k_ESteamNetworkingConnectionState_ClosedByPeer is also possible depending the exact - /// sequence of events. - /// - /// Returns k_EResultInvalidParam if the handle is invalid. - /// Returns k_EResultInvalidState if the connection is not in the appropriate state. - /// (Remember that the connection state could change in between the time that the - /// notification being posted to the queue and when it is received by the application.) - /// - /// A note about connection configuration options. If you need to set any configuration - /// options that are common to all connections accepted through a particular listen - /// socket, consider setting the options on the listen socket, since such options are - /// inherited automatically. If you really do need to set options that are connection - /// specific, it is safe to set them on the connection before accepting the connection. - virtual EResult AcceptConnection( HSteamNetConnection hConn ) = 0; - - /// Disconnects from the remote host and invalidates the connection handle. - /// Any unread data on the connection is discarded. - /// - /// nReason is an application defined code that will be received on the other - /// end and recorded (when possible) in backend analytics. The value should - /// come from a restricted range. (See ESteamNetConnectionEnd.) If you don't need - /// to communicate any information to the remote host, and do not want analytics to - /// be able to distinguish "normal" connection terminations from "exceptional" ones, - /// You may pass zero, in which case the generic value of - /// k_ESteamNetConnectionEnd_App_Generic will be used. - /// - /// pszDebug is an optional human-readable diagnostic string that will be received - /// by the remote host and recorded (when possible) in backend analytics. - /// - /// If you wish to put the socket into a "linger" state, where an attempt is made to - /// flush any remaining sent data, use bEnableLinger=true. Otherwise reliable data - /// is not flushed. - /// - /// If the connection has already ended and you are just freeing up the - /// connection interface, the reason code, debug string, and linger flag are - /// ignored. - virtual bool CloseConnection( HSteamNetConnection hPeer, int nReason, const char *pszDebug, bool bEnableLinger ) = 0; - - /// Destroy a listen socket. All the connections that were accepting on the listen - /// socket are closed ungracefully. - virtual bool CloseListenSocket( HSteamListenSocket hSocket ) = 0; - - /// Set connection user data. the data is returned in the following places - /// - You can query it using GetConnectionUserData. - /// - The SteamNetworkingmessage_t structure. - /// - The SteamNetConnectionInfo_t structure. - /// (Which is a member of SteamNetConnectionStatusChangedCallback_t -- but see WARNINGS below!!!!) - /// - /// Do you need to set this atomically when the connection is created? - /// See k_ESteamNetworkingConfig_ConnectionUserData. - /// - /// WARNING: Be *very careful* when using the value provided in callbacks structs. - /// Callbacks are queued, and the value that you will receive in your - /// callback is the userdata that was effective at the time the callback - /// was queued. There are subtle race conditions that can happen if you - /// don't understand this! - /// - /// If any incoming messages for this connection are queued, the userdata - /// field is updated, so that when when you receive messages (e.g. with - /// ReceiveMessagesOnConnection), they will always have the very latest - /// userdata. So the tricky race conditions that can happen with callbacks - /// do not apply to retrieving messages. - /// - /// Returns false if the handle is invalid. - virtual bool SetConnectionUserData( HSteamNetConnection hPeer, int64 nUserData ) = 0; - - /// Fetch connection user data. Returns -1 if handle is invalid - /// or if you haven't set any userdata on the connection. - virtual int64 GetConnectionUserData( HSteamNetConnection hPeer ) = 0; - - /// Set a name for the connection, used mostly for debugging - virtual void SetConnectionName( HSteamNetConnection hPeer, const char *pszName ) = 0; - - /// Fetch connection name. Returns false if handle is invalid - virtual bool GetConnectionName( HSteamNetConnection hPeer, char *pszName, int nMaxLen ) = 0; - - /// Send a message to the remote host on the specified connection. - /// - /// nSendFlags determines the delivery guarantees that will be provided, - /// when data should be buffered, etc. E.g. k_nSteamNetworkingSend_Unreliable - /// - /// Note that the semantics we use for messages are not precisely - /// the same as the semantics of a standard "stream" socket. - /// (SOCK_STREAM) For an ordinary stream socket, the boundaries - /// between chunks are not considered relevant, and the sizes of - /// the chunks of data written will not necessarily match up to - /// the sizes of the chunks that are returned by the reads on - /// the other end. The remote host might read a partial chunk, - /// or chunks might be coalesced. For the message semantics - /// used here, however, the sizes WILL match. Each send call - /// will match a successful read call on the remote host - /// one-for-one. If you are porting existing stream-oriented - /// code to the semantics of reliable messages, your code should - /// work the same, since reliable message semantics are more - /// strict than stream semantics. The only caveat is related to - /// performance: there is per-message overhead to retain the - /// message sizes, and so if your code sends many small chunks - /// of data, performance will suffer. Any code based on stream - /// sockets that does not write excessively small chunks will - /// work without any changes. - /// - /// The pOutMessageNumber is an optional pointer to receive the - /// message number assigned to the message, if sending was successful. - /// - /// Returns: - /// - k_EResultInvalidParam: invalid connection handle, or the individual message is too big. - /// (See k_cbMaxSteamNetworkingSocketsMessageSizeSend) - /// - k_EResultInvalidState: connection is in an invalid state - /// - k_EResultNoConnection: connection has ended - /// - k_EResultIgnored: You used k_nSteamNetworkingSend_NoDelay, and the message was dropped because - /// we were not ready to send it. - /// - k_EResultLimitExceeded: there was already too much data queued to be sent. - /// (See k_ESteamNetworkingConfig_SendBufferSize) - virtual EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, uint32 cbData, int nSendFlags, int64 *pOutMessageNumber ) = 0; - - /// Send one or more messages without copying the message payload. - /// This is the most efficient way to send messages. To use this - /// function, you must first allocate a message object using - /// ISteamNetworkingUtils::AllocateMessage. (Do not declare one - /// on the stack or allocate your own.) - /// - /// You should fill in the message payload. You can either let - /// it allocate the buffer for you and then fill in the payload, - /// or if you already have a buffer allocated, you can just point - /// m_pData at your buffer and set the callback to the appropriate function - /// to free it. Note that if you use your own buffer, it MUST remain valid - /// until the callback is executed. And also note that your callback can be - /// invoked at any time from any thread (perhaps even before SendMessages - /// returns!), so it MUST be fast and threadsafe. - /// - /// You MUST also fill in: - /// - m_conn - the handle of the connection to send the message to - /// - m_nFlags - bitmask of k_nSteamNetworkingSend_xxx flags. - /// - /// All other fields are currently reserved and should not be modified. - /// - /// The library will take ownership of the message structures. They may - /// be modified or become invalid at any time, so you must not read them - /// after passing them to this function. - /// - /// pOutMessageNumberOrResult is an optional array that will receive, - /// for each message, the message number that was assigned to the message - /// if sending was successful. If sending failed, then a negative EResult - /// value is placed into the array. For example, the array will hold - /// -k_EResultInvalidState if the connection was in an invalid state. - /// See ISteamNetworkingSockets::SendMessageToConnection for possible - /// failure codes. - virtual void SendMessages( int nMessages, SteamNetworkingMessage_t *const *pMessages, int64 *pOutMessageNumberOrResult ) = 0; - - /// Flush any messages waiting on the Nagle timer and send them - /// at the next transmission opportunity (often that means right now). - /// - /// If Nagle is enabled (it's on by default) then when calling - /// SendMessageToConnection the message will be buffered, up to the Nagle time - /// before being sent, to merge small messages into the same packet. - /// (See k_ESteamNetworkingConfig_NagleTime) - /// - /// Returns: - /// k_EResultInvalidParam: invalid connection handle - /// k_EResultInvalidState: connection is in an invalid state - /// k_EResultNoConnection: connection has ended - /// k_EResultIgnored: We weren't (yet) connected, so this operation has no effect. - virtual EResult FlushMessagesOnConnection( HSteamNetConnection hConn ) = 0; - - /// Fetch the next available message(s) from the connection, if any. - /// Returns the number of messages returned into your array, up to nMaxMessages. - /// If the connection handle is invalid, -1 is returned. - /// - /// The order of the messages returned in the array is relevant. - /// Reliable messages will be received in the order they were sent (and with the - /// same sizes --- see SendMessageToConnection for on this subtle difference from a stream socket). - /// - /// Unreliable messages may be dropped, or delivered out of order with respect to - /// each other or with respect to reliable messages. The same unreliable message - /// may be received multiple times. - /// - /// If any messages are returned, you MUST call SteamNetworkingMessage_t::Release() on each - /// of them free up resources after you are done. It is safe to keep the object alive for - /// a little while (put it into some queue, etc), and you may call Release() from any thread. - virtual int ReceiveMessagesOnConnection( HSteamNetConnection hConn, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; - - /// Returns basic information about the high-level state of the connection. - virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0; - - /// Returns a small set of information about the real-time state of the connection - /// and the queue status of each lane. - /// - /// - pStatus may be NULL if the information is not desired. (E.g. you are only interested - /// in the lane information.) - /// - On entry, nLanes specifies the length of the pLanes array. This may be 0 - /// if you do not wish to receive any lane data. It's OK for this to be smaller than - /// the total number of configured lanes. - /// - pLanes points to an array that will receive lane-specific info. It can be NULL - /// if this is not needed. - /// - /// Return value: - /// - k_EResultNoConnection - connection handle is invalid or connection has been closed. - /// - k_EResultInvalidParam - nLanes is bad - virtual EResult GetConnectionRealTimeStatus( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus, - int nLanes, SteamNetConnectionRealTimeLaneStatus_t *pLanes ) = 0; - - // GO_MODIFICATION - virtual int GetConnectionType( HSteamNetConnection hConn, char* pszBuf, int cbBuf ) = 0; - - /// Returns detailed connection stats in text format. Useful - /// for dumping to a log, etc. - /// - /// Returns: - /// -1 failure (bad connection handle) - /// 0 OK, your buffer was filled in and '\0'-terminated - /// >0 Your buffer was either nullptr, or it was too small and the text got truncated. - /// Try again with a buffer of at least N bytes. - virtual int GetDetailedConnectionStatus( HSteamNetConnection hConn, char *pszBuf, int cbBuf ) = 0; - - /// Returns local IP and port that a listen socket created using CreateListenSocketIP is bound to. - /// - /// An IPv6 address of ::0 means "any IPv4 or IPv6" - /// An IPv6 address of ::ffff:0000:0000 means "any IPv4" - virtual bool GetListenSocketAddress( HSteamListenSocket hSocket, SteamNetworkingIPAddr *address ) = 0; - - /// Create a pair of connections that are talking to each other, e.g. a loopback connection. - /// This is very useful for testing, or so that your client/server code can work the same - /// even when you are running a local "server". - /// - /// The two connections will immediately be placed into the connected state, and no callbacks - /// will be posted immediately. After this, if you close either connection, the other connection - /// will receive a callback, exactly as if they were communicating over the network. You must - /// close *both* sides in order to fully clean up the resources! - /// - /// By default, internal buffers are used, completely bypassing the network, the chopping up of - /// messages into packets, encryption, copying the payload, etc. This means that loopback - /// packets, by default, will not simulate lag or loss. Passing true for bUseNetworkLoopback will - /// cause the socket pair to send packets through the local network loopback device (127.0.0.1) - /// on ephemeral ports. Fake lag and loss are supported in this case, and CPU time is expended - /// to encrypt and decrypt. - /// - /// If you wish to assign a specific identity to either connection, you may pass a particular - /// identity. Otherwise, if you pass nullptr, the respective connection will assume a generic - /// "localhost" identity. If you use real network loopback, this might be translated to the - /// actual bound loopback port. Otherwise, the port will be zero. - virtual bool CreateSocketPair( HSteamNetConnection *pOutConnection1, HSteamNetConnection *pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity *pIdentity1, const SteamNetworkingIdentity *pIdentity2 ) = 0; - - /// Configure multiple outbound messages streams ("lanes") on a connection, and - /// control head-of-line blocking between them. Messages within a given lane - /// are always sent in the order they are queued, but messages from different - /// lanes may be sent out of order. Each lane has its own message number - /// sequence. The first message sent on each lane will be assigned the number 1. - /// - /// Each lane has a "priority". Lanes with higher numeric values will only be processed - /// when all lanes with lower number values are empty. The magnitudes of the priority - /// values are not relevant, only their sort order. - /// - /// Each lane also is assigned a weight, which controls the approximate proportion - /// of the bandwidth that will be consumed by the lane, relative to other lanes - /// of the same priority. (This is assuming the lane stays busy. An idle lane - /// does not build up "credits" to be be spent once a message is queued.) - /// This value is only meaningful as a proportion, relative to other lanes with - /// the same priority. For lanes with different priorities, the strict priority - /// order will prevail, and their weights relative to each other are not relevant. - /// Thus, if a lane has a unique priority value, the weight value for that lane is - /// not relevant. - /// - /// Example: 3 lanes, with priorities [ 0, 10, 10 ] and weights [ (NA), 20, 5 ]. - /// Messages sent on the first will always be sent first, before messages in the - /// other two lanes. Its weight value is irrelevant, since there are no other - /// lanes with priority=0. The other two lanes will share bandwidth, with the second - /// and third lanes sharing bandwidth using a ratio of approximately 4:1. - /// (The weights [ NA, 4, 1 ] would be equivalent.) - /// - /// Notes: - /// - At the time of this writing, some code has performance cost that is linear - /// in the number of lanes, so keep the number of lanes to an absolute minimum. - /// 3 or so is fine; >8 is a lot. The max number of lanes on Steam is 255, - /// which is a very large number and not recommended! If you are compiling this - /// library from source, see STEAMNETWORKINGSOCKETS_MAX_LANES.) - /// - Lane priority values may be any int. Their absolute value is not relevant, - /// only the order matters. - /// - Weights must be positive, and due to implementation details, they are restricted - /// to 16-bit values. The absolute magnitudes don't matter, just the proportions. - /// - Messages sent on a lane index other than 0 have a small overhead on the wire, - /// so for maximum wire efficiency, lane 0 should be the "most common" lane, regardless - /// of priorities or weights. - /// - A connection has a single lane by default. Calling this function with - /// nNumLanes=1 is legal, but pointless, since the priority and weight values are - /// irrelevant in that case. - /// - You may reconfigure connection lanes at any time, however reducing the number of - /// lanes is not allowed. - /// - Reconfiguring lanes might restart any bandwidth sharing balancing. Usually you - /// will call this function once, near the start of the connection, perhaps after - /// exchanging a few messages. - /// - To assign all lanes the same priority, you may use pLanePriorities=NULL. - /// - If you wish all lanes with the same priority to share bandwidth equally (or - /// if no two lanes have the same priority value, and thus priority values are - /// irrelevant), you may use pLaneWeights=NULL - /// - Priorities and weights determine the order that messages are SENT on the wire. - /// There are NO GUARANTEES on the order that messages are RECEIVED! Due to packet - /// loss, out-of-order delivery, and subtle details of packet serialization, messages - /// might still be received slightly out-of-order! The *only* strong guarantee is that - /// *reliable* messages on the *same lane* will be delivered in the order they are sent. - /// - Each host configures the lanes for the packets they send; the lanes for the flow - /// in one direction are completely unrelated to the lanes in the opposite direction. - /// - /// Return value: - /// - k_EResultNoConnection - bad hConn - /// - k_EResultInvalidParam - Invalid number of lanes, bad weights, or you tried to reduce the number of lanes - /// - k_EResultInvalidState - Connection is already dead, etc - /// - /// See also: - /// SteamNetworkingMessage_t::m_idxLane - virtual EResult ConfigureConnectionLanes( HSteamNetConnection hConn, int nNumLanes, const int *pLanePriorities, const uint16 *pLaneWeights ) = 0; - - // - // Identity and authentication - // - - /// Get the identity assigned to this interface. - /// E.g. on Steam, this is the user's SteamID, or for the gameserver interface, the SteamID assigned - /// to the gameserver. Returns false and sets the result to an invalid identity if we don't know - /// our identity yet. (E.g. GameServer has not logged in. On Steam, the user will know their SteamID - /// even if they are not signed into Steam.) - virtual bool GetIdentity( SteamNetworkingIdentity *pIdentity ) = 0; - - /// Indicate our desire to be ready participate in authenticated communications. - /// If we are currently not ready, then steps will be taken to obtain the necessary - /// certificates. (This includes a certificate for us, as well as any CA certificates - /// needed to authenticate peers.) - /// - /// You can call this at program init time if you know that you are going to - /// be making authenticated connections, so that we will be ready immediately when - /// those connections are attempted. (Note that essentially all connections require - /// authentication, with the exception of ordinary UDP connections with authentication - /// disabled using k_ESteamNetworkingConfig_IP_AllowWithoutAuth.) If you don't call - /// this function, we will wait until a feature is utilized that that necessitates - /// these resources. - /// - /// You can also call this function to force a retry, if failure has occurred. - /// Once we make an attempt and fail, we will not automatically retry. - /// In this respect, the behavior of the system after trying and failing is the same - /// as before the first attempt: attempting authenticated communication or calling - /// this function will call the system to attempt to acquire the necessary resources. - /// - /// You can use GetAuthenticationStatus or listen for SteamNetAuthenticationStatus_t - /// to monitor the status. - /// - /// Returns the current value that would be returned from GetAuthenticationStatus. - virtual ESteamNetworkingAvailability InitAuthentication() = 0; - - /// Query our readiness to participate in authenticated communications. A - /// SteamNetAuthenticationStatus_t callback is posted any time this status changes, - /// but you can use this function to query it at any time. - /// - /// The value of SteamNetAuthenticationStatus_t::m_eAvail is returned. If you only - /// want this high level status, you can pass NULL for pDetails. If you want further - /// details, pass non-NULL to receive them. - virtual ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStatus_t *pDetails ) = 0; - - // - // Poll groups. A poll group is a set of connections that can be polled efficiently. - // (In our API, to "poll" a connection means to retrieve all pending messages. We - // actually don't have an API to "poll" the connection *state*, like BSD sockets.) - // - - /// Create a new poll group. - /// - /// You should destroy the poll group when you are done using DestroyPollGroup - virtual HSteamNetPollGroup CreatePollGroup() = 0; - - /// Destroy a poll group created with CreatePollGroup(). - /// - /// If there are any connections in the poll group, they are removed from the group, - /// and left in a state where they are not part of any poll group. - /// Returns false if passed an invalid poll group handle. - virtual bool DestroyPollGroup( HSteamNetPollGroup hPollGroup ) = 0; - - /// Assign a connection to a poll group. Note that a connection may only belong to a - /// single poll group. Adding a connection to a poll group implicitly removes it from - /// any other poll group it is in. - /// - /// You can pass k_HSteamNetPollGroup_Invalid to remove a connection from its current - /// poll group without adding it to a new poll group. - /// - /// If there are received messages currently pending on the connection, an attempt - /// is made to add them to the queue of messages for the poll group in approximately - /// the order that would have applied if the connection was already part of the poll - /// group at the time that the messages were received. - /// - /// Returns false if the connection handle is invalid, or if the poll group handle - /// is invalid (and not k_HSteamNetPollGroup_Invalid). - virtual bool SetConnectionPollGroup( HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup ) = 0; - - /// Same as ReceiveMessagesOnConnection, but will return the next messages available - /// on any connection in the poll group. Examine SteamNetworkingMessage_t::m_conn - /// to know which connection. (SteamNetworkingMessage_t::m_nConnUserData might also - /// be useful.) - /// - /// Delivery order of messages among different connections will usually match the - /// order that the last packet was received which completed the message. But this - /// is not a strong guarantee, especially for packets received right as a connection - /// is being assigned to poll group. - /// - /// Delivery order of messages on the same connection is well defined and the - /// same guarantees are present as mentioned in ReceiveMessagesOnConnection. - /// (But the messages are not grouped by connection, so they will not necessarily - /// appear consecutively in the list; they may be interleaved with messages for - /// other connections.) - virtual int ReceiveMessagesOnPollGroup( HSteamNetPollGroup hPollGroup, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; - - // - // Clients connecting to dedicated servers hosted in a data center, - // using tickets issued by your game coordinator. If you are not - // issuing your own tickets to restrict who can attempt to connect - // to your server, then you won't use these functions. - // - - /// Call this when you receive a ticket from your backend / matchmaking system. Puts the - /// ticket into a persistent cache, and optionally returns the parsed ticket. - /// - /// See stamdatagram_ticketgen.h for more details. - virtual bool ReceivedRelayAuthTicket( const void *pvTicket, int cbTicket, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0; - - /// Search cache for a ticket to talk to the server on the specified virtual port. - /// If found, returns the number of seconds until the ticket expires, and optionally - /// the complete cracked ticket. Returns 0 if we don't have a ticket. - /// - /// Typically this is useful just to confirm that you have a ticket, before you - /// call ConnectToHostedDedicatedServer to connect to the server. - virtual int FindRelayAuthTicketForServer( const SteamNetworkingIdentity &identityGameServer, int nRemoteVirtualPort, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0; - - /// Client call to connect to a server hosted in a Valve data center, on the specified virtual - /// port. You must have placed a ticket for this server into the cache, or else this connect - /// attempt will fail! If you are not issuing your own tickets, then to connect to a dedicated - /// server via SDR in auto-ticket mode, use ConnectP2P. (The server must be configured to allow - /// this type of connection by listening using CreateListenSocketP2P.) - /// - /// You may wonder why tickets are stored in a cache, instead of simply being passed as an argument - /// here. The reason is to make reconnection to a gameserver robust, even if the client computer loses - /// connection to Steam or the central backend, or the app is restarted or crashes, etc. - /// - /// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess() - /// when your app initializes - /// - /// If you need to set any initial config options, pass them here. See - /// SteamNetworkingConfigValue_t for more about why this is preferable to - /// setting the options "immediately" after creation. - virtual HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentity &identityTarget, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; - - // - // Servers hosted in data centers known to the Valve relay network - // - - /// Returns the value of the SDR_LISTEN_PORT environment variable. This - /// is the UDP server your server will be listening on. This will - /// configured automatically for you in production environments. - /// - /// In development, you'll need to set it yourself. See - /// https://partner.steamgames.com/doc/api/ISteamNetworkingSockets - /// for more information on how to configure dev environments. - virtual uint16 GetHostedDedicatedServerPort() = 0; - - /// Returns 0 if SDR_LISTEN_PORT is not set. Otherwise, returns the data center the server - /// is running in. This will be k_SteamDatagramPOPID_dev in non-production environment. - virtual SteamNetworkingPOPID GetHostedDedicatedServerPOPID() = 0; - - /// Return info about the hosted server. This contains the PoPID of the server, - /// and opaque routing information that can be used by the relays to send traffic - /// to your server. - /// - /// You will need to send this information to your backend, and put it in tickets, - /// so that the relays will know how to forward traffic from - /// clients to your server. See SteamDatagramRelayAuthTicket for more info. - /// - /// Also, note that the routing information is contained in SteamDatagramGameCoordinatorServerLogin, - /// so if possible, it's preferred to use GetGameCoordinatorServerLogin to send this info - /// to your game coordinator service, and also login securely at the same time. - /// - /// On a successful exit, k_EResultOK is returned - /// - /// Unsuccessful exit: - /// - Something other than k_EResultOK is returned. - /// - k_EResultInvalidState: We are not configured to listen for SDR (SDR_LISTEN_SOCKET - /// is not set.) - /// - k_EResultPending: we do not (yet) have the authentication information needed. - /// (See GetAuthenticationStatus.) If you use environment variables to pre-fetch - /// the network config, this data should always be available immediately. - /// - A non-localized diagnostic debug message will be placed in m_data that describes - /// the cause of the failure. - /// - /// NOTE: The returned blob is not encrypted. Send it to your backend, but don't - /// directly share it with clients. - virtual EResult GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting ) = 0; - - /// Create a listen socket on the specified virtual port. The physical UDP port to use - /// will be determined by the SDR_LISTEN_PORT environment variable. If a UDP port is not - /// configured, this call will fail. - /// - /// This call MUST be made through the SteamGameServerNetworkingSockets() interface. - /// - /// This function should be used when you are using the ticket generator library - /// to issue your own tickets. Clients connecting to the server on this virtual - /// port will need a ticket, and they must connect using ConnectToHostedDedicatedServer. - /// - /// If you need to set any initial config options, pass them here. See - /// SteamNetworkingConfigValue_t for more about why this is preferable to - /// setting the options "immediately" after creation. - virtual HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; - - /// Generate an authentication blob that can be used to securely login with - /// your backend, using SteamDatagram_ParseHostedServerLogin. (See - /// steamdatagram_gamecoordinator.h) - /// - /// Before calling the function: - /// - Populate the app data in pLoginInfo (m_cbAppData and m_appData). You can leave - /// all other fields uninitialized. - /// - *pcbSignedBlob contains the size of the buffer at pBlob. (It should be - /// at least k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized.) - /// - /// On a successful exit: - /// - k_EResultOK is returned - /// - All of the remaining fields of pLoginInfo will be filled out. - /// - *pcbSignedBlob contains the size of the serialized blob that has been - /// placed into pBlob. - /// - /// Unsuccessful exit: - /// - Something other than k_EResultOK is returned. - /// - k_EResultNotLoggedOn: you are not logged in (yet) - /// - See GetHostedDedicatedServerAddress for more potential failure return values. - /// - A non-localized diagnostic debug message will be placed in pBlob that describes - /// the cause of the failure. - /// - /// This works by signing the contents of the SteamDatagramGameCoordinatorServerLogin - /// with the cert that is issued to this server. In dev environments, it's OK if you do - /// not have a cert. (You will need to enable insecure dev login in SteamDatagram_ParseHostedServerLogin.) - /// Otherwise, you will need a signed cert. - /// - /// NOTE: The routing blob returned here is not encrypted. Send it to your backend - /// and don't share it directly with clients. - virtual EResult GetGameCoordinatorServerLogin( SteamDatagramGameCoordinatorServerLogin *pLoginInfo, int *pcbSignedBlob, void *pBlob ) = 0; - - - // - // Relayed connections using custom signaling protocol - // - // This is used if you have your own method of sending out-of-band - // signaling / rendezvous messages through a mutually trusted channel. - // - - /// Create a P2P "client" connection that does signaling over a custom - /// rendezvous/signaling channel. - /// - /// pSignaling points to a new object that you create just for this connection. - /// It must stay valid until Release() is called. Once you pass the - /// object to this function, it assumes ownership. Release() will be called - /// from within the function call if the call fails. Furthermore, until Release() - /// is called, you should be prepared for methods to be invoked on your - /// object from any thread! You need to make sure your object is threadsafe! - /// Furthermore, you should make sure that dispatching the methods is done - /// as quickly as possible. - /// - /// This function will immediately construct a connection in the "connecting" - /// state. Soon after (perhaps before this function returns, perhaps in another thread), - /// the connection will begin sending signaling messages by calling - /// ISteamNetworkingConnectionSignaling::SendSignal. - /// - /// When the remote peer accepts the connection (See - /// ISteamNetworkingSignalingRecvContext::OnConnectRequest), - /// it will begin sending signaling messages. When these messages are received, - /// you can pass them to the connection using ReceivedP2PCustomSignal. - /// - /// If you know the identity of the peer that you expect to be on the other end, - /// you can pass their identity to improve debug output or just detect bugs. - /// If you don't know their identity yet, you can pass NULL, and their - /// identity will be established in the connection handshake. - /// - /// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess() - /// when your app initializes - /// - /// If you need to set any initial config options, pass them here. See - /// SteamNetworkingConfigValue_t for more about why this is preferable to - /// setting the options "immediately" after creation. - virtual HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; - - /// Called when custom signaling has received a message. When your - /// signaling channel receives a message, it should save off whatever - /// routing information was in the envelope into the context object, - /// and then pass the payload to this function. - /// - /// A few different things can happen next, depending on the message: - /// - /// - If the signal is associated with existing connection, it is dealt - /// with immediately. If any replies need to be sent, they will be - /// dispatched using the ISteamNetworkingConnectionSignaling - /// associated with the connection. - /// - If the message represents a connection request (and the request - /// is not redundant for an existing connection), a new connection - /// will be created, and ReceivedConnectRequest will be called on your - /// context object to determine how to proceed. - /// - Otherwise, the message is for a connection that does not - /// exist (anymore). In this case, we *may* call SendRejectionReply - /// on your context object. - /// - /// In any case, we will not save off pContext or access it after this - /// function returns. - /// - /// Returns true if the message was parsed and dispatched without anything - /// unusual or suspicious happening. Returns false if there was some problem - /// with the message that prevented ordinary handling. (Debug output will - /// usually have more information.) - /// - /// If you expect to be using relayed connections, then you probably want - /// to call ISteamNetworkingUtils::InitRelayNetworkAccess() when your app initializes - virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingSignalingRecvContext *pContext ) = 0; - - // - // Certificate provision by the application. On Steam, we normally handle all this automatically - // and you will not need to use these advanced functions. - // - - /// Get blob that describes a certificate request. You can send this to your game coordinator. - /// Upon entry, *pcbBlob should contain the size of the buffer. On successful exit, it will - /// return the number of bytes that were populated. You can pass pBlob=NULL to query for the required - /// size. (512 bytes is a conservative estimate.) - /// - /// Pass this blob to your game coordinator and call SteamDatagram_CreateCert. - virtual bool GetCertificateRequest( int *pcbBlob, void *pBlob, SteamNetworkingErrMsg &errMsg ) = 0; - - /// Set the certificate. The certificate blob should be the output of - /// SteamDatagram_CreateCert. - virtual bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkingErrMsg &errMsg ) = 0; - - /// Reset the identity associated with this instance. - /// Any open connections are closed. Any previous certificates, etc are discarded. - /// You can pass a specific identity that you want to use, or you can pass NULL, - /// in which case the identity will be invalid until you set it using SetCertificate - /// - /// NOTE: This function is not actually supported on Steam! It is included - /// for use on other platforms where the active user can sign out and - /// a new user can sign in. - virtual void ResetIdentity( const SteamNetworkingIdentity *pIdentity ) = 0; - - // - // Misc - // - - /// Invoke all callback functions queued for this interface. - /// See k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, etc - /// - /// You don't need to call this if you are using Steam's callback dispatch - /// mechanism (SteamAPI_RunCallbacks and SteamGameserver_RunCallbacks). - virtual void RunCallbacks() = 0; - - // - // "FakeIP" system. - // - // A FakeIP is essentially a temporary, arbitrary identifier that - // happens to be a valid IPv4 address. The purpose of this system is to make it - // easy to integrate with existing code that identifies hosts using IPv4 addresses. - // The FakeIP address will never actually be used to send or receive any packets - // on the Internet, it is strictly an identifier. - // - // FakeIP addresses are designed to (hopefully) pass through existing code as - // transparently as possible, while conflicting with "real" addresses that might - // be in use on networks (both the Internet and LANs) in the same code as little - // as possible. At the time this comment is being written, they come from the - // 169.254.0.0/16 range, and the port number will always be >1024. HOWEVER, - // this is subject to change! Do not make assumptions about these addresses, - // or your code might break in the future. In particular, you should use - // functions such as ISteamNetworkingUtils::IsFakeIP to determine if an IP - // address is a "fake" one used by this system. - // - - /// Begin asynchronous process of allocating a fake IPv4 address that other - /// peers can use to contact us via P2P. IP addresses returned by this - /// function are globally unique for a given appid. - /// - /// nNumPorts is the numbers of ports you wish to reserve. This is useful - /// for the same reason that listening on multiple UDP ports is useful for - /// different types of traffic. Because these allocations come from a global - /// namespace, there is a relatively strict limit on the maximum number of - /// ports you may request. (At the time of this writing, the limit is 4.) - /// The port assignments are *not* guaranteed to have any particular order - /// or relationship! Do *not* assume they are contiguous, even though that - /// may often occur in practice. - /// - /// Returns false if a request was already in progress, true if a new request - /// was started. A SteamNetworkingFakeIPResult_t will be posted when the request - /// completes. - /// - /// For gameservers, you *must* call this after initializing the SDK but before - /// beginning login. Steam needs to know in advance that FakeIP will be used. - /// Everywhere your public IP would normally appear (such as the server browser) will be - /// replaced by the FakeIP, and the fake port at index 0. The request is actually queued - /// until the logon completes, so you must not wait until the allocation completes - /// before logging in. Except for trivial failures that can be detected locally - /// (e.g. invalid parameter), a SteamNetworkingFakeIPResult_t callback (whether success or - /// failure) will not be posted until after we have logged in. Furthermore, it is assumed - /// that FakeIP allocation is essential for your application to function, and so failure - /// will not be reported until *several* retries have been attempted. This process may - /// last several minutes. It is *highly* recommended to treat failure as fatal. - /// - /// To communicate using a connection-oriented (TCP-style) API: - /// - Server creates a listen socket using CreateListenSocketP2PFakeIP - /// - Client connects using ConnectByIPAddress, passing in the FakeIP address. - /// - The connection will behave mostly like a P2P connection. The identities - /// that appear in SteamNetConnectionInfo_t will be the FakeIP identity until - /// we know the real identity. Then it will be the real identity. If the - /// SteamNetConnectionInfo_t::m_addrRemote is valid, it will be a real IPv4 - /// address of a NAT-punched connection. Otherwise, it will not be valid. - /// - /// To communicate using an ad-hoc sendto/recv from (UDP-style) API, - /// use CreateFakeUDPPort. - virtual bool BeginAsyncRequestFakeIP( int nNumPorts ) = 0; - - /// Return info about the FakeIP and port(s) that we have been assigned, - /// if any. idxFirstPort is currently reserved and must be zero. - /// Make sure and check SteamNetworkingFakeIPResult_t::m_eResult - virtual void GetFakeIP( int idxFirstPort, SteamNetworkingFakeIPResult_t *pInfo ) = 0; - - /// Create a listen socket that will listen for P2P connections sent - /// to our FakeIP. A peer can initiate connections to this listen - /// socket by calling ConnectByIPAddress. - /// - /// idxFakePort refers to the *index* of the fake port requested, - /// not the actual port number. For example, pass 0 to refer to the - /// first port in the reservation. You must call this only after calling - /// BeginAsyncRequestFakeIP. However, you do not need to wait for the - /// request to complete before creating the listen socket. - virtual HSteamListenSocket CreateListenSocketP2PFakeIP( int idxFakePort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; - - /// If the connection was initiated using the "FakeIP" system, then we - /// we can get an IP address for the remote host. If the remote host had - /// a global FakeIP at the time the connection was established, this - /// function will return that global IP. Otherwise, a FakeIP that is - /// unique locally will be allocated from the local FakeIP address space, - /// and that will be returned. - /// - /// The allocation of local FakeIPs attempts to assign addresses in - /// a consistent manner. If multiple connections are made to the - /// same remote host, they *probably* will return the same FakeIP. - /// However, since the namespace is limited, this cannot be guaranteed. - /// - /// On failure, returns: - /// - k_EResultInvalidParam: invalid connection handle - /// - k_EResultIPNotFound: This connection wasn't made using FakeIP system - virtual EResult GetRemoteFakeIPForConnection( HSteamNetConnection hConn, SteamNetworkingIPAddr *pOutAddr ) = 0; - - /// Get an interface that can be used like a UDP port to send/receive - /// datagrams to a FakeIP address. This is intended to make it easy - /// to port existing UDP-based code to take advantage of SDR. - /// - /// idxFakeServerPort refers to the *index* of the port allocated using - /// BeginAsyncRequestFakeIP and is used to create "server" ports. You may - /// call this before the allocation has completed. However, any attempts - /// to send packets will fail until the allocation has succeeded. When - /// the peer receives packets sent from this interface, the from address - /// of the packet will be the globally-unique FakeIP. If you call this - /// function multiple times and pass the same (nonnegative) fake port index, - /// the same object will be returned, and this object is not reference counted. - /// - /// To create a "client" port (e.g. the equivalent of an ephemeral UDP port) - /// pass -1. In this case, a distinct object will be returned for each call. - /// When the peer receives packets sent from this interface, the peer will - /// assign a FakeIP from its own locally-controlled namespace. - virtual ISteamNetworkingFakeUDPPort *CreateFakeUDPPort( int idxFakeServerPort ) = 0; - -protected: - ~ISteamNetworkingSockets(); // Silence some warnings -}; -#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets012" - -// Global accessors - -// Using standalone lib -#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB - - static_assert( STEAMNETWORKINGSOCKETS_INTERFACE_VERSION[24] == '2', "Version mismatch" ); - STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamNetworkingSockets_LibV12(); - inline ISteamNetworkingSockets *SteamNetworkingSockets_Lib() { return SteamNetworkingSockets_LibV12(); } - - STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamGameServerNetworkingSockets_LibV12(); - inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets_Lib() { return SteamGameServerNetworkingSockets_LibV12(); } - - #ifndef STEAMNETWORKINGSOCKETS_STEAMAPI - inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_LibV12(); } - inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_LibV12(); } - #endif -#endif - -// Using Steamworks SDK -#ifdef STEAMNETWORKINGSOCKETS_STEAMAPI - STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamNetworkingSockets_SteamAPI, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); - STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamGameServerNetworkingSockets_SteamAPI, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); - - #ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB - inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_SteamAPI(); } - inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_SteamAPI(); } - #endif -#endif - -/// Callback struct used to notify when a connection has changed state -#if defined( VALVE_CALLBACK_PACK_SMALL ) -#pragma pack( push, 4 ) -#elif defined( VALVE_CALLBACK_PACK_LARGE ) -#pragma pack( push, 8 ) -#else -#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" -#endif - -/// This callback is posted whenever a connection is created, destroyed, or changes state. -/// The m_info field will contain a complete description of the connection at the time the -/// change occurred and the callback was posted. In particular, m_eState will have the -/// new connection state. -/// -/// You will usually need to listen for this callback to know when: -/// - A new connection arrives on a listen socket. -/// m_info.m_hListenSocket will be set, m_eOldState = k_ESteamNetworkingConnectionState_None, -/// and m_info.m_eState = k_ESteamNetworkingConnectionState_Connecting. -/// See ISteamNetworkigSockets::AcceptConnection. -/// - A connection you initiated has been accepted by the remote host. -/// m_eOldState = k_ESteamNetworkingConnectionState_Connecting, and -/// m_info.m_eState = k_ESteamNetworkingConnectionState_Connected. -/// Some connections might transition to k_ESteamNetworkingConnectionState_FindingRoute first. -/// - A connection has been actively rejected or closed by the remote host. -/// m_eOldState = k_ESteamNetworkingConnectionState_Connecting or k_ESteamNetworkingConnectionState_Connected, -/// and m_info.m_eState = k_ESteamNetworkingConnectionState_ClosedByPeer. m_info.m_eEndReason -/// and m_info.m_szEndDebug will have for more details. -/// NOTE: upon receiving this callback, you must still destroy the connection using -/// ISteamNetworkingSockets::CloseConnection to free up local resources. (The details -/// passed to the function are not used in this case, since the connection is already closed.) -/// - A problem was detected with the connection, and it has been closed by the local host. -/// The most common failure is timeout, but other configuration or authentication failures -/// can cause this. m_eOldState = k_ESteamNetworkingConnectionState_Connecting or -/// k_ESteamNetworkingConnectionState_Connected, and m_info.m_eState = k_ESteamNetworkingConnectionState_ProblemDetectedLocally. -/// m_info.m_eEndReason and m_info.m_szEndDebug will have for more details. -/// NOTE: upon receiving this callback, you must still destroy the connection using -/// ISteamNetworkingSockets::CloseConnection to free up local resources. (The details -/// passed to the function are not used in this case, since the connection is already closed.) -/// -/// Remember that callbacks are posted to a queue, and networking connections can -/// change at any time. It is possible that the connection has already changed -/// state by the time you process this callback. -/// -/// Also note that callbacks will be posted when connections are created and destroyed by your own API calls. -struct SteamNetConnectionStatusChangedCallback_t -{ - enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 1 }; - - /// Connection handle - HSteamNetConnection m_hConn; - - /// Full connection info - SteamNetConnectionInfo_t m_info; - - /// Previous state. (Current state is in m_info.m_eState) - ESteamNetworkingConnectionState m_eOldState; -}; - -/// A struct used to describe our readiness to participate in authenticated, -/// encrypted communication. In order to do this we need: -/// -/// - The list of trusted CA certificates that might be relevant for this -/// app. -/// - A valid certificate issued by a CA. -/// -/// This callback is posted whenever the state of our readiness changes. -struct SteamNetAuthenticationStatus_t -{ - enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 2 }; - - /// Status - ESteamNetworkingAvailability m_eAvail; - - /// Non-localized English language status. For diagnostic/debugging - /// purposes only. - char m_debugMsg[ 256 ]; -}; - -#pragma pack( pop ) - -#endif // ISTEAMNETWORKINGSOCKETS diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingutils.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingutils.h deleted file mode 100644 index 626efedf931..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingutils.h +++ /dev/null @@ -1,500 +0,0 @@ -//====== Copyright Valve Corporation, All rights reserved. ==================== -// -// Purpose: misc networking utilities -// -//============================================================================= - -#ifndef ISTEAMNETWORKINGUTILS -#define ISTEAMNETWORKINGUTILS -#pragma once - -#include "steamnetworkingtypes.h" -#include "steam_api_common.h" - -struct SteamDatagramRelayAuthTicket; -struct SteamRelayNetworkStatus_t; - -//----------------------------------------------------------------------------- -/// Misc networking utilities for checking the local networking environment -/// and estimating pings. -class ISteamNetworkingUtils -{ -public: - // - // Efficient message sending - // - - /// Allocate and initialize a message object. Usually the reason - /// you call this is to pass it to ISteamNetworkingSockets::SendMessages. - /// The returned object will have all of the relevant fields cleared to zero. - /// - /// Optionally you can also request that this system allocate space to - /// hold the payload itself. If cbAllocateBuffer is nonzero, the system - /// will allocate memory to hold a payload of at least cbAllocateBuffer bytes. - /// m_pData will point to the allocated buffer, m_cbSize will be set to the - /// size, and m_pfnFreeData will be set to the proper function to free up - /// the buffer. - /// - /// If cbAllocateBuffer=0, then no buffer is allocated. m_pData will be NULL, - /// m_cbSize will be zero, and m_pfnFreeData will be NULL. You will need to - /// set each of these. - virtual SteamNetworkingMessage_t *AllocateMessage( int cbAllocateBuffer ) = 0; - - // - // Access to Steam Datagram Relay (SDR) network - // - - // - // Initialization and status check - // - - /// If you know that you are going to be using the relay network (for example, - /// because you anticipate making P2P connections), call this to initialize the - /// relay network. If you do not call this, the initialization will - /// be delayed until the first time you use a feature that requires access - /// to the relay network, which will delay that first access. - /// - /// You can also call this to force a retry if the previous attempt has failed. - /// Performing any action that requires access to the relay network will also - /// trigger a retry, and so calling this function is never strictly necessary, - /// but it can be useful to call it a program launch time, if access to the - /// relay network is anticipated. - /// - /// Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t - /// callbacks to know when initialization has completed. - /// Typically initialization completes in a few seconds. - /// - /// Note: dedicated servers hosted in known data centers do *not* need - /// to call this, since they do not make routing decisions. However, if - /// the dedicated server will be using P2P functionality, it will act as - /// a "client" and this should be called. - inline void InitRelayNetworkAccess(); - - /// Fetch current status of the relay network. - /// - /// SteamRelayNetworkStatus_t is also a callback. It will be triggered on - /// both the user and gameserver interfaces any time the status changes, or - /// ping measurement starts or stops. - /// - /// SteamRelayNetworkStatus_t::m_eAvail is returned. If you want - /// more details, you can pass a non-NULL value. - virtual ESteamNetworkingAvailability GetRelayNetworkStatus( SteamRelayNetworkStatus_t *pDetails ) = 0; - - // - // "Ping location" functions - // - // We use the ping times to the valve relays deployed worldwide to - // generate a "marker" that describes the location of an Internet host. - // Given two such markers, we can estimate the network latency between - // two hosts, without sending any packets. The estimate is based on the - // optimal route that is found through the Valve network. If you are - // using the Valve network to carry the traffic, then this is precisely - // the ping you want. If you are not, then the ping time will probably - // still be a reasonable estimate. - // - // This is extremely useful to select peers for matchmaking! - // - // The markers can also be converted to a string, so they can be transmitted. - // We have a separate library you can use on your app's matchmaking/coordinating - // server to manipulate these objects. (See steamdatagram_gamecoordinator.h) - - /// Return location info for the current host. Returns the approximate - /// age of the data, in seconds, or -1 if no data is available. - /// - /// It takes a few seconds to initialize access to the relay network. If - /// you call this very soon after calling InitRelayNetworkAccess, - /// the data may not be available yet. - /// - /// This always return the most up-to-date information we have available - /// right now, even if we are in the middle of re-calculating ping times. - virtual float GetLocalPingLocation( SteamNetworkPingLocation_t &result ) = 0; - - /// Estimate the round-trip latency between two arbitrary locations, in - /// milliseconds. This is a conservative estimate, based on routing through - /// the relay network. For most basic relayed connections, this ping time - /// will be pretty accurate, since it will be based on the route likely to - /// be actually used. - /// - /// If a direct IP route is used (perhaps via NAT traversal), then the route - /// will be different, and the ping time might be better. Or it might actually - /// be a bit worse! Standard IP routing is frequently suboptimal! - /// - /// But even in this case, the estimate obtained using this method is a - /// reasonable upper bound on the ping time. (Also it has the advantage - /// of returning immediately and not sending any packets.) - /// - /// In a few cases we might not able to estimate the route. In this case - /// a negative value is returned. k_nSteamNetworkingPing_Failed means - /// the reason was because of some networking difficulty. (Failure to - /// ping, etc) k_nSteamNetworkingPing_Unknown is returned if we cannot - /// currently answer the question for some other reason. - /// - /// Do you need to be able to do this from a backend/matchmaking server? - /// You are looking for the "game coordinator" library. - virtual int EstimatePingTimeBetweenTwoLocations( const SteamNetworkPingLocation_t &location1, const SteamNetworkPingLocation_t &location2 ) = 0; - - /// Same as EstimatePingTime, but assumes that one location is the local host. - /// This is a bit faster, especially if you need to calculate a bunch of - /// these in a loop to find the fastest one. - /// - /// In rare cases this might return a slightly different estimate than combining - /// GetLocalPingLocation with EstimatePingTimeBetweenTwoLocations. That's because - /// this function uses a slightly more complete set of information about what - /// route would be taken. - virtual int EstimatePingTimeFromLocalHost( const SteamNetworkPingLocation_t &remoteLocation ) = 0; - - /// Convert a ping location into a text format suitable for sending over the wire. - /// The format is a compact and human readable. However, it is subject to change - /// so please do not parse it yourself. Your buffer must be at least - /// k_cchMaxSteamNetworkingPingLocationString bytes. - virtual void ConvertPingLocationToString( const SteamNetworkPingLocation_t &location, char *pszBuf, int cchBufSize ) = 0; - - /// Parse back SteamNetworkPingLocation_t string. Returns false if we couldn't understand - /// the string. - virtual bool ParsePingLocationString( const char *pszString, SteamNetworkPingLocation_t &result ) = 0; - - /// Check if the ping data of sufficient recency is available, and if - /// it's too old, start refreshing it. - /// - /// Please only call this function when you *really* do need to force an - /// immediate refresh of the data. (For example, in response to a specific - /// user input to refresh this information.) Don't call it "just in case", - /// before every connection, etc. That will cause extra traffic to be sent - /// for no benefit. The library will automatically refresh the information - /// as needed. - /// - /// Returns true if sufficiently recent data is already available. - /// - /// Returns false if sufficiently recent data is not available. In this - /// case, ping measurement is initiated, if it is not already active. - /// (You cannot restart a measurement already in progress.) - /// - /// You can use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t - /// to know when ping measurement completes. - virtual bool CheckPingDataUpToDate( float flMaxAgeSeconds ) = 0; - - // - // List of Valve data centers, and ping times to them. This might - // be useful to you if you are use our hosting, or just need to measure - // latency to a cloud data center where we are running relays. - // - - /// Fetch ping time of best available relayed route from this host to - /// the specified data center. - virtual int GetPingToDataCenter( SteamNetworkingPOPID popID, SteamNetworkingPOPID *pViaRelayPoP ) = 0; - - /// Get *direct* ping time to the relays at the data center. - virtual int GetDirectPingToPOP( SteamNetworkingPOPID popID ) = 0; - - /// Get number of network points of presence in the config - virtual int GetPOPCount() = 0; - - /// Get list of all POP IDs. Returns the number of entries that were filled into - /// your list. - virtual int GetPOPList( SteamNetworkingPOPID *list, int nListSz ) = 0; - - // - // Misc - // - - /// Fetch current timestamp. This timer has the following properties: - /// - /// - Monotonicity is guaranteed. - /// - The initial value will be at least 24*3600*30*1e6, i.e. about - /// 30 days worth of microseconds. In this way, the timestamp value of - /// 0 will always be at least "30 days ago". Also, negative numbers - /// will never be returned. - /// - Wraparound / overflow is not a practical concern. - /// - /// If you are running under the debugger and stop the process, the clock - /// might not advance the full wall clock time that has elapsed between - /// calls. If the process is not blocked from normal operation, the - /// timestamp values will track wall clock time, even if you don't call - /// the function frequently. - /// - /// The value is only meaningful for this run of the process. Don't compare - /// it to values obtained on another computer, or other runs of the same process. - virtual SteamNetworkingMicroseconds GetLocalTimestamp() = 0; - - /// Set a function to receive network-related information that is useful for debugging. - /// This can be very useful during development, but it can also be useful for troubleshooting - /// problems with tech savvy end users. If you have a console or other log that customers - /// can examine, these log messages can often be helpful to troubleshoot network issues. - /// (Especially any warning/error messages.) - /// - /// The detail level indicates what message to invoke your callback on. Lower numeric - /// value means more important, and the value you pass is the lowest priority (highest - /// numeric value) you wish to receive callbacks for. - /// - /// The value here controls the detail level for most messages. You can control the - /// detail level for various subsystems (perhaps only for certain connections) by - /// adjusting the configuration values k_ESteamNetworkingConfig_LogLevel_Xxxxx. - /// - /// Except when debugging, you should only use k_ESteamNetworkingSocketsDebugOutputType_Msg - /// or k_ESteamNetworkingSocketsDebugOutputType_Warning. For best performance, do NOT - /// request a high detail level and then filter out messages in your callback. This incurs - /// all of the expense of formatting the messages, which are then discarded. Setting a high - /// priority value (low numeric value) here allows the library to avoid doing this work. - /// - /// IMPORTANT: This may be called from a service thread, while we own a mutex, etc. - /// Your output function must be threadsafe and fast! Do not make any other - /// Steamworks calls from within the handler. - virtual void SetDebugOutputFunction( ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) = 0; - - // - // Fake IP - // - // Useful for interfacing with code that assumes peers are identified using an IPv4 address - // - - /// Return true if an IPv4 address is one that might be used as a "fake" one. - /// This function is fast; it just does some logical tests on the IP and does - /// not need to do any lookup operations. - inline bool IsFakeIPv4( uint32 nIPv4 ) { return GetIPv4FakeIPType( nIPv4 ) > k_ESteamNetworkingFakeIPType_NotFake; } - virtual ESteamNetworkingFakeIPType GetIPv4FakeIPType( uint32 nIPv4 ) = 0; - - /// Get the real identity associated with a given FakeIP. - /// - /// On failure, returns: - /// - k_EResultInvalidParam: the IP is not a FakeIP. - /// - k_EResultNoMatch: we don't recognize that FakeIP and don't know the corresponding identity. - /// - /// FakeIP's used by active connections, or the FakeIPs assigned to local identities, - /// will always work. FakeIPs for recently destroyed connections will continue to - /// return results for a little while, but not forever. At some point, we will forget - /// FakeIPs to save space. It's reasonably safe to assume that you can read back the - /// real identity of a connection very soon after it is destroyed. But do not wait - /// indefinitely. - virtual EResult GetRealIdentityForFakeIP( const SteamNetworkingIPAddr &fakeIP, SteamNetworkingIdentity *pOutRealIdentity ) = 0; - - // - // Set and get configuration values, see ESteamNetworkingConfigValue for individual descriptions. - // - - // Shortcuts for common cases. (Implemented as inline functions below) - bool SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val ); - bool SetGlobalConfigValueFloat( ESteamNetworkingConfigValue eValue, float val ); - bool SetGlobalConfigValueString( ESteamNetworkingConfigValue eValue, const char *val ); - bool SetGlobalConfigValuePtr( ESteamNetworkingConfigValue eValue, void *val ); - bool SetConnectionConfigValueInt32( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val ); - bool SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ); - bool SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val ); - - // - // Set global callbacks. If you do not want to use Steam's callback dispatch mechanism and you - // want to use the same callback on all (or most) listen sockets and connections, then - // simply install these callbacks first thing, and you are good to go. - // See ISteamNetworkingSockets::RunCallbacks - // - bool SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback ); - bool SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback ); - bool SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback ); - bool SetGlobalCallback_FakeIPResult( FnSteamNetworkingFakeIPResult fnCallback ); - bool SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback ); - bool SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback ); - - /// Set a configuration value. - /// - eValue: which value is being set - /// - eScope: Onto what type of object are you applying the setting? - /// - scopeArg: Which object you want to change? (Ignored for global scope). E.g. connection handle, listen socket handle, interface pointer, etc. - /// - eDataType: What type of data is in the buffer at pValue? This must match the type of the variable exactly! - /// - pArg: Value to set it to. You can pass NULL to remove a non-global setting at this scope, - /// causing the value for that object to use global defaults. Or at global scope, passing NULL - /// will reset any custom value and restore it to the system default. - /// NOTE: When setting pointers (e.g. callback functions), do not pass the function pointer directly. - /// Your argument should be a pointer to a function pointer. - virtual bool SetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, - ESteamNetworkingConfigDataType eDataType, const void *pArg ) = 0; - - /// Set a configuration value, using a struct to pass the value. - /// (This is just a convenience shortcut; see below for the implementation and - /// a little insight into how SteamNetworkingConfigValue_t is used when - /// setting config options during listen socket and connection creation.) - bool SetConfigValueStruct( const SteamNetworkingConfigValue_t &opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj ); - - /// Get a configuration value. - /// - eValue: which value to fetch - /// - eScopeType: query setting on what type of object - /// - eScopeArg: the object to query the setting for - /// - pOutDataType: If non-NULL, the data type of the value is returned. - /// - pResult: Where to put the result. Pass NULL to query the required buffer size. (k_ESteamNetworkingGetConfigValue_BufferTooSmall will be returned.) - /// - cbResult: IN: the size of your buffer. OUT: the number of bytes filled in or required. - virtual ESteamNetworkingGetConfigValueResult GetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, - ESteamNetworkingConfigDataType *pOutDataType, void *pResult, size_t *cbResult ) = 0; - - /// Get info about a configuration value. Returns the name of the value, - /// or NULL if the value doesn't exist. Other output parameters can be NULL - /// if you do not need them. - virtual const char *GetConfigValueInfo( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigDataType *pOutDataType, - ESteamNetworkingConfigScope *pOutScope ) = 0; - - /// Iterate the list of all configuration values in the current environment that it might - /// be possible to display or edit using a generic UI. To get the first iterable value, - /// pass k_ESteamNetworkingConfig_Invalid. Returns k_ESteamNetworkingConfig_Invalid - /// to signal end of list. - /// - /// The bEnumerateDevVars argument can be used to include "dev" vars. These are vars that - /// are recommended to only be editable in "debug" or "dev" mode and typically should not be - /// shown in a retail environment where a malicious local user might use this to cheat. - virtual ESteamNetworkingConfigValue IterateGenericEditableConfigValues( ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars ) = 0; - - // - // String conversions. You'll usually access these using the respective - // inline methods. - // - virtual void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr &addr, char *buf, size_t cbBuf, bool bWithPort ) = 0; - virtual bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ) = 0; - virtual ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType( const SteamNetworkingIPAddr &addr ) = 0; - virtual void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ) = 0; - virtual bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr ) = 0; - -protected: - ~ISteamNetworkingUtils(); // Silence some warnings -}; -#define STEAMNETWORKINGUTILS_INTERFACE_VERSION "SteamNetworkingUtils004" - -// Global accessors -// Using standalone lib -#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB - - // Standalone lib - static_assert( STEAMNETWORKINGUTILS_INTERFACE_VERSION[22] == '4', "Version mismatch" ); - STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingUtils *SteamNetworkingUtils_LibV4(); - inline ISteamNetworkingUtils *SteamNetworkingUtils_Lib() { return SteamNetworkingUtils_LibV4(); } - - #ifndef STEAMNETWORKINGSOCKETS_STEAMAPI - inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_LibV4(); } - #endif -#endif - -// Using Steamworks SDK -#ifdef STEAMNETWORKINGSOCKETS_STEAMAPI - STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamNetworkingUtils *, SteamNetworkingUtils_SteamAPI, - /* Prefer user version of the interface. But if it isn't found, then use - gameserver one. Yes, this is a completely terrible hack */ - SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) ? - SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) : - SteamInternal_FindOrCreateGameServerInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ), - "global", - STEAMNETWORKINGUTILS_INTERFACE_VERSION - ) - - #ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB - inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_SteamAPI(); } - #endif -#endif - -/// A struct used to describe our readiness to use the relay network. -/// To do this we first need to fetch the network configuration, -/// which describes what POPs are available. -struct SteamRelayNetworkStatus_t -{ - enum { k_iCallback = k_iSteamNetworkingUtilsCallbacks + 1 }; - - /// Summary status. When this is "current", initialization has - /// completed. Anything else means you are not ready yet, or - /// there is a significant problem. - ESteamNetworkingAvailability m_eAvail; - - /// Nonzero if latency measurement is in progress (or pending, - /// awaiting a prerequisite). - int m_bPingMeasurementInProgress; - - /// Status obtaining the network config. This is a prerequisite - /// for relay network access. - /// - /// Failure to obtain the network config almost always indicates - /// a problem with the local internet connection. - ESteamNetworkingAvailability m_eAvailNetworkConfig; - - /// Current ability to communicate with ANY relay. Note that - /// the complete failure to communicate with any relays almost - /// always indicates a problem with the local Internet connection. - /// (However, just because you can reach a single relay doesn't - /// mean that the local connection is in perfect health.) - ESteamNetworkingAvailability m_eAvailAnyRelay; - - /// Non-localized English language status. For diagnostic/debugging - /// purposes only. - char m_debugMsg[ 256 ]; -}; - -#ifndef API_GEN - -/// Utility class for printing a SteamNetworkingIdentity. -/// E.g. printf( "Identity is '%s'\n", SteamNetworkingIdentityRender( identity ).c_str() ); -struct SteamNetworkingIdentityRender -{ - SteamNetworkingIdentityRender( const SteamNetworkingIdentity &x ) { x.ToString( buf, sizeof(buf) ); } - inline const char *c_str() const { return buf; } -private: - char buf[ SteamNetworkingIdentity::k_cchMaxString ]; -}; - -/// Utility class for printing a SteamNetworkingIPAddrRender. -struct SteamNetworkingIPAddrRender -{ - SteamNetworkingIPAddrRender( const SteamNetworkingIPAddr &x, bool bWithPort = true ) { x.ToString( buf, sizeof(buf), bWithPort ); } - inline const char *c_str() const { return buf; } -private: - char buf[ SteamNetworkingIPAddr::k_cchMaxString ]; -}; - -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// Internal stuff - -inline void ISteamNetworkingUtils::InitRelayNetworkAccess() { CheckPingDataUpToDate( 1e10f ); } -inline bool ISteamNetworkingUtils::SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Int32, &val ); } -inline bool ISteamNetworkingUtils::SetGlobalConfigValueFloat( ESteamNetworkingConfigValue eValue, float val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Float, &val ); } -inline bool ISteamNetworkingUtils::SetGlobalConfigValueString( ESteamNetworkingConfigValue eValue, const char *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_String, val ); } -inline bool ISteamNetworkingUtils::SetGlobalConfigValuePtr( ESteamNetworkingConfigValue eValue, void *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Ptr, &val ); } // Note: passing pointer to pointer. -inline bool ISteamNetworkingUtils::SetConnectionConfigValueInt32( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_Int32, &val ); } -inline bool ISteamNetworkingUtils::SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_Float, &val ); } -inline bool ISteamNetworkingUtils::SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_String, val ); } -inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, (void*)fnCallback ); } -inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_AuthStatusChanged, (void*)fnCallback ); } -inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged, (void*)fnCallback ); } -inline bool ISteamNetworkingUtils::SetGlobalCallback_FakeIPResult( FnSteamNetworkingFakeIPResult fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_FakeIPResult, (void*)fnCallback ); } -inline bool ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_MessagesSessionRequest, (void*)fnCallback ); } -inline bool ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_MessagesSessionFailed, (void*)fnCallback ); } - -inline bool ISteamNetworkingUtils::SetConfigValueStruct( const SteamNetworkingConfigValue_t &opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj ) -{ - // Locate the argument. Strings are a special case, since the - // "value" (the whole string buffer) doesn't fit in the struct - // NOTE: for pointer values, we pass a pointer to the pointer, - // we do not pass the pointer directly. - const void *pVal = ( opt.m_eDataType == k_ESteamNetworkingConfig_String ) ? (const void *)opt.m_val.m_string : (const void *)&opt.m_val; - return SetConfigValue( opt.m_eValue, eScopeType, scopeObj, opt.m_eDataType, pVal ); -} - -// How to get helper functions. -#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) || defined(STEAMNETWORKINGSOCKETS_FOREXPORT) || defined( STEAMNETWORKINGSOCKETS_STANDALONELIB ) - - // Call direct to static functions - STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr *pAddr, char *buf, size_t cbBuf, bool bWithPort ); - STEAMNETWORKINGSOCKETS_INTERFACE bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ); - STEAMNETWORKINGSOCKETS_INTERFACE ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType( const SteamNetworkingIPAddr *pAddr ); - STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity *pIdentity, char *buf, size_t cbBuf ); - STEAMNETWORKINGSOCKETS_INTERFACE bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, size_t sizeofIdentity, const char *pszStr ); - inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingIPAddr_ToString( this, buf, cbBuf, bWithPort ); } - inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingIPAddr_ParseString( this, pszStr ); } - inline ESteamNetworkingFakeIPType SteamNetworkingIPAddr::GetFakeIPType() const { return SteamNetworkingIPAddr_GetFakeIPType( this ); } - inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingIdentity_ToString( this, buf, cbBuf ); } - inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingIdentity_ParseString( this, sizeof(*this), pszStr ); } - -#elif defined( STEAMNETWORKINGSOCKETS_STEAMAPI ) - // Using steamworks SDK - go through SteamNetworkingUtils() - inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingUtils()->SteamNetworkingIPAddr_ToString( *this, buf, cbBuf, bWithPort ); } - inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIPAddr_ParseString( this, pszStr ); } - inline ESteamNetworkingFakeIPType SteamNetworkingIPAddr::GetFakeIPType() const { return SteamNetworkingUtils()->SteamNetworkingIPAddr_GetFakeIPType( *this ); } - inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingUtils()->SteamNetworkingIdentity_ToString( *this, buf, cbBuf ); } - inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIdentity_ParseString( this, pszStr ); } -#else - #error "Invalid config" -#endif - -#endif // ISTEAMNETWORKINGUTILS diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steam_api_common.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steam_api_common.h deleted file mode 100644 index 24e2dda8e68..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steam_api_common.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef STEAM_API_COMMON -#define STEAM_API_COMMON -#pragma once - -// When using the SteamWorks SDK, this header contains declarations -// for callbacks, etc. In the OpenSource version, it's a stub with -// just a few things. - -#include "steamtypes.h" -#include "steamclientpublic.h" - -enum { k_iSteamNetworkingSocketsCallbacks = 1220 }; -enum { k_iSteamNetworkingMessagesCallbacks = 1250 }; -enum { k_iSteamNetworkingUtilsCallbacks = 1280 }; - -// handle to a communication pipe to the Steam client -typedef int32 HSteamPipe; -// handle to single instance of a steam user -typedef int32 HSteamUser; - -#ifdef API_GEN -# define STEAM_CLANG_ATTR(ATTR) __attribute__((annotate( ATTR ))) -#else -# define STEAM_CLANG_ATTR(ATTR) -#endif - -#define STEAM_METHOD_DESC(DESC) STEAM_CLANG_ATTR( "desc:" #DESC ";" ) -#define STEAM_IGNOREATTR() STEAM_CLANG_ATTR( "ignore" ) -#define STEAM_OUT_STRUCT() STEAM_CLANG_ATTR( "out_struct: ;" ) -#define STEAM_OUT_STRING() STEAM_CLANG_ATTR( "out_string: ;" ) -#define STEAM_OUT_ARRAY_CALL(COUNTER,FUNCTION,PARAMS) STEAM_CLANG_ATTR( "out_array_call:" #COUNTER "," #FUNCTION "," #PARAMS ";" ) -#define STEAM_OUT_ARRAY_COUNT(COUNTER, DESC) STEAM_CLANG_ATTR( "out_array_count:" #COUNTER ";desc:" #DESC ) -#define STEAM_ARRAY_COUNT(COUNTER) STEAM_CLANG_ATTR( "array_count:" #COUNTER ";" ) -#define STEAM_ARRAY_COUNT_D(COUNTER, DESC) STEAM_CLANG_ATTR( "array_count:" #COUNTER ";desc:" #DESC ) -#define STEAM_BUFFER_COUNT(COUNTER) STEAM_CLANG_ATTR( "buffer_count:" #COUNTER ";" ) -#define STEAM_OUT_BUFFER_COUNT(COUNTER) STEAM_CLANG_ATTR( "out_buffer_count:" #COUNTER ";" ) -#define STEAM_OUT_STRING_COUNT(COUNTER) STEAM_CLANG_ATTR( "out_string_count:" #COUNTER ";" ) -#define STEAM_DESC(DESC) STEAM_CLANG_ATTR("desc:" #DESC ";") -#define STEAM_CALL_RESULT(RESULT_TYPE) STEAM_CLANG_ATTR("callresult:" #RESULT_TYPE ";") -#define STEAM_CALL_BACK(RESULT_TYPE) STEAM_CLANG_ATTR("callback:" #RESULT_TYPE ";") - -#endif // STEAM_API_COMMON diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamclientpublic.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamclientpublic.h deleted file mode 100644 index 2bd66253f30..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamclientpublic.h +++ /dev/null @@ -1,1198 +0,0 @@ -//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ -// -// Declare common types used by the Steamworks SDK. -// -//============================================================================= - -#ifndef STEAMCLIENTPUBLIC_H -#define STEAMCLIENTPUBLIC_H - -#include "steamtypes.h" -#include "steamuniverse.h" - -// General result codes -enum EResult -{ - k_EResultNone = 0, // no result - k_EResultOK = 1, // success - k_EResultFail = 2, // generic failure - k_EResultNoConnection = 3, // no/failed network connection -// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed - k_EResultInvalidPassword = 5, // password/ticket is invalid - k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere - k_EResultInvalidProtocolVer = 7, // protocol version is incorrect - k_EResultInvalidParam = 8, // a parameter is incorrect - k_EResultFileNotFound = 9, // file was not found - k_EResultBusy = 10, // called method busy - action not taken - k_EResultInvalidState = 11, // called object was in an invalid state - k_EResultInvalidName = 12, // name is invalid - k_EResultInvalidEmail = 13, // email is invalid - k_EResultDuplicateName = 14, // name is not unique - k_EResultAccessDenied = 15, // access is denied - k_EResultTimeout = 16, // operation timed out - k_EResultBanned = 17, // VAC2 banned - k_EResultAccountNotFound = 18, // account not found - k_EResultInvalidSteamID = 19, // steamID is invalid - k_EResultServiceUnavailable = 20, // The requested service is currently unavailable - k_EResultNotLoggedOn = 21, // The user is not logged on - k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party) - k_EResultEncryptionFailure = 23, // Encryption or Decryption failed - k_EResultInsufficientPrivilege = 24, // Insufficient privilege - k_EResultLimitExceeded = 25, // Too much of a good thing - k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes) - k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired - k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again - k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time - k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user - k_EResultIPNotFound = 31, // IP address not found - k_EResultPersistFailed = 32, // failed to write change to the data store - k_EResultLockingFailed = 33, // failed to acquire access lock for this operation - k_EResultLogonSessionReplaced = 34, - k_EResultConnectFailed = 35, - k_EResultHandshakeFailed = 36, - k_EResultIOFailure = 37, - k_EResultRemoteDisconnect = 38, - k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested - k_EResultBlocked = 40, // a user didn't allow it - k_EResultIgnored = 41, // target is ignoring sender - k_EResultNoMatch = 42, // nothing matching the request found - k_EResultAccountDisabled = 43, - k_EResultServiceReadOnly = 44, // this service is not accepting content changes right now - k_EResultAccountNotFeatured = 45, // account doesn't have value, so this feature isn't available - k_EResultAdministratorOK = 46, // allowed to take this action, but only because requester is admin - k_EResultContentVersion = 47, // A Version mismatch in content transmitted within the Steam protocol. - k_EResultTryAnotherCM = 48, // The current CM can't service the user making a request, user should try another. - k_EResultPasswordRequiredToKickSession = 49,// You are already logged in elsewhere, this cached credential login has failed. - k_EResultAlreadyLoggedInElsewhere = 50, // You are already logged in elsewhere, you must wait - k_EResultSuspended = 51, // Long running operation (content download) suspended/paused - k_EResultCancelled = 52, // Operation canceled (typically by user: content download) - k_EResultDataCorruption = 53, // Operation canceled because data is ill formed or unrecoverable - k_EResultDiskFull = 54, // Operation canceled - not enough disk space. - k_EResultRemoteCallFailed = 55, // an remote call or IPC call failed - k_EResultPasswordUnset = 56, // Password could not be verified as it's unset server side - k_EResultExternalAccountUnlinked = 57, // External account (PSN, Facebook...) is not linked to a Steam account - k_EResultPSNTicketInvalid = 58, // PSN ticket was invalid - k_EResultExternalAccountAlreadyLinked = 59, // External account (PSN, Facebook...) is already linked to some other account, must explicitly request to replace/delete the link first - k_EResultRemoteFileConflict = 60, // The sync cannot resume due to a conflict between the local and remote files - k_EResultIllegalPassword = 61, // The requested new password is not legal - k_EResultSameAsPreviousValue = 62, // new value is the same as the old one ( secret question and answer ) - k_EResultAccountLogonDenied = 63, // account login denied due to 2nd factor authentication failure - k_EResultCannotUseOldPassword = 64, // The requested new password is not legal - k_EResultInvalidLoginAuthCode = 65, // account login denied due to auth code invalid - k_EResultAccountLogonDeniedNoMail = 66, // account login denied due to 2nd factor auth failure - and no mail has been sent - partner site specific - k_EResultHardwareNotCapableOfIPT = 67, // - k_EResultIPTInitError = 68, // - k_EResultParentalControlRestricted = 69, // operation failed due to parental control restrictions for current user - k_EResultFacebookQueryError = 70, // Facebook query returned an error - k_EResultExpiredLoginAuthCode = 71, // account login denied due to auth code expired - k_EResultIPLoginRestrictionFailed = 72, - k_EResultAccountLockedDown = 73, - k_EResultAccountLogonDeniedVerifiedEmailRequired = 74, - k_EResultNoMatchingURL = 75, - k_EResultBadResponse = 76, // parse failure, missing field, etc. - k_EResultRequirePasswordReEntry = 77, // The user cannot complete the action until they re-enter their password - k_EResultValueOutOfRange = 78, // the value entered is outside the acceptable range - k_EResultUnexpectedError = 79, // something happened that we didn't expect to ever happen - k_EResultDisabled = 80, // The requested service has been configured to be unavailable - k_EResultInvalidCEGSubmission = 81, // The set of files submitted to the CEG server are not valid ! - k_EResultRestrictedDevice = 82, // The device being used is not allowed to perform this action - k_EResultRegionLocked = 83, // The action could not be complete because it is region restricted - k_EResultRateLimitExceeded = 84, // Temporary rate limit exceeded, try again later, different from k_EResultLimitExceeded which may be permanent - k_EResultAccountLoginDeniedNeedTwoFactor = 85, // Need two-factor code to login - k_EResultItemDeleted = 86, // The thing we're trying to access has been deleted - k_EResultAccountLoginDeniedThrottle = 87, // login attempt failed, try to throttle response to possible attacker - k_EResultTwoFactorCodeMismatch = 88, // two factor code mismatch - k_EResultTwoFactorActivationCodeMismatch = 89, // activation code for two-factor didn't match - k_EResultAccountAssociatedToMultiplePartners = 90, // account has been associated with multiple partners - k_EResultNotModified = 91, // data not modified - k_EResultNoMobileDevice = 92, // the account does not have a mobile device associated with it - k_EResultTimeNotSynced = 93, // the time presented is out of range or tolerance - k_EResultSmsCodeFailed = 94, // SMS code failure (no match, none pending, etc.) - k_EResultAccountLimitExceeded = 95, // Too many accounts access this resource - k_EResultAccountActivityLimitExceeded = 96, // Too many changes to this account - k_EResultPhoneActivityLimitExceeded = 97, // Too many changes to this phone - k_EResultRefundToWallet = 98, // Cannot refund to payment method, must use wallet - k_EResultEmailSendFailure = 99, // Cannot send an email - k_EResultNotSettled = 100, // Can't perform operation till payment has settled - k_EResultNeedCaptcha = 101, // Needs to provide a valid captcha - k_EResultGSLTDenied = 102, // a game server login token owned by this token's owner has been banned - k_EResultGSOwnerDenied = 103, // game server owner is denied for other reason (account lock, community ban, vac ban, missing phone) - k_EResultInvalidItemType = 104, // the type of thing we were requested to act on is invalid - k_EResultIPBanned = 105, // the ip address has been banned from taking this action - k_EResultGSLTExpired = 106, // this token has expired from disuse; can be reset for use - k_EResultInsufficientFunds = 107, // user doesn't have enough wallet funds to complete the action - k_EResultTooManyPending = 108, // There are too many of this thing pending already - k_EResultNoSiteLicensesFound = 109, // No site licenses found - k_EResultWGNetworkSendExceeded = 110, // the WG couldn't send a response because we exceeded max network send size - k_EResultAccountNotFriends = 111, // the user is not mutually friends - k_EResultLimitedUserAccount = 112, // the user is limited - k_EResultCantRemoveItem = 113, // item can't be removed - k_EResultAccountDeleted = 114, // account has been deleted - k_EResultExistingUserCancelledLicense = 115, // A license for this already exists, but cancelled - k_EResultCommunityCooldown = 116, // access is denied because of a community cooldown (probably from support profile data resets) - k_EResultNoLauncherSpecified = 117, // No launcher was specified, but a launcher was needed to choose correct realm for operation. - k_EResultMustAgreeToSSA = 118, // User must agree to china SSA or global SSA before login - k_EResultLauncherMigrated = 119, // The specified launcher type is no longer supported; the user should be directed elsewhere - k_EResultSteamRealmMismatch = 120, // The user's realm does not match the realm of the requested resource - k_EResultInvalidSignature = 121, // signature check did not match - k_EResultParseFailure = 122, // Failed to parse input - k_EResultNoVerifiedPhone = 123, // account does not have a verified phone number - k_EResultInsufficientBattery = 124, // user device doesn't have enough battery charge currently to complete the action - k_EResultChargerRequired = 125, // The operation requires a charger to be plugged in, which wasn't present - k_EResultCachedCredentialInvalid = 126, // Cached credential was invalid - user must reauthenticate - K_EResultPhoneNumberIsVOIP = 127, // The phone number provided is a Voice Over IP number - k_EResultNotSupported = 128, // The data being accessed is not supported by this API - k_EResultFamilySizeLimitExceeded = 129, // Reached the maximum size of the family -}; - -// Error codes for use with the voice functions -enum EVoiceResult -{ - k_EVoiceResultOK = 0, - k_EVoiceResultNotInitialized = 1, - k_EVoiceResultNotRecording = 2, - k_EVoiceResultNoData = 3, - k_EVoiceResultBufferTooSmall = 4, - k_EVoiceResultDataCorrupted = 5, - k_EVoiceResultRestricted = 6, - k_EVoiceResultUnsupportedCodec = 7, - k_EVoiceResultReceiverOutOfDate = 8, - k_EVoiceResultReceiverDidNotAnswer = 9, - -}; - -// Result codes to GSHandleClientDeny/Kick -enum EDenyReason -{ - k_EDenyInvalid = 0, - k_EDenyInvalidVersion = 1, - k_EDenyGeneric = 2, - k_EDenyNotLoggedOn = 3, - k_EDenyNoLicense = 4, - k_EDenyCheater = 5, - k_EDenyLoggedInElseWhere = 6, - k_EDenyUnknownText = 7, - k_EDenyIncompatibleAnticheat = 8, - k_EDenyMemoryCorruption = 9, - k_EDenyIncompatibleSoftware = 10, - k_EDenySteamConnectionLost = 11, - k_EDenySteamConnectionError = 12, - k_EDenySteamResponseTimedOut = 13, - k_EDenySteamValidationStalled = 14, - k_EDenySteamOwnerLeftGuestUser = 15, -}; - -// return type of GetAuthSessionTicket -typedef uint32 HAuthTicket; -const HAuthTicket k_HAuthTicketInvalid = 0; - -// results from BeginAuthSession -enum EBeginAuthSessionResult -{ - k_EBeginAuthSessionResultOK = 0, // Ticket is valid for this game and this steamID. - k_EBeginAuthSessionResultInvalidTicket = 1, // Ticket is not valid. - k_EBeginAuthSessionResultDuplicateRequest = 2, // A ticket has already been submitted for this steamID - k_EBeginAuthSessionResultInvalidVersion = 3, // Ticket is from an incompatible interface version - k_EBeginAuthSessionResultGameMismatch = 4, // Ticket is not for this game - k_EBeginAuthSessionResultExpiredTicket = 5, // Ticket has expired -}; - -// Callback values for callback ValidateAuthTicketResponse_t which is a response to BeginAuthSession -enum EAuthSessionResponse -{ - k_EAuthSessionResponseOK = 0, // Steam has verified the user is online, the ticket is valid and ticket has not been reused. - k_EAuthSessionResponseUserNotConnectedToSteam = 1, // The user in question is not connected to steam - k_EAuthSessionResponseNoLicenseOrExpired = 2, // The license has expired. - k_EAuthSessionResponseVACBanned = 3, // The user is VAC banned for this game. - k_EAuthSessionResponseLoggedInElseWhere = 4, // The user account has logged in elsewhere and the session containing the game instance has been disconnected. - k_EAuthSessionResponseVACCheckTimedOut = 5, // VAC has been unable to perform anti-cheat checks on this user - k_EAuthSessionResponseAuthTicketCanceled = 6, // The ticket has been canceled by the issuer - k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7, // This ticket has already been used, it is not valid. - k_EAuthSessionResponseAuthTicketInvalid = 8, // This ticket is not from a user instance currently connected to steam. - k_EAuthSessionResponsePublisherIssuedBan = 9, // The user is banned for this game. The ban came via the web api and not VAC - k_EAuthSessionResponseAuthTicketNetworkIdentityFailure = 10, // The network identity in the ticket does not match the server authenticating the ticket -}; - -// results from UserHasLicenseForApp -enum EUserHasLicenseForAppResult -{ - k_EUserHasLicenseResultHasLicense = 0, // User has a license for specified app - k_EUserHasLicenseResultDoesNotHaveLicense = 1, // User does not have a license for the specified app - k_EUserHasLicenseResultNoAuth = 2, // User has not been authenticated -}; - - -// Steam account types -enum EAccountType -{ - k_EAccountTypeInvalid = 0, - k_EAccountTypeIndividual = 1, // single user account - k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account - k_EAccountTypeGameServer = 3, // game server account - k_EAccountTypeAnonGameServer = 4, // anonymous game server account - k_EAccountTypePending = 5, // pending - k_EAccountTypeContentServer = 6, // content server - k_EAccountTypeClan = 7, - k_EAccountTypeChat = 8, - k_EAccountTypeConsoleUser = 9, // Fake SteamID for local PSN account on PS3 or Live account on 360, etc. - k_EAccountTypeAnonUser = 10, - - // Max of 16 items in this field - k_EAccountTypeMax -}; - - - -//----------------------------------------------------------------------------- -// Purpose: Chat Entry Types (previously was only friend-to-friend message types) -//----------------------------------------------------------------------------- -enum EChatEntryType -{ - k_EChatEntryTypeInvalid = 0, - k_EChatEntryTypeChatMsg = 1, // Normal text message from another user - k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat) - k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game - k_EChatEntryTypeEmote = 4, // text emote message (deprecated, should be treated as ChatMsg) - //k_EChatEntryTypeLobbyGameStart = 5, // lobby game is starting (dead - listen for LobbyGameCreated_t callback instead) - k_EChatEntryTypeLeftConversation = 6, // user has left the conversation ( closed chat window ) - // Above are previous FriendMsgType entries, now merged into more generic chat entry types - k_EChatEntryTypeEntered = 7, // user has entered the conversation (used in multi-user chat and group chat) - k_EChatEntryTypeWasKicked = 8, // user was kicked (data: 64-bit steamid of actor performing the kick) - k_EChatEntryTypeWasBanned = 9, // user was banned (data: 64-bit steamid of actor performing the ban) - k_EChatEntryTypeDisconnected = 10, // user disconnected - k_EChatEntryTypeHistoricalChat = 11, // a chat message from user's chat history or offilne message - //k_EChatEntryTypeReserved1 = 12, // No longer used - //k_EChatEntryTypeReserved2 = 13, // No longer used - k_EChatEntryTypeLinkBlocked = 14, // a link was removed by the chat filter. -}; - - -//----------------------------------------------------------------------------- -// Purpose: Chat Room Enter Responses -//----------------------------------------------------------------------------- -enum EChatRoomEnterResponse -{ - k_EChatRoomEnterResponseSuccess = 1, // Success - k_EChatRoomEnterResponseDoesntExist = 2, // Chat doesn't exist (probably closed) - k_EChatRoomEnterResponseNotAllowed = 3, // General Denied - You don't have the permissions needed to join the chat - k_EChatRoomEnterResponseFull = 4, // Chat room has reached its maximum size - k_EChatRoomEnterResponseError = 5, // Unexpected Error - k_EChatRoomEnterResponseBanned = 6, // You are banned from this chat room and may not join - k_EChatRoomEnterResponseLimited = 7, // Joining this chat is not allowed because you are a limited user (no value on account) - k_EChatRoomEnterResponseClanDisabled = 8, // Attempt to join a clan chat when the clan is locked or disabled - k_EChatRoomEnterResponseCommunityBan = 9, // Attempt to join a chat when the user has a community lock on their account - k_EChatRoomEnterResponseMemberBlockedYou = 10, // Join failed - some member in the chat has blocked you from joining - k_EChatRoomEnterResponseYouBlockedMember = 11, // Join failed - you have blocked some member already in the chat - // k_EChatRoomEnterResponseNoRankingDataLobby = 12, // No longer used - // k_EChatRoomEnterResponseNoRankingDataUser = 13, // No longer used - // k_EChatRoomEnterResponseRankOutOfRange = 14, // No longer used - k_EChatRoomEnterResponseRatelimitExceeded = 15, // Join failed - to many join attempts in a very short period of time -}; - - -const unsigned int k_unSteamAccountIDMask = 0xFFFFFFFF; -const unsigned int k_unSteamAccountInstanceMask = 0x000FFFFF; -const unsigned int k_unSteamUserDefaultInstance = 1; // fixed instance for all individual users - -// Special flags for Chat accounts - they go in the top 8 bits -// of the steam ID's "instance", leaving 12 for the actual instances -enum EChatSteamIDInstanceFlags -{ - k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags - - k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1, // top bit - k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2, // next one down, etc - k_EChatInstanceFlagMMSLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 3, // next one down, etc - - // Max of 8 flags -}; - - -//----------------------------------------------------------------------------- -// Purpose: Possible positions to tell the overlay to show notifications in -//----------------------------------------------------------------------------- -enum ENotificationPosition -{ - k_EPositionInvalid = -1, - k_EPositionTopLeft = 0, - k_EPositionTopRight = 1, - k_EPositionBottomLeft = 2, - k_EPositionBottomRight = 3, -}; - - -//----------------------------------------------------------------------------- -// Purpose: Broadcast upload result details -//----------------------------------------------------------------------------- -enum EBroadcastUploadResult -{ - k_EBroadcastUploadResultNone = 0, // broadcast state unknown - k_EBroadcastUploadResultOK = 1, // broadcast was good, no problems - k_EBroadcastUploadResultInitFailed = 2, // broadcast init failed - k_EBroadcastUploadResultFrameFailed = 3, // broadcast frame upload failed - k_EBroadcastUploadResultTimeout = 4, // broadcast upload timed out - k_EBroadcastUploadResultBandwidthExceeded = 5, // broadcast send too much data - k_EBroadcastUploadResultLowFPS = 6, // broadcast FPS too low - k_EBroadcastUploadResultMissingKeyFrames = 7, // broadcast sending not enough key frames - k_EBroadcastUploadResultNoConnection = 8, // broadcast client failed to connect to relay - k_EBroadcastUploadResultRelayFailed = 9, // relay dropped the upload - k_EBroadcastUploadResultSettingsChanged = 10, // the client changed broadcast settings - k_EBroadcastUploadResultMissingAudio = 11, // client failed to send audio data - k_EBroadcastUploadResultTooFarBehind = 12, // clients was too slow uploading - k_EBroadcastUploadResultTranscodeBehind = 13, // server failed to keep up with transcode - k_EBroadcastUploadResultNotAllowedToPlay = 14, // Broadcast does not have permissions to play game - k_EBroadcastUploadResultBusy = 15, // RTMP host to busy to take new broadcast stream, choose another - k_EBroadcastUploadResultBanned = 16, // Account banned from community broadcast - k_EBroadcastUploadResultAlreadyActive = 17, // We already already have an stream running. - k_EBroadcastUploadResultForcedOff = 18, // We explicitly shutting down a broadcast - k_EBroadcastUploadResultAudioBehind = 19, // Audio stream was too far behind video - k_EBroadcastUploadResultShutdown = 20, // Broadcast Server was shut down - k_EBroadcastUploadResultDisconnect = 21, // broadcast uploader TCP disconnected - k_EBroadcastUploadResultVideoInitFailed = 22, // invalid video settings - k_EBroadcastUploadResultAudioInitFailed = 23, // invalid audio settings -}; - - -//----------------------------------------------------------------------------- -// Purpose: Reasons a user may not use the Community Market. -// Used in MarketEligibilityResponse_t. -//----------------------------------------------------------------------------- -enum EMarketNotAllowedReasonFlags -{ - k_EMarketNotAllowedReason_None = 0, - - // A back-end call failed or something that might work again on retry - k_EMarketNotAllowedReason_TemporaryFailure = (1 << 0), - - // Disabled account - k_EMarketNotAllowedReason_AccountDisabled = (1 << 1), - - // Locked account - k_EMarketNotAllowedReason_AccountLockedDown = (1 << 2), - - // Limited account (no purchases) - k_EMarketNotAllowedReason_AccountLimited = (1 << 3), - - // The account is banned from trading items - k_EMarketNotAllowedReason_TradeBanned = (1 << 4), - - // Wallet funds aren't tradable because the user has had no purchase - // activity in the last year or has had no purchases prior to last month - k_EMarketNotAllowedReason_AccountNotTrusted = (1 << 5), - - // The user doesn't have Steam Guard enabled - k_EMarketNotAllowedReason_SteamGuardNotEnabled = (1 << 6), - - // The user has Steam Guard, but it hasn't been enabled for the required - // number of days - k_EMarketNotAllowedReason_SteamGuardOnlyRecentlyEnabled = (1 << 7), - - // The user has recently forgotten their password and reset it - k_EMarketNotAllowedReason_RecentPasswordReset = (1 << 8), - - // The user has recently funded his or her wallet with a new payment method - k_EMarketNotAllowedReason_NewPaymentMethod = (1 << 9), - - // An invalid cookie was sent by the user - k_EMarketNotAllowedReason_InvalidCookie = (1 << 10), - - // The user has Steam Guard, but is using a new computer or web browser - k_EMarketNotAllowedReason_UsingNewDevice = (1 << 11), - - // The user has recently refunded a store purchase by his or herself - k_EMarketNotAllowedReason_RecentSelfRefund = (1 << 12), - - // The user has recently funded his or her wallet with a new payment method that cannot be verified - k_EMarketNotAllowedReason_NewPaymentMethodCannotBeVerified = (1 << 13), - - // Not only is the account not trusted, but they have no recent purchases at all - k_EMarketNotAllowedReason_NoRecentPurchases = (1 << 14), - - // User accepted a wallet gift that was recently purchased - k_EMarketNotAllowedReason_AcceptedWalletGift = (1 << 15), -}; - - -// -// describes XP / progress restrictions to apply for games with duration control / -// anti-indulgence enabled for minor Steam China users. -// -// WARNING: DO NOT RENUMBER -enum EDurationControlProgress -{ - k_EDurationControlProgress_Full = 0, // Full progress - k_EDurationControlProgress_Half = 1, // deprecated - XP or persistent rewards should be halved - k_EDurationControlProgress_None = 2, // deprecated - XP or persistent rewards should be stopped - - k_EDurationControl_ExitSoon_3h = 3, // allowed 3h time since 5h gap/break has elapsed, game should exit - steam will terminate the game soon - k_EDurationControl_ExitSoon_5h = 4, // allowed 5h time in calendar day has elapsed, game should exit - steam will terminate the game soon - k_EDurationControl_ExitSoon_Night = 5, // game running after day period, game should exit - steam will terminate the game soon -}; - - -// -// describes which notification timer has expired, for steam china duration control feature -// -// WARNING: DO NOT RENUMBER -enum EDurationControlNotification -{ - k_EDurationControlNotification_None = 0, // just informing you about progress, no notification to show - k_EDurationControlNotification_1Hour = 1, // "you've been playing for N hours" - - k_EDurationControlNotification_3Hours = 2, // deprecated - "you've been playing for 3 hours; take a break" - k_EDurationControlNotification_HalfProgress = 3,// deprecated - "your XP / progress is half normal" - k_EDurationControlNotification_NoProgress = 4, // deprecated - "your XP / progress is zero" - - k_EDurationControlNotification_ExitSoon_3h = 5, // allowed 3h time since 5h gap/break has elapsed, game should exit - steam will terminate the game soon - k_EDurationControlNotification_ExitSoon_5h = 6, // allowed 5h time in calendar day has elapsed, game should exit - steam will terminate the game soon - k_EDurationControlNotification_ExitSoon_Night = 7,// game running after day period, game should exit - steam will terminate the game soon -}; - - -// -// Specifies a game's online state in relation to duration control -// -enum EDurationControlOnlineState -{ - k_EDurationControlOnlineState_Invalid = 0, // nil value - k_EDurationControlOnlineState_Offline = 1, // currently in offline play - single-player, offline co-op, etc. - k_EDurationControlOnlineState_Online = 2, // currently in online play - k_EDurationControlOnlineState_OnlineHighPri = 3, // currently in online play and requests not to be interrupted -}; - - -enum EBetaBranchFlags -{ - k_EBetaBranch_None = 0, - k_EBetaBranch_Default = 1, // this is the default branch ("public") - k_EBetaBranch_Available = 2, // this branch can be selected (available) - k_EBetaBranch_Private = 4, // this is a private branch (password protected) - k_EBetaBranch_Selected = 8, // this is the currently selected branch (active) - k_EBetaBranch_Installed = 16, // this is the currently installed branch (mounted) -}; - -#pragma pack( push, 1 ) - -#define CSTEAMID_DEFINED - -// Steam ID structure (64 bits total) -class CSteamID -{ -public: - - //----------------------------------------------------------------------------- - // Purpose: Constructor - //----------------------------------------------------------------------------- - CSteamID() - { - m_steamid.m_comp.m_unAccountID = 0; - m_steamid.m_comp.m_EAccountType = k_EAccountTypeInvalid; - m_steamid.m_comp.m_EUniverse = k_EUniverseInvalid; - m_steamid.m_comp.m_unAccountInstance = 0; - } - - - //----------------------------------------------------------------------------- - // Purpose: Constructor - // Input : unAccountID - 32-bit account ID - // eUniverse - Universe this account belongs to - // eAccountType - Type of account - //----------------------------------------------------------------------------- - CSteamID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) - { - Set( unAccountID, eUniverse, eAccountType ); - } - - - //----------------------------------------------------------------------------- - // Purpose: Constructor - // Input : unAccountID - 32-bit account ID - // unAccountInstance - instance - // eUniverse - Universe this account belongs to - // eAccountType - Type of account - //----------------------------------------------------------------------------- - CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType ) - { -#if defined(_SERVER) && defined(Assert) - Assert( ( k_EAccountTypeIndividual != eAccountType ) || ( unAccountInstance == k_unSteamUserDefaultInstance ) ); // enforce that for individual accounts, instance is always 1 -#endif // _SERVER - InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType ); - } - - - //----------------------------------------------------------------------------- - // Purpose: Constructor - // Input : ulSteamID - 64-bit representation of a Steam ID - // Note: Will not accept a uint32 or int32 as input, as that is a probable mistake. - // See the stubbed out overloads in the private: section for more info. - //----------------------------------------------------------------------------- - CSteamID( uint64 ulSteamID ) - { - SetFromUint64( ulSteamID ); - } -#ifdef INT64_DIFFERENT_FROM_INT64_T - CSteamID( uint64_t ulSteamID ) - { - SetFromUint64( (uint64)ulSteamID ); - } -#endif - - - //----------------------------------------------------------------------------- - // Purpose: Sets parameters for steam ID - // Input : unAccountID - 32-bit account ID - // eUniverse - Universe this account belongs to - // eAccountType - Type of account - //----------------------------------------------------------------------------- - void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) - { - m_steamid.m_comp.m_unAccountID = unAccountID; - m_steamid.m_comp.m_EUniverse = eUniverse; - m_steamid.m_comp.m_EAccountType = eAccountType; - - if ( eAccountType == k_EAccountTypeClan || eAccountType == k_EAccountTypeGameServer ) - { - m_steamid.m_comp.m_unAccountInstance = 0; - } - else - { - m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDefaultInstance; - } - } - - - //----------------------------------------------------------------------------- - // Purpose: Sets parameters for steam ID - // Input : unAccountID - 32-bit account ID - // eUniverse - Universe this account belongs to - // eAccountType - Type of account - //----------------------------------------------------------------------------- - void InstancedSet( uint32 unAccountID, uint32 unInstance, EUniverse eUniverse, EAccountType eAccountType ) - { - m_steamid.m_comp.m_unAccountID = unAccountID; - m_steamid.m_comp.m_EUniverse = eUniverse; - m_steamid.m_comp.m_EAccountType = eAccountType; - m_steamid.m_comp.m_unAccountInstance = unInstance; - } - - - //----------------------------------------------------------------------------- - // Purpose: Initializes a steam ID from its 52 bit parts and universe/type - // Input : ulIdentifier - 52 bits of goodness - //----------------------------------------------------------------------------- - void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType ) - { - m_steamid.m_comp.m_unAccountID = ( ulIdentifier & k_unSteamAccountIDMask ); // account ID is low 32 bits - m_steamid.m_comp.m_unAccountInstance = ( ( ulIdentifier >> 32 ) & k_unSteamAccountInstanceMask ); // account instance is next 20 bits - m_steamid.m_comp.m_EUniverse = eUniverse; - m_steamid.m_comp.m_EAccountType = eAccountType; - } - - - //----------------------------------------------------------------------------- - // Purpose: Initializes a steam ID from its 64-bit representation - // Input : ulSteamID - 64-bit representation of a Steam ID - //----------------------------------------------------------------------------- - void SetFromUint64( uint64 ulSteamID ) - { - m_steamid.m_unAll64Bits = ulSteamID; - } - - - //----------------------------------------------------------------------------- - // Purpose: Clear all fields, leaving an invalid ID. - //----------------------------------------------------------------------------- - void Clear() - { - m_steamid.m_comp.m_unAccountID = 0; - m_steamid.m_comp.m_EAccountType = k_EAccountTypeInvalid; - m_steamid.m_comp.m_EUniverse = k_EUniverseInvalid; - m_steamid.m_comp.m_unAccountInstance = 0; - } - - //----------------------------------------------------------------------------- - // Purpose: Converts steam ID to its 64-bit representation - // Output : 64-bit representation of a Steam ID - //----------------------------------------------------------------------------- - uint64 ConvertToUint64() const - { - return m_steamid.m_unAll64Bits; - } - - - //----------------------------------------------------------------------------- - // Purpose: Converts the static parts of a steam ID to a 64-bit representation. - // For multiseat accounts, all instances of that account will have the - // same static account key, so they can be grouped together by the static - // account key. - // Output : 64-bit static account key - //----------------------------------------------------------------------------- - uint64 GetStaticAccountKey() const - { - // note we do NOT include the account instance (which is a dynamic property) in the static account key - return (uint64) ( ( ( (uint64) m_steamid.m_comp.m_EUniverse ) << 56 ) + ((uint64) m_steamid.m_comp.m_EAccountType << 52 ) + m_steamid.m_comp.m_unAccountID ); - } - - - //----------------------------------------------------------------------------- - // Purpose: create an anonymous game server login to be filled in by the AM - //----------------------------------------------------------------------------- - void CreateBlankAnonLogon( EUniverse eUniverse ) - { - m_steamid.m_comp.m_unAccountID = 0; - m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonGameServer; - m_steamid.m_comp.m_EUniverse = eUniverse; - m_steamid.m_comp.m_unAccountInstance = 0; - } - - - //----------------------------------------------------------------------------- - // Purpose: create an anonymous game server login to be filled in by the AM - //----------------------------------------------------------------------------- - void CreateBlankAnonUserLogon( EUniverse eUniverse ) - { - m_steamid.m_comp.m_unAccountID = 0; - m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonUser; - m_steamid.m_comp.m_EUniverse = eUniverse; - m_steamid.m_comp.m_unAccountInstance = 0; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this an anonymous game server login that will be filled in? - //----------------------------------------------------------------------------- - bool BBlankAnonAccount() const - { - return m_steamid.m_comp.m_unAccountID == 0 && BAnonAccount() && m_steamid.m_comp.m_unAccountInstance == 0; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this a game server account id? (Either persistent or anonymous) - //----------------------------------------------------------------------------- - bool BGameServerAccount() const - { - return m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this a persistent (not anonymous) game server account id? - //----------------------------------------------------------------------------- - bool BPersistentGameServerAccount() const - { - return m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this an anonymous game server account id? - //----------------------------------------------------------------------------- - bool BAnonGameServerAccount() const - { - return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this a content server account id? - //----------------------------------------------------------------------------- - bool BContentServerAccount() const - { - return m_steamid.m_comp.m_EAccountType == k_EAccountTypeContentServer; - } - - - //----------------------------------------------------------------------------- - // Purpose: Is this a clan account id? - //----------------------------------------------------------------------------- - bool BClanAccount() const - { - return m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan; - } - - - //----------------------------------------------------------------------------- - // Purpose: Is this a chat account id? - //----------------------------------------------------------------------------- - bool BChatAccount() const - { - return m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this a chat account id? - //----------------------------------------------------------------------------- - bool IsLobby() const - { - return ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat ) - && ( m_steamid.m_comp.m_unAccountInstance & k_EChatInstanceFlagLobby ); - } - - - //----------------------------------------------------------------------------- - // Purpose: Is this an individual user account id? - //----------------------------------------------------------------------------- - bool BIndividualAccount() const - { - return m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual || m_steamid.m_comp.m_EAccountType == k_EAccountTypeConsoleUser; - } - - - //----------------------------------------------------------------------------- - // Purpose: Is this an anonymous account? - //----------------------------------------------------------------------------- - bool BAnonAccount() const - { - return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this an anonymous user account? ( used to create an account or reset a password ) - //----------------------------------------------------------------------------- - bool BAnonUserAccount() const - { - return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this a faked up Steam ID for a PSN friend account? - //----------------------------------------------------------------------------- - bool BConsoleUserAccount() const - { - return m_steamid.m_comp.m_EAccountType == k_EAccountTypeConsoleUser; - } - - // simple accessors - void SetAccountID( uint32 unAccountID ) { m_steamid.m_comp.m_unAccountID = unAccountID; } - void SetAccountInstance( uint32 unInstance ){ m_steamid.m_comp.m_unAccountInstance = unInstance; } - - AccountID_t GetAccountID() const { return m_steamid.m_comp.m_unAccountID; } - uint32 GetUnAccountInstance() const { return m_steamid.m_comp.m_unAccountInstance; } - EAccountType GetEAccountType() const { return ( EAccountType ) m_steamid.m_comp.m_EAccountType; } - EUniverse GetEUniverse() const { return m_steamid.m_comp.m_EUniverse; } - void SetEUniverse( EUniverse eUniverse ) { m_steamid.m_comp.m_EUniverse = eUniverse; } - bool IsValid() const; - - // this set of functions is hidden, will be moved out of class - explicit CSteamID( const char *pchSteamID, EUniverse eDefaultUniverse = k_EUniverseInvalid ); - const char * Render() const; // renders this steam ID to string - static const char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string - - void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse ); - // SetFromString allows many partially-correct strings, constraining how - // we might be able to change things in the future. - // SetFromStringStrict requires the exact string forms that we support - // and is preferred when the caller knows it's safe to be strict. - // Returns whether the string parsed correctly. - bool SetFromStringStrict( const char *pchSteamID, EUniverse eDefaultUniverse ); - - inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; } - inline bool operator!=( const CSteamID &val ) const { return !operator==( val ); } - inline bool operator<( const CSteamID &val ) const { return m_steamid.m_unAll64Bits < val.m_steamid.m_unAll64Bits; } - inline bool operator>( const CSteamID &val ) const { return m_steamid.m_unAll64Bits > val.m_steamid.m_unAll64Bits; } - - // DEBUG function - bool BValidExternalSteamID() const; - -private: - // These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID. - // If you get a compiler error about an ambiguous constructor/function then it may be because you're - // passing a 32-bit int to a function that takes a CSteamID. You should explicitly create the SteamID - // using the correct Universe and account Type/Instance values. - CSteamID( uint32 ); - CSteamID( int32 ); - - // 64 bits total - union SteamID_t - { - struct SteamIDComponent_t - { -#ifdef VALVE_BIG_ENDIAN - EUniverse m_EUniverse : 8; // universe this account belongs to - unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference - unsigned int m_unAccountInstance : 20; // dynamic instance ID - uint32 m_unAccountID : 32; // unique account identifier -#else - uint32 m_unAccountID : 32; // unique account identifier - unsigned int m_unAccountInstance : 20; // dynamic instance ID - unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference - EUniverse m_EUniverse : 8; // universe this account belongs to -#endif - } m_comp; - - uint64 m_unAll64Bits; - } m_steamid; -}; - -inline bool CSteamID::IsValid() const -{ - if ( m_steamid.m_comp.m_EAccountType <= k_EAccountTypeInvalid || m_steamid.m_comp.m_EAccountType >= k_EAccountTypeMax ) - return false; - - if ( m_steamid.m_comp.m_EUniverse <= k_EUniverseInvalid || m_steamid.m_comp.m_EUniverse >= k_EUniverseMax ) - return false; - - if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual ) - { - if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != k_unSteamUserDefaultInstance ) - return false; - } - - if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan ) - { - if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != 0 ) - return false; - } - - if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer ) - { - if ( m_steamid.m_comp.m_unAccountID == 0 ) - return false; - // Any limit on instances? We use them for local users and bots - } - return true; -} - -#if defined( INCLUDED_STEAM2_USERID_STRUCTS ) - -//----------------------------------------------------------------------------- -// Purpose: Initializes a steam ID from a Steam2 ID structure -// Input: pTSteamGlobalUserID - Steam2 ID to convert -// eUniverse - universe this ID belongs to -//----------------------------------------------------------------------------- -inline CSteamID SteamIDFromSteam2UserID( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse ) -{ - uint32 unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 + - pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits; - - return CSteamID( unAccountID, k_unSteamUserDefaultInstance, eUniverse, k_EAccountTypeIndividual ); -} - -bool SteamIDFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse, CSteamID *pSteamIDOut ); - -//----------------------------------------------------------------------------- -// Purpose: Fills out a Steam2 ID structure -// Input: pTSteamGlobalUserID - Steam2 ID to write to -//----------------------------------------------------------------------------- -inline TSteamGlobalUserID SteamIDToSteam2UserID( CSteamID steamID ) -{ - TSteamGlobalUserID steamGlobalUserID; - - steamGlobalUserID.m_SteamInstanceID = 0; - steamGlobalUserID.m_SteamLocalUserID.Split.High32bits = steamID.GetAccountID() % 2; - steamGlobalUserID.m_SteamLocalUserID.Split.Low32bits = steamID.GetAccountID() / 2; - - return steamGlobalUserID; -} - - -#endif - -// generic invalid CSteamID -#define k_steamIDNil CSteamID() - -// This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol -// to provide its steamID -#define k_steamIDOutofDateGS CSteamID( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ) -// This steamID comes from a user game connection to an sv_lan GS -#define k_steamIDLanModeGS CSteamID( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid ) -// This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized -// its steam3 component and started logging on. -#define k_steamIDNotInitYetGS CSteamID( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ) -// This steamID can come from a user game connection to a GS that isn't using the steam authentication system but still -// wants to support the "Join Game" option in the friends list -#define k_steamIDNonSteamGS CSteamID( 2, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ) - - -#ifdef STEAM -// Returns the matching chat steamID, with the default instance of 0 -// If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance -CSteamID ChatIDFromSteamID( const CSteamID &steamID ); -// Returns the matching clan steamID, with the default instance of 0 -// If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance -CSteamID ClanIDFromSteamID( const CSteamID &steamID ); -// Asserts steamID type before conversion -CSteamID ChatIDFromClanID( const CSteamID &steamIDClan ); -// Asserts steamID type before conversion -CSteamID ClanIDFromChatID( const CSteamID &steamIDChat ); - -#endif // _STEAM - - -//----------------------------------------------------------------------------- -// Purpose: encapsulates an appID/modID pair -//----------------------------------------------------------------------------- -class CGameID -{ -public: - - enum EGameIDType - { - k_EGameIDTypeApp = 0, - k_EGameIDTypeGameMod = 1, - k_EGameIDTypeShortcut = 2, - k_EGameIDTypeP2P = 3, - }; - - CGameID() - { - m_gameID.m_nType = k_EGameIDTypeApp; - m_gameID.m_nAppID = k_uAppIdInvalid; - m_gameID.m_nModID = 0; - } - - explicit CGameID( uint64 ulGameID ) - { - m_ulGameID = ulGameID; - } -#ifdef INT64_DIFFERENT_FROM_INT64_T - CGameID( uint64_t ulGameID ) - { - m_ulGameID = (uint64)ulGameID; - } -#endif - - explicit CGameID( int32 nAppID ) - { - m_ulGameID = 0; - m_gameID.m_nAppID = nAppID; - } - - explicit CGameID( uint32 nAppID ) - { - m_ulGameID = 0; - m_gameID.m_nAppID = nAppID; - } - - // Not validating anything .. use IsValid() - explicit CGameID( uint32 nAppID, uint32 nModID, CGameID::EGameIDType nType ) - { - m_gameID.m_nAppID = nAppID; - m_gameID.m_nModID = nModID; - m_gameID.m_nType = nType; - } - - CGameID( const CGameID &that ) - { - m_ulGameID = that.m_ulGameID; - } - - CGameID& operator=( const CGameID & that ) - { - m_ulGameID = that.m_ulGameID; - return *this; - } - - // Hidden functions used only by Steam - explicit CGameID( const char *pchGameID ); - const char *Render() const; // render this Game ID to string - static const char *Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string - - uint64 ToUint64() const - { - return m_ulGameID; - } - - uint64 *GetUint64Ptr() - { - return &m_ulGameID; - } - - void Set( uint64 ulGameID ) - { - m_ulGameID = ulGameID; - } - - bool IsMod() const - { - return ( m_gameID.m_nType == k_EGameIDTypeGameMod ); - } - - bool IsShortcut() const - { - return ( m_gameID.m_nType == k_EGameIDTypeShortcut ); - } - - bool IsP2PFile() const - { - return ( m_gameID.m_nType == k_EGameIDTypeP2P ); - } - - bool IsSteamApp() const - { - return ( m_gameID.m_nType == k_EGameIDTypeApp ); - } - - uint32 ModID() const - { - return m_gameID.m_nModID; - } - -#if !defined(VALVE_SHORTCUT_DEBUG) - uint32 AppID( bool = false ) const - { - return m_gameID.m_nAppID; - } -#else - uint32 AppID( bool bShortcutOK = false ) const; -#endif - - bool operator == ( const CGameID &rhs ) const - { - return m_ulGameID == rhs.m_ulGameID; - } - - bool operator != ( const CGameID &rhs ) const - { - return !(*this == rhs); - } - - bool operator < ( const CGameID &rhs ) const - { - return ( m_ulGameID < rhs.m_ulGameID ); - } - - bool IsValid() const - { - // each type has it's own invalid fixed point: - switch( m_gameID.m_nType ) - { - case k_EGameIDTypeApp: - return m_gameID.m_nAppID != k_uAppIdInvalid; - - case k_EGameIDTypeGameMod: - return m_gameID.m_nAppID != k_uAppIdInvalid && (m_gameID.m_nModID & 0x80000000); - - case k_EGameIDTypeShortcut: - return m_gameID.m_nAppID == k_uAppIdInvalid - && (m_gameID.m_nModID & 0x80000000) - && m_gameID.m_nModID >= (5000 | 0x80000000); // k_unMaxExpectedLocalAppId - shortcuts are pushed beyond that range - - case k_EGameIDTypeP2P: - return m_gameID.m_nAppID == k_uAppIdInvalid && (m_gameID.m_nModID & 0x80000000); - - default: - return false; - } - - } - - void Reset() - { - m_ulGameID = 0; - } - -// -// Internal stuff. Use the accessors above if possible -// - - struct GameID_t - { -#ifdef VALVE_BIG_ENDIAN - unsigned int m_nModID : 32; - unsigned int m_nType : 8; - unsigned int m_nAppID : 24; -#else - unsigned int m_nAppID : 24; - unsigned int m_nType : 8; - unsigned int m_nModID : 32; -#endif - }; - - union - { - uint64 m_ulGameID; - GameID_t m_gameID; - }; - - friend CGameID GameIDFromAppAndModPath( uint32 nAppID, const char *pchModPath ); -}; - -#pragma pack( pop ) - -const int k_cchGameExtraInfoMax = 64; - - -//----------------------------------------------------------------------------- -// Purpose: Passed as argument to SteamAPI_UseBreakpadCrashHandler to enable optional callback -// just before minidump file is captured after a crash has occurred. (Allows app to append additional comment data to the dump, etc.) -//----------------------------------------------------------------------------- -typedef void (*PFNPreMinidumpCallback)(void *context); - -enum EGameSearchErrorCode_t -{ - k_EGameSearchErrorCode_OK = 1, - k_EGameSearchErrorCode_Failed_Search_Already_In_Progress = 2, - k_EGameSearchErrorCode_Failed_No_Search_In_Progress = 3, - k_EGameSearchErrorCode_Failed_Not_Lobby_Leader = 4, // if not the lobby leader can not call SearchForGameWithLobby - k_EGameSearchErrorCode_Failed_No_Host_Available = 5, // no host is available that matches those search params - k_EGameSearchErrorCode_Failed_Search_Params_Invalid = 6, // search params are invalid - k_EGameSearchErrorCode_Failed_Offline = 7, // offline, could not communicate with server - k_EGameSearchErrorCode_Failed_NotAuthorized = 8, // either the user or the application does not have priveledges to do this - k_EGameSearchErrorCode_Failed_Unknown_Error = 9, // unknown error -}; - -enum EPlayerResult_t -{ - k_EPlayerResultFailedToConnect = 1, // failed to connect after confirming - k_EPlayerResultAbandoned = 2, // quit game without completing it - k_EPlayerResultKicked = 3, // kicked by other players/moderator/server rules - k_EPlayerResultIncomplete = 4, // player stayed to end but game did not conclude successfully ( nofault to player ) - k_EPlayerResultCompleted = 5, // player completed game -}; - - -enum ESteamIPv6ConnectivityProtocol -{ - k_ESteamIPv6ConnectivityProtocol_Invalid = 0, - k_ESteamIPv6ConnectivityProtocol_HTTP = 1, // because a proxy may make this different than other protocols - k_ESteamIPv6ConnectivityProtocol_UDP = 2, // test UDP connectivity. Uses a port that is commonly needed for other Steam stuff. If UDP works, TCP probably works. -}; - -// For the above transport protocol, what do we think the local machine's connectivity to the internet over ipv6 is like -enum ESteamIPv6ConnectivityState -{ - k_ESteamIPv6ConnectivityState_Unknown = 0, // We haven't run a test yet - k_ESteamIPv6ConnectivityState_Good = 1, // We have recently been able to make a request on ipv6 for the given protocol - k_ESteamIPv6ConnectivityState_Bad = 2, // We failed to make a request, either because this machine has no ipv6 address assigned, or it has no upstream connectivity -}; - - -// Define compile time assert macros to let us validate the structure sizes. -#define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1]; - -#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) -// The 32-bit version of gcc has the alignment requirement for uint64 and double set to -// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned. -// The 64-bit version of gcc has the alignment requirement for these types set to -// 8 meaning that unless we use #pragma pack(4) our structures will get bigger. -// The 64-bit structure packing has to match the 32-bit structure packing for each platform. -#define VALVE_CALLBACK_PACK_SMALL -#else -#define VALVE_CALLBACK_PACK_LARGE -#endif - -#if defined( VALVE_CALLBACK_PACK_SMALL ) -#pragma pack( push, 4 ) -#elif defined( VALVE_CALLBACK_PACK_LARGE ) -#pragma pack( push, 8 ) -#else -#error ??? -#endif - -typedef struct ValvePackingSentinel_t -{ - uint32 m_u32; - uint64 m_u64; - uint16 m_u16; - double m_d; -} ValvePackingSentinel_t; - -#pragma pack( pop ) - - -#if defined(VALVE_CALLBACK_PACK_SMALL) -VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 24 ) -#elif defined(VALVE_CALLBACK_PACK_LARGE) -VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 32 ) -#else -#error ??? -#endif - -#endif // STEAMCLIENTPUBLIC_H diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingcustomsignaling.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingcustomsignaling.h deleted file mode 100644 index 00ff8f3c4d5..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingcustomsignaling.h +++ /dev/null @@ -1,108 +0,0 @@ -//====== Copyright Valve Corporation, All rights reserved. ==================== -// -// Interfaces needed to implement your own P2P signaling service. If you -// aren't using P2P connections, or you can use the default service provided -// by the platform (e.g. a typical Steam game), then you don't need anything -// in this file. -// -//============================================================================= - -#ifndef STEAMNETWORKINGCUSTOMSIGNALING -#define STEAMNETWORKINGCUSTOMSIGNALING -#pragma once - -#include "steamnetworkingtypes.h" - -class ISteamNetworkingSockets; - -/// Interface used to send signaling messages for a particular connection. -/// -/// - For connections initiated locally, you will construct it and pass -/// it to ISteamNetworkingSockets::ConnectP2PCustomSignaling. -/// - For connections initiated remotely and "accepted" locally, you -/// will return it from ISteamNetworkingSignalingRecvContext::OnConnectRequest -class ISteamNetworkingConnectionSignaling -{ -public: - /// Called to send a rendezvous message to the remote peer. This may be called - /// from any thread, at any time, so you need to be thread-safe! Don't take - /// any locks that might hold while calling into SteamNetworkingSockets functions, - /// because this could lead to deadlocks. - /// - /// Note that when initiating a connection, we may not know the identity - /// of the peer, if you did not specify it in ConnectP2PCustomSignaling. - /// - /// Return true if a best-effort attempt was made to deliver the message. - /// If you return false, it is assumed that the situation is fatal; - /// the connection will be closed, and Release() will be called - /// eventually. - /// - /// Signaling objects will not be shared between connections. - /// You can assume that the same value of hConn will be used - /// every time. - virtual bool SendSignal( HSteamNetConnection hConn, const SteamNetConnectionInfo_t &info, const void *pMsg, int cbMsg ) = 0; - - /// Called when the connection no longer needs to send signals. - /// Note that this happens eventually (but not immediately) after - /// the connection is closed. Signals may need to be sent for a brief - /// time after the connection is closed, to clean up the connection. - /// - /// If you do not need to save any additional per-connection information - /// and can handle SendSignal() using only the arguments supplied, you do - /// not need to actually create different objects per connection. In that - /// case, it is valid for all connections to use the same global object, and - /// for this function to do nothing. - virtual void Release() = 0; -}; - -/// Interface used when a custom signal is received. -/// See ISteamNetworkingSockets::ReceivedP2PCustomSignal -class ISteamNetworkingSignalingRecvContext -{ -public: - - /// Called when the signal represents a request for a new connection. - /// - /// If you want to ignore the request, just return NULL. In this case, - /// the peer will NOT receive any reply. You should consider ignoring - /// requests rather than actively rejecting them, as a security measure. - /// If you actively reject requests, then this makes it possible to detect - /// if a user is online or not, just by sending them a request. - /// - /// If you wish to send back a rejection, then use - /// ISteamNetworkingSockets::CloseConnection() and then return NULL. - /// We will marshal a properly formatted rejection signal and - /// call SendRejectionSignal() so you can send it to them. - /// - /// If you return a signaling object, the connection is NOT immediately - /// accepted by default. Instead, it stays in the "connecting" state, - /// and the usual callback is posted, and your app can accept the - /// connection using ISteamNetworkingSockets::AcceptConnection. This - /// may be useful so that these sorts of connections can be more similar - /// to your application code as other types of connections accepted on - /// a listen socket. If this is not useful and you want to skip this - /// callback process and immediately accept the connection, call - /// ISteamNetworkingSockets::AcceptConnection before returning the - /// signaling object. - /// - /// After accepting a connection (through either means), the connection - /// will transition into the "finding route" state. - virtual ISteamNetworkingConnectionSignaling *OnConnectRequest( HSteamNetConnection hConn, const SteamNetworkingIdentity &identityPeer, int nLocalVirtualPort ) = 0; - - /// This is called to actively communicate rejection or failure - /// to the incoming message. If you intend to ignore all incoming requests - /// that you do not wish to accept, then it's not strictly necessary to - /// implement this. - virtual void SendRejectionSignal( const SteamNetworkingIdentity &identityPeer, const void *pMsg, int cbMsg ) = 0; -}; - -/// The function signature of the callback used to obtain a signaling object -/// for connections initiated locally. These are used for -/// ISteamNetworkingSockets::ConnectP2P, and when using the -/// ISteamNetworkingMessages interface. To install the callback for all -/// interfaces, do something like this: -/// SteamNetworkingUtils()->SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling, (void*)fnCallback ); -typedef ISteamNetworkingConnectionSignaling * (*FnSteamNetworkingSocketsCreateConnectionSignaling)( ISteamNetworkingSockets *pLocalInterface, const SteamNetworkingIdentity &identityPeer, int nLocalVirtualPort, int nRemoteVirtualPort ); - -#endif // STEAMNETWORKINGCUSTOMSIGNALING - diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingsockets.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingsockets.h deleted file mode 100644 index 62ec17e18ad..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingsockets.h +++ /dev/null @@ -1,51 +0,0 @@ -//====== Copyright Valve Corporation, All rights reserved. ==================== -// -// High level interface to GameNetworkingSockets library. -// -//============================================================================= - -#ifndef STEAMNETWORKINGSOCKETS_H -#define STEAMNETWORKINGSOCKETS_H -#ifdef _WIN32 -#pragma once -#endif - -#include "isteamnetworkingsockets.h" - -extern "C" { - -// Initialize the library. Optionally, you can set an initial identity for the default -// interface that is returned by SteamNetworkingSockets(). -// -// On failure, false is returned, and a non-localized diagnostic message is returned. -STEAMNETWORKINGSOCKETS_INTERFACE bool GameNetworkingSockets_Init( const SteamNetworkingIdentity *pIdentity, SteamNetworkingErrMsg &errMsg ); - -// Close all connections and listen sockets and free all resources -STEAMNETWORKINGSOCKETS_INTERFACE void GameNetworkingSockets_Kill(); - -/// Custom memory allocation methods. If you call this, you MUST call it exactly once, -/// before calling any other API function. *Most* allocations will pass through these, -/// especially all allocations that are per-connection. A few allocations -/// might still go to the default CRT malloc and operator new. -/// To use this, you must compile the library with STEAMNETWORKINGSOCKETS_ENABLE_MEM_OVERRIDE -STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingSockets_SetCustomMemoryAllocator( - void* (*pfn_malloc)( size_t s ), - void (*pfn_free)( void *p ), - void* (*pfn_realloc)( void *p, size_t s ) -); - - -// -// Statistics about the global lock. -// -STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingSockets_SetLockWaitWarningThreshold( SteamNetworkingMicroseconds usecThreshold ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingSockets_SetLockAcquiredCallback( void (*callback)( const char *tags, SteamNetworkingMicroseconds usecWaited ) ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingSockets_SetLockHeldCallback( void (*callback)( const char *tags, SteamNetworkingMicroseconds usecWaited ) ); - -/// Called from the service thread at initialization time. -/// Use this to customize its priority / affinity, etc -STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingSockets_SetServiceThreadInitCallback( void (*callback)() ); - -} - -#endif // STEAMNETWORKINGSOCKETS_H diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingsockets_flat.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingsockets_flat.h deleted file mode 100644 index 3e326373a91..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingsockets_flat.h +++ /dev/null @@ -1,168 +0,0 @@ -//====== Copyright Valve Corporation, All rights reserved. ==================== -// -// "Flat" interface to SteamNetworkingSockets. -// -// Designed to match the auto-generated flat interface in the Steamworks SDK -// (for better or worse...) It uses plain C linkage, but it is C++ code, and -// is not intended to compile as C code. -// -//============================================================================= - -#ifndef STEAMNETWORKINGSOCKETS_FLAT -#define STEAMNETWORKINGSOCKETS_FLAT -#pragma once - -#include "steamnetworkingtypes.h" -#include "isteamnetworkingsockets.h" -#include "isteamnetworkingutils.h" -class ISteamNetworkingConnectionSignaling; - -typedef uint64 uint64_steamid; // Used when passing or returning CSteamID - -// ISteamNetworkingSockets -STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamAPI_SteamNetworkingSockets_v009(); -STEAMNETWORKINGSOCKETS_INTERFACE HSteamListenSocket SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP( ISteamNetworkingSockets* self, const SteamNetworkingIPAddr & localAddress, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); -STEAMNETWORKINGSOCKETS_INTERFACE HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectByIPAddress( ISteamNetworkingSockets* self, const SteamNetworkingIPAddr & address, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); -STEAMNETWORKINGSOCKETS_INTERFACE HSteamListenSocket SteamAPI_ISteamNetworkingSockets_CreateListenSocketP2P( ISteamNetworkingSockets* self, int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); -STEAMNETWORKINGSOCKETS_INTERFACE HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2P( ISteamNetworkingSockets* self, const SteamNetworkingIdentity & identityRemote, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); -STEAMNETWORKINGSOCKETS_INTERFACE EResult SteamAPI_ISteamNetworkingSockets_AcceptConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_CloseConnection( ISteamNetworkingSockets* self, HSteamNetConnection hPeer, int nReason, const char * pszDebug, bool bEnableLinger ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_CloseListenSocket( ISteamNetworkingSockets* self, HSteamListenSocket hSocket ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_SetConnectionUserData( ISteamNetworkingSockets* self, HSteamNetConnection hPeer, int64 nUserData ); -STEAMNETWORKINGSOCKETS_INTERFACE int64 SteamAPI_ISteamNetworkingSockets_GetConnectionUserData( ISteamNetworkingSockets* self, HSteamNetConnection hPeer ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_ISteamNetworkingSockets_SetConnectionName( ISteamNetworkingSockets* self, HSteamNetConnection hPeer, const char * pszName ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_GetConnectionName( ISteamNetworkingSockets* self, HSteamNetConnection hPeer, char * pszName, int nMaxLen ); -STEAMNETWORKINGSOCKETS_INTERFACE EResult SteamAPI_ISteamNetworkingSockets_SendMessageToConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn, const void * pData, uint32 cbData, int nSendFlags, int64 * pOutMessageNumber ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_ISteamNetworkingSockets_SendMessages( ISteamNetworkingSockets* self, int nMessages, SteamNetworkingMessage_t *const * pMessages, int64 * pOutMessageNumberOrResult ); -STEAMNETWORKINGSOCKETS_INTERFACE EResult SteamAPI_ISteamNetworkingSockets_FlushMessagesOnConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn ); -STEAMNETWORKINGSOCKETS_INTERFACE int SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetworkingMessage_t ** ppOutMessages, int nMaxMessages ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_GetConnectionInfo( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetConnectionInfo_t * pInfo ); -STEAMNETWORKINGSOCKETS_INTERFACE EResult SteamAPI_ISteamNetworkingSockets_GetConnectionRealTimeStatus( ISteamNetworkingSockets *self, HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStats, int nLanes, SteamNetConnectionRealTimeLaneStatus_t *pLanes ); -STEAMNETWORKINGSOCKETS_INTERFACE int SteamAPI_ISteamNetworkingSockets_GetDetailedConnectionStatus( ISteamNetworkingSockets* self, HSteamNetConnection hConn, char * pszBuf, int cbBuf ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_GetListenSocketAddress( ISteamNetworkingSockets* self, HSteamListenSocket hSocket, SteamNetworkingIPAddr * address ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_CreateSocketPair( ISteamNetworkingSockets* self, HSteamNetConnection * pOutConnection1, HSteamNetConnection * pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity * pIdentity1, const SteamNetworkingIdentity * pIdentity2 ); -STEAMNETWORKINGSOCKETS_INTERFACE EResult SteamAPI_ISteamNetworkingSockets_ConfigureConnectionLanes(ISteamNetworkingSockets *self, HSteamNetConnection hConn, int nNumLanes, const int *pLanePriorities, const uint16 *pLaneWeights ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_GetIdentity( ISteamNetworkingSockets* self, SteamNetworkingIdentity * pIdentity ); -STEAMNETWORKINGSOCKETS_INTERFACE ESteamNetworkingAvailability SteamAPI_ISteamNetworkingSockets_InitAuthentication( ISteamNetworkingSockets* self ); -STEAMNETWORKINGSOCKETS_INTERFACE ESteamNetworkingAvailability SteamAPI_ISteamNetworkingSockets_GetAuthenticationStatus( ISteamNetworkingSockets* self, SteamNetAuthenticationStatus_t * pDetails ); -STEAMNETWORKINGSOCKETS_INTERFACE HSteamNetPollGroup SteamAPI_ISteamNetworkingSockets_CreatePollGroup( ISteamNetworkingSockets* self ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_DestroyPollGroup( ISteamNetworkingSockets* self, HSteamNetPollGroup hPollGroup ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_SetConnectionPollGroup( ISteamNetworkingSockets* self, HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup ); -STEAMNETWORKINGSOCKETS_INTERFACE int SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnPollGroup( ISteamNetworkingSockets* self, HSteamNetPollGroup hPollGroup, SteamNetworkingMessage_t ** ppOutMessages, int nMaxMessages ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_ReceivedRelayAuthTicket( ISteamNetworkingSockets* self, const void * pvTicket, int cbTicket, SteamDatagramRelayAuthTicket * pOutParsedTicket ); -STEAMNETWORKINGSOCKETS_INTERFACE int SteamAPI_ISteamNetworkingSockets_FindRelayAuthTicketForServer( ISteamNetworkingSockets* self, const SteamNetworkingIdentity & identityGameServer, int nRemoteVirtualPort, SteamDatagramRelayAuthTicket * pOutParsedTicket ); -STEAMNETWORKINGSOCKETS_INTERFACE HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectToHostedDedicatedServer( ISteamNetworkingSockets* self, const SteamNetworkingIdentity & identityTarget, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); -STEAMNETWORKINGSOCKETS_INTERFACE uint16 SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerPort( ISteamNetworkingSockets* self ); -STEAMNETWORKINGSOCKETS_INTERFACE SteamNetworkingPOPID SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerPOPID( ISteamNetworkingSockets* self ); -STEAMNETWORKINGSOCKETS_INTERFACE EResult SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerAddress( ISteamNetworkingSockets* self, SteamDatagramHostedAddress * pRouting ); -STEAMNETWORKINGSOCKETS_INTERFACE HSteamListenSocket SteamAPI_ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket( ISteamNetworkingSockets* self, int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); -STEAMNETWORKINGSOCKETS_INTERFACE EResult SteamAPI_ISteamNetworkingSockets_GetGameCoordinatorServerLogin( ISteamNetworkingSockets* self, SteamDatagramGameCoordinatorServerLogin * pLoginInfo, int * pcbSignedBlob, void * pBlob ); -STEAMNETWORKINGSOCKETS_INTERFACE HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling( ISteamNetworkingSockets* self, ISteamNetworkingConnectionSignaling * pSignaling, const SteamNetworkingIdentity * pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal( ISteamNetworkingSockets* self, const void * pMsg, int cbMsg, ISteamNetworkingSignalingRecvContext * pContext ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_GetCertificateRequest( ISteamNetworkingSockets* self, int * pcbBlob, void * pBlob, SteamNetworkingErrMsg & errMsg ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_SetCertificate( ISteamNetworkingSockets* self, const void * pCertificate, int cbCertificate, SteamNetworkingErrMsg & errMsg ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_ISteamNetworkingSockets_RunCallbacks( ISteamNetworkingSockets* self ); - -// ISteamNetworkingUtils -STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingUtils *SteamAPI_SteamNetworkingUtils_v003(); -STEAMNETWORKINGSOCKETS_INTERFACE SteamNetworkingMessage_t * SteamAPI_ISteamNetworkingUtils_AllocateMessage( ISteamNetworkingUtils* self, int cbAllocateBuffer ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_ISteamNetworkingUtils_InitRelayNetworkAccess( ISteamNetworkingUtils* self ); -STEAMNETWORKINGSOCKETS_INTERFACE ESteamNetworkingAvailability SteamAPI_ISteamNetworkingUtils_GetRelayNetworkStatus( ISteamNetworkingUtils* self, SteamRelayNetworkStatus_t * pDetails ); -STEAMNETWORKINGSOCKETS_INTERFACE float SteamAPI_ISteamNetworkingUtils_GetLocalPingLocation( ISteamNetworkingUtils* self, SteamNetworkPingLocation_t & result ); -STEAMNETWORKINGSOCKETS_INTERFACE int SteamAPI_ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations( ISteamNetworkingUtils* self, const SteamNetworkPingLocation_t & location1, const SteamNetworkPingLocation_t & location2 ); -STEAMNETWORKINGSOCKETS_INTERFACE int SteamAPI_ISteamNetworkingUtils_EstimatePingTimeFromLocalHost( ISteamNetworkingUtils* self, const SteamNetworkPingLocation_t & remoteLocation ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_ISteamNetworkingUtils_ConvertPingLocationToString( ISteamNetworkingUtils* self, const SteamNetworkPingLocation_t & location, char * pszBuf, int cchBufSize ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_ParsePingLocationString( ISteamNetworkingUtils* self, const char * pszString, SteamNetworkPingLocation_t & result ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_CheckPingDataUpToDate( ISteamNetworkingUtils* self, float flMaxAgeSeconds ); -STEAMNETWORKINGSOCKETS_INTERFACE int SteamAPI_ISteamNetworkingUtils_GetPingToDataCenter( ISteamNetworkingUtils* self, SteamNetworkingPOPID popID, SteamNetworkingPOPID * pViaRelayPoP ); -STEAMNETWORKINGSOCKETS_INTERFACE int SteamAPI_ISteamNetworkingUtils_GetDirectPingToPOP( ISteamNetworkingUtils* self, SteamNetworkingPOPID popID ); -STEAMNETWORKINGSOCKETS_INTERFACE int SteamAPI_ISteamNetworkingUtils_GetPOPCount( ISteamNetworkingUtils* self ); -STEAMNETWORKINGSOCKETS_INTERFACE int SteamAPI_ISteamNetworkingUtils_GetPOPList( ISteamNetworkingUtils* self, SteamNetworkingPOPID * list, int nListSz ); -STEAMNETWORKINGSOCKETS_INTERFACE SteamNetworkingMicroseconds SteamAPI_ISteamNetworkingUtils_GetLocalTimestamp( ISteamNetworkingUtils* self ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_ISteamNetworkingUtils_SetDebugOutputFunction( ISteamNetworkingUtils* self, ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueInt32( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, int32 val ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueFloat( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, float val ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueString( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, const char * val ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValuePtr( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, void * val ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueInt32( ISteamNetworkingUtils* self, HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueFloat( ISteamNetworkingUtils* self, HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueString( ISteamNetworkingUtils* self, HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char * val ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamNetConnectionStatusChanged( ISteamNetworkingUtils* self, FnSteamNetConnectionStatusChanged fnCallback ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamNetAuthenticationStatusChanged( ISteamNetworkingUtils* self, FnSteamNetAuthenticationStatusChanged fnCallback ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamRelayNetworkStatusChanged( ISteamNetworkingUtils* self, FnSteamRelayNetworkStatusChanged fnCallback ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetConfigValue( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, ESteamNetworkingConfigDataType eDataType, const void * pArg ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SetConfigValueStruct( ISteamNetworkingUtils* self, const SteamNetworkingConfigValue_t & opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj ); -STEAMNETWORKINGSOCKETS_INTERFACE ESteamNetworkingGetConfigValueResult SteamAPI_ISteamNetworkingUtils_GetConfigValue( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, ESteamNetworkingConfigDataType * pOutDataType, void * pResult, size_t * cbResult ); -STEAMNETWORKINGSOCKETS_INTERFACE const char * SteamAPI_ISteamNetworkingUtils_GetConfigValueInfo( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigDataType * pOutDataType, ESteamNetworkingConfigScope * pOutScope ); -STEAMNETWORKINGSOCKETS_INTERFACE ESteamNetworkingConfigValue SteamAPI_ISteamNetworkingUtils_IterateGenericEditableConfigValues( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars ); - -// SteamNetworkingIPAddr -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_Clear( SteamNetworkingIPAddr* self ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_IsIPv6AllZeros( SteamNetworkingIPAddr* self ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_SetIPv6( SteamNetworkingIPAddr* self, const uint8 * ipv6, uint16 nPort ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_SetIPv4( SteamNetworkingIPAddr* self, uint32 nIP, uint16 nPort ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_IsIPv4( SteamNetworkingIPAddr* self ); -STEAMNETWORKINGSOCKETS_INTERFACE uint32 SteamAPI_SteamNetworkingIPAddr_GetIPv4( SteamNetworkingIPAddr* self ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_SetIPv6LocalHost( SteamNetworkingIPAddr* self, uint16 nPort ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_IsLocalHost( SteamNetworkingIPAddr* self ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_IsEqualTo( SteamNetworkingIPAddr* self, const SteamNetworkingIPAddr & x ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr* self, char *buf, size_t cbBuf, bool bWithPort ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr* self, const char *pszStr ); - -// SteamNetworkingIdentity -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_Clear( SteamNetworkingIdentity* self ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIdentity_IsInvalid( SteamNetworkingIdentity* self ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_SetSteamID( SteamNetworkingIdentity* self, uint64_steamid steamID ); -STEAMNETWORKINGSOCKETS_INTERFACE uint64_steamid SteamAPI_SteamNetworkingIdentity_GetSteamID( SteamNetworkingIdentity* self ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_SetSteamID64( SteamNetworkingIdentity* self, uint64 steamID ); -STEAMNETWORKINGSOCKETS_INTERFACE uint64 SteamAPI_SteamNetworkingIdentity_GetSteamID64( SteamNetworkingIdentity* self ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIdentity_SetXboxPairwiseID( SteamNetworkingIdentity* self, const char * pszString ); -STEAMNETWORKINGSOCKETS_INTERFACE const char * SteamAPI_SteamNetworkingIdentity_GetXboxPairwiseID( SteamNetworkingIdentity* self ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_SetIPAddr( SteamNetworkingIdentity* self, const SteamNetworkingIPAddr & addr ); -STEAMNETWORKINGSOCKETS_INTERFACE const SteamNetworkingIPAddr * SteamAPI_SteamNetworkingIdentity_GetIPAddr( SteamNetworkingIdentity* self ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_SetLocalHost( SteamNetworkingIdentity* self ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIdentity_IsLocalHost( SteamNetworkingIdentity* self ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIdentity_SetGenericString( SteamNetworkingIdentity* self, const char * pszString ); -STEAMNETWORKINGSOCKETS_INTERFACE const char * SteamAPI_SteamNetworkingIdentity_GetGenericString( SteamNetworkingIdentity* self ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIdentity_SetGenericBytes( SteamNetworkingIdentity* self, const void * data, uint32 cbLen ); -STEAMNETWORKINGSOCKETS_INTERFACE const uint8 * SteamAPI_SteamNetworkingIdentity_GetGenericBytes( SteamNetworkingIdentity* self, int & cbLen ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIdentity_IsEqualTo( SteamNetworkingIdentity* self, const SteamNetworkingIdentity & x ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity* self, char *buf, size_t cbBuf ); -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity* self, size_t sizeofIdentity, const char *pszStr ); - -// SteamNetworkingMessage_t -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingMessage_t_Release( SteamNetworkingMessage_t* self ); - -// SteamDatagramHostedAddress -#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamDatagramHostedAddress_Clear( SteamDatagramHostedAddress* self ); -STEAMNETWORKINGSOCKETS_INTERFACE SteamNetworkingPOPID SteamAPI_SteamDatagramHostedAddress_GetPopID( SteamDatagramHostedAddress* self ); -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamDatagramHostedAddress_SetDevAddress( SteamDatagramHostedAddress* self, uint32 nIP, uint16 nPort, SteamNetworkingPOPID popid ); -#endif - -// -// Special flat functions to make it easier to work with custom signaling -// - -typedef bool (*FSteamNetworkingSocketsCustomSignaling_SendSignal)( void *ctx, HSteamNetConnection hConn, const SteamNetConnectionInfo_t &info, const void *pMsg, int cbMsg ); -typedef void (*FSteamNetworkingSocketsCustomSignaling_Release)( void *ctx ); - -/// Create an ISteamNetworkingConnectionSignaling object from plain C primitives. -STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingConnectionSignaling *SteamAPI_ISteamNetworkingSockets_CreateCustomSignaling( - void *ctx, //< pointer to something useful you understand. Will be passed to your callbacks. - FSteamNetworkingSocketsCustomSignaling_SendSignal fnSendSignal, //< Callback to send a signal. See ISteamNetworkingConnectionSignaling::SendSignal - FSteamNetworkingSocketsCustomSignaling_Release fnRelease //< callback to do any cleanup. See ISteamNetworkingConnectionSignaling::Release. You can pass NULL if you don't need to do any cleanup. -); - -typedef ISteamNetworkingConnectionSignaling * (*FSteamNetworkingCustomSignalingRecvContext_OnConnectRequest)( void *ctx, HSteamNetConnection hConn, const SteamNetworkingIdentity &identityPeer, int nLocalVirtualPort ); -typedef void (*FSteamNetworkingCustomSignalingRecvContext_SendRejectionSignal)( void *ctx, const SteamNetworkingIdentity &identityPeer, const void *pMsg, int cbMsg ); - -/// Same as SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal, but using plain C primitives. -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal2( - ISteamNetworkingSockets* self, const void * pMsg, int cbMsg, //< Same as SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal - void *ctx, //< pointer to something useful you understand. Will be passed to your callbacks. - FSteamNetworkingCustomSignalingRecvContext_OnConnectRequest fnOnConnectRequest, //< callback for sending a signal. Required. See ISteamNetworkingSignalingRecvContext::OnConnectRequest - FSteamNetworkingCustomSignalingRecvContext_SendRejectionSignal fnSendRejectionSignal //< callback when we wish to actively reject the connection. Optional, pass NULL if you don't need this. See ISteamNetworkingSignalingRecvContext::SendRejectionSignal -); - -#endif // STEAMNETWORKINGSOCKETS_FLAT diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingtypes.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingtypes.h deleted file mode 100644 index 448842354d2..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingtypes.h +++ /dev/null @@ -1,1935 +0,0 @@ -//====== Copyright Valve Corporation, All rights reserved. ==================== -// -// Purpose: misc networking utilities -// -//============================================================================= - -#ifndef STEAMNETWORKINGTYPES -#define STEAMNETWORKINGTYPES -#pragma once - -#include -#include -#include "steamtypes.h" -#include "steamclientpublic.h" - -//---------------------------------------- -// SteamNetworkingSockets library config -// Opensource version -// -#ifndef STEAMNETWORKINGSOCKETS_OPENSOURCE -#define STEAMNETWORKINGSOCKETS_OPENSOURCE -#endif -#define STEAMNETWORKINGSOCKETS_STANDALONELIB -//#define STEAMNETWORKINGSOCKETS_STEAMAPI // Comment this in to support linking with steam_api.h as well -// End SteamNetworkingSockets config. -//----------------------------------------------------------------------------- - -#ifdef NN_NINTENDO_SDK // We always static link on Nintendo - #define STEAMNETWORKINGSOCKETS_STATIC_LINK -#endif -#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) - #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" -#elif defined( STEAMNETWORKINGSOCKETS_FOREXPORT ) - #if defined( _WIN32 ) || defined( __ORBIS__ ) || defined( __PROSPERO__ ) - #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __declspec( dllexport ) - #else - #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __attribute__((visibility("default"))) - #endif -#else - #ifdef _WIN32 - #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __declspec( dllimport ) - #else - #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" - #endif -#endif - -#if defined( VALVE_CALLBACK_PACK_SMALL ) -#pragma pack( push, 4 ) -#elif defined( VALVE_CALLBACK_PACK_LARGE ) -#pragma pack( push, 8 ) -#else -#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" -#endif - -struct SteamDatagramRelayAuthTicket; -struct SteamDatagramHostedAddress; -struct SteamDatagramGameCoordinatorServerLogin; -struct SteamNetConnectionStatusChangedCallback_t; -struct SteamNetAuthenticationStatus_t; -struct SteamRelayNetworkStatus_t; -struct SteamNetworkingMessagesSessionRequest_t; -struct SteamNetworkingMessagesSessionFailed_t; -struct SteamNetworkingFakeIPResult_t; - -typedef void (*FnSteamNetConnectionStatusChanged)( SteamNetConnectionStatusChangedCallback_t * ); -typedef void (*FnSteamNetAuthenticationStatusChanged)( SteamNetAuthenticationStatus_t * ); -typedef void (*FnSteamRelayNetworkStatusChanged)(SteamRelayNetworkStatus_t *); -typedef void (*FnSteamNetworkingMessagesSessionRequest)(SteamNetworkingMessagesSessionRequest_t *); -typedef void (*FnSteamNetworkingMessagesSessionFailed)(SteamNetworkingMessagesSessionFailed_t *); -typedef void (*FnSteamNetworkingFakeIPResult)(SteamNetworkingFakeIPResult_t *); - -/// Handle used to identify a connection to a remote host. -typedef uint32 HSteamNetConnection; -const HSteamNetConnection k_HSteamNetConnection_Invalid = 0; - -/// Handle used to identify a "listen socket". Unlike traditional -/// Berkeley sockets, a listen socket and a connection are two -/// different abstractions. -typedef uint32 HSteamListenSocket; -const HSteamListenSocket k_HSteamListenSocket_Invalid = 0; - -/// Handle used to identify a poll group, used to query many -/// connections at once efficiently. -typedef uint32 HSteamNetPollGroup; -const HSteamNetPollGroup k_HSteamNetPollGroup_Invalid = 0; - -/// Max length of diagnostic error message -const int k_cchMaxSteamNetworkingErrMsg = 1024; - -/// Used to return English-language diagnostic error messages to caller. -/// (For debugging or spewing to a console, etc. Not intended for UI.) -typedef char SteamNetworkingErrMsg[ k_cchMaxSteamNetworkingErrMsg ]; - -/// Identifier used for a network location point of presence. (E.g. a Valve data center.) -/// Typically you won't need to directly manipulate these. -typedef uint32 SteamNetworkingPOPID; - -/// A local timestamp. You can subtract two timestamps to get the number of elapsed -/// microseconds. This is guaranteed to increase over time during the lifetime -/// of a process, but not globally across runs. You don't need to worry about -/// the value wrapping around. Note that the underlying clock might not actually have -/// microsecond resolution. -typedef int64 SteamNetworkingMicroseconds; - -/// Describe the status of a particular network resource -enum ESteamNetworkingAvailability -{ - // Negative values indicate a problem. - // - // In general, we will not automatically retry unless you take some action that - // depends on of requests this resource, such as querying the status, attempting - // to initiate a connection, receive a connection, etc. If you do not take any - // action at all, we do not automatically retry in the background. - k_ESteamNetworkingAvailability_CannotTry = -102, // A dependent resource is missing, so this service is unavailable. (E.g. we cannot talk to routers because Internet is down or we don't have the network config.) - k_ESteamNetworkingAvailability_Failed = -101, // We have tried for enough time that we would expect to have been successful by now. We have never been successful - k_ESteamNetworkingAvailability_Previously = -100, // We tried and were successful at one time, but now it looks like we have a problem - - k_ESteamNetworkingAvailability_Retrying = -10, // We previously failed and are currently retrying - - // Not a problem, but not ready either - k_ESteamNetworkingAvailability_NeverTried = 1, // We don't know because we haven't ever checked/tried - k_ESteamNetworkingAvailability_Waiting = 2, // We're waiting on a dependent resource to be acquired. (E.g. we cannot obtain a cert until we are logged into Steam. We cannot measure latency to relays until we have the network config.) - k_ESteamNetworkingAvailability_Attempting = 3, // We're actively trying now, but are not yet successful. - - k_ESteamNetworkingAvailability_Current = 100, // Resource is online/available - - - k_ESteamNetworkingAvailability_Unknown = 0, // Internal dummy/sentinel, or value is not applicable in this context - k_ESteamNetworkingAvailability__Force32bit = 0x7fffffff, -}; - -// -// Describing network hosts -// - -/// Different methods of describing the identity of a network host -enum ESteamNetworkingIdentityType -{ - // Dummy/empty/invalid. - // Please note that if we parse a string that we don't recognize - // but that appears reasonable, we will NOT use this type. Instead - // we'll use k_ESteamNetworkingIdentityType_UnknownType. - k_ESteamNetworkingIdentityType_Invalid = 0, - - // - // Basic platform-specific identifiers. - // - k_ESteamNetworkingIdentityType_SteamID = 16, // 64-bit CSteamID - k_ESteamNetworkingIdentityType_XboxPairwiseID = 17, // Publisher-specific user identity, as string - k_ESteamNetworkingIdentityType_SonyPSN = 18, // 64-bit ID - - // - // Special identifiers. - // - - // Use their IP address (and port) as their "identity". - // These types of identities are always unauthenticated. - // They are useful for porting plain sockets code, and other - // situations where you don't care about authentication. In this - // case, the local identity will be "localhost", - // and the remote address will be their network address. - // - // We use the same type for either IPv4 or IPv6, and - // the address is always store as IPv6. We use IPv4 - // mapped addresses to handle IPv4. - k_ESteamNetworkingIdentityType_IPAddress = 1, - - // Generic string/binary blobs. It's up to your app to interpret this. - // This library can tell you if the remote host presented a certificate - // signed by somebody you have chosen to trust, with this identity on it. - // It's up to you to ultimately decide what this identity means. - k_ESteamNetworkingIdentityType_GenericString = 2, - k_ESteamNetworkingIdentityType_GenericBytes = 3, - - // This identity type is used when we parse a string that looks like is a - // valid identity, just of a kind that we don't recognize. In this case, we - // can often still communicate with the peer! Allowing such identities - // for types we do not recognize useful is very useful for forward - // compatibility. - k_ESteamNetworkingIdentityType_UnknownType = 4, - - // Make sure this enum is stored in an int. - k_ESteamNetworkingIdentityType__Force32bit = 0x7fffffff, -}; - -/// "Fake IPs" are assigned to hosts, to make it easier to interface with -/// older code that assumed all hosts will have an IPv4 address -enum ESteamNetworkingFakeIPType -{ - k_ESteamNetworkingFakeIPType_Invalid, // Error, argument was not even an IP address, etc. - k_ESteamNetworkingFakeIPType_NotFake, // Argument was a valid IP, but was not from the reserved "fake" range - k_ESteamNetworkingFakeIPType_GlobalIPv4, // Globally unique (for a given app) IPv4 address. Address space managed by Steam - k_ESteamNetworkingFakeIPType_LocalIPv4, // Locally unique IPv4 address. Address space managed by the local process. For internal use only; should not be shared! - - k_ESteamNetworkingFakeIPType__Force32Bit = 0x7fffffff -}; - -#pragma pack(push,1) - -/// Store an IP and port. IPv6 is always used; IPv4 is represented using -/// "IPv4-mapped" addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd -/// (RFC 4291 section 2.5.5.2.) -struct SteamNetworkingIPAddr -{ - void Clear(); // Set everything to zero. E.g. [::]:0 - bool IsIPv6AllZeros() const; // Return true if the IP is ::0. (Doesn't check port.) - void SetIPv6( const uint8 *ipv6, uint16 nPort ); // Set IPv6 address. IP is interpreted as bytes, so there are no endian issues. (Same as inaddr_in6.) The IP can be a mapped IPv4 address - void SetIPv4( uint32 nIP, uint16 nPort ); // Sets to IPv4 mapped address. IP and port are in host byte order. - bool IsIPv4() const; // Return true if IP is mapped IPv4 - uint32 GetIPv4() const; // Returns IP in host byte order (e.g. aa.bb.cc.dd as 0xaabbccdd). Returns 0 if IP is not mapped IPv4. - void SetIPv6LocalHost( uint16 nPort = 0); // Set to the IPv6 localhost address ::1, and the specified port. - bool IsLocalHost() const; // Return true if this identity is localhost. (Either IPv6 ::1, or IPv4 127.0.0.1) - - // Max length of the buffer needed to hold IP formatted using ToString, including '\0' - // ([0123:4567:89ab:cdef:0123:4567:89ab:cdef]:12345) - enum { k_cchMaxString = 48 }; - - /// Print to a string, with or without the port. Mapped IPv4 addresses are printed - /// as dotted decimal (12.34.56.78), otherwise this will print the canonical - /// form according to RFC5952. If you include the port, IPv6 will be surrounded by - /// brackets, e.g. [::1:2]:80. Your buffer should be at least k_cchMaxString bytes - /// to avoid truncation - /// - /// See also SteamNetworkingIdentityRender - inline void ToString( char *buf, size_t cbBuf, bool bWithPort ) const; - - /// Parse an IP address and optional port. If a port is not present, it is set to 0. - /// (This means that you cannot tell if a zero port was explicitly specified.) - inline bool ParseString( const char *pszStr ); - - /// RFC4038, section 4.2 - struct IPv4MappedAddress { - uint64 m_8zeros; - uint16 m_0000; - uint16 m_ffff; - uint8 m_ip[ 4 ]; // NOTE: As bytes, i.e. network byte order - }; - - union - { - uint8 m_ipv6[ 16 ]; - IPv4MappedAddress m_ipv4; - }; - uint16 m_port; // Host byte order - - /// See if two addresses are identical - bool operator==(const SteamNetworkingIPAddr &x ) const; - - /// Classify address as FakeIP. This function never returns - /// k_ESteamNetworkingFakeIPType_Invalid. - ESteamNetworkingFakeIPType GetFakeIPType() const; - - /// Return true if we are a FakeIP - bool IsFakeIP() const { return GetFakeIPType() > k_ESteamNetworkingFakeIPType_NotFake; } -}; - -/// An abstract way to represent the identity of a network host. All identities can -/// be represented as simple string. Furthermore, this string representation is actually -/// used on the wire in several places, even though it is less efficient, in order to -/// facilitate forward compatibility. (Old client code can handle an identity type that -/// it doesn't understand.) -struct SteamNetworkingIdentity -{ - /// Type of identity. - ESteamNetworkingIdentityType m_eType; - - // - // Get/Set in various formats. - // - - void Clear(); - bool IsInvalid() const; // Return true if we are the invalid type. Does not make any other validity checks (e.g. is SteamID actually valid) - - void SetSteamID( CSteamID steamID ); - CSteamID GetSteamID() const; // Return black CSteamID (!IsValid()) if identity is not a SteamID - void SetSteamID64( uint64 steamID ); // Takes SteamID as raw 64-bit number - uint64 GetSteamID64() const; // Returns 0 if identity is not SteamID - - bool SetXboxPairwiseID( const char *pszString ); // Returns false if invalid length - const char *GetXboxPairwiseID() const; // Returns nullptr if not Xbox ID - - void SetPSNID( uint64 id ); - uint64 GetPSNID() const; // Returns 0 if not PSN - - void SetIPAddr( const SteamNetworkingIPAddr &addr ); // Set to specified IP:port - const SteamNetworkingIPAddr *GetIPAddr() const; // returns null if we are not an IP address. - void SetIPv4Addr( uint32 nIPv4, uint16 nPort ); // Set to specified IPv4:port - uint32 GetIPv4() const; // returns 0 if we are not an IPv4 address. - - ESteamNetworkingFakeIPType GetFakeIPType() const; - bool IsFakeIP() const { return GetFakeIPType() > k_ESteamNetworkingFakeIPType_NotFake; } - - // "localhost" is equivalent for many purposes to "anonymous." Our remote - // will identify us by the network address we use. - void SetLocalHost(); // Set to localhost. (We always use IPv6 ::1 for this, not 127.0.0.1) - bool IsLocalHost() const; // Return true if this identity is localhost. - - bool SetGenericString( const char *pszString ); // Returns false if invalid length - const char *GetGenericString() const; // Returns nullptr if not generic string type - - bool SetGenericBytes( const void *data, size_t cbLen ); // Returns false if invalid size. - const uint8 *GetGenericBytes( int &cbLen ) const; // Returns null if not generic bytes type - - /// See if two identities are identical - bool operator==(const SteamNetworkingIdentity &x ) const; - - /// Print to a human-readable string. This is suitable for debug messages - /// or any other time you need to encode the identity as a string. It has a - /// URL-like format (type:). Your buffer should be at least - /// k_cchMaxString bytes big to avoid truncation. - /// - /// See also SteamNetworkingIPAddrRender - void ToString( char *buf, size_t cbBuf ) const; - - /// Parse back a string that was generated using ToString. If we don't understand the - /// string, but it looks "reasonable" (it matches the pattern type: and doesn't - /// have any funky characters, etc), then we will return true, and the type is set to - /// k_ESteamNetworkingIdentityType_UnknownType. false will only be returned if the string - /// looks invalid. - bool ParseString( const char *pszStr ); - - // Max sizes - enum { - k_cchMaxString = 128, // Max length of the buffer needed to hold any identity, formatted in string format by ToString - k_cchMaxGenericString = 32, // Max length of the string for generic string identities. Including terminating '\0' - k_cchMaxXboxPairwiseID = 33, // Including terminating '\0' - k_cbMaxGenericBytes = 32, - }; - - // - // Internal representation. Don't access this directly, use the accessors! - // - // Number of bytes that are relevant below. This MUST ALWAYS be - // set. (Use the accessors!) This is important to enable old code to work - // with new identity types. - int m_cbSize; - union { - uint64 m_steamID64; - uint64 m_PSNID; - char m_szGenericString[ k_cchMaxGenericString ]; - char m_szXboxPairwiseID[ k_cchMaxXboxPairwiseID ]; - uint8 m_genericBytes[ k_cbMaxGenericBytes ]; - char m_szUnknownRawString[ k_cchMaxString ]; - SteamNetworkingIPAddr m_ip; - uint32 m_reserved[ 32 ]; // Pad structure to leave easy room for future expansion - }; -}; -#pragma pack(pop) - -// -// Connection status -// - -/// High level connection status -enum ESteamNetworkingConnectionState -{ - - /// Dummy value used to indicate an error condition in the API. - /// Specified connection doesn't exist or has already been closed. - k_ESteamNetworkingConnectionState_None = 0, - - /// We are trying to establish whether peers can talk to each other, - /// whether they WANT to talk to each other, perform basic auth, - /// and exchange crypt keys. - /// - /// - For connections on the "client" side (initiated locally): - /// We're in the process of trying to establish a connection. - /// Depending on the connection type, we might not know who they are. - /// Note that it is not possible to tell if we are waiting on the - /// network to complete handshake packets, or for the application layer - /// to accept the connection. - /// - /// - For connections on the "server" side (accepted through listen socket): - /// We have completed some basic handshake and the client has presented - /// some proof of identity. The connection is ready to be accepted - /// using AcceptConnection(). - /// - /// In either case, any unreliable packets sent now are almost certain - /// to be dropped. Attempts to receive packets are guaranteed to fail. - /// You may send messages if the send mode allows for them to be queued. - /// but if you close the connection before the connection is actually - /// established, any queued messages will be discarded immediately. - /// (We will not attempt to flush the queue and confirm delivery to the - /// remote host, which ordinarily happens when a connection is closed.) - k_ESteamNetworkingConnectionState_Connecting = 1, - - /// Some connection types use a back channel or trusted 3rd party - /// for earliest communication. If the server accepts the connection, - /// then these connections switch into the rendezvous state. During this - /// state, we still have not yet established an end-to-end route (through - /// the relay network), and so if you send any messages unreliable, they - /// are going to be discarded. - k_ESteamNetworkingConnectionState_FindingRoute = 2, - - /// We've received communications from our peer (and we know - /// who they are) and are all good. If you close the connection now, - /// we will make our best effort to flush out any reliable sent data that - /// has not been acknowledged by the peer. (But note that this happens - /// from within the application process, so unlike a TCP connection, you are - /// not totally handing it off to the operating system to deal with it.) - k_ESteamNetworkingConnectionState_Connected = 3, - - /// Connection has been closed by our peer, but not closed locally. - /// The connection still exists from an API perspective. You must close the - /// handle to free up resources. If there are any messages in the inbound queue, - /// you may retrieve them. Otherwise, nothing may be done with the connection - /// except to close it. - /// - /// This stats is similar to CLOSE_WAIT in the TCP state machine. - k_ESteamNetworkingConnectionState_ClosedByPeer = 4, - - /// A disruption in the connection has been detected locally. (E.g. timeout, - /// local internet connection disrupted, etc.) - /// - /// The connection still exists from an API perspective. You must close the - /// handle to free up resources. - /// - /// Attempts to send further messages will fail. Any remaining received messages - /// in the queue are available. - k_ESteamNetworkingConnectionState_ProblemDetectedLocally = 5, - -// -// The following values are used internally and will not be returned by any API. -// We document them here to provide a little insight into the state machine that is used -// under the hood. -// - - /// We've disconnected on our side, and from an API perspective the connection is closed. - /// No more data may be sent or received. All reliable data has been flushed, or else - /// we've given up and discarded it. We do not yet know for sure that the peer knows - /// the connection has been closed, however, so we're just hanging around so that if we do - /// get a packet from them, we can send them the appropriate packets so that they can - /// know why the connection was closed (and not have to rely on a timeout, which makes - /// it appear as if something is wrong). - k_ESteamNetworkingConnectionState_FinWait = -1, - - /// We've disconnected on our side, and from an API perspective the connection is closed. - /// No more data may be sent or received. From a network perspective, however, on the wire, - /// we have not yet given any indication to the peer that the connection is closed. - /// We are in the process of flushing out the last bit of reliable data. Once that is done, - /// we will inform the peer that the connection has been closed, and transition to the - /// FinWait state. - /// - /// Note that no indication is given to the remote host that we have closed the connection, - /// until the data has been flushed. If the remote host attempts to send us data, we will - /// do whatever is necessary to keep the connection alive until it can be closed properly. - /// But in fact the data will be discarded, since there is no way for the application to - /// read it back. Typically this is not a problem, as application protocols that utilize - /// the lingering functionality are designed for the remote host to wait for the response - /// before sending any more data. - k_ESteamNetworkingConnectionState_Linger = -2, - - /// Connection is completely inactive and ready to be destroyed - k_ESteamNetworkingConnectionState_Dead = -3, - - k_ESteamNetworkingConnectionState__Force32Bit = 0x7fffffff -}; - -/// Enumerate various causes of connection termination. These are designed to work similar -/// to HTTP error codes: the numeric range gives you a rough classification as to the source -/// of the problem. -enum ESteamNetConnectionEnd -{ - // Invalid/sentinel value - k_ESteamNetConnectionEnd_Invalid = 0, - - // - // Application codes. These are the values you will pass to - // ISteamNetworkingSockets::CloseConnection. You can use these codes if - // you want to plumb through application-specific reason codes. If you don't - // need this facility, feel free to always pass - // k_ESteamNetConnectionEnd_App_Generic. - // - // The distinction between "normal" and "exceptional" termination is - // one you may use if you find useful, but it's not necessary for you - // to do so. The only place where we distinguish between normal and - // exceptional is in connection analytics. If a significant - // proportion of connections terminates in an exceptional manner, - // this can trigger an alert. - // - - // 1xxx: Application ended the connection in a "usual" manner. - // E.g.: user intentionally disconnected from the server, - // gameplay ended normally, etc - k_ESteamNetConnectionEnd_App_Min = 1000, - k_ESteamNetConnectionEnd_App_Generic = k_ESteamNetConnectionEnd_App_Min, - // Use codes in this range for "normal" disconnection - k_ESteamNetConnectionEnd_App_Max = 1999, - - // 2xxx: Application ended the connection in some sort of exceptional - // or unusual manner that might indicate a bug or configuration - // issue. - // - k_ESteamNetConnectionEnd_AppException_Min = 2000, - k_ESteamNetConnectionEnd_AppException_Generic = k_ESteamNetConnectionEnd_AppException_Min, - // Use codes in this range for "unusual" disconnection - k_ESteamNetConnectionEnd_AppException_Max = 2999, - - // - // System codes. These will be returned by the system when - // the connection state is k_ESteamNetworkingConnectionState_ClosedByPeer - // or k_ESteamNetworkingConnectionState_ProblemDetectedLocally. It is - // illegal to pass a code in this range to ISteamNetworkingSockets::CloseConnection - // - - // 3xxx: Connection failed or ended because of problem with the - // local host or their connection to the Internet. - k_ESteamNetConnectionEnd_Local_Min = 3000, - - // You cannot do what you want to do because you're running in offline mode. - k_ESteamNetConnectionEnd_Local_OfflineMode = 3001, - - // We're having trouble contacting many (perhaps all) relays. - // Since it's unlikely that they all went offline at once, the best - // explanation is that we have a problem on our end. Note that we don't - // bother distinguishing between "many" and "all", because in practice, - // it takes time to detect a connection problem, and by the time - // the connection has timed out, we might not have been able to - // actively probe all of the relay clusters, even if we were able to - // contact them at one time. So this code just means that: - // - // * We don't have any recent successful communication with any relay. - // * We have evidence of recent failures to communicate with multiple relays. - k_ESteamNetConnectionEnd_Local_ManyRelayConnectivity = 3002, - - // A hosted server is having trouble talking to the relay - // that the client was using, so the problem is most likely - // on our end - k_ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay = 3003, - - // We're not able to get the SDR network config. This is - // *almost* always a local issue, since the network config - // comes from the CDN, which is pretty darn reliable. - k_ESteamNetConnectionEnd_Local_NetworkConfig = 3004, - - // Steam rejected our request because we don't have rights - // to do this. - k_ESteamNetConnectionEnd_Local_Rights = 3005, - - // ICE P2P rendezvous failed because we were not able to - // determine our "public" address (e.g. reflexive address via STUN) - // - // If relay fallback is available (it always is on Steam), then - // this is only used internally and will not be returned as a high - // level failure. - k_ESteamNetConnectionEnd_Local_P2P_ICE_NoPublicAddresses = 3006, - - k_ESteamNetConnectionEnd_Local_Max = 3999, - - // 4xxx: Connection failed or ended, and it appears that the - // cause does NOT have to do with the local host or their - // connection to the Internet. It could be caused by the - // remote host, or it could be somewhere in between. - k_ESteamNetConnectionEnd_Remote_Min = 4000, - - // The connection was lost, and as far as we can tell our connection - // to relevant services (relays) has not been disrupted. This doesn't - // mean that the problem is "their fault", it just means that it doesn't - // appear that we are having network issues on our end. - k_ESteamNetConnectionEnd_Remote_Timeout = 4001, - - // Something was invalid with the cert or crypt handshake - // info you gave me, I don't understand or like your key types, - // etc. - k_ESteamNetConnectionEnd_Remote_BadCrypt = 4002, - - // You presented me with a cert that was I was able to parse - // and *technically* we could use encrypted communication. - // But there was a problem that prevents me from checking your identity - // or ensuring that somebody int he middle can't observe our communication. - // E.g.: - the CA key was missing (and I don't accept unsigned certs) - // - The CA key isn't one that I trust, - // - The cert doesn't was appropriately restricted by app, user, time, data center, etc. - // - The cert wasn't issued to you. - // - etc - k_ESteamNetConnectionEnd_Remote_BadCert = 4003, - - // These will never be returned - //k_ESteamNetConnectionEnd_Remote_NotLoggedIn_DEPRECATED = 4004, - //k_ESteamNetConnectionEnd_Remote_NotRunningApp_DEPRECATED = 4005, - - // Something wrong with the protocol version you are using. - // (Probably the code you are running is too old.) - k_ESteamNetConnectionEnd_Remote_BadProtocolVersion = 4006, - - // NAT punch failed failed because we never received any public - // addresses from the remote host. (But we did receive some - // signals form them.) - // - // If relay fallback is available (it always is on Steam), then - // this is only used internally and will not be returned as a high - // level failure. - k_ESteamNetConnectionEnd_Remote_P2P_ICE_NoPublicAddresses = 4007, - - k_ESteamNetConnectionEnd_Remote_Max = 4999, - - // 5xxx: Connection failed for some other reason. - k_ESteamNetConnectionEnd_Misc_Min = 5000, - - // A failure that isn't necessarily the result of a software bug, - // but that should happen rarely enough that it isn't worth specifically - // writing UI or making a localized message for. - // The debug string should contain further details. - k_ESteamNetConnectionEnd_Misc_Generic = 5001, - - // Generic failure that is most likely a software bug. - k_ESteamNetConnectionEnd_Misc_InternalError = 5002, - - // The connection to the remote host timed out, but we - // don't know if the problem is on our end, in the middle, - // or on their end. - k_ESteamNetConnectionEnd_Misc_Timeout = 5003, - - //k_ESteamNetConnectionEnd_Misc_RelayConnectivity_DEPRECATED = 5004, - - // There's some trouble talking to Steam. - k_ESteamNetConnectionEnd_Misc_SteamConnectivity = 5005, - - // A server in a dedicated hosting situation has no relay sessions - // active with which to talk back to a client. (It's the client's - // job to open and maintain those sessions.) - k_ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient = 5006, - - // While trying to initiate a connection, we never received - // *any* communication from the peer. - //k_ESteamNetConnectionEnd_Misc_ServerNeverReplied = 5007, - - // P2P rendezvous failed in a way that we don't have more specific - // information - k_ESteamNetConnectionEnd_Misc_P2P_Rendezvous = 5008, - - // NAT punch failed, probably due to NAT/firewall configuration. - // - // If relay fallback is available (it always is on Steam), then - // this is only used internally and will not be returned as a high - // level failure. - k_ESteamNetConnectionEnd_Misc_P2P_NAT_Firewall = 5009, - - // Our peer replied that it has no record of the connection. - // This should not happen ordinarily, but can happen in a few - // exception cases: - // - // - This is an old connection, and the peer has already cleaned - // up and forgotten about it. (Perhaps it timed out and they - // closed it and were not able to communicate this to us.) - // - A bug or internal protocol error has caused us to try to - // talk to the peer about the connection before we received - // confirmation that the peer has accepted the connection. - // - The peer thinks that we have closed the connection for some - // reason (perhaps a bug), and believes that is it is - // acknowledging our closure. - k_ESteamNetConnectionEnd_Misc_PeerSentNoConnection = 5010, - - k_ESteamNetConnectionEnd_Misc_Max = 5999, - - k_ESteamNetConnectionEnd__Force32Bit = 0x7fffffff -}; - -/// Max length, in bytes (including null terminator) of the reason string -/// when a connection is closed. -const int k_cchSteamNetworkingMaxConnectionCloseReason = 128; - -/// Max length, in bytes (include null terminator) of debug description -/// of a connection. -const int k_cchSteamNetworkingMaxConnectionDescription = 128; - -/// Max length of the app's part of the description -const int k_cchSteamNetworkingMaxConnectionAppName = 32; - -const int k_nSteamNetworkConnectionInfoFlags_Unauthenticated = 1; // We don't have a certificate for the remote host. -const int k_nSteamNetworkConnectionInfoFlags_Unencrypted = 2; // Information is being sent out over a wire unencrypted (by this library) -const int k_nSteamNetworkConnectionInfoFlags_LoopbackBuffers = 4; // Internal loopback buffers. Won't be true for localhost. (You can check the address to determine that.) This implies k_nSteamNetworkConnectionInfoFlags_FastLAN -const int k_nSteamNetworkConnectionInfoFlags_Fast = 8; // The connection is "fast" and "reliable". Either internal/localhost (check the address to find out), or the peer is on the same LAN. (Probably. It's based on the address and the ping time, this is actually hard to determine unambiguously). -const int k_nSteamNetworkConnectionInfoFlags_Relayed = 16; // The connection is relayed somehow (SDR or TURN). -const int k_nSteamNetworkConnectionInfoFlags_DualWifi = 32; // We're taking advantage of dual-wifi multi-path - -/// Describe the state of a connection. -struct SteamNetConnectionInfo_t -{ - - /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know - SteamNetworkingIdentity m_identityRemote; - - /// Arbitrary user data set by the local application code - int64 m_nUserData; - - /// Handle to listen socket this was connected on, or k_HSteamListenSocket_Invalid if we initiated the connection - HSteamListenSocket m_hListenSocket; - - /// Remote address. Might be all 0's if we don't know it, or if this is N/A. - /// (E.g. Basically everything except direct UDP connection.) - SteamNetworkingIPAddr m_addrRemote; - uint16 m__pad1; - - /// What data center is the remote host in? (0 if we don't know.) - SteamNetworkingPOPID m_idPOPRemote; - - /// What relay are we using to communicate with the remote host? - /// (0 if not applicable.) - SteamNetworkingPOPID m_idPOPRelay; - - /// High level state of the connection - ESteamNetworkingConnectionState m_eState; - - /// Basic cause of the connection termination or problem. - /// See ESteamNetConnectionEnd for the values used - int m_eEndReason; - - /// Human-readable, but non-localized explanation for connection - /// termination or problem. This is intended for debugging / - /// diagnostic purposes only, not to display to users. It might - /// have some details specific to the issue. - char m_szEndDebug[ k_cchSteamNetworkingMaxConnectionCloseReason ]; - - /// Debug description. This includes the internal connection ID, - /// connection type (and peer information), and any name - /// given to the connection by the app. This string is used in various - /// internal logging messages. - /// - /// Note that the connection ID *usually* matches the HSteamNetConnection - /// handle, but in certain cases with symmetric connections it might not. - char m_szConnectionDescription[ k_cchSteamNetworkingMaxConnectionDescription ]; - - /// Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx - int m_nFlags; - - /// Internal stuff, room to change API easily - uint32 reserved[63]; -}; - -/// Quick connection state, pared down to something you could call -/// more frequently without it being too big of a perf hit. -struct SteamNetConnectionRealTimeStatus_t -{ - - /// High level state of the connection - ESteamNetworkingConnectionState m_eState; - - /// Current ping (ms) - int m_nPing; - - /// Connection quality measured locally, 0...1. (Percentage of packets delivered - /// end-to-end in order). - float m_flConnectionQualityLocal; - - /// Packet delivery success rate as observed from remote host - float m_flConnectionQualityRemote; - - /// Current data rates from recent history. - float m_flOutPacketsPerSec; - float m_flOutBytesPerSec; - float m_flInPacketsPerSec; - float m_flInBytesPerSec; - - /// Estimate rate that we believe that we can send data to our peer. - /// Note that this could be significantly higher than m_flOutBytesPerSec, - /// meaning the capacity of the channel is higher than you are sending data. - /// (That's OK!) - int m_nSendRateBytesPerSecond; - - /// Number of bytes pending to be sent. This is data that you have recently - /// requested to be sent but has not yet actually been put on the wire. The - /// reliable number ALSO includes data that was previously placed on the wire, - /// but has now been scheduled for re-transmission. Thus, it's possible to - /// observe m_cbPendingReliable increasing between two checks, even if no - /// calls were made to send reliable data between the checks. Data that is - /// awaiting the Nagle delay will appear in these numbers. - int m_cbPendingUnreliable; - int m_cbPendingReliable; - - /// Number of bytes of reliable data that has been placed the wire, but - /// for which we have not yet received an acknowledgment, and thus we may - /// have to re-transmit. - int m_cbSentUnackedReliable; - - /// If you queued a message right now, approximately how long would that message - /// wait in the queue before we actually started putting its data on the wire in - /// a packet? - /// - /// In general, data that is sent by the application is limited by the bandwidth - /// of the channel. If you send data faster than this, it must be queued and - /// put on the wire at a metered rate. Even sending a small amount of data (e.g. - /// a few MTU, say ~3k) will require some of the data to be delayed a bit. - /// - /// Ignoring multiple lanes, the estimated delay will be approximately equal to - /// - /// ( m_cbPendingUnreliable+m_cbPendingReliable ) / m_nSendRateBytesPerSecond - /// - /// plus or minus one MTU. It depends on how much time has elapsed since the last - /// packet was put on the wire. For example, the queue might have *just* been emptied, - /// and the last packet placed on the wire, and we are exactly up against the send - /// rate limit. In that case we might need to wait for one packet's worth of time to - /// elapse before we can send again. On the other extreme, the queue might have data - /// in it waiting for Nagle. (This will always be less than one packet, because as - /// soon as we have a complete packet we would send it.) In that case, we might be - /// ready to send data now, and this value will be 0. - /// - /// This value is only valid if multiple lanes are not used. If multiple lanes are - /// in use, then the queue time will be different for each lane, and you must use - /// the value in SteamNetConnectionRealTimeLaneStatus_t. - /// - /// Nagle delay is ignored for the purposes of this calculation. - SteamNetworkingMicroseconds m_usecQueueTime; - - // Internal stuff, room to change API easily - uint32 reserved[16]; -}; - -/// Quick status of a particular lane -struct SteamNetConnectionRealTimeLaneStatus_t -{ - // Counters for this particular lane. See the corresponding variables - // in SteamNetConnectionRealTimeStatus_t - int m_cbPendingUnreliable; - int m_cbPendingReliable; - int m_cbSentUnackedReliable; - int _reservePad1; // Reserved for future use - - /// Lane-specific queue time. This value takes into consideration lane priorities - /// and weights, and how much data is queued in each lane, and attempts to predict - /// how any data currently queued will be sent out. - SteamNetworkingMicroseconds m_usecQueueTime; - - // Internal stuff, room to change API easily - uint32 reserved[10]; -}; - -#pragma pack( pop ) - -// -// Network messages -// - -/// Max size of a single message that we can SEND. -/// Note: We might be wiling to receive larger messages, -/// and our peer might, too. -const int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 512 * 1024; - -/// A message that has been received. -struct SteamNetworkingMessage_t -{ - - /// Message payload - void *m_pData; - - /// Size of the payload. - int m_cbSize; - - /// For messages received on connections: what connection did this come from? - /// For outgoing messages: what connection to send it to? - /// Not used when using the ISteamNetworkingMessages interface - HSteamNetConnection m_conn; - - /// For inbound messages: Who sent this to us? - /// For outbound messages on connections: not used. - /// For outbound messages on the ad-hoc ISteamNetworkingMessages interface: who should we send this to? - SteamNetworkingIdentity m_identityPeer; - - /// For messages received on connections, this is the user data - /// associated with the connection. - /// - /// This is *usually* the same as calling GetConnection() and then - /// fetching the user data associated with that connection, but for - /// the following subtle differences: - /// - /// - This user data will match the connection's user data at the time - /// is captured at the time the message is returned by the API. - /// If you subsequently change the userdata on the connection, - /// this won't be updated. - /// - This is an inline call, so it's *much* faster. - /// - You might have closed the connection, so fetching the user data - /// would not be possible. - /// - /// Not used when sending messages. - int64 m_nConnUserData; - - /// Local timestamp when the message was received - /// Not used for outbound messages. - SteamNetworkingMicroseconds m_usecTimeReceived; - - /// Message number assigned by the sender. This is not used for outbound - /// messages. Note that if multiple lanes are used, each lane has its own - /// message numbers, which are assigned sequentially, so messages from - /// different lanes will share the same numbers. - int64 m_nMessageNumber; - - /// Function used to free up m_pData. This mechanism exists so that - /// apps can create messages with buffers allocated from their own - /// heap, and pass them into the library. This function will - /// usually be something like: - /// - /// free( pMsg->m_pData ); - void (*m_pfnFreeData)( SteamNetworkingMessage_t *pMsg ); - - /// Function to used to decrement the internal reference count and, if - /// it's zero, release the message. You should not set this function pointer, - /// or need to access this directly! Use the Release() function instead! - void (*m_pfnRelease)( SteamNetworkingMessage_t *pMsg ); - - /// When using ISteamNetworkingMessages, the channel number the message was received on - /// (Not used for messages sent or received on "connections") - int m_nChannel; - - /// Bitmask of k_nSteamNetworkingSend_xxx flags. - /// For received messages, only the k_nSteamNetworkingSend_Reliable bit is valid. - /// For outbound messages, all bits are relevant - int m_nFlags; - - /// Arbitrary user data that you can use when sending messages using - /// ISteamNetworkingUtils::AllocateMessage and ISteamNetworkingSockets::SendMessage. - /// (The callback you set in m_pfnFreeData might use this field.) - /// - /// Not used for received messages. - int64 m_nUserData; - - /// For outbound messages, which lane to use? See ISteamNetworkingSockets::ConfigureConnectionLanes. - /// For inbound messages, what lane was the message received on? - uint16 m_idxLane; - uint16 _pad1__; - - /// You MUST call this when you're done with the object, - /// to free up memory, etc. - inline void Release(); - - // For code compatibility, some accessors -#ifndef API_GEN - inline uint32 GetSize() const { return m_cbSize; } - inline const void *GetData() const { return m_pData; } - inline int GetChannel() const { return m_nChannel; } - inline HSteamNetConnection GetConnection() const { return m_conn; } - inline int64 GetConnectionUserData() const { return m_nConnUserData; } - inline SteamNetworkingMicroseconds GetTimeReceived() const { return m_usecTimeReceived; } - inline int64 GetMessageNumber() const { return m_nMessageNumber; } -#endif -protected: - // Declare destructor protected. You should never need to declare a message - // object on the stack or create one yourself. - // - You will receive a pointer to a message object when you receive messages (e.g. ISteamNetworkingSockets::ReceiveMessagesOnConnection) - // - You can allocate a message object for efficient sending using ISteamNetworkingUtils::AllocateMessage - // - Call Release() to free the object - inline ~SteamNetworkingMessage_t() {} -}; - -// -// Flags used to set options for message sending -// - -// Send the message unreliably. Can be lost. Messages *can* be larger than a -// single MTU (UDP packet), but there is no retransmission, so if any piece -// of the message is lost, the entire message will be dropped. -// -// The sending API does have some knowledge of the underlying connection, so -// if there is no NAT-traversal accomplished or there is a recognized adjustment -// happening on the connection, the packet will be batched until the connection -// is open again. -// -// Migration note: This is not exactly the same as k_EP2PSendUnreliable! You -// probably want k_ESteamNetworkingSendType_UnreliableNoNagle -const int k_nSteamNetworkingSend_Unreliable = 0; - -// Disable Nagle's algorithm. -// By default, Nagle's algorithm is applied to all outbound messages. This means -// that the message will NOT be sent immediately, in case further messages are -// sent soon after you send this, which can be grouped together. Any time there -// is enough buffered data to fill a packet, the packets will be pushed out immediately, -// but partially-full packets not be sent until the Nagle timer expires. See -// ISteamNetworkingSockets::FlushMessagesOnConnection, ISteamNetworkingMessages::FlushMessagesToUser -// -// NOTE: Don't just send every message without Nagle because you want packets to get there -// quicker. Make sure you understand the problem that Nagle is solving before disabling it. -// If you are sending small messages, often many at the same time, then it is very likely that -// it will be more efficient to leave Nagle enabled. A typical proper use of this flag is -// when you are sending what you know will be the last message sent for a while (e.g. the last -// in the server simulation tick to a particular client), and you use this flag to flush all -// messages. -const int k_nSteamNetworkingSend_NoNagle = 1; - -// Send a message unreliably, bypassing Nagle's algorithm for this message and any messages -// currently pending on the Nagle timer. This is equivalent to using k_ESteamNetworkingSend_Unreliable -// and then immediately flushing the messages using ISteamNetworkingSockets::FlushMessagesOnConnection -// or ISteamNetworkingMessages::FlushMessagesToUser. (But using this flag is more efficient since you -// only make one API call.) -const int k_nSteamNetworkingSend_UnreliableNoNagle = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoNagle; - -// If the message cannot be sent very soon (because the connection is still doing some initial -// handshaking, route negotiations, etc), then just drop it. This is only applicable for unreliable -// messages. Using this flag on reliable messages is invalid. -const int k_nSteamNetworkingSend_NoDelay = 4; - -// Send an unreliable message, but if it cannot be sent relatively quickly, just drop it instead of queuing it. -// This is useful for messages that are not useful if they are excessively delayed, such as voice data. -// NOTE: The Nagle algorithm is not used, and if the message is not dropped, any messages waiting on the -// Nagle timer are immediately flushed. -// -// A message will be dropped under the following circumstances: -// - the connection is not fully connected. (E.g. the "Connecting" or "FindingRoute" states) -// - there is a sufficiently large number of messages queued up already such that the current message -// will not be placed on the wire in the next ~200ms or so. -// -// If a message is dropped for these reasons, k_EResultIgnored will be returned. -const int k_nSteamNetworkingSend_UnreliableNoDelay = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoDelay|k_nSteamNetworkingSend_NoNagle; - -// Reliable message send. Can send up to k_cbMaxSteamNetworkingSocketsMessageSizeSend bytes in a single message. -// Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for -// efficient sends of large chunks of data. -// -// The Nagle algorithm is used. See notes on k_ESteamNetworkingSendType_Unreliable for more details. -// See k_ESteamNetworkingSendType_ReliableNoNagle, ISteamNetworkingSockets::FlushMessagesOnConnection, -// ISteamNetworkingMessages::FlushMessagesToUser -// -// Migration note: This is NOT the same as k_EP2PSendReliable, it's more like k_EP2PSendReliableWithBuffering -const int k_nSteamNetworkingSend_Reliable = 8; - -// Send a message reliably, but bypass Nagle's algorithm. -// -// Migration note: This is equivalent to k_EP2PSendReliable -const int k_nSteamNetworkingSend_ReliableNoNagle = k_nSteamNetworkingSend_Reliable|k_nSteamNetworkingSend_NoNagle; - -// By default, message sending is queued, and the work of encryption and talking to -// the operating system sockets, etc is done on a service thread. This is usually a -// a performance win when messages are sent from the "main thread". However, if this -// flag is set, and data is ready to be sent immediately (either from this message -// or earlier queued data), then that work will be done in the current thread, before -// the current call returns. If data is not ready to be sent (due to rate limiting -// or Nagle), then this flag has no effect. -// -// This is an advanced flag used to control performance at a very low level. For -// most applications running on modern hardware with more than one CPU core, doing -// the work of sending on a service thread will yield the best performance. Only -// use this flag if you have a really good reason and understand what you are doing. -// Otherwise you will probably just make performance worse. -const int k_nSteamNetworkingSend_UseCurrentThread = 16; - -// When sending a message using ISteamNetworkingMessages, automatically re-establish -// a broken session, without returning k_EResultNoConnection. Without this flag, -// if you attempt to send a message, and the session was proactively closed by the -// peer, or an error occurred that disrupted communications, then you must close the -// session using ISteamNetworkingMessages::CloseSessionWithUser before attempting to -// send another message. (Or you can simply add this flag and retry.) In this way, -// the disruption cannot go unnoticed, and a more clear order of events can be -// ascertained. This is especially important when reliable messages are used, since -// if the connection is disrupted, some of those messages will not have been delivered, -// and it is in general not possible to know which. Although a -// SteamNetworkingMessagesSessionFailed_t callback will be posted when an error occurs -// to notify you that a failure has happened, callbacks are asynchronous, so it is not -// possible to tell exactly when it happened. And because the primary purpose of -// ISteamNetworkingMessages is to be like UDP, there is no notification when a peer closes -// the session. -// -// If you are not using any reliable messages (e.g. you are using ISteamNetworkingMessages -// exactly as a transport replacement for UDP-style datagrams only), you may not need to -// know when an underlying connection fails, and so you may not need this notification. -const int k_nSteamNetworkingSend_AutoRestartBrokenSession = 32; - -// -// Ping location / measurement -// - -/// Object that describes a "location" on the Internet with sufficient -/// detail that we can reasonably estimate an upper bound on the ping between -/// the two hosts, even if a direct route between the hosts is not possible, -/// and the connection must be routed through the Steam Datagram Relay network. -/// This does not contain any information that identifies the host. Indeed, -/// if two hosts are in the same building or otherwise have nearly identical -/// networking characteristics, then it's valid to use the same location -/// object for both of them. -/// -/// NOTE: This object should only be used in the same process! Do not serialize it, -/// send it over the wire, or persist it in a file or database! If you need -/// to do that, convert it to a string representation using the methods in -/// ISteamNetworkingUtils(). -struct SteamNetworkPingLocation_t -{ - uint8 m_data[ 512 ]; -}; - -/// Max possible length of a ping location, in string format. This is -/// an extremely conservative worst case value which leaves room for future -/// syntax enhancements. Most strings in practice are a lot shorter. -/// If you are storing many of these, you will very likely benefit from -/// using dynamic memory. -const int k_cchMaxSteamNetworkingPingLocationString = 1024; - -/// Special values that are returned by some functions that return a ping. -const int k_nSteamNetworkingPing_Failed = -1; -const int k_nSteamNetworkingPing_Unknown = -2; - -// -// Configuration values -// - -/// Configuration values can be applied to different types of objects. -enum ESteamNetworkingConfigScope -{ - - /// Get/set global option, or defaults. Even options that apply to more specific scopes - /// have global scope, and you may be able to just change the global defaults. If you - /// need different settings per connection (for example), then you will need to set those - /// options at the more specific scope. - k_ESteamNetworkingConfig_Global = 1, - - /// Some options are specific to a particular interface. Note that all connection - /// and listen socket settings can also be set at the interface level, and they will - /// apply to objects created through those interfaces. - k_ESteamNetworkingConfig_SocketsInterface = 2, - - /// Options for a listen socket. Listen socket options can be set at the interface layer, - /// if you have multiple listen sockets and they all use the same options. - /// You can also set connection options on a listen socket, and they set the defaults - /// for all connections accepted through this listen socket. (They will be used if you don't - /// set a connection option.) - k_ESteamNetworkingConfig_ListenSocket = 3, - - /// Options for a specific connection. - k_ESteamNetworkingConfig_Connection = 4, - - k_ESteamNetworkingConfigScope__Force32Bit = 0x7fffffff -}; - -// Different configuration values have different data types -enum ESteamNetworkingConfigDataType -{ - k_ESteamNetworkingConfig_Int32 = 1, - k_ESteamNetworkingConfig_Int64 = 2, - k_ESteamNetworkingConfig_Float = 3, - k_ESteamNetworkingConfig_String = 4, - k_ESteamNetworkingConfig_Ptr = 5, - - k_ESteamNetworkingConfigDataType__Force32Bit = 0x7fffffff -}; - -/// Configuration options -enum ESteamNetworkingConfigValue -{ - k_ESteamNetworkingConfig_Invalid = 0, - -// -// Connection options -// - - /// [connection int32] Timeout value (in ms) to use when first connecting - k_ESteamNetworkingConfig_TimeoutInitial = 24, - - /// [connection int32] Timeout value (in ms) to use after connection is established - k_ESteamNetworkingConfig_TimeoutConnected = 25, - - /// [connection int32] Upper limit of buffered pending bytes to be sent, - /// if this is reached SendMessage will return k_EResultLimitExceeded - /// Default is 512k (524288 bytes) - k_ESteamNetworkingConfig_SendBufferSize = 9, - - /// [connection int32] Upper limit on total size (in bytes) of received messages - /// that will be buffered waiting to be processed by the application. If this limit - /// is exceeded, packets will be dropped. This is to protect us from a malicious - /// peer flooding us with messages faster than we can process them. - /// - /// This must be bigger than k_ESteamNetworkingConfig_RecvMaxMessageSize - k_ESteamNetworkingConfig_RecvBufferSize = 47, - - /// [connection int32] Upper limit on the number of received messages that will - /// that will be buffered waiting to be processed by the application. If this limit - /// is exceeded, packets will be dropped. This is to protect us from a malicious - /// peer flooding us with messages faster than we can pull them off the wire. - k_ESteamNetworkingConfig_RecvBufferMessages = 48, - - /// [connection int32] Maximum message size that we are willing to receive. - /// if a client attempts to send us a message larger than this, the connection - /// will be immediately closed. - /// - /// Default is 512k (524288 bytes). Note that the peer needs to be able to - /// send a message this big. (See k_cbMaxSteamNetworkingSocketsMessageSizeSend.) - k_ESteamNetworkingConfig_RecvMaxMessageSize = 49, - - /// [connection int32] Max number of message segments that can be received - /// in a single UDP packet. While decoding a packet, if the number of segments - /// exceeds this, we will abort further packet processing. - /// - /// The default is effectively unlimited. If you know that you very rarely - /// send small packets, you can protect yourself from malicious senders by - /// lowering this number. - /// - /// In particular, if you are NOT using the reliability layer and are only using - /// SteamNetworkingSockets for datagram transport, setting this to a very low - /// number may be beneficial. (We recommend a value of 2.) Make sure your sender - /// disables Nagle! - k_ESteamNetworkingConfig_RecvMaxSegmentsPerPacket = 50, - - /// [connection int64] Get/set userdata as a configuration option. - /// The default value is -1. You may want to set the user data as - /// a config value, instead of using ISteamNetworkingSockets::SetConnectionUserData - /// in two specific instances: - /// - /// - You wish to set the userdata atomically when creating - /// an outbound connection, so that the userdata is filled in properly - /// for any callbacks that happen. However, note that this trick - /// only works for connections initiated locally! For incoming - /// connections, multiple state transitions may happen and - /// callbacks be queued, before you are able to service the first - /// callback! Be careful! - /// - /// - You can set the default userdata for all newly created connections - /// by setting this value at a higher level (e.g. on the listen - /// socket or at the global level.) Then this default - /// value will be inherited when the connection is created. - /// This is useful in case -1 is a valid userdata value, and you - /// wish to use something else as the default value so you can - /// tell if it has been set or not. - /// - /// HOWEVER: once a connection is created, the effective value is - /// then bound to the connection. Unlike other connection options, - /// if you change it again at a higher level, the new value will not - /// be inherited by connections. - /// - /// Using the userdata field in callback structs is not advised because - /// of tricky race conditions. Instead, you might try one of these methods: - /// - /// - Use a separate map with the HSteamNetConnection as the key. - /// - Fetch the userdata from the connection in your callback - /// using ISteamNetworkingSockets::GetConnectionUserData, to - // ensure you have the current value. - k_ESteamNetworkingConfig_ConnectionUserData = 40, - - /// [connection int32] Minimum/maximum send rate clamp, in bytes/sec. - /// At the time of this writing these two options should always be set to - /// the same value, to manually configure a specific send rate. The default - /// value is 256K. Eventually we hope to have the library estimate the bandwidth - /// of the channel and set the send rate to that estimated bandwidth, and these - /// values will only set limits on that send rate. - k_ESteamNetworkingConfig_SendRateMin = 10, - k_ESteamNetworkingConfig_SendRateMax = 11, - - /// [connection int32] Nagle time, in microseconds. When SendMessage is called, if - /// the outgoing message is less than the size of the MTU, it will be - /// queued for a delay equal to the Nagle timer value. This is to ensure - /// that if the application sends several small messages rapidly, they are - /// coalesced into a single packet. - /// See historical RFC 896. Value is in microseconds. - /// Default is 5000us (5ms). - k_ESteamNetworkingConfig_NagleTime = 12, - - /// [connection int32] Don't automatically fail IP connections that don't have - /// strong auth. On clients, this means we will attempt the connection even if - /// we don't know our identity or can't get a cert. On the server, it means that - /// we won't automatically reject a connection due to a failure to authenticate. - /// (You can examine the incoming connection and decide whether to accept it.) - /// - /// 0: Don't attempt or accept unauthorized connections - /// 1: Attempt authorization when connecting, and allow unauthorized peers, but emit warnings - /// 2: don't attempt authentication, or complain if peer is unauthenticated - /// - /// This is a dev configuration value, and you should not let users modify it in - /// production. - k_ESteamNetworkingConfig_IP_AllowWithoutAuth = 23, - - /// [connection int32] The same as IP_AllowWithoutAuth, but will only apply - /// for connections to/from localhost addresses. Whichever value is larger - /// (more permissive) will be used. - k_ESteamNetworkingConfig_IPLocalHost_AllowWithoutAuth = 52, - - /// [connection int32] Do not send UDP packets with a payload of - /// larger than N bytes. If you set this, k_ESteamNetworkingConfig_MTU_DataSize - /// is automatically adjusted - k_ESteamNetworkingConfig_MTU_PacketSize = 32, - - /// [connection int32] (read only) Maximum message size you can send that - /// will not fragment, based on k_ESteamNetworkingConfig_MTU_PacketSize - k_ESteamNetworkingConfig_MTU_DataSize = 33, - - /// [connection int32] Allow unencrypted (and unauthenticated) communication. - /// 0: Not allowed (the default) - /// 1: Allowed, but prefer encrypted - /// 2: Allowed, and preferred - /// 3: Required. (Fail the connection if the peer requires encryption.) - /// - /// This is a dev configuration value, since its purpose is to disable encryption. - /// You should not let users modify it in production. (But note that it requires - /// the peer to also modify their value in order for encryption to be disabled.) - k_ESteamNetworkingConfig_Unencrypted = 34, - - /// [connection int32] Set this to 1 on outbound connections and listen sockets, - /// to enable "symmetric connect mode", which is useful in the following - /// common peer-to-peer use case: - /// - /// - The two peers are "equal" to each other. (Neither is clearly the "client" - /// or "server".) - /// - Either peer may initiate the connection, and indeed they may do this - /// at the same time - /// - The peers only desire a single connection to each other, and if both - /// peers initiate connections simultaneously, a protocol is needed for them - /// to resolve the conflict, so that we end up with a single connection. - /// - /// This use case is both common, and involves subtle race conditions and tricky - /// pitfalls, which is why the API has support for dealing with it. - /// - /// If an incoming connection arrives on a listen socket or via custom signaling, - /// and the application has not attempted to make a matching outbound connection - /// in symmetric mode, then the incoming connection can be accepted as usual. - /// A "matching" connection means that the relevant endpoint information matches. - /// (At the time this comment is being written, this is only supported for P2P - /// connections, which means that the peer identities must match, and the virtual - /// port must match. At a later time, symmetric mode may be supported for other - /// connection types.) - /// - /// If connections are initiated by both peers simultaneously, race conditions - /// can arise, but fortunately, most of them are handled internally and do not - /// require any special awareness from the application. However, there - /// is one important case that application code must be aware of: - /// If application code attempts an outbound connection using a ConnectXxx - /// function in symmetric mode, and a matching incoming connection is already - /// waiting on a listen socket, then instead of forming a new connection, - /// the ConnectXxx call will accept the existing incoming connection, and return - /// a connection handle to this accepted connection. - /// IMPORTANT: in this case, a SteamNetConnectionStatusChangedCallback_t - /// has probably *already* been posted to the queue for the incoming connection! - /// (Once callbacks are posted to the queue, they are not modified.) It doesn't - /// matter if the callback has not been consumed by the app. Thus, application - /// code that makes use of symmetric connections must be aware that, when processing a - /// SteamNetConnectionStatusChangedCallback_t for an incoming connection, the - /// m_hConn may refer to a new connection that the app has has not - /// seen before (the usual case), but it may also refer to a connection that - /// has already been accepted implicitly through a call to Connect()! In this - /// case, AcceptConnection() will return k_EResultDuplicateRequest. - /// - /// Only one symmetric connection to a given peer (on a given virtual port) - /// may exist at any given time. If client code attempts to create a connection, - /// and a (live) connection already exists on the local host, then either the - /// existing connection will be accepted as described above, or the attempt - /// to create a new connection will fail. Furthermore, linger mode functionality - /// is not supported on symmetric connections. - /// - /// A more complicated race condition can arise if both peers initiate a connection - /// at roughly the same time. In this situation, each peer will receive an incoming - /// connection from the other peer, when the application code has already initiated - /// an outgoing connection to that peer. The peers must resolve this conflict and - /// decide who is going to act as the "server" and who will act as the "client". - /// Typically the application does not need to be aware of this case as it is handled - /// internally. On both sides, the will observe their outbound connection being - /// "accepted", although one of them one have been converted internally to act - /// as the "server". - /// - /// In general, symmetric mode should be all-or-nothing: do not mix symmetric - /// connections with a non-symmetric connection that it might possible "match" - /// with. If you use symmetric mode on any connections, then both peers should - /// use it on all connections, and the corresponding listen socket, if any. The - /// behaviour when symmetric and ordinary connections are mixed is not defined by - /// this API, and you should not rely on it. (This advice only applies when connections - /// might possibly "match". For example, it's OK to use all symmetric mode - /// connections on one virtual port, and all ordinary, non-symmetric connections - /// on a different virtual port, as there is no potential for ambiguity.) - /// - /// When using the feature, you should set it in the following situations on - /// applicable objects: - /// - /// - When creating an outbound connection using ConnectXxx function - /// - When creating a listen socket. (Note that this will automatically cause - /// any accepted connections to inherit the flag.) - /// - When using custom signaling, before accepting an incoming connection. - /// - /// Setting the flag on listen socket and accepted connections will enable the - /// API to automatically deal with duplicate incoming connections, even if the - /// local host has not made any outbound requests. (In general, such duplicate - /// requests from a peer are ignored internally and will not be visible to the - /// application code. The previous connection must be closed or resolved first.) - k_ESteamNetworkingConfig_SymmetricConnect = 37, - - /// [connection int32] For connection types that use "virtual ports", this can be used - /// to assign a local virtual port. For incoming connections, this will always be the - /// virtual port of the listen socket (or the port requested by the remote host if custom - /// signaling is used and the connection is accepted), and cannot be changed. For - /// connections initiated locally, the local virtual port will default to the same as the - /// requested remote virtual port, if you do not specify a different option when creating - /// the connection. The local port is only relevant for symmetric connections, when - /// determining if two connections "match." In this case, if you need the local and remote - /// port to differ, you can set this value. - /// - /// You can also read back this value on listen sockets. - /// - /// This value should not be read or written in any other context. - k_ESteamNetworkingConfig_LocalVirtualPort = 38, - - /// [connection int32] Enable Dual wifi band support for this connection - /// 0 = no, 1 = yes, 2 = simulate it for debugging, even if dual wifi not available - k_ESteamNetworkingConfig_DualWifi_Enable = 39, - - /// [connection int32] True to enable diagnostics reporting through - /// generic platform UI. (Only available on Steam.) - k_ESteamNetworkingConfig_EnableDiagnosticsUI = 46, - - /// [connection int32] Send of time-since-previous-packet values in each UDP packet. - /// This add a small amount of packet overhead but allows for detailed jitter measurements - /// to be made by the receiver. - /// - /// - 0: disables the sending - /// - 1: enables sending - /// - -1: (the default) Use the default for the connection type. For plain UDP connections, - /// this is disabled, and for relayed connections, it is enabled. Note that relays - /// always send the value. - k_ESteamNetworkingConfig_SendTimeSincePreviousPacket = 59, - -// -// Simulating network conditions -// -// These are global (not per-connection) because they apply at -// a relatively low UDP layer. -// - - /// [global float, 0--100] Randomly discard N pct of packets instead of sending/recv - /// This is a global option only, since it is applied at a low level - /// where we don't have much context - k_ESteamNetworkingConfig_FakePacketLoss_Send = 2, - k_ESteamNetworkingConfig_FakePacketLoss_Recv = 3, - - /// [global int32]. Delay all outbound/inbound packets by N ms - k_ESteamNetworkingConfig_FakePacketLag_Send = 4, - k_ESteamNetworkingConfig_FakePacketLag_Recv = 5, - - /// Simulated jitter/clumping. - /// - /// For each packet, a jitter value is determined (which may - /// be zero). This amount is added as extra delay to the - /// packet. When a subsequent packet is queued, it receives its - /// own random jitter amount from the current time. if this would - /// result in the packets being delivered out of order, the later - /// packet queue time is adjusted to happen after the first packet. - /// Thus simulating jitter by itself will not reorder packets, but it - /// can "clump" them. - /// - /// - Avg: A random jitter time is generated using an exponential - /// distribution using this value as the mean (ms). The default - /// is zero, which disables random jitter. - /// - Max: Limit the random jitter time to this value (ms). - /// - Pct: odds (0-100) that a random jitter value for the packet - /// will be generated. Otherwise, a jitter value of zero - /// is used, and the packet will only be delayed by the jitter - /// system if necessary to retain order, due to the jitter of a - /// previous packet. - /// - /// All values are [global float] - /// - /// Fake jitter is simulated after fake lag, but before reordering. - k_ESteamNetworkingConfig_FakePacketJitter_Send_Avg = 53, - k_ESteamNetworkingConfig_FakePacketJitter_Send_Max = 54, - k_ESteamNetworkingConfig_FakePacketJitter_Send_Pct = 55, - k_ESteamNetworkingConfig_FakePacketJitter_Recv_Avg = 56, - k_ESteamNetworkingConfig_FakePacketJitter_Recv_Max = 57, - k_ESteamNetworkingConfig_FakePacketJitter_Recv_Pct = 58, - - /// [global float] 0-100 Percentage of packets we will add additional - /// delay to. If other packet(s) are sent/received within this delay - /// window (that doesn't also randomly receive the same extra delay), - /// then the packets become reordered. - /// - /// This mechanism is primarily intended to generate out-of-order - /// packets. To simulate random jitter, use the FakePacketJitter. - /// Fake packet reordering is applied after fake lag and jitter - k_ESteamNetworkingConfig_FakePacketReorder_Send = 6, - k_ESteamNetworkingConfig_FakePacketReorder_Recv = 7, - - /// [global int32] Extra delay, in ms, to apply to reordered - /// packets. The same time value is used for sending and receiving. - k_ESteamNetworkingConfig_FakePacketReorder_Time = 8, - - /// [global float 0--100] Globally duplicate some percentage of packets. - k_ESteamNetworkingConfig_FakePacketDup_Send = 26, - k_ESteamNetworkingConfig_FakePacketDup_Recv = 27, - - /// [global int32] Amount of delay, in ms, to delay duplicated packets. - /// (We chose a random delay between 0 and this value) - k_ESteamNetworkingConfig_FakePacketDup_TimeMax = 28, - - /// [global int32] Trace every UDP packet, similar to Wireshark or tcpdump. - /// Value is max number of bytes to dump. -1 disables tracing. - // 0 only traces the info but no actual data bytes - k_ESteamNetworkingConfig_PacketTraceMaxBytes = 41, - - - // [global int32] Global UDP token bucket rate limits. - // "Rate" refers to the steady state rate. (Bytes/sec, the - // rate that tokens are put into the bucket.) "Burst" - // refers to the max amount that could be sent in a single - // burst. (In bytes, the max capacity of the bucket.) - // Rate=0 disables the limiter entirely, which is the default. - // Burst=0 disables burst. (This is not realistic. A - // burst of at least 4K is recommended; the default is higher.) - k_ESteamNetworkingConfig_FakeRateLimit_Send_Rate = 42, - k_ESteamNetworkingConfig_FakeRateLimit_Send_Burst = 43, - k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate = 44, - k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst = 45, - - // Timeout used for out-of-order correction. This is used when we see a small - // gap in the sequence number on a packet flow. For example let's say we are - // processing packet 105 when the most recent one was 103. 104 might have dropped, - // but there is also a chance that packets are simply being reordered. It is very - // common on certain types of connections for packet 104 to arrive very soon after 105, - // especially if 104 was large and 104 was small. In this case, when we see packet 105 - // we will shunt it aside and pend it, in the hopes of seeing 104 soon after. If 104 - // arrives before the a timeout occurs, then we can deliver the packets in order to the - // remainder of packet processing, and we will record this as a "correctable" out-of-order - // situation. If the timer expires, then we will process packet 105, and assume for now - // that 104 has dropped. (If 104 later arrives, we will process it, but that will be - // accounted for as uncorrected.) - // - // The default value is 1000 microseconds. Note that the Windows scheduler does not - // have microsecond precision. - // - // Set the value to 0 to disable out of order correction at the packet layer. - // In many cases we are still effectively able to correct the situation because - // reassembly of message fragments is tolerant of fragments packets arriving out of - // order. Also, when messages are decoded and inserted into the queue for the app - // to receive them, we will correct out of order messages that have not been - // dequeued by the app yet. However, when out-of-order packets are corrected - // at the packet layer, they will not reduce the connection quality measure. - // (E.g. SteamNetConnectionRealTimeStatus_t::m_flConnectionQualityLocal) - k_ESteamNetworkingConfig_OutOfOrderCorrectionWindowMicroseconds = 51, - -// -// Callbacks -// - - // On Steam, you may use the default Steam callback dispatch mechanism. If you prefer - // to not use this dispatch mechanism (or you are not running with Steam), or you want - // to associate specific functions with specific listen sockets or connections, you can - // register them as configuration values. - // - // Note also that ISteamNetworkingUtils has some helpers to set these globally. - - /// [connection FnSteamNetConnectionStatusChanged] Callback that will be invoked - /// when the state of a connection changes. - /// - /// IMPORTANT: callbacks are dispatched to the handler that is in effect at the time - /// the event occurs, which might be in another thread. For example, immediately after - /// creating a listen socket, you may receive an incoming connection. And then immediately - /// after this, the remote host may close the connection. All of this could happen - /// before the function to create the listen socket has returned. For this reason, - /// callbacks usually must be in effect at the time of object creation. This means - /// you should set them when you are creating the listen socket or connection, or have - /// them in effect so they will be inherited at the time of object creation. - /// - /// For example: - /// - /// exterm void MyStatusChangedFunc( SteamNetConnectionStatusChangedCallback_t *info ); - /// SteamNetworkingConfigValue_t opt; opt.SetPtr( k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, MyStatusChangedFunc ); - /// SteamNetworkingIPAddr localAddress; localAddress.Clear(); - /// HSteamListenSocket hListenSock = SteamNetworkingSockets()->CreateListenSocketIP( localAddress, 1, &opt ); - /// - /// When accepting an incoming connection, there is no atomic way to switch the - /// callback. However, if the connection is DOA, AcceptConnection() will fail, and - /// you can fetch the state of the connection at that time. - /// - /// If all connections and listen sockets can use the same callback, the simplest - /// method is to set it globally before you create any listen sockets or connections. - k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged = 201, - - /// [global FnSteamNetAuthenticationStatusChanged] Callback that will be invoked - /// when our auth state changes. If you use this, install the callback before creating - /// any connections or listen sockets, and don't change it. - /// See: ISteamNetworkingUtils::SetGlobalCallback_SteamNetAuthenticationStatusChanged - k_ESteamNetworkingConfig_Callback_AuthStatusChanged = 202, - - /// [global FnSteamRelayNetworkStatusChanged] Callback that will be invoked - /// when our auth state changes. If you use this, install the callback before creating - /// any connections or listen sockets, and don't change it. - /// See: ISteamNetworkingUtils::SetGlobalCallback_SteamRelayNetworkStatusChanged - k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged = 203, - - /// [global FnSteamNetworkingMessagesSessionRequest] Callback that will be invoked - /// when a peer wants to initiate a SteamNetworkingMessagesSessionRequest. - /// See: ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionRequest - k_ESteamNetworkingConfig_Callback_MessagesSessionRequest = 204, - - /// [global FnSteamNetworkingMessagesSessionFailed] Callback that will be invoked - /// when a session you have initiated, or accepted either fails to connect, or loses - /// connection in some unexpected way. - /// See: ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionFailed - k_ESteamNetworkingConfig_Callback_MessagesSessionFailed = 205, - - /// [global FnSteamNetworkingSocketsCreateConnectionSignaling] Callback that will - /// be invoked when we need to create a signaling object for a connection - /// initiated locally. See: ISteamNetworkingSockets::ConnectP2P, - /// ISteamNetworkingMessages. - k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling = 206, - - /// [global FnSteamNetworkingFakeIPResult] Callback that's invoked when - /// a FakeIP allocation finishes. See: ISteamNetworkingSockets::BeginAsyncRequestFakeIP, - /// ISteamNetworkingUtils::SetGlobalCallback_FakeIPResult - k_ESteamNetworkingConfig_Callback_FakeIPResult = 207, - -// -// P2P connection settings -// - -// /// [listen socket int32] When you create a P2P listen socket, we will automatically -// /// open up a UDP port to listen for LAN connections. LAN connections can be made -// /// without any signaling: both sides can be disconnected from the Internet. -// /// -// /// This value can be set to zero to disable the feature. -// k_ESteamNetworkingConfig_P2P_Discovery_Server_LocalPort = 101, -// -// /// [connection int32] P2P connections can perform broadcasts looking for the peer -// /// on the LAN. -// k_ESteamNetworkingConfig_P2P_Discovery_Client_RemotePort = 102, - - /// [connection string] Comma-separated list of STUN servers that can be used - /// for NAT piercing. If you set this to an empty string, NAT piercing will - /// not be attempted. Also if "public" candidates are not allowed for - /// P2P_Transport_ICE_Enable, then this is ignored. - k_ESteamNetworkingConfig_P2P_STUN_ServerList = 103, - - /// [connection int32] What types of ICE candidates to share with the peer. - /// See k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_xxx values - k_ESteamNetworkingConfig_P2P_Transport_ICE_Enable = 104, - - /// [connection int32] When selecting P2P transport, add various - /// penalties to the scores for selected transports. (Route selection - /// scores are on a scale of milliseconds. The score begins with the - /// route ping time and is then adjusted.) - k_ESteamNetworkingConfig_P2P_Transport_ICE_Penalty = 105, - k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty = 106, - k_ESteamNetworkingConfig_P2P_TURN_ServerList = 107, - k_ESteamNetworkingConfig_P2P_TURN_UserList = 108, - k_ESteamNetworkingConfig_P2P_TURN_PassList = 109, - //k_ESteamNetworkingConfig_P2P_Transport_LANBeacon_Penalty = 107, - k_ESteamNetworkingConfig_P2P_Transport_ICE_Implementation = 110, - -// -// Settings for SDR relayed connections -// - - /// [global int32] If the first N pings to a port all fail, mark that port as unavailable for - /// a while, and try a different one. Some ISPs and routers may drop the first - /// packet, so setting this to 1 may greatly disrupt communications. - k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, - - /// [global int32] If N consecutive pings to a port fail, after having received successful - /// communication, mark that port as unavailable for a while, and try a - /// different one. - k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail = 20, - - /// [global int32] Minimum number of lifetime pings we need to send, before we think our estimate - /// is solid. The first ping to each cluster is very often delayed because of NAT, - /// routers not having the best route, etc. Until we've sent a sufficient number - /// of pings, our estimate is often inaccurate. Keep pinging until we get this - /// many pings. - k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate = 21, - - /// [global int32] Set all steam datagram traffic to originate from the same - /// local port. By default, we open up a new UDP socket (on a different local - /// port) for each relay. This is slightly less optimal, but it works around - /// some routers that don't implement NAT properly. If you have intermittent - /// problems talking to relays that might be NAT related, try toggling - /// this flag - k_ESteamNetworkingConfig_SDRClient_SingleSocket = 22, - - /// [global string] Code of relay cluster to force use. If not empty, we will - /// only use relays in that cluster. E.g. 'iad' - k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster = 29, - - /// [connection string] For development, a base-64 encoded ticket generated - /// using the cert tool. This can be used to connect to a gameserver via SDR - /// without a ticket generated using the game coordinator. (You will still - /// need a key that is trusted for your app, however.) - /// - /// This can also be passed using the SDR_DEVTICKET environment variable - k_ESteamNetworkingConfig_SDRClient_DevTicket = 30, - - /// [global string] For debugging. Override list of relays from the config with - /// this set (maybe just one). Comma-separated list. - k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr = 31, - - /// [global string] For debugging. Force ping times to clusters to be the specified - /// values. A comma separated list of = values. E.g. "sto=32,iad=100" - /// - /// This is a dev configuration value, you probably should not let users modify it - /// in production. - k_ESteamNetworkingConfig_SDRClient_FakeClusterPing = 36, - - /// [global int32] When probing the SteamDatagram network, we limit exploration - /// to the closest N POPs, based on our current best approximated ping to that POP. - k_ESteamNetworkingConfig_SDRClient_LimitPingProbesToNearestN = 60, - -// -// Log levels for debugging information of various subsystems. -// Higher numeric values will cause more stuff to be printed. -// See ISteamNetworkingUtils::SetDebugOutputFunction for more -// information -// -// The default for all values is k_ESteamNetworkingSocketsDebugOutputType_Warning. -// - k_ESteamNetworkingConfig_LogLevel_AckRTT = 13, // [connection int32] RTT calculations for inline pings and replies - k_ESteamNetworkingConfig_LogLevel_PacketDecode = 14, // [connection int32] log SNP packets send/recv - k_ESteamNetworkingConfig_LogLevel_Message = 15, // [connection int32] log each message send/recv - k_ESteamNetworkingConfig_LogLevel_PacketGaps = 16, // [connection int32] dropped packets - k_ESteamNetworkingConfig_LogLevel_P2PRendezvous = 17, // [connection int32] P2P rendezvous messages - k_ESteamNetworkingConfig_LogLevel_SDRRelayPings = 18, // [global int32] Ping relays - -// -// Experimental values. These are subject to be deleted or change at any time, -// do not set them, except as a result of an explicit and advanced user opt-in, -// and do not write anything that depends on them existing, or have any particular -// behaviour. -// - // [global int32] ECN value to send in every packet. - // -1 = The default, and means "auto". We will set ECN=1, if it appears that the local internet connection appears to understand it and there may be some benefit. - // 0..2 = use that value. - k_ESteamNetworkingConfig_ECN = 999, - - // [global int32] If true, send and request different TOS values in probes to relays - // to try to deduce if there is any bleaching or mutating of the TOS field in either direction - k_ESteamNetworkingConfig_SDRClient_EnableTOSProbes = 998, - -// -// Deleted, do not use -// - k_ESteamNetworkingConfig_DELETED_EnumerateDevVars = 35, - - k_ESteamNetworkingConfigValue__Force32Bit = 0x7fffffff -}; - -// Bitmask of types to share -const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Default = -1; // Special value - use user defaults -const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Disable = 0; // Do not do any ICE work at all or share any IP addresses with peer -const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Relay = 1; // Relayed connection via TURN server. -const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Private = 2; // host addresses that appear to be link-local or RFC1918 addresses -const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Public = 4; // STUN reflexive addresses, or host address that isn't a "private" address -const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_All = 0x7fffffff; - -/// In a few places we need to set configuration options on listen sockets and connections, and -/// have them take effect *before* the listen socket or connection really starts doing anything. -/// Creating the object and then setting the options "immediately" after creation doesn't work -/// completely, because network packets could be received between the time the object is created and -/// when the options are applied. To set options at creation time in a reliable way, they must be -/// passed to the creation function. This structure is used to pass those options. -/// -/// For the meaning of these fields, see ISteamNetworkingUtils::SetConfigValue. Basically -/// when the object is created, we just iterate over the list of options and call -/// ISteamNetworkingUtils::SetConfigValueStruct, where the scope arguments are supplied by the -/// object being created. -struct SteamNetworkingConfigValue_t -{ - /// Which option is being set - ESteamNetworkingConfigValue m_eValue; - - /// Which field below did you fill in? - ESteamNetworkingConfigDataType m_eDataType; - - /// Option value - union - { - int32_t m_int32; - int64_t m_int64; - float m_float; - const char *m_string; // Points to your '\0'-terminated buffer - void *m_ptr; - } m_val; - - // - // Shortcut helpers to set the type and value in a single call - // - inline void SetInt32( ESteamNetworkingConfigValue eVal, int32_t data ) - { - m_eValue = eVal; - m_eDataType = k_ESteamNetworkingConfig_Int32; - m_val.m_int32 = data; - } - inline void SetInt64( ESteamNetworkingConfigValue eVal, int64_t data ) - { - m_eValue = eVal; - m_eDataType = k_ESteamNetworkingConfig_Int64; - m_val.m_int64 = data; - } - inline void SetFloat( ESteamNetworkingConfigValue eVal, float data ) - { - m_eValue = eVal; - m_eDataType = k_ESteamNetworkingConfig_Float; - m_val.m_float = data; - } - inline void SetPtr( ESteamNetworkingConfigValue eVal, void *data ) - { - m_eValue = eVal; - m_eDataType = k_ESteamNetworkingConfig_Ptr; - m_val.m_ptr = data; - } - inline void SetString( ESteamNetworkingConfigValue eVal, const char *data ) // WARNING - Just saves your pointer. Does NOT make a copy of the string - { - m_eValue = eVal; - m_eDataType = k_ESteamNetworkingConfig_Ptr; - m_val.m_string = data; - } -}; - -/// Return value of ISteamNetworkintgUtils::GetConfigValue -enum ESteamNetworkingGetConfigValueResult -{ - k_ESteamNetworkingGetConfigValue_BadValue = -1, // No such configuration value - k_ESteamNetworkingGetConfigValue_BadScopeObj = -2, // Bad connection handle, etc - k_ESteamNetworkingGetConfigValue_BufferTooSmall = -3, // Couldn't fit the result in your buffer - k_ESteamNetworkingGetConfigValue_OK = 1, - k_ESteamNetworkingGetConfigValue_OKInherited = 2, // A value was not set at this level, but the effective (inherited) value was returned. - - k_ESteamNetworkingGetConfigValueResult__Force32Bit = 0x7fffffff -}; - -// -// Debug output -// - -/// Detail level for diagnostic output callback. -/// See ISteamNetworkingUtils::SetDebugOutputFunction -enum ESteamNetworkingSocketsDebugOutputType -{ - k_ESteamNetworkingSocketsDebugOutputType_None = 0, - k_ESteamNetworkingSocketsDebugOutputType_Bug = 1, // You used the API incorrectly, or an internal error happened - k_ESteamNetworkingSocketsDebugOutputType_Error = 2, // Run-time error condition that isn't the result of a bug. (E.g. we are offline, cannot bind a port, etc) - k_ESteamNetworkingSocketsDebugOutputType_Important = 3, // Nothing is wrong, but this is an important notification - k_ESteamNetworkingSocketsDebugOutputType_Warning = 4, - k_ESteamNetworkingSocketsDebugOutputType_Msg = 5, // Recommended amount - k_ESteamNetworkingSocketsDebugOutputType_Verbose = 6, // Quite a bit - k_ESteamNetworkingSocketsDebugOutputType_Debug = 7, // Practically everything - k_ESteamNetworkingSocketsDebugOutputType_Everything = 8, // Wall of text, detailed packet contents breakdown, etc - - k_ESteamNetworkingSocketsDebugOutputType__Force32Bit = 0x7fffffff -}; - -/// Setup callback for debug output, and the desired verbosity you want. -typedef void (*FSteamNetworkingSocketsDebugOutput)( ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg ); - -// -// Valve data centers -// - -/// Convert 3- or 4-character ID to 32-bit int. -inline SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString( const char *pszCode ) -{ - // OK we made a bad decision when we decided how to pack 3-character codes into a uint32. We'd like to support - // 4-character codes, but we don't want to break compatibility. The migration path has some subtleties that make - // this nontrivial, and there are already some IDs stored in SQL. Ug, so the 4 character code "abcd" will - // be encoded with the digits like "0xddaabbcc". - // - // Also: we don't currently use 1- or 2-character codes, but if ever do in the future, let's make sure don't read - // past the end of the string and access uninitialized memory. (And if the string is empty, we always want - // to return 0 and not read bytes past the '\0'.) - // - // There is also extra paranoia to make sure the bytes are not treated as signed. - SteamNetworkingPOPID result = (uint32)(uint8)pszCode[0] << 16U; - if ( result && pszCode[1] ) - { - result |= ( (uint32)(uint8)pszCode[1] << 8U ); - if ( pszCode[2] ) - { - result |= (uint32)(uint8)pszCode[2] | ( (uint32)(uint8)pszCode[3] << 24U ); - } - } - return result; -} - -/// Unpack integer to string representation, including terminating '\0' -/// -/// See also SteamNetworkingPOPIDRender -template -inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id, char (&szCode)[N] ) -{ - static_assert( N >= 5, "Fixed-size buffer not big enough to hold SDR POP ID" ); - szCode[0] = char( id >> 16U ); - szCode[1] = char( id >> 8U ); - szCode[2] = char( id ); - szCode[3] = char( id >> 24U ); // See comment above about deep regret and sadness - szCode[4] = 0; -} - -/// The POPID "dev" is used in non-production environments for testing. -const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( (uint32)'d' << 16U ) | ( (uint32)'e' << 8U ) | (uint32)'v'; - -#ifndef API_GEN - -/// Utility class for printing a SteamNetworkingPOPID. -struct SteamNetworkingPOPIDRender -{ - SteamNetworkingPOPIDRender( SteamNetworkingPOPID x ) { GetSteamNetworkingLocationPOPStringFromID( x, buf ); } - inline const char *c_str() const { return buf; } -private: - char buf[ 8 ]; -}; - -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// Internal stuff -#ifndef API_GEN - -// For code compatibility -typedef SteamNetworkingMessage_t ISteamNetworkingMessage; -typedef SteamNetworkingErrMsg SteamDatagramErrMsg; - -inline void SteamNetworkingIPAddr::Clear() { memset( this, 0, sizeof(*this) ); } -inline bool SteamNetworkingIPAddr::IsIPv6AllZeros() const { const uint64 *q = (const uint64 *)m_ipv6; return q[0] == 0 && q[1] == 0; } -inline void SteamNetworkingIPAddr::SetIPv6( const uint8 *ipv6, uint16 nPort ) { memcpy( m_ipv6, ipv6, 16 ); m_port = nPort; } -inline void SteamNetworkingIPAddr::SetIPv4( uint32 nIP, uint16 nPort ) { m_ipv4.m_8zeros = 0; m_ipv4.m_0000 = 0; m_ipv4.m_ffff = 0xffff; m_ipv4.m_ip[0] = uint8(nIP>>24); m_ipv4.m_ip[1] = uint8(nIP>>16); m_ipv4.m_ip[2] = uint8(nIP>>8); m_ipv4.m_ip[3] = uint8(nIP); m_port = nPort; } -inline bool SteamNetworkingIPAddr::IsIPv4() const { return m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0xffff; } -inline uint32 SteamNetworkingIPAddr::GetIPv4() const { return IsIPv4() ? ( (uint32(m_ipv4.m_ip[0])<<24) | (uint32(m_ipv4.m_ip[1])<<16) | (uint32(m_ipv4.m_ip[2])<<8) | uint32(m_ipv4.m_ip[3]) ) : 0; } -inline void SteamNetworkingIPAddr::SetIPv6LocalHost( uint16 nPort ) { m_ipv4.m_8zeros = 0; m_ipv4.m_0000 = 0; m_ipv4.m_ffff = 0; m_ipv6[12] = 0; m_ipv6[13] = 0; m_ipv6[14] = 0; m_ipv6[15] = 1; m_port = nPort; } -inline bool SteamNetworkingIPAddr::IsLocalHost() const { return ( m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0 && m_ipv6[12] == 0 && m_ipv6[13] == 0 && m_ipv6[14] == 0 && m_ipv6[15] == 1 ) || ( GetIPv4() == 0x7f000001 ); } -inline bool SteamNetworkingIPAddr::operator==(const SteamNetworkingIPAddr &x ) const { return memcmp( this, &x, sizeof(SteamNetworkingIPAddr) ) == 0; } - -inline void SteamNetworkingIdentity::Clear() { memset( this, 0, sizeof(*this) ); } -inline bool SteamNetworkingIdentity::IsInvalid() const { return m_eType == k_ESteamNetworkingIdentityType_Invalid; } -inline void SteamNetworkingIdentity::SetSteamID( CSteamID steamID ) { SetSteamID64( steamID.ConvertToUint64() ); } -inline CSteamID SteamNetworkingIdentity::GetSteamID() const { return CSteamID( GetSteamID64() ); } -inline void SteamNetworkingIdentity::SetSteamID64( uint64 steamID ) { m_eType = k_ESteamNetworkingIdentityType_SteamID; m_cbSize = sizeof( m_steamID64 ); m_steamID64 = steamID; } -inline uint64 SteamNetworkingIdentity::GetSteamID64() const { return m_eType == k_ESteamNetworkingIdentityType_SteamID ? m_steamID64 : 0; } -inline bool SteamNetworkingIdentity::SetXboxPairwiseID( const char *pszString ) { size_t l = strlen( pszString ); if ( l < 1 || l >= sizeof(m_szXboxPairwiseID) ) return false; - m_eType = k_ESteamNetworkingIdentityType_XboxPairwiseID; m_cbSize = int(l+1); memcpy( m_szXboxPairwiseID, pszString, m_cbSize ); return true; } -inline const char *SteamNetworkingIdentity::GetXboxPairwiseID() const { return m_eType == k_ESteamNetworkingIdentityType_XboxPairwiseID ? m_szXboxPairwiseID : NULL; } -inline void SteamNetworkingIdentity::SetPSNID( uint64 id ) { m_eType = k_ESteamNetworkingIdentityType_SonyPSN; m_cbSize = sizeof( m_PSNID ); m_PSNID = id; } -inline uint64 SteamNetworkingIdentity::GetPSNID() const { return m_eType == k_ESteamNetworkingIdentityType_SonyPSN ? m_PSNID : 0; } -inline void SteamNetworkingIdentity::SetIPAddr( const SteamNetworkingIPAddr &addr ) { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip = addr; } -inline const SteamNetworkingIPAddr *SteamNetworkingIdentity::GetIPAddr() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? &m_ip : NULL; } -inline void SteamNetworkingIdentity::SetIPv4Addr( uint32 nIPv4, uint16 nPort ) { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip.SetIPv4( nIPv4, nPort ); } -inline uint32 SteamNetworkingIdentity::GetIPv4() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? m_ip.GetIPv4() : 0; } -inline ESteamNetworkingFakeIPType SteamNetworkingIdentity::GetFakeIPType() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? m_ip.GetFakeIPType() : k_ESteamNetworkingFakeIPType_Invalid; } -inline void SteamNetworkingIdentity::SetLocalHost() { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip.SetIPv6LocalHost(); } -inline bool SteamNetworkingIdentity::IsLocalHost() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress && m_ip.IsLocalHost(); } -inline bool SteamNetworkingIdentity::SetGenericString( const char *pszString ) { size_t l = strlen( pszString ); if ( l >= sizeof(m_szGenericString) ) return false; - m_eType = k_ESteamNetworkingIdentityType_GenericString; m_cbSize = int(l+1); memcpy( m_szGenericString, pszString, m_cbSize ); return true; } -inline const char *SteamNetworkingIdentity::GetGenericString() const { return m_eType == k_ESteamNetworkingIdentityType_GenericString ? m_szGenericString : NULL; } -inline bool SteamNetworkingIdentity::SetGenericBytes( const void *data, size_t cbLen ) { if ( cbLen > sizeof(m_genericBytes) ) return false; - m_eType = k_ESteamNetworkingIdentityType_GenericBytes; m_cbSize = int(cbLen); memcpy( m_genericBytes, data, m_cbSize ); return true; } -inline const uint8 *SteamNetworkingIdentity::GetGenericBytes( int &cbLen ) const { if ( m_eType != k_ESteamNetworkingIdentityType_GenericBytes ) return NULL; - cbLen = m_cbSize; return m_genericBytes; } -inline bool SteamNetworkingIdentity::operator==(const SteamNetworkingIdentity &x ) const { return m_eType == x.m_eType && m_cbSize == x.m_cbSize && memcmp( m_genericBytes, x.m_genericBytes, m_cbSize ) == 0; } -inline void SteamNetworkingMessage_t::Release() { (*m_pfnRelease)( this ); } - -#endif // #ifndef API_GEN - -#endif // #ifndef STEAMNETWORKINGTYPES diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamtypes.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamtypes.h deleted file mode 100644 index 43002ebef2c..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamtypes.h +++ /dev/null @@ -1,183 +0,0 @@ -//========= Copyright 1996-2022, Valve LLC, All rights reserved. ============ - -#ifndef STEAMTYPES_H -#define STEAMTYPES_H - -#define S_CALLTYPE __cdecl -// WARNING: __cdecl is potentially #defined away in steam_api_common.h - -// Steam-specific types. Defined here so this header file can be included in other code bases. -#ifndef WCHARTYPES_H -typedef unsigned char uint8; -#endif - -#ifdef __GNUC__ - #if __GNUC__ < 4 - #error "Steamworks requires GCC 4.X (4.2 or 4.4 have been tested)" - #endif -#endif - -#if defined(__LP64__) || defined(__x86_64__) || defined(_WIN64) || defined(__aarch64__) || defined(__s390x__) -#define X64BITS -#endif - -#if !defined(VALVE_BIG_ENDIAN) -#if defined(_PS3) -// Make sure VALVE_BIG_ENDIAN gets set on PS3, may already be set previously in Valve internal code. -#define VALVE_BIG_ENDIAN 1 -#endif -#if defined( __GNUC__ ) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define VALVE_BIG_ENDIAN 1 -#endif -#endif - -typedef unsigned char uint8; -typedef signed char int8; - -#if defined( _WIN32 ) && !defined( __GNUC__ ) - -typedef __int16 int16; -typedef unsigned __int16 uint16; -typedef __int32 int32; -//typedef unsigned __int32 uint32; -typedef unsigned long uint32; -typedef __int64 int64; -typedef unsigned __int64 uint64; - -typedef int64 lint64; -typedef uint64 ulint64; - -#ifdef X64BITS -typedef __int64 intp; // intp is an integer that can accomodate a pointer -typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *) -#else -typedef __int32 intp; -typedef unsigned __int32 uintp; -#endif - -#else // _WIN32 - -typedef short int16; -typedef unsigned short uint16; -typedef int int32; -typedef unsigned int uint32; -typedef long long int64; -typedef unsigned long long uint64; - -// [u]int64 are actually defined as 'long long' and gcc 64-bit -// doesn't automatically consider them the same as 'long int'. -// Changing the types for [u]int64 is complicated by -// there being many definitions, so we just -// define a 'long int' here and use it in places that would -// otherwise confuse the compiler. -typedef long int lint64; -typedef unsigned long int ulint64; - -#ifdef X64BITS -typedef long long intp; -typedef unsigned long long uintp; -#else -typedef int intp; -typedef unsigned int uintp; -#endif - -#endif // else _WIN32 - -typedef uint32 AppId_t; -const AppId_t k_uAppIdInvalid = 0x0; - -// AppIds and DepotIDs also presently share the same namespace -typedef uint32 DepotId_t; -const DepotId_t k_uDepotIdInvalid = 0x0; - -// RTime32. Seconds elapsed since Jan 1 1970, i.e. unix timestamp. -// It's the same as time_t, but it is always 32-bit and unsigned. -typedef uint32 RTime32; - -// handle to a Steam API call -typedef uint64 SteamAPICall_t; -const SteamAPICall_t k_uAPICallInvalid = 0x0; - -typedef uint32 AccountID_t; -const AccountID_t k_uAccountIdInvalid = 0; - -// Party Beacon ID -typedef uint64 PartyBeaconID_t; -const PartyBeaconID_t k_ulPartyBeaconIdInvalid = 0; - -enum ESteamIPType -{ - k_ESteamIPTypeIPv4 = 0, - k_ESteamIPTypeIPv6 = 1, -}; - -#pragma pack( push, 1 ) - -struct SteamIPAddress_t -{ - union { - - uint32 m_unIPv4; // Host order - uint8 m_rgubIPv6[16]; // Network order! Same as inaddr_in6. (0011:2233:4455:6677:8899:aabb:ccdd:eeff) - - // Internal use only - uint64 m_ipv6Qword[2]; // big endian - }; - - ESteamIPType m_eType; - - bool IsSet() const - { - if ( k_ESteamIPTypeIPv4 == m_eType ) - { - return m_unIPv4 != 0; - } - else - { - return m_ipv6Qword[0] !=0 || m_ipv6Qword[1] != 0; - } - } - - static SteamIPAddress_t IPv4Any() - { - SteamIPAddress_t ipOut; - ipOut.m_eType = k_ESteamIPTypeIPv4; - ipOut.m_unIPv4 = 0; - - return ipOut; - } - - static SteamIPAddress_t IPv6Any() - { - SteamIPAddress_t ipOut; - ipOut.m_eType = k_ESteamIPTypeIPv6; - ipOut.m_ipv6Qword[0] = 0; - ipOut.m_ipv6Qword[1] = 0; - - return ipOut; - } - - static SteamIPAddress_t IPv4Loopback() - { - SteamIPAddress_t ipOut; - ipOut.m_eType = k_ESteamIPTypeIPv4; - ipOut.m_unIPv4 = 0x7f000001; - - return ipOut; - } - - static SteamIPAddress_t IPv6Loopback() - { - SteamIPAddress_t ipOut; - ipOut.m_eType = k_ESteamIPTypeIPv6; - ipOut.m_ipv6Qword[0] = 0; - ipOut.m_ipv6Qword[1] = 0; - ipOut.m_rgubIPv6[15] = 1; - - return ipOut; - } -}; - -#pragma pack( pop ) - -#endif // STEAMTYPES_H diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamuniverse.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamuniverse.h deleted file mode 100644 index dd384dcc4c2..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamuniverse.h +++ /dev/null @@ -1,27 +0,0 @@ -//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -//============================================================================= - -#ifndef STEAMUNIVERSE_H -#define STEAMUNIVERSE_H -#ifdef _WIN32 -#pragma once -#endif - - -// Steam universes. Each universe is a self-contained Steam instance. -enum EUniverse -{ - k_EUniverseInvalid = 0, - k_EUniversePublic = 1, - k_EUniverseBeta = 2, - k_EUniverseInternal = 3, - k_EUniverseDev = 4, - // k_EUniverseRC = 5, // no such universe anymore - k_EUniverseMax -}; - - -#endif // STEAMUNIVERSE_H diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/curl.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/curl.h deleted file mode 100644 index eb06022501c..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/curl.h +++ /dev/null @@ -1,3239 +0,0 @@ -#ifndef CURLINC_CURL_H -#define CURLINC_CURL_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -/* - * If you have libcurl problems, all docs and details are found here: - * https://curl.se/libcurl/ - */ - -#ifdef CURL_NO_OLDIES -#define CURL_STRICTER -#endif - -/* Compile-time deprecation macros. */ -#if defined(__GNUC__) && \ - ((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1 ))) && \ - !defined(__INTEL_COMPILER) && \ - !defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL) -#define CURL_DEPRECATED(version, message) \ - __attribute__((deprecated("since " # version ". " message))) -#define CURL_IGNORE_DEPRECATION(statements) \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ - statements \ - _Pragma("GCC diagnostic pop") -#else -#define CURL_DEPRECATED(version, message) -#define CURL_IGNORE_DEPRECATION(statements) statements -#endif - -#include "curlver.h" /* libcurl version defines */ -#include "system.h" /* determine things run-time */ - -#include -#include - -#if defined(__FreeBSD__) || defined(__MidnightBSD__) -/* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */ -#include -#endif - -/* The include stuff here below is mainly for time_t! */ -#include -#include - -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) -#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \ - defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H)) -/* The check above prevents the winsock2 inclusion if winsock.h already was - included, since they can't co-exist without problems */ -#include -#include -#endif -#endif - -/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish - libc5-based Linux systems. Only include it on systems that are known to - require it! */ -#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ - defined(__minix) || defined(__INTEGRITY) || \ - defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \ - defined(__CYGWIN__) || defined(AMIGA) || defined(__NuttX__) || \ - (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) || \ - (defined(__MidnightBSD_version) && (__MidnightBSD_version < 100000)) || \ - defined(__sun__) || defined(__serenity__) || defined(__vxworks__) -#include -#endif - -#if !defined(_WIN32) && !defined(_WIN32_WCE) -#include -#endif - -#if !defined(_WIN32) -#include -#endif - -/* Compatibility for non-Clang compilers */ -#ifndef __has_declspec_attribute -# define __has_declspec_attribute(x) 0 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER) -typedef struct Curl_easy CURL; -typedef struct Curl_share CURLSH; -#else -typedef void CURL; -typedef void CURLSH; -#endif - -/* - * libcurl external API function linkage decorations. - */ - -#ifdef CURL_STATICLIB -# define CURL_EXTERN -#elif defined(_WIN32) || \ - (__has_declspec_attribute(dllexport) && \ - __has_declspec_attribute(dllimport)) -# if defined(BUILDING_LIBCURL) -# define CURL_EXTERN __declspec(dllexport) -# else -# define CURL_EXTERN __declspec(dllimport) -# endif -#elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS) -# define CURL_EXTERN CURL_EXTERN_SYMBOL -#else -# define CURL_EXTERN -#endif - -#ifndef curl_socket_typedef -/* socket typedef */ -#if defined(_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H) -typedef SOCKET curl_socket_t; -#define CURL_SOCKET_BAD INVALID_SOCKET -#else -typedef int curl_socket_t; -#define CURL_SOCKET_BAD -1 -#endif -#define curl_socket_typedef -#endif /* curl_socket_typedef */ - -/* enum for the different supported SSL backends */ -typedef enum { - CURLSSLBACKEND_NONE = 0, - CURLSSLBACKEND_OPENSSL = 1, - CURLSSLBACKEND_GNUTLS = 2, - CURLSSLBACKEND_NSS CURL_DEPRECATED(8.3.0, "") = 3, - CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */ - CURLSSLBACKEND_GSKIT CURL_DEPRECATED(8.3.0, "") = 5, - CURLSSLBACKEND_POLARSSL CURL_DEPRECATED(7.69.0, "") = 6, - CURLSSLBACKEND_WOLFSSL = 7, - CURLSSLBACKEND_SCHANNEL = 8, - CURLSSLBACKEND_SECURETRANSPORT = 9, - CURLSSLBACKEND_AXTLS CURL_DEPRECATED(7.61.0, "") = 10, - CURLSSLBACKEND_MBEDTLS = 11, - CURLSSLBACKEND_MESALINK CURL_DEPRECATED(7.82.0, "") = 12, - CURLSSLBACKEND_BEARSSL = 13, - CURLSSLBACKEND_RUSTLS = 14 -} curl_sslbackend; - -/* aliases for library clones and renames */ -#define CURLSSLBACKEND_AWSLC CURLSSLBACKEND_OPENSSL -#define CURLSSLBACKEND_BORINGSSL CURLSSLBACKEND_OPENSSL -#define CURLSSLBACKEND_LIBRESSL CURLSSLBACKEND_OPENSSL - -/* deprecated names: */ -#define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL -#define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT - -struct curl_httppost { - struct curl_httppost *next; /* next entry in the list */ - char *name; /* pointer to allocated name */ - long namelength; /* length of name length */ - char *contents; /* pointer to allocated data contents */ - long contentslength; /* length of contents field, see also - CURL_HTTPPOST_LARGE */ - char *buffer; /* pointer to allocated buffer contents */ - long bufferlength; /* length of buffer field */ - char *contenttype; /* Content-Type */ - struct curl_slist *contentheader; /* list of extra headers for this form */ - struct curl_httppost *more; /* if one field name has more than one - file, this link should link to following - files */ - long flags; /* as defined below */ - -/* specified content is a file name */ -#define CURL_HTTPPOST_FILENAME (1<<0) -/* specified content is a file name */ -#define CURL_HTTPPOST_READFILE (1<<1) -/* name is only stored pointer do not free in formfree */ -#define CURL_HTTPPOST_PTRNAME (1<<2) -/* contents is only stored pointer do not free in formfree */ -#define CURL_HTTPPOST_PTRCONTENTS (1<<3) -/* upload file from buffer */ -#define CURL_HTTPPOST_BUFFER (1<<4) -/* upload file from pointer contents */ -#define CURL_HTTPPOST_PTRBUFFER (1<<5) -/* upload file contents by using the regular read callback to get the data and - pass the given pointer as custom pointer */ -#define CURL_HTTPPOST_CALLBACK (1<<6) -/* use size in 'contentlen', added in 7.46.0 */ -#define CURL_HTTPPOST_LARGE (1<<7) - - char *showfilename; /* The file name to show. If not set, the - actual file name will be used (if this - is a file part) */ - void *userp; /* custom pointer used for - HTTPPOST_CALLBACK posts */ - curl_off_t contentlen; /* alternative length of contents - field. Used if CURL_HTTPPOST_LARGE is - set. Added in 7.46.0 */ -}; - - -/* This is a return code for the progress callback that, when returned, will - signal libcurl to continue executing the default progress function */ -#define CURL_PROGRESSFUNC_CONTINUE 0x10000001 - -/* This is the CURLOPT_PROGRESSFUNCTION callback prototype. It is now - considered deprecated but was the only choice up until 7.31.0 */ -typedef int (*curl_progress_callback)(void *clientp, - double dltotal, - double dlnow, - double ultotal, - double ulnow); - -/* This is the CURLOPT_XFERINFOFUNCTION callback prototype. It was introduced - in 7.32.0, avoids the use of floating point numbers and provides more - detailed information. */ -typedef int (*curl_xferinfo_callback)(void *clientp, - curl_off_t dltotal, - curl_off_t dlnow, - curl_off_t ultotal, - curl_off_t ulnow); - -#ifndef CURL_MAX_READ_SIZE - /* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */ -#define CURL_MAX_READ_SIZE (10*1024*1024) -#endif - -#ifndef CURL_MAX_WRITE_SIZE - /* Tests have proven that 20K is a very bad buffer size for uploads on - Windows, while 16K for some odd reason performed a lot better. - We do the ifndef check to allow this value to easier be changed at build - time for those who feel adventurous. The practical minimum is about - 400 bytes since libcurl uses a buffer of this size as a scratch area - (unrelated to network send operations). */ -#define CURL_MAX_WRITE_SIZE 16384 -#endif - -#ifndef CURL_MAX_HTTP_HEADER -/* The only reason to have a max limit for this is to avoid the risk of a bad - server feeding libcurl with a never-ending header that will cause reallocs - infinitely */ -#define CURL_MAX_HTTP_HEADER (100*1024) -#endif - -/* This is a magic return code for the write callback that, when returned, - will signal libcurl to pause receiving on the current transfer. */ -#define CURL_WRITEFUNC_PAUSE 0x10000001 - -/* This is a magic return code for the write callback that, when returned, - will signal an error from the callback. */ -#define CURL_WRITEFUNC_ERROR 0xFFFFFFFF - -typedef size_t (*curl_write_callback)(char *buffer, - size_t size, - size_t nitems, - void *outstream); - -/* This callback will be called when a new resolver request is made */ -typedef int (*curl_resolver_start_callback)(void *resolver_state, - void *reserved, void *userdata); - -/* enumeration of file types */ -typedef enum { - CURLFILETYPE_FILE = 0, - CURLFILETYPE_DIRECTORY, - CURLFILETYPE_SYMLINK, - CURLFILETYPE_DEVICE_BLOCK, - CURLFILETYPE_DEVICE_CHAR, - CURLFILETYPE_NAMEDPIPE, - CURLFILETYPE_SOCKET, - CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */ - - CURLFILETYPE_UNKNOWN /* should never occur */ -} curlfiletype; - -#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0) -#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1) -#define CURLFINFOFLAG_KNOWN_TIME (1<<2) -#define CURLFINFOFLAG_KNOWN_PERM (1<<3) -#define CURLFINFOFLAG_KNOWN_UID (1<<4) -#define CURLFINFOFLAG_KNOWN_GID (1<<5) -#define CURLFINFOFLAG_KNOWN_SIZE (1<<6) -#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7) - -/* Information about a single file, used when doing FTP wildcard matching */ -struct curl_fileinfo { - char *filename; - curlfiletype filetype; - time_t time; /* always zero! */ - unsigned int perm; - int uid; - int gid; - curl_off_t size; - long int hardlinks; - - struct { - /* If some of these fields is not NULL, it is a pointer to b_data. */ - char *time; - char *perm; - char *user; - char *group; - char *target; /* pointer to the target filename of a symlink */ - } strings; - - unsigned int flags; - - /* These are libcurl private struct fields. Previously used by libcurl, so - they must never be interfered with. */ - char *b_data; - size_t b_size; - size_t b_used; -}; - -/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */ -#define CURL_CHUNK_BGN_FUNC_OK 0 -#define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */ -#define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */ - -/* if splitting of data transfer is enabled, this callback is called before - download of an individual chunk started. Note that parameter "remains" works - only for FTP wildcard downloading (for now), otherwise is not used */ -typedef long (*curl_chunk_bgn_callback)(const void *transfer_info, - void *ptr, - int remains); - -/* return codes for CURLOPT_CHUNK_END_FUNCTION */ -#define CURL_CHUNK_END_FUNC_OK 0 -#define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */ - -/* If splitting of data transfer is enabled this callback is called after - download of an individual chunk finished. - Note! After this callback was set then it have to be called FOR ALL chunks. - Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC. - This is the reason why we don't need "transfer_info" parameter in this - callback and we are not interested in "remains" parameter too. */ -typedef long (*curl_chunk_end_callback)(void *ptr); - -/* return codes for FNMATCHFUNCTION */ -#define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */ -#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */ -#define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */ - -/* callback type for wildcard downloading pattern matching. If the - string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */ -typedef int (*curl_fnmatch_callback)(void *ptr, - const char *pattern, - const char *string); - -/* These are the return codes for the seek callbacks */ -#define CURL_SEEKFUNC_OK 0 -#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */ -#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so - libcurl might try other means instead */ -typedef int (*curl_seek_callback)(void *instream, - curl_off_t offset, - int origin); /* 'whence' */ - -/* This is a return code for the read callback that, when returned, will - signal libcurl to immediately abort the current transfer. */ -#define CURL_READFUNC_ABORT 0x10000000 -/* This is a return code for the read callback that, when returned, will - signal libcurl to pause sending data on the current transfer. */ -#define CURL_READFUNC_PAUSE 0x10000001 - -/* Return code for when the trailing headers' callback has terminated - without any errors */ -#define CURL_TRAILERFUNC_OK 0 -/* Return code for when was an error in the trailing header's list and we - want to abort the request */ -#define CURL_TRAILERFUNC_ABORT 1 - -typedef size_t (*curl_read_callback)(char *buffer, - size_t size, - size_t nitems, - void *instream); - -typedef int (*curl_trailer_callback)(struct curl_slist **list, - void *userdata); - -typedef enum { - CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ - CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */ - CURLSOCKTYPE_LAST /* never use */ -} curlsocktype; - -/* The return code from the sockopt_callback can signal information back - to libcurl: */ -#define CURL_SOCKOPT_OK 0 -#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return - CURLE_ABORTED_BY_CALLBACK */ -#define CURL_SOCKOPT_ALREADY_CONNECTED 2 - -typedef int (*curl_sockopt_callback)(void *clientp, - curl_socket_t curlfd, - curlsocktype purpose); - -struct curl_sockaddr { - int family; - int socktype; - int protocol; - unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it - turned really ugly and painful on the systems that - lack this type */ - struct sockaddr addr; -}; - -typedef curl_socket_t -(*curl_opensocket_callback)(void *clientp, - curlsocktype purpose, - struct curl_sockaddr *address); - -typedef int -(*curl_closesocket_callback)(void *clientp, curl_socket_t item); - -typedef enum { - CURLIOE_OK, /* I/O operation successful */ - CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ - CURLIOE_FAILRESTART, /* failed to restart the read */ - CURLIOE_LAST /* never use */ -} curlioerr; - -typedef enum { - CURLIOCMD_NOP, /* no operation */ - CURLIOCMD_RESTARTREAD, /* restart the read stream from start */ - CURLIOCMD_LAST /* never use */ -} curliocmd; - -typedef curlioerr (*curl_ioctl_callback)(CURL *handle, - int cmd, - void *clientp); - -#ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS -/* - * The following typedef's are signatures of malloc, free, realloc, strdup and - * calloc respectively. Function pointers of these types can be passed to the - * curl_global_init_mem() function to set user defined memory management - * callback routines. - */ -typedef void *(*curl_malloc_callback)(size_t size); -typedef void (*curl_free_callback)(void *ptr); -typedef void *(*curl_realloc_callback)(void *ptr, size_t size); -typedef char *(*curl_strdup_callback)(const char *str); -typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); - -#define CURL_DID_MEMORY_FUNC_TYPEDEFS -#endif - -/* the kind of data that is passed to information_callback */ -typedef enum { - CURLINFO_TEXT = 0, - CURLINFO_HEADER_IN, /* 1 */ - CURLINFO_HEADER_OUT, /* 2 */ - CURLINFO_DATA_IN, /* 3 */ - CURLINFO_DATA_OUT, /* 4 */ - CURLINFO_SSL_DATA_IN, /* 5 */ - CURLINFO_SSL_DATA_OUT, /* 6 */ - CURLINFO_END -} curl_infotype; - -typedef int (*curl_debug_callback) - (CURL *handle, /* the handle/transfer this concerns */ - curl_infotype type, /* what kind of data */ - char *data, /* points to the data */ - size_t size, /* size of the data pointed to */ - void *userptr); /* whatever the user please */ - -/* This is the CURLOPT_PREREQFUNCTION callback prototype. */ -typedef int (*curl_prereq_callback)(void *clientp, - char *conn_primary_ip, - char *conn_local_ip, - int conn_primary_port, - int conn_local_port); - -/* Return code for when the pre-request callback has terminated without - any errors */ -#define CURL_PREREQFUNC_OK 0 -/* Return code for when the pre-request callback wants to abort the - request */ -#define CURL_PREREQFUNC_ABORT 1 - -/* All possible error codes from all sorts of curl functions. Future versions - may return other values, stay prepared. - - Always add new return codes last. Never *EVER* remove any. The return - codes must remain the same! - */ - -typedef enum { - CURLE_OK = 0, - CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ - CURLE_FAILED_INIT, /* 2 */ - CURLE_URL_MALFORMAT, /* 3 */ - CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for - 7.17.0, reused in April 2011 for 7.21.5] */ - CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ - CURLE_COULDNT_RESOLVE_HOST, /* 6 */ - CURLE_COULDNT_CONNECT, /* 7 */ - CURLE_WEIRD_SERVER_REPLY, /* 8 */ - CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server - due to lack of access - when login fails - this is not returned. */ - CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for - 7.15.4, reused in Dec 2011 for 7.24.0]*/ - CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ - CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server - [was obsoleted in August 2007 for 7.17.0, - reused in Dec 2011 for 7.24.0]*/ - CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ - CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ - CURLE_FTP_CANT_GET_HOST, /* 15 */ - CURLE_HTTP2, /* 16 - A problem in the http2 framing layer. - [was obsoleted in August 2007 for 7.17.0, - reused in July 2014 for 7.38.0] */ - CURLE_FTP_COULDNT_SET_TYPE, /* 17 */ - CURLE_PARTIAL_FILE, /* 18 */ - CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ - CURLE_OBSOLETE20, /* 20 - NOT USED */ - CURLE_QUOTE_ERROR, /* 21 - quote command failure */ - CURLE_HTTP_RETURNED_ERROR, /* 22 */ - CURLE_WRITE_ERROR, /* 23 */ - CURLE_OBSOLETE24, /* 24 - NOT USED */ - CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ - CURLE_READ_ERROR, /* 26 - couldn't open/read from file */ - CURLE_OUT_OF_MEMORY, /* 27 */ - CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ - CURLE_OBSOLETE29, /* 29 - NOT USED */ - CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ - CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ - CURLE_OBSOLETE32, /* 32 - NOT USED */ - CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ - CURLE_HTTP_POST_ERROR, /* 34 */ - CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ - CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ - CURLE_FILE_COULDNT_READ_FILE, /* 37 */ - CURLE_LDAP_CANNOT_BIND, /* 38 */ - CURLE_LDAP_SEARCH_FAILED, /* 39 */ - CURLE_OBSOLETE40, /* 40 - NOT USED */ - CURLE_FUNCTION_NOT_FOUND, /* 41 - NOT USED starting with 7.53.0 */ - CURLE_ABORTED_BY_CALLBACK, /* 42 */ - CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ - CURLE_OBSOLETE44, /* 44 - NOT USED */ - CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ - CURLE_OBSOLETE46, /* 46 - NOT USED */ - CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */ - CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */ - CURLE_SETOPT_OPTION_SYNTAX, /* 49 - Malformed setopt option */ - CURLE_OBSOLETE50, /* 50 - NOT USED */ - CURLE_OBSOLETE51, /* 51 - NOT USED */ - CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ - CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ - CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as - default */ - CURLE_SEND_ERROR, /* 55 - failed sending network data */ - CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ - CURLE_OBSOLETE57, /* 57 - NOT IN USE */ - CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ - CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ - CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint - wasn't verified fine */ - CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */ - CURLE_OBSOLETE62, /* 62 - NOT IN USE since 7.82.0 */ - CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ - CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ - CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind - that failed */ - CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ - CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not - accepted and we failed to login */ - CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ - CURLE_TFTP_PERM, /* 69 - permission problem on server */ - CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */ - CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ - CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ - CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */ - CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ - CURLE_OBSOLETE75, /* 75 - NOT IN USE since 7.82.0 */ - CURLE_OBSOLETE76, /* 76 - NOT IN USE since 7.82.0 */ - CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing - or wrong format */ - CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ - CURLE_SSH, /* 79 - error from the SSH layer, somewhat - generic so the error message will be of - interest when this has happened */ - - CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL - connection */ - CURLE_AGAIN, /* 81 - socket is not ready for send/recv, - wait till it's ready and try again (Added - in 7.18.2) */ - CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or - wrong format (Added in 7.19.0) */ - CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in - 7.19.0) */ - CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */ - CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */ - CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */ - CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */ - CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */ - CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the - session will be queued */ - CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not - match */ - CURLE_SSL_INVALIDCERTSTATUS, /* 91 - invalid certificate status */ - CURLE_HTTP2_STREAM, /* 92 - stream error in HTTP/2 framing layer - */ - CURLE_RECURSIVE_API_CALL, /* 93 - an api function was called from - inside a callback */ - CURLE_AUTH_ERROR, /* 94 - an authentication function returned an - error */ - CURLE_HTTP3, /* 95 - An HTTP/3 layer problem */ - CURLE_QUIC_CONNECT_ERROR, /* 96 - QUIC connection error */ - CURLE_PROXY, /* 97 - proxy handshake error */ - CURLE_SSL_CLIENTCERT, /* 98 - client-side certificate required */ - CURLE_UNRECOVERABLE_POLL, /* 99 - poll/select returned fatal error */ - CURLE_TOO_LARGE, /* 100 - a value/data met its maximum */ - CURL_LAST /* never use! */ -} CURLcode; - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Previously obsolete error code reused in 7.38.0 */ -#define CURLE_OBSOLETE16 CURLE_HTTP2 - -/* Previously obsolete error codes reused in 7.24.0 */ -#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED -#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT - -/* compatibility with older names */ -#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING -#define CURLE_FTP_WEIRD_SERVER_REPLY CURLE_WEIRD_SERVER_REPLY - -/* The following were added in 7.62.0 */ -#define CURLE_SSL_CACERT CURLE_PEER_FAILED_VERIFICATION - -/* The following were added in 7.21.5, April 2011 */ -#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION - -/* Added for 7.78.0 */ -#define CURLE_TELNET_OPTION_SYNTAX CURLE_SETOPT_OPTION_SYNTAX - -/* The following were added in 7.17.1 */ -/* These are scheduled to disappear by 2009 */ -#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION - -/* The following were added in 7.17.0 */ -/* These are scheduled to disappear by 2009 */ -#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */ -#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46 -#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44 -#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10 -#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16 -#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32 -#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29 -#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12 -#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20 -#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40 -#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24 -#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57 -#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN - -#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED -#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE -#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR -#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL -#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS -#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR -#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED - -/* The following were added earlier */ - -#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT -#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR -#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED -#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED -#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE -#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME -#define CURLE_LDAP_INVALID_URL CURLE_OBSOLETE62 -#define CURLE_CONV_REQD CURLE_OBSOLETE76 -#define CURLE_CONV_FAILED CURLE_OBSOLETE75 - -/* This was the error code 50 in 7.7.3 and a few earlier versions, this - is no longer used by libcurl but is instead #defined here only to not - make programs break */ -#define CURLE_ALREADY_COMPLETE 99999 - -/* Provide defines for really old option names */ -#define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */ -#define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */ -#define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA - -/* Since long deprecated options with no code in the lib that does anything - with them. */ -#define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40 -#define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72 - -#endif /* !CURL_NO_OLDIES */ - -/* - * Proxy error codes. Returned in CURLINFO_PROXY_ERROR if CURLE_PROXY was - * return for the transfers. - */ -typedef enum { - CURLPX_OK, - CURLPX_BAD_ADDRESS_TYPE, - CURLPX_BAD_VERSION, - CURLPX_CLOSED, - CURLPX_GSSAPI, - CURLPX_GSSAPI_PERMSG, - CURLPX_GSSAPI_PROTECTION, - CURLPX_IDENTD, - CURLPX_IDENTD_DIFFER, - CURLPX_LONG_HOSTNAME, - CURLPX_LONG_PASSWD, - CURLPX_LONG_USER, - CURLPX_NO_AUTH, - CURLPX_RECV_ADDRESS, - CURLPX_RECV_AUTH, - CURLPX_RECV_CONNECT, - CURLPX_RECV_REQACK, - CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED, - CURLPX_REPLY_COMMAND_NOT_SUPPORTED, - CURLPX_REPLY_CONNECTION_REFUSED, - CURLPX_REPLY_GENERAL_SERVER_FAILURE, - CURLPX_REPLY_HOST_UNREACHABLE, - CURLPX_REPLY_NETWORK_UNREACHABLE, - CURLPX_REPLY_NOT_ALLOWED, - CURLPX_REPLY_TTL_EXPIRED, - CURLPX_REPLY_UNASSIGNED, - CURLPX_REQUEST_FAILED, - CURLPX_RESOLVE_HOST, - CURLPX_SEND_AUTH, - CURLPX_SEND_CONNECT, - CURLPX_SEND_REQUEST, - CURLPX_UNKNOWN_FAIL, - CURLPX_UNKNOWN_MODE, - CURLPX_USER_REJECTED, - CURLPX_LAST /* never use */ -} CURLproxycode; - -/* This prototype applies to all conversion callbacks */ -typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length); - -typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */ - void *ssl_ctx, /* actually an OpenSSL - or WolfSSL SSL_CTX, - or an mbedTLS - mbedtls_ssl_config */ - void *userptr); - -typedef enum { - CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use - CONNECT HTTP/1.1 */ - CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT - HTTP/1.0 */ - CURLPROXY_HTTPS = 2, /* HTTPS but stick to HTTP/1 added in 7.52.0 */ - CURLPROXY_HTTPS2 = 3, /* HTTPS and attempt HTTP/2 added in 8.2.0 */ - CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already - in 7.10 */ - CURLPROXY_SOCKS5 = 5, /* added in 7.10 */ - CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */ - CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the - host name rather than the IP address. added - in 7.18.0 */ -} curl_proxytype; /* this enum was added in 7.10 */ - -/* - * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options: - * - * CURLAUTH_NONE - No HTTP authentication - * CURLAUTH_BASIC - HTTP Basic authentication (default) - * CURLAUTH_DIGEST - HTTP Digest authentication - * CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication - * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated) - * CURLAUTH_NTLM - HTTP NTLM authentication - * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour - * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper - * CURLAUTH_BEARER - HTTP Bearer token authentication - * CURLAUTH_ONLY - Use together with a single other type to force no - * authentication or just that single type - * CURLAUTH_ANY - All fine types set - * CURLAUTH_ANYSAFE - All fine types except Basic - */ - -#define CURLAUTH_NONE ((unsigned long)0) -#define CURLAUTH_BASIC (((unsigned long)1)<<0) -#define CURLAUTH_DIGEST (((unsigned long)1)<<1) -#define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2) -/* Deprecated since the advent of CURLAUTH_NEGOTIATE */ -#define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE -/* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */ -#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE -#define CURLAUTH_NTLM (((unsigned long)1)<<3) -#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4) -#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5) -#define CURLAUTH_BEARER (((unsigned long)1)<<6) -#define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7) -#define CURLAUTH_ONLY (((unsigned long)1)<<31) -#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) -#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) - -#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */ -#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */ -#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */ -#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */ -#define CURLSSH_AUTH_HOST (1<<2) /* host key files */ -#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */ -#define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */ -#define CURLSSH_AUTH_GSSAPI (1<<5) /* gssapi (kerberos, ...) */ -#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY - -#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */ -#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */ -#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */ - -#define CURL_ERROR_SIZE 256 - -enum curl_khtype { - CURLKHTYPE_UNKNOWN, - CURLKHTYPE_RSA1, - CURLKHTYPE_RSA, - CURLKHTYPE_DSS, - CURLKHTYPE_ECDSA, - CURLKHTYPE_ED25519 -}; - -struct curl_khkey { - const char *key; /* points to a null-terminated string encoded with base64 - if len is zero, otherwise to the "raw" data */ - size_t len; - enum curl_khtype keytype; -}; - -/* this is the set of return values expected from the curl_sshkeycallback - callback */ -enum curl_khstat { - CURLKHSTAT_FINE_ADD_TO_FILE, - CURLKHSTAT_FINE, - CURLKHSTAT_REJECT, /* reject the connection, return an error */ - CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now. - Causes a CURLE_PEER_FAILED_VERIFICATION error but the - connection will be left intact etc */ - CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key */ - CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */ -}; - -/* this is the set of status codes pass in to the callback */ -enum curl_khmatch { - CURLKHMATCH_OK, /* match */ - CURLKHMATCH_MISMATCH, /* host found, key mismatch! */ - CURLKHMATCH_MISSING, /* no matching host/key found */ - CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */ -}; - -typedef int - (*curl_sshkeycallback) (CURL *easy, /* easy handle */ - const struct curl_khkey *knownkey, /* known */ - const struct curl_khkey *foundkey, /* found */ - enum curl_khmatch, /* libcurl's view on the keys */ - void *clientp); /* custom pointer passed with */ - /* CURLOPT_SSH_KEYDATA */ - -typedef int - (*curl_sshhostkeycallback) (void *clientp,/* custom pointer passed */ - /* with CURLOPT_SSH_HOSTKEYDATA */ - int keytype, /* CURLKHTYPE */ - const char *key, /* hostkey to check */ - size_t keylen); /* length of the key */ - /* return CURLE_OK to accept */ - /* or something else to refuse */ - - -/* parameter for the CURLOPT_USE_SSL option */ -typedef enum { - CURLUSESSL_NONE, /* do not attempt to use SSL */ - CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */ - CURLUSESSL_CONTROL, /* SSL for the control connection or fail */ - CURLUSESSL_ALL, /* SSL for all communication or fail */ - CURLUSESSL_LAST /* not an option, never use */ -} curl_usessl; - -/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */ - -/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the - name of improving interoperability with older servers. Some SSL libraries - have introduced work-arounds for this flaw but those work-arounds sometimes - make the SSL communication fail. To regain functionality with those broken - servers, a user can this way allow the vulnerability back. */ -#define CURLSSLOPT_ALLOW_BEAST (1<<0) - -/* - NO_REVOKE tells libcurl to disable certificate revocation checks for those - SSL backends where such behavior is present. */ -#define CURLSSLOPT_NO_REVOKE (1<<1) - -/* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain - if possible. The OpenSSL backend has this ability. */ -#define CURLSSLOPT_NO_PARTIALCHAIN (1<<2) - -/* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline - checks and ignore missing revocation list for those SSL backends where such - behavior is present. */ -#define CURLSSLOPT_REVOKE_BEST_EFFORT (1<<3) - -/* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of - operating system. Currently implemented under MS-Windows. */ -#define CURLSSLOPT_NATIVE_CA (1<<4) - -/* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use - a client certificate for authentication. (Schannel) */ -#define CURLSSLOPT_AUTO_CLIENT_CERT (1<<5) - -/* The default connection attempt delay in milliseconds for happy eyeballs. - CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document - this value, keep them in sync. */ -#define CURL_HET_DEFAULT 200L - -/* The default connection upkeep interval in milliseconds. */ -#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Backwards compatibility with older names */ -/* These are scheduled to disappear by 2009 */ - -#define CURLFTPSSL_NONE CURLUSESSL_NONE -#define CURLFTPSSL_TRY CURLUSESSL_TRY -#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL -#define CURLFTPSSL_ALL CURLUSESSL_ALL -#define CURLFTPSSL_LAST CURLUSESSL_LAST -#define curl_ftpssl curl_usessl -#endif /* !CURL_NO_OLDIES */ - -/* parameter for the CURLOPT_FTP_SSL_CCC option */ -typedef enum { - CURLFTPSSL_CCC_NONE, /* do not send CCC */ - CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */ - CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */ - CURLFTPSSL_CCC_LAST /* not an option, never use */ -} curl_ftpccc; - -/* parameter for the CURLOPT_FTPSSLAUTH option */ -typedef enum { - CURLFTPAUTH_DEFAULT, /* let libcurl decide */ - CURLFTPAUTH_SSL, /* use "AUTH SSL" */ - CURLFTPAUTH_TLS, /* use "AUTH TLS" */ - CURLFTPAUTH_LAST /* not an option, never use */ -} curl_ftpauth; - -/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */ -typedef enum { - CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */ - CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD - again if MKD succeeded, for SFTP this does - similar magic */ - CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD - again even if MKD failed! */ - CURLFTP_CREATE_DIR_LAST /* not an option, never use */ -} curl_ftpcreatedir; - -/* parameter for the CURLOPT_FTP_FILEMETHOD option */ -typedef enum { - CURLFTPMETHOD_DEFAULT, /* let libcurl pick */ - CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */ - CURLFTPMETHOD_NOCWD, /* no CWD at all */ - CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */ - CURLFTPMETHOD_LAST /* not an option, never use */ -} curl_ftpmethod; - -/* bitmask defines for CURLOPT_HEADEROPT */ -#define CURLHEADER_UNIFIED 0 -#define CURLHEADER_SEPARATE (1<<0) - -/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */ -#define CURLALTSVC_READONLYFILE (1<<2) -#define CURLALTSVC_H1 (1<<3) -#define CURLALTSVC_H2 (1<<4) -#define CURLALTSVC_H3 (1<<5) - - -struct curl_hstsentry { - char *name; - size_t namelen; - unsigned int includeSubDomains:1; - char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */ -}; - -struct curl_index { - size_t index; /* the provided entry's "index" or count */ - size_t total; /* total number of entries to save */ -}; - -typedef enum { - CURLSTS_OK, - CURLSTS_DONE, - CURLSTS_FAIL -} CURLSTScode; - -typedef CURLSTScode (*curl_hstsread_callback)(CURL *easy, - struct curl_hstsentry *e, - void *userp); -typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy, - struct curl_hstsentry *e, - struct curl_index *i, - void *userp); - -/* CURLHSTS_* are bits for the CURLOPT_HSTS option */ -#define CURLHSTS_ENABLE (long)(1<<0) -#define CURLHSTS_READONLYFILE (long)(1<<1) - -/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS - options. Do not use. */ -#define CURLPROTO_HTTP (1<<0) -#define CURLPROTO_HTTPS (1<<1) -#define CURLPROTO_FTP (1<<2) -#define CURLPROTO_FTPS (1<<3) -#define CURLPROTO_SCP (1<<4) -#define CURLPROTO_SFTP (1<<5) -#define CURLPROTO_TELNET (1<<6) -#define CURLPROTO_LDAP (1<<7) -#define CURLPROTO_LDAPS (1<<8) -#define CURLPROTO_DICT (1<<9) -#define CURLPROTO_FILE (1<<10) -#define CURLPROTO_TFTP (1<<11) -#define CURLPROTO_IMAP (1<<12) -#define CURLPROTO_IMAPS (1<<13) -#define CURLPROTO_POP3 (1<<14) -#define CURLPROTO_POP3S (1<<15) -#define CURLPROTO_SMTP (1<<16) -#define CURLPROTO_SMTPS (1<<17) -#define CURLPROTO_RTSP (1<<18) -#define CURLPROTO_RTMP (1<<19) -#define CURLPROTO_RTMPT (1<<20) -#define CURLPROTO_RTMPE (1<<21) -#define CURLPROTO_RTMPTE (1<<22) -#define CURLPROTO_RTMPS (1<<23) -#define CURLPROTO_RTMPTS (1<<24) -#define CURLPROTO_GOPHER (1<<25) -#define CURLPROTO_SMB (1<<26) -#define CURLPROTO_SMBS (1<<27) -#define CURLPROTO_MQTT (1<<28) -#define CURLPROTO_GOPHERS (1<<29) -#define CURLPROTO_ALL (~0) /* enable everything */ - -/* long may be 32 or 64 bits, but we should never depend on anything else - but 32 */ -#define CURLOPTTYPE_LONG 0 -#define CURLOPTTYPE_OBJECTPOINT 10000 -#define CURLOPTTYPE_FUNCTIONPOINT 20000 -#define CURLOPTTYPE_OFF_T 30000 -#define CURLOPTTYPE_BLOB 40000 - -/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the - string options from the header file */ - - -#define CURLOPT(na,t,nu) na = t + nu -#define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu - -/* CURLOPT aliases that make no run-time difference */ - -/* 'char *' argument to a string with a trailing zero */ -#define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT - -/* 'struct curl_slist *' argument */ -#define CURLOPTTYPE_SLISTPOINT CURLOPTTYPE_OBJECTPOINT - -/* 'void *' argument passed untouched to callback */ -#define CURLOPTTYPE_CBPOINT CURLOPTTYPE_OBJECTPOINT - -/* 'long' argument with a set of values/bitmask */ -#define CURLOPTTYPE_VALUES CURLOPTTYPE_LONG - -/* - * All CURLOPT_* values. - */ - -typedef enum { - /* This is the FILE * or void * the regular output should be written to. */ - CURLOPT(CURLOPT_WRITEDATA, CURLOPTTYPE_CBPOINT, 1), - - /* The full URL to get/put */ - CURLOPT(CURLOPT_URL, CURLOPTTYPE_STRINGPOINT, 2), - - /* Port number to connect to, if other than default. */ - CURLOPT(CURLOPT_PORT, CURLOPTTYPE_LONG, 3), - - /* Name of proxy to use. */ - CURLOPT(CURLOPT_PROXY, CURLOPTTYPE_STRINGPOINT, 4), - - /* "user:password;options" to use when fetching. */ - CURLOPT(CURLOPT_USERPWD, CURLOPTTYPE_STRINGPOINT, 5), - - /* "user:password" to use with proxy. */ - CURLOPT(CURLOPT_PROXYUSERPWD, CURLOPTTYPE_STRINGPOINT, 6), - - /* Range to get, specified as an ASCII string. */ - CURLOPT(CURLOPT_RANGE, CURLOPTTYPE_STRINGPOINT, 7), - - /* not used */ - - /* Specified file stream to upload from (use as input): */ - CURLOPT(CURLOPT_READDATA, CURLOPTTYPE_CBPOINT, 9), - - /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE - * bytes big. */ - CURLOPT(CURLOPT_ERRORBUFFER, CURLOPTTYPE_OBJECTPOINT, 10), - - /* Function that will be called to store the output (instead of fwrite). The - * parameters will use fwrite() syntax, make sure to follow them. */ - CURLOPT(CURLOPT_WRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 11), - - /* Function that will be called to read the input (instead of fread). The - * parameters will use fread() syntax, make sure to follow them. */ - CURLOPT(CURLOPT_READFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 12), - - /* Time-out the read operation after this amount of seconds */ - CURLOPT(CURLOPT_TIMEOUT, CURLOPTTYPE_LONG, 13), - - /* If CURLOPT_READDATA is used, this can be used to inform libcurl about - * how large the file being sent really is. That allows better error - * checking and better verifies that the upload was successful. -1 means - * unknown size. - * - * For large file support, there is also a _LARGE version of the key - * which takes an off_t type, allowing platforms with larger off_t - * sizes to handle larger files. See below for INFILESIZE_LARGE. - */ - CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14), - - /* POST static input fields. */ - CURLOPT(CURLOPT_POSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 15), - - /* Set the referrer page (needed by some CGIs) */ - CURLOPT(CURLOPT_REFERER, CURLOPTTYPE_STRINGPOINT, 16), - - /* Set the FTP PORT string (interface name, named or numerical IP address) - Use i.e '-' to use default address. */ - CURLOPT(CURLOPT_FTPPORT, CURLOPTTYPE_STRINGPOINT, 17), - - /* Set the User-Agent string (examined by some CGIs) */ - CURLOPT(CURLOPT_USERAGENT, CURLOPTTYPE_STRINGPOINT, 18), - - /* If the download receives less than "low speed limit" bytes/second - * during "low speed time" seconds, the operations is aborted. - * You could i.e if you have a pretty high speed connection, abort if - * it is less than 2000 bytes/sec during 20 seconds. - */ - - /* Set the "low speed limit" */ - CURLOPT(CURLOPT_LOW_SPEED_LIMIT, CURLOPTTYPE_LONG, 19), - - /* Set the "low speed time" */ - CURLOPT(CURLOPT_LOW_SPEED_TIME, CURLOPTTYPE_LONG, 20), - - /* Set the continuation offset. - * - * Note there is also a _LARGE version of this key which uses - * off_t types, allowing for large file offsets on platforms which - * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. - */ - CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21), - - /* Set cookie in request: */ - CURLOPT(CURLOPT_COOKIE, CURLOPTTYPE_STRINGPOINT, 22), - - /* This points to a linked list of headers, struct curl_slist kind. This - list is also used for RTSP (in spite of its name) */ - CURLOPT(CURLOPT_HTTPHEADER, CURLOPTTYPE_SLISTPOINT, 23), - - /* This points to a linked list of post entries, struct curl_httppost */ - CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24, - 7.56.0, "Use CURLOPT_MIMEPOST"), - - /* name of the file keeping your private SSL-certificate */ - CURLOPT(CURLOPT_SSLCERT, CURLOPTTYPE_STRINGPOINT, 25), - - /* password for the SSL or SSH private key */ - CURLOPT(CURLOPT_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 26), - - /* send TYPE parameter? */ - CURLOPT(CURLOPT_CRLF, CURLOPTTYPE_LONG, 27), - - /* send linked-list of QUOTE commands */ - CURLOPT(CURLOPT_QUOTE, CURLOPTTYPE_SLISTPOINT, 28), - - /* send FILE * or void * to store headers to, if you use a callback it - is simply passed to the callback unmodified */ - CURLOPT(CURLOPT_HEADERDATA, CURLOPTTYPE_CBPOINT, 29), - - /* point to a file to read the initial cookies from, also enables - "cookie awareness" */ - CURLOPT(CURLOPT_COOKIEFILE, CURLOPTTYPE_STRINGPOINT, 31), - - /* What version to specifically try to use. - See CURL_SSLVERSION defines below. */ - CURLOPT(CURLOPT_SSLVERSION, CURLOPTTYPE_VALUES, 32), - - /* What kind of HTTP time condition to use, see defines */ - CURLOPT(CURLOPT_TIMECONDITION, CURLOPTTYPE_VALUES, 33), - - /* Time to use with the above condition. Specified in number of seconds - since 1 Jan 1970 */ - CURLOPT(CURLOPT_TIMEVALUE, CURLOPTTYPE_LONG, 34), - - /* 35 = OBSOLETE */ - - /* Custom request, for customizing the get command like - HTTP: DELETE, TRACE and others - FTP: to use a different list command - */ - CURLOPT(CURLOPT_CUSTOMREQUEST, CURLOPTTYPE_STRINGPOINT, 36), - - /* FILE handle to use instead of stderr */ - CURLOPT(CURLOPT_STDERR, CURLOPTTYPE_OBJECTPOINT, 37), - - /* 38 is not used */ - - /* send linked-list of post-transfer QUOTE commands */ - CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39), - - /* OBSOLETE, do not use! */ - CURLOPT(CURLOPT_OBSOLETE40, CURLOPTTYPE_OBJECTPOINT, 40), - - /* talk a lot */ - CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41), - - /* throw the header out too */ - CURLOPT(CURLOPT_HEADER, CURLOPTTYPE_LONG, 42), - - /* shut off the progress meter */ - CURLOPT(CURLOPT_NOPROGRESS, CURLOPTTYPE_LONG, 43), - - /* use HEAD to get http document */ - CURLOPT(CURLOPT_NOBODY, CURLOPTTYPE_LONG, 44), - - /* no output on http error codes >= 400 */ - CURLOPT(CURLOPT_FAILONERROR, CURLOPTTYPE_LONG, 45), - - /* this is an upload */ - CURLOPT(CURLOPT_UPLOAD, CURLOPTTYPE_LONG, 46), - - /* HTTP POST method */ - CURLOPT(CURLOPT_POST, CURLOPTTYPE_LONG, 47), - - /* bare names when listing directories */ - CURLOPT(CURLOPT_DIRLISTONLY, CURLOPTTYPE_LONG, 48), - - /* Append instead of overwrite on upload! */ - CURLOPT(CURLOPT_APPEND, CURLOPTTYPE_LONG, 50), - - /* Specify whether to read the user+password from the .netrc or the URL. - * This must be one of the CURL_NETRC_* enums below. */ - CURLOPT(CURLOPT_NETRC, CURLOPTTYPE_VALUES, 51), - - /* use Location: Luke! */ - CURLOPT(CURLOPT_FOLLOWLOCATION, CURLOPTTYPE_LONG, 52), - - /* transfer data in text/ASCII format */ - CURLOPT(CURLOPT_TRANSFERTEXT, CURLOPTTYPE_LONG, 53), - - /* HTTP PUT */ - CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54, - 7.12.1, "Use CURLOPT_UPLOAD"), - - /* 55 = OBSOLETE */ - - /* DEPRECATED - * Function that will be called instead of the internal progress display - * function. This function should be defined as the curl_progress_callback - * prototype defines. */ - CURLOPTDEPRECATED(CURLOPT_PROGRESSFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 56, - 7.32.0, "Use CURLOPT_XFERINFOFUNCTION"), - - /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION - callbacks */ - CURLOPT(CURLOPT_XFERINFODATA, CURLOPTTYPE_CBPOINT, 57), -#define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA - - /* We want the referrer field set automatically when following locations */ - CURLOPT(CURLOPT_AUTOREFERER, CURLOPTTYPE_LONG, 58), - - /* Port of the proxy, can be set in the proxy string as well with: - "[host]:[port]" */ - CURLOPT(CURLOPT_PROXYPORT, CURLOPTTYPE_LONG, 59), - - /* size of the POST input data, if strlen() is not good to use */ - CURLOPT(CURLOPT_POSTFIELDSIZE, CURLOPTTYPE_LONG, 60), - - /* tunnel non-http operations through an HTTP proxy */ - CURLOPT(CURLOPT_HTTPPROXYTUNNEL, CURLOPTTYPE_LONG, 61), - - /* Set the interface string to use as outgoing network interface */ - CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62), - - /* Set the krb4/5 security level, this also enables krb4/5 awareness. This - * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string - * is set but doesn't match one of these, 'private' will be used. */ - CURLOPT(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63), - - /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ - CURLOPT(CURLOPT_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 64), - - /* The CApath or CAfile used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CURLOPT(CURLOPT_CAINFO, CURLOPTTYPE_STRINGPOINT, 65), - - /* 66 = OBSOLETE */ - /* 67 = OBSOLETE */ - - /* Maximum number of http redirects to follow */ - CURLOPT(CURLOPT_MAXREDIRS, CURLOPTTYPE_LONG, 68), - - /* Pass a long set to 1 to get the date of the requested document (if - possible)! Pass a zero to shut it off. */ - CURLOPT(CURLOPT_FILETIME, CURLOPTTYPE_LONG, 69), - - /* This points to a linked list of telnet options */ - CURLOPT(CURLOPT_TELNETOPTIONS, CURLOPTTYPE_SLISTPOINT, 70), - - /* Max amount of cached alive connections */ - CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71), - - /* OBSOLETE, do not use! */ - CURLOPT(CURLOPT_OBSOLETE72, CURLOPTTYPE_LONG, 72), - - /* 73 = OBSOLETE */ - - /* Set to explicitly use a new connection for the upcoming transfer. - Do not use this unless you're absolutely sure of this, as it makes the - operation slower and is less friendly for the network. */ - CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74), - - /* Set to explicitly forbid the upcoming transfer's connection to be reused - when done. Do not use this unless you're absolutely sure of this, as it - makes the operation slower and is less friendly for the network. */ - CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75), - - /* Set to a file name that contains random data for libcurl to use to - seed the random engine when doing SSL connects. */ - CURLOPTDEPRECATED(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76, - 7.84.0, "Serves no purpose anymore"), - - /* Set to the Entropy Gathering Daemon socket pathname */ - CURLOPTDEPRECATED(CURLOPT_EGDSOCKET, CURLOPTTYPE_STRINGPOINT, 77, - 7.84.0, "Serves no purpose anymore"), - - /* Time-out connect operations after this amount of seconds, if connects are - OK within this time, then fine... This only aborts the connect phase. */ - CURLOPT(CURLOPT_CONNECTTIMEOUT, CURLOPTTYPE_LONG, 78), - - /* Function that will be called to store headers (instead of fwrite). The - * parameters will use fwrite() syntax, make sure to follow them. */ - CURLOPT(CURLOPT_HEADERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 79), - - /* Set this to force the HTTP request to get back to GET. Only really usable - if POST, PUT or a custom request have been used first. - */ - CURLOPT(CURLOPT_HTTPGET, CURLOPTTYPE_LONG, 80), - - /* Set if we should verify the Common name from the peer certificate in ssl - * handshake, set 1 to check existence, 2 to ensure that it matches the - * provided hostname. */ - CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81), - - /* Specify which file name to write all known cookies in after completed - operation. Set file name to "-" (dash) to make it go to stdout. */ - CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82), - - /* Specify which SSL ciphers to use */ - CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83), - - /* Specify which HTTP version to use! This must be set to one of the - CURL_HTTP_VERSION* enums set below. */ - CURLOPT(CURLOPT_HTTP_VERSION, CURLOPTTYPE_VALUES, 84), - - /* Specifically switch on or off the FTP engine's use of the EPSV command. By - default, that one will always be attempted before the more traditional - PASV command. */ - CURLOPT(CURLOPT_FTP_USE_EPSV, CURLOPTTYPE_LONG, 85), - - /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ - CURLOPT(CURLOPT_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 86), - - /* name of the file keeping your private SSL-key */ - CURLOPT(CURLOPT_SSLKEY, CURLOPTTYPE_STRINGPOINT, 87), - - /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ - CURLOPT(CURLOPT_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 88), - - /* crypto engine for the SSL-sub system */ - CURLOPT(CURLOPT_SSLENGINE, CURLOPTTYPE_STRINGPOINT, 89), - - /* set the crypto engine for the SSL-sub system as default - the param has no meaning... - */ - CURLOPT(CURLOPT_SSLENGINE_DEFAULT, CURLOPTTYPE_LONG, 90), - - /* Non-zero value means to use the global dns cache */ - /* DEPRECATED, do not use! */ - CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91, - 7.11.1, "Use CURLOPT_SHARE"), - - /* DNS cache timeout */ - CURLOPT(CURLOPT_DNS_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 92), - - /* send linked-list of pre-transfer QUOTE commands */ - CURLOPT(CURLOPT_PREQUOTE, CURLOPTTYPE_SLISTPOINT, 93), - - /* set the debug function */ - CURLOPT(CURLOPT_DEBUGFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 94), - - /* set the data for the debug function */ - CURLOPT(CURLOPT_DEBUGDATA, CURLOPTTYPE_CBPOINT, 95), - - /* mark this as start of a cookie session */ - CURLOPT(CURLOPT_COOKIESESSION, CURLOPTTYPE_LONG, 96), - - /* The CApath directory used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CURLOPT(CURLOPT_CAPATH, CURLOPTTYPE_STRINGPOINT, 97), - - /* Instruct libcurl to use a smaller receive buffer */ - CURLOPT(CURLOPT_BUFFERSIZE, CURLOPTTYPE_LONG, 98), - - /* Instruct libcurl to not use any signal/alarm handlers, even when using - timeouts. This option is useful for multi-threaded applications. - See libcurl-the-guide for more background information. */ - CURLOPT(CURLOPT_NOSIGNAL, CURLOPTTYPE_LONG, 99), - - /* Provide a CURLShare for mutexing non-ts data */ - CURLOPT(CURLOPT_SHARE, CURLOPTTYPE_OBJECTPOINT, 100), - - /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), - CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and - CURLPROXY_SOCKS5. */ - CURLOPT(CURLOPT_PROXYTYPE, CURLOPTTYPE_VALUES, 101), - - /* Set the Accept-Encoding string. Use this to tell a server you would like - the response to be compressed. Before 7.21.6, this was known as - CURLOPT_ENCODING */ - CURLOPT(CURLOPT_ACCEPT_ENCODING, CURLOPTTYPE_STRINGPOINT, 102), - - /* Set pointer to private data */ - CURLOPT(CURLOPT_PRIVATE, CURLOPTTYPE_OBJECTPOINT, 103), - - /* Set aliases for HTTP 200 in the HTTP Response header */ - CURLOPT(CURLOPT_HTTP200ALIASES, CURLOPTTYPE_SLISTPOINT, 104), - - /* Continue to send authentication (user+password) when following locations, - even when hostname changed. This can potentially send off the name - and password to whatever host the server decides. */ - CURLOPT(CURLOPT_UNRESTRICTED_AUTH, CURLOPTTYPE_LONG, 105), - - /* Specifically switch on or off the FTP engine's use of the EPRT command ( - it also disables the LPRT attempt). By default, those ones will always be - attempted before the good old traditional PORT command. */ - CURLOPT(CURLOPT_FTP_USE_EPRT, CURLOPTTYPE_LONG, 106), - - /* Set this to a bitmask value to enable the particular authentications - methods you like. Use this in combination with CURLOPT_USERPWD. - Note that setting multiple bits may cause extra network round-trips. */ - CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107), - - /* Set the ssl context callback function, currently only for OpenSSL or - WolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument. - The function must match the curl_ssl_ctx_callback prototype. */ - CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108), - - /* Set the userdata for the ssl context callback function's third - argument */ - CURLOPT(CURLOPT_SSL_CTX_DATA, CURLOPTTYPE_CBPOINT, 109), - - /* FTP Option that causes missing dirs to be created on the remote server. - In 7.19.4 we introduced the convenience enums for this option using the - CURLFTP_CREATE_DIR prefix. - */ - CURLOPT(CURLOPT_FTP_CREATE_MISSING_DIRS, CURLOPTTYPE_LONG, 110), - - /* Set this to a bitmask value to enable the particular authentications - methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. - Note that setting multiple bits may cause extra network round-trips. */ - CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111), - - /* Option that changes the timeout, in seconds, associated with getting a - response. This is different from transfer timeout time and essentially - places a demand on the server to acknowledge commands in a timely - manner. For FTP, SMTP, IMAP and POP3. */ - CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112), - - /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to - tell libcurl to use those IP versions only. This only has effect on - systems with support for more than one, i.e IPv4 _and_ IPv6. */ - CURLOPT(CURLOPT_IPRESOLVE, CURLOPTTYPE_VALUES, 113), - - /* Set this option to limit the size of a file that will be downloaded from - an HTTP or FTP server. - - Note there is also _LARGE version which adds large file support for - platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ - CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114), - - /* See the comment for INFILESIZE above, but in short, specifies - * the size of the file being uploaded. -1 means unknown. - */ - CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115), - - /* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version - * of this; look above for RESUME_FROM. - */ - CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116), - - /* Sets the maximum size of data that will be downloaded from - * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. - */ - CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117), - - /* Set this option to the file name of your .netrc file you want libcurl - to parse (using the CURLOPT_NETRC option). If not set, libcurl will do - a poor attempt to find the user's home directory and check for a .netrc - file in there. */ - CURLOPT(CURLOPT_NETRC_FILE, CURLOPTTYPE_STRINGPOINT, 118), - - /* Enable SSL/TLS for FTP, pick one of: - CURLUSESSL_TRY - try using SSL, proceed anyway otherwise - CURLUSESSL_CONTROL - SSL for the control connection or fail - CURLUSESSL_ALL - SSL for all communication or fail - */ - CURLOPT(CURLOPT_USE_SSL, CURLOPTTYPE_VALUES, 119), - - /* The _LARGE version of the standard POSTFIELDSIZE option */ - CURLOPT(CURLOPT_POSTFIELDSIZE_LARGE, CURLOPTTYPE_OFF_T, 120), - - /* Enable/disable the TCP Nagle algorithm */ - CURLOPT(CURLOPT_TCP_NODELAY, CURLOPTTYPE_LONG, 121), - - /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 123 OBSOLETE. Gone in 7.16.0 */ - /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 127 OBSOLETE. Gone in 7.16.0 */ - /* 128 OBSOLETE. Gone in 7.16.0 */ - - /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option - can be used to change libcurl's default action which is to first try - "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK - response has been received. - - Available parameters are: - CURLFTPAUTH_DEFAULT - let libcurl decide - CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS - CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL - */ - CURLOPT(CURLOPT_FTPSSLAUTH, CURLOPTTYPE_VALUES, 129), - - CURLOPTDEPRECATED(CURLOPT_IOCTLFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 130, - 7.18.0, "Use CURLOPT_SEEKFUNCTION"), - CURLOPTDEPRECATED(CURLOPT_IOCTLDATA, CURLOPTTYPE_CBPOINT, 131, - 7.18.0, "Use CURLOPT_SEEKDATA"), - - /* 132 OBSOLETE. Gone in 7.16.0 */ - /* 133 OBSOLETE. Gone in 7.16.0 */ - - /* null-terminated string for pass on to the FTP server when asked for - "account" info */ - CURLOPT(CURLOPT_FTP_ACCOUNT, CURLOPTTYPE_STRINGPOINT, 134), - - /* feed cookie into cookie engine */ - CURLOPT(CURLOPT_COOKIELIST, CURLOPTTYPE_STRINGPOINT, 135), - - /* ignore Content-Length */ - CURLOPT(CURLOPT_IGNORE_CONTENT_LENGTH, CURLOPTTYPE_LONG, 136), - - /* Set to non-zero to skip the IP address received in a 227 PASV FTP server - response. Typically used for FTP-SSL purposes but is not restricted to - that. libcurl will then instead use the same IP address it used for the - control connection. */ - CURLOPT(CURLOPT_FTP_SKIP_PASV_IP, CURLOPTTYPE_LONG, 137), - - /* Select "file method" to use when doing FTP, see the curl_ftpmethod - above. */ - CURLOPT(CURLOPT_FTP_FILEMETHOD, CURLOPTTYPE_VALUES, 138), - - /* Local port number to bind the socket to */ - CURLOPT(CURLOPT_LOCALPORT, CURLOPTTYPE_LONG, 139), - - /* Number of ports to try, including the first one set with LOCALPORT. - Thus, setting it to 1 will make no additional attempts but the first. - */ - CURLOPT(CURLOPT_LOCALPORTRANGE, CURLOPTTYPE_LONG, 140), - - /* no transfer, set up connection and let application use the socket by - extracting it with CURLINFO_LASTSOCKET */ - CURLOPT(CURLOPT_CONNECT_ONLY, CURLOPTTYPE_LONG, 141), - - /* Function that will be called to convert from the - network encoding (instead of using the iconv calls in libcurl) */ - CURLOPTDEPRECATED(CURLOPT_CONV_FROM_NETWORK_FUNCTION, - CURLOPTTYPE_FUNCTIONPOINT, 142, - 7.82.0, "Serves no purpose anymore"), - - /* Function that will be called to convert to the - network encoding (instead of using the iconv calls in libcurl) */ - CURLOPTDEPRECATED(CURLOPT_CONV_TO_NETWORK_FUNCTION, - CURLOPTTYPE_FUNCTIONPOINT, 143, - 7.82.0, "Serves no purpose anymore"), - - /* Function that will be called to convert from UTF8 - (instead of using the iconv calls in libcurl) - Note that this is used only for SSL certificate processing */ - CURLOPTDEPRECATED(CURLOPT_CONV_FROM_UTF8_FUNCTION, - CURLOPTTYPE_FUNCTIONPOINT, 144, - 7.82.0, "Serves no purpose anymore"), - - /* if the connection proceeds too quickly then need to slow it down */ - /* limit-rate: maximum number of bytes per second to send or receive */ - CURLOPT(CURLOPT_MAX_SEND_SPEED_LARGE, CURLOPTTYPE_OFF_T, 145), - CURLOPT(CURLOPT_MAX_RECV_SPEED_LARGE, CURLOPTTYPE_OFF_T, 146), - - /* Pointer to command string to send if USER/PASS fails. */ - CURLOPT(CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPTTYPE_STRINGPOINT, 147), - - /* callback function for setting socket options */ - CURLOPT(CURLOPT_SOCKOPTFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 148), - CURLOPT(CURLOPT_SOCKOPTDATA, CURLOPTTYPE_CBPOINT, 149), - - /* set to 0 to disable session ID reuse for this transfer, default is - enabled (== 1) */ - CURLOPT(CURLOPT_SSL_SESSIONID_CACHE, CURLOPTTYPE_LONG, 150), - - /* allowed SSH authentication methods */ - CURLOPT(CURLOPT_SSH_AUTH_TYPES, CURLOPTTYPE_VALUES, 151), - - /* Used by scp/sftp to do public/private key authentication */ - CURLOPT(CURLOPT_SSH_PUBLIC_KEYFILE, CURLOPTTYPE_STRINGPOINT, 152), - CURLOPT(CURLOPT_SSH_PRIVATE_KEYFILE, CURLOPTTYPE_STRINGPOINT, 153), - - /* Send CCC (Clear Command Channel) after authentication */ - CURLOPT(CURLOPT_FTP_SSL_CCC, CURLOPTTYPE_LONG, 154), - - /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */ - CURLOPT(CURLOPT_TIMEOUT_MS, CURLOPTTYPE_LONG, 155), - CURLOPT(CURLOPT_CONNECTTIMEOUT_MS, CURLOPTTYPE_LONG, 156), - - /* set to zero to disable the libcurl's decoding and thus pass the raw body - data to the application even when it is encoded/compressed */ - CURLOPT(CURLOPT_HTTP_TRANSFER_DECODING, CURLOPTTYPE_LONG, 157), - CURLOPT(CURLOPT_HTTP_CONTENT_DECODING, CURLOPTTYPE_LONG, 158), - - /* Permission used when creating new files and directories on the remote - server for protocols that support it, SFTP/SCP/FILE */ - CURLOPT(CURLOPT_NEW_FILE_PERMS, CURLOPTTYPE_LONG, 159), - CURLOPT(CURLOPT_NEW_DIRECTORY_PERMS, CURLOPTTYPE_LONG, 160), - - /* Set the behavior of POST when redirecting. Values must be set to one - of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */ - CURLOPT(CURLOPT_POSTREDIR, CURLOPTTYPE_VALUES, 161), - - /* used by scp/sftp to verify the host's public key */ - CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, CURLOPTTYPE_STRINGPOINT, 162), - - /* Callback function for opening socket (instead of socket(2)). Optionally, - callback is able change the address or refuse to connect returning - CURL_SOCKET_BAD. The callback should have type - curl_opensocket_callback */ - CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163), - CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164), - - /* POST volatile input fields. */ - CURLOPT(CURLOPT_COPYPOSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 165), - - /* set transfer mode (;type=) when doing FTP via an HTTP proxy */ - CURLOPT(CURLOPT_PROXY_TRANSFER_MODE, CURLOPTTYPE_LONG, 166), - - /* Callback function for seeking in the input stream */ - CURLOPT(CURLOPT_SEEKFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 167), - CURLOPT(CURLOPT_SEEKDATA, CURLOPTTYPE_CBPOINT, 168), - - /* CRL file */ - CURLOPT(CURLOPT_CRLFILE, CURLOPTTYPE_STRINGPOINT, 169), - - /* Issuer certificate */ - CURLOPT(CURLOPT_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 170), - - /* (IPv6) Address scope */ - CURLOPT(CURLOPT_ADDRESS_SCOPE, CURLOPTTYPE_LONG, 171), - - /* Collect certificate chain info and allow it to get retrievable with - CURLINFO_CERTINFO after the transfer is complete. */ - CURLOPT(CURLOPT_CERTINFO, CURLOPTTYPE_LONG, 172), - - /* "name" and "pwd" to use when fetching. */ - CURLOPT(CURLOPT_USERNAME, CURLOPTTYPE_STRINGPOINT, 173), - CURLOPT(CURLOPT_PASSWORD, CURLOPTTYPE_STRINGPOINT, 174), - - /* "name" and "pwd" to use with Proxy when fetching. */ - CURLOPT(CURLOPT_PROXYUSERNAME, CURLOPTTYPE_STRINGPOINT, 175), - CURLOPT(CURLOPT_PROXYPASSWORD, CURLOPTTYPE_STRINGPOINT, 176), - - /* Comma separated list of hostnames defining no-proxy zones. These should - match both hostnames directly, and hostnames within a domain. For - example, local.com will match local.com and www.local.com, but NOT - notlocal.com or www.notlocal.com. For compatibility with other - implementations of this, .local.com will be considered to be the same as - local.com. A single * is the only valid wildcard, and effectively - disables the use of proxy. */ - CURLOPT(CURLOPT_NOPROXY, CURLOPTTYPE_STRINGPOINT, 177), - - /* block size for TFTP transfers */ - CURLOPT(CURLOPT_TFTP_BLKSIZE, CURLOPTTYPE_LONG, 178), - - /* Socks Service */ - /* DEPRECATED, do not use! */ - CURLOPTDEPRECATED(CURLOPT_SOCKS5_GSSAPI_SERVICE, - CURLOPTTYPE_STRINGPOINT, 179, - 7.49.0, "Use CURLOPT_PROXY_SERVICE_NAME"), - - /* Socks Service */ - CURLOPT(CURLOPT_SOCKS5_GSSAPI_NEC, CURLOPTTYPE_LONG, 180), - - /* set the bitmask for the protocols that are allowed to be used for the - transfer, which thus helps the app which takes URLs from users or other - external inputs and want to restrict what protocol(s) to deal - with. Defaults to CURLPROTO_ALL. */ - CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181, - 7.85.0, "Use CURLOPT_PROTOCOLS_STR"), - - /* set the bitmask for the protocols that libcurl is allowed to follow to, - as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs - to be set in both bitmasks to be allowed to get redirected to. */ - CURLOPTDEPRECATED(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182, - 7.85.0, "Use CURLOPT_REDIR_PROTOCOLS_STR"), - - /* set the SSH knownhost file name to use */ - CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183), - - /* set the SSH host key callback, must point to a curl_sshkeycallback - function */ - CURLOPT(CURLOPT_SSH_KEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 184), - - /* set the SSH host key callback custom pointer */ - CURLOPT(CURLOPT_SSH_KEYDATA, CURLOPTTYPE_CBPOINT, 185), - - /* set the SMTP mail originator */ - CURLOPT(CURLOPT_MAIL_FROM, CURLOPTTYPE_STRINGPOINT, 186), - - /* set the list of SMTP mail receiver(s) */ - CURLOPT(CURLOPT_MAIL_RCPT, CURLOPTTYPE_SLISTPOINT, 187), - - /* FTP: send PRET before PASV */ - CURLOPT(CURLOPT_FTP_USE_PRET, CURLOPTTYPE_LONG, 188), - - /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */ - CURLOPT(CURLOPT_RTSP_REQUEST, CURLOPTTYPE_VALUES, 189), - - /* The RTSP session identifier */ - CURLOPT(CURLOPT_RTSP_SESSION_ID, CURLOPTTYPE_STRINGPOINT, 190), - - /* The RTSP stream URI */ - CURLOPT(CURLOPT_RTSP_STREAM_URI, CURLOPTTYPE_STRINGPOINT, 191), - - /* The Transport: header to use in RTSP requests */ - CURLOPT(CURLOPT_RTSP_TRANSPORT, CURLOPTTYPE_STRINGPOINT, 192), - - /* Manually initialize the client RTSP CSeq for this handle */ - CURLOPT(CURLOPT_RTSP_CLIENT_CSEQ, CURLOPTTYPE_LONG, 193), - - /* Manually initialize the server RTSP CSeq for this handle */ - CURLOPT(CURLOPT_RTSP_SERVER_CSEQ, CURLOPTTYPE_LONG, 194), - - /* The stream to pass to INTERLEAVEFUNCTION. */ - CURLOPT(CURLOPT_INTERLEAVEDATA, CURLOPTTYPE_CBPOINT, 195), - - /* Let the application define a custom write method for RTP data */ - CURLOPT(CURLOPT_INTERLEAVEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 196), - - /* Turn on wildcard matching */ - CURLOPT(CURLOPT_WILDCARDMATCH, CURLOPTTYPE_LONG, 197), - - /* Directory matching callback called before downloading of an - individual file (chunk) started */ - CURLOPT(CURLOPT_CHUNK_BGN_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 198), - - /* Directory matching callback called after the file (chunk) - was downloaded, or skipped */ - CURLOPT(CURLOPT_CHUNK_END_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 199), - - /* Change match (fnmatch-like) callback for wildcard matching */ - CURLOPT(CURLOPT_FNMATCH_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 200), - - /* Let the application define custom chunk data pointer */ - CURLOPT(CURLOPT_CHUNK_DATA, CURLOPTTYPE_CBPOINT, 201), - - /* FNMATCH_FUNCTION user pointer */ - CURLOPT(CURLOPT_FNMATCH_DATA, CURLOPTTYPE_CBPOINT, 202), - - /* send linked-list of name:port:address sets */ - CURLOPT(CURLOPT_RESOLVE, CURLOPTTYPE_SLISTPOINT, 203), - - /* Set a username for authenticated TLS */ - CURLOPT(CURLOPT_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 204), - - /* Set a password for authenticated TLS */ - CURLOPT(CURLOPT_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 205), - - /* Set authentication type for authenticated TLS */ - CURLOPT(CURLOPT_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 206), - - /* Set to 1 to enable the "TE:" header in HTTP requests to ask for - compressed transfer-encoded responses. Set to 0 to disable the use of TE: - in outgoing requests. The current default is 0, but it might change in a - future libcurl release. - - libcurl will ask for the compressed methods it knows of, and if that - isn't any, it will not ask for transfer-encoding at all even if this - option is set to 1. - - */ - CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207), - - /* Callback function for closing socket (instead of close(2)). The callback - should have type curl_closesocket_callback */ - CURLOPT(CURLOPT_CLOSESOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 208), - CURLOPT(CURLOPT_CLOSESOCKETDATA, CURLOPTTYPE_CBPOINT, 209), - - /* allow GSSAPI credential delegation */ - CURLOPT(CURLOPT_GSSAPI_DELEGATION, CURLOPTTYPE_VALUES, 210), - - /* Set the name servers to use for DNS resolution. - * Only supported by the c-ares DNS backend */ - CURLOPT(CURLOPT_DNS_SERVERS, CURLOPTTYPE_STRINGPOINT, 211), - - /* Time-out accept operations (currently for FTP only) after this amount - of milliseconds. */ - CURLOPT(CURLOPT_ACCEPTTIMEOUT_MS, CURLOPTTYPE_LONG, 212), - - /* Set TCP keepalive */ - CURLOPT(CURLOPT_TCP_KEEPALIVE, CURLOPTTYPE_LONG, 213), - - /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */ - CURLOPT(CURLOPT_TCP_KEEPIDLE, CURLOPTTYPE_LONG, 214), - CURLOPT(CURLOPT_TCP_KEEPINTVL, CURLOPTTYPE_LONG, 215), - - /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */ - CURLOPT(CURLOPT_SSL_OPTIONS, CURLOPTTYPE_VALUES, 216), - - /* Set the SMTP auth originator */ - CURLOPT(CURLOPT_MAIL_AUTH, CURLOPTTYPE_STRINGPOINT, 217), - - /* Enable/disable SASL initial response */ - CURLOPT(CURLOPT_SASL_IR, CURLOPTTYPE_LONG, 218), - - /* Function that will be called instead of the internal progress display - * function. This function should be defined as the curl_xferinfo_callback - * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */ - CURLOPT(CURLOPT_XFERINFOFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 219), - - /* The XOAUTH2 bearer token */ - CURLOPT(CURLOPT_XOAUTH2_BEARER, CURLOPTTYPE_STRINGPOINT, 220), - - /* Set the interface string to use as outgoing network - * interface for DNS requests. - * Only supported by the c-ares DNS backend */ - CURLOPT(CURLOPT_DNS_INTERFACE, CURLOPTTYPE_STRINGPOINT, 221), - - /* Set the local IPv4 address to use for outgoing DNS requests. - * Only supported by the c-ares DNS backend */ - CURLOPT(CURLOPT_DNS_LOCAL_IP4, CURLOPTTYPE_STRINGPOINT, 222), - - /* Set the local IPv6 address to use for outgoing DNS requests. - * Only supported by the c-ares DNS backend */ - CURLOPT(CURLOPT_DNS_LOCAL_IP6, CURLOPTTYPE_STRINGPOINT, 223), - - /* Set authentication options directly */ - CURLOPT(CURLOPT_LOGIN_OPTIONS, CURLOPTTYPE_STRINGPOINT, 224), - - /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */ - CURLOPTDEPRECATED(CURLOPT_SSL_ENABLE_NPN, CURLOPTTYPE_LONG, 225, - 7.86.0, "Has no function"), - - /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */ - CURLOPT(CURLOPT_SSL_ENABLE_ALPN, CURLOPTTYPE_LONG, 226), - - /* Time to wait for a response to an HTTP request containing an - * Expect: 100-continue header before sending the data anyway. */ - CURLOPT(CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOPTTYPE_LONG, 227), - - /* This points to a linked list of headers used for proxy requests only, - struct curl_slist kind */ - CURLOPT(CURLOPT_PROXYHEADER, CURLOPTTYPE_SLISTPOINT, 228), - - /* Pass in a bitmask of "header options" */ - CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229), - - /* The public key in DER form used to validate the peer public key - this option is used only if SSL_VERIFYPEER is true */ - CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230), - - /* Path to Unix domain socket */ - CURLOPT(CURLOPT_UNIX_SOCKET_PATH, CURLOPTTYPE_STRINGPOINT, 231), - - /* Set if we should verify the certificate status. */ - CURLOPT(CURLOPT_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 232), - - /* Set if we should enable TLS false start. */ - CURLOPT(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233), - - /* Do not squash dot-dot sequences */ - CURLOPT(CURLOPT_PATH_AS_IS, CURLOPTTYPE_LONG, 234), - - /* Proxy Service Name */ - CURLOPT(CURLOPT_PROXY_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 235), - - /* Service Name */ - CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236), - - /* Wait/don't wait for pipe/mutex to clarify */ - CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237), - - /* Set the protocol used when curl is given a URL without a protocol */ - CURLOPT(CURLOPT_DEFAULT_PROTOCOL, CURLOPTTYPE_STRINGPOINT, 238), - - /* Set stream weight, 1 - 256 (default is 16) */ - CURLOPT(CURLOPT_STREAM_WEIGHT, CURLOPTTYPE_LONG, 239), - - /* Set stream dependency on another CURL handle */ - CURLOPT(CURLOPT_STREAM_DEPENDS, CURLOPTTYPE_OBJECTPOINT, 240), - - /* Set E-xclusive stream dependency on another CURL handle */ - CURLOPT(CURLOPT_STREAM_DEPENDS_E, CURLOPTTYPE_OBJECTPOINT, 241), - - /* Do not send any tftp option requests to the server */ - CURLOPT(CURLOPT_TFTP_NO_OPTIONS, CURLOPTTYPE_LONG, 242), - - /* Linked-list of host:port:connect-to-host:connect-to-port, - overrides the URL's host:port (only for the network layer) */ - CURLOPT(CURLOPT_CONNECT_TO, CURLOPTTYPE_SLISTPOINT, 243), - - /* Set TCP Fast Open */ - CURLOPT(CURLOPT_TCP_FASTOPEN, CURLOPTTYPE_LONG, 244), - - /* Continue to send data if the server responds early with an - * HTTP status code >= 300 */ - CURLOPT(CURLOPT_KEEP_SENDING_ON_ERROR, CURLOPTTYPE_LONG, 245), - - /* The CApath or CAfile used to validate the proxy certificate - this option is used only if PROXY_SSL_VERIFYPEER is true */ - CURLOPT(CURLOPT_PROXY_CAINFO, CURLOPTTYPE_STRINGPOINT, 246), - - /* The CApath directory used to validate the proxy certificate - this option is used only if PROXY_SSL_VERIFYPEER is true */ - CURLOPT(CURLOPT_PROXY_CAPATH, CURLOPTTYPE_STRINGPOINT, 247), - - /* Set if we should verify the proxy in ssl handshake, - set 1 to verify. */ - CURLOPT(CURLOPT_PROXY_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 248), - - /* Set if we should verify the Common name from the proxy certificate in ssl - * handshake, set 1 to check existence, 2 to ensure that it matches - * the provided hostname. */ - CURLOPT(CURLOPT_PROXY_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 249), - - /* What version to specifically try to use for proxy. - See CURL_SSLVERSION defines below. */ - CURLOPT(CURLOPT_PROXY_SSLVERSION, CURLOPTTYPE_VALUES, 250), - - /* Set a username for authenticated TLS for proxy */ - CURLOPT(CURLOPT_PROXY_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 251), - - /* Set a password for authenticated TLS for proxy */ - CURLOPT(CURLOPT_PROXY_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 252), - - /* Set authentication type for authenticated TLS for proxy */ - CURLOPT(CURLOPT_PROXY_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 253), - - /* name of the file keeping your private SSL-certificate for proxy */ - CURLOPT(CURLOPT_PROXY_SSLCERT, CURLOPTTYPE_STRINGPOINT, 254), - - /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for - proxy */ - CURLOPT(CURLOPT_PROXY_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 255), - - /* name of the file keeping your private SSL-key for proxy */ - CURLOPT(CURLOPT_PROXY_SSLKEY, CURLOPTTYPE_STRINGPOINT, 256), - - /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for - proxy */ - CURLOPT(CURLOPT_PROXY_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 257), - - /* password for the SSL private key for proxy */ - CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258), - - /* Specify which SSL ciphers to use for proxy */ - CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259), - - /* CRL file for proxy */ - CURLOPT(CURLOPT_PROXY_CRLFILE, CURLOPTTYPE_STRINGPOINT, 260), - - /* Enable/disable specific SSL features with a bitmask for proxy, see - CURLSSLOPT_* */ - CURLOPT(CURLOPT_PROXY_SSL_OPTIONS, CURLOPTTYPE_LONG, 261), - - /* Name of pre proxy to use. */ - CURLOPT(CURLOPT_PRE_PROXY, CURLOPTTYPE_STRINGPOINT, 262), - - /* The public key in DER form used to validate the proxy public key - this option is used only if PROXY_SSL_VERIFYPEER is true */ - CURLOPT(CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 263), - - /* Path to an abstract Unix domain socket */ - CURLOPT(CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOPTTYPE_STRINGPOINT, 264), - - /* Suppress proxy CONNECT response headers from user callbacks */ - CURLOPT(CURLOPT_SUPPRESS_CONNECT_HEADERS, CURLOPTTYPE_LONG, 265), - - /* The request target, instead of extracted from the URL */ - CURLOPT(CURLOPT_REQUEST_TARGET, CURLOPTTYPE_STRINGPOINT, 266), - - /* bitmask of allowed auth methods for connections to SOCKS5 proxies */ - CURLOPT(CURLOPT_SOCKS5_AUTH, CURLOPTTYPE_LONG, 267), - - /* Enable/disable SSH compression */ - CURLOPT(CURLOPT_SSH_COMPRESSION, CURLOPTTYPE_LONG, 268), - - /* Post MIME data. */ - CURLOPT(CURLOPT_MIMEPOST, CURLOPTTYPE_OBJECTPOINT, 269), - - /* Time to use with the CURLOPT_TIMECONDITION. Specified in number of - seconds since 1 Jan 1970. */ - CURLOPT(CURLOPT_TIMEVALUE_LARGE, CURLOPTTYPE_OFF_T, 270), - - /* Head start in milliseconds to give happy eyeballs. */ - CURLOPT(CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPTTYPE_LONG, 271), - - /* Function that will be called before a resolver request is made */ - CURLOPT(CURLOPT_RESOLVER_START_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 272), - - /* User data to pass to the resolver start callback. */ - CURLOPT(CURLOPT_RESOLVER_START_DATA, CURLOPTTYPE_CBPOINT, 273), - - /* send HAProxy PROXY protocol header? */ - CURLOPT(CURLOPT_HAPROXYPROTOCOL, CURLOPTTYPE_LONG, 274), - - /* shuffle addresses before use when DNS returns multiple */ - CURLOPT(CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPTTYPE_LONG, 275), - - /* Specify which TLS 1.3 ciphers suites to use */ - CURLOPT(CURLOPT_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 276), - CURLOPT(CURLOPT_PROXY_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 277), - - /* Disallow specifying username/login in URL. */ - CURLOPT(CURLOPT_DISALLOW_USERNAME_IN_URL, CURLOPTTYPE_LONG, 278), - - /* DNS-over-HTTPS URL */ - CURLOPT(CURLOPT_DOH_URL, CURLOPTTYPE_STRINGPOINT, 279), - - /* Preferred buffer size to use for uploads */ - CURLOPT(CURLOPT_UPLOAD_BUFFERSIZE, CURLOPTTYPE_LONG, 280), - - /* Time in ms between connection upkeep calls for long-lived connections. */ - CURLOPT(CURLOPT_UPKEEP_INTERVAL_MS, CURLOPTTYPE_LONG, 281), - - /* Specify URL using CURL URL API. */ - CURLOPT(CURLOPT_CURLU, CURLOPTTYPE_OBJECTPOINT, 282), - - /* add trailing data just after no more data is available */ - CURLOPT(CURLOPT_TRAILERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 283), - - /* pointer to be passed to HTTP_TRAILER_FUNCTION */ - CURLOPT(CURLOPT_TRAILERDATA, CURLOPTTYPE_CBPOINT, 284), - - /* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */ - CURLOPT(CURLOPT_HTTP09_ALLOWED, CURLOPTTYPE_LONG, 285), - - /* alt-svc control bitmask */ - CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286), - - /* alt-svc cache file name to possibly read from/write to */ - CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287), - - /* maximum age (idle time) of a connection to consider it for reuse - * (in seconds) */ - CURLOPT(CURLOPT_MAXAGE_CONN, CURLOPTTYPE_LONG, 288), - - /* SASL authorization identity */ - CURLOPT(CURLOPT_SASL_AUTHZID, CURLOPTTYPE_STRINGPOINT, 289), - - /* allow RCPT TO command to fail for some recipients */ - CURLOPT(CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOPTTYPE_LONG, 290), - - /* the private SSL-certificate as a "blob" */ - CURLOPT(CURLOPT_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 291), - CURLOPT(CURLOPT_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 292), - CURLOPT(CURLOPT_PROXY_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 293), - CURLOPT(CURLOPT_PROXY_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 294), - CURLOPT(CURLOPT_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 295), - - /* Issuer certificate for proxy */ - CURLOPT(CURLOPT_PROXY_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 296), - CURLOPT(CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 297), - - /* the EC curves requested by the TLS client (RFC 8422, 5.1); - * OpenSSL support via 'set_groups'/'set_curves': - * https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html - */ - CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298), - - /* HSTS bitmask */ - CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299), - /* HSTS file name */ - CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300), - - /* HSTS read callback */ - CURLOPT(CURLOPT_HSTSREADFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 301), - CURLOPT(CURLOPT_HSTSREADDATA, CURLOPTTYPE_CBPOINT, 302), - - /* HSTS write callback */ - CURLOPT(CURLOPT_HSTSWRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 303), - CURLOPT(CURLOPT_HSTSWRITEDATA, CURLOPTTYPE_CBPOINT, 304), - - /* Parameters for V4 signature */ - CURLOPT(CURLOPT_AWS_SIGV4, CURLOPTTYPE_STRINGPOINT, 305), - - /* Same as CURLOPT_SSL_VERIFYPEER but for DoH (DNS-over-HTTPS) servers. */ - CURLOPT(CURLOPT_DOH_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 306), - - /* Same as CURLOPT_SSL_VERIFYHOST but for DoH (DNS-over-HTTPS) servers. */ - CURLOPT(CURLOPT_DOH_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 307), - - /* Same as CURLOPT_SSL_VERIFYSTATUS but for DoH (DNS-over-HTTPS) servers. */ - CURLOPT(CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 308), - - /* The CA certificates as "blob" used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CURLOPT(CURLOPT_CAINFO_BLOB, CURLOPTTYPE_BLOB, 309), - - /* The CA certificates as "blob" used to validate the proxy certificate - this option is used only if PROXY_SSL_VERIFYPEER is true */ - CURLOPT(CURLOPT_PROXY_CAINFO_BLOB, CURLOPTTYPE_BLOB, 310), - - /* used by scp/sftp to verify the host's public key */ - CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311), - - /* Function that will be called immediately before the initial request - is made on a connection (after any protocol negotiation step). */ - CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312), - - /* Data passed to the CURLOPT_PREREQFUNCTION callback */ - CURLOPT(CURLOPT_PREREQDATA, CURLOPTTYPE_CBPOINT, 313), - - /* maximum age (since creation) of a connection to consider it for reuse - * (in seconds) */ - CURLOPT(CURLOPT_MAXLIFETIME_CONN, CURLOPTTYPE_LONG, 314), - - /* Set MIME option flags. */ - CURLOPT(CURLOPT_MIME_OPTIONS, CURLOPTTYPE_LONG, 315), - - /* set the SSH host key callback, must point to a curl_sshkeycallback - function */ - CURLOPT(CURLOPT_SSH_HOSTKEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 316), - - /* set the SSH host key callback custom pointer */ - CURLOPT(CURLOPT_SSH_HOSTKEYDATA, CURLOPTTYPE_CBPOINT, 317), - - /* specify which protocols that are allowed to be used for the transfer, - which thus helps the app which takes URLs from users or other external - inputs and want to restrict what protocol(s) to deal with. Defaults to - all built-in protocols. */ - CURLOPT(CURLOPT_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 318), - - /* specify which protocols that libcurl is allowed to follow directs to */ - CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319), - - /* websockets options */ - CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320), - - /* CA cache timeout */ - CURLOPT(CURLOPT_CA_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 321), - - /* Can leak things, gonna exit() soon */ - CURLOPT(CURLOPT_QUICK_EXIT, CURLOPTTYPE_LONG, 322), - - /* set a specific client IP for HAProxy PROXY protocol header? */ - CURLOPT(CURLOPT_HAPROXY_CLIENT_IP, CURLOPTTYPE_STRINGPOINT, 323), - - /* millisecond version */ - CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, CURLOPTTYPE_LONG, 324), - - CURLOPT_LASTENTRY /* the last unused */ -} CURLoption; - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Backwards compatibility with older names */ -/* These are scheduled to disappear by 2011 */ - -/* This was added in version 7.19.1 */ -#define CURLOPT_POST301 CURLOPT_POSTREDIR - -/* These are scheduled to disappear by 2009 */ - -/* The following were added in 7.17.0 */ -#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD -#define CURLOPT_FTPAPPEND CURLOPT_APPEND -#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY -#define CURLOPT_FTP_SSL CURLOPT_USE_SSL - -/* The following were added earlier */ - -#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD -#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL - -/* */ -#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT - -/* Added in 8.2.0 */ -#define CURLOPT_MAIL_RCPT_ALLLOWFAILS CURLOPT_MAIL_RCPT_ALLOWFAILS - -#else -/* This is set if CURL_NO_OLDIES is defined at compile-time */ -#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */ -#endif - - - /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host - name resolves addresses using more than one IP protocol version, this - option might be handy to force libcurl to use a specific IP version. */ -#define CURL_IPRESOLVE_WHATEVER 0 /* default, uses addresses to all IP - versions that your system allows */ -#define CURL_IPRESOLVE_V4 1 /* uses only IPv4 addresses/connections */ -#define CURL_IPRESOLVE_V6 2 /* uses only IPv6 addresses/connections */ - - /* Convenient "aliases" */ -#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER - - /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ -enum { - CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd - like the library to choose the best possible - for us! */ - CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ - CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ - CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */ - CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */ - CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1 - Upgrade */ - CURL_HTTP_VERSION_3 = 30, /* Use HTTP/3, fallback to HTTP/2 or HTTP/1 if - needed. For HTTPS only. For HTTP, this option - makes libcurl return error. */ - CURL_HTTP_VERSION_3ONLY = 31, /* Use HTTP/3 without fallback. For HTTPS - only. For HTTP, this makes libcurl - return error. */ - - CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ -}; - -/* Convenience definition simple because the name of the version is HTTP/2 and - not 2.0. The 2_0 version of the enum name was set while the version was - still planned to be 2.0 and we stick to it for compatibility. */ -#define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_0 - -/* - * Public API enums for RTSP requests - */ -enum { - CURL_RTSPREQ_NONE, /* first in list */ - CURL_RTSPREQ_OPTIONS, - CURL_RTSPREQ_DESCRIBE, - CURL_RTSPREQ_ANNOUNCE, - CURL_RTSPREQ_SETUP, - CURL_RTSPREQ_PLAY, - CURL_RTSPREQ_PAUSE, - CURL_RTSPREQ_TEARDOWN, - CURL_RTSPREQ_GET_PARAMETER, - CURL_RTSPREQ_SET_PARAMETER, - CURL_RTSPREQ_RECORD, - CURL_RTSPREQ_RECEIVE, - CURL_RTSPREQ_LAST /* last in list */ -}; - - /* These enums are for use with the CURLOPT_NETRC option. */ -enum CURL_NETRC_OPTION { - CURL_NETRC_IGNORED, /* The .netrc will never be read. - * This is the default. */ - CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred - * to one in the .netrc. */ - CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. - * Unless one is set programmatically, the .netrc - * will be queried. */ - CURL_NETRC_LAST -}; - -enum { - CURL_SSLVERSION_DEFAULT, - CURL_SSLVERSION_TLSv1, /* TLS 1.x */ - CURL_SSLVERSION_SSLv2, - CURL_SSLVERSION_SSLv3, - CURL_SSLVERSION_TLSv1_0, - CURL_SSLVERSION_TLSv1_1, - CURL_SSLVERSION_TLSv1_2, - CURL_SSLVERSION_TLSv1_3, - - CURL_SSLVERSION_LAST /* never use, keep last */ -}; - -enum { - CURL_SSLVERSION_MAX_NONE = 0, - CURL_SSLVERSION_MAX_DEFAULT = (CURL_SSLVERSION_TLSv1 << 16), - CURL_SSLVERSION_MAX_TLSv1_0 = (CURL_SSLVERSION_TLSv1_0 << 16), - CURL_SSLVERSION_MAX_TLSv1_1 = (CURL_SSLVERSION_TLSv1_1 << 16), - CURL_SSLVERSION_MAX_TLSv1_2 = (CURL_SSLVERSION_TLSv1_2 << 16), - CURL_SSLVERSION_MAX_TLSv1_3 = (CURL_SSLVERSION_TLSv1_3 << 16), - - /* never use, keep last */ - CURL_SSLVERSION_MAX_LAST = (CURL_SSLVERSION_LAST << 16) -}; - -enum CURL_TLSAUTH { - CURL_TLSAUTH_NONE, - CURL_TLSAUTH_SRP, - CURL_TLSAUTH_LAST /* never use, keep last */ -}; - -/* symbols to use with CURLOPT_POSTREDIR. - CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303 - can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302 - | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */ - -#define CURL_REDIR_GET_ALL 0 -#define CURL_REDIR_POST_301 1 -#define CURL_REDIR_POST_302 2 -#define CURL_REDIR_POST_303 4 -#define CURL_REDIR_POST_ALL \ - (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303) - -typedef enum { - CURL_TIMECOND_NONE, - - CURL_TIMECOND_IFMODSINCE, - CURL_TIMECOND_IFUNMODSINCE, - CURL_TIMECOND_LASTMOD, - - CURL_TIMECOND_LAST -} curl_TimeCond; - -/* Special size_t value signaling a null-terminated string. */ -#define CURL_ZERO_TERMINATED ((size_t) -1) - -/* curl_strequal() and curl_strnequal() are subject for removal in a future - release */ -CURL_EXTERN int curl_strequal(const char *s1, const char *s2); -CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n); - -/* Mime/form handling support. */ -typedef struct curl_mime curl_mime; /* Mime context. */ -typedef struct curl_mimepart curl_mimepart; /* Mime part context. */ - -/* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */ -#define CURLMIMEOPT_FORMESCAPE (1<<0) /* Use backslash-escaping for forms. */ - -/* - * NAME curl_mime_init() - * - * DESCRIPTION - * - * Create a mime context and return its handle. The easy parameter is the - * target handle. - */ -CURL_EXTERN curl_mime *curl_mime_init(CURL *easy); - -/* - * NAME curl_mime_free() - * - * DESCRIPTION - * - * release a mime handle and its substructures. - */ -CURL_EXTERN void curl_mime_free(curl_mime *mime); - -/* - * NAME curl_mime_addpart() - * - * DESCRIPTION - * - * Append a new empty part to the given mime context and return a handle to - * the created part. - */ -CURL_EXTERN curl_mimepart *curl_mime_addpart(curl_mime *mime); - -/* - * NAME curl_mime_name() - * - * DESCRIPTION - * - * Set mime/form part name. - */ -CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name); - -/* - * NAME curl_mime_filename() - * - * DESCRIPTION - * - * Set mime part remote file name. - */ -CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part, - const char *filename); - -/* - * NAME curl_mime_type() - * - * DESCRIPTION - * - * Set mime part type. - */ -CURL_EXTERN CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype); - -/* - * NAME curl_mime_encoder() - * - * DESCRIPTION - * - * Set mime data transfer encoder. - */ -CURL_EXTERN CURLcode curl_mime_encoder(curl_mimepart *part, - const char *encoding); - -/* - * NAME curl_mime_data() - * - * DESCRIPTION - * - * Set mime part data source from memory data, - */ -CURL_EXTERN CURLcode curl_mime_data(curl_mimepart *part, - const char *data, size_t datasize); - -/* - * NAME curl_mime_filedata() - * - * DESCRIPTION - * - * Set mime part data source from named file. - */ -CURL_EXTERN CURLcode curl_mime_filedata(curl_mimepart *part, - const char *filename); - -/* - * NAME curl_mime_data_cb() - * - * DESCRIPTION - * - * Set mime part data source from callback function. - */ -CURL_EXTERN CURLcode curl_mime_data_cb(curl_mimepart *part, - curl_off_t datasize, - curl_read_callback readfunc, - curl_seek_callback seekfunc, - curl_free_callback freefunc, - void *arg); - -/* - * NAME curl_mime_subparts() - * - * DESCRIPTION - * - * Set mime part data source from subparts. - */ -CURL_EXTERN CURLcode curl_mime_subparts(curl_mimepart *part, - curl_mime *subparts); -/* - * NAME curl_mime_headers() - * - * DESCRIPTION - * - * Set mime part headers. - */ -CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part, - struct curl_slist *headers, - int take_ownership); - -typedef enum { - /********* the first one is unused ************/ - CURLFORM_NOTHING CURL_DEPRECATED(7.56.0, ""), - CURLFORM_COPYNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"), - CURLFORM_PTRNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"), - CURLFORM_NAMELENGTH CURL_DEPRECATED(7.56.0, ""), - CURLFORM_COPYCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"), - CURLFORM_PTRCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"), - CURLFORM_CONTENTSLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"), - CURLFORM_FILECONTENT CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"), - CURLFORM_ARRAY CURL_DEPRECATED(7.56.0, ""), - CURLFORM_OBSOLETE, - CURLFORM_FILE CURL_DEPRECATED(7.56.0, "Use curl_mime_filedata()"), - - CURLFORM_BUFFER CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"), - CURLFORM_BUFFERPTR CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"), - CURLFORM_BUFFERLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"), - - CURLFORM_CONTENTTYPE CURL_DEPRECATED(7.56.0, "Use curl_mime_type()"), - CURLFORM_CONTENTHEADER CURL_DEPRECATED(7.56.0, "Use curl_mime_headers()"), - CURLFORM_FILENAME CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"), - CURLFORM_END, - CURLFORM_OBSOLETE2, - - CURLFORM_STREAM CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"), - CURLFORM_CONTENTLEN /* added in 7.46.0, provide a curl_off_t length */ - CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"), - - CURLFORM_LASTENTRY /* the last unused */ -} CURLformoption; - -/* structure to be used as parameter for CURLFORM_ARRAY */ -struct curl_forms { - CURLformoption option; - const char *value; -}; - -/* use this for multipart formpost building */ -/* Returns code for curl_formadd() - * - * Returns: - * CURL_FORMADD_OK on success - * CURL_FORMADD_MEMORY if the FormInfo allocation fails - * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form - * CURL_FORMADD_NULL if a null pointer was given for a char - * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed - * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used - * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) - * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated - * CURL_FORMADD_MEMORY if some allocation for string copying failed. - * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array - * - ***************************************************************************/ -typedef enum { - CURL_FORMADD_OK CURL_DEPRECATED(7.56.0, ""), /* 1st, no error */ - - CURL_FORMADD_MEMORY CURL_DEPRECATED(7.56.0, ""), - CURL_FORMADD_OPTION_TWICE CURL_DEPRECATED(7.56.0, ""), - CURL_FORMADD_NULL CURL_DEPRECATED(7.56.0, ""), - CURL_FORMADD_UNKNOWN_OPTION CURL_DEPRECATED(7.56.0, ""), - CURL_FORMADD_INCOMPLETE CURL_DEPRECATED(7.56.0, ""), - CURL_FORMADD_ILLEGAL_ARRAY CURL_DEPRECATED(7.56.0, ""), - /* libcurl was built with form api disabled */ - CURL_FORMADD_DISABLED CURL_DEPRECATED(7.56.0, ""), - - CURL_FORMADD_LAST /* last */ -} CURLFORMcode; - -/* - * NAME curl_formadd() - * - * DESCRIPTION - * - * Pretty advanced function for building multi-part formposts. Each invoke - * adds one part that together construct a full post. Then use - * CURLOPT_HTTPPOST to send it off to libcurl. - */ -CURL_EXTERN CURLFORMcode CURL_DEPRECATED(7.56.0, "Use curl_mime_init()") -curl_formadd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - ...); - -/* - * callback function for curl_formget() - * The void *arg pointer will be the one passed as second argument to - * curl_formget(). - * The character buffer passed to it must not be freed. - * Should return the buffer length passed to it as the argument "len" on - * success. - */ -typedef size_t (*curl_formget_callback)(void *arg, const char *buf, - size_t len); - -/* - * NAME curl_formget() - * - * DESCRIPTION - * - * Serialize a curl_httppost struct built with curl_formadd(). - * Accepts a void pointer as second argument which will be passed to - * the curl_formget_callback function. - * Returns 0 on success. - */ -CURL_EXTERN int CURL_DEPRECATED(7.56.0, "") -curl_formget(struct curl_httppost *form, void *arg, - curl_formget_callback append); -/* - * NAME curl_formfree() - * - * DESCRIPTION - * - * Free a multipart formpost previously built with curl_formadd(). - */ -CURL_EXTERN void CURL_DEPRECATED(7.56.0, "Use curl_mime_free()") -curl_formfree(struct curl_httppost *form); - -/* - * NAME curl_getenv() - * - * DESCRIPTION - * - * Returns a malloc()'ed string that MUST be curl_free()ed after usage is - * complete. DEPRECATED - see lib/README.curlx - */ -CURL_EXTERN char *curl_getenv(const char *variable); - -/* - * NAME curl_version() - * - * DESCRIPTION - * - * Returns a static ascii string of the libcurl version. - */ -CURL_EXTERN char *curl_version(void); - -/* - * NAME curl_easy_escape() - * - * DESCRIPTION - * - * Escapes URL strings (converts all letters consider illegal in URLs to their - * %XX versions). This function returns a new allocated string or NULL if an - * error occurred. - */ -CURL_EXTERN char *curl_easy_escape(CURL *handle, - const char *string, - int length); - -/* the previous version: */ -CURL_EXTERN char *curl_escape(const char *string, - int length); - - -/* - * NAME curl_easy_unescape() - * - * DESCRIPTION - * - * Unescapes URL encoding in strings (converts all %XX codes to their 8bit - * versions). This function returns a new allocated string or NULL if an error - * occurred. - * Conversion Note: On non-ASCII platforms the ASCII %XX codes are - * converted into the host encoding. - */ -CURL_EXTERN char *curl_easy_unescape(CURL *handle, - const char *string, - int length, - int *outlength); - -/* the previous version */ -CURL_EXTERN char *curl_unescape(const char *string, - int length); - -/* - * NAME curl_free() - * - * DESCRIPTION - * - * Provided for de-allocation in the same translation unit that did the - * allocation. Added in libcurl 7.10 - */ -CURL_EXTERN void curl_free(void *p); - -/* - * NAME curl_global_init() - * - * DESCRIPTION - * - * curl_global_init() should be invoked exactly once for each application that - * uses libcurl and before any call of other libcurl functions. - - * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the - * curl_version_info_data.features flag (fetch by curl_version_info()). - - */ -CURL_EXTERN CURLcode curl_global_init(long flags); - -/* - * NAME curl_global_init_mem() - * - * DESCRIPTION - * - * curl_global_init() or curl_global_init_mem() should be invoked exactly once - * for each application that uses libcurl. This function can be used to - * initialize libcurl and set user defined memory management callback - * functions. Users can implement memory management routines to check for - * memory leaks, check for mis-use of the curl library etc. User registered - * callback routines will be invoked by this library instead of the system - * memory management routines like malloc, free etc. - */ -CURL_EXTERN CURLcode curl_global_init_mem(long flags, - curl_malloc_callback m, - curl_free_callback f, - curl_realloc_callback r, - curl_strdup_callback s, - curl_calloc_callback c); - -/* - * NAME curl_global_cleanup() - * - * DESCRIPTION - * - * curl_global_cleanup() should be invoked exactly once for each application - * that uses libcurl - */ -CURL_EXTERN void curl_global_cleanup(void); - -/* - * NAME curl_global_trace() - * - * DESCRIPTION - * - * curl_global_trace() can be invoked at application start to - * configure which components in curl should participate in tracing. - - * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the - * curl_version_info_data.features flag (fetch by curl_version_info()). - - */ -CURL_EXTERN CURLcode curl_global_trace(const char *config); - -/* linked-list structure for the CURLOPT_QUOTE option (and other) */ -struct curl_slist { - char *data; - struct curl_slist *next; -}; - -/* - * NAME curl_global_sslset() - * - * DESCRIPTION - * - * When built with multiple SSL backends, curl_global_sslset() allows to - * choose one. This function can only be called once, and it must be called - * *before* curl_global_init(). - * - * The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The - * backend can also be specified via the name parameter (passing -1 as id). - * If both id and name are specified, the name will be ignored. If neither id - * nor name are specified, the function will fail with - * CURLSSLSET_UNKNOWN_BACKEND and set the "avail" pointer to the - * NULL-terminated list of available backends. - * - * Upon success, the function returns CURLSSLSET_OK. - * - * If the specified SSL backend is not available, the function returns - * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a NULL-terminated - * list of available SSL backends. - * - * The SSL backend can be set only once. If it has already been set, a - * subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE. - */ - -struct curl_ssl_backend { - curl_sslbackend id; - const char *name; -}; -typedef struct curl_ssl_backend curl_ssl_backend; - -typedef enum { - CURLSSLSET_OK = 0, - CURLSSLSET_UNKNOWN_BACKEND, - CURLSSLSET_TOO_LATE, - CURLSSLSET_NO_BACKENDS /* libcurl was built without any SSL support */ -} CURLsslset; - -CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name, - const curl_ssl_backend ***avail); - -/* - * NAME curl_slist_append() - * - * DESCRIPTION - * - * Appends a string to a linked list. If no list exists, it will be created - * first. Returns the new list, after appending. - */ -CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *list, - const char *data); - -/* - * NAME curl_slist_free_all() - * - * DESCRIPTION - * - * free a previously built curl_slist. - */ -CURL_EXTERN void curl_slist_free_all(struct curl_slist *list); - -/* - * NAME curl_getdate() - * - * DESCRIPTION - * - * Returns the time, in seconds since 1 Jan 1970 of the time string given in - * the first argument. The time argument in the second parameter is unused - * and should be set to NULL. - */ -CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); - -/* info about the certificate chain, for SSL backends that support it. Asked - for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */ -struct curl_certinfo { - int num_of_certs; /* number of certificates with information */ - struct curl_slist **certinfo; /* for each index in this array, there's a - linked list with textual information for a - certificate in the format "name:content". - eg "Subject:foo", "Issuer:bar", etc. */ -}; - -/* Information about the SSL library used and the respective internal SSL - handle, which can be used to obtain further information regarding the - connection. Asked for with CURLINFO_TLS_SSL_PTR or CURLINFO_TLS_SESSION. */ -struct curl_tlssessioninfo { - curl_sslbackend backend; - void *internals; -}; - -#define CURLINFO_STRING 0x100000 -#define CURLINFO_LONG 0x200000 -#define CURLINFO_DOUBLE 0x300000 -#define CURLINFO_SLIST 0x400000 -#define CURLINFO_PTR 0x400000 /* same as SLIST */ -#define CURLINFO_SOCKET 0x500000 -#define CURLINFO_OFF_T 0x600000 -#define CURLINFO_MASK 0x0fffff -#define CURLINFO_TYPEMASK 0xf00000 - -typedef enum { - CURLINFO_NONE, /* first, never use this */ - CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, - CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, - CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, - CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, - CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, - CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, - CURLINFO_SIZE_UPLOAD CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_UPLOAD_T") - = CURLINFO_DOUBLE + 7, - CURLINFO_SIZE_UPLOAD_T = CURLINFO_OFF_T + 7, - CURLINFO_SIZE_DOWNLOAD - CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_DOWNLOAD_T") - = CURLINFO_DOUBLE + 8, - CURLINFO_SIZE_DOWNLOAD_T = CURLINFO_OFF_T + 8, - CURLINFO_SPEED_DOWNLOAD - CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_DOWNLOAD_T") - = CURLINFO_DOUBLE + 9, - CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T + 9, - CURLINFO_SPEED_UPLOAD - CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_UPLOAD_T") - = CURLINFO_DOUBLE + 10, - CURLINFO_SPEED_UPLOAD_T = CURLINFO_OFF_T + 10, - CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, - CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, - CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, - CURLINFO_FILETIME = CURLINFO_LONG + 14, - CURLINFO_FILETIME_T = CURLINFO_OFF_T + 14, - CURLINFO_CONTENT_LENGTH_DOWNLOAD - CURL_DEPRECATED(7.55.0, - "Use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T") - = CURLINFO_DOUBLE + 15, - CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T + 15, - CURLINFO_CONTENT_LENGTH_UPLOAD - CURL_DEPRECATED(7.55.0, - "Use CURLINFO_CONTENT_LENGTH_UPLOAD_T") - = CURLINFO_DOUBLE + 16, - CURLINFO_CONTENT_LENGTH_UPLOAD_T = CURLINFO_OFF_T + 16, - CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, - CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, - CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, - CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, - CURLINFO_PRIVATE = CURLINFO_STRING + 21, - CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, - CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, - CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, - CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, - CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, - CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, - CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, - CURLINFO_LASTSOCKET CURL_DEPRECATED(7.45.0, "Use CURLINFO_ACTIVESOCKET") - = CURLINFO_LONG + 29, - CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, - CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31, - CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32, - CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33, - CURLINFO_CERTINFO = CURLINFO_PTR + 34, - CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35, - CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36, - CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37, - CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38, - CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39, - CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40, - CURLINFO_LOCAL_IP = CURLINFO_STRING + 41, - CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, - CURLINFO_TLS_SESSION CURL_DEPRECATED(7.48.0, "Use CURLINFO_TLS_SSL_PTR") - = CURLINFO_PTR + 43, - CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44, - CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45, - CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46, - CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47, - CURLINFO_PROTOCOL CURL_DEPRECATED(7.85.0, "Use CURLINFO_SCHEME") - = CURLINFO_LONG + 48, - CURLINFO_SCHEME = CURLINFO_STRING + 49, - CURLINFO_TOTAL_TIME_T = CURLINFO_OFF_T + 50, - CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51, - CURLINFO_CONNECT_TIME_T = CURLINFO_OFF_T + 52, - CURLINFO_PRETRANSFER_TIME_T = CURLINFO_OFF_T + 53, - CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54, - CURLINFO_REDIRECT_TIME_T = CURLINFO_OFF_T + 55, - CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56, - CURLINFO_RETRY_AFTER = CURLINFO_OFF_T + 57, - CURLINFO_EFFECTIVE_METHOD = CURLINFO_STRING + 58, - CURLINFO_PROXY_ERROR = CURLINFO_LONG + 59, - CURLINFO_REFERER = CURLINFO_STRING + 60, - CURLINFO_CAINFO = CURLINFO_STRING + 61, - CURLINFO_CAPATH = CURLINFO_STRING + 62, - CURLINFO_XFER_ID = CURLINFO_OFF_T + 63, - CURLINFO_CONN_ID = CURLINFO_OFF_T + 64, - CURLINFO_QUEUE_TIME_T = CURLINFO_OFF_T + 65, - CURLINFO_LASTONE = 65 -} CURLINFO; - -/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as - CURLINFO_HTTP_CODE */ -#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE - -typedef enum { - CURLCLOSEPOLICY_NONE, /* first, never use this */ - - CURLCLOSEPOLICY_OLDEST, - CURLCLOSEPOLICY_LEAST_RECENTLY_USED, - CURLCLOSEPOLICY_LEAST_TRAFFIC, - CURLCLOSEPOLICY_SLOWEST, - CURLCLOSEPOLICY_CALLBACK, - - CURLCLOSEPOLICY_LAST /* last, never use this */ -} curl_closepolicy; - -#define CURL_GLOBAL_SSL (1<<0) /* no purpose since 7.57.0 */ -#define CURL_GLOBAL_WIN32 (1<<1) -#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) -#define CURL_GLOBAL_NOTHING 0 -#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL -#define CURL_GLOBAL_ACK_EINTR (1<<2) - - -/***************************************************************************** - * Setup defines, protos etc for the sharing stuff. - */ - -/* Different data locks for a single share */ -typedef enum { - CURL_LOCK_DATA_NONE = 0, - /* CURL_LOCK_DATA_SHARE is used internally to say that - * the locking is just made to change the internal state of the share - * itself. - */ - CURL_LOCK_DATA_SHARE, - CURL_LOCK_DATA_COOKIE, - CURL_LOCK_DATA_DNS, - CURL_LOCK_DATA_SSL_SESSION, - CURL_LOCK_DATA_CONNECT, - CURL_LOCK_DATA_PSL, - CURL_LOCK_DATA_HSTS, - CURL_LOCK_DATA_LAST -} curl_lock_data; - -/* Different lock access types */ -typedef enum { - CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */ - CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */ - CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */ - CURL_LOCK_ACCESS_LAST /* never use */ -} curl_lock_access; - -typedef void (*curl_lock_function)(CURL *handle, - curl_lock_data data, - curl_lock_access locktype, - void *userptr); -typedef void (*curl_unlock_function)(CURL *handle, - curl_lock_data data, - void *userptr); - - -typedef enum { - CURLSHE_OK, /* all is fine */ - CURLSHE_BAD_OPTION, /* 1 */ - CURLSHE_IN_USE, /* 2 */ - CURLSHE_INVALID, /* 3 */ - CURLSHE_NOMEM, /* 4 out of memory */ - CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */ - CURLSHE_LAST /* never use */ -} CURLSHcode; - -typedef enum { - CURLSHOPT_NONE, /* don't use */ - CURLSHOPT_SHARE, /* specify a data type to share */ - CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */ - CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */ - CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */ - CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock - callback functions */ - CURLSHOPT_LAST /* never use */ -} CURLSHoption; - -CURL_EXTERN CURLSH *curl_share_init(void); -CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option, - ...); -CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *share); - -/**************************************************************************** - * Structures for querying information about the curl library at runtime. - */ - -typedef enum { - CURLVERSION_FIRST, - CURLVERSION_SECOND, - CURLVERSION_THIRD, - CURLVERSION_FOURTH, - CURLVERSION_FIFTH, - CURLVERSION_SIXTH, - CURLVERSION_SEVENTH, - CURLVERSION_EIGHTH, - CURLVERSION_NINTH, - CURLVERSION_TENTH, - CURLVERSION_ELEVENTH, - CURLVERSION_LAST /* never actually use this */ -} CURLversion; - -/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by - basically all programs ever that want to get version information. It is - meant to be a built-in version number for what kind of struct the caller - expects. If the struct ever changes, we redefine the NOW to another enum - from above. */ -#define CURLVERSION_NOW CURLVERSION_ELEVENTH - -struct curl_version_info_data { - CURLversion age; /* age of the returned struct */ - const char *version; /* LIBCURL_VERSION */ - unsigned int version_num; /* LIBCURL_VERSION_NUM */ - const char *host; /* OS/host/cpu/machine when configured */ - int features; /* bitmask, see defines below */ - const char *ssl_version; /* human readable string */ - long ssl_version_num; /* not used anymore, always 0 */ - const char *libz_version; /* human readable string */ - /* protocols is terminated by an entry with a NULL protoname */ - const char * const *protocols; - - /* The fields below this were added in CURLVERSION_SECOND */ - const char *ares; - int ares_num; - - /* This field was added in CURLVERSION_THIRD */ - const char *libidn; - - /* These field were added in CURLVERSION_FOURTH */ - - /* Same as '_libiconv_version' if built with HAVE_ICONV */ - int iconv_ver_num; - - const char *libssh_version; /* human readable string */ - - /* These fields were added in CURLVERSION_FIFTH */ - unsigned int brotli_ver_num; /* Numeric Brotli version - (MAJOR << 24) | (MINOR << 12) | PATCH */ - const char *brotli_version; /* human readable string. */ - - /* These fields were added in CURLVERSION_SIXTH */ - unsigned int nghttp2_ver_num; /* Numeric nghttp2 version - (MAJOR << 16) | (MINOR << 8) | PATCH */ - const char *nghttp2_version; /* human readable string. */ - const char *quic_version; /* human readable quic (+ HTTP/3) library + - version or NULL */ - - /* These fields were added in CURLVERSION_SEVENTH */ - const char *cainfo; /* the built-in default CURLOPT_CAINFO, might - be NULL */ - const char *capath; /* the built-in default CURLOPT_CAPATH, might - be NULL */ - - /* These fields were added in CURLVERSION_EIGHTH */ - unsigned int zstd_ver_num; /* Numeric Zstd version - (MAJOR << 24) | (MINOR << 12) | PATCH */ - const char *zstd_version; /* human readable string. */ - - /* These fields were added in CURLVERSION_NINTH */ - const char *hyper_version; /* human readable string. */ - - /* These fields were added in CURLVERSION_TENTH */ - const char *gsasl_version; /* human readable string. */ - - /* These fields were added in CURLVERSION_ELEVENTH */ - /* feature_names is terminated by an entry with a NULL feature name */ - const char * const *feature_names; -}; -typedef struct curl_version_info_data curl_version_info_data; - -#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */ -#define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported - (deprecated) */ -#define CURL_VERSION_SSL (1<<2) /* SSL options are present */ -#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */ -#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */ -#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth is supported - (deprecated) */ -#define CURL_VERSION_DEBUG (1<<6) /* Built with debug capabilities */ -#define CURL_VERSION_ASYNCHDNS (1<<7) /* Asynchronous DNS resolves */ -#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth is supported */ -#define CURL_VERSION_LARGEFILE (1<<9) /* Supports files larger than 2GB */ -#define CURL_VERSION_IDN (1<<10) /* Internationized Domain Names are - supported */ -#define CURL_VERSION_SSPI (1<<11) /* Built against Windows SSPI */ -#define CURL_VERSION_CONV (1<<12) /* Character conversions supported */ -#define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported */ -#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */ -#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegation to winbind helper - is supported */ -#define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */ -#define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */ -#define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */ -#define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */ -#define CURL_VERSION_PSL (1<<20) /* Mozilla's Public Suffix List, used - for cookie domain verification */ -#define CURL_VERSION_HTTPS_PROXY (1<<21) /* HTTPS-proxy support built-in */ -#define CURL_VERSION_MULTI_SSL (1<<22) /* Multiple SSL backends available */ -#define CURL_VERSION_BROTLI (1<<23) /* Brotli features are present. */ -#define CURL_VERSION_ALTSVC (1<<24) /* Alt-Svc handling built-in */ -#define CURL_VERSION_HTTP3 (1<<25) /* HTTP3 support built-in */ -#define CURL_VERSION_ZSTD (1<<26) /* zstd features are present */ -#define CURL_VERSION_UNICODE (1<<27) /* Unicode support on Windows */ -#define CURL_VERSION_HSTS (1<<28) /* HSTS is supported */ -#define CURL_VERSION_GSASL (1<<29) /* libgsasl is supported */ -#define CURL_VERSION_THREADSAFE (1<<30) /* libcurl API is thread-safe */ - - /* - * NAME curl_version_info() - * - * DESCRIPTION - * - * This function returns a pointer to a static copy of the version info - * struct. See above. - */ -CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion); - -/* - * NAME curl_easy_strerror() - * - * DESCRIPTION - * - * The curl_easy_strerror function may be used to turn a CURLcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. - */ -CURL_EXTERN const char *curl_easy_strerror(CURLcode); - -/* - * NAME curl_share_strerror() - * - * DESCRIPTION - * - * The curl_share_strerror function may be used to turn a CURLSHcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. - */ -CURL_EXTERN const char *curl_share_strerror(CURLSHcode); - -/* - * NAME curl_easy_pause() - * - * DESCRIPTION - * - * The curl_easy_pause function pauses or unpauses transfers. Select the new - * state by setting the bitmask, use the convenience defines below. - * - */ -CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask); - -#define CURLPAUSE_RECV (1<<0) -#define CURLPAUSE_RECV_CONT (0) - -#define CURLPAUSE_SEND (1<<2) -#define CURLPAUSE_SEND_CONT (0) - -#define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND) -#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT) - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -/* unfortunately, the easy.h and multi.h include files need options and info - stuff before they can be included! */ -#include "easy.h" /* nothing in curl is fun without the easy stuff */ -#include "multi.h" -#include "urlapi.h" -#include "options.h" -#include "header.h" -#include "websockets.h" -#include "mprintf.h" - -/* the typechecker doesn't work in C++ (yet) */ -#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \ - ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \ - !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK) -#include "typecheck-gcc.h" -#else -#if defined(__STDC__) && (__STDC__ >= 1) -/* This preprocessor magic that replaces a call with the exact same call is - only done to make sure application authors pass exactly three arguments - to these functions. */ -#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param) -#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg) -#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) -#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) -#endif /* __STDC__ >= 1 */ -#endif /* gcc >= 4.3 && !__cplusplus && !CURL_DISABLE_TYPECHECK */ - -#endif /* CURLINC_CURL_H */ diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/curlver.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/curlver.h deleted file mode 100644 index 1e660cbf58c..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/curlver.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef CURLINC_CURLVER_H -#define CURLINC_CURLVER_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -/* This header file contains nothing but libcurl version info, generated by - a script at release-time. This was made its own header file in 7.11.2 */ - -/* This is the global package copyright */ -#define LIBCURL_COPYRIGHT "Daniel Stenberg, ." - -/* This is the version number of the libcurl package from which this header - file origins: */ -#define LIBCURL_VERSION "8.6.0" - -/* The numeric version number is also available "in parts" by using these - defines: */ -#define LIBCURL_VERSION_MAJOR 8 -#define LIBCURL_VERSION_MINOR 6 -#define LIBCURL_VERSION_PATCH 0 - -/* This is the numeric version of the libcurl version number, meant for easier - parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will - always follow this syntax: - - 0xXXYYZZ - - Where XX, YY and ZZ are the main version, release and patch numbers in - hexadecimal (using 8 bits each). All three numbers are always represented - using two digits. 1.2 would appear as "0x010200" while version 9.11.7 - appears as "0x090b07". - - This 6-digit (24 bits) hexadecimal number does not show pre-release number, - and it is always a greater number in a more recent release. It makes - comparisons with greater than and less than work. - - Note: This define is the full hex number and _does not_ use the - CURL_VERSION_BITS() macro since curl's own configure script greps for it - and needs it to contain the full number. -*/ -#define LIBCURL_VERSION_NUM 0x080600 - -/* - * This is the date and time when the full source package was created. The - * timestamp is not stored in git, as the timestamp is properly set in the - * tarballs by the maketgz script. - * - * The format of the date follows this template: - * - * "2007-11-23" - */ -#define LIBCURL_TIMESTAMP "2024-01-31" - -#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z)) -#define CURL_AT_LEAST_VERSION(x,y,z) \ - (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) - -#endif /* CURLINC_CURLVER_H */ diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/easy.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/easy.h deleted file mode 100644 index 1285101c587..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/easy.h +++ /dev/null @@ -1,125 +0,0 @@ -#ifndef CURLINC_EASY_H -#define CURLINC_EASY_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ -#ifdef __cplusplus -extern "C" { -#endif - -/* Flag bits in the curl_blob struct: */ -#define CURL_BLOB_COPY 1 /* tell libcurl to copy the data */ -#define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */ - -struct curl_blob { - void *data; - size_t len; - unsigned int flags; /* bit 0 is defined, the rest are reserved and should be - left zeroes */ -}; - -CURL_EXTERN CURL *curl_easy_init(void); -CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); -CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); -CURL_EXTERN void curl_easy_cleanup(CURL *curl); - -/* - * NAME curl_easy_getinfo() - * - * DESCRIPTION - * - * Request internal information from the curl session with this function. - * The third argument MUST be pointing to the specific type of the used option - * which is documented in each man page of the option. The data pointed to - * will be filled in accordingly and can be relied upon only if the function - * returns CURLE_OK. This function is intended to get used *AFTER* a performed - * transfer, all results from this function are undefined until the transfer - * is completed. - */ -CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); - - -/* - * NAME curl_easy_duphandle() - * - * DESCRIPTION - * - * Creates a new curl session handle with the same options set for the handle - * passed in. Duplicating a handle could only be a matter of cloning data and - * options, internal state info and things like persistent connections cannot - * be transferred. It is useful in multithreaded applications when you can run - * curl_easy_duphandle() for each new thread to avoid a series of identical - * curl_easy_setopt() invokes in every thread. - */ -CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl); - -/* - * NAME curl_easy_reset() - * - * DESCRIPTION - * - * Re-initializes a CURL handle to the default values. This puts back the - * handle to the same state as it was in when it was just created. - * - * It does keep: live connections, the Session ID cache, the DNS cache and the - * cookies. - */ -CURL_EXTERN void curl_easy_reset(CURL *curl); - -/* - * NAME curl_easy_recv() - * - * DESCRIPTION - * - * Receives data from the connected socket. Use after successful - * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. - */ -CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, - size_t *n); - -/* - * NAME curl_easy_send() - * - * DESCRIPTION - * - * Sends data over the connected socket. Use after successful - * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. - */ -CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, - size_t buflen, size_t *n); - - -/* - * NAME curl_easy_upkeep() - * - * DESCRIPTION - * - * Performs connection upkeep for the given session handle. - */ -CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/header.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/header.h deleted file mode 100644 index 8df11e1e424..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/header.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef CURLINC_HEADER_H -#define CURLINC_HEADER_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -struct curl_header { - char *name; /* this might not use the same case */ - char *value; - size_t amount; /* number of headers using this name */ - size_t index; /* ... of this instance, 0 or higher */ - unsigned int origin; /* see bits below */ - void *anchor; /* handle privately used by libcurl */ -}; - -/* 'origin' bits */ -#define CURLH_HEADER (1<<0) /* plain server header */ -#define CURLH_TRAILER (1<<1) /* trailers */ -#define CURLH_CONNECT (1<<2) /* CONNECT headers */ -#define CURLH_1XX (1<<3) /* 1xx headers */ -#define CURLH_PSEUDO (1<<4) /* pseudo headers */ - -typedef enum { - CURLHE_OK, - CURLHE_BADINDEX, /* header exists but not with this index */ - CURLHE_MISSING, /* no such header exists */ - CURLHE_NOHEADERS, /* no headers at all exist (yet) */ - CURLHE_NOREQUEST, /* no request with this number was used */ - CURLHE_OUT_OF_MEMORY, /* out of memory while processing */ - CURLHE_BAD_ARGUMENT, /* a function argument was not okay */ - CURLHE_NOT_BUILT_IN /* if API was disabled in the build */ -} CURLHcode; - -CURL_EXTERN CURLHcode curl_easy_header(CURL *easy, - const char *name, - size_t index, - unsigned int origin, - int request, - struct curl_header **hout); - -CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy, - unsigned int origin, - int request, - struct curl_header *prev); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif /* CURLINC_HEADER_H */ diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/mprintf.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/mprintf.h deleted file mode 100644 index 4f704548d19..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/mprintf.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef CURLINC_MPRINTF_H -#define CURLINC_MPRINTF_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -#include -#include /* needed for FILE */ -#include "curl.h" /* for CURL_EXTERN */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if (defined(__GNUC__) || defined(__clang__)) && \ - defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ - !defined(CURL_NO_FMT_CHECKS) -#if defined(__MINGW32__) && !defined(__clang__) -#define CURL_TEMP_PRINTF(fmt, arg) \ - __attribute__((format(gnu_printf, fmt, arg))) -#else -#define CURL_TEMP_PRINTF(fmt, arg) \ - __attribute__((format(printf, fmt, arg))) -#endif -#else -#define CURL_TEMP_PRINTF(fmt, arg) -#endif - -CURL_EXTERN int curl_mprintf(const char *format, ...) - CURL_TEMP_PRINTF(1, 2); -CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...) - CURL_TEMP_PRINTF(2, 3); -CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...) - CURL_TEMP_PRINTF(2, 3); -CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, - const char *format, ...) - CURL_TEMP_PRINTF(3, 4); -CURL_EXTERN int curl_mvprintf(const char *format, va_list args) - CURL_TEMP_PRINTF(1, 0); -CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args) - CURL_TEMP_PRINTF(2, 0); -CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args) - CURL_TEMP_PRINTF(2, 0); -CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, - const char *format, va_list args) - CURL_TEMP_PRINTF(3, 0); -CURL_EXTERN char *curl_maprintf(const char *format, ...) - CURL_TEMP_PRINTF(1, 2); -CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args) - CURL_TEMP_PRINTF(1, 0); - -#undef CURL_TEMP_PRINTF - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif /* CURLINC_MPRINTF_H */ diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/multi.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/multi.h deleted file mode 100644 index e79b48ff32a..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/multi.h +++ /dev/null @@ -1,471 +0,0 @@ -#ifndef CURLINC_MULTI_H -#define CURLINC_MULTI_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ -/* - This is an "external" header file. Don't give away any internals here! - - GOALS - - o Enable a "pull" interface. The application that uses libcurl decides where - and when to ask libcurl to get/send data. - - o Enable multiple simultaneous transfers in the same thread without making it - complicated for the application. - - o Enable the application to select() on its own file descriptors and curl's - file descriptors simultaneous easily. - -*/ - -/* - * This header file should not really need to include "curl.h" since curl.h - * itself includes this file and we expect user applications to do #include - * without the need for especially including multi.h. - * - * For some reason we added this include here at one point, and rather than to - * break existing (wrongly written) libcurl applications, we leave it as-is - * but with this warning attached. - */ -#include "curl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER) -typedef struct Curl_multi CURLM; -#else -typedef void CURLM; -#endif - -typedef enum { - CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or - curl_multi_socket*() soon */ - CURLM_OK, - CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ - CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ - CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ - CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ - CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ - CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ - CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was - attempted to get added - again */ - CURLM_RECURSIVE_API_CALL, /* an api function was called from inside a - callback */ - CURLM_WAKEUP_FAILURE, /* wakeup is unavailable or failed */ - CURLM_BAD_FUNCTION_ARGUMENT, /* function called with a bad parameter */ - CURLM_ABORTED_BY_CALLBACK, - CURLM_UNRECOVERABLE_POLL, - CURLM_LAST -} CURLMcode; - -/* just to make code nicer when using curl_multi_socket() you can now check - for CURLM_CALL_MULTI_SOCKET too in the same style it works for - curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ -#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM - -/* bitmask bits for CURLMOPT_PIPELINING */ -#define CURLPIPE_NOTHING 0L -#define CURLPIPE_HTTP1 1L -#define CURLPIPE_MULTIPLEX 2L - -typedef enum { - CURLMSG_NONE, /* first, not used */ - CURLMSG_DONE, /* This easy handle has completed. 'result' contains - the CURLcode of the transfer */ - CURLMSG_LAST /* last, not used */ -} CURLMSG; - -struct CURLMsg { - CURLMSG msg; /* what this message means */ - CURL *easy_handle; /* the handle it concerns */ - union { - void *whatever; /* message-specific data */ - CURLcode result; /* return code for transfer */ - } data; -}; -typedef struct CURLMsg CURLMsg; - -/* Based on poll(2) structure and values. - * We don't use pollfd and POLL* constants explicitly - * to cover platforms without poll(). */ -#define CURL_WAIT_POLLIN 0x0001 -#define CURL_WAIT_POLLPRI 0x0002 -#define CURL_WAIT_POLLOUT 0x0004 - -struct curl_waitfd { - curl_socket_t fd; - short events; - short revents; -}; - -/* - * Name: curl_multi_init() - * - * Desc: initialize multi-style curl usage - * - * Returns: a new CURLM handle to use in all 'curl_multi' functions. - */ -CURL_EXTERN CURLM *curl_multi_init(void); - -/* - * Name: curl_multi_add_handle() - * - * Desc: add a standard curl handle to the multi stack - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, - CURL *curl_handle); - - /* - * Name: curl_multi_remove_handle() - * - * Desc: removes a curl handle from the multi stack again - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, - CURL *curl_handle); - - /* - * Name: curl_multi_fdset() - * - * Desc: Ask curl for its fd_set sets. The app can use these to select() or - * poll() on. We want curl_multi_perform() called as soon as one of - * them are ready. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, - fd_set *read_fd_set, - fd_set *write_fd_set, - fd_set *exc_fd_set, - int *max_fd); - -/* - * Name: curl_multi_wait() - * - * Desc: Poll on all fds within a CURLM set as well as any - * additional fds passed to the function. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, - struct curl_waitfd extra_fds[], - unsigned int extra_nfds, - int timeout_ms, - int *ret); - -/* - * Name: curl_multi_poll() - * - * Desc: Poll on all fds within a CURLM set as well as any - * additional fds passed to the function. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_poll(CURLM *multi_handle, - struct curl_waitfd extra_fds[], - unsigned int extra_nfds, - int timeout_ms, - int *ret); - -/* - * Name: curl_multi_wakeup() - * - * Desc: wakes up a sleeping curl_multi_poll call. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle); - - /* - * Name: curl_multi_perform() - * - * Desc: When the app thinks there's data available for curl it calls this - * function to read/write whatever there is right now. This returns - * as soon as the reads and writes are done. This function does not - * require that there actually is data available for reading or that - * data can be written, it can be called just in case. It returns - * the number of handles that still transfer data in the second - * argument's integer-pointer. - * - * Returns: CURLMcode type, general multi error code. *NOTE* that this only - * returns errors etc regarding the whole multi stack. There might - * still have occurred problems on individual transfers even when - * this returns OK. - */ -CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, - int *running_handles); - - /* - * Name: curl_multi_cleanup() - * - * Desc: Cleans up and removes a whole multi stack. It does not free or - * touch any individual easy handles in any way. We need to define - * in what state those handles will be if this function is called - * in the middle of a transfer. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); - -/* - * Name: curl_multi_info_read() - * - * Desc: Ask the multi handle if there's any messages/informationals from - * the individual transfers. Messages include informationals such as - * error code from the transfer or just the fact that a transfer is - * completed. More details on these should be written down as well. - * - * Repeated calls to this function will return a new struct each - * time, until a special "end of msgs" struct is returned as a signal - * that there is no more to get at this point. - * - * The data the returned pointer points to will not survive calling - * curl_multi_cleanup(). - * - * The 'CURLMsg' struct is meant to be very simple and only contain - * very basic information. If more involved information is wanted, - * we will provide the particular "transfer handle" in that struct - * and that should/could/would be used in subsequent - * curl_easy_getinfo() calls (or similar). The point being that we - * must never expose complex structs to applications, as then we'll - * undoubtably get backwards compatibility problems in the future. - * - * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out - * of structs. It also writes the number of messages left in the - * queue (after this read) in the integer the second argument points - * to. - */ -CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, - int *msgs_in_queue); - -/* - * Name: curl_multi_strerror() - * - * Desc: The curl_multi_strerror function may be used to turn a CURLMcode - * value into the equivalent human readable error string. This is - * useful for printing meaningful error messages. - * - * Returns: A pointer to a null-terminated error message. - */ -CURL_EXTERN const char *curl_multi_strerror(CURLMcode); - -/* - * Name: curl_multi_socket() and - * curl_multi_socket_all() - * - * Desc: An alternative version of curl_multi_perform() that allows the - * application to pass in one of the file descriptors that have been - * detected to have "action" on them and let libcurl perform. - * See man page for details. - */ -#define CURL_POLL_NONE 0 -#define CURL_POLL_IN 1 -#define CURL_POLL_OUT 2 -#define CURL_POLL_INOUT 3 -#define CURL_POLL_REMOVE 4 - -#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD - -#define CURL_CSELECT_IN 0x01 -#define CURL_CSELECT_OUT 0x02 -#define CURL_CSELECT_ERR 0x04 - -typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ - curl_socket_t s, /* socket */ - int what, /* see above */ - void *userp, /* private callback - pointer */ - void *socketp); /* private socket - pointer */ -/* - * Name: curl_multi_timer_callback - * - * Desc: Called by libcurl whenever the library detects a change in the - * maximum number of milliseconds the app is allowed to wait before - * curl_multi_socket() or curl_multi_perform() must be called - * (to allow libcurl's timed events to take place). - * - * Returns: The callback should return zero. - */ -typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ - long timeout_ms, /* see above */ - void *userp); /* private callback - pointer */ - -CURL_EXTERN CURLMcode CURL_DEPRECATED(7.19.5, "Use curl_multi_socket_action()") -curl_multi_socket(CURLM *multi_handle, curl_socket_t s, int *running_handles); - -CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, - curl_socket_t s, - int ev_bitmask, - int *running_handles); - -CURL_EXTERN CURLMcode CURL_DEPRECATED(7.19.5, "Use curl_multi_socket_action()") -curl_multi_socket_all(CURLM *multi_handle, int *running_handles); - -#ifndef CURL_ALLOW_OLD_MULTI_SOCKET -/* This macro below was added in 7.16.3 to push users who recompile to use - the new curl_multi_socket_action() instead of the old curl_multi_socket() -*/ -#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) -#endif - -/* - * Name: curl_multi_timeout() - * - * Desc: Returns the maximum number of milliseconds the app is allowed to - * wait before curl_multi_socket() or curl_multi_perform() must be - * called (to allow libcurl's timed events to take place). - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, - long *milliseconds); - -typedef enum { - /* This is the socket callback function pointer */ - CURLOPT(CURLMOPT_SOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 1), - - /* This is the argument passed to the socket callback */ - CURLOPT(CURLMOPT_SOCKETDATA, CURLOPTTYPE_OBJECTPOINT, 2), - - /* set to 1 to enable pipelining for this multi handle */ - CURLOPT(CURLMOPT_PIPELINING, CURLOPTTYPE_LONG, 3), - - /* This is the timer callback function pointer */ - CURLOPT(CURLMOPT_TIMERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 4), - - /* This is the argument passed to the timer callback */ - CURLOPT(CURLMOPT_TIMERDATA, CURLOPTTYPE_OBJECTPOINT, 5), - - /* maximum number of entries in the connection cache */ - CURLOPT(CURLMOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 6), - - /* maximum number of (pipelining) connections to one host */ - CURLOPT(CURLMOPT_MAX_HOST_CONNECTIONS, CURLOPTTYPE_LONG, 7), - - /* maximum number of requests in a pipeline */ - CURLOPT(CURLMOPT_MAX_PIPELINE_LENGTH, CURLOPTTYPE_LONG, 8), - - /* a connection with a content-length longer than this - will not be considered for pipelining */ - CURLOPT(CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 9), - - /* a connection with a chunk length longer than this - will not be considered for pipelining */ - CURLOPT(CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 10), - - /* a list of site names(+port) that are blocked from pipelining */ - CURLOPT(CURLMOPT_PIPELINING_SITE_BL, CURLOPTTYPE_OBJECTPOINT, 11), - - /* a list of server types that are blocked from pipelining */ - CURLOPT(CURLMOPT_PIPELINING_SERVER_BL, CURLOPTTYPE_OBJECTPOINT, 12), - - /* maximum number of open connections in total */ - CURLOPT(CURLMOPT_MAX_TOTAL_CONNECTIONS, CURLOPTTYPE_LONG, 13), - - /* This is the server push callback function pointer */ - CURLOPT(CURLMOPT_PUSHFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 14), - - /* This is the argument passed to the server push callback */ - CURLOPT(CURLMOPT_PUSHDATA, CURLOPTTYPE_OBJECTPOINT, 15), - - /* maximum number of concurrent streams to support on a connection */ - CURLOPT(CURLMOPT_MAX_CONCURRENT_STREAMS, CURLOPTTYPE_LONG, 16), - - CURLMOPT_LASTENTRY /* the last unused */ -} CURLMoption; - - -/* - * Name: curl_multi_setopt() - * - * Desc: Sets options for the multi handle. - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, - CURLMoption option, ...); - - -/* - * Name: curl_multi_assign() - * - * Desc: This function sets an association in the multi handle between the - * given socket and a private pointer of the application. This is - * (only) useful for curl_multi_socket uses. - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, - curl_socket_t sockfd, void *sockp); - -/* - * Name: curl_multi_get_handles() - * - * Desc: Returns an allocated array holding all handles currently added to - * the multi handle. Marks the final entry with a NULL pointer. If - * there is no easy handle added to the multi handle, this function - * returns an array with the first entry as a NULL pointer. - * - * Returns: NULL on failure, otherwise a CURL **array pointer - */ -CURL_EXTERN CURL **curl_multi_get_handles(CURLM *multi_handle); - -/* - * Name: curl_push_callback - * - * Desc: This callback gets called when a new stream is being pushed by the - * server. It approves or denies the new stream. It can also decide - * to completely fail the connection. - * - * Returns: CURL_PUSH_OK, CURL_PUSH_DENY or CURL_PUSH_ERROROUT - */ -#define CURL_PUSH_OK 0 -#define CURL_PUSH_DENY 1 -#define CURL_PUSH_ERROROUT 2 /* added in 7.72.0 */ - -struct curl_pushheaders; /* forward declaration only */ - -CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h, - size_t num); -CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h, - const char *name); - -typedef int (*curl_push_callback)(CURL *parent, - CURL *easy, - size_t num_headers, - struct curl_pushheaders *headers, - void *userp); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/options.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/options.h deleted file mode 100644 index 1ed76a95c68..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/options.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef CURLINC_OPTIONS_H -#define CURLINC_OPTIONS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - CURLOT_LONG, /* long (a range of values) */ - CURLOT_VALUES, /* (a defined set or bitmask) */ - CURLOT_OFF_T, /* curl_off_t (a range of values) */ - CURLOT_OBJECT, /* pointer (void *) */ - CURLOT_STRING, /* (char * to null-terminated buffer) */ - CURLOT_SLIST, /* (struct curl_slist *) */ - CURLOT_CBPTR, /* (void * passed as-is to a callback) */ - CURLOT_BLOB, /* blob (struct curl_blob *) */ - CURLOT_FUNCTION /* function pointer */ -} curl_easytype; - -/* Flag bits */ - -/* "alias" means it is provided for old programs to remain functional, - we prefer another name */ -#define CURLOT_FLAG_ALIAS (1<<0) - -/* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size - to use for curl_easy_setopt() for the given id */ -struct curl_easyoption { - const char *name; - CURLoption id; - curl_easytype type; - unsigned int flags; -}; - -CURL_EXTERN const struct curl_easyoption * -curl_easy_option_by_name(const char *name); - -CURL_EXTERN const struct curl_easyoption * -curl_easy_option_by_id(CURLoption id); - -CURL_EXTERN const struct curl_easyoption * -curl_easy_option_next(const struct curl_easyoption *prev); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif -#endif /* CURLINC_OPTIONS_H */ diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/stdcheaders.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/stdcheaders.h deleted file mode 100644 index 7451aa30525..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/stdcheaders.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef CURLINC_STDCHEADERS_H -#define CURLINC_STDCHEADERS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -#include - -size_t fread(void *, size_t, size_t, FILE *); -size_t fwrite(const void *, size_t, size_t, FILE *); - -int strcasecmp(const char *, const char *); -int strncasecmp(const char *, const char *, size_t); - -#endif /* CURLINC_STDCHEADERS_H */ diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/system.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/system.h deleted file mode 100644 index 81a1b817df3..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/system.h +++ /dev/null @@ -1,496 +0,0 @@ -#ifndef CURLINC_SYSTEM_H -#define CURLINC_SYSTEM_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -/* - * Try to keep one section per platform, compiler and architecture, otherwise, - * if an existing section is reused for a different one and later on the - * original is adjusted, probably the piggybacking one can be adversely - * changed. - * - * In order to differentiate between platforms/compilers/architectures use - * only compiler built in predefined preprocessor symbols. - * - * curl_off_t - * ---------- - * - * For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit - * wide signed integral data type. The width of this data type must remain - * constant and independent of any possible large file support settings. - * - * As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit - * wide signed integral data type if there is no 64-bit type. - * - * As a general rule, curl_off_t shall not be mapped to off_t. This rule shall - * only be violated if off_t is the only 64-bit data type available and the - * size of off_t is independent of large file support settings. Keep your - * build on the safe side avoiding an off_t gating. If you have a 64-bit - * off_t then take for sure that another 64-bit data type exists, dig deeper - * and you will find it. - * - */ - -#if defined(__DJGPP__) || defined(__GO32__) -# if defined(__DJGPP__) && (__DJGPP__ > 1) -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# else -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T int - -#elif defined(__SALFORDC__) -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# define CURL_TYPEOF_CURL_SOCKLEN_T int - -#elif defined(__BORLANDC__) -# if (__BORLANDC__ < 0x520) -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# else -# define CURL_TYPEOF_CURL_OFF_T __int64 -# define CURL_FORMAT_CURL_OFF_T "I64d" -# define CURL_FORMAT_CURL_OFF_TU "I64u" -# define CURL_SUFFIX_CURL_OFF_T i64 -# define CURL_SUFFIX_CURL_OFF_TU ui64 -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T int - -#elif defined(__TURBOC__) -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# define CURL_TYPEOF_CURL_SOCKLEN_T int - -#elif defined(__POCC__) -# if (__POCC__ < 280) -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# elif defined(_MSC_VER) -# define CURL_TYPEOF_CURL_OFF_T __int64 -# define CURL_FORMAT_CURL_OFF_T "I64d" -# define CURL_FORMAT_CURL_OFF_TU "I64u" -# define CURL_SUFFIX_CURL_OFF_T i64 -# define CURL_SUFFIX_CURL_OFF_TU ui64 -# else -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T int - -#elif defined(__LCC__) -# if defined(__MCST__) /* MCST eLbrus Compiler Collection */ -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t -# define CURL_PULL_SYS_TYPES_H 1 -# define CURL_PULL_SYS_SOCKET_H 1 -# else /* Local (or Little) C Compiler */ -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# define CURL_TYPEOF_CURL_SOCKLEN_T int -# endif - -#elif defined(macintosh) -# include -# if TYPE_LONGLONG -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# else -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int - -#elif defined(__TANDEM) -# if ! defined(__LP64) - /* Required for 32-bit NonStop builds only. */ -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# define CURL_TYPEOF_CURL_SOCKLEN_T int -# endif - -#elif defined(_WIN32_WCE) -# define CURL_TYPEOF_CURL_OFF_T __int64 -# define CURL_FORMAT_CURL_OFF_T "I64d" -# define CURL_FORMAT_CURL_OFF_TU "I64u" -# define CURL_SUFFIX_CURL_OFF_T i64 -# define CURL_SUFFIX_CURL_OFF_TU ui64 -# define CURL_TYPEOF_CURL_SOCKLEN_T int - -#elif defined(__MINGW32__) -# include -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T PRId64 -# define CURL_FORMAT_CURL_OFF_TU PRIu64 -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# define CURL_TYPEOF_CURL_SOCKLEN_T int -# define CURL_PULL_SYS_TYPES_H 1 - -#elif defined(__VMS) -# if defined(__VAX) -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# else -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int - -#elif defined(__OS400__) -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t -# define CURL_PULL_SYS_TYPES_H 1 -# define CURL_PULL_SYS_SOCKET_H 1 - -#elif defined(__MVS__) -# if defined(_LONG_LONG) -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# elif defined(_LP64) -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# else -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t -# define CURL_PULL_SYS_TYPES_H 1 -# define CURL_PULL_SYS_SOCKET_H 1 - -#elif defined(__370__) -# if defined(__IBMC__) || defined(__IBMCPP__) -# if defined(_ILP32) -# elif defined(_LP64) -# endif -# if defined(_LONG_LONG) -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# elif defined(_LP64) -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# else -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t -# define CURL_PULL_SYS_TYPES_H 1 -# define CURL_PULL_SYS_SOCKET_H 1 -# endif - -#elif defined(TPF) -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# define CURL_TYPEOF_CURL_SOCKLEN_T int - -#elif defined(__TINYC__) /* also known as tcc */ -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t -# define CURL_PULL_SYS_TYPES_H 1 -# define CURL_PULL_SYS_SOCKET_H 1 - -#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Oracle Solaris Studio */ -# if !defined(__LP64) && (defined(__ILP32) || \ - defined(__i386) || \ - defined(__sparcv8) || \ - defined(__sparcv8plus)) -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# elif defined(__LP64) || \ - defined(__amd64) || defined(__sparcv9) -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t -# define CURL_PULL_SYS_TYPES_H 1 -# define CURL_PULL_SYS_SOCKET_H 1 - -#elif defined(__xlc__) /* IBM xlc compiler */ -# if !defined(_LP64) -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# else -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t -# define CURL_PULL_SYS_TYPES_H 1 -# define CURL_PULL_SYS_SOCKET_H 1 - -#elif defined(__hpux) /* HP aCC compiler */ -# if !defined(_LP64) -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# else -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t -# define CURL_PULL_SYS_TYPES_H 1 -# define CURL_PULL_SYS_SOCKET_H 1 - -/* ===================================== */ -/* KEEP MSVC THE PENULTIMATE ENTRY */ -/* ===================================== */ - -#elif defined(_MSC_VER) -# if (_MSC_VER >= 1800) -# include -# define CURL_TYPEOF_CURL_OFF_T __int64 -# define CURL_FORMAT_CURL_OFF_T PRId64 -# define CURL_FORMAT_CURL_OFF_TU PRIu64 -# define CURL_SUFFIX_CURL_OFF_T i64 -# define CURL_SUFFIX_CURL_OFF_TU ui64 -# elif (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) -# define CURL_TYPEOF_CURL_OFF_T __int64 -# define CURL_FORMAT_CURL_OFF_T "I64d" -# define CURL_FORMAT_CURL_OFF_TU "I64u" -# define CURL_SUFFIX_CURL_OFF_T i64 -# define CURL_SUFFIX_CURL_OFF_TU ui64 -# else -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T int - -/* ===================================== */ -/* KEEP GENERIC GCC THE LAST ENTRY */ -/* ===================================== */ - -#elif defined(__GNUC__) && !defined(_SCO_DS) -# if !defined(__LP64__) && \ - (defined(__ILP32__) || defined(__i386__) || defined(__hppa__) || \ - defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || \ - defined(__sparc__) || defined(__mips__) || defined(__sh__) || \ - defined(__XTENSA__) || \ - (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4) || \ - (defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L)) -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# elif defined(__LP64__) || \ - defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \ - defined(__e2k__) || \ - (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \ - (defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L) -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# endif -# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t -# define CURL_PULL_SYS_TYPES_H 1 -# define CURL_PULL_SYS_SOCKET_H 1 - -#else -/* generic "safe guess" on old 32 bit style */ -# define CURL_TYPEOF_CURL_OFF_T long -# define CURL_FORMAT_CURL_OFF_T "ld" -# define CURL_FORMAT_CURL_OFF_TU "lu" -# define CURL_SUFFIX_CURL_OFF_T L -# define CURL_SUFFIX_CURL_OFF_TU UL -# define CURL_TYPEOF_CURL_SOCKLEN_T int -#endif - -#ifdef _AIX -/* AIX needs */ -#define CURL_PULL_SYS_POLL_H -#endif - -/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */ -/* sys/types.h is required here to properly make type definitions below. */ -#ifdef CURL_PULL_SYS_TYPES_H -# include -#endif - -/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */ -/* sys/socket.h is required here to properly make type definitions below. */ -#ifdef CURL_PULL_SYS_SOCKET_H -# include -#endif - -/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */ -/* sys/poll.h is required here to properly make type definitions below. */ -#ifdef CURL_PULL_SYS_POLL_H -# include -#endif - -/* Data type definition of curl_socklen_t. */ -#ifdef CURL_TYPEOF_CURL_SOCKLEN_T - typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; -#endif - -/* Data type definition of curl_off_t. */ - -#ifdef CURL_TYPEOF_CURL_OFF_T - typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; -#endif - -/* - * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow - * these to be visible and exported by the external libcurl interface API, - * while also making them visible to the library internals, simply including - * curl_setup.h, without actually needing to include curl.h internally. - * If some day this section would grow big enough, all this should be moved - * to its own header file. - */ - -/* - * Figure out if we can use the ## preprocessor operator, which is supported - * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ - * or __cplusplus so we need to carefully check for them too. - */ - -#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ - defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ - defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \ - defined(__ILEC400__) - /* This compiler is believed to have an ISO compatible preprocessor */ -#define CURL_ISOCPP -#else - /* This compiler is believed NOT to have an ISO compatible preprocessor */ -#undef CURL_ISOCPP -#endif - -/* - * Macros for minimum-width signed and unsigned curl_off_t integer constants. - */ - -#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551) -# define CURLINC_OFF_T_C_HLPR2(x) x -# define CURLINC_OFF_T_C_HLPR1(x) CURLINC_OFF_T_C_HLPR2(x) -# define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \ - CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T) -# define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \ - CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU) -#else -# ifdef CURL_ISOCPP -# define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix -# else -# define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix -# endif -# define CURLINC_OFF_T_C_HLPR1(Val,Suffix) CURLINC_OFF_T_C_HLPR2(Val,Suffix) -# define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T) -# define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU) -#endif - -#endif /* CURLINC_SYSTEM_H */ diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/typecheck-gcc.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/typecheck-gcc.h deleted file mode 100644 index b880f3dc605..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/typecheck-gcc.h +++ /dev/null @@ -1,717 +0,0 @@ -#ifndef CURLINC_TYPECHECK_GCC_H -#define CURLINC_TYPECHECK_GCC_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -/* wraps curl_easy_setopt() with typechecking */ - -/* To add a new kind of warning, add an - * if(curlcheck_sometype_option(_curl_opt)) - * if(!curlcheck_sometype(value)) - * _curl_easy_setopt_err_sometype(); - * block and define curlcheck_sometype_option, curlcheck_sometype and - * _curl_easy_setopt_err_sometype below - * - * NOTE: We use two nested 'if' statements here instead of the && operator, in - * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x - * when compiling with -Wlogical-op. - * - * To add an option that uses the same type as an existing option, you'll just - * need to extend the appropriate _curl_*_option macro - */ -#define curl_easy_setopt(handle, option, value) \ - __extension__({ \ - CURLoption _curl_opt = (option); \ - if(__builtin_constant_p(_curl_opt)) { \ - CURL_IGNORE_DEPRECATION( \ - if(curlcheck_long_option(_curl_opt)) \ - if(!curlcheck_long(value)) \ - _curl_easy_setopt_err_long(); \ - if(curlcheck_off_t_option(_curl_opt)) \ - if(!curlcheck_off_t(value)) \ - _curl_easy_setopt_err_curl_off_t(); \ - if(curlcheck_string_option(_curl_opt)) \ - if(!curlcheck_string(value)) \ - _curl_easy_setopt_err_string(); \ - if(curlcheck_write_cb_option(_curl_opt)) \ - if(!curlcheck_write_cb(value)) \ - _curl_easy_setopt_err_write_callback(); \ - if((_curl_opt) == CURLOPT_RESOLVER_START_FUNCTION) \ - if(!curlcheck_resolver_start_callback(value)) \ - _curl_easy_setopt_err_resolver_start_callback(); \ - if((_curl_opt) == CURLOPT_READFUNCTION) \ - if(!curlcheck_read_cb(value)) \ - _curl_easy_setopt_err_read_cb(); \ - if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \ - if(!curlcheck_ioctl_cb(value)) \ - _curl_easy_setopt_err_ioctl_cb(); \ - if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \ - if(!curlcheck_sockopt_cb(value)) \ - _curl_easy_setopt_err_sockopt_cb(); \ - if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \ - if(!curlcheck_opensocket_cb(value)) \ - _curl_easy_setopt_err_opensocket_cb(); \ - if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \ - if(!curlcheck_progress_cb(value)) \ - _curl_easy_setopt_err_progress_cb(); \ - if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \ - if(!curlcheck_debug_cb(value)) \ - _curl_easy_setopt_err_debug_cb(); \ - if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \ - if(!curlcheck_ssl_ctx_cb(value)) \ - _curl_easy_setopt_err_ssl_ctx_cb(); \ - if(curlcheck_conv_cb_option(_curl_opt)) \ - if(!curlcheck_conv_cb(value)) \ - _curl_easy_setopt_err_conv_cb(); \ - if((_curl_opt) == CURLOPT_SEEKFUNCTION) \ - if(!curlcheck_seek_cb(value)) \ - _curl_easy_setopt_err_seek_cb(); \ - if(curlcheck_cb_data_option(_curl_opt)) \ - if(!curlcheck_cb_data(value)) \ - _curl_easy_setopt_err_cb_data(); \ - if((_curl_opt) == CURLOPT_ERRORBUFFER) \ - if(!curlcheck_error_buffer(value)) \ - _curl_easy_setopt_err_error_buffer(); \ - if((_curl_opt) == CURLOPT_STDERR) \ - if(!curlcheck_FILE(value)) \ - _curl_easy_setopt_err_FILE(); \ - if(curlcheck_postfields_option(_curl_opt)) \ - if(!curlcheck_postfields(value)) \ - _curl_easy_setopt_err_postfields(); \ - if((_curl_opt) == CURLOPT_HTTPPOST) \ - if(!curlcheck_arr((value), struct curl_httppost)) \ - _curl_easy_setopt_err_curl_httpost(); \ - if((_curl_opt) == CURLOPT_MIMEPOST) \ - if(!curlcheck_ptr((value), curl_mime)) \ - _curl_easy_setopt_err_curl_mimepost(); \ - if(curlcheck_slist_option(_curl_opt)) \ - if(!curlcheck_arr((value), struct curl_slist)) \ - _curl_easy_setopt_err_curl_slist(); \ - if((_curl_opt) == CURLOPT_SHARE) \ - if(!curlcheck_ptr((value), CURLSH)) \ - _curl_easy_setopt_err_CURLSH(); \ - ) \ - } \ - curl_easy_setopt(handle, _curl_opt, value); \ - }) - -/* wraps curl_easy_getinfo() with typechecking */ -#define curl_easy_getinfo(handle, info, arg) \ - __extension__({ \ - CURLINFO _curl_info = (info); \ - if(__builtin_constant_p(_curl_info)) { \ - CURL_IGNORE_DEPRECATION( \ - if(curlcheck_string_info(_curl_info)) \ - if(!curlcheck_arr((arg), char *)) \ - _curl_easy_getinfo_err_string(); \ - if(curlcheck_long_info(_curl_info)) \ - if(!curlcheck_arr((arg), long)) \ - _curl_easy_getinfo_err_long(); \ - if(curlcheck_double_info(_curl_info)) \ - if(!curlcheck_arr((arg), double)) \ - _curl_easy_getinfo_err_double(); \ - if(curlcheck_slist_info(_curl_info)) \ - if(!curlcheck_arr((arg), struct curl_slist *)) \ - _curl_easy_getinfo_err_curl_slist(); \ - if(curlcheck_tlssessioninfo_info(_curl_info)) \ - if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \ - _curl_easy_getinfo_err_curl_tlssesssioninfo(); \ - if(curlcheck_certinfo_info(_curl_info)) \ - if(!curlcheck_arr((arg), struct curl_certinfo *)) \ - _curl_easy_getinfo_err_curl_certinfo(); \ - if(curlcheck_socket_info(_curl_info)) \ - if(!curlcheck_arr((arg), curl_socket_t)) \ - _curl_easy_getinfo_err_curl_socket(); \ - if(curlcheck_off_t_info(_curl_info)) \ - if(!curlcheck_arr((arg), curl_off_t)) \ - _curl_easy_getinfo_err_curl_off_t(); \ - ) \ - } \ - curl_easy_getinfo(handle, _curl_info, arg); \ - }) - -/* - * For now, just make sure that the functions are called with three arguments - */ -#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) -#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) - - -/* the actual warnings, triggered by calling the _curl_easy_setopt_err* - * functions */ - -/* To define a new warning, use _CURL_WARNING(identifier, "message") */ -#define CURLWARNING(id, message) \ - static void __attribute__((__warning__(message))) \ - __attribute__((__unused__)) __attribute__((__noinline__)) \ - id(void) { __asm__(""); } - -CURLWARNING(_curl_easy_setopt_err_long, - "curl_easy_setopt expects a long argument for this option") -CURLWARNING(_curl_easy_setopt_err_curl_off_t, - "curl_easy_setopt expects a curl_off_t argument for this option") -CURLWARNING(_curl_easy_setopt_err_string, - "curl_easy_setopt expects a " - "string ('char *' or char[]) argument for this option" - ) -CURLWARNING(_curl_easy_setopt_err_write_callback, - "curl_easy_setopt expects a curl_write_callback argument for this option") -CURLWARNING(_curl_easy_setopt_err_resolver_start_callback, - "curl_easy_setopt expects a " - "curl_resolver_start_callback argument for this option" - ) -CURLWARNING(_curl_easy_setopt_err_read_cb, - "curl_easy_setopt expects a curl_read_callback argument for this option") -CURLWARNING(_curl_easy_setopt_err_ioctl_cb, - "curl_easy_setopt expects a curl_ioctl_callback argument for this option") -CURLWARNING(_curl_easy_setopt_err_sockopt_cb, - "curl_easy_setopt expects a curl_sockopt_callback argument for this option") -CURLWARNING(_curl_easy_setopt_err_opensocket_cb, - "curl_easy_setopt expects a " - "curl_opensocket_callback argument for this option" - ) -CURLWARNING(_curl_easy_setopt_err_progress_cb, - "curl_easy_setopt expects a curl_progress_callback argument for this option") -CURLWARNING(_curl_easy_setopt_err_debug_cb, - "curl_easy_setopt expects a curl_debug_callback argument for this option") -CURLWARNING(_curl_easy_setopt_err_ssl_ctx_cb, - "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option") -CURLWARNING(_curl_easy_setopt_err_conv_cb, - "curl_easy_setopt expects a curl_conv_callback argument for this option") -CURLWARNING(_curl_easy_setopt_err_seek_cb, - "curl_easy_setopt expects a curl_seek_callback argument for this option") -CURLWARNING(_curl_easy_setopt_err_cb_data, - "curl_easy_setopt expects a " - "private data pointer as argument for this option") -CURLWARNING(_curl_easy_setopt_err_error_buffer, - "curl_easy_setopt expects a " - "char buffer of CURL_ERROR_SIZE as argument for this option") -CURLWARNING(_curl_easy_setopt_err_FILE, - "curl_easy_setopt expects a 'FILE *' argument for this option") -CURLWARNING(_curl_easy_setopt_err_postfields, - "curl_easy_setopt expects a 'void *' or 'char *' argument for this option") -CURLWARNING(_curl_easy_setopt_err_curl_httpost, - "curl_easy_setopt expects a 'struct curl_httppost *' " - "argument for this option") -CURLWARNING(_curl_easy_setopt_err_curl_mimepost, - "curl_easy_setopt expects a 'curl_mime *' " - "argument for this option") -CURLWARNING(_curl_easy_setopt_err_curl_slist, - "curl_easy_setopt expects a 'struct curl_slist *' argument for this option") -CURLWARNING(_curl_easy_setopt_err_CURLSH, - "curl_easy_setopt expects a CURLSH* argument for this option") - -CURLWARNING(_curl_easy_getinfo_err_string, - "curl_easy_getinfo expects a pointer to 'char *' for this info") -CURLWARNING(_curl_easy_getinfo_err_long, - "curl_easy_getinfo expects a pointer to long for this info") -CURLWARNING(_curl_easy_getinfo_err_double, - "curl_easy_getinfo expects a pointer to double for this info") -CURLWARNING(_curl_easy_getinfo_err_curl_slist, - "curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info") -CURLWARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo, - "curl_easy_getinfo expects a pointer to " - "'struct curl_tlssessioninfo *' for this info") -CURLWARNING(_curl_easy_getinfo_err_curl_certinfo, - "curl_easy_getinfo expects a pointer to " - "'struct curl_certinfo *' for this info") -CURLWARNING(_curl_easy_getinfo_err_curl_socket, - "curl_easy_getinfo expects a pointer to curl_socket_t for this info") -CURLWARNING(_curl_easy_getinfo_err_curl_off_t, - "curl_easy_getinfo expects a pointer to curl_off_t for this info") - -/* groups of curl_easy_setops options that take the same type of argument */ - -/* To add a new option to one of the groups, just add - * (option) == CURLOPT_SOMETHING - * to the or-expression. If the option takes a long or curl_off_t, you don't - * have to do anything - */ - -/* evaluates to true if option takes a long argument */ -#define curlcheck_long_option(option) \ - (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT) - -#define curlcheck_off_t_option(option) \ - (((option) > CURLOPTTYPE_OFF_T) && ((option) < CURLOPTTYPE_BLOB)) - -/* evaluates to true if option takes a char* argument */ -#define curlcheck_string_option(option) \ - ((option) == CURLOPT_ABSTRACT_UNIX_SOCKET || \ - (option) == CURLOPT_ACCEPT_ENCODING || \ - (option) == CURLOPT_ALTSVC || \ - (option) == CURLOPT_CAINFO || \ - (option) == CURLOPT_CAPATH || \ - (option) == CURLOPT_COOKIE || \ - (option) == CURLOPT_COOKIEFILE || \ - (option) == CURLOPT_COOKIEJAR || \ - (option) == CURLOPT_COOKIELIST || \ - (option) == CURLOPT_CRLFILE || \ - (option) == CURLOPT_CUSTOMREQUEST || \ - (option) == CURLOPT_DEFAULT_PROTOCOL || \ - (option) == CURLOPT_DNS_INTERFACE || \ - (option) == CURLOPT_DNS_LOCAL_IP4 || \ - (option) == CURLOPT_DNS_LOCAL_IP6 || \ - (option) == CURLOPT_DNS_SERVERS || \ - (option) == CURLOPT_DOH_URL || \ - (option) == CURLOPT_EGDSOCKET || \ - (option) == CURLOPT_FTP_ACCOUNT || \ - (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \ - (option) == CURLOPT_FTPPORT || \ - (option) == CURLOPT_HSTS || \ - (option) == CURLOPT_HAPROXY_CLIENT_IP || \ - (option) == CURLOPT_INTERFACE || \ - (option) == CURLOPT_ISSUERCERT || \ - (option) == CURLOPT_KEYPASSWD || \ - (option) == CURLOPT_KRBLEVEL || \ - (option) == CURLOPT_LOGIN_OPTIONS || \ - (option) == CURLOPT_MAIL_AUTH || \ - (option) == CURLOPT_MAIL_FROM || \ - (option) == CURLOPT_NETRC_FILE || \ - (option) == CURLOPT_NOPROXY || \ - (option) == CURLOPT_PASSWORD || \ - (option) == CURLOPT_PINNEDPUBLICKEY || \ - (option) == CURLOPT_PRE_PROXY || \ - (option) == CURLOPT_PROTOCOLS_STR || \ - (option) == CURLOPT_PROXY || \ - (option) == CURLOPT_PROXY_CAINFO || \ - (option) == CURLOPT_PROXY_CAPATH || \ - (option) == CURLOPT_PROXY_CRLFILE || \ - (option) == CURLOPT_PROXY_ISSUERCERT || \ - (option) == CURLOPT_PROXY_KEYPASSWD || \ - (option) == CURLOPT_PROXY_PINNEDPUBLICKEY || \ - (option) == CURLOPT_PROXY_SERVICE_NAME || \ - (option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \ - (option) == CURLOPT_PROXY_SSLCERT || \ - (option) == CURLOPT_PROXY_SSLCERTTYPE || \ - (option) == CURLOPT_PROXY_SSLKEY || \ - (option) == CURLOPT_PROXY_SSLKEYTYPE || \ - (option) == CURLOPT_PROXY_TLS13_CIPHERS || \ - (option) == CURLOPT_PROXY_TLSAUTH_PASSWORD || \ - (option) == CURLOPT_PROXY_TLSAUTH_TYPE || \ - (option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \ - (option) == CURLOPT_PROXYPASSWORD || \ - (option) == CURLOPT_PROXYUSERNAME || \ - (option) == CURLOPT_PROXYUSERPWD || \ - (option) == CURLOPT_RANDOM_FILE || \ - (option) == CURLOPT_RANGE || \ - (option) == CURLOPT_REDIR_PROTOCOLS_STR || \ - (option) == CURLOPT_REFERER || \ - (option) == CURLOPT_REQUEST_TARGET || \ - (option) == CURLOPT_RTSP_SESSION_ID || \ - (option) == CURLOPT_RTSP_STREAM_URI || \ - (option) == CURLOPT_RTSP_TRANSPORT || \ - (option) == CURLOPT_SASL_AUTHZID || \ - (option) == CURLOPT_SERVICE_NAME || \ - (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \ - (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \ - (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 || \ - (option) == CURLOPT_SSH_KNOWNHOSTS || \ - (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \ - (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \ - (option) == CURLOPT_SSLCERT || \ - (option) == CURLOPT_SSLCERTTYPE || \ - (option) == CURLOPT_SSLENGINE || \ - (option) == CURLOPT_SSLKEY || \ - (option) == CURLOPT_SSLKEYTYPE || \ - (option) == CURLOPT_SSL_CIPHER_LIST || \ - (option) == CURLOPT_TLS13_CIPHERS || \ - (option) == CURLOPT_TLSAUTH_PASSWORD || \ - (option) == CURLOPT_TLSAUTH_TYPE || \ - (option) == CURLOPT_TLSAUTH_USERNAME || \ - (option) == CURLOPT_UNIX_SOCKET_PATH || \ - (option) == CURLOPT_URL || \ - (option) == CURLOPT_USERAGENT || \ - (option) == CURLOPT_USERNAME || \ - (option) == CURLOPT_AWS_SIGV4 || \ - (option) == CURLOPT_USERPWD || \ - (option) == CURLOPT_XOAUTH2_BEARER || \ - (option) == CURLOPT_SSL_EC_CURVES || \ - 0) - -/* evaluates to true if option takes a curl_write_callback argument */ -#define curlcheck_write_cb_option(option) \ - ((option) == CURLOPT_HEADERFUNCTION || \ - (option) == CURLOPT_WRITEFUNCTION) - -/* evaluates to true if option takes a curl_conv_callback argument */ -#define curlcheck_conv_cb_option(option) \ - ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \ - (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \ - (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION) - -/* evaluates to true if option takes a data argument to pass to a callback */ -#define curlcheck_cb_data_option(option) \ - ((option) == CURLOPT_CHUNK_DATA || \ - (option) == CURLOPT_CLOSESOCKETDATA || \ - (option) == CURLOPT_DEBUGDATA || \ - (option) == CURLOPT_FNMATCH_DATA || \ - (option) == CURLOPT_HEADERDATA || \ - (option) == CURLOPT_HSTSREADDATA || \ - (option) == CURLOPT_HSTSWRITEDATA || \ - (option) == CURLOPT_INTERLEAVEDATA || \ - (option) == CURLOPT_IOCTLDATA || \ - (option) == CURLOPT_OPENSOCKETDATA || \ - (option) == CURLOPT_PREREQDATA || \ - (option) == CURLOPT_PROGRESSDATA || \ - (option) == CURLOPT_READDATA || \ - (option) == CURLOPT_SEEKDATA || \ - (option) == CURLOPT_SOCKOPTDATA || \ - (option) == CURLOPT_SSH_KEYDATA || \ - (option) == CURLOPT_SSL_CTX_DATA || \ - (option) == CURLOPT_WRITEDATA || \ - (option) == CURLOPT_RESOLVER_START_DATA || \ - (option) == CURLOPT_TRAILERDATA || \ - (option) == CURLOPT_SSH_HOSTKEYDATA || \ - 0) - -/* evaluates to true if option takes a POST data argument (void* or char*) */ -#define curlcheck_postfields_option(option) \ - ((option) == CURLOPT_POSTFIELDS || \ - (option) == CURLOPT_COPYPOSTFIELDS || \ - 0) - -/* evaluates to true if option takes a struct curl_slist * argument */ -#define curlcheck_slist_option(option) \ - ((option) == CURLOPT_HTTP200ALIASES || \ - (option) == CURLOPT_HTTPHEADER || \ - (option) == CURLOPT_MAIL_RCPT || \ - (option) == CURLOPT_POSTQUOTE || \ - (option) == CURLOPT_PREQUOTE || \ - (option) == CURLOPT_PROXYHEADER || \ - (option) == CURLOPT_QUOTE || \ - (option) == CURLOPT_RESOLVE || \ - (option) == CURLOPT_TELNETOPTIONS || \ - (option) == CURLOPT_CONNECT_TO || \ - 0) - -/* groups of curl_easy_getinfo infos that take the same type of argument */ - -/* evaluates to true if info expects a pointer to char * argument */ -#define curlcheck_string_info(info) \ - (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \ - (info) != CURLINFO_PRIVATE) - -/* evaluates to true if info expects a pointer to long argument */ -#define curlcheck_long_info(info) \ - (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE) - -/* evaluates to true if info expects a pointer to double argument */ -#define curlcheck_double_info(info) \ - (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST) - -/* true if info expects a pointer to struct curl_slist * argument */ -#define curlcheck_slist_info(info) \ - (((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST)) - -/* true if info expects a pointer to struct curl_tlssessioninfo * argument */ -#define curlcheck_tlssessioninfo_info(info) \ - (((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION)) - -/* true if info expects a pointer to struct curl_certinfo * argument */ -#define curlcheck_certinfo_info(info) ((info) == CURLINFO_CERTINFO) - -/* true if info expects a pointer to struct curl_socket_t argument */ -#define curlcheck_socket_info(info) \ - (CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T) - -/* true if info expects a pointer to curl_off_t argument */ -#define curlcheck_off_t_info(info) \ - (CURLINFO_OFF_T < (info)) - - -/* typecheck helpers -- check whether given expression has requested type */ - -/* For pointers, you can use the curlcheck_ptr/curlcheck_arr macros, - * otherwise define a new macro. Search for __builtin_types_compatible_p - * in the GCC manual. - * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is - * the actual expression passed to the curl_easy_setopt macro. This - * means that you can only apply the sizeof and __typeof__ operators, no - * == or whatsoever. - */ - -/* XXX: should evaluate to true if expr is a pointer */ -#define curlcheck_any_ptr(expr) \ - (sizeof(expr) == sizeof(void *)) - -/* evaluates to true if expr is NULL */ -/* XXX: must not evaluate expr, so this check is not accurate */ -#define curlcheck_NULL(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL))) - -/* evaluates to true if expr is type*, const type* or NULL */ -#define curlcheck_ptr(expr, type) \ - (curlcheck_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), type *) || \ - __builtin_types_compatible_p(__typeof__(expr), const type *)) - -/* evaluates to true if expr is one of type[], type*, NULL or const type* */ -#define curlcheck_arr(expr, type) \ - (curlcheck_ptr((expr), type) || \ - __builtin_types_compatible_p(__typeof__(expr), type [])) - -/* evaluates to true if expr is a string */ -#define curlcheck_string(expr) \ - (curlcheck_arr((expr), char) || \ - curlcheck_arr((expr), signed char) || \ - curlcheck_arr((expr), unsigned char)) - -/* evaluates to true if expr is a long (no matter the signedness) - * XXX: for now, int is also accepted (and therefore short and char, which - * are promoted to int when passed to a variadic function) */ -#define curlcheck_long(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), long) || \ - __builtin_types_compatible_p(__typeof__(expr), signed long) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \ - __builtin_types_compatible_p(__typeof__(expr), int) || \ - __builtin_types_compatible_p(__typeof__(expr), signed int) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \ - __builtin_types_compatible_p(__typeof__(expr), short) || \ - __builtin_types_compatible_p(__typeof__(expr), signed short) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \ - __builtin_types_compatible_p(__typeof__(expr), char) || \ - __builtin_types_compatible_p(__typeof__(expr), signed char) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned char)) - -/* evaluates to true if expr is of type curl_off_t */ -#define curlcheck_off_t(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) - -/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ -/* XXX: also check size of an char[] array? */ -#define curlcheck_error_buffer(expr) \ - (curlcheck_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), char *) || \ - __builtin_types_compatible_p(__typeof__(expr), char[])) - -/* evaluates to true if expr is of type (const) void* or (const) FILE* */ -#if 0 -#define curlcheck_cb_data(expr) \ - (curlcheck_ptr((expr), void) || \ - curlcheck_ptr((expr), FILE)) -#else /* be less strict */ -#define curlcheck_cb_data(expr) \ - curlcheck_any_ptr(expr) -#endif - -/* evaluates to true if expr is of type FILE* */ -#define curlcheck_FILE(expr) \ - (curlcheck_NULL(expr) || \ - (__builtin_types_compatible_p(__typeof__(expr), FILE *))) - -/* evaluates to true if expr can be passed as POST data (void* or char*) */ -#define curlcheck_postfields(expr) \ - (curlcheck_ptr((expr), void) || \ - curlcheck_arr((expr), char) || \ - curlcheck_arr((expr), unsigned char)) - -/* helper: __builtin_types_compatible_p distinguishes between functions and - * function pointers, hide it */ -#define curlcheck_cb_compatible(func, type) \ - (__builtin_types_compatible_p(__typeof__(func), type) || \ - __builtin_types_compatible_p(__typeof__(func) *, type)) - -/* evaluates to true if expr is of type curl_resolver_start_callback */ -#define curlcheck_resolver_start_callback(expr) \ - (curlcheck_NULL(expr) || \ - curlcheck_cb_compatible((expr), curl_resolver_start_callback)) - -/* evaluates to true if expr is of type curl_read_callback or "similar" */ -#define curlcheck_read_cb(expr) \ - (curlcheck_NULL(expr) || \ - curlcheck_cb_compatible((expr), __typeof__(fread) *) || \ - curlcheck_cb_compatible((expr), curl_read_callback) || \ - curlcheck_cb_compatible((expr), _curl_read_callback1) || \ - curlcheck_cb_compatible((expr), _curl_read_callback2) || \ - curlcheck_cb_compatible((expr), _curl_read_callback3) || \ - curlcheck_cb_compatible((expr), _curl_read_callback4) || \ - curlcheck_cb_compatible((expr), _curl_read_callback5) || \ - curlcheck_cb_compatible((expr), _curl_read_callback6)) -typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *); -typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *); -typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *); -typedef size_t (*_curl_read_callback4)(void *, size_t, size_t, void *); -typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *); -typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *); - -/* evaluates to true if expr is of type curl_write_callback or "similar" */ -#define curlcheck_write_cb(expr) \ - (curlcheck_read_cb(expr) || \ - curlcheck_cb_compatible((expr), __typeof__(fwrite) *) || \ - curlcheck_cb_compatible((expr), curl_write_callback) || \ - curlcheck_cb_compatible((expr), _curl_write_callback1) || \ - curlcheck_cb_compatible((expr), _curl_write_callback2) || \ - curlcheck_cb_compatible((expr), _curl_write_callback3) || \ - curlcheck_cb_compatible((expr), _curl_write_callback4) || \ - curlcheck_cb_compatible((expr), _curl_write_callback5) || \ - curlcheck_cb_compatible((expr), _curl_write_callback6)) -typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *); -typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t, - const void *); -typedef size_t (*_curl_write_callback3)(const char *, size_t, size_t, FILE *); -typedef size_t (*_curl_write_callback4)(const void *, size_t, size_t, void *); -typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t, - const void *); -typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *); - -/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */ -#define curlcheck_ioctl_cb(expr) \ - (curlcheck_NULL(expr) || \ - curlcheck_cb_compatible((expr), curl_ioctl_callback) || \ - curlcheck_cb_compatible((expr), _curl_ioctl_callback1) || \ - curlcheck_cb_compatible((expr), _curl_ioctl_callback2) || \ - curlcheck_cb_compatible((expr), _curl_ioctl_callback3) || \ - curlcheck_cb_compatible((expr), _curl_ioctl_callback4)) -typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *); -typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *); -typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *); -typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *); - -/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */ -#define curlcheck_sockopt_cb(expr) \ - (curlcheck_NULL(expr) || \ - curlcheck_cb_compatible((expr), curl_sockopt_callback) || \ - curlcheck_cb_compatible((expr), _curl_sockopt_callback1) || \ - curlcheck_cb_compatible((expr), _curl_sockopt_callback2)) -typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); -typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t, - curlsocktype); - -/* evaluates to true if expr is of type curl_opensocket_callback or - "similar" */ -#define curlcheck_opensocket_cb(expr) \ - (curlcheck_NULL(expr) || \ - curlcheck_cb_compatible((expr), curl_opensocket_callback) || \ - curlcheck_cb_compatible((expr), _curl_opensocket_callback1) || \ - curlcheck_cb_compatible((expr), _curl_opensocket_callback2) || \ - curlcheck_cb_compatible((expr), _curl_opensocket_callback3) || \ - curlcheck_cb_compatible((expr), _curl_opensocket_callback4)) -typedef curl_socket_t (*_curl_opensocket_callback1) - (void *, curlsocktype, struct curl_sockaddr *); -typedef curl_socket_t (*_curl_opensocket_callback2) - (void *, curlsocktype, const struct curl_sockaddr *); -typedef curl_socket_t (*_curl_opensocket_callback3) - (const void *, curlsocktype, struct curl_sockaddr *); -typedef curl_socket_t (*_curl_opensocket_callback4) - (const void *, curlsocktype, const struct curl_sockaddr *); - -/* evaluates to true if expr is of type curl_progress_callback or "similar" */ -#define curlcheck_progress_cb(expr) \ - (curlcheck_NULL(expr) || \ - curlcheck_cb_compatible((expr), curl_progress_callback) || \ - curlcheck_cb_compatible((expr), _curl_progress_callback1) || \ - curlcheck_cb_compatible((expr), _curl_progress_callback2)) -typedef int (*_curl_progress_callback1)(void *, - double, double, double, double); -typedef int (*_curl_progress_callback2)(const void *, - double, double, double, double); - -/* evaluates to true if expr is of type curl_debug_callback or "similar" */ -#define curlcheck_debug_cb(expr) \ - (curlcheck_NULL(expr) || \ - curlcheck_cb_compatible((expr), curl_debug_callback) || \ - curlcheck_cb_compatible((expr), _curl_debug_callback1) || \ - curlcheck_cb_compatible((expr), _curl_debug_callback2) || \ - curlcheck_cb_compatible((expr), _curl_debug_callback3) || \ - curlcheck_cb_compatible((expr), _curl_debug_callback4) || \ - curlcheck_cb_compatible((expr), _curl_debug_callback5) || \ - curlcheck_cb_compatible((expr), _curl_debug_callback6) || \ - curlcheck_cb_compatible((expr), _curl_debug_callback7) || \ - curlcheck_cb_compatible((expr), _curl_debug_callback8)) -typedef int (*_curl_debug_callback1) (CURL *, - curl_infotype, char *, size_t, void *); -typedef int (*_curl_debug_callback2) (CURL *, - curl_infotype, char *, size_t, const void *); -typedef int (*_curl_debug_callback3) (CURL *, - curl_infotype, const char *, size_t, void *); -typedef int (*_curl_debug_callback4) (CURL *, - curl_infotype, const char *, size_t, const void *); -typedef int (*_curl_debug_callback5) (CURL *, - curl_infotype, unsigned char *, size_t, void *); -typedef int (*_curl_debug_callback6) (CURL *, - curl_infotype, unsigned char *, size_t, const void *); -typedef int (*_curl_debug_callback7) (CURL *, - curl_infotype, const unsigned char *, size_t, void *); -typedef int (*_curl_debug_callback8) (CURL *, - curl_infotype, const unsigned char *, size_t, const void *); - -/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ -/* this is getting even messier... */ -#define curlcheck_ssl_ctx_cb(expr) \ - (curlcheck_NULL(expr) || \ - curlcheck_cb_compatible((expr), curl_ssl_ctx_callback) || \ - curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback1) || \ - curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback2) || \ - curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback3) || \ - curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback4) || \ - curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback5) || \ - curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback6) || \ - curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback7) || \ - curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback8)) -typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *); -typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *); -typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *); -typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *, - const void *); -#ifdef HEADER_SSL_H -/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX - * this will of course break if we're included before OpenSSL headers... - */ -typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX *, void *); -typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX *, const void *); -typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX *, void *); -typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX *, - const void *); -#else -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7; -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8; -#endif - -/* evaluates to true if expr is of type curl_conv_callback or "similar" */ -#define curlcheck_conv_cb(expr) \ - (curlcheck_NULL(expr) || \ - curlcheck_cb_compatible((expr), curl_conv_callback) || \ - curlcheck_cb_compatible((expr), _curl_conv_callback1) || \ - curlcheck_cb_compatible((expr), _curl_conv_callback2) || \ - curlcheck_cb_compatible((expr), _curl_conv_callback3) || \ - curlcheck_cb_compatible((expr), _curl_conv_callback4)) -typedef CURLcode (*_curl_conv_callback1)(char *, size_t length); -typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length); -typedef CURLcode (*_curl_conv_callback3)(void *, size_t length); -typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length); - -/* evaluates to true if expr is of type curl_seek_callback or "similar" */ -#define curlcheck_seek_cb(expr) \ - (curlcheck_NULL(expr) || \ - curlcheck_cb_compatible((expr), curl_seek_callback) || \ - curlcheck_cb_compatible((expr), _curl_seek_callback1) || \ - curlcheck_cb_compatible((expr), _curl_seek_callback2)) -typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int); -typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int); - - -#endif /* CURLINC_TYPECHECK_GCC_H */ diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/urlapi.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/urlapi.h deleted file mode 100644 index 91f8c4548aa..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/urlapi.h +++ /dev/null @@ -1,151 +0,0 @@ -#ifndef CURLINC_URLAPI_H -#define CURLINC_URLAPI_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -#include "curl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* the error codes for the URL API */ -typedef enum { - CURLUE_OK, - CURLUE_BAD_HANDLE, /* 1 */ - CURLUE_BAD_PARTPOINTER, /* 2 */ - CURLUE_MALFORMED_INPUT, /* 3 */ - CURLUE_BAD_PORT_NUMBER, /* 4 */ - CURLUE_UNSUPPORTED_SCHEME, /* 5 */ - CURLUE_URLDECODE, /* 6 */ - CURLUE_OUT_OF_MEMORY, /* 7 */ - CURLUE_USER_NOT_ALLOWED, /* 8 */ - CURLUE_UNKNOWN_PART, /* 9 */ - CURLUE_NO_SCHEME, /* 10 */ - CURLUE_NO_USER, /* 11 */ - CURLUE_NO_PASSWORD, /* 12 */ - CURLUE_NO_OPTIONS, /* 13 */ - CURLUE_NO_HOST, /* 14 */ - CURLUE_NO_PORT, /* 15 */ - CURLUE_NO_QUERY, /* 16 */ - CURLUE_NO_FRAGMENT, /* 17 */ - CURLUE_NO_ZONEID, /* 18 */ - CURLUE_BAD_FILE_URL, /* 19 */ - CURLUE_BAD_FRAGMENT, /* 20 */ - CURLUE_BAD_HOSTNAME, /* 21 */ - CURLUE_BAD_IPV6, /* 22 */ - CURLUE_BAD_LOGIN, /* 23 */ - CURLUE_BAD_PASSWORD, /* 24 */ - CURLUE_BAD_PATH, /* 25 */ - CURLUE_BAD_QUERY, /* 26 */ - CURLUE_BAD_SCHEME, /* 27 */ - CURLUE_BAD_SLASHES, /* 28 */ - CURLUE_BAD_USER, /* 29 */ - CURLUE_LACKS_IDN, /* 30 */ - CURLUE_TOO_LARGE, /* 31 */ - CURLUE_LAST -} CURLUcode; - -typedef enum { - CURLUPART_URL, - CURLUPART_SCHEME, - CURLUPART_USER, - CURLUPART_PASSWORD, - CURLUPART_OPTIONS, - CURLUPART_HOST, - CURLUPART_PORT, - CURLUPART_PATH, - CURLUPART_QUERY, - CURLUPART_FRAGMENT, - CURLUPART_ZONEID /* added in 7.65.0 */ -} CURLUPart; - -#define CURLU_DEFAULT_PORT (1<<0) /* return default port number */ -#define CURLU_NO_DEFAULT_PORT (1<<1) /* act as if no port number was set, - if the port number matches the - default for the scheme */ -#define CURLU_DEFAULT_SCHEME (1<<2) /* return default scheme if - missing */ -#define CURLU_NON_SUPPORT_SCHEME (1<<3) /* allow non-supported scheme */ -#define CURLU_PATH_AS_IS (1<<4) /* leave dot sequences */ -#define CURLU_DISALLOW_USER (1<<5) /* no user+password allowed */ -#define CURLU_URLDECODE (1<<6) /* URL decode on get */ -#define CURLU_URLENCODE (1<<7) /* URL encode on set */ -#define CURLU_APPENDQUERY (1<<8) /* append a form style part */ -#define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */ -#define CURLU_NO_AUTHORITY (1<<10) /* Allow empty authority when the - scheme is unknown. */ -#define CURLU_ALLOW_SPACE (1<<11) /* Allow spaces in the URL */ -#define CURLU_PUNYCODE (1<<12) /* get the host name in punycode */ -#define CURLU_PUNY2IDN (1<<13) /* punycode => IDN conversion */ - -typedef struct Curl_URL CURLU; - -/* - * curl_url() creates a new CURLU handle and returns a pointer to it. - * Must be freed with curl_url_cleanup(). - */ -CURL_EXTERN CURLU *curl_url(void); - -/* - * curl_url_cleanup() frees the CURLU handle and related resources used for - * the URL parsing. It will not free strings previously returned with the URL - * API. - */ -CURL_EXTERN void curl_url_cleanup(CURLU *handle); - -/* - * curl_url_dup() duplicates a CURLU handle and returns a new copy. The new - * handle must also be freed with curl_url_cleanup(). - */ -CURL_EXTERN CURLU *curl_url_dup(const CURLU *in); - -/* - * curl_url_get() extracts a specific part of the URL from a CURLU - * handle. Returns error code. The returned pointer MUST be freed with - * curl_free() afterwards. - */ -CURL_EXTERN CURLUcode curl_url_get(const CURLU *handle, CURLUPart what, - char **part, unsigned int flags); - -/* - * curl_url_set() sets a specific part of the URL in a CURLU handle. Returns - * error code. The passed in string will be copied. Passing a NULL instead of - * a part string, clears that part. - */ -CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what, - const char *part, unsigned int flags); - -/* - * curl_url_strerror() turns a CURLUcode value into the equivalent human - * readable error string. This is useful for printing meaningful error - * messages. - */ -CURL_EXTERN const char *curl_url_strerror(CURLUcode); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif /* CURLINC_URLAPI_H */ diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/websockets.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/websockets.h deleted file mode 100644 index 6ef6a2bc92e..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/libcurl/websockets.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef CURLINC_WEBSOCKETS_H -#define CURLINC_WEBSOCKETS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -struct curl_ws_frame { - int age; /* zero */ - int flags; /* See the CURLWS_* defines */ - curl_off_t offset; /* the offset of this data into the frame */ - curl_off_t bytesleft; /* number of pending bytes left of the payload */ - size_t len; /* size of the current data chunk */ -}; - -/* flag bits */ -#define CURLWS_TEXT (1<<0) -#define CURLWS_BINARY (1<<1) -#define CURLWS_CONT (1<<2) -#define CURLWS_CLOSE (1<<3) -#define CURLWS_PING (1<<4) -#define CURLWS_OFFSET (1<<5) - -/* - * NAME curl_ws_recv() - * - * DESCRIPTION - * - * Receives data from the websocket connection. Use after successful - * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. - */ -CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen, - size_t *recv, - const struct curl_ws_frame **metap); - -/* flags for curl_ws_send() */ -#define CURLWS_PONG (1<<6) - -/* - * NAME curl_ws_send() - * - * DESCRIPTION - * - * Sends data over the websocket connection. Use after successful - * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. - */ -CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer, - size_t buflen, size_t *sent, - curl_off_t fragsize, - unsigned int flags); - -/* bits for the CURLOPT_WS_OPTIONS bitmask: */ -#define CURLWS_RAW_MODE (1<<0) - -CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(CURL *curl); - -#ifdef __cplusplus -} -#endif - -#endif /* CURLINC_WEBSOCKETS_H */ diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/sentry/sentry.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/sentry/sentry.h deleted file mode 100644 index e4449f0363a..00000000000 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/sentry/sentry.h +++ /dev/null @@ -1,2278 +0,0 @@ -/** - * sentry-native - * - * sentry-native is a C client to send events to native from - * C and C++ applications. It can work together with breakpad/crashpad - * but also send events on its own. - * - * NOTE on encodings: - * - * Sentry will assume an encoding of UTF-8 for all string data that is captured - * and being sent to sentry as an Event. - * All the functions that are dealing with *paths* will assume an OS-specific - * encoding, typically ANSI on Windows, UTF-8 macOS, and the locale encoding on - * Linux; and they provide wchar-compatible alternatives on Windows which are - * preferred. - */ - -#ifndef SENTRY_H_INCLUDED -#define SENTRY_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -/* SDK Version */ -#ifndef SENTRY_SDK_NAME -# ifdef __ANDROID__ -# define SENTRY_SDK_NAME "sentry.native.android" -# else -# define SENTRY_SDK_NAME "sentry.native" -# endif -#endif -#define SENTRY_SDK_VERSION "0.8.3" -#define SENTRY_SDK_USER_AGENT SENTRY_SDK_NAME "/" SENTRY_SDK_VERSION - -/* common platform detection */ -#ifdef _WIN32 -# define SENTRY_PLATFORM_WINDOWS -#elif defined(__APPLE__) -# include -# if defined(TARGET_OS_OSX) && TARGET_OS_OSX -# define SENTRY_PLATFORM_MACOS -# elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE -# define SENTRY_PLATFORM_IOS -# endif -# define SENTRY_PLATFORM_DARWIN -# define SENTRY_PLATFORM_UNIX -#elif defined(__ANDROID__) -# define SENTRY_PLATFORM_ANDROID -# define SENTRY_PLATFORM_LINUX -# define SENTRY_PLATFORM_UNIX -#elif defined(__linux) || defined(__linux__) -# define SENTRY_PLATFORM_LINUX -# define SENTRY_PLATFORM_UNIX -#elif defined(_AIX) -/* IBM i PASE is also counted as AIX */ -# define SENTRY_PLATFORM_AIX -# define SENTRY_PLATFORM_UNIX -#elif defined(__NX__) -# define SENTRY_PLATFORM_NX -#else -# error unsupported platform -#endif - -/* marks a function as part of the sentry API */ -#ifndef SENTRY_API -# ifdef _WIN32 -# if defined(SENTRY_BUILD_SHARED) /* build dll */ -# define SENTRY_API __declspec(dllexport) -# elif !defined(SENTRY_BUILD_STATIC) /* use dll */ -# define SENTRY_API __declspec(dllimport) -# else /* static library */ -# define SENTRY_API -# endif -# else -# if __GNUC__ >= 4 -# define SENTRY_API __attribute__((visibility("default"))) -# else -# define SENTRY_API -# endif -# endif -#endif - -/* marks a function as experimental api */ -#ifndef SENTRY_EXPERIMENTAL_API -# define SENTRY_EXPERIMENTAL_API SENTRY_API -#endif - -#include -#include -#include - -/* context type dependencies */ -#ifdef _WIN32 -# include -#else -# include -#endif - -/** - * The library internally uses the system malloc and free functions to manage - * memory. It does not use realloc. The reason for this is that on unix - * platforms we fall back to a simplistic page allocator once we have - * encountered a SIGSEGV or other terminating signal as malloc is no longer - * safe to use. Since we cannot portably reallocate allocations made on the - * pre-existing allocator we're instead not using realloc. - * - * Note also that after SIGSEGV sentry_free() becomes a noop. - */ - -/** - * Allocates memory with the underlying allocator. - */ -SENTRY_API void *sentry_malloc(size_t size); - -/** - * Releases memory allocated from the underlying allocator. - */ -SENTRY_API void sentry_free(void *ptr); - -/** - * Legacy function. Alias for `sentry_free`. - */ -#define sentry_string_free sentry_free - -/* -- Protocol Value API -- */ - -/** - * Type of a sentry value. - */ -typedef enum { - SENTRY_VALUE_TYPE_NULL, - SENTRY_VALUE_TYPE_BOOL, - SENTRY_VALUE_TYPE_INT32, - SENTRY_VALUE_TYPE_DOUBLE, - SENTRY_VALUE_TYPE_STRING, - SENTRY_VALUE_TYPE_LIST, - SENTRY_VALUE_TYPE_OBJECT, -} sentry_value_type_t; - -/** - * Represents a sentry protocol value. - * - * The members of this type should never be accessed. They are only here - * so that alignment for the type can be properly determined. - * - * Values must be released with `sentry_value_decref`. This lowers the - * internal refcount by one. If the refcount hits zero it's freed. Some - * values like primitives have no refcount (like null) so operations on - * those are no-ops. - * - * In addition values can be frozen. Some values like primitives are always - * frozen but lists and dicts are not and can be frozen on demand. This - * automatically happens for some shared values in the event payload like - * the module list. - */ -union sentry_value_u { - uint64_t _bits; - double _double; -}; -typedef union sentry_value_u sentry_value_t; - -/** - * Increments the reference count on the value. - */ -SENTRY_API void sentry_value_incref(sentry_value_t value); - -/** - * Decrements the reference count on the value. - */ -SENTRY_API void sentry_value_decref(sentry_value_t value); - -/** - * Returns the refcount of a value. - */ -SENTRY_API size_t sentry_value_refcount(sentry_value_t value); - -/** - * Freezes a value. - */ -SENTRY_API void sentry_value_freeze(sentry_value_t value); - -/** - * Checks if a value is frozen. - */ -SENTRY_API int sentry_value_is_frozen(sentry_value_t value); - -/** - * Creates a null value. - */ -SENTRY_API sentry_value_t sentry_value_new_null(void); - -/** - * Creates a new 32-bit signed integer value. - */ -SENTRY_API sentry_value_t sentry_value_new_int32(int32_t value); - -/** - * Creates a new double value. - */ -SENTRY_API sentry_value_t sentry_value_new_double(double value); - -/** - * Creates a new boolean value. - */ -SENTRY_API sentry_value_t sentry_value_new_bool(int value); - -/** - * Creates a new null terminated string. - */ -SENTRY_API sentry_value_t sentry_value_new_string(const char *value); -SENTRY_API sentry_value_t sentry_value_new_string_n( - const char *value, size_t value_len); - -/** - * Creates a new list value. - */ -SENTRY_API sentry_value_t sentry_value_new_list(void); - -/** - * Creates a new object. - */ -SENTRY_API sentry_value_t sentry_value_new_object(void); - -/** - * Returns the type of the value passed. - */ -SENTRY_API sentry_value_type_t sentry_value_get_type(sentry_value_t value); - -/** - * Sets a key to a value in the map. - * - * This moves the ownership of the value into the map. The caller does not - * have to call `sentry_value_decref` on it. - */ -SENTRY_API int sentry_value_set_by_key( - sentry_value_t value, const char *k, sentry_value_t v); - -SENTRY_API int sentry_value_set_by_key_n( - sentry_value_t value, const char *k, size_t k_len, sentry_value_t v); - -/** - * This removes a value from the map by key. - */ -SENTRY_API int sentry_value_remove_by_key(sentry_value_t value, const char *k); -SENTRY_API int sentry_value_remove_by_key_n( - sentry_value_t value, const char *k, size_t k_len); - -/** - * Appends a value to a list. - * - * This moves the ownership of the value into the list. The caller does not - * have to call `sentry_value_decref` on it. - */ -SENTRY_API int sentry_value_append(sentry_value_t value, sentry_value_t v); - -/** - * Inserts a value into the list at a certain position. - * - * This moves the ownership of the value into the list. The caller does not - * have to call `sentry_value_decref` on it. - * - * If the list is shorter than the given index it's automatically extended - * and filled with `null` values. - */ -SENTRY_API int sentry_value_set_by_index( - sentry_value_t value, size_t index, sentry_value_t v); - -/** - * This removes a value from the list by index. - */ -SENTRY_API int sentry_value_remove_by_index(sentry_value_t value, size_t index); - -/** - * Looks up a value in a map by key. If missing a null value is returned. - * The returned value is borrowed. - */ -SENTRY_API sentry_value_t sentry_value_get_by_key( - sentry_value_t value, const char *k); -SENTRY_API sentry_value_t sentry_value_get_by_key_n( - sentry_value_t value, const char *k, size_t k_len); - -/** - * Looks up a value in a map by key. If missing a null value is returned. - * The returned value is owned. - * - * If the caller no longer needs the value it must be released with - * `sentry_value_decref`. - */ -SENTRY_API sentry_value_t sentry_value_get_by_key_owned( - sentry_value_t value, const char *k); -SENTRY_API sentry_value_t sentry_value_get_by_key_owned_n( - sentry_value_t value, const char *k, size_t k_len); - -/** - * Looks up a value in a list by index. If missing a null value is returned. - * The returned value is borrowed. - */ -SENTRY_API sentry_value_t sentry_value_get_by_index( - sentry_value_t value, size_t index); - -/** - * Looks up a value in a list by index. If missing a null value is - * returned. The returned value is owned. - * - * If the caller no longer needs the value it must be released with - * `sentry_value_decref`. - */ -SENTRY_API sentry_value_t sentry_value_get_by_index_owned( - sentry_value_t value, size_t index); - -/** - * Returns the length of the given map or list. - * - * If an item is not a list or map the return value is 0. - */ -SENTRY_API size_t sentry_value_get_length(sentry_value_t value); - -/** - * Converts a value into a 32bit signed integer. - */ -SENTRY_API int32_t sentry_value_as_int32(sentry_value_t value); - -/** - * Converts a value into a double value. - */ -SENTRY_API double sentry_value_as_double(sentry_value_t value); - -/** - * Returns the value as c string. - */ -SENTRY_API const char *sentry_value_as_string(sentry_value_t value); - -/** - * Returns `true` if the value is boolean true. - */ -SENTRY_API int sentry_value_is_true(sentry_value_t value); - -/** - * Returns `true` if the value is null. - */ -SENTRY_API int sentry_value_is_null(sentry_value_t value); - -/** - * Serialize a sentry value to JSON. - * - * The string is freshly allocated and must be freed with - * `sentry_string_free`. - */ -SENTRY_API char *sentry_value_to_json(sentry_value_t value); - -/** - * Sentry levels for events and breadcrumbs. - */ -typedef enum sentry_level_e { - SENTRY_LEVEL_DEBUG = -1, - SENTRY_LEVEL_INFO = 0, - SENTRY_LEVEL_WARNING = 1, - SENTRY_LEVEL_ERROR = 2, - SENTRY_LEVEL_FATAL = 3, -} sentry_level_t; - -/** - * Creates a new empty Event value. - * - * See https://docs.sentry.io/platforms/native/enriching-events/ for how to - * further work with events, and https://develop.sentry.dev/sdk/event-payloads/ - * for a detailed overview of the possible properties of an Event. - */ -SENTRY_API sentry_value_t sentry_value_new_event(void); - -/** - * Creates a new Message Event value. - * - * See https://develop.sentry.dev/sdk/event-payloads/message/ - * - * `logger` can be NULL to omit the logger value. - */ -SENTRY_API sentry_value_t sentry_value_new_message_event( - sentry_level_t level, const char *logger, const char *text); -SENTRY_API sentry_value_t sentry_value_new_message_event_n(sentry_level_t level, - const char *logger, size_t logger_len, const char *text, size_t text_len); - -/** - * Creates a new Breadcrumb with a specific type and message. - * - * See https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/ - * - * Either parameter can be NULL in which case no such attributes is created. - */ -SENTRY_API sentry_value_t sentry_value_new_breadcrumb( - const char *type, const char *message); -SENTRY_API sentry_value_t sentry_value_new_breadcrumb_n( - const char *type, size_t type_len, const char *message, size_t message_len); - -/** - * Creates a new Exception value. - * - * This is intended for capturing language-level exception, such as from a - * try-catch block. `type` and `value` here refer to the exception class and - * a possible description. - * - * See https://develop.sentry.dev/sdk/event-payloads/exception/ - * - * The returned value needs to be attached to an event via - * `sentry_event_add_exception`. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_exception( - const char *type, const char *value); -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_exception_n( - const char *type, size_t type_len, const char *value, size_t value_len); - -/** - * Creates a new Thread value. - * - * See https://develop.sentry.dev/sdk/event-payloads/threads/ - * - * The returned value needs to be attached to an event via - * `sentry_event_add_thread`. - * - * `name` can be NULL. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_thread( - uint64_t id, const char *name); -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_thread_n( - uint64_t id, const char *name, size_t name_len); - -/** - * Creates a new Stack Trace conforming to the Stack Trace Interface. - * - * See https://develop.sentry.dev/sdk/event-payloads/stacktrace/ - * - * The returned object must be attached to either an exception or thread - * object. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` - * stack trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_stacktrace( - void **ips, size_t len); - -/** - * Sets the Stack Trace conforming to the Stack Trace Interface in a value. - * - * The value argument must be either an exception or thread object. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` stack - * trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API void sentry_value_set_stacktrace( - sentry_value_t value, void **ips, size_t len); - -/** - * Adds an Exception to an Event value. - * - * This takes ownership of the `exception`. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_add_exception( - sentry_value_t event, sentry_value_t exception); - -/** - * Adds a Thread to an Event value. - * - * This takes ownership of the `thread`. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_add_thread( - sentry_value_t event, sentry_value_t thread); - -/* -- Experimental APIs -- */ - -/** - * Serialize a sentry value to msgpack. - * - * The string is freshly allocated and must be freed with - * `sentry_string_free`. Since msgpack is not zero terminated - * the size is written to the `size_out` parameter. - */ -SENTRY_EXPERIMENTAL_API char *sentry_value_to_msgpack( - sentry_value_t value, size_t *size_out); - -/** - * Adds a stack trace to an event. - * - * The stack trace is added as part of a new thread object. - * This function is **deprecated** in favor of using - * `sentry_value_new_stacktrace` in combination with `sentry_value_new_thread` - * and `sentry_event_add_thread`. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` - * stack trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_value_add_stacktrace( - sentry_value_t event, void **ips, size_t len); - -/** - * This represents the OS dependent user context in the case of a crash, and can - * be used to manually capture a crash. - */ -typedef struct sentry_ucontext_s { -#ifdef _WIN32 - EXCEPTION_POINTERS exception_ptrs; -#else - int signum; - siginfo_t *siginfo; - ucontext_t *user_context; -#endif -} sentry_ucontext_t; - -/** - * Unwinds the stack from the given address. - * - * If the address is given in `addr` the stack is unwound form there. - * Otherwise (NULL is passed) the current instruction pointer is used as - * start address. - * Unwinding with a given `addr` is not supported on all platforms. - * - * The stack trace in the form of instruction-addresses, is written to the - * caller allocated `stacktrace_out`, with up to `max_len` frames being written. - * The actual number of unwound stackframes is returned. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack( - void *addr, void **stacktrace_out, size_t max_len); - -/** - * Unwinds the stack from the given context. - * - * The caller is responsible to construct an appropriate `sentry_ucontext_t`. - * Unwinding from a user context is not supported on all platforms. - * - * The stack trace in the form of instruction-addresses, is written to the - * caller allocated `stacktrace_out`, with up to `max_len` frames being written. - * The actual number of unwound stackframes is returned. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack_from_ucontext( - const sentry_ucontext_t *uctx, void **stacktrace_out, size_t max_len); - -/** - * A UUID - */ -typedef struct sentry_uuid_s { - char bytes[16]; -} sentry_uuid_t; - -/** - * Creates the nil uuid. - */ -SENTRY_API sentry_uuid_t sentry_uuid_nil(void); - -/** - * Creates a new uuid4. - */ -SENTRY_API sentry_uuid_t sentry_uuid_new_v4(void); - -/** - * Parses a uuid from a string. - */ -SENTRY_API sentry_uuid_t sentry_uuid_from_string(const char *str); -SENTRY_API sentry_uuid_t sentry_uuid_from_string_n( - const char *str, size_t str_len); - -/** - * Creates a uuid from bytes. - */ -SENTRY_API sentry_uuid_t sentry_uuid_from_bytes(const char bytes[16]); - -/** - * Checks if the uuid is nil. - */ -SENTRY_API int sentry_uuid_is_nil(const sentry_uuid_t *uuid); - -/** - * Returns the bytes of the uuid. - */ -SENTRY_API void sentry_uuid_as_bytes(const sentry_uuid_t *uuid, char bytes[16]); - -/** - * Formats the uuid into a string buffer. - */ -SENTRY_API void sentry_uuid_as_string(const sentry_uuid_t *uuid, char str[37]); - -/** - * A Sentry Envelope. - * - * The Envelope is an abstract type which represents a payload being sent to - * sentry. It can contain one or more items, typically an Event. - * See https://develop.sentry.dev/sdk/envelopes/ - */ -struct sentry_envelope_s; -typedef struct sentry_envelope_s sentry_envelope_t; - -/** - * Frees an envelope. - */ -SENTRY_API void sentry_envelope_free(sentry_envelope_t *envelope); - -/** - * Given an Envelope, returns the embedded Event if there is one. - * - * This returns a borrowed value to the Event in the Envelope. - */ -SENTRY_API sentry_value_t sentry_envelope_get_event( - const sentry_envelope_t *envelope); - -/** - * Given an Envelope, returns the embedded Transaction if there is one. - * - * This returns a borrowed value to the Transaction in the Envelope. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_envelope_get_transaction( - const sentry_envelope_t *envelope); - -/** - * Serializes the envelope. - * - * The return value needs to be freed with sentry_string_free(). - */ -SENTRY_API char *sentry_envelope_serialize( - const sentry_envelope_t *envelope, size_t *size_out); - -/** - * Serializes the envelope into a file. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_envelope_write_to_file( - const sentry_envelope_t *envelope, const char *path); -SENTRY_API int sentry_envelope_write_to_file_n( - const sentry_envelope_t *envelope, const char *path, size_t path_len); - -/** - * The Sentry Client Options. - * - * See https://docs.sentry.io/platforms/native/configuration/ - */ -struct sentry_options_s; -typedef struct sentry_options_s sentry_options_t; - -/** - * This represents an interface for user-defined transports. - * - * Transports are responsible for sending envelopes to sentry and are the last - * step in the event pipeline. - * - * Envelopes will be submitted to the transport in a _fire and forget_ fashion, - * and the transport must send those envelopes _in order_. - * - * A transport has the following hooks, all of which - * take the user provided `state` as last parameter. The transport state needs - * to be set with `sentry_transport_set_state` and typically holds handles and - * other information that can be reused across requests. - * - * * `send_func`: This function will take ownership of an envelope, and is - * responsible for freeing it via `sentry_envelope_free`. - * * `startup_func`: This hook will be called by sentry inside of `sentry_init` - * and instructs the transport to initialize itself. Failures will bubble up - * to `sentry_init`. - * * `flush_func`: Instructs the transport to flush its queue. - * This hook receives a millisecond-resolution `timeout` parameter and should - * return `0` if the transport queue is flushed within the timeout. - * * `shutdown_func`: Instructs the transport to flush its queue and shut down. - * This hook receives a millisecond-resolution `timeout` parameter and should - * return `0` if the transport is flushed and shut down successfully. - * In case of a non-zero return value, sentry will log an error, but continue - * with freeing the transport. - * * `free_func`: Frees the transports `state`. This hook might be called even - * though `shutdown_func` returned a failure code previously. - * - * The transport interface might be extended in the future with hooks to flush - * its internal queue without shutting down, and to dump its internal queue to - * disk in case of a hard crash. - */ -struct sentry_transport_s; -typedef struct sentry_transport_s sentry_transport_t; - -/** - * Creates a new transport with an initial `send_func`. - */ -SENTRY_API sentry_transport_t *sentry_transport_new( - void (*send_func)(sentry_envelope_t *envelope, void *state)); - -/** - * Sets the transport `state`. - * - * If the state is owned by the transport and needs to be freed, use - * `sentry_transport_set_free_func` to set an appropriate hook. - */ -SENTRY_API void sentry_transport_set_state( - sentry_transport_t *transport, void *state); - -/** - * Sets the transport hook to free the transport `state`. - */ -SENTRY_API void sentry_transport_set_free_func( - sentry_transport_t *transport, void (*free_func)(void *state)); - -/** - * Sets the transport startup hook. - * - * This hook is called from within `sentry_init` and will get a reference to the - * options which can be used to initialize a transports internal state. - * It should return `0` on success. A failure will bubble up to `sentry_init`. - */ -SENTRY_API void sentry_transport_set_startup_func(sentry_transport_t *transport, - int (*startup_func)(const sentry_options_t *options, void *state)); - -/** - * Sets the transport flush hook. - * - * This hook will receive a millisecond-resolution timeout. - * It should return `0` if all the pending envelopes are - * sent within the timeout, or `1` if the timeout is hit. - */ -SENTRY_API void sentry_transport_set_flush_func(sentry_transport_t *transport, - int (*flush_func)(uint64_t timeout, void *state)); - -/** - * Sets the transport shutdown hook. - * - * This hook will receive a millisecond-resolution timeout. - * It should return `0` on success in case all the pending envelopes have been - * sent within the timeout, or `1` if the timeout was hit. - */ -SENTRY_API void sentry_transport_set_shutdown_func( - sentry_transport_t *transport, - int (*shutdown_func)(uint64_t timeout, void *state)); - -/** - * Generic way to free a transport. - */ -SENTRY_API void sentry_transport_free(sentry_transport_t *transport); - -/** - * Create a new function transport. - * - * It is a convenience function which works with a borrowed `data`, and will - * automatically free the envelope, so the user provided function does not need - * to do that. - * - * This function is *deprecated* and will be removed in a future version. - * It is here for backwards compatibility. Users should migrate to the - * `sentry_transport_new` API. - */ -SENTRY_API sentry_transport_t *sentry_new_function_transport( - void (*func)(const sentry_envelope_t *envelope, void *data), void *data); - -/** - * This represents an interface for user-defined backends. - * - * Backends are responsible to handle crashes. They are maintained at runtime - * via various life-cycle hooks from the sentry-core. - * - * At this point none of those interfaces are exposed in the API including - * creation and destruction. The main use-case of the backend in the API at this - * point is to disable it via `sentry_options_set_backend` at runtime before it - * is initialized. - */ -struct sentry_backend_s; -typedef struct sentry_backend_s sentry_backend_t; - -/* -- Options APIs -- */ - -/** - * The state of user consent. - */ -typedef enum { - SENTRY_USER_CONSENT_UNKNOWN = -1, - SENTRY_USER_CONSENT_GIVEN = 1, - SENTRY_USER_CONSENT_REVOKED = 0, -} sentry_user_consent_t; - -/** - * The crash handler strategy. - */ -typedef enum { - SENTRY_HANDLER_STRATEGY_DEFAULT = 0, - SENTRY_HANDLER_STRATEGY_CHAIN_AT_START = 1, -} sentry_handler_strategy_t; - -/** - * Creates a new options struct. - * Can be freed with `sentry_options_free`. - */ -SENTRY_API sentry_options_t *sentry_options_new(void); - -/** - * Deallocates previously allocated sentry options. - */ -SENTRY_API void sentry_options_free(sentry_options_t *opts); - -/** - * Sets a transport. - */ -SENTRY_API void sentry_options_set_transport( - sentry_options_t *opts, sentry_transport_t *transport); - -/** - * Type of the `before_send` callback. - * - * The callback takes ownership of the `event`, and should usually return that - * same event. In case the event should be discarded, the callback needs to - * call `sentry_value_decref` on the provided event, and return a - * `sentry_value_new_null()` instead. - * - * If you have set an `on_crash` callback (independent of whether it discards or - * retains the event), `before_send` will no longer be invoked for crash-events, - * which allows you to better distinguish between crashes and all other events - * in client-side pre-processing. - * - * This function may be invoked inside of a signal handler and must be safe for - * that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. - * On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see - * the documentation on SEH (structured exception handling) for more information - * https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling - * - * Up to version 0.4.18 the `before_send` callback wasn't invoked in case the - * event sampling discarded an event. In the current implementation the - * `before_send` callback is invoked even if the event sampling discards the - * event, following the cross-SDK session filter order: - * - * https://develop.sentry.dev/sdk/sessions/#filter-order - * - * On Windows the crashpad backend can capture fast-fail crashes which by-pass - * SEH. Since the `before_send` is called by a local exception-handler, it will - * not be invoked when such a crash happened, even though a minidump will be - * sent. - */ -typedef sentry_value_t (*sentry_event_function_t)( - sentry_value_t event, void *hint, void *closure); - -/** - * Sets the `before_send` callback. - * - * See the `sentry_event_function_t` typedef above for more information. - */ -SENTRY_API void sentry_options_set_before_send( - sentry_options_t *opts, sentry_event_function_t func, void *data); - -/** - * Type of the `on_crash` callback. - * - * The `on_crash` callback replaces the `before_send` callback for crash events. - * The interface is analogous to `before_send` in that the callback takes - * ownership of the `event`, and should usually return that same event. In case - * the event should be discarded, the callback needs to call - * `sentry_value_decref` on the provided event, and return a - * `sentry_value_new_null()` instead. - * - * Only the `inproc` backend currently fills the passed-in event with crash - * meta-data. Since both `breakpad` and `crashpad` use minidumps to capture the - * crash state, the passed-in event is empty when using these backends. Changes - * to the event from inside the hooks will be passed along, but in the case of - * the minidump backends these changes might get overwritten during server-side - * ingestion and processing. This primarily affects the exception payloads which - * are auto-generated from the minidump content. See - * https://github.com/getsentry/sentry-native/issues/1147 for details. - * - * If you set this callback in the options, it prevents a concurrently enabled - * `before_send` callback from being invoked in the crash case. This allows for - * better differentiation between crashes and other events and gradual migration - * from existing `before_send` implementations: - * - * - if you have a `before_send` implementation and do not define an `on_crash` - * callback your application will receive both normal and crash events as - * before - * - if you have a `before_send` implementation but only want to handle normal - * events with it, then you can define an `on_crash` callback that returns - * the passed-in event and does nothing else - * - if you are not interested in normal events, but only want to act on - * crashes (within the limits mentioned below), then only define an - * `on_crash` callback with the option to filter (on all backends) or enrich - * (only inproc) the crash event - * - * This function may be invoked inside of a signal handler and must be safe for - * that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. - * On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see - * the documentation on SEH (structured exception handling) for more information - * https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling - * - * Platform-specific behavior: - * - * - does not work with crashpad on macOS. - * - for breakpad on Linux the `uctx` parameter is always NULL. - * - on Windows the crashpad backend can capture fast-fail crashes which - * by-pass SEH. Since `on_crash` is called by a local exception-handler, it will - * not be invoked when such a crash happened, even though a minidump will be - * sent. - */ -typedef sentry_value_t (*sentry_crash_function_t)( - const sentry_ucontext_t *uctx, sentry_value_t event, void *closure); - -/** - * Sets the `on_crash` callback. - * - * See the `sentry_crash_function_t` typedef above for more information. - */ -SENTRY_API void sentry_options_set_on_crash( - sentry_options_t *opts, sentry_crash_function_t func, void *data); - -/** - * Sets the DSN. - */ -SENTRY_API void sentry_options_set_dsn(sentry_options_t *opts, const char *dsn); -SENTRY_API void sentry_options_set_dsn_n( - sentry_options_t *opts, const char *dsn, size_t dsn_len); - -/** - * Gets the DSN. - */ -SENTRY_API const char *sentry_options_get_dsn(const sentry_options_t *opts); - -/** - * Sets the sample rate, which should be a double between `0.0` and `1.0`. - * Sentry will randomly discard any event that is captured using - * `sentry_capture_event` when a sample rate < 1 is set. - * - * The sampling happens at the end of the event processing according to the - * following order: - * - * https://develop.sentry.dev/sdk/sessions/#filter-order - * - * Only items 3. to 6. are currently applicable to sentry-native. This means - * each processing step is executed even if the sampling discards the event - * before sending it to the backend. This is particularly relevant to users of - * the `before_send` callback. - * - * The above is in contrast to versions up to 0.4.18 where the sampling happened - * at the beginning of the processing/filter sequence. - */ -SENTRY_API void sentry_options_set_sample_rate( - sentry_options_t *opts, double sample_rate); - -/** - * Gets the sample rate. - */ -SENTRY_API double sentry_options_get_sample_rate(const sentry_options_t *opts); - -/** - * Sets the release. - */ -SENTRY_API void sentry_options_set_release( - sentry_options_t *opts, const char *release); -SENTRY_API void sentry_options_set_release_n( - sentry_options_t *opts, const char *release, size_t release_len); - -/** - * Gets the release. - */ -SENTRY_API const char *sentry_options_get_release(const sentry_options_t *opts); - -/** - * Sets the environment. - */ -SENTRY_API void sentry_options_set_environment( - sentry_options_t *opts, const char *environment); -SENTRY_API void sentry_options_set_environment_n( - sentry_options_t *opts, const char *environment, size_t environment_len); - -/** - * Gets the environment. - */ -SENTRY_API const char *sentry_options_get_environment( - const sentry_options_t *opts); - -/** - * Sets the dist. - */ -SENTRY_API void sentry_options_set_dist( - sentry_options_t *opts, const char *dist); -SENTRY_API void sentry_options_set_dist_n( - sentry_options_t *opts, const char *dist, size_t dist_len); - -/** - * Gets the dist. - */ -SENTRY_API const char *sentry_options_get_dist(const sentry_options_t *opts); - -/** - * Configures the proxy. - * - * The given proxy has to include the full scheme, - * eg. `http://some.proxy/` or `socks5://some.proxy/`. - * - * Not every transport behaves the same way when configuring a proxy. - * On Windows if a transport can't connect to the proxy it will fall back on a - * connection without proxy. This is also true for the crashpad_handler - * transport on macOS for a socks proxy, but not for a http proxy. - * All transports that use libcurl (Linux and the Native SDK transport on macOS) - * will honor the proxy settings and not fall back. - */ -SENTRY_API void sentry_options_set_proxy( - sentry_options_t *opts, const char *proxy); -SENTRY_API void sentry_options_set_proxy_n( - sentry_options_t *opts, const char *proxy, size_t proxy_len); - -/** - * Returns the configured proxy. - */ -SENTRY_API const char *sentry_options_get_proxy(const sentry_options_t *opts); - -/** - * Configures the proxy. - * - * This is a **deprecated** alias for `sentry_options_set_proxy(_n)`. - * - * The given proxy has to include the full scheme, - * eg. `http://some.proxy/. - */ -SENTRY_API void sentry_options_set_http_proxy( - sentry_options_t *opts, const char *proxy); -SENTRY_API void sentry_options_set_http_proxy_n( - sentry_options_t *opts, const char *proxy, size_t proxy_len); - -/** - * Returns the configured proxy. - */ -SENTRY_API const char *sentry_options_get_http_proxy( - const sentry_options_t *opts); - -/** - * Configures the path to a file containing ssl certificates for - * verification. - */ -SENTRY_API void sentry_options_set_ca_certs( - sentry_options_t *opts, const char *path); -SENTRY_API void sentry_options_set_ca_certs_n( - sentry_options_t *opts, const char *path, size_t path_len); - -/** - * Returns the configured path for ca certificates. - */ -SENTRY_API const char *sentry_options_get_ca_certs( - const sentry_options_t *opts); - -/** - * Configures the name of the http transport thread. - */ -SENTRY_API void sentry_options_set_transport_thread_name( - sentry_options_t *opts, const char *name); -SENTRY_API void sentry_options_set_transport_thread_name_n( - sentry_options_t *opts, const char *name, size_t name_len); - -/** - * Returns the configured http transport thread name. - */ -SENTRY_API const char *sentry_options_get_transport_thread_name( - const sentry_options_t *opts); - -/* - * Configures the name of the sentry SDK. Returns 0 on success. - */ -SENTRY_API int sentry_options_set_sdk_name( - sentry_options_t *opts, const char *sdk_name); - -/* - * Configures the name of the sentry SDK. Returns 0 on success. - */ -SENTRY_API int sentry_options_set_sdk_name_n( - sentry_options_t *opts, const char *sdk_name, size_t sdk_name_len); - -/** - * Returns the configured sentry SDK name. Unless overwritten this defaults to - * SENTRY_SDK_NAME. - */ -SENTRY_API const char *sentry_options_get_sdk_name( - const sentry_options_t *opts); - -/** - * Returns the user agent. Unless overwritten this defaults to - * "SENTRY_SDK_NAME / SENTRY_SDK_VERSION". - */ -SENTRY_API const char *sentry_options_get_user_agent( - const sentry_options_t *opts); - -/** - * Enables or disables debug printing mode. To change the log level from the - * default DEBUG level, use `sentry_options_set_logger_level`. - */ -SENTRY_API void sentry_options_set_debug(sentry_options_t *opts, int debug); - -/** - * Returns the current value of the debug flag. - */ -SENTRY_API int sentry_options_get_debug(const sentry_options_t *opts); - -/** - * Sets the level of the logger. Has no effect if `debug` is not set to true. - */ -SENTRY_API void sentry_options_set_logger_level( - sentry_options_t *opts, sentry_level_t level); - -/** - * Sets the number of breadcrumbs being tracked and attached to events. - * - * Defaults to 100. - */ -SENTRY_API void sentry_options_set_max_breadcrumbs( - sentry_options_t *opts, size_t max_breadcrumbs); - -/** - * Gets the number of breadcrumbs being tracked and attached to events. - */ -SENTRY_API size_t sentry_options_get_max_breadcrumbs( - const sentry_options_t *opts); - -/** - * Type of the callback for logger function. - */ -typedef void (*sentry_logger_function_t)( - sentry_level_t level, const char *message, va_list args, void *userdata); - -/** - * Sets the sentry-native logger function. - * - * Used for logging debug events when the `debug` option is set to true. - * - * Note: Multiple threads may invoke your `func`. If you plan to mutate any data - * inside the `userdata` argument after initialization, you must ensure proper - * synchronization inside the logger function. - * - */ -SENTRY_API void sentry_options_set_logger( - sentry_options_t *opts, sentry_logger_function_t func, void *userdata); - -/** - * Enables or disables automatic session tracking. - * - * Automatic session tracking is enabled by default and is equivalent to calling - * `sentry_start_session` after startup. - * There can only be one running session, and the current session will always be - * closed implicitly by `sentry_close`, when starting a new session with - * `sentry_start_session`, or manually by calling `sentry_end_session`. - */ -SENTRY_API void sentry_options_set_auto_session_tracking( - sentry_options_t *opts, int val); - -/** - * Returns true if automatic session tracking is enabled. - */ -SENTRY_API int sentry_options_get_auto_session_tracking( - const sentry_options_t *opts); - -/** - * Enables or disables user consent requirements for uploads. - * - * This disables uploads until the user has given the consent to the SDK. - * Consent itself is given with `sentry_user_consent_give` and - * `sentry_user_consent_revoke`. - */ -SENTRY_API void sentry_options_set_require_user_consent( - sentry_options_t *opts, int val); - -/** - * Returns true if user consent is required. - */ -SENTRY_API int sentry_options_get_require_user_consent( - const sentry_options_t *opts); - -/** - * Enables or disables on-device symbolication of stack traces. - * - * This feature can have a performance impact, and is enabled by default on - * Android. It is usually only needed when it is not possible to provide debug - * information files for system libraries which are needed for serverside - * symbolication. - */ -SENTRY_API void sentry_options_set_symbolize_stacktraces( - sentry_options_t *opts, int val); - -/** - * Returns true if on-device symbolication of stack traces is enabled. - */ -SENTRY_API int sentry_options_get_symbolize_stacktraces( - const sentry_options_t *opts); - -/** - * Adds a new attachment to be sent along. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use `sentry_options_add_attachmentw` - * instead. - */ -SENTRY_API void sentry_options_add_attachment( - sentry_options_t *opts, const char *path); -SENTRY_API void sentry_options_add_attachment_n( - sentry_options_t *opts, const char *path, size_t path_len); - -/** - * Enables or disables attaching screenshots to fatal error events. Disabled by - * default. - * - * This feature is currently supported by all backends on Windows. Only the - * `crashpad` backend can capture screenshots of fast-fail crashes that bypass - * SEH (structured exception handling). - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_attach_screenshot( - sentry_options_t *opts, int val); - -/** - * Sets the path to the crashpad handler if the crashpad backend is used. - * - * The path defaults to the `crashpad_handler`/`crashpad_handler.exe` - * executable, depending on platform, which is expected to be present in the - * same directory as the app executable. - * - * It is recommended that library users set an explicit handler path, depending - * on the directory/executable structure of their app. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use `sentry_options_set_handler_pathw` - * instead. - */ -SENTRY_API void sentry_options_set_handler_path( - sentry_options_t *opts, const char *path); -SENTRY_API void sentry_options_set_handler_path_n( - sentry_options_t *opts, const char *path, size_t path_len); - -/** - * Sets the path to the Sentry Database Directory. - * - * Sentry will use this path to persist user consent, sessions, and other - * artifacts in case of a crash. This will also be used by the crashpad backend - * if it is configured. - * - * The directory is used for "cached" data, which needs to persist across - * application restarts to ensure proper flagging of release-health sessions, - * but might otherwise be safely purged regularly. - * - * It is roughly equivalent to the type of `AppData/Local` on Windows and - * `XDG_CACHE_HOME` on Linux, and equivalent runtime directories on other - * platforms. - * - * It is recommended that users set an explicit absolute path, depending - * on their apps runtime directory. The path will be created if it does not - * exist, and will be resolved to an absolute path inside of `sentry_init`. The - * directory should not be shared with other application data/configuration, as - * sentry-native will enumerate and possibly delete files in that directory. An - * example might be `$XDG_CACHE_HOME/your-app/sentry` - * - * If no explicit path it set, sentry-native will default to `.sentry-native` in - * the current working directory, with no specific platform-specific handling. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use - * `sentry_options_set_database_pathw` instead. - */ -SENTRY_API void sentry_options_set_database_path( - sentry_options_t *opts, const char *path); -SENTRY_API void sentry_options_set_database_path_n( - sentry_options_t *opts, const char *path, size_t path_len); - -#ifdef SENTRY_PLATFORM_WINDOWS -/** - * Wide char version of `sentry_options_add_attachment`. - */ -SENTRY_API void sentry_options_add_attachmentw( - sentry_options_t *opts, const wchar_t *path); -SENTRY_API void sentry_options_add_attachmentw_n( - sentry_options_t *opts, const wchar_t *path, size_t path_len); - -/** - * Wide char version of `sentry_options_set_handler_path`. - */ -SENTRY_API void sentry_options_set_handler_pathw( - sentry_options_t *opts, const wchar_t *path); -SENTRY_API void sentry_options_set_handler_pathw_n( - sentry_options_t *opts, const wchar_t *path, size_t path_len); - -/** - * Wide char version of `sentry_options_set_database_path`. - */ -SENTRY_API void sentry_options_set_database_pathw( - sentry_options_t *opts, const wchar_t *path); -SENTRY_API void sentry_options_set_database_pathw_n( - sentry_options_t *opts, const wchar_t *path, size_t path_len); -#endif - -/** - * Enables forwarding to the system crash reporter. Disabled by default. - * - * This setting only has an effect when using Crashpad on macOS. If enabled, - * Crashpad forwards crashes to the macOS system crash reporter. Depending - * on the crash, this may impact the crash time. Even if enabled, Crashpad - * may choose not to forward certain crashes. - */ -SENTRY_API void sentry_options_set_system_crash_reporter_enabled( - sentry_options_t *opts, int enabled); - -/** - * Enables a wait for the crash report upload to be finished before shutting - * down. This is disabled by default. - * - * This setting only has an effect when using the `crashpad` backend on Linux. - */ -SENTRY_API void sentry_options_set_crashpad_wait_for_upload( - sentry_options_t *opts, int wait_for_upload); - -/** - * Sets the maximum time (in milliseconds) to wait for the asynchronous - * tasks to end on shutdown, before attempting a forced termination. - */ -SENTRY_API void sentry_options_set_shutdown_timeout( - sentry_options_t *opts, uint64_t shutdown_timeout); - -/** - * Gets the maximum time (in milliseconds) to wait for the asynchronous tasks to - * end on shutdown, before attempting a forced termination. - */ -SENTRY_API uint64_t sentry_options_get_shutdown_timeout(sentry_options_t *opts); - -/** - * Sets a user-defined backend. - * - * Since creation and destruction of backends is not exposed in the API, this - * can only be used to set the backend to `NULL`, which disables the backend in - * the initialization. - */ -SENTRY_API void sentry_options_set_backend( - sentry_options_t *opts, sentry_backend_t *backend); - -/* -- Global APIs -- */ - -/** - * Initializes the Sentry SDK with the specified options. - * - * This takes ownership of the options. After the options have been set - * they cannot be modified any more. - * Depending on the configured transport and backend, this function might not be - * fully thread-safe. - * Returns 0 on success. - */ -SENTRY_API int sentry_init(sentry_options_t *options); - -/** - * Instructs the transport to flush its send queue. - * - * The `timeout` parameter is in milliseconds. - * - * Returns 0 on success, or a non-zero return value in case the timeout is hit. - * - * Note that this function will block the thread it was called from until the - * sentry background worker has finished its work or it timed out, whichever - * comes first. - */ -SENTRY_API int sentry_flush(uint64_t timeout); - -/** - * Shuts down the sentry client and forces transports to flush out. - * - * Returns 0 on success. - * - * Note that this does not uninstall any crash handler installed by our - * backends, which will still process crashes after `sentry_close()`, except - * when using `crashpad` on Linux or the `inproc` backend. - * - * Further note that this function will block the thread it was called from - * until the sentry background worker has finished its work or it timed out, - * whichever comes first. - */ -SENTRY_API int sentry_close(void); - -/** - * Shuts down the sentry client and forces transports to flush out. - * - * This is a **deprecated** alias for `sentry_close`. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_shutdown(void); - -/** - * This will lazily load and cache a list of all the loaded libraries. - * - * Returns a new reference to an immutable, frozen list. - * The reference must be released with `sentry_value_decref`. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_get_modules_list(void); - -/** - * Clears the internal module cache. - * - * For performance reasons, sentry will cache the list of loaded libraries when - * capturing events. This cache can get out-of-date when loading or unloading - * libraries at runtime. It is therefore recommended to call - * `sentry_clear_modulecache` when doing so, to make sure that the next call to - * `sentry_capture_event` will have an up-to-date module list. - */ -SENTRY_EXPERIMENTAL_API void sentry_clear_modulecache(void); - -/** - * Re-initializes the Sentry backend. - * - * This is needed if a third-party library overrides the previously installed - * signal handler. Calling this function can be potentially dangerous and should - * only be done when necessary. - * - * Returns 0 on success. - */ -SENTRY_EXPERIMENTAL_API int sentry_reinstall_backend(void); - -/** - * Gives user consent. - */ -SENTRY_API void sentry_user_consent_give(void); - -/** - * Revokes user consent. - */ -SENTRY_API void sentry_user_consent_revoke(void); - -/** - * Resets the user consent (back to unknown). - */ -SENTRY_API void sentry_user_consent_reset(void); - -/** - * Checks the current state of user consent. - */ -SENTRY_API sentry_user_consent_t sentry_user_consent_get(void); - -/** - * Sends a sentry event. - * - * If returns a nil UUID if the event being passed in is a transaction, and the - * transaction will not be sent nor consumed. `sentry_transaction_finish` should - * be used to send transactions. - */ -SENTRY_API sentry_uuid_t sentry_capture_event(sentry_value_t event); - -/** - * Allows capturing independently created minidumps. - * - * This generates a fatal error event, includes the scope and attachments. - * If a before-send hook doesn't drop the event, the minidump is attached - * and the event is sent. - * - * Returns a nil `UUID` if capturing the minidump failed and the event-id - * otherwise. Uploads can fail because capturing is asynchronous, so a non-nil - * `UUID` is not a delivery guarantee. However, if the minidump is successfully - * delivered, the ID is guaranteed to be the same as the event in the Sentry UI. - * - * Note: You don't need this function if you rely on Sentry to create the - * minidump. This is useful when you have a minidump captured through a - * different mechanism, and you want Sentry to ingest it. - */ -SENTRY_API sentry_uuid_t sentry_capture_minidump(const char *path); -SENTRY_API sentry_uuid_t sentry_capture_minidump_n( - const char *path, size_t path_len); - -/** - * Captures a system-native exception that you retrieve when you manually handle - * `POSIX` signals or `SEH` exceptions and want to keep using that handling - * instead of the top-level handlers in our backends. The exception is still - * processed as a sentry event inside the SDK, including applying scope metadata - * and invoking hooks. - * - * The passed in `sentry_ucontext_t` must be filled with the OS-specific - * exception data (as specified in the struct definition) that you retrieve - * from your handler. - * - * This is safe to be called from a crashing thread and may not return. - * - * Note: The `crashpad` client currently supports this only on Windows. `inproc` - * and `breakpad` supports it on all platforms (on macOS, the `uctx` - * argument is ignored when using the `breakpad` backend). - */ -SENTRY_EXPERIMENTAL_API void sentry_handle_exception( - const sentry_ucontext_t *uctx); - -/** - * Adds the breadcrumb to be sent in case of an event. - */ -SENTRY_API void sentry_add_breadcrumb(sentry_value_t breadcrumb); - -/** - * Sets the specified user. - */ -SENTRY_API void sentry_set_user(sentry_value_t user); - -/** - * Removes a user. - */ -SENTRY_API void sentry_remove_user(void); - -/** - * Sets a tag. - */ -SENTRY_API void sentry_set_tag(const char *key, const char *value); -SENTRY_API void sentry_set_tag_n( - const char *key, size_t key_len, const char *value, size_t value_len); - -/** - * Removes the tag with the specified key. - */ -SENTRY_API void sentry_remove_tag(const char *key); -SENTRY_API void sentry_remove_tag_n(const char *key, size_t key_len); - -/** - * Sets extra information. - */ -SENTRY_API void sentry_set_extra(const char *key, sentry_value_t value); -SENTRY_API void sentry_set_extra_n( - const char *key, size_t key_len, sentry_value_t value); - -/** - * Removes the extra with the specified key. - */ -SENTRY_API void sentry_remove_extra(const char *key); -SENTRY_API void sentry_remove_extra_n(const char *key, size_t key_len); - -/** - * Sets a context object. - */ -SENTRY_API void sentry_set_context(const char *key, sentry_value_t value); -SENTRY_API void sentry_set_context_n( - const char *key, size_t key_len, sentry_value_t value); - -/** - * Removes the context object with the specified key. - */ -SENTRY_API void sentry_remove_context(const char *key); -SENTRY_API void sentry_remove_context_n(const char *key, size_t key_len); - -/** - * Sets the event fingerprint. - * - * This accepts a variable number of arguments, and needs to be terminated by a - * trailing `NULL`. - */ -SENTRY_API void sentry_set_fingerprint(const char *fingerprint, ...); -SENTRY_API void sentry_set_fingerprint_n( - const char *fingerprint, size_t fingerprint_len, ...); - -/** - * Removes the fingerprint. - */ -SENTRY_API void sentry_remove_fingerprint(void); - -/** - * Set the trace. The primary use for this is to allow other SDKs to propagate - * their trace context to connect events on all layers - */ -SENTRY_API void sentry_set_trace( - const char *trace_id, const char *parent_span_id); -SENTRY_API void sentry_set_trace_n(const char *trace_id, size_t trace_id_len, - const char *parent_span_id, size_t parent_span_id_len); - -/** - * Sets the transaction. - */ -SENTRY_API void sentry_set_transaction(const char *transaction); -SENTRY_API void sentry_set_transaction_n( - const char *transaction, size_t transaction_len); - -/** - * Sets the event level. - */ -SENTRY_API void sentry_set_level(sentry_level_t level); - -/** - * Sets the maximum number of spans that can be attached to a - * transaction. - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_max_spans( - sentry_options_t *opts, size_t max_spans); - -/** - * Gets the maximum number of spans that can be attached to a - * transaction. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_options_get_max_spans( - sentry_options_t *opts); - -/** - * Sets the sample rate for transactions. Should be a double between - * `0.0` and `1.0`. Transactions will be randomly discarded during - * `sentry_transaction_finish` when the sample rate is < 1.0. - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_traces_sample_rate( - sentry_options_t *opts, double sample_rate); - -/** - * Returns the sample rate for transactions. - */ -SENTRY_EXPERIMENTAL_API double sentry_options_get_traces_sample_rate( - sentry_options_t *opts); - -/** - * A sentry Transaction Context. - * - * See Transaction Interface under - * https://develop.sentry.dev/sdk/performance/#new-span-and-transaction-classes - */ -struct sentry_transaction_context_s; -typedef struct sentry_transaction_context_s sentry_transaction_context_t; -typedef double (*sentry_traces_sampler_function)( - const sentry_transaction_context_t *transaction_ctx, - sentry_value_t custom_sampling_ctx, const int *parent_sampled); - -/** - * Sets the traces sampler callback. Should be a function that returns a double - * and takes in a sentry_transaction_context_t pointer, a sentry_value_t for - * a custom sampling context and an int pointer for the parent sampled flag. - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_traces_sampler( - sentry_options_t *opts, sentry_traces_sampler_function callback); - -#ifdef SENTRY_PLATFORM_LINUX - -/** - * Returns the currently set strategy for the handler. - * - * This option does only work for the `inproc` backend on `Linux` and `Android`. - * - * The main use-case is when the Native SDK is used in the context of the - * CLR/Mono runtimes which convert some POSIX signals into managed-code - * exceptions and discontinue the signal chain. - * - * If this happens and we invoke the previous handler at the end (i.e., after - * our handler processed the signal, which is the default strategy) we will end - * up sending a native crash in addition to the managed code exception (which - * will either generate another crash-event if uncaught or could be handled in - * the managed code and neither terminate the application nor create a crash - * event). To correctly process the signals of CLR/Mono applications, we must - * invoke the runtime handler at the start of our handler. - */ -SENTRY_EXPERIMENTAL_API sentry_handler_strategy_t -sentry_options_get_handler_strategy(const sentry_options_t *opts); - -/** - * Sets the handler strategy. - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_handler_strategy( - sentry_options_t *opts, sentry_handler_strategy_t handler_strategy); - -#endif // SENTRY_PLATFORM_LINUX - -/* -- Session APIs -- */ - -typedef enum { - SENTRY_SESSION_STATUS_OK, - SENTRY_SESSION_STATUS_CRASHED, - SENTRY_SESSION_STATUS_ABNORMAL, - SENTRY_SESSION_STATUS_EXITED, -} sentry_session_status_t; - -/** - * Starts a new session. - */ -SENTRY_API void sentry_start_session(void); - -/** - * Ends a session. - */ -SENTRY_API void sentry_end_session(void); - -/** - * Ends a session with an explicit `status` code. - */ -SENTRY_EXPERIMENTAL_API void sentry_end_session_with_status( - sentry_session_status_t status); - -/* -- Performance Monitoring/Tracing APIs -- */ - -/** - * A sentry Transaction. - * - * See https://develop.sentry.dev/sdk/event-payloads/transaction/ - */ -struct sentry_transaction_s; -typedef struct sentry_transaction_s sentry_transaction_t; - -/** - * A sentry Span. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ - */ -struct sentry_span_s; -typedef struct sentry_span_s sentry_span_t; - -/** - * Constructs a new Transaction Context. The returned value needs to be passed - * into `sentry_transaction_start` in order to be recorded and sent to sentry. - * - * See - * https://docs.sentry.io/platforms/native/enriching-events/transaction-name/ - * for an explanation of a Transaction's `name`, and - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around an `operation`'s value. - * - * Also see https://develop.sentry.dev/sdk/event-payloads/transaction/#anatomy - * for an explanation of `operation`, in addition to other properties and - * actions that can be performed on a Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Transaction Context - * if it needs to be mutated across threads. Methods operating on the - * Transaction Context will mention what kind of expectations they carry if they - * need to mutate or access the object in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_transaction_context_t * -sentry_transaction_context_new(const char *name, const char *operation); -SENTRY_EXPERIMENTAL_API sentry_transaction_context_t * -sentry_transaction_context_new_n(const char *name, size_t name_len, - const char *operation, size_t operation_len); - -/** - * Sets the `name` on a Transaction Context, which will be used in the - * Transaction constructed off of the context. - * - * The Transaction Context should not be mutated by other functions while - * setting a name on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_name( - sentry_transaction_context_t *tx_ctx, const char *name); -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_name_n( - sentry_transaction_context_t *tx_ctx, const char *name, size_t name_len); -/** - * Gets the `name` of a Transaction Context. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_transaction_context_get_name( - const sentry_transaction_context_t *tx_ctx); - -/** - * Sets the `operation` on a Transaction Context, which will be used in the - * Transaction constructed off of the context - * - * See https://develop.sentry.dev/sdk/performance/span-operations/ for - * conventions on `operation`s. - * - * The Transaction Context should not be mutated by other functions while - * setting an operation on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_operation( - sentry_transaction_context_t *tx_ctx, const char *operation); -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_operation_n( - sentry_transaction_context_t *tx_ctx, const char *operation, - size_t operation_len); -/** - * Gets the `operation` of a Transaction Context. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_transaction_context_get_operation( - const sentry_transaction_context_t *tx_ctx); - -/** - * Sets the `sampled` field on a Transaction Context, which will be used in the - * Transaction constructed off of the context. - * - * When passed any value above 0, the Transaction will bypass all sampling - * options and always be sent to sentry. If passed 0, this Transaction and its - * child spans will never be sent to sentry. - * - * The Transaction Context should not be mutated by other functions while - * setting `sampled` on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_sampled( - sentry_transaction_context_t *tx_ctx, int sampled); - -/** - * Removes the `sampled` field on a Transaction Context, which will be used in - * the Transaction constructed off of the context. - * - * The Transaction will use the sampling rate as defined in `sentry_options`. - * - * The Transaction Context should not be mutated by other functions while - * removing `sampled`. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_remove_sampled( - sentry_transaction_context_t *tx_ctx); - -/** - * Update the Transaction Context with the given HTTP header key/value pair. - * - * This is used to propagate distributed tracing metadata from upstream - * services. Therefore, the headers of incoming requests should be fed into this - * function so that sentry is able to continue a trace that was started by an - * upstream service. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_update_from_header( - sentry_transaction_context_t *tx_ctx, const char *key, const char *value); -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_update_from_header_n( - sentry_transaction_context_t *tx_ctx, const char *key, size_t key_len, - const char *value, size_t value_len); - -/** - * Starts a new Transaction based on the provided context, restored from an - * external integration (i.e. a span from a different SDK) or manually - * constructed by a user. - * - * The second parameter is a custom Sampling Context to be used with a Traces - * Sampler to allow you to make a more informed sampling decision. - * - * Returns a Transaction, which is expected to be manually managed by the - * caller. Manual management involves ensuring that `sentry_transaction_finish` - * is invoked for the Transaction, and that the caller manually starts and - * finishes any child Spans as needed on the Transaction. - * - * Not invoking `sentry_transaction_finish` with the returned Transaction means - * it will be discarded, and will not be sent to sentry. - * - * To ensure that any Events or Message Events are associated with this - * Transaction while it is active, invoke and pass in the Transaction returned - * by this function to `sentry_set_transaction_object`. Further documentation on - * this can be found in `sentry_set_transaction_object`'s docstring. - * - * Takes ownership of `transaction_context`. A Transaction Context cannot be - * modified or re-used after it is used to start a Transaction. - * - * Takes ownership of `custom_sampling_ctx`. A Sampling Context cannot be - * modified or re-used after it is used to start a Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Transaction if it - * needs to be mutated across threads. Methods operating on the Transaction will - * mention what kind of expectations they carry if they need to mutate or access - * the object in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_transaction_t *sentry_transaction_start( - sentry_transaction_context_t *tx_ctx, sentry_value_t custom_sampling_ctx); -/** - * Also starts a transaction like the regular `sentry_transaction_start` - * function, but has an additional timestamp parameter to let the user provide - * explicit timings. - * - * The timestamp should be provided in microseconds since the Unix epoch. - */ -SENTRY_EXPERIMENTAL_API sentry_transaction_t *sentry_transaction_start_ts( - sentry_transaction_context_t *tx_ctx, sentry_value_t custom_sampling_ctx, - uint64_t timestamp); - -/** - * Finishes and sends a Transaction to sentry. The event ID of the Transaction - * will be returned if this was successful; A nil UUID will be returned - * otherwise. - * - * Always takes ownership of `transaction`, regardless of whether the operation - * was successful or not. A Transaction cannot be modified or re-used after it - * is finished. - */ -SENTRY_EXPERIMENTAL_API sentry_uuid_t sentry_transaction_finish( - sentry_transaction_t *tx); -/** - * Also finishes a transaction like the regular `sentry_transaction_finish` - * function, but has an additional timestamp parameter to let the user provide - * explicit timings. - * - * The timestamp should be provided in microseconds since the Unix epoch. - */ -SENTRY_EXPERIMENTAL_API sentry_uuid_t sentry_transaction_finish_ts( - sentry_transaction_t *tx, uint64_t timestamp); - -/** - * Sets the Transaction so any Events sent while the Transaction - * is active will be associated with the Transaction. - * - * If the Transaction being passed in is unsampled, it will still be associated - * with any new Events. This will lead to some Events pointing to orphan or - * missing traces in sentry, see - * https://docs.sentry.io/product/sentry-basics/tracing/trace-view/#orphan-traces-and-broken-subtraces - * - * This increases the number of references pointing to the Transaction. Invoke - * `sentry_transaction_finish` to remove the Transaction set by this function as - * well as its reference by passing in the same Transaction as the one passed - * into this function. - */ -SENTRY_EXPERIMENTAL_API void sentry_set_transaction_object( - sentry_transaction_t *tx); - -/** - * Sets the Span so any Events sent while the Span - * is active will be associated with the Span. - * - * This increases the number of references pointing to the Span. Invoke - * `sentry_span_finish` to remove the Span set by this function as well - * as its reference by passing in the same Span as the one passed into - * this function. - */ -SENTRY_EXPERIMENTAL_API void sentry_set_span(sentry_span_t *span); - -/** - * Starts a new Span. - * - * The return value of `sentry_transaction_start` should be passed in as - * `parent`. This value can't be null, since we don't allow for orphan spans. - * - * Both `operation` and `description` can be null, but it is recommended to - * supply the former. See - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around operations. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for a description of - * the created Span's properties and expectations for `operation` and - * `description`. - * - * Returns a value that should be passed into `sentry_span_finish`. Not - * finishing the Span means it will be discarded, and will not be sent to - * sentry. `sentry_value_null` will be returned if the child Span could not be - * created. - * - * To ensure that any Events or Message Events are associated with this - * Span while it is active, invoke and pass in the Span returned - * by this function to `sentry_set_span`. Further documentation on this can be - * found in `sentry_set_span`'s docstring. - * - * This increases the number of references pointing to the Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Span if it needs - * to be mutated across threads. Methods operating on the Span will mention what - * kind of expectations they carry if they need to mutate or access the object - * in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_transaction_start_child( - sentry_transaction_t *parent, const char *operation, - const char *description); -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_transaction_start_child_n( - sentry_transaction_t *parent, const char *operation, size_t operation_len, - const char *description, size_t description_len); -/** - * Also starts a span like the regular `sentry_transaction_start_child_ts` - * functions, but has an additional timestamp parameter to let the user provide - * explicit timings. - * - * The timestamp should be provided in microseconds since the Unix epoch. - */ -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_transaction_start_child_ts( - sentry_transaction_t *parent, const char *operation, - const char *description, uint64_t timestamp); -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_transaction_start_child_ts_n( - sentry_transaction_t *parent, const char *operation, size_t operation_len, - const char *description, size_t description_len, uint64_t timestamp); - -/** - * Starts a new Span. - * - * The return value of either `sentry_transaction_start_child` or - * `sentry_span_start_child` should be passed in as `parent`. This value can't - * be null, since we don't allow for orphan spans. - * - * Both `operation` and `description` can be null, but it is recommended to - * supply the former. See - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around operations. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for a description of - * the created Span's properties and expectations for `operation` and - * `description`. - * - * Returns a value that should be passed into `sentry_span_finish`. Not - * finishing the Span means it will be discarded, and will not be sent to - * sentry. `sentry_value_null` will be returned if the child Span could not be - * created. - * - * To ensure that any Events or Message Events are associated with this - * Span while it is active, invoke and pass in the Span returned - * by this function to `sentry_set_span`. Further documentation on this can be - * found in `sentry_set_span`'s docstring. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Span if it needs - * to be mutated across threads. Methods operating on the Span will mention what - * kind of expectations they carry if they need to mutate or access the object - * in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_span_start_child( - sentry_span_t *parent, const char *operation, const char *description); -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_span_start_child_n( - sentry_span_t *parent, const char *operation, size_t operation_len, - const char *description, size_t description_len); -/** - * Also starts a span like the regular `sentry_span_start_child_ts` functions, - * but has an additional timestamp parameter to let the user provide explicit - * timings. - * - * The timestamp should be provided in microseconds since the Unix epoch. - */ -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_span_start_child_ts( - sentry_span_t *parent, const char *operation, const char *description, - uint64_t timestamp); -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_span_start_child_ts_n( - sentry_span_t *parent, const char *operation, size_t operation_len, - const char *description, size_t description_len, uint64_t timestamp); - -/** - * Finishes a Span. - * - * This takes ownership of `span`. A Span cannot be modified or re-used after it - * is finished. - * - * This will mutate the `span`'s containing Transaction, so the containing - * Transaction should also not be mutated by other functions when finishing a - * span. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_finish(sentry_span_t *span); -/** - * Also finishes a span like the regular `sentry_span_finish` function, but has - * an additional timestamp parameter to let the user provide explicit timings. - * - * The timestamp should be provided in microseconds since the Unix epoch. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_finish_ts( - sentry_span_t *span, uint64_t timestamp); - -/** - * Sets a tag on a Transaction to the given string value. - * - * Tags longer than 200 bytes will be truncated. - * - * The Transaction should not be mutated by other functions while a tag is being - * set on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_tag( - sentry_transaction_t *transaction, const char *tag, const char *value); -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_tag_n( - sentry_transaction_t *transaction, const char *tag, size_t tag_len, - const char *value, size_t value_len); - -/** - * Removes a tag from a Transaction. - * - * The Transaction should not be mutated by other functions while a tag is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_tag( - sentry_transaction_t *transaction, const char *tag); -SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_tag_n( - sentry_transaction_t *transaction, const char *tag, size_t tag_len); - -/** - * Sets the given key in a Transaction's "data" section to the given value. - * - * The Transaction should not be mutated by other functions while data is being - * set on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_data( - sentry_transaction_t *transaction, const char *key, sentry_value_t value); -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_data_n( - sentry_transaction_t *transaction, const char *key, size_t key_len, - sentry_value_t value); - -/** - * Removes a key from a Transaction's "data" section. - * - * The Transaction should not be mutated by other functions while data is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_data( - sentry_transaction_t *transaction, const char *key); -SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_data_n( - sentry_transaction_t *transaction, const char *key, size_t key_len); - -/** - * Sets a tag on a Span to the given string value. - * - * Tags longer than 200 bytes will be truncated. - * - * The Span should not be mutated by other functions while a tag is being set on - * it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_tag( - sentry_span_t *span, const char *tag, const char *value); -SENTRY_EXPERIMENTAL_API void sentry_span_set_tag_n(sentry_span_t *span, - const char *tag, size_t tag_len, const char *value, size_t value_len); - -/** - * Removes a tag from a Span. - * - * The Span should not be mutated by other functions while a tag is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_remove_tag( - sentry_span_t *span, const char *tag); -SENTRY_EXPERIMENTAL_API void sentry_span_remove_tag_n( - sentry_span_t *span, const char *tag, size_t tag_len); - -/** - * Sets the given key in a Span's "data" section to the given value. - * - * The Span should not be mutated by other functions while data is being set on - * it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_data( - sentry_span_t *span, const char *key, sentry_value_t value); -SENTRY_EXPERIMENTAL_API void sentry_span_set_data_n( - sentry_span_t *span, const char *key, size_t key_len, sentry_value_t value); - -/** - * Removes a key from a Span's "data" section. - * - * The Span should not be mutated by other functions while data is being removed - * from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_remove_data( - sentry_span_t *span, const char *key); -SENTRY_EXPERIMENTAL_API void sentry_span_remove_data_n( - sentry_span_t *span, const char *key, size_t key_len); - -/** - * Sets a Transaction's name. - * - * The Transaction should not be mutated by other functions while setting its - * name. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_name( - sentry_transaction_t *transaction, const char *name); -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_name_n( - sentry_transaction_t *transaction, const char *name, size_t name_len); - -/** - * Creates a new User Feedback with a specific name, email and comments. - * - * See https://develop.sentry.dev/sdk/envelopes/#user-feedback - * - * User Feedback has to be associated with a specific event that has been - * sent to Sentry earlier. - */ -SENTRY_API sentry_value_t sentry_value_new_user_feedback( - const sentry_uuid_t *uuid, const char *name, const char *email, - const char *comments); -SENTRY_API sentry_value_t sentry_value_new_user_feedback_n( - const sentry_uuid_t *uuid, const char *name, size_t name_len, - const char *email, size_t email_len, const char *comments, - size_t comments_len); - -/** - * Captures a manually created User Feedback and sends it to Sentry. - */ -SENTRY_API void sentry_capture_user_feedback(sentry_value_t user_feedback); - -/** - * The status of a Span or Transaction. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for documentation. - */ -typedef enum { - // The operation completed successfully. - // HTTP status 100..299 + successful redirects from the 3xx range. - SENTRY_SPAN_STATUS_OK, - // The operation was cancelled (typically by the user). - SENTRY_SPAN_STATUS_CANCELLED, - // Unknown. Any non-standard HTTP status code. - // "We do not know whether the transaction failed or succeeded." - SENTRY_SPAN_STATUS_UNKNOWN, - // Client specified an invalid argument. 4xx. - // Note that this differs from FailedPrecondition. InvalidArgument - // indicates arguments that are problematic regardless of the - // state of the system. - SENTRY_SPAN_STATUS_INVALID_ARGUMENT, - // Deadline expired before operation could complete. - // For operations that change the state of the system, this error may be - // returned even if the operation has been completed successfully. - // HTTP redirect loops and 504 Gateway Timeout. - SENTRY_SPAN_STATUS_DEADLINE_EXCEEDED, - // 404 Not Found. Some requested entity (file or directory) was not found. - SENTRY_SPAN_STATUS_NOT_FOUND, - // Already exists (409) - // Some entity that we attempted to create already exists. - SENTRY_SPAN_STATUS_ALREADY_EXISTS, - // 403 Forbidden - // The caller does not have permission to execute the specified operation. - SENTRY_SPAN_STATUS_PERMISSION_DENIED, - // 429 Too Many Requests - // Some resource has been exhausted, perhaps a per-user quota or perhaps - // the entire file system is out of space. - SENTRY_SPAN_STATUS_RESOURCE_EXHAUSTED, - // Operation was rejected because the system is not in a state required for - // the operation's execution. - SENTRY_SPAN_STATUS_FAILED_PRECONDITION, - // The operation was aborted, typically due to a concurrency issue. - SENTRY_SPAN_STATUS_ABORTED, - // Operation was attempted past the valid range. - SENTRY_SPAN_STATUS_OUT_OF_RANGE, - // 501 Not Implemented - // Operation is not implemented or not enabled. - SENTRY_SPAN_STATUS_UNIMPLEMENTED, - // Other/generic 5xx - SENTRY_SPAN_STATUS_INTERNAL_ERROR, - // 503 Service Unavailable - SENTRY_SPAN_STATUS_UNAVAILABLE, - // Unrecoverable data loss or corruption - SENTRY_SPAN_STATUS_DATA_LOSS, - // 401 Unauthorized (actually does mean unauthenticated according to RFC - // 7235) - // Prefer PermissionDenied if a user is logged in. - SENTRY_SPAN_STATUS_UNAUTHENTICATED, -} sentry_span_status_t; - -/** - * Sets a Span's status. - * - * The Span should not be mutated by other functions while setting its status. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_status( - sentry_span_t *span, sentry_span_status_t status); - -/** - * Sets a Transaction's status. - * - * The Transaction should not be mutated by other functions while setting its - * status. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_status( - sentry_transaction_t *tx, sentry_span_status_t status); - -/** - * Type of the `iter_headers` callback. - * - * The callback is being called with HTTP header key/value pairs. - * These headers can be attached to outgoing HTTP requests to propagate - * distributed tracing metadata to downstream services. - * - */ -typedef void (*sentry_iter_headers_function_t)( - const char *key, const char *value, void *userdata); - -/** - * Iterates the distributed tracing HTTP headers for the given span. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_iter_headers(sentry_span_t *span, - sentry_iter_headers_function_t callback, void *userdata); - -/** - * Iterates the distributed tracing HTTP headers for the given transaction. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_iter_headers( - sentry_transaction_t *tx, sentry_iter_headers_function_t callback, - void *userdata); - -/** - * Returns whether the application has crashed on the last run. - * - * Notes: - * * The underlying value is set by sentry_init() - it must be called first. - * * Call sentry_clear_crashed_last_run() to reset for the next app run. - * - * Possible return values: - * 1 = the last run was a crash - * 0 = no crash recognized - * -1 = sentry_init() hasn't been called yet - */ -SENTRY_EXPERIMENTAL_API int sentry_get_crashed_last_run(void); - -/** - * Clear the status of the "crashed-last-run". You should explicitly call - * this after sentry_init() if you're using sentry_get_crashed_last_run(). - * Otherwise, the same information is reported on any subsequent runs. - * - * Notes: - * * This doesn't change the value of sentry_get_crashed_last_run() yet. - * However, if sentry_init() is called again, the value will change. - * * This may only be called after sentry_init() and before sentry_close(). - * - * Returns 0 on success, 1 on error. - */ -SENTRY_EXPERIMENTAL_API int sentry_clear_crashed_last_run(void); - -/** - * Sentry SDK version. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_version(void); - -/** - * Sentry SDK name set during build time. - * Deprecated: Please use sentry_options_get_sdk_name instead. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_name(void); - -/** - * Sentry SDK User-Agent set during build time. - * Deprecated: Please use sentry_options_get_user_agent instead. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_user_agent(void); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/GeneralsMD/Code/GameEngine/Source/Common/StatsExporter.cpp b/GeneralsMD/Code/GameEngine/Source/Common/StatsExporter.cpp index 48631a04660..d7d21e8dafd 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/StatsExporter.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/StatsExporter.cpp @@ -33,6 +33,8 @@ #include "GameLogic/Module/BattlePlanUpdate.h" #include +// Keep zconf.h from redefining 'Byte' (BaseTypeCore.h) when using unprefixed zlib (vcpkg). +#define __MACTYPES__ #include #include "GameNetwork/GeneralsOnline/json.hpp" diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP/HTTPManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP/HTTPManager.cpp index 903dff27454..a420a04cda6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP/HTTPManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP/HTTPManager.cpp @@ -204,8 +204,6 @@ HTTPRequest* HTTPManager::PlatformCreateRequest(EHTTPVerb httpVerb, EIPProtocolV return pNewRequest; } -std::atomic HTTPManager::m_bCACertBad = false; - HTTPManager::~HTTPManager() { CHECK_MAIN_THREAD; diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP/HTTPRequest.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP/HTTPRequest.cpp index b7646874d53..9e41910c504 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP/HTTPRequest.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP/HTTPRequest.cpp @@ -150,10 +150,6 @@ bool HTTPRequest::InvokeDelayAction() void HTTPRequest::Threaded_SetComplete(CURLcode result) { - if (result == CURLE_SSL_CACERT_BADFILE || result == CURLE_PEER_FAILED_VERIFICATION) - { - HTTPManager::SetCACertStoreBad(); - } // store response code curl_easy_getinfo(m_pCURL, CURLINFO_RESPONSE_CODE, &m_responseCode); @@ -323,34 +319,10 @@ void HTTPRequest::PlatformStartRequest() curl_easy_setopt(m_pCURL, CURLOPT_VERBOSE, 1); #else - // TODO_NGMP: We should move to libcurl backed by SChannel so we don't need to do this - // Check if cacert.pem exists - - if (HTTPManager::IsCACertStoreBad()) - { - curl_easy_setopt(m_pCURL, CURLOPT_SSL_VERIFYPEER, 0); - curl_easy_setopt(m_pCURL, CURLOPT_SSL_VERIFYHOST, 0); - } - else - { - std::ifstream certFile("cacert.pem"); - if (certFile.good()) - { - certFile.close(); - curl_easy_setopt(m_pCURL, CURLOPT_CAINFO, "cacert.pem"); - - curl_easy_setopt(m_pCURL, CURLOPT_SSL_VERIFYPEER, 1L); - curl_easy_setopt(m_pCURL, CURLOPT_SSL_VERIFYHOST, 2L); - } - else - { - HTTPManager::SetCACertStoreBad(); - curl_easy_setopt(m_pCURL, CURLOPT_SSL_VERIFYPEER, 0); - curl_easy_setopt(m_pCURL, CURLOPT_SSL_VERIFYHOST, 0); - } - } - - + // Use the OS cert store (needed since we build curl against OpenSSL, not schannel). + curl_easy_setopt(m_pCURL, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA); + curl_easy_setopt(m_pCURL, CURLOPT_SSL_VERIFYPEER, 1L); + curl_easy_setopt(m_pCURL, CURLOPT_SSL_VERIFYHOST, 2L); #endif pHTTPManager->AddHandleToMulti(m_pCURL); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/NetworkMesh.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/NetworkMesh.cpp index 8275a1bda63..9c95ab8dac2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/NetworkMesh.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/NetworkMesh.cpp @@ -28,8 +28,6 @@ static std::mutex g_pendingDeletionMutex; static std::vector g_pendingConnSignalingDeletions; // Clean up pending ConnectionSignaling objects that were deferred during Release() -// Forward declaration needed since ConnectionSignaling is nested inside CSignalingClient -struct ISteamNetworkingConnectionSignaling; static void CleanupPendingConnSignalingDeletions() { @@ -660,10 +658,13 @@ NetworkMesh::NetworkMesh() } // TODO_STEAM: Dont hardcode, get everything from service - SteamNetworkingUtils()->SetGlobalConfigValueString(k_ESteamNetworkingConfig_P2P_STUN_ServerList, "stun:stun.playgenerals.online:53,stun:stun.playgenerals.online:3478,stun.l.google.com:19302,stun1.l.google.com:19302,stun2.l.google.com:19302,stun3.l.google.com:19302,stun4.l.google.com:19302"); + // Every entry must resolve to distinct addresses. stun1-4.l.google.com resolve to the same IPs as + // stun.l.google.com, and duplicate addresses make the native ICE client retry STUN servers forever. + SteamNetworkingUtils()->SetGlobalConfigValueString(k_ESteamNetworkingConfig_P2P_STUN_ServerList, "stun:stun.playgenerals.online:53,stun:stun.playgenerals.online:3478,stun:stun.l.google.com:19302"); // comma seperated setting lists - const char* turnList = "turn:turn.playgenerals.online:53?transport=udp,turn:turn.playgenerals.online:3478?transport=udp"; + // No "?transport=udp" suffix: the native ICE client passes everything after the host as the port. + const char* turnList = "turn:turn.playgenerals.online:53,turn:turn.playgenerals.online:3478"; m_strTurnUsername = pLobbyInterface->GetLobbyTurnUsername(); m_strTurnToken = pLobbyInterface->GetLobbyTurnToken(); @@ -693,6 +694,9 @@ NetworkMesh::NetworkMesh() SteamNetworkingUtils()->SetGlobalConfigValueInt32(k_ESteamNetworkingConfig_P2P_Transport_ICE_Enable, k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_All); } + // The vcpkg GNS build only has the native ICE client (no WebRTC), so select it explicitly. + SteamNetworkingUtils()->SetGlobalConfigValueInt32(k_ESteamNetworkingConfig_P2P_Transport_ICE_Implementation, 1); + m_hListenSock = k_HSteamListenSocket_Invalid; // create signalling service @@ -1442,10 +1446,15 @@ std::string PlayerConnection::GetConnectionType() if (m_hSteamConnection == k_HSteamNetConnection_Invalid) return "(disconnected)"; - char szBuf[2048] = { 0 }; - int ret = SteamNetworkingSockets()->GetDetailedConnectionStatus(m_hSteamConnection, szBuf, 2048); - NetworkLog(ELogVerbosity::LOG_DEBUG, "[STEAM] PlayerConnection::GetConnectionType returned %d", ret); - return std::string(szBuf); + SteamNetConnectionInfo_t info; + if (!SteamNetworkingSockets()->GetConnectionInfo(m_hSteamConnection, &info)) + { + NetworkLog(ELogVerbosity::LOG_DEBUG, "[STEAM] PlayerConnection::GetConnectionType failed to get connection info"); + return "(unknown)"; + } + + // IsDirect() relies on relayed connections reporting "Relayed". + return (info.m_nFlags & k_nSteamNetworkConnectionInfoFlags_Relayed) != 0 ? "Relayed" : "Direct"; } void PlayerConnection::UpdateState(EConnectionState newState, NetworkMesh* pOwningMesh) diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/OnlineServices_RoomsInterface.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/OnlineServices_RoomsInterface.cpp index d2564d9cd74..bd5064d2d6a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/OnlineServices_RoomsInterface.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/OnlineServices_RoomsInterface.cpp @@ -197,29 +197,10 @@ void WebSocket::Connect(const char* url, bool bIsReconnect, std::function/discord-rpc-LICENSE.txt" - COMMAND ${CMAKE_COMMAND} -E copy -t "$" - $ - COMMAND_EXPAND_LISTS ) + if(EXISTS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/sentry-native/crashpad_handler.exe") + # sentry's crashpad backend is an out-of-process watcher: it needs its + # own executable next to the game, at the default handler path sentry + # looks for (see sentry_options_set_handler_path in sentry.h). + add_custom_command(TARGET z_generals POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/sentry-native/crashpad_handler.exe" + "$/crashpad_handler.exe" + ) + endif() endif() # RC files optional for MinGW builds diff --git a/MakePatch.ps1 b/MakePatch.ps1 index 248da231b1f..f4bd734b1ff 100644 --- a/MakePatch.ps1 +++ b/MakePatch.ps1 @@ -1,5 +1,5 @@ $patchDirectoryPath = "Patch" -$buildDir = "build\win32\GeneralsMD\Release"; +$buildDir = "build\win32-vcpkg\GeneralsMD\Release"; $buildVer = 1; $crcFilesDir = "$patchDirectoryPath/private/genonlineserver/crcfiles" @@ -25,8 +25,7 @@ New-Item -ItemType Directory -Path "$updaterDir" New-Item -ItemType Directory -Path "$workingDir" # Copy runtime libraries and release exe to working dir -Copy-Item -Path "$buildDir\libcurl.dll" -Destination $workingDir -Copy-Item -Path "$buildDir\zlib1.dll" -Destination $workingDir +Copy-Item -Path "$buildDir\crashpad_handler.exe" -Destination $workingDir Copy-Item -Path "$buildDir\discord-rpc.dll" -Destination $workingDir Copy-Item -Path "$buildDir\discord-rpc-LICENSE.txt" -Destination $workingDir Copy-Item -Path "$buildDir\GeneralsOnlineZH.exe" -Destination $workingDir diff --git a/cmake/compilers.cmake b/cmake/compilers.cmake index d8944d209e9..c5c4d5118c2 100644 --- a/cmake/compilers.cmake +++ b/cmake/compilers.cmake @@ -24,16 +24,6 @@ else() set(IS_VS6_BUILD FALSE) endif() -if(NOT DEFINED RTS_BUILD_OPTION_OPTIMIZED) - option(RTS_BUILD_OPTION_OPTIMIZED "Enable aggressive MSVC Release optimizations." OFF) -endif() -if(NOT DEFINED RTS_BUILD_OPTION_PGO) - set(RTS_BUILD_OPTION_PGO "OFF" CACHE STRING "MSVC profile-guided optimization mode.") -endif() -if(NOT DEFINED RTS_PGO_FILE) - set(RTS_PGO_FILE "${CMAKE_BINARY_DIR}/genzh.pgd" CACHE FILEPATH "MSVC PGO database path.") -endif() - # Make release builds have debug information too. if(MSVC) # Create PDB for Release as long as debug info was generated during compile. @@ -42,7 +32,6 @@ if(MSVC) # /INCREMENTAL:NO prevents PDB size bloat in Debug configuration(s). add_link_options("/INCREMENTAL:NO") - else() # We go a bit wild here and assume any other compiler we are going to use supports -g for debug info. # Add debug symbols to Release builds for crash dump analysis, profiling, and post-mortem debugging. diff --git a/cmake/gamespy.cmake b/cmake/gamespy.cmake index d7f53c90443..4c498628781 100644 --- a/cmake/gamespy.cmake +++ b/cmake/gamespy.cmake @@ -7,26 +7,4 @@ FetchContent_Declare( GIT_TAG 07e3d15c500415abc281efb74322ab6d9c857eb8 ) -FetchContent_Populate(gamespy) - -# GameSpy exports these configuration buffers from the shared DLL. The -# upstream headers declare them as ordinary extern data, which makes MSVC -# generate direct references instead of importing them through the DLL. -foreach(_gamespy_header IN ITEMS - "${gamespy_SOURCE_DIR}/include/gamespy/gstats/gstats.h" - "${gamespy_SOURCE_DIR}/include/gamespy/gstats/gpersist.h") - file(READ "${_gamespy_header}" _gamespy_header_contents) - string(REPLACE - "extern char gcd_secret_key[256];" - "#if defined(_WIN32) && defined(GAMESPY_IMPORT_DATA)\n\textern __declspec(dllimport) char gcd_secret_key[256];\n#else\n\textern char gcd_secret_key[256];\n#endif" - _gamespy_header_contents - "${_gamespy_header_contents}") - string(REPLACE - "extern char gcd_gamename[256];" - "#if defined(_WIN32) && defined(GAMESPY_IMPORT_DATA)\n\textern __declspec(dllimport) char gcd_gamename[256];\n#else\n\textern char gcd_gamename[256];\n#endif" - _gamespy_header_contents - "${_gamespy_header_contents}") - file(WRITE "${_gamespy_header}" "${_gamespy_header_contents}") -endforeach() - -add_subdirectory("${gamespy_SOURCE_DIR}" "${gamespy_BINARY_DIR}") +FetchContent_MakeAvailable(gamespy) diff --git a/cmake/networking.cmake b/cmake/networking.cmake deleted file mode 100644 index 27695e48490..00000000000 --- a/cmake/networking.cmake +++ /dev/null @@ -1,65 +0,0 @@ -find_package(OpenSSL REQUIRED) -find_package(Protobuf CONFIG REQUIRED) - -set(SENTRY_BUILD_SHARED_LIBS OFF CACHE BOOL "Build Sentry as a static library" FORCE) -set(SENTRY_BUILD_TESTS OFF CACHE BOOL "Do not build Sentry tests" FORCE) -set(SENTRY_BUILD_EXAMPLES OFF CACHE BOOL "Do not build Sentry examples" FORCE) -set(SENTRY_ENABLE_INSTALL OFF CACHE BOOL "Do not install Sentry" FORCE) -set(SENTRY_TRANSPORT winhttp CACHE STRING "Use WinHTTP for Sentry transport" FORCE) -set(SENTRY_BACKEND inproc CACHE STRING "Use in-process Sentry crash capture" FORCE) - -FetchContent_Declare( - sentry_native - GIT_REPOSITORY https://github.com/getsentry/sentry-native.git - GIT_TAG 0.9.0 -) -FetchContent_MakeAvailable(sentry_native) - -set(CURL_USE_OPENSSL ON CACHE BOOL "Build libcurl with OpenSSL" FORCE) -set(CURL_DISABLE_WEBSOCKETS OFF CACHE BOOL "Enable libcurl WebSocket support" FORCE) -set(BUILD_CURL_EXE OFF CACHE BOOL "Do not build the curl command-line tool" FORCE) -set(BUILD_TESTING OFF CACHE BOOL "Do not build third-party tests" FORCE) -set(BUILD_SHARED_LIBS ON CACHE BOOL "Build libcurl as a shared library" FORCE) -set(BUILD_STATIC_LIBS OFF CACHE BOOL "Do not build a static libcurl" FORCE) - -FetchContent_Declare( - curl - GIT_REPOSITORY https://github.com/curl/curl.git - GIT_TAG curl-8_11_0 -) -FetchContent_MakeAvailable(curl) - -set(BUILD_STATIC_LIB OFF CACHE BOOL "Do not build the static GameNetworkingSockets library" FORCE) -set(BUILD_SHARED_LIB ON CACHE BOOL "Build the shared GameNetworkingSockets library" FORCE) -set(BUILD_EXAMPLES OFF CACHE BOOL "Do not build GameNetworkingSockets examples" FORCE) -set(BUILD_TESTS OFF CACHE BOOL "Do not build GameNetworkingSockets tests" FORCE) -set(BUILD_TOOLS OFF CACHE BOOL "Do not build GameNetworkingSockets tools" FORCE) -set(ENABLE_ICE ON CACHE BOOL "Enable GameNetworkingSockets NAT traversal" FORCE) -set(USE_STEAMWEBRTC ON CACHE BOOL "Enable GameNetworkingSockets WebRTC ICE support" FORCE) -set(USE_CRYPTO OpenSSL CACHE STRING "Use OpenSSL for GameNetworkingSockets crypto" FORCE) -set(Protobuf_USE_STATIC_LIBS OFF CACHE BOOL "Use shared protobuf when available" FORCE) - -FetchContent_Declare( - gamenetworkingsockets - GIT_REPOSITORY https://github.com/ValveSoftware/GameNetworkingSockets.git - GIT_TAG v1.6.0 - GIT_SUBMODULES_RECURSE TRUE -) -FetchContent_Populate(gamenetworkingsockets) - -# The WebRTC wrapper bundled with GNS predates vcpkg's protobuf package and -# otherwise adds its vendored Abseil targets a second time. -set(_gns_steamwebrtc_cmake - "${gamenetworkingsockets_SOURCE_DIR}/src/external/steamwebrtc/CMakeLists.txt") -file(READ "${_gns_steamwebrtc_cmake}" _gns_steamwebrtc_contents) -string(REPLACE - "set(absl_FOUND OFF)" - "find_package(absl CONFIG REQUIRED)" - _gns_steamwebrtc_contents - "${_gns_steamwebrtc_contents}") -file(WRITE "${_gns_steamwebrtc_cmake}" "${_gns_steamwebrtc_contents}") - -add_subdirectory( - "${gamenetworkingsockets_SOURCE_DIR}" - "${gamenetworkingsockets_BINARY_DIR}" -) diff --git a/ports/gamenetworkingsockets/portfile.cmake b/ports/gamenetworkingsockets/portfile.cmake new file mode 100644 index 00000000000..4060fe0c781 --- /dev/null +++ b/ports/gamenetworkingsockets/portfile.cmake @@ -0,0 +1,56 @@ +# Upstream port, pointed at our GNS fork until the ICE fixes are merged upstream. +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tintinhamans/GNS + REF "641dfe7252b85d5827789304e494b1d135f58824" # gameclient-20260925 + SHA512 c41c929ec667e4be0c3982a72c33eeef3888922a9449dde3adc00b5f4b471c3ce334b1bc0dea7277b012ae28705e02f828e119111dfb184afae0217bb13a3140 + HEAD_REF gameclient +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + ice ENABLE_ICE +) + +# Select static vs dynamic based on the triplet. +if("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "dynamic") + set(BUILD_SHARED_LIB ON) + set(BUILD_STATIC_LIB OFF) +else() + set(BUILD_SHARED_LIB OFF) + set(BUILD_STATIC_LIB ON) +endif() + +# Link the MSVC CRT statically when the CRT linkage is static. +# Not used on non-MSVC platforms; listed in MAYBE_UNUSED_VARIABLES accordingly. +if("${VCPKG_CRT_LINKAGE}" STREQUAL "static") + set(MSVC_CRT_STATIC ON) +else() + set(MSVC_CRT_STATIC OFF) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DUSE_CRYPTO=OpenSSL + -DBUILD_STATIC_LIB=${BUILD_STATIC_LIB} + -DBUILD_SHARED_LIB=${BUILD_SHARED_LIB} + -DMSVC_CRT_STATIC=${MSVC_CRT_STATIC} + -DBUILD_TESTS=OFF + -DBUILD_EXAMPLES=OFF + -DBUILD_TOOLS=OFF + ${FEATURE_OPTIONS} + MAYBE_UNUSED_VARIABLES + MSVC_CRT_STATIC +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/GameNetworkingSockets") +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_copy_pdbs() +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/gamenetworkingsockets/vcpkg.json b/ports/gamenetworkingsockets/vcpkg.json new file mode 100644 index 00000000000..5361f80798f --- /dev/null +++ b/ports/gamenetworkingsockets/vcpkg.json @@ -0,0 +1,28 @@ +{ + "name": "gamenetworkingsockets", + "version": "1.6.0", + "description": "GameNetworkingSockets is a basic transport layer for games.", + "homepage": "https://github.com/ValveSoftware/GameNetworkingSockets", + "license": "BSD-3-Clause", + "supports": "!uwp & !(arm64 & windows)", + "dependencies": [ + "openssl", + "protobuf", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "ice" + ], + "features": { + "ice": { + "description": "Build support for P2P connections using the native ICE client (STUN and TURN)." + } + } +} diff --git a/triplets/x86-windows-static-md.cmake b/triplets/x86-windows-static-md.cmake new file mode 100644 index 00000000000..92c47b8f18c --- /dev/null +++ b/triplets/x86-windows-static-md.cmake @@ -0,0 +1,20 @@ +# Static libraries with the dynamic CRT (/MD), matching CMAKE_MSVC_RUNTIME_LIBRARY. +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +# Match the engine's _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR: std::mutex built with the +# constexpr constructor (VS 2022 17.10+) crashes in mtx_do_lock on older msvcp140.dll. +set(VCPKG_C_FLAGS "/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR") +set(VCPKG_CXX_FLAGS "/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR") + +# Exclude compiler version from ABI hash so that weekly GitHub runner image +# updates don't invalidate the binary cache. Minor MSVC version bumps do not +# cause ABI incompatibilities for this project. +set(VCPKG_DISABLE_COMPILER_TRACKING ON) + +# The gamenetworkingsockets port does not forward static linkage to its +# protobuf lookup, so it would otherwise compile with PROTOBUF_USE_DLLS. +if(PORT STREQUAL "gamenetworkingsockets") + set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DProtobuf_USE_STATIC_LIBS=ON) +endif() diff --git a/vcpkg.json b/vcpkg.json index 663515edf03..cf35cbc253e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,11 +1,29 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", - "builtin-baseline": "b02e341c927f16d991edbd915d8ea43eac52096c", + "builtin-baseline": "b61d33065508ba0d5e393206abb3cb2366299699", + "vcpkg-configuration": { + "overlay-ports": [ "./ports" ] + }, "dependencies": [ "zlib", "ffmpeg", "stb", - "openssl", - "protobuf" + { + "name": "curl", + "default-features": false, + "features": [ "openssl", "websockets" ] + }, + { + "name": "gamenetworkingsockets", + "version>=": "1.6.0", + "default-features": false, + "features": [ "ice" ] + }, + { + "name": "sentry-native", + "version>=": "0.17.0", + "default-features": false, + "features": [ "backend", "transport" ] + } ] - } \ No newline at end of file + }