message.h File Reference

LLMessageSystem class header file. More...

#include <cstring>
#include <set>
#include "llerror.h"
#include "net.h"
#include "string_table.h"
#include "llcircuit.h"
#include "lltimer.h"
#include "llpacketring.h"
#include "llhost.h"
#include "llhttpclient.h"
#include "llhttpnode.h"
#include "llpacketack.h"
#include "message_prehash.h"
#include "llstl.h"
#include "llmsgvariabletype.h"

Include dependency graph for message.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  LLMessageStringTable
class  LLUseCircuitCodeResponder
class  LLMessageSystem
class  LLMessageSystem::LLMessageCountInfo

Typedefs

typedef void(*) msg_exception_callback (LLMessageSystem *, void *, EMessageException)
typedef void(*) message_handler_func_t (LLMessageSystem *msgsystem, void **user_data)

Enumerations

enum  EPacketHeaderLayout { PHL_FLAGS = 0, PHL_PACKET_ID = 1, PHL_OFFSET = 5, PHL_NAME = 6 }
enum  EMessageException { MX_UNREGISTERED_MESSAGE, MX_PACKET_TOO_SHORT, MX_RAN_OFF_END_OF_PACKET, MX_WROTE_PAST_BUFFER_SIZE }

Functions

BOOL start_messaging_system (const std::string &template_name, U32 port, S32 version_major, S32 version_minor, S32 version_patch, BOOL b_dump_prehash_file, const std::string &secret, const LLUseCircuitCodeResponder *responder=NULL)
void end_messaging_system ()
void null_message_callback (LLMessageSystem *msg, void **data)
static voidhtonmemcpy (void *vs, const void *vct, EMsgVariableType type, size_t n)
voidntohmemcpy (void *s, const void *ct, EMsgVariableType type, size_t n)

Variables

const U32 MESSAGE_MAX_STRINGS_LENGTH = 64
const U32 MESSAGE_NUMBER_OF_HASH_BUCKETS = 8192
const S32 MESSAGE_MAX_PER_FRAME = 400
LLMessageStringTable gMessageStringTable
const S32 MAX_MESSAGE_INTERNAL_NAME_SIZE = 255
const S32 MAX_BUFFER_SIZE = NET_BUFFER_SIZE
const S32 MAX_BLOCKS = 255
const U8 LL_ZERO_CODE_FLAG = 0x80
const U8 LL_RELIABLE_FLAG = 0x40
const U8 LL_RESENT_FLAG = 0x20
const U8 LL_ACK_FLAG = 0x10
const S32 LL_MINIMUM_VALID_PACKET_SIZE = LL_PACKET_ID_SIZE + 1
const S32 LL_DEFAULT_RELIABLE_RETRIES = 3
const F32 LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS = 1.f
const F32 LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS = 1.f
const F32 LL_PING_BASED_TIMEOUT_DUMMY = 0.0f
const F32 LL_SEMIRELIABLE_TIMEOUT_FACTOR = 5.f / 1000.f
const F32 LL_RELIABLE_TIMEOUT_FACTOR = 5.f / 1000.f
const F32 LL_FILE_XFER_TIMEOUT_FACTOR = 5.f / 1000.f
const F32 LL_LOST_TIMEOUT_FACTOR = 16.f / 1000.f
const F32 LL_MAX_LOST_TIMEOUT = 5.f
const S32 MAX_MESSAGE_COUNT_NUM = 1024
LLMessageSystemgMessageSystem


Detailed Description

LLMessageSystem class header file.

LicenseInfo
firstyear=2001&license=viewergpl

Copyright (c) 2001-2007, Linden Research, Inc.

Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlife.com/developers/opensource/gplv2

There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlife.com/developers/opensource/flossexception

By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.

ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$

Definition in file message.h.


Typedef Documentation

typedef void(*) message_handler_func_t(LLMessageSystem *msgsystem, void **user_data)

Definition at line 183 of file message.h.

typedef void(*) msg_exception_callback(LLMessageSystem *, void *, EMessageException)

Definition at line 182 of file message.h.


Enumeration Type Documentation

enum EMessageException

Enumerator:
MX_UNREGISTERED_MESSAGE 
MX_PACKET_TOO_SHORT 
MX_RAN_OFF_END_OF_PACKET 
MX_WROTE_PAST_BUFFER_SIZE 

Definition at line 175 of file message.h.

enum EPacketHeaderLayout

Enumerator:
PHL_FLAGS 
PHL_PACKET_ID 
PHL_OFFSET 
PHL_NAME 

Definition at line 138 of file message.h.


Function Documentation

void end_messaging_system (  ) 

Definition at line 2665 of file message.cpp.

References LLTransferManager::cleanup(), gMessageSystem, gTransferManager, llendl, llinfos, NULL, LLMessageSystem::stopLogging(), LLMessageSystem::summarizeLogs(), and LLTransferTargetVFile::updateQueue().

Referenced by cleanup_app().

static void* htonmemcpy ( void vs,
const void vct,
EMsgVariableType  type,
size_t  n 
) [inline, static]

Definition at line 798 of file message.h.

References i, llendl, llerrs, MVT_BOOL, MVT_F32, MVT_F64, MVT_FIXED, MVT_IP_ADDR, MVT_IP_PORT, MVT_LLQuaternion, MVT_LLUUID, MVT_LLVector3, MVT_LLVector3d, MVT_LLVector4, MVT_S16, MVT_S16Array, MVT_S32, MVT_S64, MVT_S8, MVT_U16, MVT_U16Quat, MVT_U16Vec3, MVT_U32, MVT_U64, MVT_U8, MVT_VARIABLE, s, and S32.

Referenced by LLMsgVarData::addData(), buildBlock(), LLTemplateMessageReader::decodeData(), LLGestureList::deserialize(), LLGesture::deserialize(), ntohmemcpy(), LLDataPackerBinaryBuffer::packBinaryData(), LLDataPackerBinaryBuffer::packBinaryDataFixed(), LLDataPackerBinaryBuffer::packColor4(), LLDataPackerBinaryBuffer::packColor4U(), LLHUDEffectSpiral::packData(), LLHUDEffectPointAt::packData(), LLHUDEffectLookAt::packData(), LLHUDEffectBeam::packData(), LLDataPackerBinaryBuffer::packF32(), LLSelectMgr::packMultipleUpdate(), LLDataPackerBinaryBuffer::packS32(), LLDataPackerBinaryBuffer::packString(), LLTextureAnim::packTAMessage(), LLPrimitive::packTEField(), LLDataPackerBinaryBuffer::packU16(), LLDataPackerBinaryBuffer::packU32(), LLDataPackerBinaryBuffer::packUUID(), LLDataPackerBinaryBuffer::packVector2(), LLDataPackerBinaryBuffer::packVector3(), LLDataPackerBinaryBuffer::packVector4(), LLViewerObject::processUpdateMessage(), LLXfer::sendPacket(), LLGestureList::serialize(), LLGesture::serialize(), LLDataPackerBinaryBuffer::unpackBinaryData(), LLDataPackerBinaryBuffer::unpackBinaryDataFixed(), LLDataPackerBinaryBuffer::unpackColor4(), LLDataPackerBinaryBuffer::unpackColor4U(), LLHUDEffectSpiral::unpackData(), LLHUDEffectPointAt::unpackData(), LLHUDEffectLookAt::unpackData(), LLHUDEffectBeam::unpackData(), LLDataPackerBinaryBuffer::unpackF32(), LLDataPackerBinaryBuffer::unpackS32(), LLTextureAnim::unpackTAMessage(), LLPrimitive::unpackTEField(), LLDataPackerBinaryBuffer::unpackU16(), LLDataPackerBinaryBuffer::unpackU32(), LLDataPackerBinaryBuffer::unpackUUID(), LLDataPackerBinaryBuffer::unpackVector2(), LLDataPackerBinaryBuffer::unpackVector3(), and LLDataPackerBinaryBuffer::unpackVector4().

void* ntohmemcpy ( void s,
const void ct,
EMsgVariableType  type,
size_t  n 
) [inline]

Definition at line 958 of file message.h.

References htonmemcpy().

Referenced by LLXferManager::processReceiveData().

void null_message_callback ( LLMessageSystem msg,
void **  data 
)

Definition at line 3305 of file message.cpp.

Referenced by callback_prepare_video(), LLMessageSystem::establishBidirectionalTrust(), LLAudioStreamMediaListener::handleEvent(), idle_startup(), register_viewer_callbacks(), and start_messaging_system().

BOOL start_messaging_system ( const std::string &  template_name,
U32  port,
S32  version_major,
S32  version_minor,
S32  version_patch,
BOOL  b_dump_prehash_file,
const std::string &  secret,
const LLUseCircuitCodeResponder responder = NULL 
)

Definition at line 2470 of file message.cpp.

References _PREHASH_AddCircuitCode, _PREHASH_CloseCircuit, _PREHASH_CompletePingCheck, _PREHASH_CreateTrustedCircuit, _PREHASH_DenyTrustedCircuit, _PREHASH_OpenCircuit, _PREHASH_PacketAck, _PREHASH_StartPingCheck, _PREHASH_UseCircuitCode, close_circuit(), dump_prehash_files(), FALSE, g_shared_secret, gMessageSystem, gPrehashVersionNumber, gTransferManager, LLTransferManager::init(), init_prehash_data(), LLMessageSystem::isOK(), llendl, llerrs, llinfos, LLMessageSystem::mMessageFileVersionNumber, NULL, null_message_callback(), open_circuit(), process_complete_ping_check(), process_create_trusted_circuit(), process_deny_trusted_circuit(), process_packet_ack(), process_start_ping_check(), LLMessageSystem::processAddCircuitCode(), LLMessageSystem::processError(), LLMessageSystem::processUseCircuitCode(), LLMessageSystem::setHandlerFunc(), LLMessageSystem::setHandlerFuncFast(), and TRUE.

Referenced by tut::LLTemplateMessageBuilderTestData::defaultTemplate(), idle_startup(), and tut::LLMessageSystemTestData::LLMessageSystemTestData().


Variable Documentation

LLMessageStringTable gMessageStringTable

Definition at line 49 of file message_string_table.cpp.

Referenced by LLMessageSystem::addBinaryData(), LLMessageSystem::addBOOL(), LLMessageSystem::addF32(), LLMessageSystem::addF64(), LLMessageSystem::addHandlerFunc(), LLMessageSystem::addIPAddr(), LLMessageSystem::addIPPort(), LLMessageSystem::addQuat(), LLMessageSystem::addS16(), LLMessageSystem::addS32(), LLMessageSystem::addS8(), LLMessageSystem::addString(), LLMessageSystem::addU16(), LLMessageSystem::addU32(), LLMessageSystem::addU64(), LLMessageSystem::addU8(), LLMessageSystem::addUUID(), LLMessageSystem::addVector3(), LLMessageSystem::addVector3d(), LLMessageSystem::addVector4(), LLMessageSystem::callHandler(), check_for_unrecognized_messages(), LLMessageSystem::delHandlerFunc(), LLMessageSystem::dispatch(), dump_prehash_files(), tut::LLSDMessageReaderTestData::ensureMessageName(), findTemplate(), LLMessageSystem::getBinaryData(), LLMessageSystem::getBOOL(), LLMessageSystem::getF32(), LLMessageSystem::getF64(), LLMessageSystem::getIPAddr(), LLMessageSystem::getIPPort(), LLMessageSystem::getNumberOfBlocks(), LLMessageSystem::getQuat(), LLMessageSystem::getS16(), LLMessageSystem::getS32(), LLMessageSystem::getS8(), LLMessageSystem::getSize(), LLMessageSystem::getString(), LLMessageSystem::getU16(), LLMessageSystem::getU32(), LLMessageSystem::getU64(), LLMessageSystem::getU8(), LLMessageSystem::getUUID(), LLMessageSystem::getVector3(), LLMessageSystem::getVector3d(), LLMessageSystem::getVector4(), init_prehash_data(), LLMessageSystem::isMessage(), LLMessageSystem::isSendFull(), LLMessageBlock::LLMessageBlock(), LLMessageTemplate::LLMessageTemplate(), LLMessageVariable::LLMessageVariable(), LLMessageSystem::newMessage(), LLMessageSystem::nextBlock(), LLMessageHandlerBridge::post(), tut::LLMessageTemplateParserTestData::prehash(), and LLMessageSystem::setHandlerFunc().

LLMessageSystem* gMessageSystem

Definition at line 1800 of file message.cpp.

const U8 LL_ACK_FLAG = 0x10

Definition at line 134 of file message.h.

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

const S32 LL_DEFAULT_RELIABLE_RETRIES = 3

Definition at line 147 of file message.h.

Referenced by LLMessageSystem::sendReliable(), and LLTransferSourceChannel::updateTransfers().

const F32 LL_FILE_XFER_TIMEOUT_FACTOR = 5.f / 1000.f

Definition at line 157 of file message.h.

const F32 LL_LOST_TIMEOUT_FACTOR = 16.f / 1000.f

Definition at line 158 of file message.h.

Referenced by LLCircuitData::updateWatchDogTimers().

const F32 LL_MAX_LOST_TIMEOUT = 5.f

Definition at line 159 of file message.h.

Referenced by LLCircuitData::updateWatchDogTimers().

const F32 LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS = 1.f

Definition at line 148 of file message.h.

Referenced by LLCircuitData::resendUnackedPackets(), and LLMessageSystem::sendReliable().

const F32 LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS = 1.f

Definition at line 149 of file message.h.

Referenced by LLMessageSystem::flushSemiReliable(), and LLMessageSystem::sendSemiReliable().

const S32 LL_MINIMUM_VALID_PACKET_SIZE = LL_PACKET_ID_SIZE + 1

Definition at line 137 of file message.h.

Referenced by LLMessageSystem::checkMessages(), LLTemplateMessageReader::decodeTemplate(), and LLMessageSystem::zeroCodeExpand().

const F32 LL_PING_BASED_TIMEOUT_DUMMY = 0.0f

Definition at line 150 of file message.h.

Referenced by LLMessageSystem::sendReliable().

const U8 LL_RELIABLE_FLAG = 0x40

Definition at line 132 of file message.h.

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

const F32 LL_RELIABLE_TIMEOUT_FACTOR = 5.f / 1000.f

Definition at line 156 of file message.h.

Referenced by LLCircuitData::resendUnackedPackets(), and LLMessageSystem::sendReliable().

const U8 LL_RESENT_FLAG = 0x20

Definition at line 133 of file message.h.

Referenced by LLMessageSystem::checkMessages(), and LLCircuitData::resendUnackedPackets().

const F32 LL_SEMIRELIABLE_TIMEOUT_FACTOR = 5.f / 1000.f

Definition at line 155 of file message.h.

Referenced by LLMessageSystem::flushSemiReliable(), and LLMessageSystem::sendSemiReliable().

const U8 LL_ZERO_CODE_FLAG = 0x80

Definition at line 131 of file message.h.

Referenced by zero_code(), and LLMessageSystem::zeroCodeExpand().

const S32 MAX_BLOCKS = 255

Definition at line 129 of file message.h.

Referenced by LLTemplateMessageBuilder::isMessageFull(), and LLTemplateMessageBuilder::nextBlock().

const S32 MAX_BUFFER_SIZE = NET_BUFFER_SIZE

Definition at line 128 of file message.h.

Referenced by buildBlock(), LLMessageSystem::sendMessage(), zero_code(), LLMessageSystem::zeroCodeAdjustCurrentSendTotal(), and LLMessageSystem::zeroCodeExpand().

const S32 MAX_MESSAGE_COUNT_NUM = 1024

Definition at line 161 of file message.h.

Referenced by LLMessageSystem::logMsgFromInvalidCircuit(), LLMessageSystem::logTrustedMsgFromUntrustedCircuit(), and LLMessageSystem::logValidMsg().

const S32 MAX_MESSAGE_INTERNAL_NAME_SIZE = 255

Definition at line 127 of file message.h.

const S32 MESSAGE_MAX_PER_FRAME = 400

Definition at line 69 of file message.h.

Referenced by idle_network().

const U32 MESSAGE_MAX_STRINGS_LENGTH = 64

Definition at line 66 of file message.h.

Referenced by LLMessageStringTable::getString().

const U32 MESSAGE_NUMBER_OF_HASH_BUCKETS = 8192

Definition at line 67 of file message.h.

Referenced by dump_prehash_files(), LLMessageStringTable::getString(), LLMessageStringTable::LLMessageStringTable(), and message_hash_my_string().


Generated on Thu Jul 1 06:10:53 2010 for Second Life Viewer by  doxygen 1.4.7