From d93a647639b717287c223aaf8e63f82fc265a1cd Mon Sep 17 00:00:00 2001 From: Max Lv Date: Tue, 21 Oct 2014 18:06:47 +0800 Subject: [PATCH] add a header file for library interface --- src/shadowsocks.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/shadowsocks.h diff --git a/src/shadowsocks.h b/src/shadowsocks.h new file mode 100644 index 00000000..5f7da99c --- /dev/null +++ b/src/shadowsocks.h @@ -0,0 +1,43 @@ +/* + * shadowsocks.h - Header files of library interfaces + * + * Copyright (C) 2013 - 2014, Max Lv + * + * This file is part of the shadowsocks-libev. + * shadowsocks-libev is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * shadowsocks-libev is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with pdnsd; see the file COPYING. If not, see + * . + */ + +#ifndef _SHADOWSOCKS_H +#define _SHADOWSOCKS_H + +typedef struct { + char *server; // server hostname or ip + char *method; // encryption method + char *passwd; // password of server + char *config; // file path to config + char *acl; // file path to acl + int server_port; // port number of server + int local_port; // port number of local + int timeout; // connection timeout + int fast_open; // tcp fast open + int verbose; // verbose mode +} profile_t; + +// create and start a shadowsocks service, +// if success, return the pid. +// if not, return -1 +int create_ss_service (profile_t profile, char *log_file); + +#endif // _SHADOWSOCKS_H