relay.h 875 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef _RELAY_H_
  2. #define _RELAY_H_
  3. #include "flow.h"
  4. #include <stdint.h>
  5. struct proxy_thread_data {
  6. flow *f;
  7. uint8_t *initial_data;
  8. int32_t pipefd;
  9. };
  10. struct socks_req {
  11. uint8_t version;
  12. uint8_t cmd;
  13. uint8_t rsvd;
  14. uint8_t addr_type;
  15. };
  16. int replace_packet(flow *f, struct packet_info *info);
  17. int process_downstream(flow *f, int32_t offset, struct packet_info *info);
  18. int read_header(flow *f, struct packet_info *info);
  19. uint32_t get_response_length(uint8_t *response);
  20. int fill_with_downstream(flow *f, uint8_t *data, int32_t length);
  21. uint16_t tcp_checksum(struct packet_info *info);
  22. void *proxy_covert_site(void *data);
  23. #define BEGIN_HEADER 0x10
  24. #define PARSE_HEADER 0x20
  25. #define MID_CONTENT 0x30
  26. #define BEGIN_CHUNK 0x40
  27. #define MID_CHUNK 0x50
  28. #define END_CHUNK 0x60
  29. #define END_BODY 0x70
  30. #define FORFEIT_REST 0x80
  31. #define USE_REST 0x90
  32. #endif /* _RELAY_H_ */