mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 03:58:20 +00:00
Reformat Zeek in Spicy style
This largely copies over Spicy's `.clang-format` configuration file. The one place where we deviate is header include order since Zeek depends on headers being included in a certain order.
This commit is contained in:
parent
7b8e7ed72c
commit
f5a76c1aed
786 changed files with 131714 additions and 153609 deletions
|
@ -6,63 +6,50 @@
|
|||
#include "zeek/analyzer/protocol/krb/types.bif.h"
|
||||
#include "zeek/analyzer/protocol/tcp/TCP_Reassembler.h"
|
||||
|
||||
namespace zeek::analyzer::krb_tcp
|
||||
{
|
||||
namespace zeek::analyzer::krb_tcp {
|
||||
|
||||
KRB_Analyzer::KRB_Analyzer(Connection* conn)
|
||||
: analyzer::tcp::TCP_ApplicationAnalyzer("KRB_TCP", conn)
|
||||
{
|
||||
interp = new binpac::KRB_TCP::KRB_Conn(this);
|
||||
had_gap = false;
|
||||
}
|
||||
KRB_Analyzer::KRB_Analyzer(Connection* conn) : analyzer::tcp::TCP_ApplicationAnalyzer("KRB_TCP", conn) {
|
||||
interp = new binpac::KRB_TCP::KRB_Conn(this);
|
||||
had_gap = false;
|
||||
}
|
||||
|
||||
KRB_Analyzer::~KRB_Analyzer()
|
||||
{
|
||||
delete interp;
|
||||
}
|
||||
KRB_Analyzer::~KRB_Analyzer() { delete interp; }
|
||||
|
||||
void KRB_Analyzer::Done()
|
||||
{
|
||||
analyzer::tcp::TCP_ApplicationAnalyzer::Done();
|
||||
void KRB_Analyzer::Done() {
|
||||
analyzer::tcp::TCP_ApplicationAnalyzer::Done();
|
||||
|
||||
interp->FlowEOF(true);
|
||||
interp->FlowEOF(false);
|
||||
}
|
||||
interp->FlowEOF(true);
|
||||
interp->FlowEOF(false);
|
||||
}
|
||||
|
||||
void KRB_Analyzer::EndpointEOF(bool is_orig)
|
||||
{
|
||||
analyzer::tcp::TCP_ApplicationAnalyzer::EndpointEOF(is_orig);
|
||||
interp->FlowEOF(is_orig);
|
||||
}
|
||||
void KRB_Analyzer::EndpointEOF(bool is_orig) {
|
||||
analyzer::tcp::TCP_ApplicationAnalyzer::EndpointEOF(is_orig);
|
||||
interp->FlowEOF(is_orig);
|
||||
}
|
||||
|
||||
void KRB_Analyzer::DeliverStream(int len, const u_char* data, bool orig)
|
||||
{
|
||||
analyzer::tcp::TCP_ApplicationAnalyzer::DeliverStream(len, data, orig);
|
||||
void KRB_Analyzer::DeliverStream(int len, const u_char* data, bool orig) {
|
||||
analyzer::tcp::TCP_ApplicationAnalyzer::DeliverStream(len, data, orig);
|
||||
|
||||
if ( TCP() && TCP()->IsPartial() )
|
||||
return;
|
||||
if ( TCP() && TCP()->IsPartial() )
|
||||
return;
|
||||
|
||||
if ( had_gap )
|
||||
// If only one side had a content gap, we could still try to
|
||||
// deliver data to the other side if the script layer can
|
||||
// handle this.
|
||||
return;
|
||||
if ( had_gap )
|
||||
// If only one side had a content gap, we could still try to
|
||||
// deliver data to the other side if the script layer can
|
||||
// handle this.
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
interp->NewData(orig, data, data + len);
|
||||
}
|
||||
catch ( const binpac::Exception& e )
|
||||
{
|
||||
AnalyzerViolation(util::fmt("Binpac exception: %s", e.c_msg()));
|
||||
}
|
||||
}
|
||||
try {
|
||||
interp->NewData(orig, data, data + len);
|
||||
} catch ( const binpac::Exception& e ) {
|
||||
AnalyzerViolation(util::fmt("Binpac exception: %s", e.c_msg()));
|
||||
}
|
||||
}
|
||||
|
||||
void KRB_Analyzer::Undelivered(uint64_t seq, int len, bool orig)
|
||||
{
|
||||
analyzer::tcp::TCP_ApplicationAnalyzer::Undelivered(seq, len, orig);
|
||||
had_gap = true;
|
||||
interp->NewGap(orig, len);
|
||||
}
|
||||
void KRB_Analyzer::Undelivered(uint64_t seq, int len, bool orig) {
|
||||
analyzer::tcp::TCP_ApplicationAnalyzer::Undelivered(seq, len, orig);
|
||||
had_gap = true;
|
||||
interp->NewGap(orig, len);
|
||||
}
|
||||
|
||||
} // namespace zeek::analyzer::krb_tcp
|
||||
} // namespace zeek::analyzer::krb_tcp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue