LLTemplateMessageReader Class Reference

#include <lltemplatemessagereader.h>

Inheritance diagram for LLTemplateMessageReader:

Inheritance graph
[legend]
Collaboration diagram for LLTemplateMessageReader:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::map< U32, LLMessageTemplate * > message_template_number_map_t

Public Member Functions

 LLTemplateMessageReader (message_template_number_map_t &)
virtual ~LLTemplateMessageReader ()
virtual void getBinaryData (const char *blockname, const char *varname, void *datap, S32 size, S32 blocknum=0, S32 max_size=S32_MAX)
virtual void getBOOL (const char *block, const char *var, BOOL &data, S32 blocknum=0)
virtual void getS8 (const char *block, const char *var, S8 &data, S32 blocknum=0)
virtual void getU8 (const char *block, const char *var, U8 &data, S32 blocknum=0)
virtual void getS16 (const char *block, const char *var, S16 &data, S32 blocknum=0)
virtual void getU16 (const char *block, const char *var, U16 &data, S32 blocknum=0)
virtual void getS32 (const char *block, const char *var, S32 &data, S32 blocknum=0)
virtual void getF32 (const char *block, const char *var, F32 &data, S32 blocknum=0)
virtual void getU32 (const char *block, const char *var, U32 &data, S32 blocknum=0)
virtual void getU64 (const char *block, const char *var, U64 &data, S32 blocknum=0)
virtual void getF64 (const char *block, const char *var, F64 &data, S32 blocknum=0)
virtual void getVector3 (const char *block, const char *var, LLVector3 &vec, S32 blocknum=0)
virtual void getVector4 (const char *block, const char *var, LLVector4 &vec, S32 blocknum=0)
virtual void getVector3d (const char *block, const char *var, LLVector3d &vec, S32 blocknum=0)
virtual void getQuat (const char *block, const char *var, LLQuaternion &q, S32 blocknum=0)
virtual void getUUID (const char *block, const char *var, LLUUID &uuid, S32 blocknum=0)
virtual void getIPAddr (const char *block, const char *var, U32 &ip, S32 blocknum=0)
virtual void getIPPort (const char *block, const char *var, U16 &port, S32 blocknum=0)
virtual void getString (const char *block, const char *var, S32 buffer_size, char *buffer, S32 blocknum=0)
virtual S32 getNumberOfBlocks (const char *blockname)
virtual S32 getSize (const char *blockname, const char *varname)
virtual S32 getSize (const char *blockname, S32 blocknum, const char *varname)
virtual void clearMessage ()
virtual const char * getMessageName () const
virtual S32 getMessageSize () const
virtual void copyToBuilder (LLMessageBuilder &) const
BOOL validateMessage (const U8 *buffer, S32 buffer_size, const LLHost &sender)
BOOL readMessage (const U8 *buffer, const LLHost &sender)
bool isTrusted () const
bool isBanned (bool trusted_source) const

Private Member Functions

void getData (const char *blockname, const char *varname, void *datap, S32 size=0, S32 blocknum=0, S32 max_size=S32_MAX)
BOOL decodeTemplate (const U8 *buffer, S32 buffer_size, LLMessageTemplate **msg_template)
void logRanOffEndOfPacket (const LLHost &host, const S32 where, const S32 wanted)
BOOL decodeData (const U8 *buffer, const LLHost &sender)

Private Attributes

S32 mReceiveSize
LLMessageTemplatemCurrentRMessageTemplate
LLMsgDatamCurrentRMessageData
message_template_number_map_tmMessageNumbers

Detailed Description

Definition at line 42 of file lltemplatemessagereader.h.


Member Typedef Documentation

typedef std::map<U32, LLMessageTemplate*> LLTemplateMessageReader::message_template_number_map_t

Definition at line 46 of file lltemplatemessagereader.h.


Constructor & Destructor Documentation

LLTemplateMessageReader::LLTemplateMessageReader ( message_template_number_map_t  ) 

Definition at line 45 of file lltemplatemessagereader.cpp.

LLTemplateMessageReader::~LLTemplateMessageReader (  )  [virtual]

Definition at line 55 of file lltemplatemessagereader.cpp.

References mCurrentRMessageData, and NULL.


Member Function Documentation

void LLTemplateMessageReader::clearMessage (  )  [virtual]

Implements LLMessageReader.

Definition at line 62 of file lltemplatemessagereader.cpp.

References mCurrentRMessageData, mCurrentRMessageTemplate, mReceiveSize, and NULL.

void LLTemplateMessageReader::copyToBuilder ( LLMessageBuilder  )  const [virtual]

Implements LLMessageReader.

Definition at line 793 of file lltemplatemessagereader.cpp.

References LLMessageBuilder::copyFromMessageData(), mCurrentRMessageData, mCurrentRMessageTemplate, and NULL.

BOOL LLTemplateMessageReader::decodeData ( const U8 buffer,
const LLHost sender 
) [private]

Definition at line 528 of file lltemplatemessagereader.cpp.

References LLMsgData::addBlock(), LLMsgBlkData::addData(), LLMsgBlkData::addVariable(), LLMessageTemplate::callHandlerFunc(), FALSE, LLFastTimer::FTM_PROCESS_MESSAGES, LLTimer::getElapsedTimeF32(), LLMessageReader::getTimeDecodes(), LLMessageReader::getTimeDecodesSpamThreshold(), LLMessageSystem::getTimingCallback(), LLMessageSystem::getTimingCallbackData(), gMessageSystem, htonmemcpy(), i, LL_PACKET_ID_SIZE, llassert, lldebugs, llendl, llerrs, llwarns, logRanOffEndOfPacket(), MBT_MULTIPLE, MBT_SINGLE, MBT_VARIABLE, mCurrentRMessageData, mCurrentRMessageTemplate, LLMessageTemplate::mDecodeTimeThisFrame, LLMessageTemplate::mFrequency, LLMessageTemplate::mMaxDecodeTimePerMsg, LLMsgData::mMemberBlocks, LLMessageTemplate::mMemberBlocks, LLMsgBlkData::mName, LLMessageTemplate::mName, mReceiveSize, LLMessageTemplate::mTotalDecoded, LLMessageTemplate::mTotalDecodeTime, MVT_U16, MVT_U32, MVT_U8, MVT_VARIABLE, NULL, PHL_OFFSET, LLTimer::reset(), S32, size, t, and TRUE.

Referenced by readMessage().

BOOL LLTemplateMessageReader::decodeTemplate ( const U8 buffer,
S32  buffer_size,
LLMessageTemplate **  msg_template 
) [private]

Definition at line 443 of file lltemplatemessagereader.cpp.

References LLMessageSystem::callExceptionFunc(), FALSE, get_ptr_in_map(), gMessageSystem, LL_MINIMUM_VALID_PACKET_SIZE, LL_PACKET_ID_SIZE, llendl, llwarns, mMessageNumbers, MX_UNREGISTERED_MESSAGE, S32, and TRUE.

Referenced by validateMessage().

void LLTemplateMessageReader::getBinaryData ( const char *  blockname,
const char *  varname,
void datap,
S32  size,
S32  blocknum = 0,
S32  max_size = S32_MAX 
) [virtual]

All get* methods expect pointers to canonical strings.

Implements LLMessageReader.

Definition at line 271 of file lltemplatemessagereader.cpp.

References getData().

void LLTemplateMessageReader::getBOOL ( const char *  block,
const char *  var,
BOOL data,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 291 of file lltemplatemessagereader.cpp.

References getData().

void LLTemplateMessageReader::getData ( const char *  blockname,
const char *  varname,
void datap,
S32  size = 0,
S32  blocknum = 0,
S32  max_size = S32_MAX 
) [private]

Definition at line 70 of file lltemplatemessagereader.cpp.

References LLMsgVarData::getData(), LLMsgVarData::getName(), LLMsgVarData::getSize(), llendl, llerrs, llwarns, mCurrentRMessageData, LLMsgData::mMemberBlocks, LLMsgBlkData::mMemberVarData, LLMsgData::mName, mReceiveSize, and S32.

Referenced by getBinaryData(), getBOOL(), getF32(), getF64(), getIPAddr(), getIPPort(), getQuat(), getS16(), getS32(), getS8(), getString(), getU16(), getU32(), getU64(), getU8(), getUUID(), getVector3(), getVector3d(), and getVector4().

void LLTemplateMessageReader::getF32 ( const char *  block,
const char *  var,
F32 data,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 329 of file lltemplatemessagereader.cpp.

References getData(), llendl, llfinite, and llwarns.

void LLTemplateMessageReader::getF64 ( const char *  block,
const char *  var,
F64 data,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 342 of file lltemplatemessagereader.cpp.

References getData(), llendl, llfinite, and llwarns.

void LLTemplateMessageReader::getIPAddr ( const char *  block,
const char *  var,
U32 ip,
S32  blocknum = 0 
) [inline, virtual]

Implements LLMessageReader.

Definition at line 418 of file lltemplatemessagereader.cpp.

References getData().

void LLTemplateMessageReader::getIPPort ( const char *  block,
const char *  var,
U16 port,
S32  blocknum = 0 
) [inline, virtual]

Implements LLMessageReader.

Definition at line 423 of file lltemplatemessagereader.cpp.

References getData().

const char * LLTemplateMessageReader::getMessageName (  )  const [virtual]

Returns pointer to canonical (prehashed) string.

Implements LLMessageReader.

Definition at line 770 of file lltemplatemessagereader.cpp.

References llendl, llwarns, mCurrentRMessageTemplate, and LLMessageTemplate::mName.

Referenced by LLMessageSystem::checkMessages(), and logRanOffEndOfPacket().

S32 LLTemplateMessageReader::getMessageSize (  )  const [virtual]

Implements LLMessageReader.

Definition at line 437 of file lltemplatemessagereader.cpp.

References mReceiveSize.

S32 LLTemplateMessageReader::getNumberOfBlocks ( const char *  blockname  )  [virtual]

Implements LLMessageReader.

Definition at line 153 of file lltemplatemessagereader.cpp.

References llendl, llerrs, mCurrentRMessageData, LLMsgData::mMemberBlocks, and mReceiveSize.

void LLTemplateMessageReader::getQuat ( const char *  block,
const char *  var,
LLQuaternion q,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 395 of file lltemplatemessagereader.cpp.

References getData(), LLVector3::isFinite(), llendl, llwarns, LLQuaternion::loadIdentity(), LLVector3::mV, and LLQuaternion::unpackFromVector3().

void LLTemplateMessageReader::getS16 ( const char *  block,
const char *  var,
S16 data,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 299 of file lltemplatemessagereader.cpp.

References getData().

void LLTemplateMessageReader::getS32 ( const char *  block,
const char *  var,
S32 data,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 311 of file lltemplatemessagereader.cpp.

References getData(), and S32.

void LLTemplateMessageReader::getS8 ( const char *  block,
const char *  var,
S8 data,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 279 of file lltemplatemessagereader.cpp.

References getData().

S32 LLTemplateMessageReader::getSize ( const char *  blockname,
S32  blocknum,
const char *  varname 
) [virtual]

Implements LLMessageReader.

Definition at line 231 of file lltemplatemessagereader.cpp.

References LLMsgVarData::getName(), LLMsgVarData::getSize(), llendl, llerrs, mCurrentRMessageData, LLMsgData::mMemberBlocks, LLMsgBlkData::mMemberVarData, LLMsgData::mName, and mReceiveSize.

S32 LLTemplateMessageReader::getSize ( const char *  blockname,
const char *  varname 
) [virtual]

Implements LLMessageReader.

Definition at line 183 of file lltemplatemessagereader.cpp.

References LLMsgVarData::getName(), LLMsgVarData::getSize(), llendl, llerrs, MBT_SINGLE, mCurrentRMessageData, mCurrentRMessageTemplate, LLMessageTemplate::mMemberBlocks, LLMsgData::mMemberBlocks, LLMsgBlkData::mMemberVarData, LLMsgData::mName, and mReceiveSize.

void LLTemplateMessageReader::getString ( const char *  block,
const char *  var,
S32  buffer_size,
char *  buffer,
S32  blocknum = 0 
) [inline, virtual]

Implements LLMessageReader.

Definition at line 429 of file lltemplatemessagereader.cpp.

References getData().

void LLTemplateMessageReader::getU16 ( const char *  block,
const char *  var,
U16 data,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 305 of file lltemplatemessagereader.cpp.

References getData().

void LLTemplateMessageReader::getU32 ( const char *  block,
const char *  var,
U32 data,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 317 of file lltemplatemessagereader.cpp.

References getData().

void LLTemplateMessageReader::getU64 ( const char *  block,
const char *  var,
U64 data,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 323 of file lltemplatemessagereader.cpp.

References getData().

void LLTemplateMessageReader::getU8 ( const char *  block,
const char *  var,
U8 data,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 285 of file lltemplatemessagereader.cpp.

References getData().

void LLTemplateMessageReader::getUUID ( const char *  block,
const char *  var,
LLUUID uuid,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 412 of file lltemplatemessagereader.cpp.

References getData(), and u.

void LLTemplateMessageReader::getVector3 ( const char *  block,
const char *  var,
LLVector3 vec,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 355 of file lltemplatemessagereader.cpp.

References getData(), llendl, llwarns, and v.

void LLTemplateMessageReader::getVector3d ( const char *  block,
const char *  var,
LLVector3d vec,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 381 of file lltemplatemessagereader.cpp.

References getData(), llendl, llwarns, and v.

void LLTemplateMessageReader::getVector4 ( const char *  block,
const char *  var,
LLVector4 vec,
S32  blocknum = 0 
) [virtual]

Implements LLMessageReader.

Definition at line 368 of file lltemplatemessagereader.cpp.

References getData(), llendl, llwarns, and v.

bool LLTemplateMessageReader::isBanned ( bool  trusted_source  )  const

Definition at line 787 of file lltemplatemessagereader.cpp.

References LLMessageTemplate::isBanned(), and mCurrentRMessageTemplate.

Referenced by LLMessageSystem::checkMessages().

bool LLTemplateMessageReader::isTrusted (  )  const

Definition at line 781 of file lltemplatemessagereader.cpp.

References LLMessageTemplate::getTrust(), mCurrentRMessageTemplate, and MT_TRUST.

Referenced by LLMessageSystem::checkMessages().

void LLTemplateMessageReader::logRanOffEndOfPacket ( const LLHost host,
const S32  where,
const S32  wanted 
) [private]

Definition at line 508 of file lltemplatemessagereader.cpp.

References LLMessageSystem::callExceptionFunc(), getMessageName(), gMessageSystem, llendl, llinfos, llwarns, mCurrentRMessageTemplate, LLMessageTemplate::mName, mReceiveSize, LLMessageSystem::mVerboseLog, and MX_RAN_OFF_END_OF_PACKET.

Referenced by decodeData().

BOOL LLTemplateMessageReader::readMessage ( const U8 buffer,
const LLHost sender 
)

Definition at line 763 of file lltemplatemessagereader.cpp.

References decodeData().

Referenced by LLMessageSystem::checkMessages(), and tut::LLTemplateMessageBuilderTestData::setReader().

BOOL LLTemplateMessageReader::validateMessage ( const U8 buffer,
S32  buffer_size,
const LLHost sender 
)

Definition at line 747 of file lltemplatemessagereader.cpp.

References decodeTemplate(), lldebugst, llendl, mCurrentRMessageTemplate, LLMessageTemplate::mName, LLMessageTemplate::mReceiveCount, and mReceiveSize.

Referenced by LLMessageSystem::checkMessages(), and tut::LLTemplateMessageBuilderTestData::setReader().


Member Data Documentation

LLMsgData* LLTemplateMessageReader::mCurrentRMessageData [private]

Definition at line 125 of file lltemplatemessagereader.h.

Referenced by clearMessage(), copyToBuilder(), decodeData(), getData(), getNumberOfBlocks(), getSize(), and ~LLTemplateMessageReader().

LLMessageTemplate* LLTemplateMessageReader::mCurrentRMessageTemplate [private]

Definition at line 124 of file lltemplatemessagereader.h.

Referenced by clearMessage(), copyToBuilder(), decodeData(), getMessageName(), getSize(), isBanned(), isTrusted(), logRanOffEndOfPacket(), and validateMessage().

message_template_number_map_t& LLTemplateMessageReader::mMessageNumbers [private]

Definition at line 126 of file lltemplatemessagereader.h.

Referenced by decodeTemplate().

S32 LLTemplateMessageReader::mReceiveSize [private]

Definition at line 123 of file lltemplatemessagereader.h.

Referenced by clearMessage(), decodeData(), getData(), getMessageSize(), getNumberOfBlocks(), getSize(), logRanOffEndOfPacket(), and validateMessage().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:50 2010 for Second Life Viewer by  doxygen 1.4.7