void* SMsgFactSaveConfigFile::Pack(void)
{
	WTRACE("SMsgFactSaveConfigFile::Pack");

	SetServiceType(WONMsg::SmallFactoryServer);
	SetMessageType(WONMsg::FactSaveConfigFile);
	SmallMessage::Pack();

	WDBG_LL("SMsgFactSaveConfigFile::Pack Appending message data");

	Append_PA_STRING(mConfigName);	Append_PA_STRING(mFilePath);	AppendRawString(mBlob);
	return GetDataPtr();
}
// TMsgDirDumpTree::Pack
// Virtual method from TMessage.  Packs data into message buffer and
// sets the new message length.
void*
TMsgDirDumpTree::Pack(void)
{
	WTRACE("TMsgDirGetDirContents::Pack");
	SetServiceType(WONMsg::DirServer);
	SetMessageType(WONMsg::DirDumpTree);
	TMessage::Pack();

	WDBG_LL("TMsgDirDumpTree::Pack Appending message data");
	Append_PA_STRING(mFilePath);
	Append_PA_STRING(mFileName);

	return GetDataPtr();
}
// 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();
}
void* SMsgFactRunProcess::Pack(void)
{
	WTRACE("SMsgFactRunProcess::Pack");

	SetServiceType(WONMsg::SmallFactoryServer);
	SetMessageType(WONMsg::FactRunProcess);
	SmallMessage::Pack();

	WDBG_LL("SMsgFactRunProcess::Pack Appending message data");

	Append_PA_STRING(mCommandLine);
	Append_PA_STRING(mWorkingDirectory);
	AppendByte(mRunDetached?1:0);

	return GetDataPtr();
}
// MMsgObsAddSubscriber::Pack
// Virtual method from MiniMessage.  Packs data into message buffer and
// sets the new message length.
void*
MMsgObsAddSubscriber::Pack(void)
{
	WTRACE("MMsgObsAddSubscriber::Pack");

	SetServiceType(WONMsg::MiniObsServer);
	SetMessageType(WONMsg::ObsMsg_AddSubscriber);
	MiniMessage::Pack();

	WDBG_LL("MMsgObsAddSubscriber::Pack Appending message data");
	Append_PA_STRING(mSubscriberName);
	Append_PW_STRING(mSubscriberDescription);
	AppendShort((short)mConnectionType);
	Append_PA_STRING(mNetAddress);
		
	return GetDataPtr();
}
示例#6
0
// TMsgCommPingReply::Pack
// Virtual method from TMessage.  Packs data into message buffer and
// sets the new message length.
void*
TMsgCommPingReply::Pack(void)
{
	WTRACE("TMsgCommPingReply::Pack");
	SetServiceType(WONMsg::CommonService);
	SetMessageType(WONMsg::CommPingReply);
	TMessage::Pack();

#ifdef WIN32
	// Build image if needed
	if (mImage.empty())
	{
		char aFileNameStr[_MAX_PATH+1];
		GetModuleFileName(NULL, aFileNameStr, _MAX_PATH+1);
		mImage = aFileNameStr;
	}

	// Fetch version if needed
	if (mVersion == 0)
	{
		struct _stat aStat;
		mVersion = (_stat(mImage.c_str(), &aStat) == -1 ? 0 : aStat.st_mtime);
	}
#endif

#if defined(macintosh) && (macintosh == 1)
#else
		// Fetch PID if needed
		if (mPID == 0)
			mPID = getpid();
#endif

	WDBG_LL("TMsgCommPingReply::Pack Appending message data");
	Append_PA_STRING(mAppName);
	Append_PA_STRING(mLogicalName);
	AppendLong(mStartTick);
	AppendLong(mVersion);
	Append_PA_STRING(mImage);
	AppendLong(mPID);
	Append_PA_STRING(mPorts);

	return GetDataPtr();
}
// MMsgObsAddPublisher::Pack
// Virtual method from MiniMessage.  Packs data into message buffer and
// sets the new message length.
void*
MMsgObsAddPublisher::Pack(void)
{
	WTRACE("MMsgObsAddPublisher::Pack");

	SetServiceType(WONMsg::MiniObsServer);
	SetMessageType(WONMsg::ObsMsg_AddPublisher);
	MiniMessage::Pack();

	WDBG_LL("MMsgObsAddPublisher::Pack Appending message data");
	Append_PA_STRING(mPublisherName);
	Append_PW_STRING(mPublisherDescription);
	AppendShort((short)mConnectionType);
	Append_PA_STRING(mNetAddress);
	AppendByte((char)mAccessPubsByName);
	AppendByte((char)mOnDemandPublishing);
	
	return GetDataPtr();
}
示例#8
0
void* SMsgFactGetDir::Pack(void)
{
	WTRACE("SMsgFactGetDir::Pack");

	SetServiceType(WONMsg::SmallFactoryServer);
	SetMessageType(WONMsg::FactGetDir);
	SmallMessage::Pack();

	WDBG_LL("SMsgFactGetDir::Pack Appending message data");

	Append_PA_STRING(mFilePath);
	return GetDataPtr();
}
示例#9
0
// 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.");
}
示例#10
0
// MMsgObsSubscribeById::Pack
// Virtual method from MiniMessage.  Packs data into message buffer and
// sets the new message length.
void*
MMsgObsSubscribeById::Pack(void)
{
	WTRACE("MMsgObsSubscribeById::Pack");

	SetServiceType(WONMsg::MiniObsServer);
	SetMessageType(WONMsg::ObsMsg_SubscribeById);
	MiniMessage::Pack();

	WDBG_LL("MMsgObsSubscribeById::Pack Appending message data");

	AppendLong(mPublicationId);
	AppendLong(mSubscriberId);
	if (!mSubscriberId) // Optional parameters follow
	{
		Append_PA_STRING(mSubscriberName);
		Append_PW_STRING(mSubscriberDescription);
		AppendShort(mConnectionType);
		Append_PA_STRING(mSubscriberAddress);
	}
	
	return GetDataPtr();
}
// TMsgDirSynchDirTree::Pack
// Virtual method from TMessage.  Packs data into message buffer and
// sets the new message length.
void*
TMsgDirSynchDirTree::Pack(void)
{
	WTRACE("TMsgDirSynchDirTree::Pack");
	SetServiceType(WONMsg::DirServer);
	SetMessageType(WONMsg::DirSynchDirTree);
	TMessage::Pack();

	WDBG_LL("TMsgDirSynchDirTree::Pack Appending message data");
	Append_PA_STRING(mServIP);
	AppendShort(mServPort);

	return GetDataPtr();
}
示例#12
0
// MMsgObsPublishRequested::Pack
// Virtual method from MiniMessage.  Packs data into message buffer and
// sets the new message length.
void*
MMsgObsPublishRequested::Pack(void)
{
	WTRACE("MMsgObsPublishRequested::Pack");

	SetServiceType(WONMsg::MiniObsServer);
	SetMessageType(WONMsg::ObsMsg_PublishRequested);
	MiniMessage::Pack();

	WDBG_LL("MMsgObsPublishRequested::Pack Appending message data");

	Append_PA_STRING(mPublicationName);
	
	return GetDataPtr();
}
void* SMsgFactStreamFile::Pack(void)
{
	WTRACE("SMsgFactStreamFile::Pack");

	SetServiceType(WONMsg::SmallFactoryServer);
	SetMessageType(WONMsg::FactStreamFile);
	SmallMessage::Pack();

	WDBG_LL("SMsgFactStreamFile::Pack Appending message data");

	Append_PA_STRING(mFilePath);
	AppendByte(mCompress?1:0);
	AppendLong(mModifyTime.dwHighDateTime);
	AppendLong(mModifyTime.dwLowDateTime);
	return GetDataPtr();
}
// TMsgCommQueryOptions::Pack
// Virtual method from TMessage.  Packs data into message buffer and
// sets the new message length.
void*
TMsgCommQueryOptions::Pack(void)
{
	WTRACE("TMsgCommQueryOptions::Pack");
	SetServiceType(WONMsg::CommonService);
	SetMessageType(WONMsg::CommQueryOptions);
	TMessage::Pack();

	WDBG_LL("TMsgCommQueryOptions::Pack Appending " << mOptionList.size() << "entries.");
	AppendShort(mOptionList.size());
	OptionList::iterator anItr = mOptionList.begin();
	for (; anItr != mOptionList.end(); anItr++)
		Append_PA_STRING(*anItr);

	return GetDataPtr();
}
// MMsgObsPublishStream::Pack
// Virtual method from MiniMessage.  Packs data into message buffer and
// sets the new message length.
void*
MMsgObsPublishStream::Pack(void)
{
	WTRACE("MMsgObsPublishStream::Pack");

	SetServiceType(WONMsg::MiniObsServer);
	SetMessageType(WONMsg::ObsMsg_PublishStream);
	MiniMessage::Pack();

	WDBG_LL("MMsgObsPublishStream::Pack Appending message data");

	AppendLong(mPublisherId);
	Append_PA_STRING(mPublicationName);
	Append_PW_STRING(mPublicationDescription);
	AppendByte((char)mSubscriptionNotification);

	return GetDataPtr();
}
示例#16
0
// MMsgObsSubscribeReply::Pack
// Virtual method from MiniMessage.  Packs data into message buffer and
// sets the new message length.
void*
MMsgObsSubscribeReply::Pack(void)
{
	WTRACE("MMsgObsSubscribeReply::Pack");
	SetServiceType(WONMsg::MiniObsServer);
	SetMessageType(WONMsg::ObsMsg_SubscribeReply);
	MiniMessage::Pack();

	WDBG_LL("MMsgObsSubscribeReply::Pack Appending message data");
	AppendShort((short)(mStatus));
	AppendLong(mPublicationId);
	AppendLong(mSubscriberId);
	AppendShort(mDataLength);
	if (mDataLength > 0)
	{
		AppendBytes(mDataLength, mDataP);
	}
	Append_PA_STRING(mPeerRedirection);

	return GetDataPtr();
}
// TMsgCommQueryOptReply::Pack
// Virtual method from TMessage.  Packs data into message buffer and
// sets the new message length.
void*
TMsgCommQueryOptReply::Pack(void)
{
	WTRACE("TMsgCommQueryOptReply::Pack");
	SetServiceType(WONMsg::CommonService);
	SetMessageType(WONMsg::CommQueryOptionsReply);
	TMessage::Pack();

	WDBG_LL("TMsgCommQueryOptReply::Pack Appending " << mOptionMap.size() << " entries");
	AppendShort(mOptionMap.size());

	OptionMap::iterator anItr = mOptionMap.begin();
	for (; anItr != mOptionMap.end(); anItr++)
	{
		Append_PA_STRING(anItr->first);
		AppendByte(anItr->second.first);
		Append_PW_STRING(anItr->second.second);
	}

	AppendShort(static_cast<short>(mStatus));

	return GetDataPtr();
}
示例#18
0
// MMsgObsPublishDataPool::Pack
// Virtual method from MiniMessage.  Packs data into message buffer and
// sets the new message length.
void*
MMsgObsPublishDataPool::Pack(void)
{
	WTRACE("MMsgObsPublishDataPool::Pack");

	SetServiceType(WONMsg::MiniObsServer);
	SetMessageType(WONMsg::ObsMsg_PublishDataPool);
	MiniMessage::Pack();

	WDBG_LL("MMsgObsPublishDataPool::Pack Appending message data");

	AppendLong(mPublisherId);
	Append_PA_STRING(mPublicationName);
	Append_PW_STRING(mPublicationDescription);
	AppendByte((char)mSubscriptionNotification);
	AppendShort(mDataLength);
	if (mDataLength > 0)
	{
		AppendBytes(mDataLength, mDataP);
	}

	return GetDataPtr();
}
示例#19
0
void RoutingServerMessage::AppendGroupName(const GroupName& theString)
{ Append_PA_STRING(theString); }