mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 03:58:20 +00:00
Add supervisor node creation
This commit is contained in:
parent
7c08488dfc
commit
573e127672
5 changed files with 115 additions and 35 deletions
30
src/Pipe.h
30
src/Pipe.h
|
@ -66,4 +66,34 @@ private:
|
|||
int status_flags[2];
|
||||
};
|
||||
|
||||
class PipePair {
|
||||
public:
|
||||
|
||||
PipePair(int flags, int status_flags, int* fds = nullptr);
|
||||
|
||||
Pipe& In()
|
||||
{ return pipes[swapped]; }
|
||||
|
||||
Pipe& Out()
|
||||
{ return pipes[!swapped]; }
|
||||
|
||||
const Pipe& In() const
|
||||
{ return pipes[swapped]; }
|
||||
|
||||
const Pipe& Out() const
|
||||
{ return pipes[!swapped]; }
|
||||
|
||||
int InFD() const
|
||||
{ return In().ReadFD(); }
|
||||
|
||||
int OutFD() const
|
||||
{ return Out().WriteFD(); }
|
||||
|
||||
void Swap()
|
||||
{ swapped = ! swapped; }
|
||||
|
||||
Pipe pipes[2];
|
||||
bool swapped = false;
|
||||
};
|
||||
|
||||
} // namespace bro
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue