diff src/common.c @ 22:38d495566d1c

Re-added some debugging messages to nacltai protocol code, enabled by the DEBUG environment variable
author Ivo Smits <Ivo@UCIS.nl>
date Sun, 27 Feb 2011 23:52:32 +0100
parents 1fa5b5fa49e1
children 5ba185ca7102
line wrap: on
line diff
--- a/src/common.c	Sun Feb 27 22:48:51 2011 +0100
+++ b/src/common.c	Sun Feb 27 23:52:32 2011 +0100
@@ -77,9 +77,11 @@
 	extern int errorexitp(const char*);
 	extern void print_header();
 	extern void hex2bin(unsigned char*, unsigned char*, int);
+	extern int debug;
 #else
 
 char* (*getconf)(const char*) = getenv;
+int debug = 0;
 
 int errorexit(const char* text) {
 	fprintf(stderr, "%s\n", text);
@@ -92,7 +94,7 @@
 
 void print_header() {
 	fprintf(stderr, "UCIS QuickTun (c) 2010 Ivo Smits <Ivo@UCIS.nl>\n");
-	fprintf(stderr, "More information: http://wiki.qontrol.nl/QuickTun\n");
+	fprintf(stderr, "More information: http://wiki.ucis.nl/QuickTun\n");
 }
 
 int init_udp(struct qtsession* session) {
@@ -189,6 +191,7 @@
 }
 
 int qtrun(struct qtproto* p) {
+	if (getconf("DEBUG")) debug = 1;
 	struct qtsession session;
 	session.protocol = *p;