1 /* 2 Copyright (C) 2000-2007 MySQL AB 3 Use is subject to license terms 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; version 2 of the License. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program; see the file COPYING. If not, write to the 16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 17 MA 02110-1335 USA. 18 */ 19 20 21 /* yaSSL externel header defines yaSSL API 22 */ 23 24 25 #ifndef yaSSL_EXT_HPP 26 #define yaSSL_EXT_HPP 27 28 29 namespace yaSSL { 30 31 32 #ifdef _WIN32 33 typedef unsigned int SOCKET_T; 34 #else 35 typedef int SOCKET_T; 36 #endif 37 38 39 class Client { 40 public: 41 Client(); 42 ~Client(); 43 44 // basics 45 int Connect(SOCKET_T); 46 int Write(const void*, int); 47 int Read(void*, int); 48 49 // options 50 void SetCA(const char*); 51 void SetCert(const char*); 52 void SetKey(const char*); 53 private: 54 struct ClientImpl; 55 ClientImpl* pimpl_; 56 57 Client(const Client&); // hide copy 58 Client& operator=(const Client&); // and assign 59 }; 60 61 62 class Server { 63 public: 64 Server(); 65 ~Server(); 66 67 // basics 68 int Accept(SOCKET_T); 69 int Write(const void*, int); 70 int Read(void*, int); 71 72 // options 73 void SetCA(const char*); 74 void SetCert(const char*); 75 void SetKey(const char*); 76 private: 77 struct ServerImpl; 78 ServerImpl* pimpl_; 79 80 Server(const Server&); // hide copy 81 Server& operator=(const Server&); // and assign 82 }; 83 84 85 } // namespace yaSSL 86 #endif // yaSSL_EXT_HPP 87