A Discrete-Event Network Simulator
API
lte-net-device.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Giuseppe Piro <g.piro@poliba.it>
19  * Nicola Baldo <nbaldo@cttc.es>
20  */
21 
22 #ifndef LTE_NET_DEVICE_H
23 #define LTE_NET_DEVICE_H
24 
25 #include <ns3/net-device.h>
26 #include <ns3/event-id.h>
27 #include <ns3/mac64-address.h>
28 #include <ns3/traced-callback.h>
29 #include <ns3/nstime.h>
30 #include <ns3/lte-phy.h>
31 #include <ns3/lte-control-messages.h>
32 
33 namespace ns3 {
34 
35 class Node;
36 class Packet;
37 
48 class LteNetDevice : public NetDevice
49 {
50 public:
55  static TypeId GetTypeId (void);
56 
57  LteNetDevice (void);
58  virtual ~LteNetDevice (void);
59 
60  virtual void DoDispose (void);
61 
62  // inherited from NetDevice
63  virtual void SetIfIndex (const uint32_t index);
64  virtual uint32_t GetIfIndex (void) const;
65  virtual Ptr<Channel> GetChannel (void) const;
66  virtual bool SetMtu (const uint16_t mtu);
67  virtual uint16_t GetMtu (void) const;
68  virtual void SetAddress (Address address);
69  virtual Address GetAddress (void) const;
70  virtual bool IsLinkUp (void) const;
71  virtual void AddLinkChangeCallback (Callback<void> callback);
72  virtual bool IsBroadcast (void) const;
73  virtual Address GetBroadcast (void) const;
74  virtual bool IsMulticast (void) const;
75  virtual bool IsPointToPoint (void) const;
76  virtual bool IsBridge (void) const;
77  virtual Ptr<Node> GetNode (void) const;
78  virtual void SetNode (Ptr<Node> node);
79  virtual bool NeedsArp (void) const;
81  virtual Address GetMulticast (Ipv4Address addr) const;
82  virtual Address GetMulticast (Ipv6Address addr) const;
84  virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
85  virtual bool SupportsSendFrom (void) const;
86 
92  void Receive (Ptr<Packet> p);
93 
94 protected:
95 
97 
98 private:
106 
108 
110 
111  uint32_t m_ifIndex;
112  bool m_linkUp;
113  mutable uint16_t m_mtu;
114 
116 };
117 
118 
119 } // namespace ns3
120 
121 #endif /* LTE_NET_DEVICE_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::LteNetDevice::GetAddress
virtual Address GetAddress(void) const
Definition: lte-net-device.cc:105
ns3::LteNetDevice::m_linkUp
bool m_linkUp
link uo
Definition: lte-net-device.h:112
ns3::LteNetDevice::LteNetDevice
LteNetDevice(const LteNetDevice &)
type conversion operator
ns3::Callback< void >
ns3::LteNetDevice::IsMulticast
virtual bool IsMulticast(void) const
Definition: lte-net-device.cc:206
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::LteNetDevice::IsLinkUp
virtual bool IsLinkUp(void) const
Definition: lte-net-device.cc:184
ns3::LteNetDevice::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: lte-net-device.cc:78
ns3::LteNetDevice::SetMtu
virtual bool SetMtu(const uint16_t mtu)
Definition: lte-net-device.cc:153
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
ns3::Ipv6Address
Describes an IPv6 address.
Definition: ipv6-address.h:50
ns3::Mac64Address
an EUI-64 address
Definition: mac64-address.h:44
ns3::LteNetDevice::SendFrom
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
Definition: lte-net-device.cc:136
ns3::LteNetDevice::SetAddress
virtual void SetAddress(Address address)
Set the address of this interface.
Definition: lte-net-device.cc:97
ns3::LteNetDevice::SetReceiveCallback
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
Definition: lte-net-device.cc:128
ns3::Ptr< Channel >
ns3::LteNetDevice::m_mtu
uint16_t m_mtu
MTU.
Definition: lte-net-device.h:113
ns3::LteNetDevice::GetIfIndex
virtual uint32_t GetIfIndex(void) const
Definition: lte-net-device.cc:176
ns3::LteNetDevice::IsBroadcast
virtual bool IsBroadcast(void) const
Definition: lte-net-device.cc:192
ns3::LteNetDevice::m_address
Mac64Address m_address
MAC address - only relevant for UEs.
Definition: lte-net-device.h:115
ns3::Address
a polymophic address class
Definition: address.h:91
ns3::LteNetDevice::SetPromiscReceiveCallback
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
Definition: lte-net-device.cc:271
ns3::LteNetDevice::GetMtu
virtual uint16_t GetMtu(void) const
Definition: lte-net-device.cc:161
ns3::LteNetDevice::GetChannel
virtual Ptr< Channel > GetChannel(void) const
Definition: lte-net-device.cc:88
first.address
address
Definition: first.py:44
ns3::LteNetDevice::GetMulticast
virtual Address GetMulticast(Ipv4Address addr) const
Make and return a MAC multicast address using the provided multicast group.
Definition: lte-net-device.cc:237
ns3::LteNetDevice::m_linkChangeCallbacks
TracedCallback m_linkChangeCallbacks
link change callback
Definition: lte-net-device.h:109
ns3::LteNetDevice::SetNode
virtual void SetNode(Ptr< Node > node)
Definition: lte-net-device.cc:112
ns3::LteNetDevice::NeedsArp
virtual bool NeedsArp(void) const
Definition: lte-net-device.cc:222
ns3::LteNetDevice::SupportsSendFrom
virtual bool SupportsSendFrom(void) const
Definition: lte-net-device.cc:144
ns3::LteNetDevice::IsBridge
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
Definition: lte-net-device.cc:230
ns3::LteNetDevice::operator=
LteNetDevice & operator=(const LteNetDevice &)
assignment operator
ns3::LteNetDevice::m_node
Ptr< Node > m_node
the node
Definition: lte-net-device.h:107
ns3::LteNetDevice::AddLinkChangeCallback
virtual void AddLinkChangeCallback(Callback< void > callback)
Definition: lte-net-device.cc:264
ns3::LteNetDevice::GetBroadcast
virtual Address GetBroadcast(void) const
Definition: lte-net-device.cc:199
ns3::LteNetDevice::Receive
void Receive(Ptr< Packet > p)
receive a packet from the lower layers in order to forward it to the upper layers
Definition: lte-net-device.cc:278
ns3::LteNetDevice::SetIfIndex
virtual void SetIfIndex(const uint32_t index)
Definition: lte-net-device.cc:169
ns3::LteNetDevice::GetNode
virtual Ptr< Node > GetNode(void) const
Definition: lte-net-device.cc:120
ns3::LteNetDevice
LteNetDevice provides basic implementation for all LTE network devices.
Definition: lte-net-device.h:49
ns3::LteNetDevice::m_ifIndex
uint32_t m_ifIndex
interface index
Definition: lte-net-device.h:111
ns3::LteNetDevice::~LteNetDevice
virtual ~LteNetDevice(void)
Definition: lte-net-device.cc:71
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition: traced-callback.h:53
ns3::LteNetDevice::LteNetDevice
LteNetDevice(void)
Definition: lte-net-device.cc:65
ns3::LteNetDevice::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-net-device.cc:51
ns3::LteNetDevice::IsPointToPoint
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
Definition: lte-net-device.cc:214
ns3::LteNetDevice::m_rxCallback
NetDevice::ReceiveCallback m_rxCallback
receive callback
Definition: lte-net-device.h:96
ns3::NetDevice
Network layer to device interface.
Definition: net-device.h:96