A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
network-controller.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 University of Padova
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Davide Magrin <magrinda@dei.unipd.it>
7 */
8
9#ifndef NETWORK_CONTROLLER_H
10#define NETWORK_CONTROLLER_H
11
12#include "ns3/object.h"
13#include "ns3/packet.h"
14
15namespace ns3
16{
17namespace lorawan
18{
19
20class NetworkStatus;
21class EndDeviceStatus;
23
24/**
25 * @ingroup lorawan
26 *
27 * This class collects a series of components that deal with various aspects
28 * of managing the network, and queries them for action when a new packet is
29 * received or other events occur in the network.
30 */
32{
33 public:
34 /**
35 * Register this type.
36 * @return The object TypeId.
37 */
38 static TypeId GetTypeId();
39
40 NetworkController(); //!< Default constructor
41 ~NetworkController() override; //!< Destructor
42
43 /**
44 * Construct a new NetworkController object providing the NetworkStatus.
45 *
46 * @param networkStatus A pointer to the NetworkStatus object.
47 */
49
50 /**
51 * Add a new NetworkControllerComponent.
52 *
53 * @param component A pointer to the NetworkControllerComponent object.
54 */
56
57 /**
58 * Method that is called by the NetworkServer application when a new packet is received.
59 *
60 * @param packet The newly received packet.
61 */
62 void OnNewPacket(Ptr<const Packet> packet);
63
64 /**
65 * Method that is called by the NetworkScheduler just before sending a reply
66 * to a certain end device.
67 *
68 * @param endDeviceStatus A pointer to the EndDeviceStatus object.
69 */
70 void BeforeSendingReply(Ptr<EndDeviceStatus> endDeviceStatus);
71
72 private:
73 Ptr<NetworkStatus> m_status; //!< A pointer to the NetworkStatus object.
74 std::list<Ptr<NetworkControllerComponent>>
75 m_components; //!< List of NetworkControllerComponent objects.
76};
77
78} // namespace lorawan
79} // namespace ns3
80
81#endif /* NETWORK_CONTROLLER_H */
Object()
Caller graph was not generated because of its size.
Definition object.cc:93
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
a unique identifier for an interface.
Definition type-id.h:50
This class represents the network server's knowledge about an end device in the LoRaWAN network it is...
Generic class describing a component of the NetworkController.
void Install(Ptr< NetworkControllerComponent > component)
Add a new NetworkControllerComponent.
Ptr< NetworkStatus > m_status
A pointer to the NetworkStatus object.
void OnNewPacket(Ptr< const Packet > packet)
Method that is called by the NetworkServer application when a new packet is received.
NetworkController()
Default constructor.
void BeforeSendingReply(Ptr< EndDeviceStatus > endDeviceStatus)
Method that is called by the NetworkScheduler just before sending a reply to a certain end device.
static TypeId GetTypeId()
Register this type.
std::list< Ptr< NetworkControllerComponent > > m_components
List of NetworkControllerComponent objects.
~NetworkController() override
Destructor.
This class represents the knowledge about the state of the network that is available at the network s...
Every class exported by the ns3 library is enclosed in the ns3 namespace.