A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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

namespace  anonymous_namespace{packet-metadata-test.cc}
 

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.
 

Macro Definition Documentation

◆ ADD_HEADER

#define ADD_HEADER ( p,
n )

◆ ADD_TRAILER

#define ADD_TRAILER ( p,
n )
Value:

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

Referenced by PacketMetadataTest::DoRun().

◆ 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__); \
}
Smart pointer class similar to boost::intrusive_ptr.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436

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

Referenced by PacketMetadataTest::DoRun().

◆ REM_HEADER

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

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

Referenced by PacketMetadataTest::DoRun().

◆ REM_TRAILER

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

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

Referenced by PacketMetadataTest::DoRun().

Variable Documentation

◆ g_packetMetadataTest

PacketMetadataTestSuite g_packetMetadataTest
static

Static variable for test initialization.

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