From 16f2a8fb8136790c1e26aa48cbbd64b327d676e8 Mon Sep 17 00:00:00 2001 From: EgorWeders <157705588+EgorWeders@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:53:01 +0700 Subject: [PATCH] Added argument --debug-exit (#512) * Added argument --debug-exit --- src/goodbyedpi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/goodbyedpi.c b/src/goodbyedpi.c index 61da21ce..15317bfe 100644 --- a/src/goodbyedpi.c +++ b/src/goodbyedpi.c @@ -187,6 +187,7 @@ static struct option long_options[] = { {"native-frag", no_argument, 0, '*' }, {"reverse-frag",no_argument, 0, '(' }, {"max-payload", optional_argument, 0, '|' }, + {"debug-exit", optional_argument, 0, '?' }, {0, 0, 0, 0 } }; @@ -577,6 +578,7 @@ int main(int argc, char *argv[]) { ipv4_tcp, ipv4_tcp_data, ipv4_udp_data, ipv6_tcp, ipv6_tcp_data, ipv6_udp_data } packet_type; + bool debug_exit = false; int i, should_reinject, should_recalc_checksum = 0; int sni_ok = 0; int opt; @@ -937,6 +939,9 @@ int main(int argc, char *argv[]) { else max_payload_size = 1200; break; + case '?': // --debug-exit + debug_exit = true; + break default: puts("Usage: goodbyedpi.exe [OPTION...]\n" " -p block passive DPI\n" @@ -1116,7 +1121,9 @@ int main(int argc, char *argv[]) { if (filters[i] == NULL) die(); } - + if (debug_exit) { + exit(EXIT_SUCCESS); + } printf("Filter activated, GoodbyeDPI is now running!\n"); signal(SIGINT, sigint_handler);