X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fclient.h;h=a74a2068580d74b7ad04f39591c3e9e53fec860a;hb=454ad122eb158b4391e2690fe6a7e127d24c525b;hp=1239e557842181dc6fed7b5c46d5d4baaf4a458a;hpb=c7df54e693e34de4037a8cc8b7a28828302c7fa5;p=umurmur.git diff --git a/src/client.h b/src/client.h index 1239e55..a74a206 100644 --- a/src/client.h +++ b/src/client.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010, Martin Johansson +/* Copyright (C) 2009-2010, Martin Johansson Copyright (C) 2005-2010, Thorvald Natvig All rights reserved. @@ -31,7 +31,6 @@ #ifndef CLIENT_H_45786678 #define CLIENT_H_45786678 -#include #include #include /* close() */ #include @@ -47,8 +46,9 @@ #include "crypt.h" #include "timer.h" #include "pds.h" +#include "ssl.h" -#define BUFSIZE 2048 +#define BUFSIZE 8192 #define UDP_BUFSIZE 512 #define INACTICITY_TIMEOUT 15 /* Seconds */ #define MAX_CODECS 10 @@ -57,7 +57,7 @@ typedef struct { int tcpfd; - SSL *ssl; + SSL_handle_t *ssl; bool_t SSLready; bool_t shutdown_wait; cryptState_t cryptState; @@ -69,14 +69,14 @@ typedef struct { uint32_t rxcount, msgsize, drainleft, txcount, txsize; int sessionId; uint64_t key; - char *playerName; - bool_t authenticated, deaf, mute; - char *os, *release; + char *username; + bool_t bUDP, authenticated, deaf, mute, recording; + char *os, *release, *os_version; uint32_t version; int codec_count; - int32_t codecs[MAX_CODECS]; + struct dlist codecs; int availableBandwidth; - etimer_t lastActivity; + etimer_t lastActivity, connectTime, idleTime; struct dlist node; struct dlist txMsgQueue; int txQueueCount; @@ -84,8 +84,14 @@ typedef struct { char *context; struct dlist chan_node; struct dlist voicetargets; + float UDPPingAvg, UDPPingVar, TCPPingAvg, TCPPingVar; + uint32_t UDPPackets, TCPPackets; } client_t; +typedef struct { + int codec, count; + struct dlist node; +} codec_t; void Client_init(); int Client_getfds(struct pollfd *pollfds); @@ -94,6 +100,8 @@ int Client_add(int fd, struct sockaddr_in *remote); int Client_read_fd(int fd); int Client_write_fd(int fd); int Client_send_message(client_t *client, message_t *msg); +int Client_send_message_ver(client_t *client, message_t *msg, uint32_t version); +int Client_send_message_except_ver(client_t *client, message_t *msg, uint32_t version); int Client_count(void); void Client_close(client_t *client); client_t *Client_iterate(client_t **client); @@ -102,5 +110,8 @@ int Client_read_udp(void); void Client_disconnect_all(); int Client_voiceMsg(client_t *client, uint8_t *data, int len); void recheckCodecVersions(); +void Client_codec_add(client_t *client, int codec); +void Client_codec_free(client_t *client); +codec_t *Client_codec_iterate(client_t *client, codec_t **codec_itr); #endif