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"
92 virtual void SetIfIndex (
const uint32_t index);
97 virtual bool SetMtu (
const uint16_t mtu);
98 virtual uint16_t
GetMtu (
void)
const;
void AddBridgePort(Ptr< NetDevice > bridgePort)
Add a 'port' to a bridge device.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
void Learn(Mac48Address source, Ptr< NetDevice > port)
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
Ptr< NetDevice > GetLearnedState(Mac48Address source)
void ForwardBroadcast(Ptr< NetDevice > incomingPort, Ptr< const Packet > packet, uint16_t protocol, Mac48Address src, Mac48Address dst)
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual void SetIfIndex(const uint32_t index)
virtual uint32_t GetIfIndex(void) const
virtual bool IsMulticast(void) const
virtual Ptr< Channel > GetChannel(void) const
static TypeId GetTypeId(void)
virtual void SetAddress(Address address)
Set the address of this interface.
a virtual net device that bridges multiple LAN segments
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
NetDevice::PromiscReceiveCallback m_promiscRxCallback
virtual void AddLinkChangeCallback(Callback< void > callback)
a polymophic address class
Ptr< NetDevice > associatedPort
Ptr< NetDevice > GetBridgePort(uint32_t n) const
std::vector< Ptr< NetDevice > > m_ports
virtual uint16_t GetMtu(void) const
virtual bool SetMtu(const uint16_t mtu)
virtual bool SupportsSendFrom() const
virtual bool IsBroadcast(void) const
virtual Address GetBroadcast(void) const
virtual bool NeedsArp(void) const
virtual ~BridgeNetDevice()
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
NetDevice::ReceiveCallback m_rxCallback
virtual Address GetAddress(void) const
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
virtual Ptr< Node > GetNode(void) const
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
std::map< Mac48Address, LearnedState > m_learnState
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
void ForwardUnicast(Ptr< NetDevice > incomingPort, Ptr< const Packet > packet, uint16_t protocol, Mac48Address src, Mac48Address dst)
Network layer to device interface.
BridgeNetDevice & operator=(const BridgeNetDevice &)
Ptr< BridgeChannel > m_channel
uint32_t GetNBridgePorts(void) const
PacketType
Packet types are used as they are in Linux.
virtual void SetNode(Ptr< Node > node)
a unique identifier for an interface.
virtual bool IsLinkUp(void) const
void ReceiveFromDevice(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, Address const &source, Address const &destination, PacketType packetType)