ED2KPacket::Hello Class Reference

Hello packet is used to initialize a communication with another client. More...

#include <packets.h>

Inheritance diagram for ED2KPacket::Hello:

ED2KPacket::Packet ED2KPacket::HelloAnswer List of all members.

Public Member Functions

 Hello (uint8_t proto=PR_ED2K, const std::string &modStr="")
 Hello (std::istream &i, bool hashLen=true)
 operator std::string ()
Hash< MD4Hash > getHash () const
IPV4Address getClientAddr () const
IPV4Address getServerAddr () const
std::string getNick () const
uint32_t getVersion () const
std::string getModStr () const
uint32_t getMuleVer () const
uint16_t getUdpPort () const
uint32_t getFeatures () const

Protected Member Functions

void load (std::istream &i, bool hashLen=true)
std::string save (uint8_t opcode, bool hashLen=true)

Private Attributes

Hash< MD4Hash > m_hash
IPV4Address m_clientAddr
 Client ip address/port.
IPV4Address m_serverAddr
 Server ip address/port.
std::string m_nick
 User nick.
uint32_t m_version
 User client version.
std::string m_modStr
 User client mod string.
uint32_t m_muleVer
 Mule version.
uint16_t m_udpPort
 UDP port.
uint32_t m_features
 eMule extended features bitset

Detailed Description

Hello packet is used to initialize a communication with another client.

The packet contains a set of information about ourselves.

Definition at line 471 of file packets.h.

Constructor & Destructor Documentation

ED2KPacket::Hello::Hello uint8_t  proto = PR_ED2K,
const std::string &  modStr = ""

Definition at line 565 of file packets.cpp.

ED2KPacket::Hello::Hello std::istream &  i,
bool  hashLen = true

Definition at line 568 of file packets.cpp.

References load().

Member Function Documentation

ED2KPacket::Hello::operator std::string  ) 

Reimplemented in ED2KPacket::HelloAnswer.

Definition at line 615 of file packets.cpp.

References OP_HELLO, and save().

Hash<MD4Hash> ED2KPacket::Hello::getHash  )  const [inline]

Definition at line 477 of file packets.h.

References m_hash.

Referenced by save().

IPV4Address ED2KPacket::Hello::getClientAddr  )  const [inline]

Definition at line 478 of file packets.h.

References m_clientAddr.

IPV4Address ED2KPacket::Hello::getServerAddr  )  const [inline]

Definition at line 479 of file packets.h.

References m_serverAddr.

std::string ED2KPacket::Hello::getNick  )  const [inline]

Definition at line 480 of file packets.h.

References m_nick.

Referenced by save().

uint32_t ED2KPacket::Hello::getVersion  )  const [inline]

Definition at line 481 of file packets.h.

References m_version.

std::string ED2KPacket::Hello::getModStr  )  const [inline]

Definition at line 482 of file packets.h.

References m_modStr.

uint32_t ED2KPacket::Hello::getMuleVer  )  const [inline]

Definition at line 483 of file packets.h.

References m_muleVer.

uint16_t ED2KPacket::Hello::getUdpPort  )  const [inline]

Definition at line 484 of file packets.h.

References m_udpPort.

Referenced by save().

uint32_t ED2KPacket::Hello::getFeatures  )  const [inline]

Definition at line 485 of file packets.h.

References m_features.

void ED2KPacket::Hello::load std::istream &  i,
bool  hashLen = true

Definition at line 572 of file packets.cpp.

References CT_MISCFEATURES, CT_MODSTR, CT_MULEVERSION, CT_NICK, CT_PORT, CT_UDPPORTS, CT_VERSION, Tag::dump(), Tag::getInt(), Tag::getOpcode(), Tag::getStr(), m_clientAddr, m_features, m_hash, m_modStr, m_muleVer, m_nick, m_serverAddr, m_udpPort, and m_version.

Referenced by Hello().

std::string ED2KPacket::Hello::save uint8_t  opcode,
bool  hashLen = true

Definition at line 618 of file packets.cpp.

References CT_MODSTR, CT_MULEVERSION, CT_NICK, CT_UDPPORTS, CT_VERSION, getHash(), getNick(), getUdpPort(), m_modStr, ED2KPacket::Packet::makePacket(), and VER_OWN.

Referenced by ED2KPacket::HelloAnswer::operator std::string(), and operator std::string().

Member Data Documentation

Hash<MD4Hash> ED2KPacket::Hello::m_hash [private]


Definition at line 490 of file packets.h.

Referenced by getHash(), and load().

IPV4Address ED2KPacket::Hello::m_clientAddr [private]

Client ip address/port.

Definition at line 491 of file packets.h.

Referenced by getClientAddr(), and load().

IPV4Address ED2KPacket::Hello::m_serverAddr [private]

Server ip address/port.

Definition at line 492 of file packets.h.

Referenced by getServerAddr(), and load().

std::string ED2KPacket::Hello::m_nick [private]

User nick.

Definition at line 493 of file packets.h.

Referenced by getNick(), and load().

uint32_t ED2KPacket::Hello::m_version [private]

User client version.

Definition at line 494 of file packets.h.

Referenced by getVersion(), and load().

std::string ED2KPacket::Hello::m_modStr [private]

User client mod string.

Definition at line 495 of file packets.h.

Referenced by getModStr(), load(), and save().

uint32_t ED2KPacket::Hello::m_muleVer [private]

Mule version.

Definition at line 496 of file packets.h.

Referenced by getMuleVer(), and load().

uint16_t ED2KPacket::Hello::m_udpPort [private]

UDP port.

Definition at line 497 of file packets.h.

Referenced by getUdpPort(), and load().

uint32_t ED2KPacket::Hello::m_features [private]

eMule extended features bitset

Definition at line 498 of file packets.h.

Referenced by getFeatures(), and load().

The documentation for this class was generated from the following files: