|
|
| 34 |
static TypeId tid = TypeId ("ns3::PointToPointChannel") |
34 |
static TypeId tid = TypeId ("ns3::PointToPointChannel") |
| 35 |
.SetParent<Channel> () |
35 |
.SetParent<Channel> () |
| 36 |
.AddConstructor<PointToPointChannel> () |
36 |
.AddConstructor<PointToPointChannel> () |
| 37 |
.AddAttribute ("Delay", "Transmission delay through the channel", |
37 |
.AddAttribute ("Delay", "Random variable giving transmission delay through the channel, in seconds.", |
| 38 |
TimeValue (Seconds (0)), |
38 |
RandomVariableValue (ConstantVariable (0)), |
| 39 |
MakeTimeAccessor (&PointToPointChannel::m_delay), |
39 |
MakeRandomVariableAccessor (&PointToPointChannel::m_delay), |
| 40 |
MakeTimeChecker ()) |
40 |
MakeRandomVariableChecker ()) |
| 41 |
; |
41 |
; |
| 42 |
return tid; |
42 |
return tid; |
| 43 |
} |
43 |
} |
|
|
| 48 |
PointToPointChannel::PointToPointChannel() |
48 |
PointToPointChannel::PointToPointChannel() |
| 49 |
: |
49 |
: |
| 50 |
Channel ("PointToPoint Channel"), |
50 |
Channel ("PointToPoint Channel"), |
| 51 |
m_delay (Seconds (0.)), |
|
|
| 52 |
m_nDevices (0) |
51 |
m_nDevices (0) |
| 53 |
{ |
52 |
{ |
| 54 |
NS_LOG_FUNCTION_NOARGS (); |
53 |
NS_LOG_FUNCTION_NOARGS (); |
|
|
| 89 |
|
88 |
|
| 90 |
uint32_t wire = src == m_link[0].m_src ? 0 : 1; |
89 |
uint32_t wire = src == m_link[0].m_src ? 0 : 1; |
| 91 |
|
90 |
|
| 92 |
Simulator::Schedule (txTime + m_delay, &PointToPointNetDevice::Receive, |
91 |
Simulator::Schedule (txTime + Seconds (m_delay.GetValue ()), &PointToPointNetDevice::Receive, |
| 93 |
m_link[wire].m_dst, p); |
92 |
m_link[wire].m_dst, p); |
| 94 |
return true; |
93 |
return true; |
| 95 |
} |
94 |
} |