1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-25 19:51:34 +01:00

Remove parent parameter from write_serialization

This is no longer needed as each PDU knows its parent PDU already
This commit is contained in:
Matias Fontanini
2017-04-29 09:53:33 -07:00
parent 8838ddf921
commit 4eb4dfe5fa
60 changed files with 79 additions and 97 deletions

View File

@@ -295,7 +295,7 @@ uint32_t TCP::header_size() const {
return sizeof(header_) + total_options_size_;
}
void TCP::write_serialization(uint8_t* buffer, uint32_t total_sz, const PDU* parent) {
void TCP::write_serialization(uint8_t* buffer, uint32_t total_sz) {
OutputMemoryStream stream(buffer, total_sz);
// Set checksum to 0, we'll calculate it at the end
checksum(0);
@@ -311,6 +311,7 @@ void TCP::write_serialization(uint8_t* buffer, uint32_t total_sz, const PDU* par
}
uint32_t check = 0;
const PDU* parent = parent_pdu();
if (const Tins::IP* ip_packet = tins_cast<const Tins::IP*>(parent)) {
check = Utils::pseudoheader_checksum(
ip_packet->src_addr(),