|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
18 #ifndef BRIDGE_NET_DEVICE_H
19 #define BRIDGE_NET_DEVICE_H
21 #include "ns3/net-device.h"
22 #include "ns3/mac48-address.h"
23 #include "ns3/nstime.h"
24 #include "ns3/bridge-channel.h"
113 virtual void SetIfIndex (
const uint32_t index);
118 virtual bool SetMtu (
const uint16_t mtu);
119 virtual uint16_t
GetMtu (
void)
const;
a unique identifier for an interface.
void AddBridgePort(Ptr< NetDevice > bridgePort)
Add a 'port' to a bridge device.
void ForwardBroadcast(Ptr< NetDevice > incomingPort, Ptr< const Packet > packet, uint16_t protocol, Mac48Address src, Mac48Address dst)
Forwards a broadcast or a multicast packet.
void ReceiveFromDevice(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, Address const &source, Address const &destination, PacketType packetType)
Receives a packet from one bridged port.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
virtual void SetAddress(Address address)
Set the address of this interface.
void ForwardUnicast(Ptr< NetDevice > incomingPort, Ptr< const Packet > packet, uint16_t protocol, Mac48Address src, Mac48Address dst)
Forwards a unicast packet.
Ipv4 addresses are stored in host order in this class.
NetDevice::PromiscReceiveCallback m_promiscRxCallback
promiscuous receive callback
Describes an IPv6 address.
std::map< Mac48Address, LearnedState > m_learnState
Container for known address statuses.
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
Time m_expirationTime
time it takes for learned MAC state to expire
virtual Ptr< Channel > GetChannel(void) const
Ptr< Node > m_node
node owning this NetDevice
Ptr< NetDevice > GetLearnedState(Mac48Address source)
Gets the port associated to a source address.
virtual Ptr< Node > GetNode(void) const
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
uint16_t m_mtu
MTU of the bridged NetDevice.
a polymophic address class
virtual uint16_t GetMtu(void) const
std::vector< Ptr< NetDevice > > m_ports
bridged ports
virtual void SetIfIndex(const uint32_t index)
virtual ~BridgeNetDevice()
uint32_t GetNBridgePorts(void) const
Gets the number of bridged 'ports', i.e., the NetDevices currently bridged.
Simulation virtual time values and global simulation resolution.
uint32_t m_ifIndex
Interface index.
Ptr< NetDevice > associatedPort
port associated with the address
static TypeId GetTypeId(void)
Get the type ID.
Ptr< NetDevice > GetBridgePort(uint32_t n) const
Gets the n-th bridged port.
virtual uint32_t GetIfIndex(void) const
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
virtual bool NeedsArp(void) const
virtual bool IsLinkUp(void) const
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
NetDevice::ReceiveCallback m_rxCallback
receive callback
Structure holding the status of an address.
virtual bool IsBroadcast(void) const
virtual bool SupportsSendFrom() const
virtual Address GetBroadcast(void) const
Time expirationTime
time it takes for learned MAC state to expire
Mac48Address m_address
MAC address of the NetDevice.
BridgeNetDevice & operator=(const BridgeNetDevice &)
Copy constructor.
PacketType
Packet types are used as they are in Linux.
virtual void AddLinkChangeCallback(Callback< void > callback)
virtual Address GetAddress(void) const
Ptr< BridgeChannel > m_channel
virtual bridged channel
virtual void SetNode(Ptr< Node > node)
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
a virtual net device that bridges multiple LAN segments
BridgeNetDevice(const BridgeNetDevice &)
Copy constructor.
virtual void DoDispose(void)
Destructor implementation.
bool m_enableLearning
true if the bridge will learn the node status
virtual bool SetMtu(const uint16_t mtu)
void Learn(Mac48Address source, Ptr< NetDevice > port)
Learns the port a MAC address is sending from.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual bool IsMulticast(void) const
Network layer to device interface.