diff --git a/.gitignore b/.gitignore index e959e86..2530996 100644 --- a/.gitignore +++ b/.gitignore @@ -45,8 +45,8 @@ tags *.user .ycm_extra_conf.pyc -/xsocksd -/xsocks -/xtproxy -/xforwarder -/xtunnel +/xSocksd +/xSocks +/xTproxy +/xForwarder +/xTunnel diff --git a/CHANGES.md b/CHANGES.md index 4985760..457340d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +v0.4.2 (2015-10-20) +----------- +* Change: Rename program name + + v0.4.1 (2015-10-18) ----------- * Hotfix: Openwrt build script @@ -51,7 +56,7 @@ v0.2.2 (2015-9-01) v0.2.1 (2015-6-09) ----------- -* Change: Build native xsocks with WinDDK for windows +* Change: Build native xSocks with WinDDK for windows * Feature: Support mingw-w64 diff --git a/Makefile b/Makefile index 05587fc..4e45861 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ MAJOR = 0 MINOR = 4 -PATCH = 1 -NAME = xsocks +PATCH = 2 +NAME = xSocks ifdef O ifeq ("$(origin O)", "command line") @@ -106,11 +106,11 @@ endif LDFLAGS += $(LIBS) -XSOCKSD=$(OBJTREE)/xsocksd -XSOCKS=$(OBJTREE)/xsocks -XTPROXY=$(OBJTREE)/xtproxy -XFORWARDER=$(OBJTREE)/xforwarder -XTUNNEL=$(OBJTREE)/xtunnel +XSOCKSD=$(OBJTREE)/xSocksd +XSOCKS=$(OBJTREE)/xSocks +XTPROXY=$(OBJTREE)/xTproxy +XFORWARDER=$(OBJTREE)/xForwarder +XTUNNEL=$(OBJTREE)/xTunnel ######################################################################### include $(SRCTREE)/config.mk @@ -216,10 +216,10 @@ $(XSOCKSD): \ $(OBJTREE)/src/consumer.o \ $(OBJTREE)/src/cache.o \ $(OBJTREE)/src/packet.o \ - $(OBJTREE)/src/xsocksd_udprelay.o \ - $(OBJTREE)/src/xsocksd_client.o \ - $(OBJTREE)/src/xsocksd_remote.o \ - $(OBJTREE)/src/xsocksd.o + $(OBJTREE)/src/xSocksd_udprelay.o \ + $(OBJTREE)/src/xSocksd_client.o \ + $(OBJTREE)/src/xSocksd_remote.o \ + $(OBJTREE)/src/xSocksd.o $(LINK) $^ -o $@ $(LDFLAGS) $(OBJTREE)/3rd/c-ares/.libs/libcares.a else $(XSOCKSD).exe: \ @@ -231,10 +231,10 @@ $(XSOCKSD).exe: \ src/consumer.o \ src/cache.o \ src/packet.o \ - src/xsocksd_udprelay.o \ - src/xsocksd_client.o \ - src/xsocksd_remote.o \ - src/xsocksd.o + src/xSocksd_udprelay.o \ + src/xSocksd_client.o \ + src/xSocksd_remote.o \ + src/xSocksd.o $(LINK) $^ -o $@ 3rd/c-ares/.libs/libcares.a $(LDFLAGS) endif @@ -249,10 +249,10 @@ XSOCKS_OBJS = \ $(OBJTREE)/src/consumer.o \ $(OBJTREE)/src/cache.o \ $(OBJTREE)/src/packet.o \ - $(OBJTREE)/src/xsocks_udprelay.o \ - $(OBJTREE)/src/xsocks_client.o \ - $(OBJTREE)/src/xsocks_remote.o \ - $(OBJTREE)/src/xsocks.o + $(OBJTREE)/src/xSocks_udprelay.o \ + $(OBJTREE)/src/xSocks_client.o \ + $(OBJTREE)/src/xSocks_remote.o \ + $(OBJTREE)/src/xSocks.o ifdef ANDROID XSOCKS_OBJS += $(OBJTREE)/src/android.o @@ -272,10 +272,10 @@ $(XSOCKS).exe: \ src/consumer.o \ src/cache.o \ src/packet.o \ - src/xsocks_udprelay.o \ - src/xsocks_client.o \ - src/xsocks_remote.o \ - src/xsocks.o + src/xSocks_udprelay.o \ + src/xSocks_client.o \ + src/xSocks_remote.o \ + src/xSocks.o $(LINK) $^ -o $@ $(LDFLAGS) endif @@ -288,10 +288,10 @@ $(XTPROXY): \ $(OBJTREE)/src/daemon.o \ $(OBJTREE)/src/signal.o \ $(OBJTREE)/src/consumer.o \ - $(OBJTREE)/src/xtproxy_udprelay.o \ - $(OBJTREE)/src/xtproxy_client.o \ - $(OBJTREE)/src/xtproxy_remote.o \ - $(OBJTREE)/src/xtproxy.o + $(OBJTREE)/src/xTproxy_udprelay.o \ + $(OBJTREE)/src/xTproxy_client.o \ + $(OBJTREE)/src/xTproxy_remote.o \ + $(OBJTREE)/src/xTproxy.o $(LINK) $^ -o $@ $(LDFLAGS) ifndef MINGW32 @@ -304,10 +304,10 @@ $(XFORWARDER): \ $(OBJTREE)/src/signal.o \ $(OBJTREE)/src/consumer.o \ $(OBJTREE)/src/cache.o \ - $(OBJTREE)/src/xforwarder_udprelay.o \ - $(OBJTREE)/src/xforwarder_client.o \ - $(OBJTREE)/src/xforwarder_remote.o \ - $(OBJTREE)/src/xforwarder.o + $(OBJTREE)/src/xForwarder_udprelay.o \ + $(OBJTREE)/src/xForwarder_client.o \ + $(OBJTREE)/src/xForwarder_remote.o \ + $(OBJTREE)/src/xForwarder.o $(LINK) $^ -o $@ $(LDFLAGS) else $(XFORWARDER).exe: \ @@ -317,10 +317,10 @@ $(XFORWARDER).exe: \ src/packet.o \ src/consumer.o \ src/cache.o \ - src/xforwarder_udprelay.o \ - src/xforwarder_client.o \ - src/xforwarder_remote.o \ - src/xforwarder.o + src/xForwarder_udprelay.o \ + src/xForwarder_client.o \ + src/xForwarder_remote.o \ + src/xForwarder.o $(LINK) $^ -o $@ $(LDFLAGS) endif @@ -333,9 +333,9 @@ $(XTUNNEL): \ $(OBJTREE)/src/daemon.o \ $(OBJTREE)/src/signal.o \ $(OBJTREE)/src/consumer.o \ - $(OBJTREE)/src/xtunnel_source.o \ - $(OBJTREE)/src/xtunnel_target.o \ - $(OBJTREE)/src/xtunnel.o + $(OBJTREE)/src/xTunnel_source.o \ + $(OBJTREE)/src/xTunnel_target.o \ + $(OBJTREE)/src/xTunnel.o $(LINK) $^ -o $@ $(LDFLAGS) else $(XTUNNEL).exe: \ @@ -344,9 +344,9 @@ $(XTUNNEL).exe: \ src/crypto.o \ src/packet.o \ src/consumer.o \ - src/xtunnel_source.o \ - src/xtunnel_target.o \ - src/xtunnel.o + src/xTunnel_source.o \ + src/xTunnel_target.o \ + src/xTunnel.o $(LINK) $^ -o $(OBJTREE)/$@ $(LDFLAGS) endif diff --git a/README.md b/README.md index 32e8ebd..9684f48 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -xsocks +xSocks ================= A secure and fast proxy for protect your network traffic Introdution ------------ -* xsocksd: Backend of xsocks, xtproxy, xforwarder -* xsocks: A socks5 server -* xtproxy: A Transparent Proxy -* xforwarder: Forward data to a specific server -* xtunnel: Like xforwarder, but standalone and specify target on server side +* xSocksd: Backend of xSocks, xTproxy, xForwarder +* xSocks: A socks5 server +* xTproxy: A Transparent Proxy +* xForwarder: Forward data to a specific server +* xTunnel: Like xForwarder, but standalone and specify target on server side Features ------------ * Transparent Proxy for all tcp traffic and udp packet * Multithreading -* Cross-platform, including PC (Linux, [Windows](https://github.com/lparam/xsocks-windows)), Mobile ([Android](https://github.com/lparam/xsocks-android)) and Router (OpenWRT) +* Cross-platform, including PC (Linux, [Windows](https://github.com/lparam/xSocks-windows)), Mobile ([Android](https://github.com/lparam/xSocks-android)) and Router (OpenWRT) BUILD ------------ @@ -29,8 +29,8 @@ make && sudo make install ```bash # At OpenWRT build root -git clone https://github.com/lparam/xsocks.git package/xsocks -make package/xsocks/openwrt/compile +git clone https://github.com/lparam/xSocks.git package/xSocks +make package/xSocks/openwrt/compile ``` ### Windows @@ -48,26 +48,26 @@ Usage ### Server ```bash -xsocksd -k PASSWORD -xtunnel -m server -k PASSWORD -t TARGET:PORT +xSocksd -k PASSWORD +xTunnel -m server -k PASSWORD -t TARGET:PORT ``` Multithreading: ```bash -xsocksd -k PASSWORD -c THREADS +xSocksd -k PASSWORD -c THREADS ``` Stop: ```bash -xsocksd --signal stop +xSocksd --signal stop ``` ### Client ```bash -xsocks -s SERVER:PORT -k PASSWORD -xforwarder -s SERVER:PORT -k PASSWORD -d DESTINATION:PORT -xtunnel -m client -k PASSWORD -t TARGET:PORT +xSocks -s SERVER:PORT -k PASSWORD +xForwarder -s SERVER:PORT -k PASSWORD -d DESTINATION:PORT +xTunnel -m client -k PASSWORD -t TARGET:PORT ``` ### Transparent Proxy @@ -76,10 +76,10 @@ Proxy all tcp traffic and udp packet transparently on gateway. ```bash root@OpenWrt:~# opkg install iptables-mod-tproxy -root@OpenWrt:~# opkg install xsocks_VER_ARCH.ipk +root@OpenWrt:~# opkg install xSocks_VER_ARCH.ipk ``` -Modify your SERVER and PASSWORD in /etc/init.d/xsocks +Modify your SERVER and PASSWORD in /etc/init.d/xSocks ```bash #!/bin/sh /etc/rc.common # Copyright (C) 2006-2014 OpenWrt.org @@ -100,24 +100,24 @@ CHAIN=XSOCKS start() { tproxy_start - mkdir -p /var/run/xsocks - xsocks -s $SERVER -k $PASSWORD - xtproxy -s $SERVER -k $PASSWORD - xforwarder -l 0.0.0.0:5533 -d 8.8.8.8:53 -s $SERVER -k $PASSWORD + mkdir -p /var/run/xSocks + xSocks -s $SERVER -k $PASSWORD + xTproxy -s $SERVER -k $PASSWORD + xForwarder -l 0.0.0.0:5533 -d 8.8.8.8:53 -s $SERVER -k $PASSWORD } stop() { tproxy_stop - xsocks --signal stop - xtproxy --signal stop - xforwarder --signal stop + xSocks --signal stop + xTproxy --signal stop + xForwarder --signal stop } shutdown() { tproxy_stop - xsocks --signal quit - xtproxy --signal quit - xforwarder --signal quit + xSocks --signal quit + xTproxy --signal quit + xForwarder --signal quit } tproxy_start() { @@ -165,7 +165,7 @@ tproxy_stop() { ``` ```bash -root@OpenWrt:~# /etc/init.d/xsocks start +root@OpenWrt:~# /etc/init.d/xSocks start ``` ```bash diff --git a/openwrt/Makefile b/openwrt/Makefile index df506ca..3bba197 100644 --- a/openwrt/Makefile +++ b/openwrt/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=xsocks -PKG_VERSION:=0.4.1 +PKG_NAME:=xSocks +PKG_VERSION:=0.4.2 PKG_RELEASE= PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/lparam/xsocks.git +PKG_SOURCE_URL:=https://github.com/lparam/xSocks.git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=v$(PKG_VERSION) @@ -18,27 +18,27 @@ PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk -define Package/xsocks/Default +define Package/xSocks/Default SECTION:=net CATEGORY:=Network TITLE:=A secure and fast proxy for protect your network traffic - URL:=https://github.com/lparam/xsocks + URL:=https://github.com/lparam/xSocks endef -define Package/xsocks - $(call Package/xsocks/Default) +define Package/xSocks + $(call Package/xSocks/Default) DEPENDS:=+libpthread +librt endef -define Package/xsocks/description - xsocks is a secure and fast proxy for protect your network traffic +define Package/xSocks/description + xSocks is a secure and fast proxy for protect your network traffic endef -define Package/xsocks/install +define Package/xSocks/install $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/xsocks.init $(1)/etc/init.d/xsocks + $(INSTALL_BIN) ./files/xSocks.init $(1)/etc/init.d/xSocks $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/x{socks,tproxy,forwarder,tunnel} $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/x{Socks,Tproxy,Forwarder,Tunnel} $(1)/usr/bin endef -$(eval $(call BuildPackage,xsocks)) +$(eval $(call BuildPackage,xSocks)) diff --git a/openwrt/files/xsocks.init b/openwrt/files/xsocks.init index 7a4e3bb..7c9f3f7 100644 --- a/openwrt/files/xsocks.init +++ b/openwrt/files/xsocks.init @@ -20,26 +20,26 @@ BLACK_LIST=/etc/black_list start() { tproxy_start acl add - mkdir -p /var/run/xsocks - xsocks -s $SERVER -k $PASSWORD - xtproxy -s $SERVER -k $PASSWORD - xforwarder -l 0.0.0.0:5533 -d $DNS:53 -s $SERVER -k $PASSWORD + mkdir -p /var/run/xSocks + xSocks -s $SERVER -k $PASSWORD + xTproxy -s $SERVER -k $PASSWORD + xForwarder -l 0.0.0.0:5533 -d $DNS:53 -s $SERVER -k $PASSWORD } stop() { tproxy_stop acl del - xsocks --signal stop - xtproxy --signal stop - xforwarder --signal stop + xSocks --signal stop + xTproxy --signal stop + xForwarder --signal stop } shutdown() { tproxy_stop acl del - xsocks --signal quit - xtproxy --signal quit - xforwarder --signal quit + xSocks --signal quit + xTproxy --signal quit + xForwarder --signal quit } tproxy_start() { diff --git a/src/android.c b/src/android.c index ecca38d..5935079 100644 --- a/src/android.c +++ b/src/android.c @@ -35,7 +35,7 @@ protect_socket(int fd) { setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)); setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(struct timeval)); - const char path[] = "/data/data/io.github.xsocks/protect_path"; + const char path[] = "/data/data/io.github.xSocks/protect_path"; memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; diff --git a/src/common.c b/src/common.c index 993c826..ea323d4 100644 --- a/src/common.c +++ b/src/common.c @@ -7,7 +7,7 @@ #include "logger.h" int -parse_target_address(const struct xsocks_request *req, struct sockaddr *addr, char *host) { +parse_target_address(const struct xSocks_request *req, struct sockaddr *addr, char *host) { int addrlen; uint16_t portlen = 2; // network byte order port number, 2 bytes union { diff --git a/src/common.h b/src/common.h index f62ba58..4470596 100644 --- a/src/common.h +++ b/src/common.h @@ -4,7 +4,7 @@ #include "uv.h" #include "socks.h" -#define XSOCKS_VERSION "0.4.1" +#define XSOCKS_VERSION "0.4.2" struct server_context { int index; @@ -33,7 +33,7 @@ struct signal_ctx { int signal_process(char *signal, const char *pidfile); void consumer_start(void *arg); -int parse_target_address(const struct xsocks_request *req, struct sockaddr *addr, char *host); +int parse_target_address(const struct xSocks_request *req, struct sockaddr *addr, char *host); void cache_log(uint8_t atyp, const struct sockaddr *src_addr, const struct sockaddr *dst_addr, const char *host, uint16_t port, int hit); int protect_socket(int fd); diff --git a/src/logger.c b/src/logger.c index 8a873c7..591ce65 100644 --- a/src/logger.c +++ b/src/logger.c @@ -89,7 +89,7 @@ logger_log(uint32_t level, const char *msg, ...) { } else { level = ANDROID_LOG_INFO; } - __android_log_print(level, "xsocks", tmp); + __android_log_print(level, "xSocks", tmp); #else time_t curtime = time(NULL); struct tm *loctime = localtime(&curtime); diff --git a/src/socks.h b/src/socks.h index 31d6d48..c31fc8e 100644 --- a/src/socks.h +++ b/src/socks.h @@ -14,7 +14,7 @@ struct socks5_method_response { char method; }; -struct xsocks_request { +struct xSocks_request { char atyp; char addr[0]; }; @@ -47,7 +47,7 @@ enum s5_auth_result { S5_AUTH_DENY = 0x01, }; -enum xsocks_atyp { +enum xSocks_atyp { ATYP_IPV4 = 0x01, ATYP_HOST = 0x03, ATYP_IPV6 = 0x04, diff --git a/src/xforwarder.c b/src/xForwarder.c similarity index 96% rename from src/xforwarder.c rename to src/xForwarder.c index 643e5f1..7fb68d7 100644 --- a/src/xforwarder.c +++ b/src/xForwarder.c @@ -10,14 +10,14 @@ #include "crypto.h" #include "daemon.h" #include "udprelay.h" -#include "xforwarder.h" +#include "xForwarder.h" static int daemon_mode = 1; static int concurrency = 0; static char *local_addr = "0.0.0.0:5533"; static char *server_addr_buf; -static char *pidfile = "/var/run/xsocks/xforwarder.pid"; +static char *pidfile = "/var/run/xSocks/xForwarder.pid"; static char *password = NULL; static char *xsignal; #ifndef _WIN32 @@ -42,7 +42,7 @@ static const struct option _lopts[] = { static void print_usage(const char *prog) { - printf("xforwarder Version: %s Maintained by lparam\n", XFORWARDER_VER); + printf("xForwarder Version: %s Maintained by lparam\n", XFORWARDER_VER); printf("Usage: %s [-l local] <-s server> <-d dest> <-k password> [-p pidfile] [-c concurrency] [-s signal] [-nhvV]\n\n", prog); printf("Options:\n"); puts(" -s \t : server address:port\n" @@ -52,8 +52,8 @@ print_usage(const char *prog) { " [-t ]\t : connection timeout in senconds\n" #ifndef _WIN32 " [-c ]\t : worker threads\n" - " [-p ]\t : pid file path (default: /var/run/xsocks/xforwarder.pid)\n" - " [--signal ]\t : send signal to xforwarder: quit, stop\n" + " [-p ]\t : pid file path (default: /var/run/xSocks/xForwarder.pid)\n" + " [--signal ]\t : send signal to xForwarder: quit, stop\n" " [-n]\t\t\t : non daemon mode\n" #endif " [-h, --help]\t\t : this help\n" @@ -70,7 +70,7 @@ parse_opts(int argc, char *argv[]) { while ((opt = getopt_long(argc, argv, _optString, _lopts, &longindex)) != -1) { switch (opt) { case 'v': - printf("xforwarder version: %s \n", XFORWARDER_VER); + printf("xForwarder version: %s \n", XFORWARDER_VER); exit(0); break; case 'h': @@ -237,7 +237,7 @@ main(int argc, char *argv[]) { return 1; } if (already_running(pidfile)) { - logger_stderr("xforwarder already running."); + logger_stderr("xForwarder already running."); return 1; } } diff --git a/src/xforwarder.h b/src/xForwarder.h similarity index 96% rename from src/xforwarder.h rename to src/xForwarder.h index 020b84c..5fa6c69 100644 --- a/src/xforwarder.h +++ b/src/xForwarder.h @@ -6,7 +6,7 @@ #include "packet.h" -#define XFORWARDER_VER "xforwarder/" XSOCKS_VERSION +#define XFORWARDER_VER "xForwarder/" XSOCKS_VERSION struct client_context { diff --git a/src/xforwarder_client.c b/src/xForwarder_client.c similarity index 99% rename from src/xforwarder_client.c rename to src/xForwarder_client.c index 13aab3f..d31dd0e 100644 --- a/src/xforwarder_client.c +++ b/src/xForwarder_client.c @@ -9,7 +9,7 @@ #include "logger.h" #include "crypto.h" #include "socks.h" -#include "xforwarder.h" +#include "xForwarder.h" static void client_alloc_cb(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf); diff --git a/src/xforwarder_remote.c b/src/xForwarder_remote.c similarity index 96% rename from src/xforwarder_remote.c rename to src/xForwarder_remote.c index 1ad9c2c..00aabb5 100644 --- a/src/xforwarder_remote.c +++ b/src/xForwarder_remote.c @@ -9,7 +9,7 @@ #include "logger.h" #include "crypto.h" #include "socks.h" -#include "xforwarder.h" +#include "xForwarder.h" static void remote_send_cb(uv_write_t *req, int status); @@ -27,7 +27,7 @@ remote_timer_expire(uv_timer_t *handle) { uv_tcp_getpeername(&client->handle.tcp, &peername, &namelen); char addr[INET6_ADDRSTRLEN + 1]; int port = ip_name(&peername, addr, sizeof addr); - logger_log(LOG_WARNING, "%s:%d <-> %s connection timeout", addr, port, dest_addr_buf); + logger_log(LOG_WARNING, "%s:%d <-> %s timeout", addr, port, dest_addr_buf); } close_client(client); close_remote(remote); @@ -148,7 +148,7 @@ request_to_server(struct remote_context *remote) { /* * - * xsocks request + * xSocks request * +------+----------+----------+ * | ATYP | BND.ADDR | BND.PORT | * +------+----------+----------+ @@ -158,14 +158,14 @@ request_to_server(struct remote_context *remote) { */ if (addr->sa_family == AF_INET) { size_t in_addr_len = sizeof(struct in_addr); - buflen = sizeof(struct xsocks_request) + in_addr_len + portlen; + buflen = sizeof(struct xSocks_request) + in_addr_len + portlen; buf[0] = ATYP_IPV4; memcpy(buf + 1, &((struct sockaddr_in *)addr)->sin_addr, in_addr_len); memcpy(buf + 1 + in_addr_len, &((struct sockaddr_in *)addr)->sin_port, portlen); } else { size_t in6_addr_len = sizeof(struct in6_addr); - buflen = sizeof(struct xsocks_request) + sizeof(struct in6_addr) + portlen; + buflen = sizeof(struct xSocks_request) + sizeof(struct in6_addr) + portlen; buf[0] = ATYP_IPV6; memcpy(buf + 1, &((struct sockaddr_in6 *)addr)->sin6_addr, in6_addr_len); memcpy(buf + 1 + in6_addr_len, &((struct sockaddr_in6 *)addr)->sin6_port, portlen); diff --git a/src/xforwarder_udprelay.c b/src/xForwarder_udprelay.c similarity index 99% rename from src/xforwarder_udprelay.c rename to src/xForwarder_udprelay.c index 7a19f17..a2cd1db 100644 --- a/src/xforwarder_udprelay.c +++ b/src/xForwarder_udprelay.c @@ -113,7 +113,7 @@ forward_to_client(struct client_context *client, uint8_t *data, ssize_t len) { /* * - * xsocks UDP Response + * xSocks UDP Response * +------+----------+----------+----------+ * | ATYP | DST.ADDR | DST.PORT | DATA | * +------+----------+----------+----------+ @@ -162,7 +162,7 @@ server_send_cb(uv_udp_send_t *req, int status) { /* * - * xsocks UDP Request + * xSocks UDP Request * +------+----------+----------+----------+ * | ATYP | DST.ADDR | DST.PORT | DATA | * +------+----------+----------+----------+ diff --git a/src/xsocks.c b/src/xSocks.c similarity index 96% rename from src/xsocks.c rename to src/xSocks.c index 0512cba..abe615b 100644 --- a/src/xsocks.c +++ b/src/xSocks.c @@ -15,13 +15,13 @@ #include "crypto.h" #include "daemon.h" #include "udprelay.h" -#include "xsocks.h" +#include "xSocks.h" static int daemon_mode = 1; static int concurrency = 0; static char *local_addr = "0.0.0.0:1080"; static char *server_addr_buf; -static char *pidfile = "/var/run/xsocks/xsocks.pid"; +static char *pidfile = "/var/run/xSocks/xSocks.pid"; static char *password = NULL; static char *acl_file; static char *xsignal; @@ -53,7 +53,7 @@ static const struct option _lopts[] = { static void print_usage(const char *prog) { - printf("xsocks Version: %s Maintained by lparam\n", XSOCKS_VER); + printf("xSocks Version: %s Maintained by lparam\n", XSOCKS_VER); #ifdef _WIN32 printf("Usage: %s [-l local] <-s server> <-k password> [-hvV]\n\n", prog); #else @@ -66,14 +66,14 @@ print_usage(const char *prog) { " [-t ]\t : connection timeout in senconds\n" #ifndef _WIN32 " [-c ]\t : worker threads\n" - " [-p ]\t : pid file path (default: /var/run/xsocks/xsocks.pid)\n" + " [-p ]\t : pid file path (default: /var/run/xSocks/xSocks.pid)\n" #endif " [--acl ]\t : ACL (Access Control List) file path\n" #ifdef ANDROID " [--vpn]\t : protect vpn socket\n" #endif #ifndef _WIN32 - " [--signal ]\t : send signal to xsocks: quit, stop\n" + " [--signal ]\t : send signal to xSocks: quit, stop\n" " [-n]\t\t\t : non daemon mode\n" #endif " [-h, --help]\t\t : this help\n" @@ -90,7 +90,7 @@ parse_opts(int argc, char *argv[]) { while ((opt = getopt_long(argc, argv, _optString, _lopts, &longindex)) != -1) { switch (opt) { case 'v': - printf("xsocks version: %s \n", XSOCKS_VER); + printf("xSocks version: %s \n", XSOCKS_VER); exit(0); break; case 'h': @@ -268,7 +268,7 @@ main(int argc, char *argv[]) { return 1; } if (already_running(pidfile)) { - logger_stderr("xsocks already running."); + logger_stderr("xSocks already running."); return 1; } } diff --git a/src/xsocks.h b/src/xSocks.h similarity index 97% rename from src/xsocks.h rename to src/xSocks.h index 9c67b09..378b153 100644 --- a/src/xsocks.h +++ b/src/xSocks.h @@ -6,7 +6,7 @@ #include "packet.h" -#define XSOCKS_VER "xsocks/" XSOCKS_VERSION +#define XSOCKS_VER "xSocks/" XSOCKS_VERSION struct client_context { diff --git a/src/xsocks_client.c b/src/xSocks_client.c similarity index 98% rename from src/xsocks_client.c rename to src/xSocks_client.c index 0c4a09a..4d65745 100644 --- a/src/xsocks_client.c +++ b/src/xSocks_client.c @@ -11,7 +11,7 @@ #include "crypto.h" #include "common.h" #include "socks.h" -#include "xsocks.h" +#include "xSocks.h" static void client_alloc_cb(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf); @@ -169,7 +169,7 @@ request_start(struct client_context *client, char *req_buf) { /* * - * xsocks request + * xSocks request * +------+----------+----------+ * | ATYP | BND.ADDR | BND.PORT | * +------+----------+----------+ @@ -179,7 +179,7 @@ request_start(struct client_context *client, char *req_buf) { */ if (req->atyp == ATYP_IPV4) { size_t in_addr_len = sizeof(struct in_addr); - buflen = sizeof(struct xsocks_request) + in_addr_len + portlen; + buflen = sizeof(struct xSocks_request) + in_addr_len + portlen; buf[0] = ATYP_IPV4; memcpy(buf + 1, req->addr, in_addr_len); memcpy(buf + 1 + in_addr_len, req->addr + in_addr_len, portlen); @@ -195,7 +195,7 @@ request_start(struct client_context *client, char *req_buf) { request_ack(client, S5_REP_ADDRESS_TYPE_NOT_SUPPORTED); return; } - buflen = sizeof(struct xsocks_request) + 1 + namelen + portlen; + buflen = sizeof(struct xSocks_request) + 1 + namelen + portlen; buf[0] = ATYP_HOST; memcpy(buf + 1, req->addr, 1 + namelen); memcpy(buf + 1 + 1 + namelen, req->addr + 1 + namelen, portlen); @@ -206,7 +206,7 @@ request_start(struct client_context *client, char *req_buf) { } else if (req->atyp == ATYP_IPV6) { size_t in6_addr_len = sizeof(struct in6_addr); - buflen = sizeof(struct xsocks_request) + in6_addr_len + portlen; + buflen = sizeof(struct xSocks_request) + in6_addr_len + portlen; buf[0] = ATYP_IPV6; memcpy(buf + 1, req->addr, in6_addr_len); memcpy(buf + 1 + in6_addr_len, req->addr + in6_addr_len, portlen); diff --git a/src/xsocks_remote.c b/src/xSocks_remote.c similarity index 96% rename from src/xsocks_remote.c rename to src/xSocks_remote.c index f4ac213..630da3c 100644 --- a/src/xsocks_remote.c +++ b/src/xSocks_remote.c @@ -8,7 +8,7 @@ #include "util.h" #include "logger.h" #include "crypto.h" -#include "xsocks.h" +#include "xSocks.h" static void remote_send_cb(uv_write_t *req, int status); @@ -26,9 +26,9 @@ remote_timer_expire(uv_timer_t *handle) { char addrbuf[INET6_ADDRSTRLEN + 1] = {0}; uint16_t port = ip_name(&client->addr, addrbuf, sizeof addrbuf); if (client->stage == XSTAGE_FORWARD) { - logger_log(LOG_WARNING, "%s:%d <-> %s connection timeout", addrbuf, port, client->target_addr); + logger_log(LOG_WARNING, "%s:%d <-> %s timeout", addrbuf, port, client->target_addr); } else { - logger_log(LOG_WARNING, "%s:%d connection timeout", addrbuf, port); + logger_log(LOG_WARNING, "%s:%d timeout", addrbuf, port); } } } diff --git a/src/xsocks_udprelay.c b/src/xSocks_udprelay.c similarity index 98% rename from src/xsocks_udprelay.c rename to src/xSocks_udprelay.c index d37927e..0abcbf3 100644 --- a/src/xsocks_udprelay.c +++ b/src/xSocks_udprelay.c @@ -125,7 +125,7 @@ forward_to_client(struct client_context *client, uint8_t *data, ssize_t len) { /* * - * xsocks UDP Response + * xSocks UDP Response * +------+----------+----------+----------+ * | ATYP | DST.ADDR | DST.PORT | DATA | * +------+----------+----------+----------+ @@ -183,7 +183,7 @@ server_send_cb(uv_udp_send_t *req, int status) { /* * - * xsocks UDP Request + * xSocks UDP Request * +------+----------+----------+----------+ * | ATYP | DST.ADDR | DST.PORT | DATA | * +------+----------+----------+----------+ @@ -227,7 +227,7 @@ client_recv_cb(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struc goto err; } - struct xsocks_request *request = (struct xsocks_request *)(buf->base + 3); + struct xSocks_request *request = (struct xSocks_request *)(buf->base + 3); struct sockaddr dest_addr; char host[256] = {0}; int addrlen = parse_target_address(request, &dest_addr, host); diff --git a/src/xsocksd.c b/src/xSocksd.c similarity index 96% rename from src/xsocksd.c rename to src/xSocksd.c index d27b8e8..fe302a0 100644 --- a/src/xsocksd.c +++ b/src/xSocksd.c @@ -12,7 +12,7 @@ #include "resolver.h" #include "daemon.h" #include "udprelay.h" -#include "xsocksd.h" +#include "xSocksd.h" #define MAX_DNS_NUM 4 @@ -23,7 +23,7 @@ static int nameserver_num; static int udprelay; static char *nameservers[MAX_DNS_NUM + 1]; static char *local_addrbuf = "0.0.0.0:1073"; -static char *pidfile = "/var/run/xsocks/xsocksd.pid"; +static char *pidfile = "/var/run/xSocks/xSocksd.pid"; static char *password; static char *xsignal; #ifndef _WIN32 @@ -48,7 +48,7 @@ static const struct option _lopts[] = { static void print_usage(const char *prog) { - printf("xsocksd Version: %s Maintained by lparam\n", XSOCKSD_VER); + printf("xSocksd Version: %s Maintained by lparam\n", XSOCKSD_VER); printf("Usage: %s [-l bind] <-k password> [-p pidfile] [-c concurrency] [-t timeout] [-s signal] [-nhvV]\n\n", prog); printf("Options:\n"); puts(" -k \t\t : password of server\n" @@ -58,8 +58,8 @@ print_usage(const char *prog) { " [-u]\t\t\t : enable udp relay\n" #ifndef _WIN32 " [-c ]\t : worker threads\n" - " [-p ]\t : pid file path (default: /var/run/xsocks/xsocksd.pid)\n" - " [--signal ]\t : send signal to xsocksd: quit, stop\n" + " [-p ]\t : pid file path (default: /var/run/xSocks/xSocksd.pid)\n" + " [--signal ]\t : send signal to xSocksd: quit, stop\n" " [-n]\t\t\t : non daemon mode\n" #endif " [-h, --help]\t\t : this help\n" @@ -76,7 +76,7 @@ parse_opts(int argc, char *argv[]) { while ((opt = getopt_long(argc, argv, _optString, _lopts, &longindex)) != -1) { switch (opt) { case 'v': - printf("xsocksd version: %s \n", XSOCKSD_VER); + printf("xSocksd version: %s \n", XSOCKSD_VER); exit(0); break; case 'h': @@ -250,7 +250,7 @@ main(int argc, char *argv[]) { return 1; } if (already_running(pidfile)) { - logger_stderr("xsocksd already running."); + logger_stderr("xSocksd already running."); return 1; } } diff --git a/src/xsocksd.h b/src/xSocksd.h similarity index 96% rename from src/xsocksd.h rename to src/xSocksd.h index ce10fb2..450e6ca 100644 --- a/src/xsocksd.h +++ b/src/xSocksd.h @@ -7,7 +7,7 @@ #include "resolver.h" -#define XSOCKSD_VER "xsocksd/" XSOCKS_VERSION +#define XSOCKSD_VER "xSocksd/" XSOCKS_VERSION struct client_context { diff --git a/src/xsocksd_client.c b/src/xSocksd_client.c similarity index 95% rename from src/xsocksd_client.c rename to src/xSocksd_client.c index 62d5b32..6157ce9 100644 --- a/src/xsocksd_client.c +++ b/src/xSocksd_client.c @@ -7,7 +7,7 @@ #include "util.h" #include "logger.h" #include "crypto.h" -#include "xsocksd.h" +#include "xSocksd.h" static void client_alloc_cb(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf); @@ -48,15 +48,15 @@ static int verify_request(uint8_t *buf, ssize_t buflen) { size_t len; static uint16_t portlen = 2; - struct xsocks_request *req = (struct xsocks_request *)buf; + struct xSocks_request *req = (struct xSocks_request *)buf; if (req->atyp == ATYP_IPV4) { - len = sizeof(struct xsocks_request) + sizeof(struct in_addr) + portlen; + len = sizeof(struct xSocks_request) + sizeof(struct in_addr) + portlen; } else if (req->atyp == ATYP_HOST) { uint8_t namelen = *(uint8_t *)(req->addr); - len = sizeof(struct xsocks_request) + 1 + namelen + portlen; + len = sizeof(struct xSocks_request) + 1 + namelen + portlen; } else if (req->atyp == ATYP_IPV6) { - len = sizeof(struct xsocks_request) + sizeof(struct in6_addr) + portlen; + len = sizeof(struct xSocks_request) + sizeof(struct in6_addr) + portlen; } else { logger_log(LOG_ERR, "unsupported address type: 0x%02x", req->atyp); len = 0; @@ -66,7 +66,7 @@ verify_request(uint8_t *buf, ssize_t buflen) { } static int -analyse_request_addr(struct xsocks_request *req, struct sockaddr *dest, char *dest_buf, char *host) { +analyse_request_addr(struct xSocks_request *req, struct sockaddr *dest, char *dest_buf, char *host) { union { struct sockaddr addr; struct sockaddr_in addr4; @@ -145,7 +145,7 @@ request_start(struct client_context *client) { char host[256] = {0}; uint16_t *portbuf; // avoid Wstrict-aliasing struct remote_context *remote = client->remote; - struct xsocks_request *request = (struct xsocks_request *)client->packet.buf; + struct xSocks_request *request = (struct xSocks_request *)client->packet.buf; int addrlen = analyse_request_addr(request, &remote->addr, client->target_addr, host); if (addrlen < 1) { diff --git a/src/xsocksd_remote.c b/src/xSocksd_remote.c similarity index 96% rename from src/xsocksd_remote.c rename to src/xSocksd_remote.c index 9613a0f..e3e65f9 100644 --- a/src/xsocksd_remote.c +++ b/src/xSocksd_remote.c @@ -9,7 +9,7 @@ #include "util.h" #include "logger.h" #include "crypto.h" -#include "xsocksd.h" +#include "xSocksd.h" static void remote_send_cb(uv_write_t *req, int status); @@ -24,9 +24,9 @@ remote_timer_expire(uv_timer_t *handle) { char addrbuf[INET6_ADDRSTRLEN + 1] = {0}; uint16_t port = ip_name(&client->addr, addrbuf, sizeof addrbuf); if (client->stage < XSTAGE_FORWARD) { - logger_log(LOG_WARNING, "%s:%d connection timeout", addrbuf, port); + logger_log(LOG_WARNING, "%s:%d timeout", addrbuf, port); } else { - logger_log(LOG_WARNING, "%s:%d <-> %s connection timeout", addrbuf, port, client->target_addr); + logger_log(LOG_WARNING, "%s:%d <-> %s timeout", addrbuf, port, client->target_addr); } } close_client(remote->client); diff --git a/src/xsocksd_udprelay.c b/src/xSocksd_udprelay.c similarity index 98% rename from src/xsocksd_udprelay.c rename to src/xSocksd_udprelay.c index 36f4566..392a675 100644 --- a/src/xsocksd_udprelay.c +++ b/src/xSocksd_udprelay.c @@ -128,7 +128,7 @@ target_recv_cb(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struc /* * - * xsocks UDP Response + * xSocks UDP Response * +------+----------+----------+----------+ * | ATYP | DST.ADDR | DST.PORT | DATA | * +------+----------+----------+----------+ @@ -222,7 +222,7 @@ resolve_target(struct target_context *target, char *host, uint16_t port) { /* * - * xsocks UDP Request + * xSocks UDP Request * +------+----------+----------+----------+ * | ATYP | DST.ADDR | DST.PORT | DATA | * +------+----------+----------+----------+ @@ -243,7 +243,7 @@ client_recv_cb(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struc char host[256] = {0}; struct sockaddr dest_addr; - struct xsocks_request *request = (struct xsocks_request *)m; + struct xSocks_request *request = (struct xSocks_request *)m; int addrlen = parse_target_address(request, &dest_addr, host); if (addrlen < 1) { logger_log(LOG_ERR, "unsupported address type: 0x%02x", request->atyp); @@ -290,7 +290,7 @@ client_recv_cb(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struc /* * - * xsocks UDP Request + * xSocks UDP Request * +------+----------+----------+----------+ * | ATYP | DST.ADDR | DST.PORT | DATA | * +------+----------+----------+----------+ diff --git a/src/xtproxy.c b/src/xTproxy.c similarity index 95% rename from src/xtproxy.c rename to src/xTproxy.c index 9504505..f09ce5a 100644 --- a/src/xtproxy.c +++ b/src/xTproxy.c @@ -11,14 +11,14 @@ #include "crypto.h" #include "daemon.h" #include "udprelay.h" -#include "xtproxy.h" +#include "xTproxy.h" static int daemon_mode = 1; static int concurrency = 0; static char *local_addrbuf = "0.0.0.0:1070"; static char *server_addrbuf; -static char *pidfile = "/var/run/xsocks/xtproxy.pid"; +static char *pidfile = "/var/run/xSocks/xTproxy.pid"; static char *password = NULL; static char *xsignal; static struct signal_ctx signals[3]; @@ -42,7 +42,7 @@ static const struct option _lopts[] = { static void print_usage(const char *prog) { - printf("xtproxy Version: %s Maintained by lparam\n", XTPROXY_VER); + printf("xTproxy Version: %s Maintained by lparam\n", XTPROXY_VER); printf("Usage: %s <-l local> <-s server> <-k password> [-p pidfile] [-c concurrency] [-nhvV]\n\n", prog); printf("Options:\n"); puts(" -h, --help\t\t : this help\n" @@ -50,9 +50,9 @@ print_usage(const char *prog) { " -s \t : server address:port\n" " -k \t\t : password of server\n" " -c \t : worker threads\n" - " -p \t\t : pid file path (default: /var/run/xsocks/xtproxy.pid)\n" + " -p \t\t : pid file path (default: /var/run/xSocks/xTproxy.pid)\n" " -t \t\t : connection timeout in senconds\n" - " [--signal ]\t : send signal to xtproxy: quit, stop\n" + " [--signal ]\t : send signal to xTproxy: quit, stop\n" " -n\t\t\t : non daemon mode\n" " -v, --version\t\t : show version\n" " -V \t\t\t : verbose mode\n"); @@ -67,7 +67,7 @@ parse_opts(int argc, char *argv[]) { while ((opt = getopt_long(argc, argv, _optString, _lopts, &longindex)) != -1) { switch (opt) { case 'v': - printf("xtproxy version: %s \n", XTPROXY_VER); + printf("xTproxy version: %s \n", XTPROXY_VER); exit(0); break; case 'h': @@ -221,7 +221,7 @@ main(int argc, char *argv[]) { return 1; } if (already_running(pidfile)) { - logger_stderr("xtproxy already running."); + logger_stderr("xTproxy already running."); return 1; } } diff --git a/src/xtproxy.h b/src/xTproxy.h similarity index 96% rename from src/xtproxy.h rename to src/xTproxy.h index ea40b96..efdba6a 100644 --- a/src/xtproxy.h +++ b/src/xTproxy.h @@ -7,7 +7,7 @@ #include "packet.h" -#define XTPROXY_VER "xtproxy/" XSOCKS_VERSION +#define XTPROXY_VER "xTproxy/" XSOCKS_VERSION struct client_context { diff --git a/src/xtproxy_client.c b/src/xTproxy_client.c similarity index 99% rename from src/xtproxy_client.c rename to src/xTproxy_client.c index 65925cf..31f48bb 100644 --- a/src/xtproxy_client.c +++ b/src/xTproxy_client.c @@ -14,7 +14,7 @@ #include "common.h" #include "crypto.h" #include "socks.h" -#include "xtproxy.h" +#include "xTproxy.h" #define SO_ORIGINAL_DST_IPV6 80 diff --git a/src/xtproxy_remote.c b/src/xTproxy_remote.c similarity index 96% rename from src/xtproxy_remote.c rename to src/xTproxy_remote.c index 023b62d..fe18104 100644 --- a/src/xtproxy_remote.c +++ b/src/xTproxy_remote.c @@ -9,7 +9,7 @@ #include "logger.h" #include "crypto.h" #include "socks.h" -#include "xtproxy.h" +#include "xTproxy.h" static void remote_send_cb(uv_write_t *req, int status); @@ -29,7 +29,7 @@ remote_timer_expire(uv_timer_t *handle) { char addr2[INET6_ADDRSTRLEN + 1]; int p1 = ip_name(&peername, addr1, sizeof addr2); int p2 = ip_name(&client->target_addr, addr2, sizeof(addr2)); - logger_log(LOG_WARNING, "%s:%d <-> %s:%d connection timeout", addr1, p1, addr2, p2); + logger_log(LOG_WARNING, "%s:%d <-> %s:%d timeout", addr1, p1, addr2, p2); } close_client(client); close_remote(remote); @@ -146,7 +146,7 @@ request_to_server(struct remote_context *remote) { /* * - * xsocks request + * xSocks request * +------+----------+----------+ * | ATYP | BND.ADDR | BND.PORT | * +------+----------+----------+ @@ -156,13 +156,13 @@ request_to_server(struct remote_context *remote) { */ if (client->target_addr.sa_family == AF_INET) { size_t in_addr_len = sizeof(struct in_addr); - buflen = sizeof(struct xsocks_request) + in_addr_len + portlen; + buflen = sizeof(struct xSocks_request) + in_addr_len + portlen; buf[0] = ATYP_IPV4; memcpy(buf + 1, &((struct sockaddr_in *)&(client->target_addr))->sin_addr, in_addr_len); memcpy(buf + 1 + in_addr_len, &((struct sockaddr_in *)&(client->target_addr))->sin_port, portlen); } else { size_t in6_addr_len = sizeof(struct in6_addr); - buflen = sizeof(struct xsocks_request) + sizeof(struct in6_addr) + portlen; + buflen = sizeof(struct xSocks_request) + sizeof(struct in6_addr) + portlen; buf[0] = ATYP_IPV6; memcpy(buf + 1, &((struct sockaddr_in6 *)&(client->target_addr))->sin6_addr, in6_addr_len); memcpy(buf + 1 + in6_addr_len, &((struct sockaddr_in6 *)&(client->target_addr))->sin6_port, portlen); diff --git a/src/xtproxy_udprelay.c b/src/xTproxy_udprelay.c similarity index 99% rename from src/xtproxy_udprelay.c rename to src/xTproxy_udprelay.c index 63a0188..f87b9eb 100644 --- a/src/xtproxy_udprelay.c +++ b/src/xTproxy_udprelay.c @@ -133,7 +133,7 @@ server_recv_cb(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struc /* * - * xsocks UDP Response + * xSocks UDP Response * +------+----------+----------+----------+ * | ATYP | DST.ADDR | DST.PORT | DATA | * +------+----------+----------+----------+ @@ -290,7 +290,7 @@ poll_cb(uv_poll_t *watcher, int status, int events) { /* * - * xsocks UDP Request + * xSocks UDP Request * +------+----------+----------+----------+ * | ATYP | DST.ADDR | DST.PORT | DATA | * +------+----------+----------+----------+ diff --git a/src/xtunnel.c b/src/xTunnel.c similarity index 95% rename from src/xtunnel.c rename to src/xTunnel.c index 4c8f125..2d6a165 100644 --- a/src/xtunnel.c +++ b/src/xTunnel.c @@ -10,7 +10,7 @@ #include "common.h" #include "crypto.h" #include "daemon.h" -#include "xtunnel.h" +#include "xTunnel.h" static int daemon_mode = 1; @@ -19,7 +19,7 @@ static char *tunnel_mode; static char *source_addr = "0.0.0.0:1222"; static char *dest_addr; static char *password = NULL; -static char *pidfile = "/var/run/xsocks/xtunnel.pid"; +static char *pidfile = "/var/run/xSocks/xTunnel.pid"; static char *xsignal; #ifndef _WIN32 static struct signal_ctx signals[3]; @@ -43,7 +43,7 @@ static const struct option _lopts[] = { static void print_usage(const char *prog) { - printf("xtunnel Version: %s Maintained by lparam\n", TUNNEL_VER); + printf("xTunnel Version: %s Maintained by lparam\n", TUNNEL_VER); printf("Usage: %s <-m mode> <-l local> <-t target> <-k password>\n", prog); printf("\t[-c concurrency] [-p pidfile] [-nVhv]\n\n"); printf("Options:\n"); @@ -53,9 +53,9 @@ print_usage(const char *prog) { " -t \t\t : target address:port\n" " -k \t\t : password of server\n" #ifndef _WIN32 - " [-p pidfile]\t\t : pid file path (default: /var/run/xsocks/xtunnel.pid)\n" + " [-p pidfile]\t\t : pid file path (default: /var/run/xSocks/xTunnel.pid)\n" " [-c concurrency]\t : worker threads\n" - " [--signal ]\t : send signal to xtunnel: quit, stop\n" + " [--signal ]\t : send signal to xTunnel: quit, stop\n" " [-n]\t\t\t : non daemon mode\n" #endif " [-V] \t\t\t : verbose mode\n" @@ -72,7 +72,7 @@ parse_opts(int argc, char *argv[]) { while ((opt = getopt_long(argc, argv, _optString, _lopts, &longindex)) != -1) { switch (opt) { case 'v': - printf("xtunnel version: %s \n", TUNNEL_VER); + printf("xTunnel version: %s \n", TUNNEL_VER); exit(0); break; case 'h': @@ -237,7 +237,7 @@ main(int argc, char *argv[]) { return 1; } if (already_running(pidfile)) { - logger_stderr("xtunnel already running."); + logger_stderr("xTunnel already running."); return 1; } } diff --git a/src/xtunnel.h b/src/xTunnel.h similarity index 96% rename from src/xtunnel.h rename to src/xTunnel.h index a429069..ff1305f 100644 --- a/src/xtunnel.h +++ b/src/xTunnel.h @@ -6,7 +6,7 @@ #include "packet.h" -#define TUNNEL_VER "xtunnel/" XSOCKS_VERSION +#define TUNNEL_VER "xTunnel/" XSOCKS_VERSION struct source_context { diff --git a/src/xtunnel_source.c b/src/xTunnel_source.c similarity index 99% rename from src/xtunnel_source.c rename to src/xTunnel_source.c index 07e7f98..fe030eb 100644 --- a/src/xtunnel_source.c +++ b/src/xTunnel_source.c @@ -7,7 +7,7 @@ #include "util.h" #include "logger.h" #include "crypto.h" -#include "xtunnel.h" +#include "xTunnel.h" struct source_context * diff --git a/src/xtunnel_target.c b/src/xTunnel_target.c similarity index 99% rename from src/xtunnel_target.c rename to src/xTunnel_target.c index eee0f96..b0ba2e9 100644 --- a/src/xtunnel_target.c +++ b/src/xTunnel_target.c @@ -7,7 +7,7 @@ #include "util.h" #include "logger.h" #include "crypto.h" -#include "xtunnel.h" +#include "xTunnel.h" struct target_context *