-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2022 Felix Fietkau <nbd@nbd.name>
*/
static struct cmdline_network *cmd_nets;
static const char *hosts_file;
-bool dummy_mode;
+const char *mssfix_path = UNETD_MSS_BPF_PATH;
+const char *data_dir = UNETD_DATA_DIR;
+int global_pex_port = UNETD_GLOBAL_PEX_PORT;
bool debug;
static void
struct cmdline_network *net;
int ch;
- while ((ch = getopt(argc, argv, "Ddh:N:")) != -1) {
+ while ((ch = getopt(argc, argv, "D:dh:M:N:P:")) != -1) {
switch (ch) {
+ case 'D':
+ data_dir = optarg;
+ break;
case 'd':
debug = true;
break;
- case 'D':
- dummy_mode = true;
- break;
case 'h':
hosts_file = optarg;
break;
net->data = optarg;
cmd_nets = net;
break;
+ case 'M':
+ mssfix_path = optarg;
+ break;
+ case 'P':
+ global_pex_port = atoi(optarg);
+ break;
}
}
uloop_init();
unetd_ubus_init();
unetd_write_hosts();
+ global_pex_open();
add_networks();
uloop_run();
+ pex_close();
network_free_all();
uloop_done();