24#if defined(FTE_TARGET_WEB)
120#define MAX_UDP_PACKET 8192
154struct dtlspeercred_s;
179#define NET_StringToSockaddr(s,p,a,f,z) (NET_StringToSockaddr2(s,p,NA_INVALID,a,f,z,1)>0)
181#define NET_StringToAdr(s,p,a) NET_StringToAdr2(s,p,a,1,NULL)
229#define MAX_ADR_SIZE 64
284 qbyte message_buf[MAX_OVERALLMSGLEN];
289 qbyte reliable_buf[MAX_OVERALLMSGLEN];
292 int outgoing_size[MAX_LATENT];
293 double outgoing_time[MAX_LATENT];
298 char in_fragment_buf[MAX_OVERALLMSGLEN];
331#define HUFFCRC_QUAKE3 0x286f2e8d
348#define NETFLAG_LENGTH_MASK 0x0000ffff
349#define NETFLAG_DATA 0x00010000
350#define NETFLAG_ACK 0x00020000
351#define NETFLAG_NAK 0x00040000
352#define NETFLAG_EOM 0x00080000
353#define NETFLAG_UNRELIABLE 0x00100000
354#define NETFLAG_ZLIB 0x00200000
355#define NETFLAG_CTL 0x80000000
357#define NQ_NETCHAN_GAMENAME "QUAKE"
358#define NQ_NETCHAN_VERSION 3
359#define NQ_NETCHAN_VERSION_QEX 4
362#define CCREQ_CONNECT 0x01
363#define CCREQ_SERVER_INFO 0x02
364#define CCREQ_PLAYER_INFO 0x03
365#define CCREQ_RULE_INFO 0x04
366#define CCREQ_PROQUAKE_RCON 0x05
368#define CCREP_ACCEPT 0x81
369#define CCREP_REJECT 0x82
370#define CCREP_SERVER_INFO 0x83
371#define CCREP_PLAYER_INFO 0x84
372#define CCREP_RULE_INFO 0x85
375#define PROTOCOL_VERSION_NQ 15
376#define PROTOCOL_VERSION_H2 19
377#define PROTOCOL_VERSION_NEHD 250
378#define PROTOCOL_VERSION_FITZ 666
379#define PROTOCOL_VERSION_RMQ 999
380#define PROTOCOL_VERSION_DP5 3502
381#define PROTOCOL_VERSION_DP6 3503
382#define PROTOCOL_VERSION_DP7 3504
383#define PROTOCOL_VERSION_BJP1 10000
384#define PROTOCOL_VERSION_BJP2 10001
385#define PROTOCOL_VERSION_BJP3 10002
387#define MOD_PROQUAKE 1
390#define MOD_PROQUAKE_VERSION (10*3.3)
396#define RMQFL_SHORTANGLE (1 << 1)
397#define RMQFL_FLOATANGLE (1 << 2)
398#define RMQFL_24BITCOORD (1 << 3)
399#define RMQFL_FLOATCOORD (1 << 4)
400#define RMQFL_EDICTSCALE (1 << 5)
401#define RMQFL_ALPHASANITY (1 << 6)
402#define RMQFL_INT32COORD (1 << 7)
403#define RMQFL_MOREFLAGS (1 << 31)
cvar_t rate
Definition: cl_main.c:156
netadr_t adr[8]
Definition: cl_main.c:288
cvar_t msg
Definition: cl_main.c:159
int qport
Definition: cl_main.c:303
int defaultport
Definition: cl_main.c:320
unsigned char qbyte
Definition: common.h:127
char * text
Definition: decomp.c:375
s
Definition: execloop.h:53
unsigned int col
Definition: gl_ngraph.c:39
GLint GLuint mask
Definition: gl_vidcommon.c:76
static EGLSurface EGLSurface EGLContext ctx
Definition: gl_videgl.c:47
Atom prop
Definition: gl_vidlinuxglx.c:4691
GLsizei count
Definition: glquake.h:149
GLsizei const GLcharARB const GLint * length
Definition: glquake.h:149
GLuint GLcharARB * name
Definition: glquake.h:155
GLint size
Definition: glquake.h:157
GLenum format
Definition: glsupp.h:502
GLenum GLsizei len
Definition: glsupp.h:502
void * module
Definition: image.c:236
unsigned char bits
Definition: image_astc.h:123
char * NET_BaseAdrToString(char *s, int len, netadr_t *a)
Definition: net_wins.c:1054
neterr_t NET_SendPacket(struct ftenet_connections_s *col, int length, const void *data, netadr_t *to)
Definition: net_wins.c:8300
qboolean NET_StringToAdrMasked(const char *s, qboolean allowdns, netadr_t *a, netadr_t *amask)
Definition: net_wins.c:2111
void Net_Master_Init(void)
Definition: net_master.c:3927
void NET_AdrToStringResolve(netadr_t *adr, void(*resolved)(void *ctx, void *data, size_t a, size_t b), void *ctx, size_t a, size_t b)
Definition: net_wins.c:793
int NET_LocalAddressForRemote(struct ftenet_connections_s *collection, netadr_t *remote, netadr_t *local, int idx)
Definition: net_wins.c:8219
neterr_t
Definition: net.h:124
@ NETERR_MTU
Definition: net.h:128
@ NETERR_DISCONNECTED
Definition: net.h:127
@ NETERR_NOROUTE
Definition: net.h:126
@ NETERR_SENT
Definition: net.h:125
@ NETERR_CLOGGED
Definition: net.h:129
netadrtype_t
Definition: net.h:34
@ NA_IP
Definition: net.h:38
@ NA_INVALID
Definition: net.h:35
@ NA_IPX
Definition: net.h:40
@ NA_UNIX
Definition: net.h:42
@ NA_LOOPBACK
Definition: net.h:36
@ NA_IRC
Definition: net.h:45
@ NA_IPV6
Definition: net.h:39
@ NA_ICE
Definition: net.h:51
@ NA_WEBSOCKET
Definition: net.h:48
void ICE_Init(void)
Definition: net_ice.c:5740
certprops_e
Definition: net.h:195
@ QCERT_ISENCRYPTED
Definition: net.h:196
@ QCERT_LOCALCERTIFICATE
Definition: net.h:200
@ QCERT_PEERSUBJECT
Definition: net.h:197
@ QCERT_PEERCERTIFICATE
Definition: net.h:198
void SockadrToNetadr(struct sockaddr_qstorage *s, int sizeofsockaddr, netadr_t *a)
Definition: net_wins.c:359
qboolean NET_EnsureRoute(struct ftenet_connections_s *collection, char *routename, const struct dtlspeercred_s *peerinfo, netadr_t *adr, qboolean outgoing)
Definition: net_wins.c:8335
int NET_GetConnectionCertificate(struct ftenet_connections_s *col, netadr_t *a, enum certprops_e prop, char *out, size_t outsize)
Definition: net_wins.c:3368
qboolean NET_IsLoopBackAddress(netadr_t *adr)
Definition: net_wins.c:2485
qboolean NET_AddressSmellsFunny(netadr_t *a)
Definition: net_wins.c:710
void NET_Init(void)
Definition: net_wins.c:9168
void SVNET_RegisterCvars(void)
Definition: net_wins.c:9404
void NET_Shutdown(void)
Definition: net_wins.c:9537
char * NET_AdrToString(char *s, int len, netadr_t *a)
Definition: net_wins.c:801
qboolean NET_IsClientLegal(netadr_t *adr)
Definition: net_wins.c:2456
char * NET_AdrToStringMasked(char *s, int len, netadr_t *a, netadr_t *amask)
Definition: net_wins.c:2439
void Huff_DecryptPacket(sizebuf_t *msg, int offset)
Definition: huff.c:553
netproto_t
Definition: net.h:54
@ NP_DTLS
Definition: net.h:56
@ NP_STREAM
Definition: net.h:57
@ NP_RTC_TLS
Definition: net.h:63
@ NP_WSS
Definition: net.h:60
@ NP_NATPMP
Definition: net.h:61
@ NP_WS
Definition: net.h:59
@ NP_INVALID
Definition: net.h:65
@ NP_TLS
Definition: net.h:58
@ NP_DGRAM
Definition: net.h:55
@ NP_RTC_TCP
Definition: net.h:62
int net_drop
Definition: net_chan.c:85
cvar_t dtls_psk_hint
Definition: net_wins.c:185
qboolean Netchan_CanPacket(netchan_t *chan, int rate)
Definition: net_chan.c:402
netadr_t net_local_cl_ipadr
Definition: net_wins.c:72
cvar_t dtls_psk_key
Definition: net.h:210
qboolean Netchan_CanReliable(netchan_t *chan, int rate)
Definition: net_chan.c:442
enum nqnc_packettype_e NQNetChan_Process(netchan_t *chan)
Definition: net_chan.c:455
void Huff_CompressPacket(huffman_t *huff, sizebuf_t *msg, int offset)
Definition: huff.c:574
void NET_ReadPackets(struct ftenet_connections_s *collection)
Definition: net_wins.c:8152
qboolean NET_CompareBaseAdr(netadr_t *a, netadr_t *b)
Definition: net_wins.c:592
void VARGS Netchan_OutOfBandPrint(netsrc_t sock, netadr_t *adr, char *format,...) LIKEPRINTF(3)
Definition: net_chan.c:335
int UDP6_OpenSocket(int port)
Definition: net_wins.c:8765
void UDP_CloseSocket(int socket)
Definition: net_wins.c:8758
void ICE_Terminate(netadr_t *to)
Definition: net_ice.c:5061
nqnc_packettype_e
Definition: net.h:321
@ NQNC_UNRELIABLE
Definition: net.h:325
@ NQNC_IGNORED
Definition: net.h:322
@ NQNC_RELIABLE
Definition: net.h:324
@ NQNC_ACK
Definition: net.h:323
int Huff_PreferedCompressionCRC(void)
Definition: huff.c:534
int Huff_GetByte(qbyte *buffer, int *count)
Definition: huff.c:563
void NET_CloseServer(void)
Definition: net_wins.c:9451
void Huff_DecompressPacket(huffman_t *huff, sizebuf_t *msg, int offset)
Definition: huff.c:625
FTE_ALIGN(4) qbyte net_message_buffer[MAX_OVERALLMSGLEN]
Definition: net_wins.c:81
void NET_InitServer(void)
Definition: net_wins.c:9457
void NET_InitClient(qboolean loopbackonly)
Definition: net_wins.c:9282
qboolean NET_GetRates(struct ftenet_connections_s *collection, float *pi, float *po, float *bi, float *bo)
Definition: net_wins.c:8087
void Netchan_Block(netchan_t *chan, int bytes, int rate)
Definition: net_chan.c:423
void VARGS Netchan_OutOfBandTPrintf(netsrc_t sock, netadr_t *adr, int language, translation_t text,...)
Definition: net_chan.c:348
void Netchan_Init(void)
Definition: net_chan.c:273
void Huff_EncryptPacket(sizebuf_t *msg, int offset)
Definition: huff.c:558
int NetadrToSockadr(netadr_t *a, struct sockaddr_qstorage *s)
Definition: net_wins.c:299
qboolean NET_StringToAdr_NoDNS(const char *address, int port, netadr_t *out)
Definition: net_wins.c:2173
qboolean NET_CompareAdrMasked(netadr_t *a, netadr_t *b, netadr_t *mask)
Definition: net_wins.c:2238
void Netchan_OutOfBand(netsrc_t sock, netadr_t *adr, int length, const qbyte *data)
Definition: net_chan.c:306
void NET_PrintAddresses(struct ftenet_connections_s *collection)
Definition: net_wins.c:8503
void NET_Tick(void)
Definition: net_wins.c:9526
qboolean NET_PortToAdr(netadrtype_t adrfamily, netproto_t adrprot, const char *s, netadr_t *a)
Definition: net_wins.c:4001
qboolean NET_DTLS_Decode(struct ftenet_connections_s *col)
Definition: net_wins.c:3334
void NET_TerminateRoute(struct ftenet_connections_s *collection, netadr_t *adr)
Definition: net_wins.c:8383
qboolean NET_CompareAdr(netadr_t *a, netadr_t *b)
Definition: net_wins.c:461
char * NET_SockadrToString(char *s, int len, struct sockaddr_qstorage *a, size_t sizeofa)
Definition: net_wins.c:437
int ICE_GetPeerCertificate(netadr_t *to, enum certprops_e prop, char *out, size_t outsize)
Definition: net_ice.c:5044
qboolean Netchan_Process(netchan_t *chan)
Definition: net_chan.c:995
struct ftenet_generic_connection_s * net_from_connection
Definition: net_wins.c:74
qboolean NET_DTLS_Disconnect(struct ftenet_connections_s *col, netadr_t *to)
Definition: net_wins.c:3309
addressscope_e
Definition: net.h:160
@ ASCOPE_LINK
Definition: net.h:163
@ ASCOPE_HOST
Definition: net.h:162
@ ASCOPE_NET
Definition: net.h:165
@ ASCOPE_PROCESS
Definition: net.h:161
@ ASCOPE_LAN
Definition: net.h:164
struct huffman_s huffman_t
Definition: net.h:333
void NET_PrintConnectionsStatus(struct ftenet_connections_s *collection)
Definition: net_wins.c:8592
void Huff_EmitByte(int ch, qbyte *buffer, int *count)
Definition: huff.c:569
neterr_t ICE_SendPacket(size_t length, const void *data, netadr_t *to)
Definition: net_ice.c:5073
cvar_t tls_ignorecertificateerrors
qboolean NET_RegisterCrypto(void *module, struct ftecrypto_s *driver)
Definition: net_wins.c:269
qboolean NET_UpdateRates(struct ftenet_connections_s *collection, qboolean inbound, size_t size)
Definition: net_wins.c:8117
int UDP_OpenSocket(int port)
Definition: net_wins.c:8714
cvar_t dtls_psk_user
Definition: net.h:210
void Netchan_Setup(netsrc_t sock, netchan_t *chan, netadr_t *adr, int qport)
Definition: net_chan.c:372
size_t NET_StringToSockaddr2(const char *s, int defaultport, netadrtype_t afhint, struct sockaddr_qstorage *sadr, int *addrfamily, int *addrsize, size_t addrcount)
Definition: net_wins.c:1207
void NET_IntegerToMask(netadr_t *a, netadr_t *amask, int bits)
Definition: net_wins.c:1881
netadr_t net_from
Definition: net_wins.c:75
qboolean NET_WasSpecialPacket(struct ftenet_connections_s *col)
Definition: net_wins.c:9137
huffman_t * Huff_CompressionCRC(int crc)
Definition: huff.c:540
cvar_t net_mtu
Definition: net_chan.c:92
cvar_t hostname
Definition: sv_main.c:204
netsrc_t
Definition: net.h:68
@ NS_CLIENT
Definition: net.h:68
@ NS_SERVER
Definition: net.h:68
enum addressscope_e NET_ClassifyAddress(netadr_t *adr, const char **outdesc)
Definition: net_wins.c:8458
qboolean NET_DTLS_Create(struct ftenet_connections_s *col, netadr_t *to, const struct dtlscred_s *cred, qboolean outgoing)
size_t NET_StringToAdr2(const char *s, int defaultport, netadr_t *a, size_t addrcount, const char **pathstart)
Definition: net_wins.c:1573
qboolean NET_Sleep(float seconds, qboolean stdinissocket)
Definition: net_wins.c:8935
qboolean NET_IsEncrypted(netadr_t *adr)
Definition: net_wins.c:2216
qboolean NET_AddrIsReliable(netadr_t *adr)
Definition: net_wins.c:444
qboolean FTENET_AddToCollection(struct ftenet_connections_s *col, const char *name, const char *address, netadrtype_t addrtype, netproto_t addrprot)
Definition: net_wins.c:3446
int TCP_OpenStream(netadr_t *remoteaddr, const char *remotename)
Definition: net_wins.c:8627
int IPX_OpenSocket(int port)
Definition: net_wins.c:8836
unsigned int Net_PextMask(unsigned int protover, qboolean fornq)
Definition: net_chan.c:111
int Netchan_Transmit(netchan_t *chan, int length, qbyte *data, int rate)
Definition: net_chan.c:642
sizebuf_t net_message
Definition: net_wins.c:76
void NET_CloseClient(void)
Definition: net_wins.c:9277
cvar_t net_enable_dtls
Definition: net_wins.c:184
char ** data
Definition: p_script.c:63
int b
Definition: pr_lua.c:242
int idx
Definition: pr_lua.c:221
vec3_t offset
Definition: q2m_flash.c:28
static ALC_API ALCvoid * buffer
Definition: snd_al.c:259
static SpeexBits spx_int16_t * out
Definition: snd_dma.c:492
static char * bytes
Definition: snd_dma.c:479
int len
Definition: net.h:99
struct netadr_s::@181::@182 irc
char icename[16]
Definition: net.h:91
unsigned short port
Definition: net.h:75
qbyte ipx[10]
Definition: net.h:82
union netadr_s::@181 address
char host[32]
Definition: net.h:85
unsigned short connum
Definition: net.h:76
char path[108]
Definition: net.h:100
netproto_t prot
Definition: net.h:73
netadrtype_t type
Definition: net.h:72
char channel[12]
Definition: net.h:87
unsigned int scopeid
Definition: net.h:77
qbyte ip[4]
Definition: net.h:80
qbyte ip6[16]
Definition: net.h:81
char user[32]
Definition: net.h:86
struct netadr_s::@181::@183 un
char websocketurl[64]
Definition: net.h:94
qbyte nqunreliableonly
Definition: net.h:239
int incoming_reliable_sequence
Definition: net.h:275
int qportsize
Definition: net.h:263
netadr_t remote_address
Definition: net.h:260
int incoming_unreliable
Definition: net.h:270
int isnqprotocol
Definition: net.h:236
int reliable_length
Definition: net.h:287
int dupe
Definition: net.h:245
int bytesin
Definition: net.h:257
int in_fragment_length
Definition: net.h:297
qboolean nqreliable_allowed
Definition: net.h:237
qboolean pext_fragmentation
Definition: net.h:241
int reliable_sequence
Definition: net.h:279
int reliable_start
Definition: net.h:288
int in_fragment_start
Definition: net.h:299
double cleartime
Definition: net.h:266
int incoming_reliable_acknowledged
Definition: net.h:273
float nqreliable_resendtime
Definition: net.h:238
int qport
Definition: net.h:262
int last_reliable_sequence
Definition: net.h:280
float frame_latency
Definition: net.h:251
int outgoing_sequence
Definition: net.h:278
float frame_rate
Definition: net.h:252
struct huffman_s * compresstable
Definition: net.h:294
int incoming_acknowledged
Definition: net.h:272
int drop_count
Definition: net.h:254
int mtu
Definition: net.h:244
int bytesout
Definition: net.h:258
int outgoing_unreliable
Definition: net.h:277
sizebuf_t message
Definition: net.h:283
int good_count
Definition: net.h:255
int incoming_sequence
Definition: net.h:271
float last_received
Definition: net.h:247
qboolean fatal_error
Definition: net.h:233
qboolean pext_stunaware
Definition: net.h:242
netsrc_t sock
Definition: net.h:261
qint64_t sa_align
Definition: net.h:110
unsigned char dontusesa_pad[6]
Definition: net.h:109
unsigned char sa_pad2[112]
Definition: net.h:111
short dontusesa_family
Definition: net.h:108
netadr_t a
Definition: sv_master.c:141
static unsigned char * to
Definition: sv_sql.c:31
cvar_t language
Definition: translate.c:24
const char * translation_t
Definition: translate.h:3