![]() |
DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
|
|
Go to the source code of this file.
Data Structures | |
struct | lhnetaddress_t |
struct | lhnetsocket_t |
Enumerations | |
enum | lhnetaddresstype_t { LHNETADDRESSTYPE_NONE , LHNETADDRESSTYPE_LOOP , LHNETADDRESSTYPE_INET4 , LHNETADDRESSTYPE_INET6 } |
Variables | |
lhnetsocket_t | lhnet_socketlist |
enum lhnetaddresstype_t |
lhnetaddress_t * LHNET_AddressFromSocket | ( | lhnetsocket_t * | sock | ) |
Definition at line 1026 of file lhnet.c.
References lhnetsocket_t::address, and NULL.
Referenced by NetConn_ChooseClientSocketForAddress(), NetConn_ChooseServerSocketForAddress(), NetConn_OpenClientPort(), NetConn_OpenServerPort(), NetConn_Read(), NetConn_ServerParsePacket(), and NetConn_Write().
void LHNET_CloseSocket | ( | lhnetsocket_t * | lhnetsocket | ) |
Definition at line 1012 of file lhnet.c.
References lhnetsocket_t::address, lhnetaddress_t::addresstype, closesocket, lhnetsocket_t::inetsocket, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, lhnetsocket_t::list, List_Delete(), and Z_Free.
Referenced by LHNET_Shutdown(), NetConn_CloseClientPorts(), and NetConn_CloseServerPorts().
Definition at line 739 of file lhnet.c.
References lhnet_default_dscp.
Referenced by NetConn_UpdateSockets().
Definition at line 725 of file lhnet.c.
References Con_Print(), lhnet_active, lhnet_packetlist, lhnet_socketlist, lhnetpacket_t::list, lhnetsocket_t::list, and List_Create().
Referenced by NetConn_Init().
lhnetsocket_t * LHNET_OpenSocket_Connectionless | ( | lhnetaddress_t * | address | ) |
Definition at line 832 of file lhnet.c.
References lhnetaddressnative_t::addr, lhnetsocket_t::address, lhnetaddress_t::addresstype, closesocket, Con_DPrintf(), CON_ERROR, Con_Print(), Con_Printf(), i, lhnetaddressnative_t::in, lhnetaddressnative_t::in6, lhnetsocket_t::inetsocket, ioctlsocket, lhnet_default_dscp, lhnet_socketlist, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, LHNETADDRESSTYPE_LOOP, LHNETPRIVATE_StrError(), lhnetsocket_t::list, List_Add_Tail(), List_For_Each_Entry, NULL, lhnetaddress_t::port, lhnetaddressnative_t::sock, SOCKETERRNO, SOCKLEN_T, Z_Free, and Z_Malloc.
Referenced by NetConn_OpenClientPort(), and NetConn_OpenServerPort().
int LHNET_Read | ( | lhnetsocket_t * | lhnetsocket, |
void * | content, | ||
int | maxcontentlength, | ||
lhnetaddress_t * | address ) |
Definition at line 1034 of file lhnet.c.
References lhnetaddressnative_t::addr, lhnetsocket_t::address, lhnetaddress_t::addresstype, lhnetaddressnative_t::addresstype, Con_DPrintf(), Con_Print(), lhnetpacket_t::data, lhnetpacket_t::destinationport, host, lhnetaddressnative_t::in, lhnetaddressnative_t::in6, lhnetsocket_t::inetsocket, lhnetpacket_t::length, lhnet_packetlist, LHNET_RECVFROM_FLAGS, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, LHNETADDRESSTYPE_LOOP, LHNETADDRESSTYPE_NONE, LHNETPRIVATE_StrError(), lhnetpacket_t::list, List_Delete(), List_For_Each_Entry_Safe, net_fakelag, NULL, lhnetaddress_t::port, lhnetaddressnative_t::port, host_static_t::realtime, lhnetpacket_t::sentdoubletime, lhnetaddressnative_t::sock, SOCKETERRNO, SOCKLEN_T, lhnetpacket_t::sourceport, time, lhnetpacket_t::timeout, cvar_t::value, value, and Z_Free.
Referenced by NetConn_Read().
Definition at line 751 of file lhnet.c.
References lhnet_active, LHNET_CloseSocket(), lhnet_packetlist, lhnet_socketlist, lhnetpacket_t::list, lhnetsocket_t::list, List_Delete(), List_For_Each_Entry_Safe, and Z_Free.
Referenced by NetConn_Shutdown().
int LHNET_Write | ( | lhnetsocket_t * | lhnetsocket, |
const void * | content, | ||
int | contentlength, | ||
const lhnetaddress_t * | address ) |
Definition at line 1135 of file lhnet.c.
References lhnetaddressnative_t::addr, lhnetsocket_t::address, lhnetaddress_t::addresstype, lhnetaddressnative_t::addresstype, Con_DPrintf(), lhnetpacket_t::data, lhnetpacket_t::destinationport, host, lhnetaddressnative_t::in, lhnetaddressnative_t::in6, lhnetsocket_t::inetsocket, lhnetpacket_t::length, lhnet_packetlist, LHNET_SENDTO_FLAGS, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, LHNETADDRESSTYPE_LOOP, LHNETPRIVATE_StrError(), lhnetpacket_t::list, List_Add_Tail(), NULL, lhnetaddress_t::port, lhnetaddressnative_t::port, host_static_t::realtime, lhnetpacket_t::sentdoubletime, SOCKETERRNO, lhnetpacket_t::sourceport, time, lhnetpacket_t::timeout, value, and Z_Malloc.
Referenced by NetConn_Write().
int LHNETADDRESS_Compare | ( | const lhnetaddress_t * | address1, |
const lhnetaddress_t * | address2 ) |
Definition at line 665 of file lhnet.c.
References lhnetaddressnative_t::addr, lhnetaddressnative_t::addresstype, lhnetaddressnative_t::in, lhnetaddressnative_t::in6, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, LHNETADDRESSTYPE_LOOP, and lhnetaddressnative_t::port.
Referenced by CL_Rcon_f(), Crypto_ClearHostKey(), Crypto_ClientParsePacket(), Crypto_RetrieveHostKey(), Crypto_ServerFindInstance(), Crypto_ServerParsePacket_Internal(), Crypto_StoreHostKey(), hmac_mdfour_challenge_matching(), NetConn_ClearFlood(), NetConn_ClientParsePacket(), NetConn_PreventFlood(), and NetConn_ServerParsePacket().
int LHNETADDRESS_FromPort | ( | lhnetaddress_t * | address, |
lhnetaddresstype_t | addresstype, | ||
int | port ) |
Definition at line 125 of file lhnet.c.
References lhnetaddressnative_t::addr, lhnetaddressnative_t::addresstype, lhnetaddressnative_t::in, lhnetaddressnative_t::in6, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, LHNETADDRESSTYPE_LOOP, and lhnetaddressnative_t::port.
Referenced by NetConn_OpenClientPort(), and NetConn_OpenServerPort().
int LHNETADDRESS_FromString | ( | lhnetaddress_t * | address, |
const char * | string, | ||
int | defaultport ) |
Definition at line 204 of file lhnet.c.
References a, lhnetaddressnative_t::addr, namecache_s::address, lhnetaddressnative_t::addresstype, Con_Printf(), namecache_s::expirationtime, host, i, lhnetaddressnative_t::in, lhnetaddressnative_t::in6, int(), LHNETADDRESS_Resolve(), LHNETADDRESS_ToString(), LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, LHNETADDRESSTYPE_LOOP, LHNETADDRESSTYPE_NONE, MAX_NAMECACHE, name, namecache_s::name, namecache, namecacheposition, NULL, lhnetaddressnative_t::port, host_static_t::realtime, string, and strlen().
Referenced by CL_EstablishConnection(), CL_Packet_f(), CL_PQRcon_f(), CL_Rcon_f(), Crypto_HostKey_Clear_f(), Log_DestBuffer_Flush_NoLock(), NetConn_Heartbeat(), NetConn_Init(), NetConn_OpenClientPort(), NetConn_OpenServerPort(), VM_M_crypto_getencryptlevel(), VM_M_crypto_getidfp(), VM_M_crypto_getidstatus(), VM_M_crypto_getkeyfp(), and VM_netaddress_resolve().
|
inlinestatic |
Definition at line 31 of file lhnet.h.
References lhnetaddress_t::addresstype, and LHNETADDRESSTYPE_NONE.
Referenced by Crypto_ServerParsePacket_Internal(), NetConn_ChooseClientSocketForAddress(), NetConn_ChooseServerSocketForAddress(), NetConn_ServerParsePacket(), RCon_Execute(), SV_Pause_f(), SV_SendClientDatagram(), and SV_Status_f().
const char * LHNETADDRESS_GetInterfaceName | ( | const lhnetaddress_t * | address, |
char * | ifname, | ||
size_t | ifnamelength ) |
Definition at line 608 of file lhnet.c.
References lhnetaddressnative_t::addr, lhnetaddressnative_t::addresstype, dpsnprintf(), lhnetaddressnative_t::in6, LHNETADDRESSTYPE_INET6, and NULL.
int LHNETADDRESS_GetPort | ( | const lhnetaddress_t * | address | ) |
Definition at line 635 of file lhnet.c.
References lhnetaddress_t::port.
Referenced by NetConn_ServerParsePacket().
int LHNETADDRESS_SetPort | ( | lhnetaddress_t * | address, |
int | port ) |
Definition at line 642 of file lhnet.c.
References lhnetaddressnative_t::addr, lhnetaddressnative_t::addresstype, lhnetaddressnative_t::in, lhnetaddressnative_t::in6, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, LHNETADDRESSTYPE_LOOP, and lhnetaddressnative_t::port.
Referenced by NetConn_ClearFlood(), NetConn_ClientParsePacket(), and NetConn_PreventFlood().
int LHNETADDRESS_ToString | ( | const lhnetaddress_t * | address, |
char * | string, | ||
int | stringbuffersize, | ||
int | includeport ) |
Returns the number of bytes written to *string excluding the \0 terminator.
Definition at line 540 of file lhnet.c.
References a, lhnetaddressnative_t::addr, lhnetaddressnative_t::addresstype, dpsnprintf(), lhnetaddressnative_t::in, lhnetaddressnative_t::in6, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, LHNETADDRESSTYPE_LOOP, and lhnetaddressnative_t::port.
Referenced by CL_Rcon_f(), Crypto_ClearHostKey(), Crypto_HostKeys_f(), Crypto_RetrieveHostKey(), Crypto_StoreHostKey(), LHNETADDRESS_FromString(), NetConn_ClientFrame(), NetConn_ClientParsePacket(), NetConn_Open(), NetConn_OpenClientPort(), NetConn_OpenServerPort(), NetConn_Read(), NetConn_ServerParsePacket(), NetConn_UpdateSockets(), NetConn_Write(), SV_SendServerinfo(), SVVM_init_edict(), and VM_netaddress_resolve().
|
extern |
Definition at line 717 of file lhnet.c.
Referenced by LHNET_Init(), LHNET_OpenSocket_Connectionless(), LHNET_Shutdown(), and Sys_Sleep().