~ubuntu-branches/ubuntu/quantal/ns3/quantal

« back to all changes in this revision

Viewing changes to ns-3.13/src/openflow/helper/openflow-switch-helper.h

  • Committer: Package Import Robot
  • Author(s): YunQiang Su, Aron Xu, YunQiang Su, Upstream
  • Date: 2012-01-06 00:35:42 UTC
  • mfrom: (10.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120106003542-vcn5g03mhapm991h
Tags: 3.13+dfsg-1
[ Aron Xu ]:
        add tag binary and binary-indep, 
  for not build doc when --binary-arch (Closes: #654493).
[ YunQiang Su ]
        add waf 1.5/1.6 source to debian directory, 
  and build waf from there (Closes: #642217).
[ Upstream ]
  Successfully link with --as-needed option (Closes: #642225).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 
2
/*
 
3
 * Copyright (c) 2011 Blake Hurd
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License version 2 as
 
7
 * published by the Free Software Foundation;
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
 *
 
18
 * Author: Blake Hurd  <naimorai@gmail.com>
 
19
 */
 
20
#ifndef OPENFLOW_SWITCH_HELPER_H
 
21
#define OPENFLOW_SWITCH_HELPER_H
 
22
 
 
23
#include "ns3/openflow-interface.h"
 
24
#include "ns3/net-device-container.h"
 
25
#include "ns3/object-factory.h"
 
26
#include <string>
 
27
 
 
28
namespace ns3 {
 
29
 
 
30
class Node;
 
31
class AttributeValue;
 
32
class Controller;
 
33
 
 
34
/**
 
35
 * \brief Add capability to switch multiple LAN segments (IEEE 802.1D bridging)
 
36
 */
 
37
class OpenFlowSwitchHelper
 
38
{
 
39
public:
 
40
  /*
 
41
   * Construct a OpenFlowSwitchHelper
 
42
   */
 
43
  OpenFlowSwitchHelper ();
 
44
 
 
45
  /**
 
46
   * Set an attribute on each ns3::OpenFlowSwitchNetDevice created by
 
47
   * OpenFlowSwitchHelper::Install
 
48
   *
 
49
   * \param n1 the name of the attribute to set
 
50
   * \param v1 the value of the attribute to set
 
51
   */
 
52
  void
 
53
  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
   */
 
67
  NetDeviceContainer
 
68
  Install (Ptr<Node> node, NetDeviceContainer c, Ptr<ns3::ofi::Controller> controller);
 
69
 
 
70
  /**
 
71
   * This method creates an ns3::OpenFlowSwitchNetDevice with the attributes
 
72
   * configured by OpenFlowSwitchHelper::SetDeviceAttribute, adds the device
 
73
   * to the node, and attaches the given NetDevices as ports of the
 
74
   * switch.
 
75
   *
 
76
   * \param node The node to install the device in
 
77
   * \param c Container of NetDevices to add as switch ports
 
78
   * \returns A container holding the added net device.
 
79
   */
 
80
  NetDeviceContainer
 
81
  Install (Ptr<Node> node, NetDeviceContainer c);
 
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
 
94
  Install (std::string nodeName, NetDeviceContainer c);
 
95
 
 
96
private:
 
97
  ObjectFactory m_deviceFactory;
 
98
};
 
99
 
 
100
} // namespace ns3
 
101
 
 
102
#endif /* OPENFLOW_SWITCH_HELPER_H */