mirror of
https://github.com/yarrick/iodine.git
synced 2025-04-11 21:10:56 +00:00
---
This commit is contained in:
parent
24e3e47f70
commit
0974d96d33
4 changed files with 21 additions and 14 deletions
10
src/client.c
10
src/client.c
|
@ -68,6 +68,8 @@ static const char *topdomain;
|
||||||
|
|
||||||
static uint16_t rand_seed;
|
static uint16_t rand_seed;
|
||||||
|
|
||||||
|
static char _v6;
|
||||||
|
|
||||||
/* Current up/downstream IP packet */
|
/* Current up/downstream IP packet */
|
||||||
static struct packet outpkt;
|
static struct packet outpkt;
|
||||||
static struct packet inpkt;
|
static struct packet inpkt;
|
||||||
|
@ -299,6 +301,12 @@ client_set_hostname_maxlen(int i)
|
||||||
hostname_maxlen = i;
|
hostname_maxlen = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
client_set_v6(char v6)
|
||||||
|
{
|
||||||
|
_v6 = v6;
|
||||||
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
client_get_raw_addr()
|
client_get_raw_addr()
|
||||||
{
|
{
|
||||||
|
@ -1537,9 +1545,11 @@ handshake_login(int dns_fd, int seed)
|
||||||
|
|
||||||
fprintf(stderr, "Server tunnel IP is %s\n", server);
|
fprintf(stderr, "Server tunnel IP is %s\n", server);
|
||||||
|
|
||||||
|
if (_v6) {
|
||||||
fprintf(stderr, "Server tunnel IPv6 is %s\n", server6);
|
fprintf(stderr, "Server tunnel IPv6 is %s\n", server6);
|
||||||
fprintf(stderr, "Client tunnel IPv6 is %s\n", client6);
|
fprintf(stderr, "Client tunnel IPv6 is %s\n", client6);
|
||||||
fprintf(stderr, "Tunnel netmask6 is %d\n", netmask6);
|
fprintf(stderr, "Tunnel netmask6 is %d\n", netmask6);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -32,6 +32,7 @@ void set_downenc(char *encoding);
|
||||||
void client_set_selecttimeout(int select_timeout);
|
void client_set_selecttimeout(int select_timeout);
|
||||||
void client_set_lazymode(int lazy_mode);
|
void client_set_lazymode(int lazy_mode);
|
||||||
void client_set_hostname_maxlen(int i);
|
void client_set_hostname_maxlen(int i);
|
||||||
|
void client_set_v6(char v6);
|
||||||
|
|
||||||
int client_handshake(int dns_fd, int raw_mode, int autodetect_frag_size, int fragsize);
|
int client_handshake(int dns_fd, int raw_mode, int autodetect_frag_size, int fragsize);
|
||||||
int client_tunnel(int tun_fd, int dns_fd);
|
int client_tunnel(int tun_fd, int dns_fd);
|
||||||
|
|
11
src/iodine.c
11
src/iodine.c
|
@ -137,10 +137,9 @@ main(int argc, char **argv)
|
||||||
int lazymode;
|
int lazymode;
|
||||||
int selecttimeout;
|
int selecttimeout;
|
||||||
int hostname_maxlen;
|
int hostname_maxlen;
|
||||||
|
char v6;
|
||||||
int rtable = 0;
|
int rtable = 0;
|
||||||
|
|
||||||
printf("***MODIFIED***\n");
|
|
||||||
|
|
||||||
nameserv_addr = NULL;
|
nameserv_addr = NULL;
|
||||||
topdomain = NULL;
|
topdomain = NULL;
|
||||||
#ifndef WINDOWS32
|
#ifndef WINDOWS32
|
||||||
|
@ -163,6 +162,8 @@ main(int argc, char **argv)
|
||||||
selecttimeout = 4;
|
selecttimeout = 4;
|
||||||
hostname_maxlen = 0xFF;
|
hostname_maxlen = 0xFF;
|
||||||
|
|
||||||
|
v6 = 0;
|
||||||
|
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
WSAStartup(req_version, &wsa_data);
|
WSAStartup(req_version, &wsa_data);
|
||||||
#endif
|
#endif
|
||||||
|
@ -178,7 +179,7 @@ main(int argc, char **argv)
|
||||||
__progname++;
|
__progname++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((choice = getopt(argc, argv, "vfhru:t:d:R:P:m:M:F:T:O:L:I:")) != -1) {
|
while ((choice = getopt(argc, argv, "vfhru6:t:d:R:P:m:M:F:T:O:L:I:")) != -1) {
|
||||||
switch(choice) {
|
switch(choice) {
|
||||||
case 'v':
|
case 'v':
|
||||||
version();
|
version();
|
||||||
|
@ -249,6 +250,9 @@ main(int argc, char **argv)
|
||||||
if (selecttimeout < 1)
|
if (selecttimeout < 1)
|
||||||
selecttimeout = 1;
|
selecttimeout = 1;
|
||||||
break;
|
break;
|
||||||
|
case '6':
|
||||||
|
v6 = 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
|
@ -304,6 +308,7 @@ main(int argc, char **argv)
|
||||||
client_set_lazymode(lazymode);
|
client_set_lazymode(lazymode);
|
||||||
client_set_topdomain(topdomain);
|
client_set_topdomain(topdomain);
|
||||||
client_set_hostname_maxlen(hostname_maxlen);
|
client_set_hostname_maxlen(hostname_maxlen);
|
||||||
|
client_set_v6(v6);
|
||||||
|
|
||||||
if (username != NULL) {
|
if (username != NULL) {
|
||||||
#ifndef WINDOWS32
|
#ifndef WINDOWS32
|
||||||
|
|
|
@ -571,13 +571,7 @@ tunnel_tun(int tun_fd, int dns_fd)
|
||||||
userid = find_user_by_ip6(header6->ip6_dst);
|
userid = find_user_by_ip6(header6->ip6_dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("header6->ip6_dst: ");
|
// printf("tunnel_tun() - userid = %d, header_info[1] = %d\n", userid, header_info[1]);
|
||||||
// char i;
|
|
||||||
// for (i = 0; i < 8; ++i)
|
|
||||||
// printf("%04x%s", ntohs((header6->ip6_dst).__in6_u.__u6_addr16[i]), i < 7 ? ":"
|
|
||||||
// : "\n");
|
|
||||||
|
|
||||||
printf("tunnel_tun() - userid = %d, header_info[1] = %d\n", userid, header_info[1]);
|
|
||||||
|
|
||||||
if (userid < 0)
|
if (userid < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2369,10 +2363,7 @@ main(int argc, char **argv)
|
||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
/*
|
check_superuser(usage);
|
||||||
* Todo: Uncomment
|
|
||||||
*/
|
|
||||||
// check_superuser(usage);
|
|
||||||
|
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
usage();
|
usage();
|
||||||
|
|
Loading…
Add table
Reference in a new issue