BOOL LLTemplateMessageReader::validateMessage(const U8* buffer, 
											  S32 buffer_size, 
											  const LLHost& sender,
											  bool trusted)
{
	mReceiveSize = buffer_size;
	BOOL valid = decodeTemplate(buffer, buffer_size, &mCurrentRMessageTemplate );
	if(valid)
	{
		mCurrentRMessageTemplate->mReceiveCount++;
		//lldebugs << "MessageRecvd:"
		//						 << mCurrentRMessageTemplate->mName 
		//						 << " from " << sender << llendl;
	}

	if (valid && isBanned(trusted))
	{
		LL_WARNS("Messaging") << "LLMessageSystem::checkMessages "
			<< "received banned message "
			<< getMessageName()
			<< " from "
			<< ((trusted) ? "trusted " : "untrusted ")
			<< sender << llendl;
		valid = FALSE;
	}

	if(valid && isUdpBanned())
	{
		llwarns << "Received UDP black listed message "
				<<  getMessageName()
				<< " from " << sender << llendl;
		valid = FALSE;
	}
	return valid;
}
Пример #2
0
void LLTemplateMessageReader::logRanOffEndOfPacket( const LLHost& host, const S32 where, const S32 wanted )
{
	// we've run off the end of the packet!
	llwarns << "Ran off end of packet " << mCurrentRMessageTemplate->mName
//			<< " with id " << mCurrentRecvPacketID 
			<< " from " << host
			<< " trying to read " << wanted
			<< " bytes at position " << where
			<< " going past packet end at " << mReceiveSize
			<< llendl;
	if(gMessageSystem->mVerboseLog)
	{
		llinfos << "MSG: -> " << host << "\tREAD PAST END:\t"
//				<< mCurrentRecvPacketID << " "
				<< getMessageName() << llendl;
	}
	gMessageSystem->callExceptionFunc(MX_RAN_OFF_END_OF_PACKET);
}
Пример #3
0
void log_graph(int from_node, int to_node, int message, int recv) {
  if (log_level < GRAPH) return;
  enum role_t to_role = message_to_role(message);
  enum role_t from_role = message_from_role(message);

  int line_size = (num_nodes()) * 9 + 6;

  char line[line_size];
  draw_base_graph(line, line_size);

  // printf("GRAPH(0): %s %s\n", line, getMessageName(message));
  int to_idx = graph_index(to_node, to_role);
  int from_idx = graph_index(from_node, from_role);

  line[from_idx] = '*';
  line[to_idx] = 'M';

  if (to_idx < from_idx) {
    int tmp = to_idx;
    to_idx = from_idx;
    from_idx = tmp;
    line[to_idx - 1] = '-';
    line[from_idx + 1] = '<';
  } else {
    line[from_idx + 1] = '-';
    line[to_idx - 1] = '>';
  }

  int i;
  for (i = (from_idx + 2); i < (to_idx - 1); i++) {
    line[i] = '-';
  }

  printf("GRAPH: %s %s %s\n", line, recv ? "RECV " : "SENT ", getMessageName(message));
  
}
Пример #4
0
void log_message(char *msg, message *m) {
  trace("(%s) Message %s from %d to %d ticket %ld slot %d value %ld crc 0x%lx", msg, getMessageName(m->type), m->from, m->to, m->ticket, m->slot, m->value, m->crc);
}