A Discrete-Event Network Simulator
API
ofswitch13-queue.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 University of Campinas (Unicamp)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Luciano Jerez Chaves <ljerezchaves@gmail.com>
18  */
19 #ifndef OFSWITCH13_QUEUE_H
20 #define OFSWITCH13_QUEUE_H
21 
22 #include "ofswitch13-interface.h"
23 
24 #include <ns3/packet.h>
25 #include <ns3/queue.h>
26 
27 namespace ns3
28 {
29 
30 // The following explicit template instantiation declaration prevents modules
31 // including this header file from implicitly instantiating Queue<Packet>.
32 extern template class Queue<Packet>;
33 
55 {
56  public:
61  static TypeId GetTypeId();
62 
63  OFSwitch13Queue();
64  ~OFSwitch13Queue() override;
65 
66  // Inherited from Queue.
67  bool Enqueue(Ptr<Packet> packet) override;
68 
73  int GetNQueues() const;
74 
82  Ptr<Queue<Packet>> GetQueue(int queueId) const;
83 
88  void SetPortStruct(struct sw_port* port);
89 
90  protected:
92  void DoDispose() override;
93 
94  // Inherited from Object.
95  void DoInitialize() override;
96 
102  uint32_t AddQueue(Ptr<Queue<Packet>> queue);
103 
108  void NotifyDequeue(Ptr<Packet> packet);
109 
114  void NotifyRemove(Ptr<Packet> packet);
115 
116  // Values used for logging context.
117  uint64_t m_dpId;
118  uint32_t m_portNo;
119 
120  private:
123  typedef std::vector<Ptr<Queue>> QueueList_t;
124 
125  struct sw_port* m_swPort;
127 
129 };
130 
131 } // namespace ns3
132 #endif /* OFSWITCH13_QUEUE_H */
The OpenFlow 1.3 queue interface.
NS_LOG_TEMPLATE_DECLARE
Redefinition of the log component.
QueueList_t m_queues
List of internal queues.
std::vector< Ptr< Queue > > QueueList_t
Structure to save the list of internal queues in this queue interface.
struct sw_port * m_swPort
BOFUSS port structure.
uint64_t m_dpId
OpenFlow datapath ID.
uint32_t m_portNo
OpenFlow port number.
a unique identifier for an interface.
Definition: type-id.h:60
uint16_t port
Definition: dsdv-manet.cc:45
Every class exported by the ns3 library is enclosed in the ns3 namespace.