zenilib
0.5.3.0
|
#include "SDL/SDL.h"
#include "SDL/SDL_endian.h"
#include "SDL/SDL_version.h"
#include "SDL/begin_code.h"
#include "SDL/close_code.h"
Go to the source code of this file.
Classes | |
struct | _SDLNet_GenericSocket |
struct | IPaddress |
struct | UDPpacket |
Macros | |
#define | INADDR_ANY 0x00000000 |
#define | INADDR_BROADCAST 0xFFFFFFFF |
#define | INADDR_LOOPBACK 0x7f000001 |
#define | INADDR_NONE 0xFFFFFFFF |
#define | SDL_DATA_ALIGNED 0 |
#define | SDL_NET_MAJOR_VERSION 2 |
#define | SDL_NET_MINOR_VERSION 0 |
#define | SDL_NET_PATCHLEVEL 0 |
#define | SDL_NET_VERSION(X) |
#define | SDLNET_MAX_UDPADDRESSES 4 |
#define | SDLNET_MAX_UDPCHANNELS 32 |
#define | SDLNet_Read16(areap) _SDLNet_Read16(areap) |
#define | SDLNet_Read32(areap) _SDLNet_Read32(areap) |
#define | SDLNet_SocketReady(sock) _SDLNet_SocketReady((SDLNet_GenericSocket)(sock)) |
#define | SDLNet_Write16(value, areap) _SDLNet_Write16(value, areap) |
#define | SDLNet_Write32(value, areap) _SDLNet_Write32(value, areap) |
Typedefs | |
typedef struct _SDLNet_GenericSocket * | SDLNet_GenericSocket |
typedef struct _SDLNet_SocketSet * | SDLNet_SocketSet |
typedef SDL_version | SDLNet_version |
typedef struct _TCPsocket * | TCPsocket |
typedef struct _UDPsocket * | UDPsocket |
#define INADDR_ANY 0x00000000 |
Definition at line 102 of file SDL_net.h.
Referenced by SDLNet_ResolveHost(), SDLNet_TCP_Open(), and SDLNet_UDP_Open().
#define INADDR_NONE 0xFFFFFFFF |
Definition at line 105 of file SDL_net.h.
Referenced by main(), SDLNet_ResolveHost(), and SDLNet_TCP_Open().
#define SDL_NET_VERSION | ( | X | ) |
Definition at line 66 of file SDL_net.h.
Referenced by SDLNet_Linked_Version().
#define SDLNET_MAX_UDPADDRESSES 4 |
Definition at line 180 of file SDL_net.h.
Referenced by SDLNet_UDP_Bind().
#define SDLNET_MAX_UDPCHANNELS 32 |
Definition at line 178 of file SDL_net.h.
Referenced by SDLNet_UDP_Bind(), SDLNet_UDP_RecvV(), SDLNet_UDP_Unbind(), and ValidChannel().
#define SDLNet_Read16 | ( | areap | ) | _SDLNet_Read16(areap) |
Definition at line 380 of file SDL_net.h.
Referenced by HandleServerData(), Zeni::iptoa(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=(), SDLNet_ResolveHost(), SDLNet_UDP_Open(), and Zeni::unserialize().
#define SDLNet_Read32 | ( | areap | ) | _SDLNet_Read32(areap) |
Definition at line 381 of file SDL_net.h.
Referenced by HandleServerData(), Zeni::iptoa(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=(), and Zeni::unserialize().
#define SDLNet_SocketReady | ( | sock | ) | _SDLNet_SocketReady((SDLNet_GenericSocket)(sock)) |
Definition at line 347 of file SDL_net.h.
Referenced by HandleNet(), and main().
#define SDLNet_Write16 | ( | value, | |
areap | |||
) | _SDLNet_Write16(value, areap) |
Definition at line 376 of file SDL_net.h.
Referenced by Zeni::serialize(), and Zeni::TCP_Listener::TCP_Listener().
#define SDLNet_Write32 | ( | value, | |
areap | |||
) | _SDLNet_Write32(value, areap) |
Definition at line 377 of file SDL_net.h.
Referenced by Zeni::serialize().
typedef struct _SDLNet_GenericSocket * SDLNet_GenericSocket |
typedef struct _SDLNet_SocketSet* SDLNet_SocketSet |
typedef SDL_version SDLNet_version |
|
static |
Definition at line 395 of file SDL_net.h.
References SDL_SwapBE16.
|
static |
Definition at line 400 of file SDL_net.h.
References SDL_SwapBE32.
|
static |
Definition at line 348 of file SDL_net.h.
References NULL, and _SDLNet_GenericSocket::ready.
|
static |
Definition at line 385 of file SDL_net.h.
References SDL_SwapBE16.
|
static |
Definition at line 390 of file SDL_net.h.
References SDL_SwapBE32.
DECLSPEC int SDLCALL SDLNet_AddSocket | ( | SDLNet_SocketSet | set, |
SDLNet_GenericSocket | sock | ||
) |
Definition at line 68 of file SDLnetselect.c.
References NULL, and SDLNet_SetError().
Referenced by SDLNet_TCP_AddSocket(), and SDLNet_UDP_AddSocket().
Definition at line 51 of file SDLnetUDP.c.
References UDPpacket::data, error, malloc, UDPpacket::maxlen, NULL, SDLNet_FreePacket(), and SDLNet_SetError().
Referenced by SDLNet_AllocPacketV().
Definition at line 98 of file SDLnetUDP.c.
References i, malloc, NULL, SDLNet_AllocPacket(), SDLNet_FreePacketV(), and SDLNet_SetError().
Referenced by main().
DECLSPEC SDLNet_SocketSet SDLCALL SDLNet_AllocSocketSet | ( | int | maxsockets | ) |
Definition at line 44 of file SDLnetselect.c.
References free, i, malloc, and NULL.
Referenced by main(), and Zeni::TCP_Socket::TCP_Socket().
DECLSPEC int SDLCALL SDLNet_CheckSockets | ( | SDLNet_SocketSet | set, |
Uint32 | timeout | ||
) |
Definition at line 110 of file SDLnetselect.c.
References i, NULL, SDLNet_GetLastError(), SDLNet_SetLastError(), and SOCKET.
Referenced by HandleNet(), main(), and Zeni::TCP_Socket::try_check_socket().
DECLSPEC int SDLCALL SDLNet_DelSocket | ( | SDLNet_SocketSet | set, |
SDLNet_GenericSocket | sock | ||
) |
Definition at line 81 of file SDLnetselect.c.
References i, NULL, and SDLNet_SetError().
Referenced by SDLNet_TCP_DelSocket(), and SDLNet_UDP_DelSocket().
Definition at line 85 of file SDLnetUDP.c.
References UDPpacket::data, and free.
Referenced by SDLNet_AllocPacket(), and SDLNet_FreePacketV().
Definition at line 121 of file SDLnetUDP.c.
References free, i, and SDLNet_FreePacket().
Referenced by cleanup(), and SDLNet_AllocPacketV().
DECLSPEC void SDLCALL SDLNet_FreeSocketSet | ( | SDLNet_SocketSet | set | ) |
Definition at line 156 of file SDLnetselect.c.
References free.
Referenced by cleanup(), Zeni::TCP_Socket::TCP_Socket(), and Zeni::TCP_Socket::~TCP_Socket().
Definition at line 76 of file SDLnet.c.
References errorbuf, and SDL_GetError().
Referenced by main(), and print_errors().
Definition at line 187 of file SDLnet.c.
References closesocket, DWORD(), free, IPaddress::host, INVALID_SOCKET, malloc, NULL, IPaddress::port, realloc, sock, and SOCKET.
Referenced by main().
Definition at line 86 of file SDLnet.c.
References int, SDLNet_SetError(), and SDLNet_started.
Referenced by main().
DECLSPEC const SDLNet_version* SDLCALL SDLNet_Linked_Version | ( | void | ) |
Definition at line 33 of file SDLnet.c.
References SDL_NET_VERSION.
Definition at line 110 of file SDLnet.c.
References int, SDLNet_started, and SOCKET_ERROR.
Referenced by cleanup().
Definition at line 73 of file SDLnetUDP.c.
References UDPpacket::data, free, malloc, UDPpacket::maxlen, and NULL.
Definition at line 138 of file SDLnet.c.
References IPaddress::host, INADDR_ANY, INADDR_NONE, memcpy, NULL, IPaddress::port, and SDLNet_Read16.
Referenced by main(), and Zeni::Net::resolve_host().
Definition at line 173 of file SDLnet.c.
References IPaddress::host, and NULL.
Referenced by main(), and Zeni::Net::reverse_lookup().
Definition at line 65 of file SDLnet.c.
References errorbuf, SDL_SetError(), and SDL_vsnprintf().
Referenced by SDLNet_AddSocket(), SDLNet_AllocPacket(), SDLNet_AllocPacketV(), SDLNet_DelSocket(), SDLNet_Init(), SDLNet_TCP_Accept(), SDLNet_TCP_Open(), SDLNet_TCP_Recv(), SDLNet_TCP_Send(), SDLNet_UDP_Bind(), SDLNet_UDP_Open(), SDLNet_UDP_SendV(), and ValidChannel().
Definition at line 166 of file SDLnetTCP.c.
References INVALID_SOCKET, malloc, NULL, SDLNet_SetError(), SDLNet_TCP_Close(), and sock.
Referenced by Zeni::TCP_Listener::accept(), and HandleServer().
|
static |
Definition at line 313 of file SDL_net.h.
References SDLNet_AddSocket().
Referenced by HandleServer(), main(), and Zeni::TCP_Socket::TCP_Socket().
Definition at line 289 of file SDLnetTCP.c.
References closesocket, free, INVALID_SOCKET, and NULL.
Referenced by cleanup(), HandleClient(), HandleServer(), main(), SDLNet_TCP_Accept(), SDLNet_TCP_Open(), Zeni::TCP_Socket::TCP_Socket(), Zeni::TCP_Listener::~TCP_Listener(), and Zeni::TCP_Socket::~TCP_Socket().
|
static |
Definition at line 325 of file SDL_net.h.
References SDLNet_DelSocket().
Referenced by HandleClient(), HandleServer(), and Zeni::TCP_Socket::~TCP_Socket().
Definition at line 223 of file SDLnetTCP.c.
References NULL.
Referenced by HandleServer(), and Zeni::TCP_Socket::peer_address().
Definition at line 46 of file SDLnetTCP.c.
References IPaddress::host, INADDR_ANY, INADDR_NONE, INVALID_SOCKET, malloc, memset, NULL, IPaddress::port, SDLNet_SetError(), SDLNet_TCP_Close(), sock, and SOCKET_ERROR.
Referenced by main(), Zeni::TCP_Listener::TCP_Listener(), and Zeni::TCP_Socket::TCP_Socket().
Definition at line 269 of file SDLnetTCP.c.
References SDLNet_GetLastError(), SDLNet_SetError(), and SDLNet_SetLastError().
Referenced by HandleClient(), HandleServer(), and Zeni::TCP_Socket::try_receive().
Definition at line 236 of file SDLnetTCP.c.
References SDLNet_GetLastError(), SDLNet_SetError(), and SDLNet_SetLastError().
Referenced by HandleClient(), HandleServer(), SendHello(), SendNew(), and Zeni::TCP_Socket::try_send().
|
static |
Definition at line 256 of file SDLnetUDP.c.
References NULL, SDLNET_MAX_UDPADDRESSES, SDLNET_MAX_UDPCHANNELS, SDLNet_SetError(), and ValidChannel().
Referenced by HandleServerData().
Definition at line 515 of file SDLnetUDP.c.
References closesocket, free, INVALID_SOCKET, and NULL.
Referenced by cleanup(), SDLNet_UDP_Open(), and Zeni::UDP_Socket::~UDP_Socket().
|
static |
Definition at line 329 of file SDL_net.h.
References SDLNet_DelSocket().
Definition at line 298 of file SDLnetUDP.c.
References NULL, and ValidChannel().
Referenced by Zeni::UDP_Socket::peer_address(), and SendHello().
Definition at line 139 of file SDLnetUDP.c.
References INADDR_ANY, INVALID_SOCKET, malloc, memset, NULL, SDLNet_Read16, SDLNet_SetError(), SDLNet_UDP_Close(), sock, and SOCKET_ERROR.
Referenced by main(), and Zeni::UDP_Socket::UDP_Socket().
Definition at line 504 of file SDLnetUDP.c.
References NULL, packets, and SDLNet_UDP_RecvV().
Referenced by Zeni::UDP_Socket::receive().
Definition at line 439 of file SDLnetUDP.c.
References UDPpacket::address, UDPpacket::channel, UDPpacket::data, IPaddress::host, i, j, UDPpacket::len, UDPpacket::maxlen, NULL, IPaddress::port, SDLNET_MAX_UDPCHANNELS, SocketReady(), and UDPpacket::status.
Referenced by HandleClient(), and SDLNet_UDP_Recv().
Definition at line 399 of file SDLnetUDP.c.
References UDPpacket::channel, and SDLNet_UDP_SendV().
Referenced by Zeni::UDP_Socket::send(), and SendBuf().
Definition at line 326 of file SDLnetUDP.c.
References UDPpacket::address, UDPpacket::channel, UDPpacket::data, IPaddress::host, i, j, UDPpacket::len, NULL, IPaddress::port, SDLNet_SetError(), and UDPpacket::status.
Referenced by SDLNet_UDP_Send().
Definition at line 220 of file SDLnetUDP.c.
References NULL.
Definition at line 287 of file SDLnetUDP.c.
References SDLNET_MAX_UDPCHANNELS.
Referenced by HandleServerData().