summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2008-11-28 17:53:09 +0000
committerOthmar Gsenger <otti@anytun.org>2008-11-28 17:53:09 +0000
commit8a024eba12f15556a0d28ba81439b056dfe9d5eb (patch)
tree65081ee7fdb6b217cbd9f6b62b3095d8c734f382
parentadded compile time options NOCRYPT,NODAEMON,NOEXEC for easyier windows porting (diff)
some more type cleanups and missig NOCRYPT defines
-rw-r--r--src/authAlgo.h2
-rw-r--r--src/buffer.cpp2
-rw-r--r--src/encryptedPacket.h6
-rw-r--r--src/keyDerivation.h2
-rw-r--r--src/threadUtils.hpp1
5 files changed, 11 insertions, 2 deletions
diff --git a/src/authAlgo.h b/src/authAlgo.h
index 2e01c0b..3085673 100644
--- a/src/authAlgo.h
+++ b/src/authAlgo.h
@@ -36,7 +36,9 @@
#include "buffer.h"
#include "encryptedPacket.h"
+#ifndef NOCRYPT
#include <gcrypt.h>
+#endif
class AuthAlgo
{
diff --git a/src/buffer.cpp b/src/buffer.cpp
index 23228eb..7a05ce2 100644
--- a/src/buffer.cpp
+++ b/src/buffer.cpp
@@ -86,7 +86,7 @@ Buffer::Buffer(std::string hex_data, bool allow_realloc) : length_(hex_data.size
for(u_int32_t i=0; i<length_; ++i)
{
- u_int32_t tmp;
+ u_int8_t tmp;
std::istringstream ss(std::string(hex_data.c_str(), i*2, 2));
if(!(ss >> std::hex >> tmp)) tmp = 0;
buf_[i] = tmp;
diff --git a/src/encryptedPacket.h b/src/encryptedPacket.h
index 1d834f5..a4356dd 100644
--- a/src/encryptedPacket.h
+++ b/src/encryptedPacket.h
@@ -135,7 +135,11 @@ private:
seq_nr_t seq_nr;
sender_id_t sender_id;
mux_t mux;
- }__attribute__((__packed__));
+ }
+#ifndef NOPACKED
+ __attribute__((__packed__))
+#endif
+;
struct HeaderStruct* header_;
u_int8_t * payload_;
diff --git a/src/keyDerivation.h b/src/keyDerivation.h
index 0f41895..9e8c7b5 100644
--- a/src/keyDerivation.h
+++ b/src/keyDerivation.h
@@ -37,7 +37,9 @@
#include "threadUtils.hpp"
#include "syncBuffer.h"
+#ifndef NOCRYPT
#include <gcrypt.h>
+#endif
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
diff --git a/src/threadUtils.hpp b/src/threadUtils.hpp
index 25afebd..960e757 100644
--- a/src/threadUtils.hpp
+++ b/src/threadUtils.hpp
@@ -30,6 +30,7 @@
*/
#include <boost/thread.hpp>
#include <boost/thread/mutex.hpp>
+#include "datatypes.h"
#ifndef __THREADUTILS__
#define __THREADUTILS__
typedef boost::mutex::scoped_lock Lock;