X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fclient.h;h=66bf7d8d9ad1bfc0ff4b8b95e4f6c0106c8dcc70;hb=2ae1e3a1e414732354074d163ee074c24ec9d3bb;hp=1239e557842181dc6fed7b5c46d5d4baaf4a458a;hpb=c7df54e693e34de4037a8cc8b7a28828302c7fa5;p=umurmur.git diff --git a/src/client.h b/src/client.h index 1239e55..66bf7d8 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,12 +69,12 @@ typedef struct { uint32_t rxcount, msgsize, drainleft, txcount, txsize; int sessionId; uint64_t key; - char *playerName; - bool_t authenticated, deaf, mute; + char *username; + bool_t bUDP, authenticated, deaf, mute; char *os, *release; uint32_t version; int codec_count; - int32_t codecs[MAX_CODECS]; + struct dlist codecs; int availableBandwidth; etimer_t lastActivity; struct dlist node; @@ -86,6 +86,10 @@ typedef struct { struct dlist voicetargets; } client_t; +typedef struct { + int codec, count; + struct dlist node; +} codec_t; void Client_init(); int Client_getfds(struct pollfd *pollfds); @@ -102,5 +106,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