if (helper_in == NULL || helper_out == NULL) return;
- helper_proc = GNUNET_OS_start_process(helper_in, helper_out, "gnunet-helper-vpn", "gnunet-helper-vpn", NULL);
+ helper_proc =
+ GNUNET_OS_start_process (helper_in, helper_out, "gnunet-helper-vpn",
+ "gnunet-helper-vpn", "1234::1", "16", "10.10.10.1",
+ "255.255.255.0");
fh_from_helper = GNUNET_DISK_pipe_handle (helper_out, GNUNET_DISK_PIPE_END_READ);
fh_to_helper = GNUNET_DISK_pipe_handle (helper_in, GNUNET_DISK_PIPE_END_WRITE);
return 1;
}
+ if (5 != argc)
+ {
+ fprintf(stderr, "Fatal: must supply 4 arguments!\n");
+ return 1;
+ }
+
{
- // TODO: get this out of argv
- char address[] = "1234::1";
- unsigned long prefix_len = 16;
+ char *address = argv[1];
+ long prefix_len = atol(argv[2]);
+
+ if (prefix_len < 1 || prefix_len > 127)
+ {
+ fprintf(stderr, "Fatal: prefix_len out of range\n");
+ return 1;
+ }
set_address6 (dev, address, prefix_len);
}
{
- char address[] = "10.10.10.1";
- char mask[] = "255.255.255.252";
+ char *address = argv[3];
+ char *mask = argv[4];
set_address4 (dev, address, mask);
}