33 #include "ns3/core-module.h"
34 #include "ns3/network-module.h"
39 int main (
int argc,
char *argv[])
44 cmd.
AddValue (
"verbose",
"turn on log components", verbose);
45 cmd.
Parse(argc, argv);
65 txDev = CreateObject<SimpleNetDevice> ();
69 rxDev = CreateObject<SimpleNetDevice> ();
virtual Address GetAddress(void) const
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Smart pointer class similar to boost::intrusive_ptr.
void SetLocal(PacketSocketAddress addr)
set the local address and protocol to be used
an address for a packet socket
static void Run(void)
Run the simulation.
Give ns3::PacketSocket powers to ns3::Node.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
virtual void SetNode(Ptr< Node > node)
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
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.
void SetPhysicalAddress(const Address address)
Set the destination address.
keep track of a set of node pointers.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
void SetRemote(PacketSocketAddress addr)
set the remote address and protocol to be used
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
void SetProtocol(uint16_t protocol)
Set the protocol.
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.
void SetChannel(Ptr< SimpleChannel > channel)
Attach a channel to this net device.
virtual uint32_t GetIfIndex(void) const