mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
PIA: Modernize how struct initialization is done
This commit is contained in:
parent
3efb27c963
commit
b8313c2487
1 changed files with 12 additions and 19 deletions
|
@ -60,29 +60,22 @@ protected:
|
||||||
// sequence numbers for TCP) and chunks of a reassembled stream.
|
// sequence numbers for TCP) and chunks of a reassembled stream.
|
||||||
struct DataBlock
|
struct DataBlock
|
||||||
{
|
{
|
||||||
IP_Hdr* ip;
|
IP_Hdr* ip = nullptr;
|
||||||
const u_char* data;
|
const u_char* data = nullptr;
|
||||||
bool is_orig;
|
bool is_orig = false;
|
||||||
int len;
|
size_t len = 0;
|
||||||
uint64_t seq;
|
size_t cap_len = 0;
|
||||||
DataBlock* next;
|
uint64_t seq = 0;
|
||||||
|
DataBlock* next = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Buffer
|
struct Buffer
|
||||||
{
|
{
|
||||||
Buffer()
|
DataBlock* head = nullptr;
|
||||||
{
|
DataBlock* tail = nullptr;
|
||||||
head = tail = nullptr;
|
int64_t size = 0;
|
||||||
size = 0;
|
int64_t chunks = 0;
|
||||||
chunks = 0;
|
State state = INIT;
|
||||||
state = INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
DataBlock* head;
|
|
||||||
DataBlock* tail;
|
|
||||||
int64_t size;
|
|
||||||
int64_t chunks;
|
|
||||||
State state;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddToBuffer(Buffer* buffer, uint64_t seq, int len, const u_char* data, bool is_orig,
|
void AddToBuffer(Buffer* buffer, uint64_t seq, int len, const u_char* data, bool is_orig,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue