A Discrete-Event Network Simulator
API
packet-metadata-test.cc File Reference
#include "ns3/header.h"
#include "ns3/packet-metadata.h"
#include "ns3/packet.h"
#include "ns3/test.h"
#include "ns3/trailer.h"
#include <cstdarg>
#include <iostream>
#include <sstream>
+ Include dependency graph for packet-metadata-test.cc:

Go to the source code of this file.

Classes

class  anonymous_namespace{packet-metadata-test.cc}::HistoryHeader< N >
 Template header-type class to check the proper header concatenation. More...
 
class  anonymous_namespace{packet-metadata-test.cc}::HistoryHeaderBase
 Base header-type class to check the proper header concatenation. More...
 
class  anonymous_namespace{packet-metadata-test.cc}::HistoryTrailer< N >
 Template trailer-type class to check the proper trailer concatenation. More...
 
class  anonymous_namespace{packet-metadata-test.cc}::HistoryTrailerBase
 Base trailer-type class to check the proper trailer concatenation. More...
 
class  PacketMetadataTest
 Packet Metadata unit tests. More...
 
class  PacketMetadataTestSuite
 Packet Metadata TestSuite. More...
 

Namespaces

 

Macros

#define ADD_HEADER(p, n)
 
#define ADD_TRAILER(p, n)
 
#define CHECK_HISTORY(p, ...)
 
#define REM_HEADER(p, n)
 
#define REM_TRAILER(p, n)
 

Variables

static PacketMetadataTestSuite g_packetMetadataTest
 Static variable for test initialization. More...
 

Macro Definition Documentation

◆ ADD_HEADER

#define ADD_HEADER (   p,
 
)
Value:
{ \
HistoryHeader<n> header; \
p->AddHeader(header); \
}

Definition at line 441 of file packet-metadata-test.cc.

◆ ADD_TRAILER

#define ADD_TRAILER (   p,
 
)
Value:
{ \
HistoryTrailer<n> trailer; \
p->AddTrailer(trailer); \
}

Definition at line 446 of file packet-metadata-test.cc.

◆ CHECK_HISTORY

#define CHECK_HISTORY (   p,
  ... 
)
Value:
{ \
CheckHistory(p, __VA_ARGS__); \
uint32_t size = p->GetSerializedSize(); \
uint8_t* buffer = new uint8_t[size]; \
p->Serialize(buffer, size); \
Ptr<Packet> otherPacket = Create<Packet>(buffer, size, true); \
delete[] buffer; \
CheckHistory(otherPacket, __VA_ARGS__); \
}

Definition at line 461 of file packet-metadata-test.cc.

◆ REM_HEADER

#define REM_HEADER (   p,
 
)
Value:
{ \
HistoryHeader<n> header; \
p->RemoveHeader(header); \
}

Definition at line 451 of file packet-metadata-test.cc.

◆ REM_TRAILER

#define REM_TRAILER (   p,
 
)
Value:
{ \
HistoryTrailer<n> trailer; \
p->RemoveTrailer(trailer); \
}

Definition at line 456 of file packet-metadata-test.cc.

Variable Documentation

◆ g_packetMetadataTest

PacketMetadataTestSuite g_packetMetadataTest
static

Static variable for test initialization.

Definition at line 902 of file packet-metadata-test.cc.