Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

Packet Class Reference

#include <evapacket.h>

Inherited by InPacket, and OutPacket.

Inheritance diagram for Packet:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Packet ()
 Packet (const short version, const short command, const short sequence)
 Packet (unsigned char *buf, int *len)
 Packet (const Packet &rhs)
 ~Packet ()
bool operator== (const Packet &rhs) const
Packetoperator= (const Packet &rhs)
const int hashCode ()
const short getVersion () const
const short getCommand () const
const short getSequence () const
void setVersion (const short version)
void setCommand (const short command)
void setSequence (const short sequence)

Static Public Member Functions

static const int getQQ ()
static void setQQ (const int id)
static void setUDP (bool isUDP)
static bool isUDP ()
static void setPasswordKey (const unsigned char *pkey)
static bool isLoginTokenSet ()
static bool isClientKeySet ()
static bool isFileAgentKeySet ()
static bool isFileAgentTokenSet ()
static unsigned char * getFileAgentKey ()
static unsigned char * getFileAgentToken ()
static unsigned int getFileAgentTokenLength ()
static unsigned char * getFileShareToken ()
static unsigned char * getClientKey ()
static const int getClientKeyLength ()
static void clearAllKeys ()

Static Protected Member Functions

static unsigned char * getSessionKey ()
static unsigned char * getPasswordKey ()
static unsigned char * getFileSessionKey ()
static unsigned char * getLoginToken ()
static const int getLoginTokenLength ()
static void setSessionKey (const unsigned char *skey)
static void setFileSessionKey (const unsigned char *fskey)
static void setLoginToken (const unsigned char *token, const int length)
static void setClientKey (const unsigned char *ckey, const int length)
static void setFileAgentKey (const unsigned char *key)
static void setFileAgentToken (const unsigned char *token, const int length)
static void setFileShareToken (const unsigned char *token)

Protected Attributes

short version
short command
short sequence

Static Protected Attributes

static unsigned char iniKey [16]

Static Private Attributes

static int qqNum = -1
static bool mIsUDP = true
static unsigned char * sessionKey = NULL
static unsigned char * passwordKey = NULL
static unsigned char * fileSessionKey = NULL
static unsigned char * loginToken = NULL
static int loginTokenLength = 0
static unsigned char * fileAgentKey = NULL
static unsigned char * fileAgentToken = NULL
static int fileAgentTokenLength = 0
static unsigned char * clientKey = NULL
static int clientKeyLength = 0
static unsigned char * fileShareToken = NULL

Detailed Description

Definition at line 26 of file evapacket.h.


Constructor & Destructor Documentation

Packet::Packet  )  [inline]
 

Definition at line 28 of file evapacket.h.

Packet::Packet const short  version,
const short  command,
const short  sequence
 

Definition at line 53 of file evapacket.cpp.

Packet::Packet unsigned char *  buf,
int *  len
 

Definition at line 60 of file evapacket.cpp.

References command, mIsUDP, sequence, and version.

Packet::Packet const Packet rhs  ) 
 

Definition at line 87 of file evapacket.cpp.

Packet::~Packet  ) 
 

Definition at line 92 of file evapacket.cpp.


Member Function Documentation

void Packet::clearAllKeys  )  [static]
 

Definition at line 195 of file evapacket.cpp.

References clientKey, clientKeyLength, fileAgentKey, fileAgentToken, fileAgentTokenLength, fileSessionKey, fileShareToken, loginToken, loginTokenLength, passwordKey, and sessionKey.

static unsigned char* Packet::getClientKey  )  [inline, static]
 

Definition at line 65 of file evapacket.h.

References clientKey.

static const int Packet::getClientKeyLength  )  [inline, static]
 

Definition at line 66 of file evapacket.h.

References clientKeyLength.

const short Packet::getCommand  )  const [inline]
 

Definition at line 41 of file evapacket.h.

References command.

Referenced by operator=(), operator==(), and InPacket::setInPacket().

static unsigned char* Packet::getFileAgentKey  )  [inline, static]
 

Definition at line 61 of file evapacket.h.

References fileAgentKey.

Referenced by SendFileNotifyAgentPacket::putContents().

static unsigned char* Packet::getFileAgentToken  )  [inline, static]
 

Definition at line 62 of file evapacket.h.

References fileAgentToken.

static unsigned int Packet::getFileAgentTokenLength  )  [inline, static]
 

Definition at line 63 of file evapacket.h.

References fileAgentTokenLength.

static unsigned char* Packet::getFileSessionKey  )  [inline, static, protected]
 

Definition at line 79 of file evapacket.h.

References fileSessionKey.

Referenced by SendIM::putBody().

static unsigned char* Packet::getFileShareToken  )  [inline, static]
 

Definition at line 64 of file evapacket.h.

References fileShareToken.

static unsigned char* Packet::getLoginToken  )  [inline, static, protected]
 

Definition at line 80 of file evapacket.h.

References loginToken.

Referenced by LoginPacket::putBody().

static const int Packet::getLoginTokenLength  )  [inline, static, protected]
 

Definition at line 81 of file evapacket.h.

References loginTokenLength.

Referenced by LoginPacket::putBody().

static unsigned char* Packet::getPasswordKey  )  [inline, static, protected]
 

Definition at line 78 of file evapacket.h.

References passwordKey.

Referenced by InPacket::decryptBody(), LogoutPacket::putBody(), and LoginPacket::putBody().

static const int Packet::getQQ  )  [inline, static]
 

Definition at line 50 of file evapacket.h.

References qqNum.

Referenced by ModifyInfoReplyPacket::parseBody(), QunCreatePacket::putBody(), KeepAlivePacket::putBody(), SendIM::putBody(), and OutPacket::putHead().

const short Packet::getSequence  )  const [inline]
 

Definition at line 42 of file evapacket.h.

References sequence.

Referenced by operator=(), ReceiveIMPacket::operator=(), operator==(), ReceiveIMPacket::ReceiveIMPacket(), and InPacket::setInPacket().

static unsigned char* Packet::getSessionKey  )  [inline, static, protected]
 

Definition at line 77 of file evapacket.h.

References sessionKey.

Referenced by InPacket::decryptBody(), OutPacket::encryptBody(), and LoginReplyPacket::parseBody().

const short Packet::getVersion  )  const [inline]
 

Definition at line 40 of file evapacket.h.

References version.

Referenced by operator=(), and InPacket::setInPacket().

const int Packet::hashCode  ) 
 

Definition at line 110 of file evapacket.cpp.

References command, and sequence.

static bool Packet::isClientKeySet  )  [inline, static]
 

Definition at line 57 of file evapacket.h.

References clientKeyLength.

static bool Packet::isFileAgentKeySet  )  [inline, static]
 

Definition at line 58 of file evapacket.h.

References fileAgentKey.

static bool Packet::isFileAgentTokenSet  )  [inline, static]
 

Definition at line 59 of file evapacket.h.

References fileAgentToken.

static bool Packet::isLoginTokenSet  )  [inline, static]
 

Definition at line 56 of file evapacket.h.

References loginToken.

static bool Packet::isUDP  )  [inline, static]
 

Definition at line 54 of file evapacket.h.

References mIsUDP.

Referenced by OutPacket::fill(), operator=(), and OutPacket::putHead().

Packet & Packet::operator= const Packet rhs  ) 
 

Definition at line 101 of file evapacket.cpp.

References command, getCommand(), getSequence(), getVersion(), isUDP(), mIsUDP, sequence, and version.

Here is the call graph for this function:

bool Packet::operator== const Packet rhs  )  const
 

Definition at line 96 of file evapacket.cpp.

References command, getCommand(), getSequence(), and sequence.

Here is the call graph for this function:

void Packet::setClientKey const unsigned char *  ckey,
const int  length
[static, protected]
 

Definition at line 148 of file evapacket.cpp.

References clientKey, and clientKeyLength.

Referenced by LoginReplyPacket::parseBody().

void Packet::setCommand const short  command  )  [inline]
 

Definition at line 46 of file evapacket.h.

void Packet::setFileAgentKey const unsigned char *  key  )  [static, protected]
 

Definition at line 157 of file evapacket.cpp.

References fileAgentKey, and QQ_KEY_LENGTH.

Referenced by EvaRequestKeyReplyPacket::parseBody().

void Packet::setFileAgentToken const unsigned char *  token,
const int  length
[static, protected]
 

Definition at line 171 of file evapacket.cpp.

References fileAgentToken, and fileAgentTokenLength.

Referenced by EvaRequestKeyReplyPacket::parseBody().

void Packet::setFileSessionKey const unsigned char *  fskey  )  [static, protected]
 

Definition at line 131 of file evapacket.cpp.

References fileSessionKey, and QQ_KEY_LENGTH.

Referenced by LoginReplyPacket::parseBody().

void Packet::setFileShareToken const unsigned char *  token  )  [static, protected]
 

Definition at line 186 of file evapacket.cpp.

References fileShareToken.

Referenced by LoginReplyPacket::parseBody().

void Packet::setLoginToken const unsigned char *  token,
const int  length
[static, protected]
 

Definition at line 139 of file evapacket.cpp.

References loginToken, and loginTokenLength.

Referenced by RequestLoginTokenReplyPacket::parseBody().

void Packet::setPasswordKey const unsigned char *  pkey  )  [static]
 

Definition at line 123 of file evapacket.cpp.

References passwordKey, and QQ_KEY_LENGTH.

static void Packet::setQQ const int  id  )  [inline, static]
 

Reimplemented in EvaMemoPacket, EvaMemoReplyPacket, QunModifyCardPacket, QunAdminOpPacket, QunTransferPacket, and SearchUserPacket.

Definition at line 51 of file evapacket.h.

References qqNum.

void Packet::setSequence const short  sequence  )  [inline]
 

Definition at line 47 of file evapacket.h.

void Packet::setSessionKey const unsigned char *  skey  )  [static, protected]
 

Definition at line 115 of file evapacket.cpp.

References QQ_KEY_LENGTH, and sessionKey.

Referenced by LoginReplyPacket::parseBody().

static void Packet::setUDP bool  isUDP  )  [inline, static]
 

Definition at line 53 of file evapacket.h.

References mIsUDP.

void Packet::setVersion const short  version  )  [inline]
 

Definition at line 45 of file evapacket.h.


Member Data Documentation

unsigned char * Packet::clientKey = NULL [static, private]
 

Reimplemented in LoginReplyPacket.

Definition at line 103 of file evapacket.h.

Referenced by clearAllKeys(), getClientKey(), and setClientKey().

int Packet::clientKeyLength = 0 [static, private]
 

Definition at line 104 of file evapacket.h.

Referenced by clearAllKeys(), getClientKeyLength(), isClientKeySet(), and setClientKey().

short Packet::command [protected]
 

Definition at line 71 of file evapacket.h.

Referenced by InPacket::decryptBody(), OutPacket::encryptBody(), getCommand(), hashCode(), operator=(), operator==(), Packet(), OutPacket::putHead(), and InPacket::setInPacket().

unsigned char * Packet::fileAgentKey = NULL [static, private]
 

Definition at line 99 of file evapacket.h.

Referenced by clearAllKeys(), getFileAgentKey(), isFileAgentKeySet(), and setFileAgentKey().

unsigned char * Packet::fileAgentToken = NULL [static, private]
 

Definition at line 100 of file evapacket.h.

Referenced by clearAllKeys(), getFileAgentToken(), isFileAgentTokenSet(), and setFileAgentToken().

int Packet::fileAgentTokenLength = 0 [static, private]
 

Definition at line 101 of file evapacket.h.

Referenced by clearAllKeys(), getFileAgentTokenLength(), and setFileAgentToken().

unsigned char * Packet::fileSessionKey = NULL [static, private]
 

Definition at line 95 of file evapacket.h.

Referenced by clearAllKeys(), getFileSessionKey(), and setFileSessionKey().

unsigned char * Packet::fileShareToken = NULL [static, private]
 

Definition at line 106 of file evapacket.h.

Referenced by clearAllKeys(), getFileShareToken(), and setFileShareToken().

unsigned char Packet::iniKey [static, protected]
 

Initial value:

 {
                        0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
                        0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
                        }

Definition at line 74 of file evapacket.h.

Referenced by InPacket::decryptBody(), and LoginPacket::putBody().

unsigned char * Packet::loginToken = NULL [static, private]
 

Definition at line 96 of file evapacket.h.

Referenced by clearAllKeys(), getLoginToken(), isLoginTokenSet(), and setLoginToken().

int Packet::loginTokenLength = 0 [static, private]
 

Definition at line 97 of file evapacket.h.

Referenced by clearAllKeys(), getLoginTokenLength(), and setLoginToken().

bool Packet::mIsUDP = true [static, private]
 

Definition at line 92 of file evapacket.h.

Referenced by isUDP(), operator=(), Packet(), and setUDP().

unsigned char * Packet::passwordKey = NULL [static, private]
 

Definition at line 94 of file evapacket.h.

Referenced by clearAllKeys(), InPacket::decryptBody(), getPasswordKey(), and setPasswordKey().

int Packet::qqNum = -1 [static, private]
 

Reimplemented in AddFriendPacket, LoginReplyPacket, QunRequestCardPacket, QunModifyCardPacket, QunAdminOpPacket, QunTransferPacket, and GetUserInfoPacket.

Definition at line 91 of file evapacket.h.

Referenced by getQQ(), and setQQ().

short Packet::sequence [protected]
 

Definition at line 72 of file evapacket.h.

Referenced by getSequence(), hashCode(), LogoutPacket::LogoutPacket(), operator=(), ReceiveIMPacket::operator=(), operator==(), Packet(), SendIM::putBody(), OutPacket::putHead(), ReceiveIMPacket::ReceiveIMPacket(), and InPacket::setInPacket().

unsigned char * Packet::sessionKey = NULL [static, private]
 

Definition at line 93 of file evapacket.h.

Referenced by clearAllKeys(), InPacket::decryptBody(), OutPacket::encryptBody(), getSessionKey(), and setSessionKey().

short Packet::version [protected]
 

Definition at line 70 of file evapacket.h.

Referenced by getVersion(), operator=(), Packet(), SendIM::putBody(), OutPacket::putHead(), and InPacket::setInPacket().


The documentation for this class was generated from the following files:
Generated on Mon May 15 20:51:42 2006 for libeva by  doxygen 1.4.4