1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
3
* Copyright (c) 2010 CTTC
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;
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.
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
18
* Author: Nicola Baldo <nbaldo@cttc.es>
22
#include "ns3/queue.h"
23
#include "ns3/simulator.h"
25
#include "ns3/boolean.h"
26
#include "ns3/uinteger.h"
27
#include "ns3/pointer.h"
28
#include "ns3/channel.h"
29
#include "non-communicating-net-device.h"
32
NS_LOG_COMPONENT_DEFINE ("NonCommunicatingNetDevice");
39
NS_OBJECT_ENSURE_REGISTERED (NonCommunicatingNetDevice);
42
NonCommunicatingNetDevice::GetTypeId (void)
44
static TypeId tid = TypeId ("ns3::NonCommunicatingNetDevice")
45
.SetParent<NetDevice> ()
46
.AddConstructor<NonCommunicatingNetDevice> ()
47
.AddAttribute ("Phy", "The PHY layer attached to this device.",
49
MakePointerAccessor (&NonCommunicatingNetDevice::GetPhy,
50
&NonCommunicatingNetDevice::SetPhy),
51
MakePointerChecker<Object> ())
56
NonCommunicatingNetDevice::NonCommunicatingNetDevice ()
58
NS_LOG_FUNCTION (this);
61
NonCommunicatingNetDevice::~NonCommunicatingNetDevice ()
63
NS_LOG_FUNCTION (this);
67
NonCommunicatingNetDevice::DoDispose ()
69
NS_LOG_FUNCTION (this);
73
NetDevice::DoDispose ();
78
NonCommunicatingNetDevice::SetIfIndex (const uint32_t index)
80
NS_LOG_FUNCTION (index);
85
NonCommunicatingNetDevice::GetIfIndex (void) const
87
NS_LOG_FUNCTION (this);
92
NonCommunicatingNetDevice::SetMtu (uint16_t mtu)
94
NS_LOG_FUNCTION (mtu);
99
NonCommunicatingNetDevice::GetMtu (void) const
101
NS_LOG_FUNCTION (this);
106
NonCommunicatingNetDevice::SetAddress (Address address)
108
NS_LOG_FUNCTION (this);
112
NonCommunicatingNetDevice::GetAddress (void) const
114
NS_LOG_FUNCTION (this);
119
NonCommunicatingNetDevice::IsBroadcast (void) const
121
NS_LOG_FUNCTION (this);
126
NonCommunicatingNetDevice::GetBroadcast (void) const
128
NS_LOG_FUNCTION (this);
133
NonCommunicatingNetDevice::IsMulticast (void) const
135
NS_LOG_FUNCTION (this);
140
NonCommunicatingNetDevice::GetMulticast (Ipv4Address addr) const
142
NS_LOG_FUNCTION (addr);
147
NonCommunicatingNetDevice::GetMulticast (Ipv6Address addr) const
149
NS_LOG_FUNCTION (addr);
154
NonCommunicatingNetDevice::IsPointToPoint (void) const
156
NS_LOG_FUNCTION (this);
161
NonCommunicatingNetDevice::IsBridge (void) const
163
NS_LOG_FUNCTION (this);
169
NonCommunicatingNetDevice::GetNode (void) const
171
NS_LOG_FUNCTION (this);
176
NonCommunicatingNetDevice::SetNode (Ptr<Node> node)
178
NS_LOG_FUNCTION (node);
184
NonCommunicatingNetDevice::SetPhy (Ptr<Object> phy)
186
NS_LOG_FUNCTION (this << phy);
192
NonCommunicatingNetDevice::GetPhy () const
194
NS_LOG_FUNCTION (this);
200
NonCommunicatingNetDevice::SetChannel (Ptr<Channel> c)
202
NS_LOG_FUNCTION (this << c);
207
NonCommunicatingNetDevice::GetChannel (void) const
209
NS_LOG_FUNCTION (this);
215
NonCommunicatingNetDevice::NeedsArp (void) const
217
NS_LOG_FUNCTION (this);
222
NonCommunicatingNetDevice::IsLinkUp (void) const
224
NS_LOG_FUNCTION (this);
229
NonCommunicatingNetDevice::AddLinkChangeCallback (Callback<void> callback)
231
NS_LOG_FUNCTION (&callback);
235
NonCommunicatingNetDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb)
237
NS_LOG_FUNCTION (&cb);
241
NonCommunicatingNetDevice::SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb)
243
NS_LOG_FUNCTION (&cb);
247
NonCommunicatingNetDevice::SupportsSendFrom () const
249
NS_LOG_FUNCTION (this);
255
NonCommunicatingNetDevice::Send (Ptr<Packet> packet,const Address& dest, uint16_t protocolNumber)
257
NS_LOG_FUNCTION (packet << dest << protocolNumber);
262
NonCommunicatingNetDevice::SendFrom (Ptr<Packet> packet, const Address& src, const Address& dest, uint16_t protocolNumber)
264
NS_LOG_FUNCTION (packet << src << dest << protocolNumber);