socks5proxy.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _SOCKS5PROXY_H_
  2. #define _SOCKS5PROXY_H_
  3. #include <stdint.h>
  4. #define SLITHEEN_ID_LEN 28
  5. #define SLITHEEN_SUPER_SECRET_SIZE 16
  6. #define SLITHEEN_SUPER_CONST "SLITHEEN_SUPER_ENCRYPT"
  7. #define SLITHEEN_SUPER_CONST_SIZE 22
  8. int proxy_data(int sockfd, uint16_t stream_id, int32_t pipefd);
  9. void *demultiplex_data();
  10. struct __attribute__ ((__packed__)) slitheen_hdr {
  11. uint64_t counter;
  12. uint16_t stream_id;
  13. uint16_t len;
  14. uint16_t garbage;
  15. uint16_t zeros;
  16. };
  17. #define SLITHEEN_HEADER_LEN 16
  18. struct __attribute__ ((__packed__)) slitheen_up_hdr{
  19. uint16_t stream_id;
  20. uint16_t len;
  21. };
  22. typedef struct connection_st{
  23. int32_t pipe_fd;
  24. uint16_t stream_id;
  25. struct connection_st *next;
  26. } connection;
  27. typedef struct connection_table_st{
  28. connection *first;
  29. } connection_table;
  30. typedef struct data_block_st {
  31. uint64_t count;
  32. uint8_t *data;
  33. struct data_block_st *next;
  34. } data_block;
  35. struct socks_method_req {
  36. uint8_t version;
  37. uint8_t num_methods;
  38. };
  39. struct socks_req {
  40. uint8_t version;
  41. uint8_t cmd;
  42. uint8_t rsvd;
  43. uint8_t addr_type;
  44. };
  45. #endif /* _SOCKS5PROXY_H_ */