move from unstable: iodine

This commit is contained in:
Leonid Plyushch 2020-02-18 15:48:43 +02:00 committed by Yaksh Bariya
parent 14bfc93899
commit 129e0e52ab
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
5 changed files with 154 additions and 0 deletions

View File

@ -0,0 +1,97 @@
diff -uNr iodine-0.7.0/src/android_dns.h iodine-0.7.0.mod/src/android_dns.h
--- iodine-0.7.0/src/android_dns.h 2014-06-16 23:28:43.000000000 +0300
+++ iodine-0.7.0.mod/src/android_dns.h 2019-01-20 16:35:42.911541961 +0200
@@ -2,7 +2,7 @@
#ifndef __FIX_ANDROID_H__
#define __FIX_ANDROID_H__
-typedef struct {
+/*typedef struct {
unsigned id :16;
unsigned rd :1;
unsigned tc :1;
@@ -18,7 +18,7 @@
unsigned ancount :16;
unsigned nscount :16;
unsigned arcount :16;
-} HEADER;
+} HEADER;*/
#define NOERROR 0
#define FORMERR 1
diff -uNr iodine-0.7.0/src/iodined.c iodine-0.7.0.mod/src/iodined.c
--- iodine-0.7.0/src/iodined.c 2014-06-16 23:28:43.000000000 +0300
+++ iodine-0.7.0.mod/src/iodined.c 2019-01-20 16:37:23.255524447 +0200
@@ -92,7 +92,7 @@
static int debug;
#if !defined(BSD) && !defined(__GLIBC__)
-static char *__progname;
+static char *___progname;
#endif
static int read_dns(int, int, struct query *);
@@ -2199,25 +2199,25 @@
static void
usage() {
- extern char *__progname;
+ extern char *___progname;
fprintf(stderr, "Usage: %s [-v] [-h] [-c] [-s] [-f] [-D] [-u user] "
"[-t chrootdir] [-d device] [-m mtu] [-z context] "
"[-l ip address to listen on] [-p port] [-n external ip] "
"[-b dnsport] [-P password] [-F pidfile] [-i max idle time] "
- "tunnel_ip[/netmask] topdomain\n", __progname);
+ "tunnel_ip[/netmask] topdomain\n", ___progname);
exit(2);
}
static void
help() {
- extern char *__progname;
+ extern char *___progname;
fprintf(stderr, "iodine IP over DNS tunneling server\n");
fprintf(stderr, "Usage: %s [-v] [-h] [-c] [-s] [-f] [-D] [-u user] "
"[-t chrootdir] [-d device] [-m mtu] [-z context] "
"[-l ip address to listen on] [-p port] [-n external ip] [-b dnsport] [-P password] "
- "[-F pidfile] tunnel_ip[/netmask] topdomain\n", __progname);
+ "[-F pidfile] tunnel_ip[/netmask] topdomain\n", ___progname);
fprintf(stderr, " -v to print version info and exit\n");
fprintf(stderr, " -h to print this help and exit\n");
fprintf(stderr, " -c to disable check of client IP/port on each request\n");
@@ -2255,7 +2255,7 @@
int
main(int argc, char **argv)
{
- extern char *__progname;
+ extern char *___progname;
char *listen_ip;
char *errormsg;
#ifndef WINDOWS32
@@ -2324,11 +2324,11 @@
#endif
#if !defined(BSD) && !defined(__GLIBC__)
- __progname = strrchr(argv[0], '/');
- if (__progname == NULL)
- __progname = argv[0];
+ ___progname = strrchr(argv[0], '/');
+ if (___progname == NULL)
+ ___progname = argv[0];
else
- __progname++;
+ ___progname++;
#endif
memset(password, 0, sizeof(password));
@@ -2573,7 +2573,7 @@
tzsetwall();
#endif
#ifndef WINDOWS32
- openlog( __progname, LOG_NDELAY, LOG_DAEMON );
+ openlog( ___progname, LOG_NDELAY, LOG_DAEMON );
#endif
if (newroot != NULL)

View File

@ -0,0 +1,14 @@
diff -uNr iodine-0.7.0/src/Makefile iodine-0.7.0.mod/src/Makefile
--- iodine-0.7.0/src/Makefile 2014-06-16 23:28:43.000000000 +0300
+++ iodine-0.7.0.mod/src/Makefile 2019-01-20 16:37:52.923519072 +0200
@@ -8,8 +8,8 @@
ARCH = `uname -m`
LIBPATH = -L.
-LDFLAGS += -lz `sh osflags $(TARGETOS) link` $(LIBPATH)
-CFLAGS += -std=c99 -c -g -Wall -D$(OS) -pedantic `sh osflags $(TARGETOS) cflags`
+LDFLAGS += -lz -llog `sh osflags $(TARGETOS) link` $(LIBPATH)
+CFLAGS += -DANDROID -std=c99 -c -g -Wall -D$(OS) -pedantic `sh osflags $(TARGETOS) cflags` -I@TERMUX_PREFIX@/include
all: stateos $(CLIENT) $(SERVER)

View File

@ -0,0 +1,12 @@
diff -uNr iodine-0.7.0/src/tun.c iodine-0.7.0.mod/src/tun.c
--- iodine-0.7.0/src/tun.c 2014-06-16 23:28:43.000000000 +0300
+++ iodine-0.7.0.mod/src/tun.c 2019-01-20 16:44:23.331442272 +0200
@@ -26,7 +26,7 @@
#include <fcntl.h>
#ifndef IFCONFIGPATH
-#define IFCONFIGPATH "PATH=/sbin:/bin "
+#define IFCONFIGPATH "PATH=@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets "
#endif
#ifdef WINDOWS32

View File

@ -0,0 +1,21 @@
diff -uNr iodine-0.7.0/src/osflags iodine-0.7.0.mod/src/osflags
--- iodine-0.7.0/src/osflags 2014-06-16 23:28:43.000000000 +0300
+++ iodine-0.7.0.mod/src/osflags 2019-05-02 14:52:08.768570062 +0300
@@ -18,8 +18,6 @@
;;
Linux)
FLAGS="";
- [ -e /usr/include/selinux/selinux.h ] && FLAGS="$FLAGS -lselinux";
- [ -e /usr/include/systemd/sd-daemon.h ] && FLAGS="$FLAGS -lsystemd-daemon";
echo $FLAGS;
;;
esac
@@ -34,8 +32,6 @@
;;
Linux)
FLAGS="-D_GNU_SOURCE"
- [ -e /usr/include/selinux/selinux.h ] && FLAGS="$FLAGS -DHAVE_SETCON";
- [ -e /usr/include/systemd/sd-daemon.h ] && FLAGS="$FLAGS -DHAVE_SYSTEMD";
echo $FLAGS;
;;
esac

View File

@ -0,0 +1,10 @@
TERMUX_PKG_HOMEPAGE=http://code.kryo.se/iodine
TERMUX_PKG_DESCRIPTION="Tunnel IPv4 data through a DNS server"
TERMUX_PKG_LICENSE="ISC"
TERMUX_PKG_VERSION=0.7.0
TERMUX_PKG_REVISION=7
TERMUX_PKG_SRCURL=http://code.kryo.se/iodine/iodine-$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=ad2b40acf1421316ec15800dcde0f587ab31d7d6f891fa8b9967c4ded93c013e
TERMUX_PKG_DEPENDS="net-tools, zlib"
TERMUX_PKG_EXTRA_MAKE_ARGS="prefix=$TERMUX_PREFIX"
TERMUX_PKG_BUILD_IN_SRC=true