A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
non-communicating-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
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: Nicola Baldo <nbaldo@cttc.es>
19
*/
20
21
#ifndef NON_COMMUNICATING_NET_DEVICE_H
22
#define NON_COMMUNICATING_NET_DEVICE_H
23
24
#include <cstring>
25
#include <ns3/node.h>
26
#include <ns3/address.h>
27
#include <ns3/net-device.h>
28
#include <ns3/callback.h>
29
#include <ns3/packet.h>
30
#include <ns3/traced-callback.h>
31
#include <ns3/ptr.h>
32
33
namespace
ns3 {
34
35
36
class
SpectrumChannel;
37
class
Channel;
38
class
SpectrumErrorModel;
39
class
Queue;
40
41
42
54
class
NonCommunicatingNetDevice
:
public
NetDevice
55
{
56
public
:
57
static
TypeId
GetTypeId
(
void
);
58
59
NonCommunicatingNetDevice
();
60
virtual
~NonCommunicatingNetDevice
();
61
62
72
void
SetChannel
(
Ptr<Channel>
c);
73
74
82
void
SetPhy
(
Ptr<Object>
phy);
83
87
Ptr<Object>
GetPhy
()
const
;
88
89
90
91
// inherited from NetDevice
92
virtual
void
SetIfIndex
(
const
uint32_t index);
93
virtual
uint32_t
GetIfIndex
(
void
)
const
;
94
virtual
Ptr<Channel>
GetChannel
(
void
)
const
;
95
virtual
bool
SetMtu
(
const
uint16_t mtu);
96
virtual
uint16_t
GetMtu
(
void
)
const
;
97
virtual
void
SetAddress
(
Address
address);
98
virtual
Address
GetAddress
(
void
)
const
;
99
virtual
bool
IsLinkUp
(
void
)
const
;
100
virtual
void
AddLinkChangeCallback
(
Callback<void>
callback);
101
virtual
bool
IsBroadcast
(
void
)
const
;
102
virtual
Address
GetBroadcast
(
void
)
const
;
103
virtual
bool
IsMulticast
(
void
)
const
;
104
virtual
bool
IsPointToPoint
(
void
)
const
;
105
virtual
bool
IsBridge
(
void
)
const
;
106
virtual
bool
Send
(
Ptr<Packet>
packet,
const
Address
& dest,
107
uint16_t protocolNumber);
108
virtual
bool
SendFrom
(
Ptr<Packet>
packet,
const
Address
& source,
const
Address
& dest,
109
uint16_t protocolNumber);
110
virtual
Ptr<Node>
GetNode
(
void
)
const
;
111
virtual
void
SetNode
(
Ptr<Node>
node);
112
virtual
bool
NeedsArp
(
void
)
const
;
113
virtual
void
SetReceiveCallback
(
NetDevice::ReceiveCallback
cb);
114
virtual
Address
GetMulticast
(
Ipv4Address
addr)
const
;
115
virtual
Address
GetMulticast
(
Ipv6Address
addr)
const
;
116
virtual
void
SetPromiscReceiveCallback
(
PromiscReceiveCallback
cb);
117
virtual
bool
SupportsSendFrom
(
void
)
const
;
118
119
120
121
122
123
private
:
124
virtual
void
DoDispose
(
void
);
125
126
Ptr<Node>
m_node
;
127
Ptr<Channel>
m_channel
;
128
129
uint32_t
m_ifIndex
;
130
131
Ptr<Object>
m_phy
;
132
};
133
134
135
}
// namespace ns3
136
137
#endif
/* NON_COMMUNICATING_NET_DEVICE_H */
src
spectrum
model
non-communicating-net-device.h
Generated on Tue May 14 2013 11:08:32 for ns-3 by
1.8.1.2