A Discrete-Event Network Simulator
API
Public Member Functions | Private Attributes | List of all members
ns3::BridgeHelper Class Reference

Add capability to bridge multiple LAN segments (IEEE 802.1D bridging) More...

#include "bridge-helper.h"

Public Member Functions

 BridgeHelper ()
 
NetDeviceContainer Install (Ptr< Node > node, NetDeviceContainer c)
 This method creates an ns3::BridgeNetDevice with the attributes configured by BridgeHelper::SetDeviceAttribute, adds the device to the node, and attaches the given NetDevices as ports of the bridge. More...
 
NetDeviceContainer Install (std::string nodeName, NetDeviceContainer c)
 This method creates an ns3::BridgeNetDevice with the attributes configured by BridgeHelper::SetDeviceAttribute, adds the device to the node, and attaches the given NetDevices as ports of the bridge. More...
 
void SetDeviceAttribute (std::string n1, const AttributeValue &v1)
 Set an attribute on each ns3::BridgeNetDevice created by BridgeHelper::Install. More...
 

Private Attributes

ObjectFactory m_deviceFactory
 Object factory. More...
 

Detailed Description

Add capability to bridge multiple LAN segments (IEEE 802.1D bridging)

Definition at line 37 of file bridge-helper.h.

Constructor & Destructor Documentation

◆ BridgeHelper()

ns3::BridgeHelper::BridgeHelper ( )

Member Function Documentation

◆ Install() [1/2]

NetDeviceContainer ns3::BridgeHelper::Install ( Ptr< Node node,
NetDeviceContainer  c 
)

This method creates an ns3::BridgeNetDevice with the attributes configured by BridgeHelper::SetDeviceAttribute, adds the device to the node, and attaches the given NetDevices as ports of the bridge.

Parameters
nodeThe node to install the device in
cContainer of NetDevices to add as bridge ports
Returns
A container holding the added net device.

Definition at line 43 of file bridge-helper.cc.

References ns3::Node::AddDevice(), ns3::NetDeviceContainer::Begin(), ns3::ObjectFactory::Create(), ns3::NetDeviceContainer::End(), ns3::Node::GetId(), m_deviceFactory, NS_LOG_FUNCTION_NOARGS, and NS_LOG_LOGIC().

Referenced by CsmaBridgeTestCase::DoRun(), BridgeTest::DoSetup(), TwoBridgeTest::DoSetup(), and Install().

◆ Install() [2/2]

NetDeviceContainer ns3::BridgeHelper::Install ( std::string  nodeName,
NetDeviceContainer  c 
)

This method creates an ns3::BridgeNetDevice with the attributes configured by BridgeHelper::SetDeviceAttribute, adds the device to the node, and attaches the given NetDevices as ports of the bridge.

Parameters
nodeNameThe name of the node to install the device in
cContainer of NetDevices to add as bridge ports
Returns
A container holding the added net device.

Definition at line 62 of file bridge-helper.cc.

References Install(), and NS_LOG_FUNCTION_NOARGS.

◆ SetDeviceAttribute()

void ns3::BridgeHelper::SetDeviceAttribute ( std::string  n1,
const AttributeValue v1 
)

Set an attribute on each ns3::BridgeNetDevice created by BridgeHelper::Install.

Parameters
n1the name of the attribute to set
v1the value of the attribute to set

Definition at line 36 of file bridge-helper.cc.

References m_deviceFactory, NS_LOG_FUNCTION_NOARGS, and ns3::ObjectFactory::Set().

Member Data Documentation

◆ m_deviceFactory

ObjectFactory ns3::BridgeHelper::m_deviceFactory
private

Object factory.

Definition at line 75 of file bridge-helper.h.

Referenced by BridgeHelper(), Install(), and SetDeviceAttribute().


The documentation for this class was generated from the following files: