diff options
author | GDR! <gdr@go2.pl> | 2014-11-25 23:09:45 +0100 |
---|---|---|
committer | GDR! <gdr@go2.pl> | 2014-11-25 23:09:45 +0100 |
commit | 16add85eb81629b07dd7bdb04fbe30be1410cc83 (patch) | |
tree | f2cc52d65a2deb0e8c1014f28d9926612c7cf074 /main.h | |
parent | c311fb3bdd2c26c347c2dd734f97003ac0538037 (diff) |
Multi-connection support client-side.
Dealing with congestion control, too
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 | |||
42 | typedef struct tunnel_t { | 45 | typedef 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; | |||
80 | extern int local_port; | 83 | extern int local_port; |
81 | 84 | ||
82 | extern int select_nfds; | 85 | extern int select_nfds; |
86 | extern tunnel *by_id; | ||
83 | 87 | ||
84 | int parse_lossless_packet(void *sender_uc, const uint8_t *data, uint32_t len); | 88 | int parse_lossless_packet(void *sender_uc, const uint8_t *data, uint32_t len); |
89 | tunnel *tunnel_create(int sockfd, int connid, uint32_t friendnumber); | ||
90 | void tunnel_delete(tunnel *t); | ||
85 | #endif | 91 | #endif |