Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime debug log (getenv way ) #547

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/goodbyedpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ static void send_native_fragment(HANDLE w_filter, WINDIVERT_ADDRESS addr,
}

int main(int argc, char *argv[]) {
debug("Debug mode enabled\n\n");
static enum packet_type_e {
unknown,
ipv4_tcp, ipv4_tcp_data, ipv4_udp_data,
Expand Down
12 changes: 6 additions & 6 deletions src/goodbyedpi.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#define HOST_MAXLEN 253
#define MAX_PACKET_SIZE 9016

#ifndef DEBUG
#define debug(...) do {} while (0)
#else
#define debug(...) printf(__VA_ARGS__)
#endif

// #ifndef DEBUG
// #define debug(...) do {} while (0)
// #else
// #define debug(...) printf(__VA_ARGS__)
// #endif
#define debug(...) if (getenv("DEBUG_GDPI") != NULL) printf(__VA_ARGS__)
int main(int argc, char *argv[]);
void deinit_all();