Giter VIP home page Giter VIP logo

ip2socks's Introduction

ip2socks

Support operating system

  • OSX
  • Linux

Get start

git clone https://github.com/FlowerWrong/ip2socks.git --recursive

# ubuntu vm
vagrant up --provider virtualbox
vagrant ssh

Compile with C++ 11 and cmake

# build ip2socks
cmake .
make


## start ip2socks
# OSX
sudo ./ip2socks --config=./scripts/config.darwin.example.yml

# linux
sudo ./ip2socks --config=./scripts/config.linux.example.yml

ip mode

  • tun
  • tap

dns mode

  • tcp: just dns with port you set local_dns_port redirect to tcp, other flow will be try to send to remote via socks 5 udp tunnel
  • udp: just dns with port you set local_dns_port redirect to udp, other flow will be send to remote via socks 5 udp tunnel

There are 5 ways to setup DNS query to remote

  • use-vc in /etc/resolv.conf: Sets RES_USEVC in _res.options. This option forces the use of TCP for DNS resolutions.
  • pdnsd
  • lwip udp hooked, redirect to upstream tcp dns server via socks 5, config with remote_dns_server, you can just route your dns servers to tun or tap with route on OSX or ip route on Linux
  • lwip udp hooked, redirect to upstream tcp dns server via socks 5, config with remote_dns_server, setup your dns to addr, eg 10.0.0.2
  • lwip udp hooked, set you dns to remote, eg: 8.8.8.8

Library

Know bugs

  • too many CLOSE_WAIT to socks server, see netstat -an | grep CLOSE_WAIT | wc -l
  • OSX receive data too often, eg: brew update, brew upgrade
  • if ERR_QUIC_PROTOCOL_ERROR, go to chrome://flags/ disable quic
  • ns_initparse Message too long bug
  • (libev) select: Invalid argument
  • tcp_raw_error is -14(ERR_RST): Connection reset.

TODO

  • speed statistics
  • DNS cache
  • block rule support, just close it
  • dnsmasq address=/test.com/127.0.0.1 support
  • domain, domain_keyword, domain_suffix (ip_cidr, geoip) rule support
  • timeout
  • log
  • OSX route batch insert
  • lwip keep-alive support
  • lwip SO_REUSEADDR support
  • TCP fast open with Linux kernel > 3.7.0
  • socks 5 client UDP relay
  • FreeBSD support
  • Android support
  • iOS support
  • ipv6 support

ip2socks's People

Contributors

flowerwrong avatar sbilly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ip2socks's Issues

作者你好,请教你个问题

  1. 我想问下ip2socks 和 tun2socks的区别是啥,两个都处理的是IP流对吗,区别难道是ip2sock支持tun和tap两种方式。
  2. git clone [email protected]:FlowerWrong/ip2socks.git --recursive 提示没有权限,麻烦授予下权限。
  3. 这个批量添加路由是什么原理,这里面添加批量的这个route的源码有吗。

TAP/TUN 代码是否能独立出来呢?

你好,我正在尝试写一个 tun2ssh 的项目,大概就是 转发 TAP 的数据包至 TUN 设备,然后把 TUN 设备中的 TCP/UDP 数据包 通过 SSH 通道放在远程服务器执行,并传回。

项目目标旨在提高易用性,减少配置。争取做到 一行命令解决所有问题:

tun2ssh --ssh_host "20.202.20.20" --ssh_name "root" --ssh_password "impasswd!"
tun2ssh --ssh_host "20.202.20.20" --ssh_name "root" --ssh_pri_key "~/.ssh/my_pri_key"

由于刚开始,对 TAP/TUN 这块还不太熟悉,也不懂 C/C++ =_= ,项目目前是 采用 rust 写的。如果您能 把 TAP/TUN 这块代码拆分开来,提供 C 接口,那将会极大地加速 tun2ssh 项目的开发进度。

非常希望得到你的帮助。

mac 编译报错

你好, mac下编译报错, 请问是什么原因
/Users/ip2socks/ip2socks-by-FlowerWrong/lwip-contrib/ports/unix/port/include/arch/cc.h:76:9: warning: 'LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS' macro
redefined [-Wmacro-redefined]
#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
^
/Users/ip2socks/ip2socks-by-FlowerWrong/src/lwipopts.h:487:9: note: previous definition is here
#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS 0
^
/Users/ip2socks/ip2socks-by-FlowerWrong/src/netif/tunif.c:100:28: error: implicit declaration of function 'writev' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
return utun_modified_len(writev(fd, iv, 2));
^
/Users/ip2socks/ip2socks-by-FlowerWrong/src/netif/tunif.c:100:28: note: did you mean 'write'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/unistd.h:496:10: note: 'write' declared here
ssize_t write(int __fd, const void * __buf, size_t __nbyte) __DARWIN_ALIAS_C(write);
^
/Users/ip2socks/ip2socks-by-FlowerWrong/src/netif/tunif.c:112:28: error: implicit declaration of function 'readv' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
return utun_modified_len(readv(fd, iv, 2));
^
/Users/ip2socks/ip2socks-by-FlowerWrong/src/netif/tunif.c:112:28: note: did you mean 'read'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/unistd.h:472:10: note: 'read' declared here
ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read);
^
1 warning and 2 errors generated.
make[2]: *** [CMakeFiles/ip2socks.dir/src/netif/tunif.c.o] Error 1
make[1]: *** [CMakeFiles/ip2socks.dir/all] Error 2
make: *** [all] Error 2

为什么 ntp 不能正常工作?

我删除了 china_ip_list.txt 文件,强制所有的请求都走 socks 代理。curl 已经可以正常访问 google.com,dns 是可以正常工作的,但使用 udp 协议的 ntp 却不工作。

我希望 udp 协议都能正常使用,ntp 只是我用来测试的工具。

# ./ip2socks --config=./scripts/config.linux.example.yml
Lwip netstack host 10.0.0.2 mask 255.255.255.0 gateway 10.0.0.1
Open tun device: tun0 for reading...
tun name is tun0
exec setup shell sh ./scripts/linux_setup_tuntap.sh 10.0.0.1
origin gateway is '192.168.158.2'
grep: ./scripts/china_ip_list/china_ip_list.txt: No such file or directory
Ip2socks started!

# # ip route
0.0.0.0/1 via 10.0.0.1 dev tun0
default via 192.168.158.2 dev ens33 proto dhcp src 192.168.158.221 metric 100
10.0.0.0/24 dev tun0 proto kernel scope link src 10.0.0.1
10.147.18.0/24 dev ens39 proto kernel scope link src 10.147.18.80
114.114.114.114 via 192.168.158.2 dev ens33
128.0.0.0/1 via 10.0.0.1 dev tun0
172.16.196.0/24 dev ens38 proto kernel scope link src 172.16.196.129
192.168.158.0/24 dev ens33 proto kernel scope link src 192.168.158.221
192.168.158.2 dev ens33 proto dhcp scope link src 192.168.158.221 metric 100
223.5.5.5 via 192.168.158.2 dev ens33
MY_VPS_IP via 192.168.158.2 dev ens33

# ping www.google.com
PING www.google.com (172.217.31.228) 56(84) bytes of data.
64 bytes from 172.217.31.228 (172.217.31.228): icmp_seq=1 ttl=255 time=0.102 ms
^C
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.102/0.102/0.102/0.000 ms

# curl www.google.com -I
HTTP/1.1 200 OK
Date: Wed, 13 Feb 2019 04:25:35 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: 1P_JAR=2019-02-13-04; expires=Fri, 15-Mar-2019 04:25:35 GMT; path=/; domain=.google.com
Set-Cookie: NID=158=Y3GKV2a22KTK3rrwCO3x-C-cJqZGaQZlz_t3_PWc5nMyqSo5g5OFuUbj1YUw8QI5vtHABT619xL-YX2lQjhQgFM_auNDko3VHA2NFRpbgg5P5LdQ03j0c5hD0jp9ygM4mlc7CrvuvGGaJC5TgqCenBcmy1QYreZbfkyDwV0aDoA; expires=Thu, 15-Aug-2019 04:25:35 GMT; path=/; domain=.google.com; HttpOnly
Transfer-Encoding: chunked
Accept-Ranges: none
Vary: Accept-Encoding

# ntpdate time.windows.com

# tcpdump -i tun0  -n udp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun0, link-type RAW (Raw IP), capture size 262144 bytes
04:18:15.060450 IP 10.0.0.1.123 > 52.173.193.166.123: NTPv4, Client, length 48
04:18:17.059996 IP 10.0.0.1.123 > 52.173.193.166.123: NTPv4, Client, length 48
04:18:19.061079 IP 10.0.0.1.123 > 52.173.193.166.123: NTPv4, Client, length 48
04:18:21.059810 IP 10.0.0.1.123 > 52.173.193.166.123: NTPv4, Client, length 48

@FlowerWrong 多谢啦

Help Plz!

Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

[ 95%] Building CXX object CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o
In file included from /root/ip2socks/src/udp_raw.cpp:14:0:
/usr/include/netinet/in.h:376:78: error: declaration of ‘uint32_t lwip_htonl(uint32_t) throw ()’ has a different exception specifier
extern uint32_t ntohl (uint32_t __netlong) __THROW attribute ((const));
^
In file included from /root/ip2socks/lwip/src/include/lwip/ip_addr.h:41:0,
from /root/ip2socks/lwip/src/include/lwip/netif.h:46,
from /root/ip2socks/lwip/src/include/lwip/udp.h:46,
from /root/ip2socks/src/udp_raw.cpp:9:
/root/ip2socks/lwip/src/include/lwip/def.h:101:7: error: from previous declaration ‘u32_t lwip_htonl(u32_t)’
u32_t lwip_htonl(u32_t x);
^
In file included from /root/ip2socks/src/udp_raw.cpp:14:0:
/usr/include/netinet/in.h:378:40: error: declaration of ‘uint16_t lwip_htons(uint16_t) throw ()’ has a different exception specifier
__THROW attribute ((const));
^
In file included from /root/ip2socks/lwip/src/include/lwip/ip_addr.h:41:0,
from /root/ip2socks/lwip/src/include/lwip/netif.h:46,
from /root/ip2socks/lwip/src/include/lwip/udp.h:46,
from /root/ip2socks/src/udp_raw.cpp:9:
/root/ip2socks/lwip/src/include/lwip/def.h:96:7: error: from previous declaration ‘u16_t lwip_htons(u16_t)’
u16_t lwip_htons(u16_t x);
^
In file included from /root/ip2socks/src/udp_raw.cpp:14:0:
/usr/include/netinet/in.h:380:40: error: declaration of ‘uint32_t lwip_htonl(uint32_t) throw ()’ has a different exception specifier
__THROW attribute ((const));
^
In file included from /root/ip2socks/lwip/src/include/lwip/ip_addr.h:41:0,
from /root/ip2socks/lwip/src/include/lwip/netif.h:46,
from /root/ip2socks/lwip/src/include/lwip/udp.h:46,
from /root/ip2socks/src/udp_raw.cpp:9:
/root/ip2socks/lwip/src/include/lwip/def.h:103:23: error: from previous declaration ‘uint32_t lwip_htonl(uint32_t)’
#define lwip_ntohl(x) lwip_htonl(x)
^
In file included from /root/ip2socks/src/udp_raw.cpp:14:0:
/usr/include/netinet/in.h:382:40: error: declaration of ‘uint16_t lwip_htons(uint16_t) throw ()’ has a different exception specifier
__THROW attribute ((const));
^
In file included from /root/ip2socks/lwip/src/include/lwip/ip_addr.h:41:0,
from /root/ip2socks/lwip/src/include/lwip/netif.h:46,
from /root/ip2socks/lwip/src/include/lwip/udp.h:46,
from /root/ip2socks/src/udp_raw.cpp:9:
/root/ip2socks/lwip/src/include/lwip/def.h:98:23: error: from previous declaration ‘uint16_t lwip_htons(uint16_t)’
#define lwip_ntohs(x) lwip_htons(x)
^
/root/ip2socks/src/udp_raw.cpp: In function ‘void udp_raw_recv(void*, udp_pcb*, pbuf*, const ip_addr_t*, u16_t)’:
/root/ip2socks/src/udp_raw.cpp:211:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("tcp", conf->dns_mode) == 0 && upcb->remote_fake_port == 53) {
^
/root/ip2socks/src/udp_raw.cpp:305:39: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
sprintf(dns_port, "%d", upcb->remote_fake_port);
^
/root/ip2socks/src/udp_raw.cpp:350:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:424:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:482:32: error: ‘struct udp_pcb’ has no member named ‘remote_fake_ip’
inet_ntop(AF_INET, &(upcb->remote_fake_ip), remote_fake_ip_str, INET_ADDRSTRLEN);
^
/root/ip2socks/src/udp_raw.cpp:484:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:496:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:499:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
/root/ip2socks/src/udp_raw.cpp:538:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:546:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:549:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
CMakeFiles/ip2socks.dir/build.make:1550: recipe for target 'CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o' failed
make[2]: *** [CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ip2socks.dir/all' failed
make[1]: *** [CMakeFiles/ip2socks.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
root@mailsys89:/ip2socks#
In file included from /root/ip2socks/src/udp_raw.cpp:14:0:
/usr/include/netinet/in.h:382:40: error: declaration of ‘uint16_t lwip_htons(uint16_t) throw ()’ has a different exception specifier
__THROW attribute ((const));
^
In file included from /root/ip2socks/lwip/src/include/lwip/ip_addr.h:41:0,
from /root/ip2socks/lwip/src/include/lwip/netif.h:46,
from /root/ip2socks/lwip/src/include/lwip/udp.h:46,
from /root/ip2socks/src/udp_raw.cpp:9:
/root/ip2socks/lwip/src/include/lwip/def.h:98:23: error: from previous declaration ‘uint16_t lwip_htons(uint16_t)’
#define lwip_ntohs(x) lwip_htons(x)
^
/root/ip2socks/src/udp_raw.cpp: In function ‘void udp_raw_recv(void*, udp_pcb*, pbuf*, const ip_addr_t*, u16_t)’:
/root/ip2socks/src/udp_raw.cpp:211:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("tcp", conf->dns_mode) == 0 && upcb->remote_fake_port == 53) {
^
/root/ip2socks/src/udp_raw.cpp:305:39: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
sprintf(dns_port, "%d", upcb->remote_fake_port);
^
/root/ip2socks/src/udp_raw.cpp:350:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:424:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:482:32: error: ‘struct udp_pcb’ has no member named ‘remote_fake_ip’
inet_ntop(AF_INET, &(upcb->remote_fake_ip), remote_fake_ip_str, INET_ADDRSTRLEN);
^
/root/ip2socks/src/udp_raw.cpp:484:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:496:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:499:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
/root/ip2socks/src/udp_raw.cpp:538:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:546:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:549:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
CMakeFiles/ip2socks.dir/build.make:1550: recipe for target 'CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o' failed
make[2]: *** [CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ip2socks.dir/all' failed
make[1]: *** [CMakeFiles/ip2socks.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
root@mailsys89:
/ip2socks#
In file included from /root/ip2socks/src/udp_raw.cpp:14:0:
/usr/include/netinet/in.h:382:40: error: declaration of ‘uint16_t lwip_htons(uint16_t) throw ()’ has a different exception specifier
__THROW attribute ((const));
^
In file included from /root/ip2socks/lwip/src/include/lwip/ip_addr.h:41:0,
from /root/ip2socks/lwip/src/include/lwip/netif.h:46,
from /root/ip2socks/lwip/src/include/lwip/udp.h:46,
from /root/ip2socks/src/udp_raw.cpp:9:
/root/ip2socks/lwip/src/include/lwip/def.h:98:23: error: from previous declaration ‘uint16_t lwip_htons(uint16_t)’
#define lwip_ntohs(x) lwip_htons(x)
^
/root/ip2socks/src/udp_raw.cpp: In function ‘void udp_raw_recv(void*, udp_pcb*, pbuf*, const ip_addr_t*, u16_t)’:
/root/ip2socks/src/udp_raw.cpp:211:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("tcp", conf->dns_mode) == 0 && upcb->remote_fake_port == 53) {
^
/root/ip2socks/src/udp_raw.cpp:305:39: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
sprintf(dns_port, "%d", upcb->remote_fake_port);
^
/root/ip2socks/src/udp_raw.cpp:350:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:424:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:482:32: error: ‘struct udp_pcb’ has no member named ‘remote_fake_ip’
inet_ntop(AF_INET, &(upcb->remote_fake_ip), remote_fake_ip_str, INET_ADDRSTRLEN);
^
/root/ip2socks/src/udp_raw.cpp:484:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:496:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:499:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
/root/ip2socks/src/udp_raw.cpp:538:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:546:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:549:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
CMakeFiles/ip2socks.dir/build.make:1550: recipe for target 'CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o' failed
make[2]: *** [CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ip2socks.dir/all' failed
make[1]: *** [CMakeFiles/ip2socks.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
root@mailsys89:/ip2socks#
In file included from /root/ip2socks/src/udp_raw.cpp:14:0:
/usr/include/netinet/in.h:382:40: error: declaration of ‘uint16_t lwip_htons(uint16_t) throw ()’ has a different exception specifier
__THROW attribute ((const));
^
In file included from /root/ip2socks/lwip/src/include/lwip/ip_addr.h:41:0,
from /root/ip2socks/lwip/src/include/lwip/netif.h:46,
from /root/ip2socks/lwip/src/include/lwip/udp.h:46,
from /root/ip2socks/src/udp_raw.cpp:9:
/root/ip2socks/lwip/src/include/lwip/def.h:98:23: error: from previous declaration ‘uint16_t lwip_htons(uint16_t)’
#define lwip_ntohs(x) lwip_htons(x)
^
/root/ip2socks/src/udp_raw.cpp: In function ‘void udp_raw_recv(void*, udp_pcb*, pbuf*, const ip_addr_t*, u16_t)’:
/root/ip2socks/src/udp_raw.cpp:211:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("tcp", conf->dns_mode) == 0 && upcb->remote_fake_port == 53) {
^
/root/ip2socks/src/udp_raw.cpp:305:39: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
sprintf(dns_port, "%d", upcb->remote_fake_port);
^
/root/ip2socks/src/udp_raw.cpp:350:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:424:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:482:32: error: ‘struct udp_pcb’ has no member named ‘remote_fake_ip’
inet_ntop(AF_INET, &(upcb->remote_fake_ip), remote_fake_ip_str, INET_ADDRSTRLEN);
^
/root/ip2socks/src/udp_raw.cpp:484:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:496:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:499:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
/root/ip2socks/src/udp_raw.cpp:538:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:546:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:549:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
CMakeFiles/ip2socks.dir/build.make:1550: recipe for target 'CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o' failed
make[2]: *** [CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ip2socks.dir/all' failed
make[1]: *** [CMakeFiles/ip2socks.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
root@mailsys89:
/ip2socks#
In file included from /root/ip2socks/src/udp_raw.cpp:14:0:
/usr/include/netinet/in.h:382:40: error: declaration of ‘uint16_t lwip_htons(uint16_t) throw ()’ has a different exception specifier
__THROW attribute ((const));
^
In file included from /root/ip2socks/lwip/src/include/lwip/ip_addr.h:41:0,
from /root/ip2socks/lwip/src/include/lwip/netif.h:46,
from /root/ip2socks/lwip/src/include/lwip/udp.h:46,
from /root/ip2socks/src/udp_raw.cpp:9:
/root/ip2socks/lwip/src/include/lwip/def.h:98:23: error: from previous declaration ‘uint16_t lwip_htons(uint16_t)’
#define lwip_ntohs(x) lwip_htons(x)
^
/root/ip2socks/src/udp_raw.cpp: In function ‘void udp_raw_recv(void*, udp_pcb*, pbuf*, const ip_addr_t*, u16_t)’:
/root/ip2socks/src/udp_raw.cpp:211:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("tcp", conf->dns_mode) == 0 && upcb->remote_fake_port == 53) {
^
/root/ip2socks/src/udp_raw.cpp:305:39: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
sprintf(dns_port, "%d", upcb->remote_fake_port);
^
/root/ip2socks/src/udp_raw.cpp:350:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:424:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:482:32: error: ‘struct udp_pcb’ has no member named ‘remote_fake_ip’
inet_ntop(AF_INET, &(upcb->remote_fake_ip), remote_fake_ip_str, INET_ADDRSTRLEN);
^
/root/ip2socks/src/udp_raw.cpp:484:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:496:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:499:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
/root/ip2socks/src/udp_raw.cpp:538:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:546:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:549:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
CMakeFiles/ip2socks.dir/build.make:1550: recipe for target 'CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o' failed
make[2]: *** [CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ip2socks.dir/all' failed
make[1]: *** [CMakeFiles/ip2socks.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
root@mailsys89:/ip2socks#
In file included from /root/ip2socks/src/udp_raw.cpp:14:0:
/usr/include/netinet/in.h:382:40: error: declaration of ‘uint16_t lwip_htons(uint16_t) throw ()’ has a different exception specifier
__THROW attribute ((const));
^
In file included from /root/ip2socks/lwip/src/include/lwip/ip_addr.h:41:0,
from /root/ip2socks/lwip/src/include/lwip/netif.h:46,
from /root/ip2socks/lwip/src/include/lwip/udp.h:46,
from /root/ip2socks/src/udp_raw.cpp:9:
/root/ip2socks/lwip/src/include/lwip/def.h:98:23: error: from previous declaration ‘uint16_t lwip_htons(uint16_t)’
#define lwip_ntohs(x) lwip_htons(x)
^
/root/ip2socks/src/udp_raw.cpp: In function ‘void udp_raw_recv(void*, udp_pcb*, pbuf*, const ip_addr_t*, u16_t)’:
/root/ip2socks/src/udp_raw.cpp:211:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("tcp", conf->dns_mode) == 0 && upcb->remote_fake_port == 53) {
^
/root/ip2socks/src/udp_raw.cpp:305:39: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
sprintf(dns_port, "%d", upcb->remote_fake_port);
^
/root/ip2socks/src/udp_raw.cpp:350:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:424:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:482:32: error: ‘struct udp_pcb’ has no member named ‘remote_fake_ip’
inet_ntop(AF_INET, &(upcb->remote_fake_ip), remote_fake_ip_str, INET_ADDRSTRLEN);
^
/root/ip2socks/src/udp_raw.cpp:484:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:496:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:499:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
/root/ip2socks/src/udp_raw.cpp:538:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:546:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:549:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
CMakeFiles/ip2socks.dir/build.make:1550: recipe for target 'CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o' failed
make[2]: *** [CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ip2socks.dir/all' failed
make[1]: *** [CMakeFiles/ip2socks.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
root@mailsys89:
/ip2socks#
In file included from /root/ip2socks/src/udp_raw.cpp:14:0:
/usr/include/netinet/in.h:382:40: error: declaration of ‘uint16_t lwip_htons(uint16_t) throw ()’ has a different exception specifier
__THROW attribute ((const));
^
In file included from /root/ip2socks/lwip/src/include/lwip/ip_addr.h:41:0,
from /root/ip2socks/lwip/src/include/lwip/netif.h:46,
from /root/ip2socks/lwip/src/include/lwip/udp.h:46,
from /root/ip2socks/src/udp_raw.cpp:9:
/root/ip2socks/lwip/src/include/lwip/def.h:98:23: error: from previous declaration ‘uint16_t lwip_htons(uint16_t)’
#define lwip_ntohs(x) lwip_htons(x)
^
/root/ip2socks/src/udp_raw.cpp: In function ‘void udp_raw_recv(void*, udp_pcb*, pbuf*, const ip_addr_t*, u16_t)’:
/root/ip2socks/src/udp_raw.cpp:211:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("tcp", conf->dns_mode) == 0 && upcb->remote_fake_port == 53) {
^
/root/ip2socks/src/udp_raw.cpp:305:39: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
sprintf(dns_port, "%d", upcb->remote_fake_port);
^
/root/ip2socks/src/udp_raw.cpp:350:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:424:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:482:32: error: ‘struct udp_pcb’ has no member named ‘remote_fake_ip’
inet_ntop(AF_INET, &(upcb->remote_fake_ip), remote_fake_ip_str, INET_ADDRSTRLEN);
^
/root/ip2socks/src/udp_raw.cpp:484:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:496:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:499:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
/root/ip2socks/src/udp_raw.cpp:538:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:546:53: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
if (strcmp("udp", conf->dns_mode) == 0 && upcb->remote_fake_port == atoi(conf->local_dns_port)) {
^
/root/ip2socks/src/udp_raw.cpp:549:23: error: ‘struct udp_pcb’ has no member named ‘remote_fake_port’
pport = upcb->remote_fake_port;
^
CMakeFiles/ip2socks.dir/build.make:1550: recipe for target 'CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o' failed
make[2]: *** [CMakeFiles/ip2socks.dir/src/udp_raw.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ip2socks.dir/all' failed
make[1]: *** [CMakeFiles/ip2socks.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Running make on OSX 10.13.3 and Xcode v9.2 (9C40b)

[ 1%] Building C object CMakeFiles/ip2socks.dir/src/dns/dns_parser.c.o
In file included from /Users/tom/Projects/ip2socks/src/dns/dns_parser.c:1:
/Users/tom/Projects/ip2socks/src/dns/dns_parser.h:1:10: fatal error: 'unittypes.h' file not found
#include <unittypes.h>
^~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/ip2socks.dir/src/dns/dns_parser.c.o] Error 1
make[1]: *** [CMakeFiles/ip2socks.dir/all] Error 2
make: *** [all] Error 2

Any tips to solve this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.