|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include <sys/socket.h>
25 #include "ns3/core-module.h"
26 #include "ns3/network-module.h"
27 #include "ns3/internet-module.h"
28 #include "ns3/fd-net-device-module.h"
29 #include "ns3/internet-apps-module.h"
36 main (
int argc,
char *argv[])
39 cmd.Parse (argc, argv);
54 if (socketpair (AF_UNIX, SOCK_DGRAM, 0, sv) < 0)
68 addresses.
SetBase (
"10.0.0.0",
"255.255.255.0");
74 nodes.Get (1)->AddApplication (app);
holds a vector of ns3::NetDevice pointers
virtual NetDeviceContainer Install(Ptr< Node > node) const
This method creates a FdNetDevice and associates it to a node.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Parse command-line arguments.
AttributeValue implementation for Boolean.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetFileDescriptor(int fd)
Set the associated file descriptor.
void EnablePcapAll(std::string prefix, bool promiscuous=false)
Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created ...
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
void SetStopTime(Time stop)
Specify application stop time.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
void SetStartTime(Time start)
Specify application start time.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
static void Run(void)
Run the simulation.
Hold variables of type string.
static void Bind(std::string name, const AttributeValue &value)
Iterate over the set of GlobalValues until a matching name is found and then set its value with Globa...
a NetDevice to read/write network traffic from/into a file descriptor.
build a set of FdNetDevice objects Normally we eschew multiple inheritance, however,...
Time Seconds(double value)
Construct a Time in the indicated unit.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
keep track of a set of node pointers.
aggregate IP/TCP/UDP functionality to existing Nodes.
AttributeValue implementation for Ipv4Address.