diff options
author | bju <bju@maxi.fritz.box> | 2014-01-22 02:04:59 +0100 |
---|---|---|
committer | bju <bju@maxi.fritz.box> | 2014-01-22 02:04:59 +0100 |
commit | 96c14c6b7ee52d1a556d6bc0cd78caf959d66eec (patch) | |
tree | ffce3289cb334dfc3bc32a7fc6811af9050cadbd /vdr-vdrmanager/clientsock.h | |
parent | 2676b99b3a7cae3ea8ebe827ac20684a90a84d07 (diff) | |
download | vdr-manager-96c14c6b7ee52d1a556d6bc0cd78caf959d66eec.tar.gz vdr-manager-96c14c6b7ee52d1a556d6bc0cd78caf959d66eec.tar.bz2 |
http://projects.vdr-developer.org/issues/1267:
- some fixes on client side certificate validation
- added SSL server side support to the plugin
Diffstat (limited to 'vdr-vdrmanager/clientsock.h')
-rw-r--r-- | vdr-vdrmanager/clientsock.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/vdr-vdrmanager/clientsock.h b/vdr-vdrmanager/clientsock.h new file mode 100644 index 0000000..d921650 --- /dev/null +++ b/vdr-vdrmanager/clientsock.h @@ -0,0 +1,62 @@ +/* + * extendes sockets + */ + +#ifndef _VDRMON_CLIENTSOCK +#define _VDRMON_CLIENTSOCK + +#include <unistd.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <openssl/ssl.h> +#include <string> + +#include "sock.h" + +using namespace std; + +class cVdrmanagerClientSocket : public cVdrmanagerSocket +{ +private: + string readbuf; + string writebuf; + char * sendbuf; + size_t sendsize; + size_t sendoffset; + bool disconnected; + bool initDisconnect; + int client; + bool login; + bool compression; + bool initCompression; + int compressionMode; + SSL * ssl; + int sslReadWrite; + int sslWantsSelect; +public: + cVdrmanagerClientSocket(const char * password, int compressionMode); + virtual ~cVdrmanagerClientSocket(); + bool Attach(int fd, SSL_CTX * sslCtx); + bool IsLineComplete(); + bool GetLine(string& line); + void Write(string line); + bool Read(); + int ReadNoSSL(); + int ReadSSL(); + bool Disconnected(); + void Disconnect(); + bool Flush(); + int FlushNoSSL(); + int FlushSSL(); + int GetClientId(); + bool WritePending(); + bool IsLoggedIn(); + void SetLoggedIn(); + void ActivateCompression(); + void Compress(); + int GetSslReadWrite(); + int GetSslWantsSelect(); + bool IsSSL(); +}; + +#endif |