A Discrete-Event Network Simulator
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 * 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: Blake Hurd <naimorai@gmail.com>
18 */
19#ifndef OPENFLOW_SWITCH_HELPER_H
20#define OPENFLOW_SWITCH_HELPER_H
21
22#include "ns3/net-device-container.h"
23#include "ns3/object-factory.h"
24#include "ns3/openflow-interface.h"
25
26#include <string>
27
28namespace ns3
29{
30
31class Node;
32class AttributeValue;
33class Controller;
34
35/**
36 * \brief Add capability to switch multiple LAN segments (IEEE 802.1D bridging)
37 */
39{
40 public:
41 /*
42 * Construct a OpenFlowSwitchHelper
43 */
45
46 /**
47 * Set an attribute on each ns3::OpenFlowSwitchNetDevice created by
48 * OpenFlowSwitchHelper::Install
49 *
50 * \param n1 the name of the attribute to set
51 * \param v1 the value of the attribute to set
52 */
53 void SetDeviceAttribute(std::string n1, const AttributeValue& v1);
54
55 /**
56 * This method creates an ns3::OpenFlowSwitchNetDevice with the attributes
57 * configured by OpenFlowSwitchHelper::SetDeviceAttribute, adds the device
58 * to the node, attaches the given NetDevices as ports of the
59 * switch, and sets up a controller connection using the provided
60 * Controller.
61 *
62 * \param node The node to install the device in
63 * \param c Container of NetDevices to add as switch ports
64 * \param controller The controller connection.
65 * \returns A container holding the added net device.
66 */
69 Ptr<ns3::ofi::Controller> controller);
70
71 /**
72 * This method creates an ns3::OpenFlowSwitchNetDevice with the attributes
73 * configured by OpenFlowSwitchHelper::SetDeviceAttribute, adds the device
74 * to the node, and attaches the given NetDevices as ports of the
75 * switch.
76 *
77 * \param node The node to install the device in
78 * \param c Container of NetDevices to add as switch ports
79 * \returns A container holding the added net device.
80 */
82
83 /**
84 * This method creates an ns3::OpenFlowSwitchNetDevice with the attributes
85 * configured by OpenFlowSwitchHelper::SetDeviceAttribute, adds the device
86 * to the node, and attaches the given NetDevices as ports of the
87 * switch.
88 *
89 * \param nodeName The name of the node to install the device in
90 * \param c Container of NetDevices to add as switch ports
91 * \returns A container holding the added net device.
92 */
93 NetDeviceContainer Install(std::string nodeName, NetDeviceContainer c);
94
95 private:
96 ObjectFactory m_deviceFactory; //!< Object factory
97};
98
99} // namespace ns3
100
101#endif /* OPENFLOW_SWITCH_HELPER_H */
Hold a value for an Attribute.
Definition: attribute.h:70
holds a vector of ns3::NetDevice pointers
Instantiate subclasses of ns3::Object.
Add capability to switch multiple LAN segments (IEEE 802.1D bridging)
NetDeviceContainer Install(Ptr< Node > node, NetDeviceContainer c, Ptr< ns3::ofi::Controller > controller)
This method creates an ns3::OpenFlowSwitchNetDevice with the attributes configured by OpenFlowSwitchH...
ObjectFactory m_deviceFactory
Object factory.
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Set an attribute on each ns3::OpenFlowSwitchNetDevice created by OpenFlowSwitchHelper::Install.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Every class exported by the ns3 library is enclosed in the ns3 namespace.