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.

54 lines
1.4 KiB

11 years ago
11 years ago
11 years ago
11 years ago
  1. /*
  2. * server.c - Define the config data structure
  3. *
  4. * Copyright (C) 2013 - 2014, Max Lv <max.c.lv@gmail.com>
  5. *
  6. * This file is part of the shadowsocks-libev.
  7. * shadowsocks-libev is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * shadowsocks-libev is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with pdnsd; see the file COPYING. If not, see
  19. * <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef _JCONF_H
  22. #define _JCONF_H
  23. #define MAX_REMOTE_NUM 10
  24. #define MAX_CONF_SIZE 16 * 1024
  25. #define DNS_THREAD_NUM 4
  26. #define MAX_UDP_CONN_NUM 4096
  27. typedef struct
  28. {
  29. char *host;
  30. char *port;
  31. } ss_addr_t;
  32. typedef struct
  33. {
  34. int remote_num;
  35. ss_addr_t remote_addr[MAX_REMOTE_NUM];
  36. char *remote_port;
  37. char *local_addr;
  38. char *local_port;
  39. char *password;
  40. char *method;
  41. char *timeout;
  42. int fast_open;
  43. int nofile;
  44. } jconf_t;
  45. jconf_t *read_jconf(const char* file);
  46. void parse_addr(const char *str, ss_addr_t *addr);
  47. void free_addr(ss_addr_t *addr);
  48. #endif // _JCONF_H