FTEQW
Documentation of the FTE engine source tree.
netinc.h
Go to the documentation of this file.
1#ifndef NETINC_INCLUDED
2#define NETINC_INCLUDED
3
4
5#ifndef HAVE_PACKET
6
7#ifndef _XBOX
8// struct sockaddr
9// {
10// short sa_family;
11// };
12
13 #define ntohs BigShort
14 #define htons BigShort
15 #define htonl BigLong
16 #define ntohl BigLong
17#endif
18/* struct sockaddr_in
19 {
20 short sin_family;
21 unsigned short sin_port;
22 in_addr sin_addr;
23 };*/
24 #define AF_UNSPEC 0
25// #define AF_INET 1
26
27 #define AF_WEBSOCK 342
28
30 {
32 char url[64];
33 };
34
35
36
37#elif defined(_WIN32)
38 #ifdef _XBOX
39 #include <xtl.h>
40 #include <WinSockX.h>
41 #else
42 #if defined(_MSC_VER) && defined(HAVE_LEGACY)
43 #define HAVE_IPX
44 #endif
45 #define WIN32_LEAN_AND_MEAN
46 #include <windows.h>
47 #include <winsock2.h>
48 #ifdef HAVE_IPX
49 #include "wsipx.h"
50 #endif
51 #include <ws2tcpip.h>
52 #endif
53 #include <errno.h>
54 #if !defined(IPPROTO_IPV6) && !defined(_XBOX)
55 /*for msvc6*/
56 #define IPPROTO_IPV6 41
57
58 #ifndef EAI_NONAME
59 #define EAI_NONAME 8
60 #endif
61
63 {
64 union
65 {
66 struct
67 {
68 u_long Zone : 28;
69 u_long Level : 4;
70 };
71 u_long Value;
72 };
73 };
74
75 #if !defined(in_addr6)
76 struct in6_addr
77 {
78 u_char s6_addr[16]; /* IPv6 address */
79 };
80 #define sockaddr_in6 sockaddr_in6_fixed /*earlier versions of msvc have a sockaddr_in6 which does _not_ match windows, so this *must* be redefined for any non-final msvc releases or it won't work at all*/
81 typedef struct sockaddr_in6
82 {
84 u_short sin6_port;
87 union
88 {
91 };
92 };
93 struct addrinfo
94 {
99 size_t ai_addrlen;
101 struct sockaddr * ai_addr;
103 };
104 #endif
105 #endif
106 #ifndef IPV6_V6ONLY
107 #define IPV6_V6ONLY 27
108 #endif
109
110 #define HAVE_IPV4
111 #ifdef IPPROTO_IPV6
112 #define HAVE_IPV6
113 #endif
114
115 #ifndef SOCK_CLOEXEC
116 #define SOCK_CLOEXEC 0
117 #endif
118#else
119 #include <sys/time.h>
120 #include <sys/types.h>
121 #include <sys/socket.h>
122 #include <netinet/in.h>
123 #include <netinet/tcp.h>
124 #include <netdb.h>
125 #include <sys/ioctl.h>
126 #include <sys/uio.h>
127 #include <arpa/inet.h>
128 #include <errno.h>
129
130 #include <unistd.h>
131
132 #ifdef sun
133 #include <sys/filio.h>
134 #endif
135 #ifdef UNIXSOCKETS
136 #include <sys/un.h>
137 #endif
138
139 #ifdef NeXT
140 #include <libc.h>
141 #endif
142
143 #ifdef __linux__
144 //requires linux 2.6.27 up (and equivelent libc)
145 //note that BSD does tend to support the api, but emulated.
146 //this works around the select FD limit, and supposedly has better performance.
147 #include <sys/epoll.h>
148 #ifdef EPOLL_CLOEXEC
149 #define HAVE_EPOLL
150 //#else too old, probably android...
151 #endif
152 #endif
153
154 #if defined(__MORPHOS__) && !defined(ixemul)
155 #define closesocket CloseSocket
156 #define ioctlsocket IoctlSocket
157 #else
158 #define closesocket close
159 #define ioctlsocket ioctl
160 #endif
161
162 #if defined(AF_INET)
163 #define HAVE_IPV4
164 #endif
165 #if defined(AF_INET6)
166 #define HAVE_IPV6
167 #endif
168
169// #if defined(AF_IPX) && defined(HAVE_LEGACY)
170// #include <netipx/ipx.h>
171// #define HAVE_IPX
172// #endif
173
174 #define SOCKET int
175
176 #ifndef SOCK_CLOEXEC
177 #define SOCK_CLOEXEC 0
178 #endif
179#endif
180
181#if defined(_WIN32)
182 #define neterrno() WSAGetLastError()
183 //this madness is because winsock defines its own errors instead of using system error codes.
184 //*AND* microsoft then went and defined names for all the unix ones too... with different values! oh the insanity of it all!
185 #define NET_EINTR WSAEINTR
186 #define NET_EWOULDBLOCK WSAEWOULDBLOCK
187 #define NET_EINPROGRESS WSAEINPROGRESS
188 #define NET_EMSGSIZE WSAEMSGSIZE
189 #define NET_ECONNRESET WSAECONNRESET
190 #define NET_ECONNABORTED WSAECONNABORTED
191 #define NET_ECONNREFUSED WSAECONNREFUSED
192 #define NET_ETIMEDOUT WSAETIMEDOUT
193 #define NET_ENOTCONN WSAENOTCONN
194 #define NET_EACCES WSAEACCES
195 #define NET_EADDRNOTAVAIL WSAEADDRNOTAVAIL
196 #define NET_ENETUNREACH WSAENETUNREACH
197 #define NET_EAFNOSUPPORT WSAEAFNOSUPPORT
198#elif defined(__MORPHOS__) && !defined(ixemul)
199 #define neterrno() Errno()
200#else
201 #define neterrno() errno
202#endif
203
204#ifndef NET_EWOULDBLOCK
205 //assume unix codes instead, so our prefix still works.
206 #define NET_EINTR EINTR
207 #define NET_EWOULDBLOCK EWOULDBLOCK
208 #define NET_EINPROGRESS EINPROGRESS
209 #define NET_EMSGSIZE EMSGSIZE
210 #define NET_ECONNRESET ECONNRESET
211 #define NET_ECONNABORTED ECONNABORTED
212 #define NET_ECONNREFUSED ECONNREFUSED
213 #define NET_ETIMEDOUT ETIMEDOUT
214 #define NET_ENOTCONN ENOTCONN
215 #define NET_EACCES EACCES
216 #define NET_EADDRNOTAVAIL EADDRNOTAVAIL
217 #define NET_ENETUNREACH ENETUNREACH
218 #define NET_EAFNOSUPPORT EAFNOSUPPORT
219#endif
220
221#ifndef INVALID_SOCKET
222 #define INVALID_SOCKET -1
223#endif
224#ifndef MSG_NOSIGNAL
225 #define MSG_NOSIGNAL 0 //available on linux, no idea about other unixes. don't bug out too much... (d)tls needs this to not get constant SIGPIPE errors
226#endif
227
228#ifndef INADDR_LOOPBACK
229 #define INADDR_LOOPBACK 0x7f000001
230#endif
231
232#if defined(FTE_TARGET_WEB)
233 #undef HAVE_IPV4
234 #undef HAVE_IPV6
235 #undef HAVE_IPX
236#endif
237
238#if 1//def SUPPORT_ICE
240{
241 char candidateid[64];
242 char addr[64]; //v4/v6/fqdn. fqdn should prefer ipv6
243 int port; //native endian...
244 int transport; //0=udp. other values not supported
245 int foundation; //to figure out...
246 int component; //1-based. allows rtp+rtcp in a single ICE... we only support one.
247 int priority; //some random value...
248 enum
249 {
251 ICE_SRFLX=1, //Server Reflexive (from stun, etc)
252 ICE_PRFLX=2, //Peer Reflexive
254 } type; //says what sort of proxy is used.
255 char reladdr[64]; //when proxied, this is our local info
257 int generation; //for ice restarts. starts at 0.
258 int network; //which network device this comes from.
259};
261{
262 ICEP_INVALID, //not allowed..
263 ICEP_QWSERVER, //we're server side
264 ICEP_QWCLIENT, //we're client side
265 ICEP_VOICE, //speex. requires client.
266 ICEP_VIDEO //err... REALLY?!?!?
269{
270 ICEM_RAW, //not actually interactive beyond a simple handshake.
271 ICEM_ICE, //rfc5245. meant to be able to holepunch, but not implemented properly yet.
272 ICEM_WEBRTC, //IP+UDP+((ICE/STUN/SDP)+(DTLS+SCTP))... no more layers? :o
273};
275{
279 ICE_CONNECTING, //exchanging pings.
280 ICE_CONNECTED //media is flowing, supposedly. sending keepalives.
282struct icestate_s;
283#define ICE_API_CURRENT "Internet Connectivity Establishment 0.0"
284typedef struct
285{
286 struct icestate_s *(QDECL *Create)(void *module, const char *conname, const char *peername, enum icemode_e mode, enum iceproto_e proto, qboolean initiator); //doesn't start pinging anything.
287 qboolean (QDECL *Set)(struct icestate_s *con, const char *prop, const char *value);
288 qboolean (QDECL *Get)(struct icestate_s *con, const char *prop, char *value, size_t valuesize);
289 struct icecandinfo_s *(QDECL *GetLCandidateInfo)(struct icestate_s *con); //retrieves candidates that need reporting to the peer.
290 void (QDECL *AddRCandidateInfo)(struct icestate_s *con, struct icecandinfo_s *cand); //stuff that came from the peer.
291 void (QDECL *Close)(struct icestate_s *con, qboolean force); //bye then.
292 void (QDECL *CloseModule)(void *module); //closes all unclosed connections, with warning.
293 qboolean (QDECL *GetLCandidateSDP)(struct icestate_s *con, char *out, size_t valuesize); //retrieves candidates that need reporting to the peer.
294 struct icestate_s *(QDECL *Find)(void *module, const char *conname);
295} icefuncs_t;
296extern icefuncs_t iceapi;
298#endif
299
300#ifdef HAVE_EPOLL
301typedef struct epollctx_s
302{
303 void (*Polled) (struct epollctx_s *ctx, unsigned int events);
305#endif
306
307//address flags
308#define ADDR_NATPMP (1u<<0)
309#define ADDR_UPNPIGP (1u<<1)
310#define ADDR_REFLEX (1u<<2) //as reported by some external server.
311
312#define FTENET_ADDRTYPES 2
314 char name[MAX_QPATH];
315
316 int (*GetLocalAddresses)(struct ftenet_generic_connection_s *con, unsigned int *adrflags, netadr_t *addresses, const char **adrparams, int maxaddresses);
317 qboolean (*ChangeLocalAddress)(struct ftenet_generic_connection_s *con, const char *addressstring, netadr_t *newadr);
321#if defined(HAVE_PACKET) && !defined(HAVE_EPOLL)
322 int (*SetFDSets) (struct ftenet_generic_connection_s *con, fd_set *readfdset, fd_set *writefdset); /*set for connections which have multiple sockets (ie: listening tcp connections)*/
323#endif
325
326 netproto_t prot; //if there's some special weirdness
327 netadrtype_t addrtype[FTENET_ADDRTYPES]; //which address families it accepts
329
332
333#ifdef HAVE_EPOLL
335#endif
336
337#ifdef HAVE_PACKET
338 SOCKET thesocket;
339#else
341#endif
343
345{
346 VH_UNSUPPORTED, //library not loaded (bad but not malicious)
347 VH_AUTHORITY_UNKNOWN, //don't know who signed it / untrusted (bad but probably not malicious)
348 VH_INCORRECT, //signature is wrong for that authority (bad, probably maliciously so)
349 VH_CORRECT //all is well.
351struct dtlsfuncs_s;
352typedef struct dtlscred_s
353{
355 {
356 void *cert;
357 size_t certsize;
358 void *key;
359 size_t keysize;
362 {
363 const char *name; //cert must match this if specified
364
365 hashfunc_t *hash; //if set peer's cert MUST match the specified digest (with this hash function)
366 qbyte digest[DIGEST_MAXSIZE];
369typedef struct dtlsfuncs_s
370{
371 void *(*CreateContext)(const dtlscred_t *credinfo, void *cbctx, neterr_t(*push)(void *cbctx, const qbyte *data, size_t datasize), qboolean isserver); //the certificate to advertise.
372 qboolean (*CheckConnection)(void *cbctx, void *peeraddr, size_t peeraddrsize, void *indata, size_t insize, neterr_t(*push)(void *cbctx, const qbyte *data, size_t datasize), void (*EstablishTrueContext)(void **cbctx, void *state));
374 neterr_t (*Transmit)(void *ctx, const qbyte *data, size_t datasize);
375 neterr_t (*Received)(void *ctx, sizebuf_t *message); //operates in-place...
377 int (*GetPeerCertificate)(void *ctx, enum certprops_e prop, char *out, size_t outsize);
378 qboolean (*GenTempCertificate)(const char *subject, struct dtlslocalcred_s *cred);
380#ifdef HAVE_DTLS
381const dtlsfuncs_t *DTLS_InitServer(void);
382const dtlsfuncs_t *DTLS_InitClient(void);
383#endif
384typedef struct ftecrypto_s
385{
386 const char *drivername;
387
388 //tlsey things
389 vfsfile_t *(*OpenStream)(const char *hostname, vfsfile_t *source, qboolean isserver); //establish a tls connection around a tcp stream
390 int (*GetChannelBinding)(vfsfile_t *vf, qbyte *binddata, size_t *bindsize); //returns -1 if functions don't match those from OpenStream
391
392 //dtls entry points
393 const struct dtlsfuncs_s *(*DTLS_InitClient)(void); //should always return something, if implemented.
394 const struct dtlsfuncs_s *(*DTLS_InitServer)(void); //returns NULL if there's no cert available.
395
396 //digital signature stuff. note: uses sha2_512
397 enum hashvalidation_e (*VerifyHash)(const qbyte *hashdata, size_t hashsize, const qbyte *certdata, size_t certsize, const qbyte *signdata, size_t signsize);
398 int (*GenerateSignature)(const qbyte *hashdata, size_t hashsize, qbyte *signdata, size_t signsizemax);
400#define cryptolib_count 6
402extern ftecrypto_t *cryptolib[cryptolib_count];
403
404
405
406#define MAX_CONNECTIONS 8
408{
410 unsigned int packetsin;
411 unsigned int packetsout;
412 unsigned int bytesin;
413 unsigned int bytesout;
414 unsigned int timemark;
420
422
423#ifdef HAVE_DTLS
424 struct dtlspeer_s *dtls; //linked list. linked lists are shit, but at least it keeps pointers valid when things are resized.
426#endif
427
429 {
430 unsigned int sendtime; //in terms of Sys_Milliseconds()
433 size_t cursize;
436
437 netadr_t srflx[2]; //ipv4, ipv6
438 unsigned int srflx_tid[3]; //to verify the above.
440
441void ICE_Tick(void);
444void QDECL ICE_AddLCandidateInfo(struct icestate_s *con, netadr_t *adr, int adrno, int type);
447{ //shared by rtcpeers+broker
448 ICEMSG_PEERLOST=0, //other side dropped connection
449 ICEMSG_GREETING=1, //master telling us our unique game name
450 ICEMSG_NEWPEER=2, //relay established, send an offer now.
451 ICEMSG_OFFER=3, //peer's initial details
452 ICEMSG_CANDIDATE=4, //candidate updates. may arrive late as new ones are discovered.
453 ICEMSG_ACCEPT=5, //go go go (response from offer)
454 ICEMSG_SERVERINFO=6,//server->broker (for advertising the server properly)
455 ICEMSG_SERVERUPDATE=7,//broker->browser (for querying available server lists)
456 ICEMSG_NAMEINUSE=8, //requested resource is unavailable.
457};
458
460{ //websocket packet types, used by both our tcp/http/broker/etc server and our ice client.
467};
468
469ftenet_connections_t *FTENET_CreateCollection(qboolean listen, void (*ReadPacket) (void));
471qboolean FTENET_AddToCollection(struct ftenet_connections_s *col, const char *name, const char *address, netadrtype_t addrtype, netproto_t addrprot);
472int NET_EnumerateAddresses(ftenet_connections_t *collection, struct ftenet_generic_connection_s **con, unsigned int *adrflags, netadr_t *addresses, const char **adrparams, int maxaddresses);
473
474void *TLS_GetKnownCertificate(const char *certname, size_t *size);
475void *Auth_GetKnownCertificate(const char *certname, size_t *size);
476vfsfile_t *FS_OpenSSL(const char *hostname, vfsfile_t *source, qboolean server);
477int TLS_GetChannelBinding(vfsfile_t *stream, qbyte *data, size_t *datasize); //datasize should be preinitialised to the max length allowed. -1 for not implemented. 0 for peer problems. 1 for success
478#ifdef HAVE_PACKET
479vfsfile_t *FS_WrapTCPSocket(SOCKET socket, qboolean conpending, const char *peername); //conpending allows us to reject any writes until the connection has succeeded. considers the socket owned (so be sure to stop using the direct socket at least before the VFS_CLOSE call).
480#endif
481vfsfile_t *FS_OpenTCP(const char *name, int defaultport, qboolean assumetls);
482
483#endif //NETINC_INCLUDED
qboolean
Definition: api_menu.h:34
enum @13::coninfomode_e mode
Definition: com_phys_ode.c:695
netadr_t adr[8]
Definition: cl_main.c:288
int defaultport
Definition: cl_main.c:320
void(QDECL *vgui_frame)(void)
unsigned char qbyte
Definition: common.h:127
unsigned int col
Definition: gl_ngraph.c:39
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: gl_vidcommon.c:351
static EGLSurface EGLSurface EGLContext ctx
Definition: gl_videgl.c:47
Atom prop
Definition: gl_vidlinuxglx.c:4691
static CONST PIXELFORMATDESCRIPTOR *static int
Definition: gl_vidnt.c:222
GLsizei const GLcharARB const GLint * length
Definition: glquake.h:149
GLint GLenum type
Definition: glquake.h:157
GLuint GLcharARB * name
Definition: glquake.h:155
GLint size
Definition: glquake.h:157
GLsizei GLboolean const GLfloat * value
Definition: glquake.h:164
GLsizei GLsizei GLcharARB * source
Definition: glquake.h:171
void * module
Definition: image.c:236
neterr_t
Definition: net.h:124
netadrtype_t
Definition: net.h:34
certprops_e
Definition: net.h:195
netproto_t
Definition: net.h:54
cvar_t hostname
Definition: sv_main.c:204
vfsfile_t * FS_OpenTCP(const char *name, int defaultport, qboolean assumetls)
Definition: net_wins.c:9836
cvar_t net_ice_broker
ftecrypto_t crypto_gnutls
Definition: netinc.h:401
qboolean ICE_WasStun(ftenet_connections_t *col)
Definition: net_ice.c:4058
ftecrypto_t crypto_sspi
Definition: net_ssl_winsspi.c:1758
struct ftenet_generic_connection_s ftenet_generic_connection_t
vfsfile_t * FS_WrapTCPSocket(SOCKET socket, qboolean conpending, const char *peername)
Definition: net_wins.c:9815
websocketpackettype_e
Definition: netinc.h:460
@ WS_PACKETTYPE_TEXTFRAME
Definition: netinc.h:462
@ WS_PACKETTYPE_PONG
Definition: netinc.h:466
@ WS_PACKETTYPE_PING
Definition: netinc.h:465
@ WS_PACKETTYPE_CLOSE
Definition: netinc.h:464
@ WS_PACKETTYPE_CONTINUATION
Definition: netinc.h:461
@ WS_PACKETTYPE_BINARYFRAME
Definition: netinc.h:463
icestate_e
Definition: netinc.h:275
@ ICE_INACTIVE
Definition: netinc.h:276
@ ICE_FAILED
Definition: netinc.h:277
@ ICE_GATHERING
Definition: netinc.h:278
@ ICE_CONNECTING
Definition: netinc.h:279
@ ICE_CONNECTED
Definition: netinc.h:280
int TLS_GetChannelBinding(vfsfile_t *stream, qbyte *data, size_t *datasize)
Definition: net_wins.c:2658
int NET_EnumerateAddresses(ftenet_connections_t *collection, struct ftenet_generic_connection_s **con, unsigned int *adrflags, netadr_t *addresses, const char **adrparams, int maxaddresses)
Definition: net_wins.c:8402
ftenet_generic_connection_t * FTENET_ICE_EstablishConnection(ftenet_connections_t *col, const char *address, netadr_t adr)
Definition: net_ice.c:5676
icefuncs_t iceapi
Definition: net_ice.c:3154
void * TLS_GetKnownCertificate(const char *certname, size_t *size)
Definition: net_wins.c:2561
struct dtlscred_s dtlscred_t
icemode_e
Definition: netinc.h:269
@ ICEM_WEBRTC
Definition: netinc.h:272
@ ICEM_RAW
Definition: netinc.h:270
@ ICEM_ICE
Definition: netinc.h:271
void QDECL ICE_AddLCandidateInfo(struct icestate_s *con, netadr_t *adr, int adrno, int type)
Definition: net_ice.c:2815
void * Auth_GetKnownCertificate(const char *certname, size_t *size)
Definition: net_wins.c:2492
void QDECL ICE_AddLCandidateConn(ftenet_connections_t *col, netadr_t *addr, int type)
Definition: net_ice.c:2901
ftecrypto_t * cryptolib[cryptolib_count]
Definition: net_wins.c:229
const dtlsfuncs_t * DTLS_InitServer(void)
Definition: net_wins.c:3155
struct ftenet_connections_s ftenet_connections_t
iceproto_e
Definition: netinc.h:261
@ ICEP_VOICE
Definition: netinc.h:265
@ ICEP_INVALID
Definition: netinc.h:262
@ ICEP_VIDEO
Definition: netinc.h:266
@ ICEP_QWSERVER
Definition: netinc.h:263
@ ICEP_QWCLIENT
Definition: netinc.h:264
struct ftecrypto_s ftecrypto_t
struct epollctx_s epollctx_t
ftenet_connections_t * FTENET_CreateCollection(qboolean listen, void(*ReadPacket)(void))
Definition: net_wins.c:2831
const dtlsfuncs_t * DTLS_InitClient(void)
Definition: net_wins.c:3179
void ICE_Tick(void)
Definition: net_ice.c:2970
icemsgtype_s
Definition: netinc.h:447
@ ICEMSG_SERVERUPDATE
Definition: netinc.h:455
@ ICEMSG_OFFER
Definition: netinc.h:451
@ ICEMSG_GREETING
Definition: netinc.h:449
@ ICEMSG_CANDIDATE
Definition: netinc.h:452
@ ICEMSG_NAMEINUSE
Definition: netinc.h:456
@ ICEMSG_NEWPEER
Definition: netinc.h:450
@ ICEMSG_ACCEPT
Definition: netinc.h:453
@ ICEMSG_PEERLOST
Definition: netinc.h:448
@ ICEMSG_SERVERINFO
Definition: netinc.h:454
hashvalidation_e
Definition: netinc.h:345
@ VH_CORRECT
Definition: netinc.h:349
@ VH_AUTHORITY_UNKNOWN
Definition: netinc.h:347
@ VH_UNSUPPORTED
Definition: netinc.h:346
@ VH_INCORRECT
Definition: netinc.h:348
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
struct dtlsfuncs_s dtlsfuncs_t
vfsfile_t * FS_OpenSSL(const char *hostname, vfsfile_t *source, qboolean server)
Definition: net_wins.c:2608
void FTENET_CloseCollection(ftenet_connections_t *col)
Definition: net_wins.c:3531
char ** data
Definition: p_script.c:63
static SpeexBits spx_int16_t * out
Definition: snd_dma.c:492
OggVorbis_File * vf
Definition: snd_ov.c:46
Definition: netinc.h:94
size_t ai_addrlen
Definition: netinc.h:99
struct sockaddr * ai_addr
Definition: netinc.h:101
char * ai_canonname
Definition: netinc.h:100
int ai_socktype
Definition: netinc.h:97
int ai_protocol
Definition: netinc.h:98
struct addrinfo * ai_next
Definition: netinc.h:102
int ai_flags
Definition: netinc.h:95
int ai_family
Definition: netinc.h:96
Definition: cvar.h:59
Definition: netinc.h:355
void * cert
Definition: netinc.h:356
void * key
Definition: netinc.h:358
size_t certsize
Definition: netinc.h:357
size_t keysize
Definition: netinc.h:359
Definition: netinc.h:362
hashfunc_t * hash
Definition: netinc.h:365
const char * name
Definition: netinc.h:363
qbyte digest[DIGEST_MAXSIZE]
Definition: netinc.h:366
Definition: netinc.h:353
struct dtlscred_s::dtlspeercred_s peer
struct dtlscred_s::dtlslocalcred_s local
Definition: netinc.h:370
int(* GetPeerCertificate)(void *ctx, enum certprops_e prop, char *out, size_t outsize)
Definition: netinc.h:377
neterr_t(* Received)(void *ctx, sizebuf_t *message)
Definition: netinc.h:375
qboolean(* GenTempCertificate)(const char *subject, struct dtlslocalcred_s *cred)
Definition: netinc.h:378
neterr_t(* Transmit)(void *ctx, const qbyte *data, size_t datasize)
Definition: netinc.h:374
void(* DestroyContext)(void *ctx)
Definition: netinc.h:373
qboolean(* CheckConnection)(void *cbctx, void *peeraddr, size_t peeraddrsize, void *indata, size_t insize, neterr_t(*push)(void *cbctx, const qbyte *data, size_t datasize), void(*EstablishTrueContext)(void **cbctx, void *state))
Definition: netinc.h:372
neterr_t(* Timeouts)(void *ctx)
Definition: netinc.h:376
Definition: netinc.h:302
void(* Polled)(struct epollctx_s *ctx, unsigned int events)
Definition: netinc.h:303
Definition: netinc.h:385
int(* GenerateSignature)(const qbyte *hashdata, size_t hashsize, qbyte *signdata, size_t signsizemax)
Definition: netinc.h:398
enum hashvalidation_e(* VerifyHash)(const qbyte *hashdata, size_t hashsize, const qbyte *certdata, size_t certsize, const qbyte *signdata, size_t signsize)
Definition: netinc.h:397
const char * drivername
Definition: netinc.h:386
int(* GetChannelBinding)(vfsfile_t *vf, qbyte *binddata, size_t *bindsize)
Definition: netinc.h:390
qbyte data[1]
Definition: netinc.h:434
struct ftenet_delayed_packet_s * next
Definition: netinc.h:431
unsigned int sendtime
Definition: netinc.h:430
netadr_t dest
Definition: netinc.h:432
size_t cursize
Definition: netinc.h:433
Definition: netinc.h:408
float bytesinrate
Definition: netinc.h:417
unsigned int srflx_tid[3]
Definition: netinc.h:438
netadr_t srflx[2]
Definition: netinc.h:437
void(* ReadGamePacket)(void)
Definition: netinc.h:421
float packetsoutrate
Definition: netinc.h:416
unsigned int bytesout
Definition: netinc.h:413
qboolean islisten
Definition: netinc.h:409
unsigned int packetsout
Definition: netinc.h:411
struct dtlspeer_s * dtls
Definition: netinc.h:424
unsigned int packetsin
Definition: netinc.h:410
unsigned int timemark
Definition: netinc.h:414
float bytesoutrate
Definition: netinc.h:418
float packetsinrate
Definition: netinc.h:415
ftenet_generic_connection_t * conn[MAX_CONNECTIONS]
Definition: netinc.h:419
struct ftenet_connections_s::ftenet_delayed_packet_s * delayed_packets
const dtlsfuncs_t * dtlsfuncs
Definition: netinc.h:425
unsigned int bytesin
Definition: netinc.h:412
Definition: netinc.h:313
void(* Close)(struct ftenet_generic_connection_s *con)
Definition: netinc.h:320
void(* PrintStatus)(struct ftenet_generic_connection_s *con)
Definition: netinc.h:324
epollctx_t epoll
Definition: netinc.h:334
qboolean islisten
Definition: netinc.h:328
int(* GetLocalAddresses)(struct ftenet_generic_connection_s *con, unsigned int *adrflags, netadr_t *addresses, const char **adrparams, int maxaddresses)
Definition: netinc.h:316
int thesocket
Definition: netinc.h:340
neterr_t(* SendPacket)(struct ftenet_generic_connection_s *con, int length, const void *data, netadr_t *to)
Definition: netinc.h:319
qboolean(* ChangeLocalAddress)(struct ftenet_generic_connection_s *con, const char *addressstring, netadr_t *newadr)
Definition: netinc.h:317
int(* SetFDSets)(struct ftenet_generic_connection_s *con, fd_set *readfdset, fd_set *writefdset)
Definition: netinc.h:322
SOCKET thesocket
Definition: netinc.h:338
struct ftenet_connections_s * owner
Definition: netinc.h:331
qboolean(* GetPacket)(struct ftenet_generic_connection_s *con)
Definition: netinc.h:318
netadrtype_t addrtype[FTENET_ADDRTYPES]
Definition: netinc.h:327
int connum
Definition: netinc.h:330
netproto_t prot
Definition: netinc.h:326
Definition: common.h:951
Definition: netinc.h:240
char reladdr[64]
Definition: netinc.h:255
char candidateid[64]
Definition: netinc.h:241
enum icecandinfo_s::@198 type
int network
Definition: netinc.h:258
int foundation
Definition: netinc.h:245
int relport
Definition: netinc.h:256
@ ICE_SRFLX
Definition: netinc.h:251
@ ICE_HOST
Definition: netinc.h:250
@ ICE_PRFLX
Definition: netinc.h:252
@ ICE_RELAY
Definition: netinc.h:253
int component
Definition: netinc.h:246
char addr[64]
Definition: netinc.h:242
int generation
Definition: netinc.h:257
int priority
Definition: netinc.h:247
int transport
Definition: netinc.h:244
int port
Definition: netinc.h:243
Definition: netinc.h:285
qboolean force
Definition: netinc.h:291
struct icecandinfo_s * cand
Definition: netinc.h:290
qboolean(QDECL *Get)(struct icestate_s *con
struct icecandinfo_s *QDECL * GetLCandidateInfo(struct icestate_s *con)
void(QDECL *CloseModule)(void *module)
char * out
Definition: netinc.h:293
const char * prop
Definition: netinc.h:287
struct icestate_s *QDECL * Create(void *module, const char *conname, const char *peername, enum icemode_e mode, enum iceproto_e proto, qboolean initiator)
struct icestate_s *QDECL * Find(void *module, const char *conname)
Definition: netinc.h:77
u_char s6_addr[16]
Definition: netinc.h:78
Definition: netinc.h:63
u_long Level
Definition: netinc.h:69
u_long Value
Definition: netinc.h:71
u_long Zone
Definition: netinc.h:68
Definition: net.h:71
Definition: common.h:196
Definition: netinc.h:82
struct in6_addr sin6_addr
Definition: netinc.h:86
struct ip6_scope_id sin6_scope_struct
Definition: netinc.h:90
u_short sin6_port
Definition: netinc.h:84
u_long sin6_scope_id
Definition: netinc.h:89
short sin6_family
Definition: netinc.h:83
u_long sin6_flowinfo
Definition: netinc.h:85
Definition: netinc.h:30
char url[64]
Definition: netinc.h:32
short sws_family
Definition: netinc.h:31
static unsigned char * to
Definition: sv_sql.c:31
void * vfsfile_t
Definition: sys_plugfte.h:2