projects
/
umurmur.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed clock source. embarassing...
[umurmur.git]
/
src
/
client.h
diff --git
a/src/client.h
b/src/client.h
index 66bf7d8d9ad1bfc0ff4b8b95e4f6c0106c8dcc70..95f61725fbb1ddf4f75e8aa2532d39afabba45ea 100644
(file)
--- a/
src/client.h
+++ b/
src/client.h
@@
-1,5
+1,5
@@
-/* Copyright (C) 2009-201
0
, Martin Johansson <martin@fatbob.nu>
- Copyright (C) 2005-201
0
, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-201
4
, Martin Johansson <martin@fatbob.nu>
+ Copyright (C) 2005-201
4
, Thorvald Natvig <thorvald@natvig.com>
All rights reserved.
All rights reserved.
@@
-31,6
+31,7
@@
#ifndef CLIENT_H_45786678
#define CLIENT_H_45786678
#ifndef CLIENT_H_45786678
#define CLIENT_H_45786678
+#include <config.h>
#include <stdint.h>
#include <unistd.h> /* close() */
#include <sys/types.h>
#include <stdint.h>
#include <unistd.h> /* close() */
#include <sys/types.h>
@@
-50,8
+51,10
@@
#define BUFSIZE 8192
#define UDP_BUFSIZE 512
#define BUFSIZE 8192
#define UDP_BUFSIZE 512
-#define INACTI
C
ITY_TIMEOUT 15 /* Seconds */
+#define INACTI
V
ITY_TIMEOUT 15 /* Seconds */
#define MAX_CODECS 10
#define MAX_CODECS 10
+#define MAX_TOKENSIZE 64
+#define MAX_TOKENS 32
#define IS_AUTH(_a_) ((_a_)->authenticated)
#define IS_AUTH(_a_) ((_a_)->authenticated)
@@
-70,13
+73,13
@@
typedef struct {
int sessionId;
uint64_t key;
char *username;
int sessionId;
uint64_t key;
char *username;
- bool_t bUDP, authenticated, deaf, mute;
- char *os, *release;
+ bool_t bUDP, authenticated, deaf, mute
, self_deaf, self_mute, recording, bOpus
;
+ char *os, *release
, *os_version
;
uint32_t version;
int codec_count;
struct dlist codecs;
int availableBandwidth;
uint32_t version;
int codec_count;
struct dlist codecs;
int availableBandwidth;
- etimer_t lastActivity;
+ etimer_t lastActivity
, connectTime, idleTime
;
struct dlist node;
struct dlist txMsgQueue;
int txQueueCount;
struct dlist node;
struct dlist txMsgQueue;
int txQueueCount;
@@
-84,6
+87,13
@@
typedef struct {
char *context;
struct dlist chan_node;
struct dlist voicetargets;
char *context;
struct dlist chan_node;
struct dlist voicetargets;
+ struct dlist tokens;
+ int tokencount;
+ uint8_t hash[20];
+ bool_t isAdmin;
+ bool_t isSuppressed;
+ float UDPPingAvg, UDPPingVar, TCPPingAvg, TCPPingVar;
+ uint32_t UDPPackets, TCPPackets;
} client_t;
typedef struct {
} client_t;
typedef struct {
@@
-91,6
+101,11
@@
typedef struct {
struct dlist node;
} codec_t;
struct dlist node;
} codec_t;
+typedef struct {
+ char *token;
+ struct dlist node;
+} token_t;
+
void Client_init();
int Client_getfds(struct pollfd *pollfds);
void Client_janitor();
void Client_init();
int Client_getfds(struct pollfd *pollfds);
void Client_janitor();
@@
-98,6
+113,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_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);
int Client_count(void);
void Client_close(client_t *client);
client_t *Client_iterate(client_t **client);
@@
-105,9
+122,10
@@
int Client_send_message_except(client_t *client, message_t *msg);
int Client_read_udp(void);
void Client_disconnect_all();
int Client_voiceMsg(client_t *client, uint8_t *data, int len);
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_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
#endif