godot/thirdparty/enet/godot.cpp

/**************************************************************************/
/*  godot.cpp                                                             */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

/**
 @file  godot.cpp
 @brief ENet Godot specific functions
*/

#include "core/io/dtls_server.h"
#include "core/io/ip.h"
#include "core/io/net_socket.h"
#include "core/io/packet_peer_dtls.h"
#include "core/io/udp_server.h"
#include "core/os/os.h"

// This must be last for windows to compile (tested with MinGW)
#include "enet/enet.h"

/// Abstract ENet interface for UDP/DTLS.
class ENetGodotSocket {};

class ENetDTLSClient;
class ENetDTLSServer;

/// NetSocket interface
class ENetUDP : public ENetGodotSocket {};

/// DTLS Client ENet interface
class ENetDTLSClient : public ENetGodotSocket {};

/// DTLSServer - ENet interface
class ENetDTLSServer : public ENetGodotSocket {};

static enet_uint32 timeBase =;

int enet_initialize(void) {}

void enet_deinitialize(void) {}

enet_uint32 enet_host_random_seed(void) {}

enet_uint32 enet_time_get(void) {}

void enet_time_set(enet_uint32 newTimeBase) {}

int enet_address_set_host(ENetAddress *address, const char *name) {}

void enet_address_set_ip(ENetAddress *address, const uint8_t *ip, size_t size) {}

int enet_address_get_host_ip(const ENetAddress *address, char *name, size_t nameLength) {}

int enet_address_get_host(const ENetAddress *address, char *name, size_t nameLength) {}

ENetSocket enet_socket_create(ENetSocketType type) {}

int enet_host_dtls_server_setup(ENetHost *host, void *p_options) {}

int enet_host_dtls_client_setup(ENetHost *host, const char *p_for_hostname, void *p_options) {}

void enet_host_refuse_new_connections(ENetHost *host, int p_refuse) {}

int enet_socket_bind(ENetSocket socket, const ENetAddress *address) {}

void enet_socket_destroy(ENetSocket socket) {}

int enet_socket_send(ENetSocket socket, const ENetAddress *address, const ENetBuffer *buffers, size_t bufferCount) {}

int enet_socket_receive(ENetSocket socket, ENetAddress *address, ENetBuffer *buffers, size_t bufferCount) {}

int enet_socket_get_address(ENetSocket socket, ENetAddress *address) {}

// Not implemented
int enet_socket_wait(ENetSocket socket, enet_uint32 *condition, enet_uint32 timeout) {}

int enet_socketset_select(ENetSocket maxSocket, ENetSocketSet *readSet, ENetSocketSet *writeSet, enet_uint32 timeout) {}

int enet_socket_listen(ENetSocket socket, int backlog) {}

int enet_socket_set_option(ENetSocket socket, ENetSocketOption option, int value) {}

int enet_socket_get_option(ENetSocket socket, ENetSocketOption option, int *value) {}

int enet_socket_connect(ENetSocket socket, const ENetAddress *address) {}

ENetSocket enet_socket_accept(ENetSocket socket, ENetAddress *address) {}

int enet_socket_shutdown(ENetSocket socket, ENetSocketShutdown how) {}