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
13#include "network-status.h"
14
15#include "ns3/object.h"
16#include "ns3/packet.h"
17
18namespace ns3
19{
20namespace lorawan
21{
22
23class NetworkStatus;
25
26/**
27 * @ingroup lorawan
28 *
29 * This class collects a series of components that deal with various aspects
30 * of managing the network, and queries them for action when a new packet is
31 * received or other events occur in the network.
32 */
34{
35 public:
36 /**
37 * Register this type.
38 * @return The object TypeId.
39 */
40 static TypeId GetTypeId();
41
42 NetworkController(); //!< Default constructor
43 ~NetworkController() override; //!< Destructor
44
45 /**
46 * Construct a new NetworkController object providing the NetworkStatus.
47 *
48 * @param networkStatus A pointer to the NetworkStatus object.
49 */
51
52 /**
53 * Add a new NetworkControllerComponent.
54 *
55 * @param component A pointer to the NetworkControllerComponent object.
56 */
58
59 /**
60 * Method that is called by the NetworkServer application when a new packet is received.
61 *
62 * @param packet The newly received packet.
63 */
64 void OnNewPacket(Ptr<const Packet> packet);
65
66 /**
67 * Method that is called by the NetworkScheduler just before sending a reply
68 * to a certain end device.
69 *
70 * @param endDeviceStatus A pointer to the EndDeviceStatus object.
71 */
72 void BeforeSendingReply(Ptr<EndDeviceStatus> endDeviceStatus);
73
74 private:
75 Ptr<NetworkStatus> m_status; //!< A pointer to the NetworkStatus object.
76 std::list<Ptr<NetworkControllerComponent>>
77 m_components; //!< List of NetworkControllerComponent objects.
78};
79
80} // namespace lorawan
81
82} // namespace ns3
83#endif /* NETWORK_CONTROLLER_H */
Object()
Constructor.
Definition object.cc:96
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
a unique identifier for an interface.
Definition type-id.h:49
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.