28 changed files with 758 additions and 122 deletions
Split View
Diff Options
-
4libcork/include/libcork/config/config.h
-
52libcork/include/libcork/config/mingw32.h
-
4libcork/posix/subprocess.c
-
97src/acl.c
-
26src/acl.h
-
22src/cache.c
-
22src/cache.h
-
22src/encrypt.c
-
22src/encrypt.h
-
23src/include.h
-
21src/jconf.c
-
21src/jconf.h
-
203src/json.h
-
28src/local.c
-
22src/local.h
-
23src/redir.c
-
22src/redir.h
-
22src/server.c
-
22src/server.h
-
22src/socks5.h
-
22src/tunnel.c
-
26src/tunnel.h
-
22src/udprelay.c
-
22src/udprelay.h
-
22src/utils.c
-
22src/utils.h
-
22src/win32.c
-
22src/win32.h
@ -0,0 +1,52 @@ |
|||
/* -*- coding: utf-8 -*- |
|||
* ---------------------------------------------------------------------- |
|||
* Copyright © 2011, RedJack, LLC. |
|||
* All rights reserved. |
|||
* |
|||
* Please see the COPYING file in this distribution for license |
|||
* details. |
|||
* ---------------------------------------------------------------------- |
|||
*/ |
|||
|
|||
#ifndef LIBCORK_CONFIG_MINGW32_H |
|||
#define LIBCORK_CONFIG_MINGW32_H |
|||
|
|||
#include <io.h> |
|||
|
|||
/*----------------------------------------------------------------------- |
|||
* Endianness |
|||
*/ |
|||
|
|||
/* Assume MinGW32 only works on x86 platform */ |
|||
|
|||
#define CORK_CONFIG_IS_BIG_ENDIAN 0 |
|||
#define CORK_CONFIG_IS_LITTLE_ENDIAN 1 |
|||
|
|||
#define CORK_HAVE_REALLOCF 0 |
|||
#define CORK_HAVE_PTHREADS 1 |
|||
|
|||
/* |
|||
* File io stuff. Odd that this is not defined by MinGW. |
|||
* Maybe there is an M$ish way to do it. |
|||
*/ |
|||
#define F_SETFL 4 |
|||
#define O_NONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ |
|||
|
|||
#define F_GETFD 1 |
|||
#define F_SETFD 2 |
|||
#define FD_CLOEXEC 0x1 |
|||
|
|||
#define WNOHANG 1 |
|||
|
|||
/* |
|||
* simple adaptors |
|||
*/ |
|||
|
|||
static inline int mingw_mkdir(const char *path, int mode) |
|||
{ |
|||
return mkdir(path); |
|||
} |
|||
#define mkdir mingw_mkdir |
|||
|
|||
|
|||
#endif /* LIBCORK_CONFIG_MINGW32_H */ |
@ -1,8 +1,32 @@ |
|||
/* |
|||
* acl.h - Define the ACL interface |
|||
* |
|||
* Copyright (C) 2013 - 2014, Max Lv <max.c.lv@gmail.com> |
|||
* |
|||
* 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 |
|||
* <http://www.gnu.org/licenses/>. |
|||
*/ |
|||
|
|||
#ifndef _ACL_H |
|||
#define _ACL_H |
|||
|
|||
int init_acl(const char *path); |
|||
void free_acl(void); |
|||
int acl_is_bypass(const char* host); |
|||
|
|||
int acl_contains_ip(const char* ip); |
|||
int acl_contains_domain(const char* domain); |
|||
|
|||
#endif // _ACL_H |
Write
Preview
Loading…
Cancel
Save