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"
30 #include "ns3/random-variable-stream.h"
105 virtual void SetIfIndex (
const uint32_t index);
110 virtual bool SetMtu (
const uint16_t mtu);
111 virtual uint16_t
GetMtu ()
const;
137 void Report (std::ostream & os)
const;
a polymophic address class
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
Virtual net device modeling mesh point.
void AddInterface(Ptr< NetDevice > port)
Attach new interface to the station.
void DoSend(bool success, Ptr< Packet > packet, Mac48Address src, Mac48Address dst, uint16_t protocol, uint32_t iface)
Response callback for L2 routing protocol.
virtual bool IsLinkUp() const
virtual Ptr< Channel > GetChannel() const
virtual bool NeedsArp() const
virtual bool IsPointToPoint() const
Return true if the net device is on a point-to-point link.
uint32_t m_ifIndex
If index.
virtual bool IsBridge() const
Return true if the net device is acting as a bridge.
virtual bool IsBroadcast() const
uint16_t m_mtu
MTU in bytes.
Ptr< Node > m_node
Parent node.
void SetRoutingProtocol(Ptr< MeshL2RoutingProtocol > protocol)
Register routing protocol to be used.
virtual bool IsMulticast() const
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
Ptr< RandomVariableStream > m_forwardingRandomVariable
Random variable used for forwarding delay and jitter.
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 bool SetMtu(const uint16_t mtu)
Ptr< BridgeChannel > m_channel
Virtual channel for upper layers.
virtual uint32_t GetIfIndex() const
virtual void SetIfIndex(const uint32_t index)
std::vector< Ptr< NetDevice > > m_ifaces
List of interfaces.
Ptr< NetDevice > GetInterface(uint32_t id) const
virtual void DoDispose()
Destructor implementation.
NetDevice::ReceiveCallback m_rxCallback
Receive action.
Statistics m_fwdStats
forward statistics
std::vector< Ptr< NetDevice > > GetInterfaces() const
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
void Forward(Ptr< NetDevice > incomingPort, Ptr< const Packet > packet, uint16_t protocol, const Mac48Address src, const Mac48Address dst)
Forward packet down to interfaces.
MeshPointDevice()
C-tor create empty (without interfaces and protocols) mesh point.
virtual ~MeshPointDevice()
D-tor.
static TypeId GetTypeId()
Get the type ID.
void Report(std::ostream &os) const
Print statistics counters.
NetDevice::PromiscReceiveCallback m_promiscRxCallback
Promisc receive action.
virtual Address GetAddress() const
Statistics m_rxStats
receive statistics
virtual Ptr< Node > GetNode() const
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
Statistics m_txStats
transmit statistics
Mac48Address m_address
Mesh point MAC address, supposed to be the address of the first added interface.
virtual void SetNode(Ptr< Node > node)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Ptr< MeshL2RoutingProtocol > m_routingProtocol
Current routing protocol, used mainly by GetRoutingProtocol.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
uint32_t GetNInterfaces() const
virtual uint16_t GetMtu() const
virtual void SetAddress(Address a)
Set the address of this interface.
virtual Address GetBroadcast() const
void ResetStats()
Reset statistics counters.
Time GetForwardingDelay() const
Return a (random) forwarding delay value from the random variable ForwardingDelay attribute.
Ptr< MeshL2RoutingProtocol > GetRoutingProtocol() const
Access current routing protocol.
virtual bool SupportsSendFrom() const
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual void AddLinkChangeCallback(Callback< void > callback)
Network layer to device interface.
PacketType
Packet types are used as they are in Linux.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t broadcastData
broadcast data
uint32_t unicastData
unicast data
uint32_t unicastDataBytes
unicast data bytes
uint32_t broadcastDataBytes
broadcast data bytes