A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
ofswitch13-port.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
20
#ifndef OFSWITCH13_PORT_H
21
#define OFSWITCH13_PORT_H
22
23
#include "
ofswitch13-interface.h
"
24
#include "
ofswitch13-queue.h
"
25
26
#include <ns3/net-device.h>
27
#include <ns3/object.h>
28
#include <ns3/packet.h>
29
#include <ns3/traced-callback.h>
30
31
namespace
ns3
32
{
33
34
// The following explicit template instantiation declaration prevents modules
35
// including this header file from implicitly instantiating Queue<Packet>.
36
extern
template
class
Queue<Packet>
;
37
38
class
OFSwitch13Device;
39
50
class
OFSwitch13Port
:
public
Object
51
{
52
public
:
53
OFSwitch13Port
();
54
~
OFSwitch13Port
()
override
;
55
64
OFSwitch13Port
(
struct
datapath* dp,
65
Ptr<NetDevice>
netDev,
66
Ptr<OFSwitch13Device>
openflowDev);
67
72
static
TypeId
GetTypeId();
73
78
Ptr<NetDevice>
GetPortDevice()
const
;
79
84
uint32_t GetPortNo()
const
;
85
90
Ptr<OFSwitch13Queue>
GetPortQueue()
const
;
91
96
struct
sw_port* GetPortStruct();
97
102
Ptr<OFSwitch13Device>
GetSwitchDevice()
const
;
103
109
bool
PortUpdateState();
110
121
bool
Send
(
Ptr<const Packet>
packet,
122
uint32_t queueNo = 0,
123
uint64_t tunnelId = 0);
124
125
protected
:
127
void
DoDispose()
override
;
128
129
// Inherited from ObjectBase.
130
void
NotifyConstructionCompleted()
override
;
131
132
private
:
138
uint32_t GetPortFeatures();
139
153
bool
Receive(
Ptr<NetDevice>
device,
154
Ptr<const Packet>
packet,
155
uint16_t protocol,
156
const
Address
& from,
157
const
Address
& to,
158
NetDevice::PacketType
packetType);
159
161
TracedCallback<Ptr<const Packet>
>
m_rxTrace
;
162
164
TracedCallback<Ptr<const Packet>
>
m_txTrace
;
165
166
uint64_t
m_dpId
;
167
uint32_t
m_portNo
;
168
struct
sw_port*
m_swPort
;
169
Ptr<NetDevice>
m_netDev
;
170
Ptr<OFSwitch13Queue>
m_portQueue
;
171
ObjectFactory
m_factQueue
;
172
Ptr<OFSwitch13Device>
m_openflowDev
;
173
};
174
175
}
// namespace ns3
176
#endif
/* OFSWITCH13_PORT_H */
ns3::Address
a polymophic address class
Definition:
address.h:100
ns3::NetDevice::PacketType
PacketType
Packet types are used as they are in Linux.
Definition:
net-device.h:300
ns3::OFSwitch13Port
A OpenFlow switch port, interconnecting the underlying NetDevice to the OpenFlow device through the O...
Definition:
ofswitch13-port.h:51
ns3::OFSwitch13Port::m_portNo
uint32_t m_portNo
Port number.
Definition:
ofswitch13-port.h:167
ns3::OFSwitch13Port::m_swPort
struct sw_port * m_swPort
BOFUSS port structure.
Definition:
ofswitch13-port.h:168
ns3::OFSwitch13Port::m_rxTrace
TracedCallback< Ptr< const Packet > > m_rxTrace
Trace source fired when a packet arrives at this switch port.
Definition:
ofswitch13-port.h:161
ns3::OFSwitch13Port::m_portQueue
Ptr< OFSwitch13Queue > m_portQueue
OpenFlow port Queue.
Definition:
ofswitch13-port.h:170
ns3::OFSwitch13Port::m_openflowDev
Ptr< OFSwitch13Device > m_openflowDev
OpenFlow device.
Definition:
ofswitch13-port.h:172
ns3::OFSwitch13Port::m_factQueue
ObjectFactory m_factQueue
Factory for port queue.
Definition:
ofswitch13-port.h:171
ns3::OFSwitch13Port::m_txTrace
TracedCallback< Ptr< const Packet > > m_txTrace
Trace source fired when a packet will be sent over this switch port.
Definition:
ofswitch13-port.h:164
ns3::OFSwitch13Port::m_dpId
uint64_t m_dpId
OpenFlow datapath ID.
Definition:
ofswitch13-port.h:166
ns3::OFSwitch13Port::m_netDev
Ptr< NetDevice > m_netDev
Underlying NetDevice.
Definition:
ofswitch13-port.h:169
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:48
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:78
Queue< Packet >
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition:
traced-callback.h:54
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:60
Send
static void Send(Ptr< NetDevice > dev, int level, std::string emuMode)
Definition:
fd-emu-send.cc:54
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ofswitch13-interface.h
ofswitch13-queue.h
contrib
ofswitch13
model
ofswitch13-port.h
Generated on Fri Mar 31 2023 13:30:37 for ns-3 by
1.9.1