• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kget

bt::AuthenticateBase

bt::AuthenticateBase Class Reference

#include <authenticatebase.h>

Inheritance diagram for bt::AuthenticateBase:

Inheritance graph
[legend]

List of all members.


Detailed Description

Author:
Joris Guisson

Base class for authentication classes. This class just groups some common stuff between Authenticate and ServerAuthentciate. It has a socket, handles the timing out, provides a function to send the handshake.

Definition at line 47 of file authenticatebase.h.


Public Member Functions

 AuthenticateBase (mse::StreamSocket *s=0)
int getPollIndex () const
const mse::StreamSocket * getSocket () const
bool isFinished () const
bool isLocal () const
virtual void onReadyRead ()
virtual void onReadyWrite ()
void setLocal (bool loc)
void setPollIndex (int pi)
Uint32 supportedExtensions () const
virtual ~AuthenticateBase ()

Protected Slots

void onError (int err)
void onTimeout ()

Protected Member Functions

virtual void handshakeReceived (bool full)=0
void makeHandshake (bt::Uint8 *buf, const SHA1Hash &info_hash, const PeerID &our_peer_id)
virtual void onFinish (bool succes)=0
void sendHandshake (const SHA1Hash &info_hash, const PeerID &our_peer_id)

Protected Attributes

Uint32 bytes_of_handshake_received
Uint32 ext_support
bool finished
Uint8 handshake [68]
bool local
int poll_index
mse::StreamSocket * sock
QTimer timer

Constructor & Destructor Documentation

bt::AuthenticateBase::AuthenticateBase ( mse::StreamSocket *  s = 0  ) 

Definition at line 33 of file authenticatebase.cpp.

bt::AuthenticateBase::~AuthenticateBase (  )  [virtual]

Definition at line 45 of file authenticatebase.cpp.


Member Function Documentation

int bt::AuthenticateBase::getPollIndex (  )  const [inline]

Definition at line 76 of file authenticatebase.h.

const mse::StreamSocket* bt::AuthenticateBase::getSocket (  )  const [inline]

get teh socket

Definition at line 67 of file authenticatebase.h.

virtual void bt::AuthenticateBase::handshakeReceived ( bool  full  )  [protected, pure virtual]

The other side send a handshake.

The first 20 bytes of the handshake will already have been checked.

Parameters:
full Indicates whether we have a full handshake if this is not full, we should just send our own

Implemented in bt::Authenticate, and bt::ServerAuthenticate.

bool bt::AuthenticateBase::isFinished (  )  const [inline]

See if the authentication is finished.

Definition at line 61 of file authenticatebase.h.

bool bt::AuthenticateBase::isLocal (  )  const [inline]

Is this a local peer.

Definition at line 58 of file authenticatebase.h.

void bt::AuthenticateBase::makeHandshake ( bt::Uint8 *  buf,
const SHA1Hash &  info_hash,
const PeerID &  our_peer_id 
) [protected]

Fill in the handshake in a buffer.

void bt::AuthenticateBase::onError ( int  err  )  [protected, slot]

Definition at line 140 of file authenticatebase.cpp.

virtual void bt::AuthenticateBase::onFinish ( bool  succes  )  [protected, pure virtual]

Authentication finished.

Parameters:
succes Succes or not

Implemented in bt::Authenticate, and bt::ServerAuthenticate.

void bt::AuthenticateBase::onReadyRead (  )  [virtual]

We can read from the socket.

Reimplemented in bt::Authenticate.

Definition at line 75 of file authenticatebase.cpp.

void bt::AuthenticateBase::onReadyWrite (  )  [virtual]

We can write to the socket (used to detect a succesfull connection).

Reimplemented in bt::Authenticate.

Definition at line 156 of file authenticatebase.cpp.

void bt::AuthenticateBase::onTimeout (  )  [protected, slot]

Definition at line 147 of file authenticatebase.cpp.

void bt::AuthenticateBase::sendHandshake ( const SHA1Hash &  info_hash,
const PeerID &  our_peer_id 
) [protected]

Send a handshake.

Parameters:
info_hash The info_hash to include
our_peer_id Our PeerID

Definition at line 51 of file authenticatebase.cpp.

void bt::AuthenticateBase::setLocal ( bool  loc  )  [inline]

Set whether this is a local peer.

Definition at line 55 of file authenticatebase.h.

void bt::AuthenticateBase::setPollIndex ( int  pi  )  [inline]

Definition at line 75 of file authenticatebase.h.

Uint32 bt::AuthenticateBase::supportedExtensions (  )  const [inline]

Flags indicating which extensions are supported.

Definition at line 64 of file authenticatebase.h.


Member Data Documentation

Uint32 bt::AuthenticateBase::bytes_of_handshake_received [protected]

Definition at line 116 of file authenticatebase.h.

Uint32 bt::AuthenticateBase::ext_support [protected]

Definition at line 117 of file authenticatebase.h.

bool bt::AuthenticateBase::finished [protected]

Definition at line 114 of file authenticatebase.h.

Uint8 bt::AuthenticateBase::handshake[68] [protected]

Definition at line 115 of file authenticatebase.h.

bool bt::AuthenticateBase::local [protected]

Definition at line 118 of file authenticatebase.h.

int bt::AuthenticateBase::poll_index [protected]

Definition at line 119 of file authenticatebase.h.

mse::StreamSocket* bt::AuthenticateBase::sock [protected]

Definition at line 112 of file authenticatebase.h.

QTimer bt::AuthenticateBase::timer [protected]

Definition at line 113 of file authenticatebase.h.


The documentation for this class was generated from the following files:
  • authenticatebase.h
  • authenticatebase.cpp

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal