summaryrefslogtreecommitdiff
path: root/client.h
blob: 028e112a17d7ced3af31dd57bd987f905918a949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "main.h"

#define CLIENT_STATE_INITIAL 1
#define CLIENT_STATE_REQUEST_SENT 2
#define CLIENT_STATE_REQUEST_ACCEPTED 3
#define CLIENT_STATE_PING_SENT 4
#define CLIENT_STATE_CONNECTED 5
#define CLIENT_STATE_PONG_RECEIVED 6
#define CLIENT_STATE_SEND_PING 7
#define CLIENT_STATE_REQUEST_TUNNEL 8
#define CLIENT_STATE_WAIT_FOR_ACKTUNNEL 9
#define CLIENT_STATE_FORWARDING 10
#define CLIENT_STATE_SHUTDOWN 11
#define CLIENT_STATE_BIND_PORT 12
#define CLIENT_STATE_SETUP_PIPE 13
#define CLIENT_STATE_CONNECTION_LOST 14

int handle_pong_frame();
int handle_acktunnel_frame(protocol_frame *rcvd_frame);
int handle_server_tcp_frame(protocol_frame *rcvd_frame);
int handle_server_tcp_fin_frame(protocol_frame *rcvd_frame);
int do_client_loop(uint8_t *tox_id_str);