summaryrefslogtreecommitdiff
path: root/openwrt/kamikaze/uanytun
diff options
context:
space:
mode:
Diffstat (limited to 'openwrt/kamikaze/uanytun')
-rw-r--r--openwrt/kamikaze/uanytun/Makefile100
-rw-r--r--openwrt/kamikaze/uanytun/files/uanytun-nocrypt.config52
-rwxr-xr-xopenwrt/kamikaze/uanytun/files/uanytun.init4
3 files changed, 148 insertions, 8 deletions
diff --git a/openwrt/kamikaze/uanytun/Makefile b/openwrt/kamikaze/uanytun/Makefile
index 809ed89..045e759 100644
--- a/openwrt/kamikaze/uanytun/Makefile
+++ b/openwrt/kamikaze/uanytun/Makefile
@@ -24,16 +24,65 @@ PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
include $(INCLUDE_DIR)/package.mk
-define Package/uanytun
+define Package/uanytun/template
SECTION:=net
CATEGORY:=Network
- DEPENDS:=+kmod-tun +libopenssl
TITLE:=micro anycast tunneling daemon
URL:=http://www.anytun.org/
MAINTAINER:=Christian Pointner <equinox@anytun.org>
SUBMENU:=VPN
endef
+define Package/uanytun/desc-template
+uAnytun is a tiny implementation of SATP. Unlike Anytun which is a full
+ featured implementation uAnytun has no support for multiple connections
+ or synchronisation. It is a small single threaded implementation intended
+ to act as a client on small platforms.
+endef
+
+define Package/uanytun
+ $(call Package/uanytun/template)
+ DEPENDS:=+kmod-tun +libgcrypt
+endef
+
+define Package/uanytun/conffiles
+/etc/config/uanytun
+endef
+
+define Package/uanytun/description
+ $(call Package/uanytun/desc-template)
+endef
+
+
+define Package/uanytun-sslcrypt
+ $(call Package/uanytun/template)
+ DEPENDS:=+kmod-tun +libopenssl
+endef
+
+define Package/uanytun-sslcrypt/conffiles
+/etc/config/uanytun-sslcrypt
+endef
+
+define Package/uanytun-sslcrypt/description
+ $(call Package/uanytun/desc-template)
+endef
+
+
+define Package/uanytun-nocrypt
+ $(call Package/uanytun/template)
+ DEPENDS:=+kmod-tun
+endef
+
+define Package/uanytun-nocrypt/conffiles
+/etc/config/uanytun-nocrypt
+endef
+
+define Package/uanytun-nocrypt/description
+ $(call Package/uanytun/desc-template)
+endef
+
+
+
define Build/Configure
(cd $(PKG_BUILD_DIR)/src; \
touch include.mk; \
@@ -44,22 +93,61 @@ endef
define Build/Compile
rm -rf $(PKG_INSTALL_DIR)
mkdir -p $(PKG_INSTALL_DIR)
+
+ $(MAKE) -C $(PKG_BUILD_DIR)/src \
+ $(TARGET_CONFIGURE_OPTS) \
+ NO_CRYPT_OBJ=1 \
+ TARGET=Linux \
+ CFLAGS="$(TARGET_CFLAGS) -DNO_CRYPT" \
+ LDFLAGS="$(TARGET_LDFLAGS) -ldl"
+ cp $(PKG_BUILD_DIR)/src/uanytun $(PKG_BUILD_DIR)/src/uanytun-nocrypt
+ $(MAKE) -C $(PKG_BUILD_DIR)/src clean
+
$(MAKE) -C $(PKG_BUILD_DIR)/src \
$(TARGET_CONFIGURE_OPTS) \
TARGET=Linux \
CFLAGS="$(TARGET_CFLAGS) -DUSE_SSL_CRYPTO -I$(STAGING_DIR)/usr/include" \
LDFLAGS="$(TARGET_LDFLAGS) -ldl -lcrypto"
+ cp $(PKG_BUILD_DIR)/src/uanytun $(PKG_BUILD_DIR)/src/uanytun-sslcrypt
+ $(MAKE) -C $(PKG_BUILD_DIR)/src clean
+
+ $(MAKE) -C $(PKG_BUILD_DIR)/src \
+ $(TARGET_CONFIGURE_OPTS) \
+ TARGET=Linux \
+ CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
+ LDFLAGS="$(TARGET_LDFLAGS) -ldl -lgcrypt -lgpgerror"
+
+ $(STRIP) $(PKG_BUILD_DIR)/src/uanytun-nocrypt
+ $(STRIP) $(PKG_BUILD_DIR)/src/uanytun-sslcrypt
$(STRIP) $(PKG_BUILD_DIR)/src/uanytun
endef
-define Package/uanytun/install
+
+
+define Package/uanytun/install-generic
$(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_DATA) ./files/uanytun.config $(1)/etc/config/uanytun
+ $(INSTALL_DATA) ./files/$(3) $(1)/etc/config/$(2)
$(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/uanytun $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(2) $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/uanytun.init $(1)/etc/init.d/uanytun
+ $(INSTALL_BIN) ./files/uanytun.init $(1)/etc/init.d/$(2)
+ sed -e 's/BIN=uanytun/BIN=$(2)/' -i $(1)/etc/init.d/$(2)
+endef
+
+define Package/uanytun/install
+ $(call Package/uanytun/install-generic, $(1), uanytun, uanytun.config)
+endef
+
+define Package/uanytun-sslcrypt/install
+ $(call Package/uanytun/install-generic, $(1), uanytun-sslcrypt, uanytun.config)
+endef
+define Package/uanytun-nocrypt/install
+ $(call Package/uanytun/install-generic, $(1), uanytun-nocrypt, uanytun-nocrypt.config)
endef
+
+
$(eval $(call BuildPackage,uanytun))
+$(eval $(call BuildPackage,uanytun-sslcrypt))
+$(eval $(call BuildPackage,uanytun-nocrypt))
diff --git a/openwrt/kamikaze/uanytun/files/uanytun-nocrypt.config b/openwrt/kamikaze/uanytun/files/uanytun-nocrypt.config
new file mode 100644
index 0000000..5cefd50
--- /dev/null
+++ b/openwrt/kamikaze/uanytun/files/uanytun-nocrypt.config
@@ -0,0 +1,52 @@
+config "client1"
+ option disabled 0
+ option username 'nobody'
+ option groupname 'nogroup'
+# option chroot "/var/run/uanytun"
+
+# option interface '<ip-address>'
+# option port '4444'
+# option sender_id '1'
+
+# option dev 'anytun0'
+ option type 'tun'
+ option ifconfig '192.168.123.1/24'
+# option post-up-script '/etc/uanytun/client1-post-up.sh'
+
+ option remote_host 'example.com'
+ option remote_port '4444'
+
+ option window_size 0
+ option mux 1
+
+
+config "client2"
+ option disabled 1
+ option username 'nobody'
+ option groupname 'nogroup'
+
+ option type 'tun'
+ option ifconfig '192.168.123.2/24'
+
+ option remote_host 'example.com'
+ option remote_port '4444'
+
+ option window_size 0
+ option mux 2
+
+
+config "client3"
+ option disabled 1
+ option username 'nobody'
+ option groupname 'nogroup'
+
+ option type 'tun'
+ option ifconfig '192.168.123.3/24'
+
+ option remote_host 'example.com'
+ option remote_port '4444'
+
+ option window_size 0
+ option mux 3
+
+
diff --git a/openwrt/kamikaze/uanytun/files/uanytun.init b/openwrt/kamikaze/uanytun/files/uanytun.init
index 9c1a928..59e1c23 100755
--- a/openwrt/kamikaze/uanytun/files/uanytun.init
+++ b/openwrt/kamikaze/uanytun/files/uanytun.init
@@ -3,7 +3,7 @@ START=50
BIN=uanytun
DAEMON=/usr/sbin/$BIN
-DESC=uanytun
+DESC=$BIN
RUN_D=/var/run
@@ -71,7 +71,7 @@ stop_vpn() {
start() {
echo -n "Starting $DESC:"
- config_load uanytun
+ config_load $BIN
if [ $# -gt 0 ]; then
while [ $# -gt 0 ]; do
config_foreach foreach_config_forced "$1"