X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fclient.h;fp=src%2Fclient.h;h=66470de3fb2177f4dea9558b79e36e20b1003d25;hb=b331021d492fd5febb576a61717a489c5cc875ff;hp=c6085d298e6563779f4763f60d4d6f9b0ab284dd;hpb=7a4674db9a32bccbcf8d1655ede3ac293a9171f5;p=umurmur.git diff --git a/src/client.h b/src/client.h index c6085d2..66470de 100644 --- a/src/client.h +++ b/src/client.h @@ -55,6 +55,7 @@ #define MAX_CODECS 10 #define MAX_TOKENSIZE 64 #define MAX_TOKENS 32 +#define KEY_LENGTH sizeof(uint16_t) + 4 * sizeof(in_addr_t) #define IS_AUTH(_a_) ((_a_)->authenticated) @@ -66,12 +67,13 @@ typedef struct { cryptState_t cryptState; bool_t readBlockedOnWrite, writeBlockedOnRead; - struct sockaddr_in remote_tcp; - struct sockaddr_in remote_udp; + struct sockaddr_storage remote_tcp; + struct sockaddr_storage remote_udp; + char addressString[INET6_ADDRSTRLEN]; uint8_t rxbuf[BUFSIZE], txbuf[BUFSIZE]; uint32_t rxcount, msgsize, drainleft, txcount, txsize; int sessionId; - uint64_t key; + uint8_t key[KEY_LENGTH]; char *username; bool_t bUDP, authenticated, deaf, mute, self_deaf, self_mute, recording, bOpus; char *os, *release, *os_version; @@ -109,7 +111,7 @@ typedef struct { void Client_init(); int Client_getfds(struct pollfd *pollfds); void Client_janitor(); -int Client_add(int fd, struct sockaddr_in *remote); +int Client_add(int fd, struct sockaddr_storage *remote); int Client_read_fd(int fd); int Client_write_fd(int fd); int Client_send_message(client_t *client, message_t *msg);