mirror of
https://github.com/mfontanini/libtins
synced 2026-01-28 12:44:25 +01:00
Add MPLS PDU and hook it up with ICMP extensions
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "exceptions.h"
|
||||
#include "utils.h"
|
||||
#include "memory_helpers.h"
|
||||
#include "mpls.h"
|
||||
|
||||
using std::runtime_error;
|
||||
|
||||
@@ -135,6 +136,12 @@ void ICMPExtensionsStructure::add_extension(const ICMPExtension& extension) {
|
||||
extensions_.push_back(extension);
|
||||
}
|
||||
|
||||
void ICMPExtensionsStructure::add_extension(MPLS& mpls) {
|
||||
ICMPExtension extension(1, 1);
|
||||
extension.payload(mpls.serialize());
|
||||
add_extension(extension);
|
||||
}
|
||||
|
||||
void ICMPExtensionsStructure::serialize(uint8_t* buffer, uint32_t buffer_size) {
|
||||
OutputMemoryStream stream(buffer, buffer_size);
|
||||
uint8_t* original_ptr = buffer;
|
||||
|
||||
Reference in New Issue
Block a user