mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00

In many cases, classes derived from TCP_ApplicationAnalyzer were *overloading* instead of overriding EndpointEOF causing the parent class version to become hidden in the child and also for the child's version to never to called polymorphically from TCP_Analyzer::EndpointEOF. Clang gave a warning in each case.
34 lines
843 B
C++
34 lines
843 B
C++
// This code contributed by Nadi Sarrar.
|
|
|
|
#ifndef bittorrent_h
|
|
#define bittorrent_h
|
|
|
|
#include "TCP.h"
|
|
|
|
#include "bittorrent_pac.h"
|
|
|
|
class BitTorrent_Analyzer : public TCP_ApplicationAnalyzer {
|
|
public:
|
|
BitTorrent_Analyzer(Connection* conn);
|
|
virtual ~BitTorrent_Analyzer();
|
|
|
|
virtual void Done();
|
|
virtual void DeliverStream(int len, const u_char* data, bool orig);
|
|
virtual void Undelivered(int seq, int len, bool orig);
|
|
virtual void EndpointEOF(bool is_orig);
|
|
|
|
static Analyzer* InstantiateAnalyzer(Connection* conn)
|
|
{ return new BitTorrent_Analyzer(conn); }
|
|
|
|
static bool Available()
|
|
{ return bittorrent_peer_handshake || bittorrent_peer_piece; }
|
|
|
|
protected:
|
|
void DeliverWeird(const char* msg, bool orig);
|
|
|
|
binpac::BitTorrent::BitTorrent_Conn* interp;
|
|
bool stop_orig, stop_resp;
|
|
uint64 stream_len_orig, stream_len_resp;
|
|
};
|
|
|
|
#endif
|