Mercurial > hg > quicktun
diff src/run.combined.c @ 27:5ba185ca7102
Fixed error checking during initialization, restructured code a bit to make it even simpler
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Sat, 09 Apr 2011 17:36:48 +0200 |
parents | 65c01f57bdce |
children | 6f0e6b7dc088 |
line wrap: on
line diff
--- a/src/run.combined.c Fri Apr 08 17:08:04 2011 +0200 +++ b/src/run.combined.c Sat Apr 09 17:36:48 2011 +0200 @@ -25,6 +25,10 @@ #include "common.c" +struct qtproto qtproto_raw; +struct qtproto qtproto_nacl0; +struct qtproto qtproto_nacltai; + #ifdef DEBIAN_BINARY char* getenvdeb(const char* name) { char tmp[1024] = "IF_QT_"; @@ -48,18 +52,18 @@ char* envval; if (envval = getconf("PROTOCOL")) { if (strcmp(envval, "raw") == 0) { - return tunmain_raw(); + return qtrun(&qtproto_raw); } else if (strcmp(envval, "nacl0") == 0) { - return tunmain_nacl0(); + return qtrun(&qtproto_nacl0); } else if (strcmp(envval, "nacltai") == 0) { - return tunmain_nacltai(); + return qtrun(&qtproto_nacltai); } else { fprintf(stderr, "Unknown protocol specified: %s\n", envval); return -1; } } else if (getconf("PRIVATE_KEY")) { - return tunmain_nacl0(); + return qtrun(&qtproto_nacl0); } else { - return tunmain_raw(); + return qtrun(&qtproto_raw); } -} \ No newline at end of file +}