1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 12:14:26 +01:00

Add MPLS PDU and hook it up with ICMP extensions

This commit is contained in:
Matias Fontanini
2015-12-31 05:57:18 -08:00
parent 4ba9085eeb
commit 7bffa7801d
14 changed files with 434 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
#include "ip.h"
#include "ethernetII.h"
#include "utils.h"
#include "mpls.h"
#include "rawpdu.h"
using namespace std;
@@ -313,6 +314,8 @@ TEST_F(ICMPTest, ExtensionsParsingWithoutALengthField) {
ICMP icmp(packet_with_extensions, sizeof(packet_with_extensions));
ICMPExtensionsStructure extensions = icmp.extensions();
ASSERT_EQ(1, extensions.extensions().size());
MPLS mpls(*extensions.extensions().begin());
EXPECT_EQ(100704, mpls.label());
EXPECT_EQ(
ICMPExtension::payload_type(ext, ext + sizeof(ext)),
extensions.extensions().begin()->serialize()