Browse Source

Added argument --debug-exit

Argument force exit before infinite loop starting.
pull/512/head
EgorWeders 8 months ago
committed by GitHub
parent
commit
4b58da4b61
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 11
      src/goodbyedpi.c

11
src/goodbyedpi.c

@ -187,6 +187,7 @@ static struct option long_options[] = {
{"native-frag", no_argument, 0, '*' }, {"native-frag", no_argument, 0, '*' },
{"reverse-frag",no_argument, 0, '(' }, {"reverse-frag",no_argument, 0, '(' },
{"max-payload", optional_argument, 0, '|' }, {"max-payload", optional_argument, 0, '|' },
{"debug-exit", optional_argument, 0, '?' },
{0, 0, 0, 0 } {0, 0, 0, 0 }
}; };
@ -577,6 +578,7 @@ int main(int argc, char *argv[]) {
ipv4_tcp, ipv4_tcp_data, ipv4_udp_data, ipv4_tcp, ipv4_tcp_data, ipv4_udp_data,
ipv6_tcp, ipv6_tcp_data, ipv6_udp_data ipv6_tcp, ipv6_tcp_data, ipv6_udp_data
} packet_type; } packet_type;
bool debug_exit=false;
int i, should_reinject, should_recalc_checksum = 0; int i, should_reinject, should_recalc_checksum = 0;
int sni_ok = 0; int sni_ok = 0;
int opt; int opt;
@ -937,6 +939,9 @@ int main(int argc, char *argv[]) {
else else
max_payload_size = 1200; max_payload_size = 1200;
break; break;
case '?': // --debug-exit
debug_exit=true;
break
default: default:
puts("Usage: goodbyedpi.exe [OPTION...]\n" puts("Usage: goodbyedpi.exe [OPTION...]\n"
" -p block passive DPI\n" " -p block passive DPI\n"
@ -987,6 +992,8 @@ int main(int argc, char *argv[]) {
" (like file transfers) in already established sessions.\n" " (like file transfers) in already established sessions.\n"
" May skip some huge HTTP requests from being processed.\n" " May skip some huge HTTP requests from being processed.\n"
" Default (if set): --max-payload 1200.\n" " Default (if set): --max-payload 1200.\n"
" --debug-exit Force exit before windivert input/output loop.\n"
" Default (if set): --max-payload 1200.\n"
"\n"); "\n");
puts("LEGACY modesets:\n" puts("LEGACY modesets:\n"
" -1 -p -r -s -f 2 -k 2 -n -e 2 (most compatible mode)\n" " -1 -p -r -s -f 2 -k 2 -n -e 2 (most compatible mode)\n"
@ -1116,7 +1123,9 @@ int main(int argc, char *argv[]) {
if (filters[i] == NULL) if (filters[i] == NULL)
die(); die();
} }
if (debug_exit) {
exit(EXIT_SUCCESS);
}
printf("Filter activated, GoodbyeDPI is now running!\n"); printf("Filter activated, GoodbyeDPI is now running!\n");
signal(SIGINT, sigint_handler); signal(SIGINT, sigint_handler);

Loading…
Cancel
Save