static int fd[TUN_IF_COUNT];
static struct sockaddr_in dest;
static in_addr_t src, tun_src, tun_dest, ipip_src, ipip_dest;
-static const uint64_t tcp_init_magic = 0x1badcafedeadbeefULL;
+static uint64_t tcp_init_magic;
#define PENDING_MESSAGES_BUFF_SIZE (0x3000)
#define PACKET_READ_SIZE 1500
assert(argc > 4 && "Need ipip remote host");
assert(argc > 5 && "Need ipip local host");
assert(argc > 6 && "Need server port");
- assert(argc > 7 && "Need mode (client or server)");
- assert(argc > 8 && "Need src host");
- if (std::string(argv[7]) == std::string("client"))
- assert(argc > 9 && "Need dest host");
+ assert(argc > 7 && "Need shared secret");
+ assert(argc > 8 && "Need mode (client or server)");
+ assert(argc > 9 && "Need src host");
+ if (std::string(argv[8]) == std::string("client"))
+ assert(argc > 10 && "Need dest host");
- assert(std::string(argv[7]) == std::string("client") || std::string(argv[7]) == std::string("server"));
- are_server = (std::string(argv[7]) == std::string("server"));
+ assert(std::string(argv[8]) == std::string("client") || std::string(argv[8]) == std::string("server"));
+ are_server = (std::string(argv[8]) == std::string("server"));
//
// Parse args into variables
remote_port = atoi(argv[6]);
}
- src = inet_addr(argv[8]);
+ tcp_init_magic = atoll(argv[7]);
+
+ src = inet_addr(argv[9]);
memset(&dest, 0, sizeof(dest));
if (!are_server) {
dest.sin_family = AF_INET;
- dest.sin_addr.s_addr = inet_addr(argv[9]);
+ dest.sin_addr.s_addr = inet_addr(argv[10]);
}
//