mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
A set of input framework refactoring, cleanup, and polishing.
This commit is contained in:
parent
1416d5404d
commit
fc907c0090
14 changed files with 162 additions and 168 deletions
|
@ -74,7 +74,7 @@ public:
|
|||
string source;
|
||||
bool removed;
|
||||
|
||||
int mode;
|
||||
ReaderMode mode;
|
||||
|
||||
StreamType stream_type; // to distinguish between event and table streams
|
||||
|
||||
|
@ -299,7 +299,25 @@ bool Manager::CreateStream(Stream* info, RecordVal* description)
|
|||
Unref(sourceval);
|
||||
|
||||
EnumVal* mode = description->LookupWithDefault(rtype->FieldOffset("mode"))->AsEnumVal();
|
||||
info->mode = mode->InternalInt();
|
||||
|
||||
switch ( mode->InternalInt() )
|
||||
{
|
||||
case 0:
|
||||
info->mode = MODE_MANUAL;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
info->mode = MODE_REREAD;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
info->mode = MODE_STREAM;
|
||||
break;
|
||||
|
||||
default:
|
||||
reporter->InternalError("unknown reader mode");
|
||||
}
|
||||
|
||||
Unref(mode);
|
||||
|
||||
info->reader = reader_obj;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue