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 * 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
17namespace ns3
18{
19
20class Node;
21class AttributeValue;
22class Controller;
23
24/**
25 * \brief Add capability to switch multiple LAN segments (IEEE 802.1D bridging)
26 */
28{
29 public:
30 /*
31 * Construct a OpenFlowSwitchHelper
32 */
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 */
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 */
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 */
Hold a value for an Attribute.
Definition attribute.h:59
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.