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
33namespace ns3 {
34
35class Node;
36class Packet;
37
48class LteNetDevice : public NetDevice
49{
50public:
55 static TypeId GetTypeId (void);
56
57 LteNetDevice (void);
58 virtual ~LteNetDevice (void);
59
60 // Delete copy constructor and assignment operator to avoid misuse
61 LteNetDevice (const LteNetDevice &) = delete;
63
64 virtual void DoDispose (void);
65
66 // inherited from NetDevice
67 virtual void SetIfIndex (const uint32_t index);
68 virtual uint32_t GetIfIndex (void) const;
69 virtual Ptr<Channel> GetChannel (void) const;
70 virtual bool SetMtu (const uint16_t mtu);
71 virtual uint16_t GetMtu (void) const;
72 virtual void SetAddress (Address address);
73 virtual Address GetAddress (void) const;
74 virtual bool IsLinkUp (void) const;
75 virtual void AddLinkChangeCallback (Callback<void> callback);
76 virtual bool IsBroadcast (void) const;
77 virtual Address GetBroadcast (void) const;
78 virtual bool IsMulticast (void) const;
79 virtual bool IsPointToPoint (void) const;
80 virtual bool IsBridge (void) const;
81 virtual Ptr<Node> GetNode (void) const;
82 virtual void SetNode (Ptr<Node> node);
83 virtual bool NeedsArp (void) const;
85 virtual Address GetMulticast (Ipv4Address addr) const;
86 virtual Address GetMulticast (Ipv6Address addr) const;
88 virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
89 virtual bool SupportsSendFrom (void) const;
90
96 void Receive (Ptr<Packet> p);
97
98protected:
99
101
102private:
104
106
108 bool m_linkUp;
109 mutable uint16_t m_mtu;
110
112};
113
114
115} // namespace ns3
116
117#endif /* LTE_NET_DEVICE_H */
a polymophic address class
Definition: address.h:91
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
Describes an IPv6 address.
Definition: ipv6-address.h:50
LteNetDevice provides basic implementation for all LTE network devices.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual bool SetMtu(const uint16_t mtu)
virtual Address GetMulticast(Ipv4Address addr) const
Make and return a MAC multicast address using the provided multicast group.
virtual uint32_t GetIfIndex(void) const
void Receive(Ptr< Packet > p)
receive a packet from the lower layers in order to forward it to the upper layers
virtual void DoDispose(void)
Destructor implementation.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
NetDevice::ReceiveCallback m_rxCallback
receive callback
virtual bool IsMulticast(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
virtual bool IsBroadcast(void) const
TracedCallback m_linkChangeCallbacks
link change callback
virtual Ptr< Node > GetNode(void) const
virtual void SetAddress(Address address)
Set the address of this interface.
virtual Ptr< Channel > GetChannel(void) const
static TypeId GetTypeId(void)
Get the type ID.
virtual void SetNode(Ptr< Node > node)
virtual ~LteNetDevice(void)
LteNetDevice(const LteNetDevice &)=delete
virtual void AddLinkChangeCallback(Callback< void > callback)
Mac64Address m_address
MAC address - only relevant for UEs.
uint16_t m_mtu
MTU.
virtual void SetIfIndex(const uint32_t index)
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
uint32_t m_ifIndex
interface index
Ptr< Node > m_node
the node
virtual Address GetAddress(void) const
virtual bool IsLinkUp(void) const
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
LteNetDevice & operator=(const LteNetDevice &)=delete
virtual bool SupportsSendFrom(void) const
virtual Address GetBroadcast(void) const
bool m_linkUp
link uo
virtual bool NeedsArp(void) const
an EUI-64 address
Definition: mac64-address.h:44
Network layer to device interface.
Definition: net-device.h:96
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
address
Definition: first.py:40
Every class exported by the ns3 library is enclosed in the ns3 namespace.