tcpslavebase.h
/*
* Copyright (C) 2000 Alex Zepeda <zipzippy@sonic.net>
* Copyright (C) 2001 George Staikos <staikos@kde.org>
* Copyright (C) 2001 Dawit Alemayehu <adawit@kde.org>
*
* This file is part of the KDE project
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _TCP_SLAVEBASE_H
#define _TCP_SLAVEBASE_H
#include <sys/types.h>
#include <stdio.h>
#include <kextsock.h>
#include <kio/slavebase.h>
namespace KIO {
class KIO_EXPORT TCPSlaveBase : public SlaveBase
{
public:
TCPSlaveBase(unsigned short int defaultPort, const QCString &protocol,
const QCString &poolSocket, const QCString &appSocket);
TCPSlaveBase(unsigned short int defaultPort, const QCString &protocol,
const QCString &poolSocket, const QCString &appSocket,
bool useSSL);
virtual ~TCPSlaveBase();
protected:
#ifndef KDE_NO_COMPAT
KDE_DEPRECATED ssize_t Write(const void *data, ssize_t len) { return write( data, len ); }
KDE_DEPRECATED ssize_t Read(void *data, ssize_t len) { return read( data, len ); }
KDE_DEPRECATED ssize_t ReadLine(char *data, ssize_t len) { return readLine( data, len ); }
KDE_DEPRECATED unsigned short int GetPort(unsigned short int p) { return port(p); }
KDE_DEPRECATED bool ConnectToHost( const QString &host, unsigned int port,
bool sendError ) { return connectToHost( host, port, sendError ); }
KDE_DEPRECATED void CloseDescriptor() { closeDescriptor(); }
KDE_DEPRECATED bool AtEOF() { return atEnd(); }
KDE_DEPRECATED bool InitializeSSL() { return initializeSSL(); }
KDE_DEPRECATED void CleanSSL() { cleanSSL(); }
#endif
ssize_t write(const void *data, ssize_t len);
ssize_t read(void *data, ssize_t len);
ssize_t readLine(char *data, ssize_t len);
void setBlockSize(int sz);
unsigned short int port(unsigned short int _port);
bool connectToHost( const QString &host, unsigned int port,
bool sendError = true );
bool usingSSL() const { return m_bIsSSL; }
bool usingTLS() const;
bool usingTLS();
bool canUseTLS();
int startTLS();
void stopTLS();
void closeDescriptor();
bool atEnd();
void setSSLMetaData();
bool initializeSSL();
void cleanSSL();
bool isConnectionValid();
int connectResult();
bool waitForResponse( int t );
void setBlockConnection( bool b );
void setConnectTimeout( int t );
bool isSSLTunnelEnabled();
void setEnableSSLTunnel( bool enable );
void setRealHost( const QString& realHost );
// don't use me!
void doConstructorStuff();
// For the certificate verification code
int verifyCertificate();
// For prompting for the certificate to use
void certificatePrompt();
// Did the user abort (as the reason for connectToHost returning false)
bool userAborted() const;
protected:
int m_iSock;
bool m_bIsSSL;
unsigned short int m_iPort;
unsigned short int m_iDefaultPort;
QCString m_sServiceName;
FILE *fp;
private:
bool doSSLHandShake( bool sendError );
protected:
virtual void virtual_hook( int id, void* data );
private:
class TcpSlaveBasePrivate;
TcpSlaveBasePrivate *d;
};
}
#endif
KIO::TCPSlaveBase::AtEOF
KDE_DEPRECATED bool AtEOF()
Definition: tcpslavebase.h:94
KIO::TCPSlaveBase::GetPort
KDE_DEPRECATED unsigned short int GetPort(unsigned short int p)
Definition: tcpslavebase.h:78
KIO::TCPSlaveBase::InitializeSSL
KDE_DEPRECATED bool InitializeSSL()
Definition: tcpslavebase.h:99
KIO::TCPSlaveBase::CleanSSL
KDE_DEPRECATED void CleanSSL()
Definition: tcpslavebase.h:104
KIO::SlaveBase
There are two classes that specifies the protocol between application (job) and kioslave.
Definition: slavebase.h:45
KIO::TCPSlaveBase::ConnectToHost
KDE_DEPRECATED bool ConnectToHost(const QString &host, unsigned int port, bool sendError)
Definition: tcpslavebase.h:83
KIO::TCPSlaveBase::usingSSL
bool usingSSL() const
Are we using SSL?
Definition: tcpslavebase.h:183
KIO::TCPSlaveBase::Write
KDE_DEPRECATED ssize_t Write(const void *data, ssize_t len)
Definition: tcpslavebase.h:63
KIO::TCPSlaveBase
There are two classes that specifies the protocol between application (job) and kioslave.
Definition: tcpslavebase.h:45
KIO::TCPSlaveBase::CloseDescriptor
KDE_DEPRECATED void CloseDescriptor()
Definition: tcpslavebase.h:89
KIO::TCPSlaveBase::ReadLine
KDE_DEPRECATED ssize_t ReadLine(char *data, ssize_t len)
Definition: tcpslavebase.h:73
KIO::TCPSlaveBase::Read
KDE_DEPRECATED ssize_t Read(void *data, ssize_t len)
Definition: tcpslavebase.h:68

KDE Home | KDE Accessibility Home | Description of Access Keys