20 #include "ns3/core-module.h"
21 #include "ns3/ipv4-click-routing.h"
22 #include "ns3/click-internet-stack-helper.h"
30 main (
int argc,
char *argv[])
33 std::string clickConfigFolder =
"src/click/examples";
36 cmd.
AddValue (
"clickConfigFolder",
"Base folder for click configuration files", clickConfigFolder);
37 cmd.
Parse (argc, argv);
49 std::map<std::string, std::string> defines;
52 defines[
"OUTPUT"] =
"\"Hello World!\"";
54 ClickInternetStackHelper clickinternet;
55 clickinternet.SetClickFile (n, clickConfigFolder +
"/nsclick-defines.click");
56 clickinternet.SetRoutingTableElement (n,
"rt");
57 clickinternet.SetDefines(n, defines);
58 clickinternet.Install (n);
69 NS_FATAL_ERROR (
"Can't use ns-3-click without NSCLICK compiled in");
static void Run(void)
Run the simulation.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Parse command-line arguments.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Time Seconds(double value)
Construct a Time in the indicated unit.
void Parse(int argc, char *argv[])
Parse the program arguments.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.