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