PIA: Modernize how struct initialization is done

This commit is contained in:
Tim Wojtulewicz 2023-04-28 11:18:10 -07:00 committed by Arne Welzel
parent 3efb27c963
commit b8313c2487

View file

@ -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,