[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] More tests for everything.



Update of /home/minion/cvsroot/src/minion
In directory moria.seul.org:/tmp/cvs-serv13122

Modified Files:
	TODO setup.py 
Log Message:
More tests for everything.

BuildMessage and ServerProcess are now working: we support all of the
non-network-related algorithms and formats in the spec.  We can build
messages and reply blocks, and (if we're a server) process them enough
to pass messages off to the next server.  We handle extended headers,
swapping, everything.

Performance is good: on my Athlon XP1700+, the server core takes 8.5
ms for a non-swap message, and 9 ms for a swap message.  Of this, I
believe around 95% is spent in the C encryption code.

Next up, more documentation and comments and code clean-up.  After
that, get queues and persistent server information working.


Index: TODO
===================================================================
RCS file: /home/minion/cvsroot/src/minion/TODO,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- TODO	29 May 2002 03:52:13 -0000	1.1
+++ TODO	31 May 2002 12:47:58 -0000	1.2
@@ -16,10 +16,9 @@
 - Publishing to directory servers
 - Downloading from directory servers
 - Key rotation
+- Reply block storage and format.
 
 WRITTEN, BUT UNTESTED
 
-- BuildMessages.py
 - ServerProcess.py
-- Some of Formats.py
 

Index: setup.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/setup.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- setup.py	29 May 2002 03:52:13 -0000	1.1
+++ setup.py	31 May 2002 12:47:58 -0000	1.2
@@ -3,7 +3,7 @@
 # Copyright 2002 Nick Mathewson.  See LICENSE for licensing information.
 # $Id$
 
-import os
+import os, struct
 from distutils.core import setup, Extension
 
 VERSION= '0.1'
@@ -12,14 +12,37 @@
 # changes, we can fix this rigamarole.
 SSL_DIR="contrib/openssl"
 
-#====================================================================
+MACROS=[]
+
+#======================================================================
+# Detect endian-ness
+
+#XXXX this breaks cross-compilation
+num = struct.pack("@I", 0x01020304) 
+big_endian = (num== "\x01\x02\x03\x04")
+little_endian = (num=="\x04\x03\x02\x01")
+other_endian = not (big_endian or little_endian)
+
+if big_endian:
+    print "Host is big-endian"
+    MACROS.append( ("MM_B_ENDIAN", 1) )
+elif little_endian:
+    print "Host is little-endian"
+    MACROS.append( ("MM_L_ENDIAN", 1) )
+    if os.path.exists("/usr/include/byteswap.h"):
+        MACROS.append( ("MM_HAVE_BYTESWAP_H", 1) )
+elif other_endian:
+    print "Feh! Host is neither little-endian or big-endian"
+
+#======================================================================
 
 extmodule = Extension("mixminion._minionlib",
-                      ["src/crypt.c", "src/aes_ctr.c", "src/main.c"],
+                      ["src/crypt.c", "src/aes_ctr.c", "src/main.c" ],
                       library_dirs=[SSL_DIR],
                       include_dirs=[SSL_DIR+"/include", "src"],
                       libraries=["ssl", "crypto"],
-                      extra_compile_args=["-Wno-strict-prototypes"])
+                      extra_compile_args=["-Wno-strict-prototypes" ],
+                      define_macros=MACROS)
 
 setup(name='Mixminion',
       version=VERSION,