A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
bridge-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 * Author: Gustavo Carneiro <gjc@inescporto.pt>
8 */
9#ifndef BRIDGE_HELPER_H
10#define BRIDGE_HELPER_H
11
12#include "ns3/net-device-container.h"
13#include "ns3/object-factory.h"
14
15#include <string>
16
17/**
18 * \file
19 * \ingroup bridge
20 * ns3::BridgeHelper declaration.
21 */
22
23namespace ns3
24{
25
26class Node;
27class AttributeValue;
28
29/**
30 * \ingroup bridge
31 * \brief Add capability to bridge multiple LAN segments (IEEE 802.1D bridging)
32 */
34{
35 public:
36 /*
37 * Construct a BridgeHelper
38 */
40 /**
41 * Set an attribute on each ns3::BridgeNetDevice created by
42 * BridgeHelper::Install
43 *
44 * \param n1 the name of the attribute to set
45 * \param v1 the value of the attribute to set
46 */
47 void SetDeviceAttribute(std::string n1, const AttributeValue& v1);
48 /**
49 * This method creates an ns3::BridgeNetDevice with the attributes
50 * configured by BridgeHelper::SetDeviceAttribute, adds the device
51 * to the node, and attaches the given NetDevices as ports of the
52 * bridge.
53 *
54 * \param node The node to install the device in
55 * \param c Container of NetDevices to add as bridge ports
56 * \returns A container holding the added net device.
57 */
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 nodeName The name of 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(std::string nodeName, NetDeviceContainer c);
70
71 private:
72 ObjectFactory m_deviceFactory; //!< Object factory
73};
74
75} // namespace ns3
76
77#endif /* BRIDGE_HELPER_H */
Hold a value for an Attribute.
Definition attribute.h:59
Add capability to bridge multiple LAN segments (IEEE 802.1D bridging)
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Set an attribute on each ns3::BridgeNetDevice created by BridgeHelper::Install.
ObjectFactory m_deviceFactory
Object factory.
NetDeviceContainer Install(Ptr< Node > node, NetDeviceContainer c)
This method creates an ns3::BridgeNetDevice with the attributes configured by BridgeHelper::SetDevice...
holds a vector of ns3::NetDevice pointers
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.