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