diff options
author | lloyd <[email protected]> | 2010-01-11 22:57:21 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-01-11 22:57:21 +0000 |
commit | a4124ddf481bfc56859007b34dea646ecb7f8a25 (patch) | |
tree | fd842d8a091c5c529d6c32cd300bc195519ceb46 /src/ssl/unix_socket/unx_sock.h | |
parent | f5fd85b0ea6a5a6975d595130e029f94fddae9a4 (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/unix_socket/unx_sock.h')
-rw-r--r-- | src/ssl/unix_socket/unx_sock.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/ssl/unix_socket/unx_sock.h b/src/ssl/unix_socket/unx_sock.h new file mode 100644 index 000000000..91c70ce80 --- /dev/null +++ b/src/ssl/unix_socket/unx_sock.h @@ -0,0 +1,62 @@ +/** +* Unix Socket Header File +* (C) 2004-2006 Jack Lloyd +* +* Released under the terms of the Botan license +*/ + +#ifndef BOTAN_UNIX_SOCKET_H__ +#define BOTAN_UNIX_SOCKET_H__ + +#include <botan/socket.h> + +namespace Botan { + +/** + FIXME: the current socket interface is totally unusable + It has to handle (cleanly): + - TCP, UDP, and SCTP, where UDP is only usable with DTLS and + TCP/SCTP is only usable with TLS. + - Alternate socket interfaces (ACE, Netxx, whatever) with + minimal wrapping needed. +*/ + + +/** +* Unix Socket Base Class +*/ +class BOTAN_DLL Unix_Socket : public Socket + { + public: + u32bit read(byte[], u32bit); + void write(const byte[], u32bit); + + std::string peer_id() const; + + void close(); + Unix_Socket(int, const std::string& = ""); + Unix_Socket(const std::string&, u16bit); + ~Unix_Socket() { close(); } + private: + std::string peer; + int sockfd; + }; + +/** +* Unix Server Socket Base Class +*/ +class BOTAN_DLL Unix_Server_Socket : public Server_Socket + { + public: + Socket* accept(); + void close(); + + Unix_Server_Socket(u16bit); + ~Unix_Server_Socket() { close(); } + private: + int sockfd; + }; + +} + +#endif |