|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #ifndef L2ROUTING_NET_DEVICE_H
23 #define L2ROUTING_NET_DEVICE_H
26 #include "ns3/net-device.h"
27 #include "ns3/mac48-address.h"
28 #include "ns3/bridge-channel.h"
29 #include "ns3/mesh-l2-routing-protocol.h"
104 virtual void SetIfIndex (
const uint32_t index);
109 virtual bool SetMtu (
const uint16_t mtu);
110 virtual uint16_t
GetMtu ()
const;
136 void Report (std::ostream & os)
const;
Virtual net device modeling mesh point.
virtual bool IsPointToPoint() const
Return true if the net device is on a point-to-point link.
a unique identifier for an interface.
NetDevice::PromiscReceiveCallback m_promiscRxCallback
Promisc receive action.
virtual Address GetAddress() const
virtual void DoDispose()
Destructor implementation.
virtual bool SetMtu(const uint16_t mtu)
Ptr< Node > m_node
Parent node.
void ResetStats()
Reset statistics counters.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
MeshPointDevice()
C-tor create empty (without interfaces and protocols) mesh point.
virtual bool IsBroadcast() const
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
Ptr< MeshL2RoutingProtocol > m_routingProtocol
Current routing protocol, used mainly by GetRoutingProtocol.
virtual bool IsLinkUp() const
uint32_t unicastData
unicast data
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual uint16_t GetMtu() const
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
uint32_t m_ifIndex
If index.
void DoSend(bool success, Ptr< Packet > packet, Mac48Address src, Mac48Address dst, uint16_t protocol, uint32_t iface)
Response callback for L2 routing protocol.
virtual void SetAddress(Address a)
Set the address of this interface.
void ReceiveFromDevice(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, Address const &source, Address const &destination, PacketType packetType)
Receive packet from interface.
virtual Address GetBroadcast() const
Statistics m_rxStats
receive statistics
Statistics m_txStats
transmit statistics
virtual void SetNode(Ptr< Node > node)
Ptr< BridgeChannel > m_channel
Virtual channel for upper layers.
virtual Ptr< Node > GetNode() const
std::vector< Ptr< NetDevice > > m_ifaces
List of interfaces.
uint32_t broadcastDataBytes
broadcast data bytes
std::vector< Ptr< NetDevice > > GetInterfaces() const
a polymophic address class
virtual void SetIfIndex(const uint32_t index)
Statistics m_fwdStats
forward statistics
virtual bool SupportsSendFrom() const
uint32_t GetNInterfaces() const
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual ~MeshPointDevice()
D-tor.
uint32_t unicastDataBytes
unicast data bytes
virtual uint32_t GetIfIndex() const
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
NetDevice::ReceiveCallback m_rxCallback
Receive action.
uint16_t m_mtu
MTU in bytes.
virtual bool NeedsArp() const
void AddInterface(Ptr< NetDevice > port)
Attach new interface to the station.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
virtual bool IsBridge() const
Return true if the net device is acting as a bridge.
void SetRoutingProtocol(Ptr< MeshL2RoutingProtocol > protocol)
Register routing protocol to be used.
uint32_t broadcastData
broadcast data
Mac48Address m_address
Mesh point MAC address, supposed to be the address of the first added interface.
PacketType
Packet types are used as they are in Linux.
static TypeId GetTypeId()
Get the type ID.
void Report(std::ostream &os) const
Print statistics counters.
Ptr< MeshL2RoutingProtocol > GetRoutingProtocol() const
Access current routing protocol.
virtual bool IsMulticast() const
Ptr< NetDevice > GetInterface(uint32_t id) const
virtual void AddLinkChangeCallback(Callback< void > callback)
void Forward(Ptr< NetDevice > incomingPort, Ptr< const Packet > packet, uint16_t protocol, const Mac48Address src, const Mac48Address dst)
Forward packet down to interfaces.
Network layer to device interface.
virtual Ptr< Channel > GetChannel() const