kget
bt::Authenticate Class Reference
#include <authenticate.h>

Detailed Description
Authenicate a peer
After we connect to a peer, we need to authenticate the peer. This class handles this.
Definition at line 47 of file authenticate.h.
Public Member Functions | |
| Authenticate (const QString &ip, Uint16 port, const SHA1Hash &info_hash, const PeerID &peer_id, PeerManager *pman) | |
| const QString & | getIP () const |
| const PeerID & | getPeerID () const |
| Uint16 | getPort () const |
| bool | isSuccesfull () const |
| mse::StreamSocket * | takeSocket () |
| virtual | ~Authenticate () |
Protected Slots | |
| void | onPeerManagerDestroyed () |
| virtual void | onReadyRead () |
| virtual void | onReadyWrite () |
Protected Member Functions | |
| virtual void | connected () |
| void | handshakeReceived (bool full) |
| void | onFinish (bool succes) |
Protected Attributes | |
| QString | host |
| SHA1Hash | info_hash |
| PeerID | our_peer_id |
| PeerID | peer_id |
| PeerManager * | pman |
| Uint16 | port |
| net::Socks * | socks |
| bool | succes |
Constructor & Destructor Documentation
| bt::Authenticate::Authenticate | ( | const QString & | ip, | |
| Uint16 | port, | |||
| const SHA1Hash & | info_hash, | |||
| const PeerID & | peer_id, | |||
| PeerManager * | pman | |||
| ) |
Connect to a remote host first and authenicate it.
- Parameters:
-
ip IP-address of host port Port of host info_hash Info hash peer_id Peer ID pman PeerManager
Definition at line 30 of file authenticate.cpp.
| bt::Authenticate::~Authenticate | ( | ) | [virtual] |
Definition at line 76 of file authenticate.cpp.
Member Function Documentation
| void bt::Authenticate::connected | ( | ) | [protected, virtual] |
Definition at line 137 of file authenticate.cpp.
| const QString& bt::Authenticate::getIP | ( | ) | const [inline] |
Definition at line 79 of file authenticate.h.
| const PeerID& bt::Authenticate::getPeerID | ( | ) | const [inline] |
Definition at line 74 of file authenticate.h.
| Uint16 bt::Authenticate::getPort | ( | ) | const [inline] |
Definition at line 80 of file authenticate.h.
| void bt::Authenticate::handshakeReceived | ( | bool | full | ) | [protected, 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
Implements bt::AuthenticateBase.
Definition at line 158 of file authenticate.cpp.
| bool bt::Authenticate::isSuccesfull | ( | ) | const [inline] |
| void bt::Authenticate::onFinish | ( | bool | succes | ) | [protected, virtual] |
Authentication finished.
- Parameters:
-
succes Succes or not
Implements bt::AuthenticateBase.
Definition at line 142 of file authenticate.cpp.
| void bt::Authenticate::onPeerManagerDestroyed | ( | ) | [protected, slot] |
Definition at line 211 of file authenticate.cpp.
| void bt::Authenticate::onReadyRead | ( | ) | [protected, virtual, slot] |
We can read from the socket.
Reimplemented from bt::AuthenticateBase.
Definition at line 111 of file authenticate.cpp.
| void bt::Authenticate::onReadyWrite | ( | ) | [protected, virtual, slot] |
We can write to the socket (used to detect a succesfull connection).
Reimplemented from bt::AuthenticateBase.
Definition at line 81 of file authenticate.cpp.
| mse::StreamSocket * bt::Authenticate::takeSocket | ( | ) |
Get a pointer to the socket, and set it internally to NULL.
After a succesfull authentication, this is used to transfer ownership to a Peer object.
- Returns:
- The socket
Definition at line 204 of file authenticate.cpp.
Member Data Documentation
QString bt::Authenticate::host [protected] |
Definition at line 95 of file authenticate.h.
SHA1Hash bt::Authenticate::info_hash [protected] |
Definition at line 93 of file authenticate.h.
PeerID bt::Authenticate::our_peer_id [protected] |
Definition at line 94 of file authenticate.h.
PeerID bt::Authenticate::peer_id [protected] |
Definition at line 94 of file authenticate.h.
PeerManager* bt::Authenticate::pman [protected] |
Definition at line 98 of file authenticate.h.
Uint16 bt::Authenticate::port [protected] |
Definition at line 96 of file authenticate.h.
net::Socks* bt::Authenticate::socks [protected] |
Definition at line 99 of file authenticate.h.
bool bt::Authenticate::succes [protected] |
Definition at line 97 of file authenticate.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference