LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2007, 2008 University of Washington | 3 * Copyright (c) 2007, 2008 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "ns3/mpi-interface.h" | 28 #include "ns3/mpi-interface.h" |
29 | 29 |
30 using namespace std; | 30 using namespace std; |
31 | 31 |
32 NS_LOG_COMPONENT_DEFINE ("PointToPointRemoteChannel"); | 32 NS_LOG_COMPONENT_DEFINE ("PointToPointRemoteChannel"); |
33 | 33 |
34 namespace ns3 { | 34 namespace ns3 { |
35 | 35 |
36 NS_OBJECT_ENSURE_REGISTERED (PointToPointRemoteChannel); | 36 NS_OBJECT_ENSURE_REGISTERED (PointToPointRemoteChannel); |
37 | 37 |
38 TypeId | 38 TypeId |
39 PointToPointRemoteChannel::GetTypeId (void) | 39 PointToPointRemoteChannel::GetTypeId (void) |
40 { | 40 { |
41 static TypeId tid = TypeId ("ns3::PointToPointRemoteChannel") | 41 static TypeId tid = TypeId ("ns3::PointToPointRemoteChannel") |
42 .SetParent<PointToPointChannel> () | 42 .SetParent<PointToPointChannel> () |
43 .AddConstructor<PointToPointRemoteChannel> () | 43 .AddConstructor<PointToPointRemoteChannel> () |
44 ; | 44 ; |
45 return tid; | 45 return tid; |
46 } | 46 } |
47 | 47 |
48 PointToPointRemoteChannel::PointToPointRemoteChannel() | 48 PointToPointRemoteChannel::PointToPointRemoteChannel () |
49 { | 49 { |
50 } | 50 } |
51 | 51 |
52 PointToPointRemoteChannel::~PointToPointRemoteChannel() | 52 PointToPointRemoteChannel::~PointToPointRemoteChannel () |
53 { | 53 { |
54 } | 54 } |
55 | 55 |
56 bool | 56 bool |
57 PointToPointRemoteChannel::TransmitStart( | 57 PointToPointRemoteChannel::TransmitStart ( |
58 Ptr<Packet> p, | 58 Ptr<Packet> p, |
59 Ptr<PointToPointNetDevice> src, | 59 Ptr<PointToPointNetDevice> src, |
60 Time txTime) | 60 Time txTime) |
61 { | 61 { |
62 NS_LOG_FUNCTION (this << p << src); | 62 NS_LOG_FUNCTION (this << p << src); |
63 NS_LOG_LOGIC ("UID is " << p->GetUid () << ")"); | 63 NS_LOG_LOGIC ("UID is " << p->GetUid () << ")"); |
64 | 64 |
65 IsInitialized (); | 65 IsInitialized (); |
66 | 66 |
67 uint32_t wire = src == GetSource (0) ? 0 : 1; | 67 uint32_t wire = src == GetSource (0) ? 0 : 1; |
68 Ptr<PointToPointNetDevice> dst = GetDestination (wire); | 68 Ptr<PointToPointNetDevice> dst = GetDestination (wire); |
69 | 69 |
70 // Calculate the rxTime (absolute) | 70 // Calculate the rxTime (absolute) |
71 Time rxTime = Simulator::Now() + txTime + GetDelay (); | 71 Time rxTime = Simulator::Now () + txTime + GetDelay (); |
72 #ifdef NS3_MPI | 72 #ifdef NS3_MPI |
73 MPIInterface::SendPacket(p, rxTime, dst->GetNode()->GetId(), dst->GetIfIndex()
); | 73 MpiInterface::SendPacket (p, rxTime, dst->GetNode ()->GetId (), dst->GetIfInde
x ()); |
74 #else | 74 #else |
75 NS_FATAL_ERROR ("Can't use distributed simulator without MPI compiled in"); | 75 NS_FATAL_ERROR ("Can't use distributed simulator without MPI compiled in"); |
76 #endif | 76 #endif |
77 return true; | 77 return true; |
78 } | 78 } |
79 | 79 |
80 } // namespace ns3 | 80 } // namespace ns3 |
LEFT | RIGHT |