Renaming InternalAnalyzerError to AnalyzerError.

This is to avoid confusion when we abort and when not: InternalError()
aborts; AnalyzerError() does not.
This commit is contained in:
Robin Sommer 2013-10-11 14:49:56 -07:00
parent d6855dc4eb
commit 8e18f9d59e
14 changed files with 29 additions and 29 deletions

View file

@ -137,7 +137,7 @@ void Reporter::InternalError(const char* fmt, ...)
abort();
}
void Reporter::InternalAnalyzerError(analyzer::Analyzer* a, const char* fmt,
void Reporter::AnalyzerError(analyzer::Analyzer* a, const char* fmt,
...)
{
if ( a )

View file

@ -92,9 +92,9 @@ public:
// dump after the message has been reported.
void InternalError(const char* fmt, ...) FMT_ATTR;
// Report an internal analyzer error. That analyzer will not process
// Report an analyzer error. That analyzer will be set to not process
// any further input, but Bro otherwise continues normally.
void InternalAnalyzerError(analyzer::Analyzer* a, const char* fmt, ...);
void AnalyzerError(analyzer::Analyzer* a, const char* fmt, ...);
// Toggle whether non-fatal messages should be reported through the
// scripting layer rather on standard output. Fatal errors are always

View file

@ -699,7 +699,7 @@ void HTTP_Message::SubmitData(int len, const char* buf)
if ( buf != (const char*) data_buffer->Bytes() + buffer_offset ||
buffer_offset + len > buffer_size )
{
reporter->InternalAnalyzerError(MyHTTP_Analyzer(),
reporter->AnalyzerError(MyHTTP_Analyzer(),
"HTTP message buffer misalignment");
return;
}
@ -747,7 +747,7 @@ void HTTP_Message::SubmitEvent(int event_type, const char* detail)
break;
default:
reporter->InternalAnalyzerError(MyHTTP_Analyzer(),
reporter->AnalyzerError(MyHTTP_Analyzer(),
"unrecognized HTTP message event");
return;
}
@ -1239,7 +1239,7 @@ int HTTP_Analyzer::HTTP_RequestLine(const char* line, const char* end_of_line)
if ( ! ParseRequest(rest, end_of_line) )
{
reporter->InternalAnalyzerError(this, "HTTP ParseRequest failed");
reporter->AnalyzerError(this, "HTTP ParseRequest failed");
return -1;
}

View file

@ -60,7 +60,7 @@ void ICMP_Analyzer::DeliverPacket(int len, const u_char* data,
break;
default:
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"unexpected IP proto in ICMP analyzer: %d", ip->NextProto());
return;
}
@ -100,7 +100,7 @@ void ICMP_Analyzer::DeliverPacket(int len, const u_char* data,
NextICMP6(current_timestamp, icmpp, len, caplen, data, ip);
else
{
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"expected ICMP as IP packet's protocol, got %d", ip->NextProto());
return;
}

View file

@ -118,7 +118,7 @@ void Login_Analyzer::NewLine(bool orig, char* line)
if ( state != LOGIN_STATE_CONFUSED )
{
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"bad state in Login_Analyzer::NewLine");
return;
}
@ -582,7 +582,7 @@ char* Login_Analyzer::PeekUserText()
{
if ( num_user_text <= 0 )
{
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"underflow in Login_Analyzer::PeekUserText()");
return 0;
}

View file

@ -42,7 +42,7 @@ void TelnetOption::RecvOption(unsigned int type)
if ( ! peer )
{
reporter->InternalAnalyzerError(endp,
reporter->AnalyzerError(endp,
"option peer missing in TelnetOption::RecvOption");
return;
}
@ -90,7 +90,7 @@ void TelnetOption::RecvOption(unsigned int type)
break;
default:
reporter->InternalAnalyzerError(endp,
reporter->AnalyzerError(endp,
"bad option type in TelnetOption::RecvOption");
return;
}
@ -173,7 +173,7 @@ void TelnetEncryptOption::RecvSubOption(u_char* data, int len)
if ( ! peer )
{
reporter->InternalAnalyzerError(endp,
reporter->AnalyzerError(endp,
"option peer missing in TelnetEncryptOption::RecvSubOption");
return;
}
@ -213,7 +213,7 @@ void TelnetAuthenticateOption::RecvSubOption(u_char* data, int len)
if ( ! peer )
{
reporter->InternalAnalyzerError(endp,
reporter->AnalyzerError(endp,
"option peer missing in TelnetAuthenticateOption::RecvSubOption");
}

View file

@ -131,7 +131,7 @@ void Contents_Rsh_Analyzer::DoDeliver(int len, const u_char* data)
break;
default:
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"bad state in Contents_Rsh_Analyzer::DoDeliver");
break;
}
@ -188,7 +188,7 @@ void Rsh_Analyzer::ClientUserName(const char* s)
{
if ( client_name )
{
reporter->InternalAnalyzerError(this, "multiple rsh client names");
reporter->AnalyzerError(this, "multiple rsh client names");
return;
}
@ -199,7 +199,7 @@ void Rsh_Analyzer::ServerUserName(const char* s)
{
if ( username )
{
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"multiple rsh initial client names");
return;
}

View file

@ -193,7 +193,7 @@ void Contents_Rlogin_Analyzer::DoDeliver(int len, const u_char* data)
break;
default:
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"bad state in Contents_Rlogin_Analyzer::DoDeliver");
break;
}
@ -226,7 +226,7 @@ void Rlogin_Analyzer::ClientUserName(const char* s)
{
if ( client_name )
{
reporter->InternalAnalyzerError(this, "multiple rlogin client names");
reporter->AnalyzerError(this, "multiple rlogin client names");
return;
}

View file

@ -1391,7 +1391,7 @@ void MIME_Mail::SubmitData(int len, const char* buf)
{
if ( buf != (char*) data_buffer->Bytes() + buffer_start )
{
reporter->InternalAnalyzerError(GetAnalyzer(),
reporter->AnalyzerError(GetAnalyzer(),
"MIME buffer misalignment");
return;
}
@ -1487,7 +1487,7 @@ void MIME_Mail::SubmitEvent(int event_type, const char* detail)
break;
default:
reporter->InternalAnalyzerError(GetAnalyzer(),
reporter->AnalyzerError(GetAnalyzer(),
"unrecognized MIME_Mail event");
return;
}

View file

@ -193,7 +193,7 @@ public:
virtual ~MIME_Message()
{
if ( ! finished )
reporter->InternalAnalyzerError(analyzer,
reporter->AnalyzerError(analyzer,
"missing MIME_Message::Done() call");
}

View file

@ -209,7 +209,7 @@ void POP3_Analyzer::ProcessRequest(int length, const char* line)
break;
default:
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"unexpected POP3 authorization state");
return;
}
@ -567,7 +567,7 @@ void POP3_Analyzer::ProcessClientCmd()
break;
default:
reporter->InternalAnalyzerError(this, "unknown POP3 command");
reporter->AnalyzerError(this, "unknown POP3 command");
return;
}
}

View file

@ -266,7 +266,7 @@ int RPC_Interpreter::DeliverRPC(const u_char* buf, int n, int rpclen,
else if ( n < 0 )
{
reporter->InternalAnalyzerError(analyzer, "RPC underflow");
reporter->AnalyzerError(analyzer, "RPC underflow");
return 0;
}
@ -479,7 +479,7 @@ bool Contents_RPC::CheckResync(int& len, const u_char*& data, bool orig)
if ( resync_toskip != 0 )
{
// Should never happen.
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"RPC resync: skipping over data failed");
return false;
}
@ -633,7 +633,7 @@ void Contents_RPC::DeliverStream(int len, const u_char* data, bool orig)
if ( ! dummy_p )
{
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"inconsistent RPC record marker extraction");
return;
}

View file

@ -738,7 +738,7 @@ int SMB_Session::ParseTransaction(int is_orig, int cmd,
break;
default:
reporter->InternalAnalyzerError(analyzer,
reporter->AnalyzerError(analyzer,
"command mismatch for SMB_Session::ParseTransaction");
return 0;
}

View file

@ -124,7 +124,7 @@ void ContentLine_Analyzer::SetPlainDelivery(int64_t length)
{
if ( length < 0 )
{
reporter->InternalAnalyzerError(this,
reporter->AnalyzerError(this,
"negative length for plain delivery");
return;
}