diff src/proto.nacltai.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 68c67c6d2080
children 6f0e6b7dc088
line wrap: on
line diff
--- a/src/proto.nacltai.c	Fri Apr 08 17:08:04 2011 +0200
+++ b/src/proto.nacltai.c	Sat Apr 09 17:36:48 2011 +0200
@@ -189,28 +189,21 @@
 	return 0;
 }
 
-#ifdef COMBINED_BINARY
-	int tunmain_nacltai() {
-#else
-	int tunmain() {
-#endif
-	struct qtproto p = {
-		1,
-		MAX_PACKET_LEN + crypto_box_curve25519xsalsa20poly1305_ZEROBYTES,
-		MAX_PACKET_LEN + crypto_box_curve25519xsalsa20poly1305_ZEROBYTES,
-		crypto_box_curve25519xsalsa20poly1305_ZEROBYTES,
-		crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES - noncelength,
-		encode,
-		decode,
-		init,
-		sizeof(struct qt_proto_data_nacltai),
-	};
-	return qtrun(&p);
-}
+struct qtproto qtproto_nacltai = {
+	1,
+	MAX_PACKET_LEN + crypto_box_curve25519xsalsa20poly1305_ZEROBYTES,
+	MAX_PACKET_LEN + crypto_box_curve25519xsalsa20poly1305_ZEROBYTES,
+	crypto_box_curve25519xsalsa20poly1305_ZEROBYTES,
+	crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES - noncelength,
+	encode,
+	decode,
+	init,
+	sizeof(struct qt_proto_data_nacltai),
+};
 
 #ifndef COMBINED_BINARY
 int main() {
 	print_header();
-	return tunmain();
+	return qtrun(&qtproto_nacltai);
 }
 #endif