You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.4 KiB

10 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
  1. /*
  2. * socks5.h - Define SOCKS5's header
  3. *
  4. * Copyright (C) 2013, clowwindy <clowwindy42@gmail.com>
  5. *
  6. * This file is part of the shadowsocks-libev.
  7. *
  8. * shadowsocks-libev is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * shadowsocks-libev is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with shadowsocks-libev; see the file COPYING. If not, see
  20. * <http://www.gnu.org/licenses/>.
  21. */
  22. #ifndef _SOCKS5_H
  23. #define _SOCKS5_H
  24. #define SVERSION 0x05
  25. #define CONNECT 0x01
  26. #define IPV4 0x01
  27. #define DOMAIN 0x03
  28. #define IPV6 0x04
  29. #define CMD_NOT_SUPPORTED 0x07
  30. #pragma pack(push)
  31. #pragma pack(1)
  32. struct method_select_request {
  33. char ver;
  34. char nmethods;
  35. char methods[255];
  36. };
  37. struct method_select_response {
  38. char ver;
  39. char method;
  40. };
  41. struct socks5_request {
  42. char ver;
  43. char cmd;
  44. char rsv;
  45. char atyp;
  46. };
  47. struct socks5_response {
  48. char ver;
  49. char rep;
  50. char rsv;
  51. char atyp;
  52. };
  53. #pragma pack(pop)
  54. #endif //_SOCKS5_H