mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
Test case for a dynamic input reader.
This commit is contained in:
parent
f45526f373
commit
3d1442e86b
11 changed files with 423 additions and 72 deletions
34
testing/btest/plugins/reader-plugin/src/Foo.h
Normal file
34
testing/btest/plugins/reader-plugin/src/Foo.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
|
||||
#ifndef BRO_PLUGIN_DEMO_FOO_H
|
||||
#define BRO_PLUGIN_DEMO_FOO_H
|
||||
|
||||
#include "input/ReaderBackend.h"
|
||||
#include "threading/formatters/Ascii.h"
|
||||
|
||||
namespace input { namespace reader {
|
||||
|
||||
/**
|
||||
* A Foo reader to measure performance of the input framework.
|
||||
*/
|
||||
class Foo : public ReaderBackend {
|
||||
public:
|
||||
Foo(ReaderFrontend* frontend);
|
||||
~Foo();
|
||||
|
||||
static ReaderBackend* Instantiate(ReaderFrontend* frontend) { return new Foo(frontend); }
|
||||
|
||||
protected:
|
||||
virtual bool DoInit(const ReaderInfo& info, int arg_num_fields, const threading::Field* const* fields);
|
||||
virtual void DoClose();
|
||||
virtual bool DoUpdate();
|
||||
virtual bool DoHeartbeat(double network_time, double current_time);
|
||||
|
||||
private:
|
||||
string RandomString(const int len);
|
||||
threading::Value* EntryToVal(TypeTag Type, TypeTag subtype);
|
||||
threading::formatter::Ascii* ascii;
|
||||
};
|
||||
|
||||
} }
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue