本文整理汇总了C++中WDBG_LL函数的典型用法代码示例。如果您正苦于以下问题:C++ WDBG_LL函数的具体用法?C++ WDBG_LL怎么用?C++ WDBG_LL使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WDBG_LL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WTRACE
// EGPublicKey::EncryptData
// Encrypts a block of specified length into the specified queue. Determines the
// number of individual blocks to be encrypted. Adds block count to queue. Then
// calls EncryptBlock() to encrypt each block into the queue. Note that mCryptP
// must be valid before this method is called.
void
EGPublicKey::EncryptData(BufferedTransformation& aQueue, const unsigned char* theMsgP,
unsigned long theLen) const
{
WTRACE("EGPublicKey::EncryptData");
WDBG_LL("EGPublicKey::EncryptData, len=" << theLen);
// Determine block length and number of blocks
unsigned long aBlockLen = mCryptP->MaxPlainTextLength();
unsigned long aNumBlock = theLen / aBlockLen;
if ((theLen % aBlockLen) != 0) aNumBlock++;
WDBG_LL("EGPublicKey::EncryptBlock NumBlocks=" << aNumBlock << ", BlockLen=" << aBlockLen);
// A num blocks to output
unsigned long tmpNumBlock = getLittleEndian(aNumBlock);
aQueue.Put(reinterpret_cast<unsigned char*>(&tmpNumBlock), sizeof(tmpNumBlock));
// Encrypt the data, one block at a time
while (theLen > aBlockLen)
{
EncryptBlock(aQueue, theMsgP, aBlockLen);
theMsgP += aBlockLen;
theLen -= aBlockLen;
}
// Encrypt the last block and close the queue
EncryptBlock(aQueue, theMsgP, theLen);
aQueue.Close();
}
示例2: WTRACE
// SMsgDirG2PeerDataBase::UnpackPeerData
// Hook to unpack the peer data if needed. Only reads peer data if peer
// data is present. Note that mPeerUser was added later and may or may not be
// present.
void
SMsgDirG2PeerDataBase::UnpackPeerData(void)
{
WTRACE("SMsgDirG2PeerDataBase::UnpackPeerData");
if (BytesLeftToRead() > 0)
{
WDBG_LL("SMsgDirG2PeerDataBase::UnpackPeerData Reading peer data.");
ReadString(mPeerKey);
mPeerIndex = ReadLong();
if (BytesLeftToRead() > 0)
{
WDBG_LL("SMsgDirG2PeerDataBase::UnpackPeerData Reading user id.");
mPeerUser = ReadLong();
}
else
mPeerUser = 0;
}
else
{
WDBG_LL("SMsgDirG2PeerDataBase::UnpackPeerData No peer data to read.");
mPeerKey = string();
mPeerIndex = 0;
mPeerUser = 0;
}
}
示例3: WTRACE
// TMsgDirGetDirContents::Unpack
// Virtual method from TMessage. Extracts data from message buffer.
void
TMsgDirGetDirContentsReply::Unpack(void)
{
WTRACE("TMsgDirGetDirContentsReply::Unpack");
TMessage::Unpack();
if ((GetServiceType() != WONMsg::DirServer) ||
(GetMessageType() != WONMsg::DirGetDirContentsReply))
{
WDBG_AH("TMsgDirGetDirContentsReply::Unpack Not a DirGetDirContentsReply message!");
throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
"Not a DirGetDirContentsReply message.");
}
WDBG_LL("TMsgDirGetDirContentsReply::Unpack Reading message data");
mStatus = static_cast<ServerStatus>(static_cast<short>(ReadShort()));
unsigned short anEntryCt = ReadShort();
WDBG_LL("TMsgDirGetDirContentsReply::Unpack Reading " << anEntryCt << "entries.");
mEntries.clear();
for (int i=0; i < anEntryCt; i++)
{
DirServerEntry anEntry;
UnpackEntry(anEntry);
mEntries.push_back(anEntry);
}
}
示例4: throw
// TMessage ctor from WONException
BadMsgException::BadMsgException(const BaseMessage& theMsgR, int theLine,
const char* theFileP, const char* addTextP) throw() :
WONException(WONCommon::ExBadTitanMessage, theLine, theFileP)
{
WTRACE("BadMsgException::ctor(TMessage)");
// Add header type info or header corrupt message
if (theMsgR.GetDataLen() >= theMsgR.GetHeaderLength())
{
WDBG_LL("BadMsgException::ctor(TMessage) Add header info.");
GetStream() << "MessageClass=" << (int)theMsgR.GetMessageClass()
<< " MessageType=" << theMsgR.GetMessageType()
<< " ServiceType=" << theMsgR.GetServiceType();
}
else
{
WDBG_LH("BadMsgException::ctor(TMessage) Corrupt header!");
GetStream() << HDRCORRUPT_MSG;
}
// Add message length and data length
WDBG_LL("BadMsgException::ctor(TMessage) Add length info.");
GetStream() << " DataLength=" << theMsgR.GetDataLen();
// Add additional text if defined
if (addTextP) GetStream() << " " << addTextP;
}
示例5: WTRACE
// ClientCDKey::BuildVChar
// Extracts a V from buffer starting at offset theOffset. Extracted V is appened
// to mStrKey. Vs use 2 bits. Value of theOffset is incremented by 2.
void
ClientCDKey::BuildVChar(const __int64& theBuf, unsigned int& theOffset) const
{
WTRACE("ClientCDKey::BuildVChar");
WDBG_LL("ClientCDKey::BuildVChar offset=" << theOffset);
char aChar = 0;
// Determine mask based on char
switch (ValFromBits(theBuf, theOffset, 2))
{
case 0:
aChar = 'A'; break;
case 1:
aChar = 'E'; break;
case 2:
aChar = 'U'; break;
case 3:
aChar = 'Y'; break;
#ifdef _DEBUG
default:
throw WONCommon::WONException(WONCommon::ExSoftwareFail, __LINE__, __FILE__,
"ClientCDKey::BuildVChar ValFromBits returned invalid char!");
break;
#endif
}
// Add char to buf and update offset
WDBG_LL("ClientCDKey::BuildVChar Char=" << aChar);
mStrKey += aChar;
theOffset += 2;
}
示例6: WTRACE
// SMsgDirG2GetNumEntities::Unpack
// Virtual method from SmallMessage. Extracts data from message buffer.
void
SMsgDirG2GetNumEntities::Unpack(void)
{
WTRACE("SMsgDirG2GetNumEntities::Unpack");
SmallMessage::Unpack();
if ((GetServiceType() != WONMsg::SmallDirServerG2) ||
(GetMessageType() != WONMsg::DirG2GetNumEntities))
{
WDBG_AH("SMsgDirG2GetNumEntities::Unpack Not a DirG2GetNumEntities message!");
throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
"Not a DirG2GetNumEntities message.");
}
WDBG_LL("SMsgDirG2GetNumEntities::Unpack Reading message data");
unsigned short aPathCt = ReadShort();
WDBG_LL("SMsgDirG2GetNumEntities::Unpack Reading " << aPathCt << " entries.");
mPaths.clear();
for (int i=0; i < aPathCt; i++)
{
DirPathData anEntry;
mPaths.push_back(anEntry);
ReadWString(mPaths.back().mPath);
mPaths.back().mMode = static_cast<DirGetMode>(ReadShort());
}
}
示例7: WTRACE
// TMsgAuth1Complete::Pack
// Virtual method from TMessage. Packs data into message buffer and
// sets the new message length.
void*
TMsgAuth1Complete::Pack(void)
{
WTRACE("TMsgAuth1Complete::Pack");
SetServiceType(WONMsg::Auth1PeerToPeer);
SetMessageType(WONMsg::Auth1Complete);
TMsgAuthRawBufferBase::Pack();
WDBG_LL("TMsgAuth1Complete::Pack Appending message data");
AppendShort(static_cast<short>(mStatus));
// Append error info if status implies failure
if (mStatus < 0)
{
WDBG_LL("TMsgAuth1Complete::Pack Failure status, append error info");
AppendShort(mErrList.size());
ErrorList::iterator anItr(mErrList.begin());
for (; anItr != mErrList.end(); anItr++)
Append_PA_STRING(*anItr);
}
// Otherwise append success info
else
{
WDBG_LL("TMsgAuth1Complete::Pack Success status, append secret and optional session");
PackRawBuf();
if (mSessionId != 0) AppendShort(mSessionId);
}
return GetDataPtr();
}
示例8: WTRACE
// Auth1PublicKeyBlock::PackData
// Packs member data into raw buffer in base class. Returns true on success and
// false on failure. Makes sure keyList is not empty. Appends number of keys
// in key list. For each key, appends key length and the key.
bool
Auth1PublicKeyBlock::PackData()
{
WTRACE("Auth1PublicKeyBlock::PackData");
if (! AuthPublicKeyBlockBase::PackData()) return false;
// KeyList cannot be empty.
WDBG_LL("Auth1PublicKeyBlock::PackData Validating...");
if (mKeyList.empty())
{
WDBG_LH("Auth1PublicKeyBlock::PackData KeySet is empty, pack fails.");
return false;
}
// Append fixed length data
WDBG_LL("Auth1PublicKeyBlock::PackData Packing...");
unsigned short aNumKeys = mKeyList.size();
makeLittleEndian(aNumKeys);
mRawBuf.append(reinterpret_cast<unsigned char*>(&aNumKeys), sizeof(aNumKeys));
// Append each key (length and binary data)
WDBG_LL("Auth1PublicKeyBlock::PackData Packing keys (" << mKeyList.size() << ')');
PublicKeyList::iterator anItr(mKeyList.begin());
for (; anItr != mKeyList.end(); anItr++)
{
unsigned short aKeyLen = anItr->GetKeyLen();
unsigned short tmpKeyLen = getLittleEndian(aKeyLen);
mRawBuf.append(reinterpret_cast<unsigned char*>(&tmpKeyLen), sizeof(tmpKeyLen));
mRawBuf.append(anItr->GetKey(), aKeyLen);
}
return true;
}
示例9: WTRACE
// Auth1PrivateKeyBlock::PackData
// Packs member data into raw buffer in base class. Returns true on success and
// false on failure. Makes sure keyList is not empty. Appends number of keys
// in key list. For each key, appends key length and the key.
bool
Auth1PrivateKeyBlock::PackData()
{
WTRACE("Auth1PrivateKeyBlock::PackData");
if (! AuthPublicKeyBlockBase::PackData()) return false;
// KeyList cannot be empty.
WDBG_LL("Auth1PrivateKeyBlock::PackData Validating...");
if (mKeyList.empty())
{
WDBG_LH("Auth1PrivateKeyBlock::PackData KeySet is empty, pack fails.");
return false;
}
// Append fixed length data
WDBG_LL("Auth1PrivateKeyBlock::PackData Packing...");
unsigned short aNumKeys = mKeyList.size();
unsigned short tmpNumKeys = getLittleEndian(aNumKeys);
mRawBuf.append(reinterpret_cast<unsigned char*>(&tmpNumKeys), sizeof(tmpNumKeys));
// Append each key (length and binary data)
WDBG_LL("Auth1PrivateKeyBlock::PackData Packing keys (" << mKeyList.size() << ')');
PrivateKeyList::iterator anItr(mKeyList.begin());
for (; anItr != mKeyList.end(); anItr++)
{
unsigned short aKeyLen = (*anItr)->GetKeyLen();
unsigned short tmpKeyLen = getLittleEndian(tmpKeyLen);
mRawBuf.append(reinterpret_cast<unsigned char*>(&tmpKeyLen), sizeof(tmpKeyLen));
mRawBuf.append((*anItr)->GetKey(), aKeyLen);
// count and record which BlockId's map to this key.
PrivateKeyMap::iterator aMapIter(mKeyMap.begin());
unsigned short aBlockIDCount=0;
std::list<unsigned short> aBlockIdList;
for(; aMapIter != mKeyMap.end(); aMapIter++)
{
if( aMapIter->second == *anItr )
{
aBlockIDCount++;
aBlockIdList.push_back( aMapIter->first );
}
}
unsigned short tmpBlockIDCount = getLittleEndian(aBlockIDCount);
// pack BlockId count and BlockIds
mRawBuf.append(reinterpret_cast<unsigned char*>(&tmpBlockIDCount), sizeof(tmpBlockIDCount));
while( aBlockIdList.size() )
{
unsigned short aBlockId = aBlockIdList.front();
makeLittleEndian(aBlockId);
mRawBuf.append(reinterpret_cast<unsigned char*>(& aBlockId), sizeof(unsigned short));
aBlockIdList.pop_front();
}
}
return true;
}
示例10: WTRACE
void
SMsgDirG2UpdateExtendBase::UnpackExtended(void)
{
WTRACE("SMsgDirG2UpdateExtendBase::UnpackExtended");
WDBG_LL("SMsgDirG2UpdateExtendBase::UnpackExtended enableDataObjects=" << mEnableDataObjects << " enableACLs=" << mEnableACLs);
mDataObjects.clear();
mACLs.clear();
if (mEnableDataObjects)
{
unsigned short aCt = ReadShort();
WDBG_LL("SMsgDirG2UpdateExtendBase::UnpackExtended Reading " << aCt << " data objects.");
for (int i=0; i < aCt; i++)
{
DataObject anObj;
unsigned char aTypeLen = ReadByte();
if (aTypeLen > 0)
anObj.GetDataType().assign(reinterpret_cast<const unsigned char*>(ReadBytes(aTypeLen)), aTypeLen);
unsigned short aDataLen = ReadShort();
if (aDataLen > 0)
anObj.GetData().assign(reinterpret_cast<const unsigned char*>(ReadBytes(aDataLen)), aDataLen);
mDataObjects.insert(anObj);
}
}
if (mEnableACLs)
{
unsigned short aCt = ReadShort();
WDBG_LL("SMsgDirG2UpdateExtendBase::UnpackExtended Reading " << aCt << " ACLs.");
for (int i=0; i < aCt; i++)
{
DirACL anACL;
anACL.mType = static_cast<WONMsg::DirG2ACLType>(ReadByte());
unsigned short aPermCt = ReadShort();
for (int j=0; j < aPermCt; j++)
{
Permission aPerm;
aPerm.mUserId = ReadLong();
aPerm.mCommunityId = ReadLong();
aPerm.mTrustLevel = ReadShort();
anACL.mACL.insert(aPerm);
}
mACLs.push_back(anACL);
}
}
}
示例11: WTRACE
// TMsgDirPeerDataBase::PackPeerData
// Hook to pack the peer data if needed. Only appends peer data if peer
// data is defined.
void
TMsgDirPeerDataBase::PackPeerData(void)
{
WTRACE("TMsgDirPeerDataBase::PackPeerData");
if (mPeerKey.size() > 0)
{
WDBG_LL("TMsgDirPeerDataBase::PackPeerData Appending peer data.");
Append_PA_STRING(mPeerKey);
AppendLong(mPeerIndex);
}
else
WDBG_LL("TMsgDirPeerDataBase::PackPeerData No peer data to append.");
}
示例12: WTRACE
void MMsgRoutingGetUserListReply::Unpack(void)
{
WTRACE("MMsgRoutingGetUserListReply::Unpack");
RoutingServerMessage::Unpack();
if (GetServiceType() != WONMsg::MiniRoutingServer ||
GetMessageType() != WONMsg::RoutingGetUserListReply)
{
WDBG_AH("MMsgRoutingGetUserListReply::Unpack Not a RoutingGetUserListReply message!");
throw WONMsg::BadMsgException(*this, __LINE__, __FILE__, "Not a RoutingGetUserListReply message.");
}
WDBG_LL("MMsgRoutingGetUserListReply::Unpack Reading message data");
// read in the status
mStatus = ReadShort();
// read in the user count
unsigned short aNumUsers = ReadShort();
// read in the user list
mUserList.clear();
for (int iUser = 0; iUser < aNumUsers; iUser++)
{
UserData aUser;
ReadUserName(aUser.mUserName);
mUserList.push_back(aUser);
}
}
示例13: WTRACE
// Auth2Certificate::PackData
// Packs member data into raw buffer in base class. Returns true on success and
// false on failure. Verifies member data and appends member data to buffer.
bool
Auth2Certificate::PackData()
{
WTRACE("Auth2Certificate::PackData");
if (! AuthCertificateBase::PackData()) return false;
// UserId and be non-zero and at least one community's info must be known.
WDBG_LL("Auth2Certificate::PackData Validating...");
if ( mDataList.size() == 0 )
{
WDBG_LH("Auth2Certificate::PackData DataList is empty, pack fails.");
return false;
}
unsigned short tmpDataListSize = mDataList.size();
mRawBuf.append(reinterpret_cast<unsigned char*>(&tmpDataListSize), sizeof(tmpDataListSize));
Auth2Certificate::DataListCIter anIter = mDataList.begin();
while( anIter != mDataList.end() )
{
if( ! (*anIter)->Serialize( mRawBuf ) ) return false;
++anIter;
}
return true;
}
示例14: WTRACE
void
DirEntity::PackDataObjects(BaseMessage& theMsgR, const DataObjectTypeSet& theSetR,
unsigned long theFlags)
{
WTRACE("DirEntity::PackDataObjects");
WDBG_LL("DirEntity::PackDataObject Packing data objects, size=" << theSetR.size());
theMsgR.AppendShort(theSetR.size());
bool packType = ((theFlags & WONMsg::GF_ADDDOTYPE) != 0);
bool packData = ((theFlags & WONMsg::GF_ADDDODATA) != 0);
DataObjectTypeSet::const_iterator anItr(theSetR.begin());
for (; anItr != theSetR.end(); anItr++)
{
if (packType)
{
unsigned char aTypeLen = anItr->GetDataType().size();
theMsgR.AppendByte(aTypeLen);
theMsgR.AppendBytes(aTypeLen, anItr->GetDataType().data());
}
if (packData)
{
unsigned short aDataLen = anItr->GetData().size();
theMsgR.AppendShort(aDataLen);
theMsgR.AppendBytes(aDataLen, anItr->GetData().data());
}
}
}
示例15: WTRACE
// TMsgCommPingReply::unpack
// Virtual method from TMessage. Extracts data from message buffer.
void
TMsgCommQueryOptReply::Unpack(void)
{
WTRACE("TMsgCommQueryOptReply::Unpack");
mOptionMap.clear();
TMessage::Unpack();
if ((GetServiceType() != WONMsg::CommonService) ||
(GetMessageType() != WONMsg::CommQueryOptionsReply))
{
WDBG_AH("TMsgCommQueryOptReply::Unpack Not a CommQueryOptionsReply message!");
throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
"Not a CommQueryOptionsReply message.");
}
unsigned short aCt = ReadShort();
WDBG_LL("TMsgCommQueryOptReply::Unpack reading " << aCt << " entries");
for (int i=0; i < aCt; i++)
{
OptionDef aDef;
string anOpt;
ReadString(anOpt);
aDef.first = static_cast<OptionStatus>(ReadByte());
ReadWString(aDef.second);
mOptionMap[anOpt] = aDef;
}
if (BytesLeftToRead() >= 2)
mStatus = static_cast<WONMsg::ServerStatus>(static_cast<short>(ReadShort()));
}