A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
sixlowpan-nd-test-utils.h
Go to the documentation of this file.
1/*
2 * Utility functions for sixlowpan ND tests.
3 * Extracted from sixlowpan-nd-reg-test.cc to reduce duplication and improve reuse.
4 */
5#ifndef SIXLOWPAN_ND_TEST_UTILS_H
6#define SIXLOWPAN_ND_TEST_UTILS_H
7
8#include "ns3/core-module.h"
9#include "ns3/internet-module.h"
10
11#include <list>
12#include <string>
13#include <utility>
14#include <vector>
15
16namespace ns3
17{
18
19/**
20 * @brief Generate expected routing table output for a star topology.
21 * @param numNodes total number of nodes (1 router + numNodes-1 leaf nodes)
22 * @param time simulation time at which the table is printed
23 * @return the expected routing table string
24 */
25std::string GenerateRoutingTableOutput(uint32_t numNodes, Time time);
26
27/**
28 * @brief Sort the host-route entries in node 0's routing table block numerically.
29 * @param routingTable the raw routing table string to sort
30 * @return the sorted routing table string
31 */
32std::string SortRoutingTableString(std::string routingTable);
33
34/**
35 * @brief Replace STALE with REACHABLE in an NDisc cache output string.
36 * @param ndiscOutput the NDisc cache output to normalize
37 * @return the normalized string
38 */
39std::string NormalizeNdiscCacheStates(const std::string& ndiscOutput);
40
41/**
42 * @brief Generate expected NDisc cache output for a star topology.
43 * @param numNodes total number of nodes
44 * @param time simulation time at which the cache is printed
45 * @return the expected NDisc cache string
46 */
47std::string GenerateNdiscCacheOutput(uint32_t numNodes, Time time);
48
49/**
50 * @brief Generate expected binding table output for a star topology.
51 * @param numNodes total number of nodes
52 * @param time simulation time at which the table is printed
53 * @return the expected binding table string
54 */
55std::string GenerateBindingTableOutput(uint32_t numNodes, Time time);
56
57} // namespace ns3
58
59#endif // SIXLOWPAN_ND_TEST_UTILS_H
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::string SortRoutingTableString(std::string routingTable)
Sort the host-route entries in node 0's routing table block numerically.
std::string GenerateNdiscCacheOutput(uint32_t numNodes, Time time)
Generate expected NDisc cache output for a star topology.
std::string GenerateBindingTableOutput(uint32_t numNodes, Time time)
Generate expected binding table output for a star topology.
std::string NormalizeNdiscCacheStates(const std::string &ndiscOutput)
Replace STALE with REACHABLE in an NDisc cache output string.
std::string GenerateRoutingTableOutput(uint32_t numNodes, Time time)
Generate expected routing table output for a star topology.