summaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authorGDR! <gdr@go2.pl>2014-11-25 23:09:45 +0100
committerGDR! <gdr@go2.pl>2014-11-25 23:09:45 +0100
commit16add85eb81629b07dd7bdb04fbe30be1410cc83 (patch)
treef2cc52d65a2deb0e8c1014f28d9926612c7cf074 /main.h
parentc311fb3bdd2c26c347c2dd734f97003ac0538037 (diff)
Multi-connection support client-side.
Dealing with congestion control, too
Diffstat (limited to 'main.h')
-rw-r--r--main.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.h b/main.h
index 4f2187d..ba0a6d0 100644
--- a/main.h
+++ b/main.h
@@ -3,8 +3,10 @@
3 3
4#include <arpa/inet.h> 4#include <arpa/inet.h>
5#include <errno.h> 5#include <errno.h>
6#include <fcntl.h>
6#include <netdb.h> 7#include <netdb.h>
7#include <netinet/in.h> 8#include <netinet/in.h>
9#include <signal.h>
8#include <stdio.h> 10#include <stdio.h>
9#include <stdlib.h> 11#include <stdlib.h>
10#include <string.h> 12#include <string.h>
@@ -18,7 +20,6 @@
18#include "util.h" 20#include "util.h"
19#include "uthash.h" 21#include "uthash.h"
20 22
21#define READ_BUFFER_SIZE 1024
22 23
23#define PROTOCOL_MAGIC_V1 0xa26a 24#define PROTOCOL_MAGIC_V1 0xa26a
24#define PROTOCOL_MAGIC PROTOCOL_MAGIC_V1 25#define PROTOCOL_MAGIC PROTOCOL_MAGIC_V1
@@ -37,8 +38,10 @@
37 38
38/* Offset of the data buffer in the packet */ 39/* Offset of the data buffer in the packet */
39#define PROTOCOL_BUFFER_OFFSET 8 40#define PROTOCOL_BUFFER_OFFSET 8
41#define READ_BUFFER_SIZE TOX_MAX_CUSTOM_PACKET_SIZE - PROTOCOL_BUFFER_OFFSET
40#define PROTOCOL_MAX_PACKET_SIZE (READ_BUFFER_SIZE + PROTOCOL_BUFFER_OFFSET) 42#define PROTOCOL_MAX_PACKET_SIZE (READ_BUFFER_SIZE + PROTOCOL_BUFFER_OFFSET)
41 43
44
42typedef struct tunnel_t { 45typedef struct tunnel_t {
43 /* The forwarded socket fd */ 46 /* The forwarded socket fd */
44 int sockfd; 47 int sockfd;
@@ -80,6 +83,9 @@ extern char *remote_host;
80extern int local_port; 83extern int local_port;
81 84
82extern int select_nfds; 85extern int select_nfds;
86extern tunnel *by_id;
83 87
84int parse_lossless_packet(void *sender_uc, const uint8_t *data, uint32_t len); 88int parse_lossless_packet(void *sender_uc, const uint8_t *data, uint32_t len);
89tunnel *tunnel_create(int sockfd, int connid, uint32_t friendnumber);
90void tunnel_delete(tunnel *t);
85#endif 91#endif