A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-net-device.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Giuseppe Piro <g.piro@poliba.it>
7 * Nicola Baldo <nbaldo@cttc.es>
8 */
9
10#ifndef LTE_NET_DEVICE_H
11#define LTE_NET_DEVICE_H
12
13#include <ns3/event-id.h>
14#include <ns3/mac64-address.h>
15#include <ns3/net-device.h>
16#include <ns3/nstime.h>
17#include <ns3/traced-callback.h>
18
19namespace ns3
20{
21
22class Node;
23class Packet;
24
25/**
26 * \defgroup lte LTE Models
27 *
28 */
29
30/**
31 * \ingroup lte
32 *
33 * LteNetDevice provides basic implementation for all LTE network devices
34 */
35class LteNetDevice : public NetDevice
36{
37 public:
38 /**
39 * \brief Get the type ID.
40 * \return the object TypeId
41 */
42 static TypeId GetTypeId();
43
45 ~LteNetDevice() override;
46
47 // Delete copy constructor and assignment operator to avoid misuse
48 LteNetDevice(const LteNetDevice&) = delete;
50
51 void DoDispose() override;
52
53 // inherited from NetDevice
54 void SetIfIndex(const uint32_t index) override;
55 uint32_t GetIfIndex() const override;
56 Ptr<Channel> GetChannel() const override;
57 bool SetMtu(const uint16_t mtu) override;
58 uint16_t GetMtu() const override;
59 void SetAddress(Address address) override;
60 Address GetAddress() const override;
61 bool IsLinkUp() const override;
62 void AddLinkChangeCallback(Callback<void> callback) override;
63 bool IsBroadcast() const override;
64 Address GetBroadcast() const override;
65 bool IsMulticast() const override;
66 bool IsPointToPoint() const override;
67 bool IsBridge() const override;
68 Ptr<Node> GetNode() const override;
69 void SetNode(Ptr<Node> node) override;
70 bool NeedsArp() const override;
72 Address GetMulticast(Ipv4Address addr) const override;
73 Address GetMulticast(Ipv6Address addr) const override;
75 bool SendFrom(Ptr<Packet> packet,
76 const Address& source,
77 const Address& dest,
78 uint16_t protocolNumber) override;
79 bool SupportsSendFrom() const override;
80
81 /**
82 * receive a packet from the lower layers in order to forward it to the upper layers
83 *
84 * \param p the packet
85 */
86 void Receive(Ptr<Packet> p);
87
88 protected:
90
91 private:
92 Ptr<Node> m_node; ///< the node
93
94 TracedCallback<> m_linkChangeCallbacks; ///< link change callback
95
96 uint32_t m_ifIndex; ///< interface index
97 bool m_linkUp; ///< link uo
98 mutable uint16_t m_mtu; ///< MTU
99
100 Mac64Address m_address; ///< MAC address - only relevant for UEs.
101};
102
103} // namespace ns3
104
105#endif /* LTE_NET_DEVICE_H */
a polymophic address class
Definition address.h:90
Callback template class.
Definition callback.h:422
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
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
Network layer to device interface.
Definition net-device.h:87
Smart pointer class similar to boost::intrusive_ptr.
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.