aboutsummaryrefslogtreecommitdiffstats
path: root/src/ssl/socket.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-01-11 22:57:21 +0000
committerlloyd <[email protected]>2010-01-11 22:57:21 +0000
commita4124ddf481bfc56859007b34dea646ecb7f8a25 (patch)
treefd842d8a091c5c529d6c32cd300bc195519ceb46 /src/ssl/socket.h
parentf5fd85b0ea6a5a6975d595130e029f94fddae9a4 (diff)
Import latest version of Ajisai into src/ssl; once this hits mainline
I'll officially kill off Ajisai (instead of it just lingering as a zombine as it is currently). Apparently I broke something (or multiple things) during the import process; servers crash and clients gets MAC errors on connect.
Diffstat (limited to 'src/ssl/socket.h')
-rw-r--r--src/ssl/socket.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/ssl/socket.h b/src/ssl/socket.h
new file mode 100644
index 000000000..ca358919c
--- /dev/null
+++ b/src/ssl/socket.h
@@ -0,0 +1,49 @@
+/**
+* Socket Interface Header File
+* (C) 2004-2006 Jack Lloyd
+*
+* Released under the terms of the Botan license
+*/
+
+#ifndef BOTAN_SOCKET_H__
+#define BOTAN_SOCKET_H__
+
+#include <botan/types.h>
+#include <string>
+
+namespace Botan {
+
+/**
+* Socket Base Class
+*/
+class BOTAN_DLL Socket
+ {
+ public:
+ virtual u32bit read(byte[], u32bit) = 0;
+ virtual void write(const byte[], u32bit) = 0;
+
+ u32bit read(byte& x) { return read(&x, 1); }
+ void write(byte x) { write(&x, 1); }
+
+ virtual std::string peer_id() const = 0;
+
+ virtual void close() = 0;
+
+ virtual ~Socket() {}
+ };
+
+/**
+* Server Socket Base Class
+*/
+class BOTAN_DLL Server_Socket
+ {
+ public:
+ virtual Socket* accept() = 0;
+ virtual void close() = 0;
+
+ virtual ~Server_Socket() {}
+ };
+
+}
+
+#endif