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
bridge-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
* Author: Gustavo Carneiro <gjc@inescporto.pt>
19
*/
20
#ifndef BRIDGE_HELPER_H
21
#define BRIDGE_HELPER_H
22
23
#include "ns3/net-device-container.h"
24
#include "ns3/object-factory.h"
25
26
#include <string>
27
28
/**
29
* \file
30
* \ingroup bridge
31
* ns3::BridgeHelper declaration.
32
*/
33
34
namespace
ns3
35
{
36
37
class
Node;
38
class
AttributeValue;
39
40
/**
41
* \ingroup bridge
42
* \brief Add capability to bridge multiple LAN segments (IEEE 802.1D bridging)
43
*/
44
class
BridgeHelper
45
{
46
public
:
47
/*
48
* Construct a BridgeHelper
49
*/
50
BridgeHelper
();
51
/**
52
* Set an attribute on each ns3::BridgeNetDevice created by
53
* BridgeHelper::Install
54
*
55
* \param n1 the name of the attribute to set
56
* \param v1 the value of the attribute to set
57
*/
58
void
SetDeviceAttribute
(std::string n1,
const
AttributeValue
& v1);
59
/**
60
* This method creates an ns3::BridgeNetDevice with the attributes
61
* configured by BridgeHelper::SetDeviceAttribute, adds the device
62
* to the node, and attaches the given NetDevices as ports of the
63
* bridge.
64
*
65
* \param node The node to install the device in
66
* \param c Container of NetDevices to add as bridge ports
67
* \returns A container holding the added net device.
68
*/
69
NetDeviceContainer
Install
(
Ptr<Node>
node,
NetDeviceContainer
c);
70
/**
71
* This method creates an ns3::BridgeNetDevice with the attributes
72
* configured by BridgeHelper::SetDeviceAttribute, adds the device
73
* to the node, and attaches the given NetDevices as ports of the
74
* bridge.
75
*
76
* \param nodeName The name of the node to install the device in
77
* \param c Container of NetDevices to add as bridge ports
78
* \returns A container holding the added net device.
79
*/
80
NetDeviceContainer
Install
(std::string nodeName,
NetDeviceContainer
c);
81
82
private
:
83
ObjectFactory
m_deviceFactory
;
//!< Object factory
84
};
85
86
}
// namespace ns3
87
88
#endif
/* BRIDGE_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:70
ns3::BridgeHelper
Add capability to bridge multiple LAN segments (IEEE 802.1D bridging)
Definition:
bridge-helper.h:45
ns3::BridgeHelper::SetDeviceAttribute
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Set an attribute on each ns3::BridgeNetDevice created by BridgeHelper::Install.
Definition:
bridge-helper.cc:43
ns3::BridgeHelper::m_deviceFactory
ObjectFactory m_deviceFactory
Object factory.
Definition:
bridge-helper.h:83
ns3::BridgeHelper::Install
NetDeviceContainer Install(Ptr< Node > node, NetDeviceContainer c)
This method creates an ns3::BridgeNetDevice with the attributes configured by BridgeHelper::SetDevice...
Definition:
bridge-helper.cc:50
ns3::BridgeHelper::BridgeHelper
BridgeHelper()
Definition:
bridge-helper.cc:36
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:43
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:48
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
bridge
helper
bridge-helper.h
Generated on Tue May 28 2024 23:34:13 for ns-3 by
1.9.6