clowwindy/ShadowVPN — pull request #16 by linusyang (2014-10-08 14:52:27+00:00)
Title: Add initial support for OS X

This patch adds initial support for OS X by using native tunnel interface called `utun`. It is supported by the XNU kernel starting from iOS 4.1 and OS X 10.7 Lion. `utun` is a bit different from the standard TUN interface of Linux or FreeBSD, but similar with the OpenBSD one.

This patch adds code to build up the `utun` interface and manipulate `utun` devices, and also includes basic samples for running clients. It is tested to work on OS X 10.9.5 Mavericks.

This pull requrest is related to issue #10.

References:
OpenVPN `utun` patch: http://thread.gmane.org/gmane.network.openvpn.devel/7464/focus=7739
Mac OS X and iOS Internals: http://newosxbook.com/src.jl?tree=listings&file=17-15-utun.c
QuickTun `utun` patch: linusyang/QuickTun@a6c8ed0
tun2socks Darwin support: linusyang/badvpn@ae94823