-/* Copyright (C) 2009-2012, Martin Johansson <martin@fatbob.nu>
- Copyright (C) 2005-2012, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-2014, Martin Johansson <martin@fatbob.nu>
+ Copyright (C) 2005-2014, Thorvald Natvig <thorvald@natvig.com>
All rights reserved.
#ifndef CLIENT_H_45786678
#define CLIENT_H_45786678
-#include <config.h>
+#include "config.h"
#include <stdint.h>
#include <unistd.h> /* close() */
#include <sys/types.h>
#define BUFSIZE 8192
#define UDP_BUFSIZE 512
-#define INACTICITY_TIMEOUT 15 /* Seconds */
+#define INACTIVITY_TIMEOUT 15 /* Seconds */
#define MAX_CODECS 10
#define MAX_TOKENSIZE 64
#define MAX_TOKENS 32
bool_t shutdown_wait;
cryptState_t cryptState;
bool_t readBlockedOnWrite, writeBlockedOnRead;
-
+
struct sockaddr_in remote_tcp;
- struct sockaddr_in remote_udp;
+ struct sockaddr_in remote_udp;
uint8_t rxbuf[BUFSIZE], txbuf[BUFSIZE];
uint32_t rxcount, msgsize, drainleft, txcount, txsize;
int sessionId;
uint64_t key;
char *username;
- bool_t bUDP, authenticated, deaf, mute, recording;
+ bool_t bUDP, authenticated, deaf, mute, self_deaf, self_mute, recording, bOpus;
char *os, *release, *os_version;
uint32_t version;
int codec_count;
int tokencount;
uint8_t hash[20];
bool_t isAdmin;
+ bool_t isSuppressed;
float UDPPingAvg, UDPPingVar, TCPPingAvg, TCPPingVar;
uint32_t UDPPackets, TCPPackets;
} client_t;
int Client_read_udp(void);
void Client_disconnect_all();
int Client_voiceMsg(client_t *client, uint8_t *data, int len);
-void recheckCodecVersions();
+void recheckCodecVersions(client_t *connectingClient);
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);
+void Client_textmessage(client_t *client, char *text);
#endif