19#include "ns3/net-device.h"
20#include "ns3/node-container.h"
21#include "ns3/packet.h"
22#include "ns3/point-to-point-net-device.h"
37 TypeId(
"ns3::NetworkServer")
39 .AddConstructor<NetworkServer>()
42 "Trace source that is fired when a packet arrives at the network server",
44 "ns3::Packet::TracedCallback")
45 .SetGroupName(
"lorawan");
81 for (
uint32_t i = 0; i < gateway->GetNDevices(); i++)
97 Address gatewayAddress = p2pNetDevice->GetAddress();
102 m_status->AddGateway(gatewayAddress, gwStatus);
112 for (it =
nodes.Begin(); it !=
nodes.End(); it++)
125 for (
uint32_t i = 0; i < node->GetNDevices(); i++)
161 m_status->OnReceivedPacket(packet, address);
a polymophic address class
keep track of a set of node pointers.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
This class collects a series of components that deal with various aspects of managing the network,...
Network server component in charge of scheduling downling packets onto devices' reception windows.
The NetworkServer is an application standing on top of a node equipped with links that connect it wit...
void AddNode(Ptr< Node > node)
Inform the NetworkServer application that this node is connected to the network.
NetworkServer()
Default constructor.
Ptr< NetworkStatus > GetNetworkStatus()
Get the NetworkStatus object of this NetworkServer application.
void AddGateway(Ptr< Node > gateway, Ptr< NetDevice > netDevice)
Add the gateway to the list of gateways connected to this network server.
TracedCallback< Ptr< const Packet > > m_receivedPacket
The ReceivedPacket trace source.
bool Receive(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &sender)
Receive a packet from a gateway.
void StopApplication() override
Stop the network server application.
static TypeId GetTypeId()
Register this type.
Ptr< NetworkScheduler > m_scheduler
Ptr to the NetworkScheduler object.
Ptr< NetworkStatus > m_status
Ptr to the NetworkStatus object.
void AddNodes(NodeContainer nodes)
Inform the NetworkServer application that these nodes are connected to the network.
~NetworkServer() override
Destructor.
void AddComponent(Ptr< NetworkControllerComponent > component)
Add a NetworkControllerComponent to this NetworkServer application.
void StartApplication() override
Start the network server application.
Ptr< NetworkController > m_controller
Ptr to the NetworkController object.
This class represents the knowledge about the state of the network that is available at the network s...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.