21 #include "ns3/packet.h"
22 #include "ns3/simulator.h"
23 #include "ns3/mgt-headers.h"
24 #include "ns3/dot11s-mac-header.h"
25 #include "ns3/hwmp-rtable.h"
26 #include "ns3/peer-link-frame.h"
27 #include "ns3/ie-dot11s-peer-management.h"
30 using namespace dot11s;
36 TestCase (
"Dot11sMeshHeader roundtrip serialization")
91 virtual void DoRun ();
102 void TestPrecursorAdd ();
103 void TestPrecursorFind ();
118 dst (
"01:00:00:01:00:01"),
119 hop (
"01:00:00:01:00:03"),
170 for (std::vector<Mac48Address>::const_iterator i =
precursors.begin (); i !=
precursors.end (); i++)
183 for (
unsigned i = 0; i <
precursors.size (); i++)
193 table = CreateObject<HwmpRtable> ();
202 Simulator::Destroy ();
209 TestCase (
"PeerLinkFrames (open, confirm, close) unit tests")
212 virtual void DoRun ();
221 fields.
subtype = (uint8_t)(WifiActionHeader::PEER_LINK_OPEN);
237 fields.
subtype = (uint8_t)(WifiActionHeader::PEER_LINK_CONFIRM);
253 fields.
subtype = (uint8_t)(WifiActionHeader::PEER_LINK_CLOSE);
275 :
TestSuite (
"devices-mesh-dot11s", UNIT)
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Simulation virtual time values and global simulation resolution.
virtual void DoRun()
Implementation to actually run this TestCase.
802.11s Peer link management frame
void SetPlinkFrameSubtype(uint8_t subtype)
Route lookup result, return type of LookupXXX methods.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
LookupResult LookupReactiveExpired(Mac48Address destination)
Return all reactive paths, including expired.
Unit test for HwmpRtable.
void TestLookup()
Test Add apth and lookup path;.
a IEEE 802.11s Mesh ID 7.3.287 of 802.11s draft 3.0
bool IsValid() const
True for valid route.
LookupResult LookupReactive(Mac48Address destination)
Lookup path to destination.
std::vector< std::pair< uint32_t, Mac48Address > > PrecursorList
Path precursor = {MAC, interface ID}.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
PrecursorList GetPrecursors(Mac48Address destination)
Built-in self test for PeerLinkFrameStart.
void AddPrecursor(Mac48Address destination, uint32_t precursorInterface, Mac48Address precursorAddress, Time lifetime)
virtual void DoRun()
Implementation to actually run this TestCase.
LookupResult LookupProactiveExpired()
Return all proactive paths, including expired.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void AddReactivePath(Mac48Address destination, Mac48Address retransmitter, uint32_t interface, uint32_t metric, Time lifetime, uint32_t seqnum)
static Dot11sTestSuite g_dot11sTestSuite
void SetPlinkFrameStart(PlinkFrameStartFields)
void DeleteProactivePath()
Time Seconds(double value)
Construct a Time in the indicated unit.
std::vector< Mac48Address > precursors
void DeleteReactivePath(Mac48Address destination)
void AddProactivePath(uint32_t metric, Mac48Address root, Mac48Address retransmitter, uint32_t interface, Time lifetime, uint32_t seqnum)
void AddHeader(const Header &header)
Add header to this packet.
LookupResult LookupProactive()
Find proactive path to tree root. Note that calling this method has side effect of deleting expired p...