22 #include "ns3/llc-snap-header.h" 23 #include "ns3/simulator.h" 24 #include "ns3/callback.h" 26 #include "ns3/packet.h" 28 #include "ns3/packet-burst.h" 29 #include "ns3/uinteger.h" 30 #include "ns3/trace-source-accessor.h" 31 #include "ns3/pointer.h" 34 #include "ns3/ipv4-header.h" 35 #include "ns3/ipv6-header.h" 36 #include <ns3/lte-radio-bearer-tag.h> 37 #include <ns3/ipv4-l3-protocol.h> 38 #include <ns3/ipv6-l3-protocol.h> 55 TypeId (
"ns3::LteNetDevice")
59 .AddAttribute (
"Mtu",
"The MAC-level Maximum Transmission Unit",
63 MakeUintegerChecker<uint16_t> ())
291 ipType = (ipType>>4) & 0x0f;
295 else if (ipType == 0x06)
298 NS_ABORT_MSG (
"LteNetDevice::Receive - Unknown IP type...");
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual void DoDispose(void)
Destructor implementation.
virtual void SetNode(Ptr< Node > node)
virtual Address GetAddress(void) const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual uint32_t GetIfIndex(void) const
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual void DoDispose(void)
Destructor implementation.
a polymophic address class
virtual void SetIfIndex(const uint32_t index)
virtual Address GetMulticast(Ipv4Address addr) const
Make and return a MAC multicast address using the provided multicast group.
static Mac48Address GetMulticast(Ipv4Address address)
virtual void SetAddress(Address address)
Set the address of this interface.
Hold an unsigned integer type.
virtual bool IsMulticast(void) const
NetDevice::ReceiveCallback m_rxCallback
receive callback
static Mac48Address GetBroadcast(void)
static TypeId GetTypeId(void)
Get the type ID.
virtual bool SupportsSendFrom(void) const
Ptr< Node > m_node
the node
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TracedCallback m_linkChangeCallbacks
link change callback
virtual void AddLinkChangeCallback(Callback< void > callback)
void Receive(Ptr< Packet > p)
receive a packet from the lower layers in order to forward it to the upper layers ...
Mac64Address m_address
MAC address - only relevant for UEs.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
virtual ~LteNetDevice(void)
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
virtual Address GetBroadcast(void) const
void ConnectWithoutContext(const CallbackBase &callback)
Append a Callback to the chain (without a context).
static Mac64Address ConvertFrom(const Address &address)
Network layer to device interface.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
virtual Ptr< Channel > GetChannel(void) const
virtual Ptr< Node > GetNode(void) const
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
virtual bool SetMtu(const uint16_t mtu)
uint32_t m_ifIndex
interface index
virtual bool IsBroadcast(void) const
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
virtual uint16_t GetMtu(void) const
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
static const uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
virtual bool NeedsArp(void) const
static const uint16_t PROT_NUMBER
Protocol number (0x0800)
virtual bool IsLinkUp(void) const
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.