A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
openflow-switch-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Blake Hurd
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Blake Hurd <naimorai@gmail.com>
7
*/
8
#ifndef OPENFLOW_SWITCH_HELPER_H
9
#define OPENFLOW_SWITCH_HELPER_H
10
11
#include "ns3/net-device-container.h"
12
#include "ns3/object-factory.h"
13
#include "ns3/openflow-interface.h"
14
15
#include <string>
16
17
namespace
ns3
18
{
19
20
class
Node;
21
class
AttributeValue;
22
class
Controller;
23
24
/**
25
* \brief Add capability to switch multiple LAN segments (IEEE 802.1D bridging)
26
*/
27
class
OpenFlowSwitchHelper
28
{
29
public
:
30
/*
31
* Construct a OpenFlowSwitchHelper
32
*/
33
OpenFlowSwitchHelper
();
34
35
/**
36
* Set an attribute on each ns3::OpenFlowSwitchNetDevice created by
37
* OpenFlowSwitchHelper::Install
38
*
39
* \param n1 the name of the attribute to set
40
* \param v1 the value of the attribute to set
41
*/
42
void
SetDeviceAttribute
(std::string n1,
const
AttributeValue
& v1);
43
44
/**
45
* This method creates an ns3::OpenFlowSwitchNetDevice with the attributes
46
* configured by OpenFlowSwitchHelper::SetDeviceAttribute, adds the device
47
* to the node, attaches the given NetDevices as ports of the
48
* switch, and sets up a controller connection using the provided
49
* Controller.
50
*
51
* \param node The node to install the device in
52
* \param c Container of NetDevices to add as switch ports
53
* \param controller The controller connection.
54
* \returns A container holding the added net device.
55
*/
56
NetDeviceContainer
Install
(
Ptr<Node>
node,
57
NetDeviceContainer
c,
58
Ptr<ns3::ofi::Controller>
controller);
59
60
/**
61
* This method creates an ns3::OpenFlowSwitchNetDevice with the attributes
62
* configured by OpenFlowSwitchHelper::SetDeviceAttribute, adds the device
63
* to the node, and attaches the given NetDevices as ports of the
64
* switch.
65
*
66
* \param node The node to install the device in
67
* \param c Container of NetDevices to add as switch ports
68
* \returns A container holding the added net device.
69
*/
70
NetDeviceContainer
Install
(
Ptr<Node>
node,
NetDeviceContainer
c);
71
72
/**
73
* This method creates an ns3::OpenFlowSwitchNetDevice with the attributes
74
* configured by OpenFlowSwitchHelper::SetDeviceAttribute, adds the device
75
* to the node, and attaches the given NetDevices as ports of the
76
* switch.
77
*
78
* \param nodeName The name of the node to install the device in
79
* \param c Container of NetDevices to add as switch ports
80
* \returns A container holding the added net device.
81
*/
82
NetDeviceContainer
Install
(std::string nodeName,
NetDeviceContainer
c);
83
84
private
:
85
ObjectFactory
m_deviceFactory
;
//!< Object factory
86
};
87
88
}
// namespace ns3
89
90
#endif
/* OPENFLOW_SWITCH_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition
net-device-container.h:32
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::OpenFlowSwitchHelper
Add capability to switch multiple LAN segments (IEEE 802.1D bridging)
Definition
openflow-switch-helper.h:28
ns3::OpenFlowSwitchHelper::Install
NetDeviceContainer Install(Ptr< Node > node, NetDeviceContainer c, Ptr< ns3::ofi::Controller > controller)
This method creates an ns3::OpenFlowSwitchNetDevice with the attributes configured by OpenFlowSwitchH...
Definition
openflow-switch-helper.cc:36
ns3::OpenFlowSwitchHelper::m_deviceFactory
ObjectFactory m_deviceFactory
Object factory.
Definition
openflow-switch-helper.h:85
ns3::OpenFlowSwitchHelper::OpenFlowSwitchHelper
OpenFlowSwitchHelper()
Definition
openflow-switch-helper.cc:22
ns3::OpenFlowSwitchHelper::SetDeviceAttribute
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Set an attribute on each ns3::OpenFlowSwitchNetDevice created by OpenFlowSwitchHelper::Install.
Definition
openflow-switch-helper.cc:29
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
openflow
helper
openflow-switch-helper.h
Generated on Fri Nov 8 2024 13:59:05 for ns-3 by
1.11.0