/src/zeek/src/analyzer/protocol/ntlm/NTLM.cc
Line | Count | Source |
1 | | // See the file "COPYING" in the main distribution directory for copyright. |
2 | | |
3 | | #include "zeek/analyzer/protocol/ntlm/NTLM.h" |
4 | | |
5 | | #include "zeek/Reporter.h" |
6 | | #include "zeek/analyzer/protocol/tcp/TCP_Reassembler.h" |
7 | | |
8 | | namespace zeek::analyzer::ntlm { |
9 | | |
10 | 10.2k | NTLM_Analyzer::NTLM_Analyzer(Connection* c) : analyzer::tcp::TCP_ApplicationAnalyzer("NTLM", c) { |
11 | 10.2k | interp = new binpac::NTLM::NTLM_Conn(this); |
12 | 10.2k | } |
13 | | |
14 | 10.2k | NTLM_Analyzer::~NTLM_Analyzer() { delete interp; } |
15 | | |
16 | 10.2k | void NTLM_Analyzer::Done() { |
17 | 10.2k | analyzer::tcp::TCP_ApplicationAnalyzer::Done(); |
18 | | |
19 | 10.2k | interp->FlowEOF(true); |
20 | 10.2k | interp->FlowEOF(false); |
21 | 10.2k | } |
22 | | |
23 | 0 | void NTLM_Analyzer::EndpointEOF(bool is_orig) { |
24 | 0 | analyzer::tcp::TCP_ApplicationAnalyzer::EndpointEOF(is_orig); |
25 | 0 | interp->FlowEOF(is_orig); |
26 | 0 | } |
27 | | |
28 | 45.3k | void NTLM_Analyzer::DeliverStream(int len, const u_char* data, bool orig) { |
29 | 45.3k | analyzer::tcp::TCP_ApplicationAnalyzer::DeliverStream(len, data, orig); |
30 | | |
31 | 45.3k | try { |
32 | 45.3k | interp->NewData(orig, data, data + len); |
33 | 45.3k | AnalyzerConfirmation(); |
34 | 45.3k | } catch ( const binpac::Exception& e ) { |
35 | 23.1k | AnalyzerViolation(util::fmt("Binpac exception: %s", e.what())); |
36 | 23.1k | } |
37 | 45.3k | } |
38 | | |
39 | 0 | void NTLM_Analyzer::Undelivered(uint64_t seq, int len, bool orig) { |
40 | 0 | analyzer::tcp::TCP_ApplicationAnalyzer::Undelivered(seq, len, orig); |
41 | 0 | interp->NewGap(orig, len); |
42 | 0 | } |
43 | | |
44 | | } // namespace zeek::analyzer::ntlm |