1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 04:54:28 +01:00

Add extensions for ICMPv6

This commit is contained in:
Matias Fontanini
2015-12-21 12:33:52 -08:00
parent 530cc56922
commit 6d90b0ce32
11 changed files with 779 additions and 474 deletions

View File

@@ -79,6 +79,7 @@ ICMPExtension::serialization_type ICMPExtension::serialize() const {
// ICMPExtensionsStructure class
const uint32_t ICMPExtensionsStructure::MINIMUM_ICMP_PAYLOAD = 128;
const uint32_t ICMPExtensionsStructure::BASE_HEADER_SIZE = sizeof(uint16_t) * 2;
ICMPExtensionsStructure::ICMPExtensionsStructure()
@@ -148,7 +149,6 @@ void ICMPExtensionsStructure::add_extension(const ICMPExtension& extension) {
void ICMPExtensionsStructure::serialize(uint8_t* buffer, uint32_t buffer_size) {
const uint32_t structure_size = size();
if (buffer_size < structure_size) {
std::cout << buffer_size << " vs " << structure_size << std::endl;
throw malformed_packet();
}
uint8_t* original_ptr = buffer;