client.h 759 B

1234567891011121314151617181920212223
  1. #include "main.h"
  2. #define CLIENT_STATE_INITIAL 1
  3. #define CLIENT_STATE_SENTREQUEST 2
  4. #define CLIENT_STATE_REQUEST_ACCEPTED 3
  5. #define CLIENT_STATE_PING_SENT 4
  6. #define CLIENT_STATE_CONNECTED 5
  7. #define CLIENT_STATE_PONG_RECEIVED 6
  8. #define CLIENT_STATE_SEND_PING 7
  9. #define CLIENT_STATE_REQUEST_TUNNEL 8
  10. #define CLIENT_STATE_WAIT_FOR_ACKTUNNEL 9
  11. #define CLIENT_STATE_FORWARDING 10
  12. #define CLIENT_STATE_SHUTDOWN 11
  13. #define CLIENT_STATE_BIND_PORT 12
  14. #define CLIENT_STATE_SETUP_PIPE 13
  15. #define CLIENT_STATE_CONNECTION_LOST 14
  16. int handle_pong_frame();
  17. int handle_acktunnel_frame(protocol_frame *rcvd_frame);
  18. int handle_server_tcp_frame(protocol_frame *rcvd_frame);
  19. int handle_server_tcp_fin_frame(protocol_frame *rcvd_frame);
  20. int do_client_loop(uint8_t *tox_id_str);