質問編集履歴
1
追加
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ファイルが実行されない
|
1
|
+
ns3でファイルが実行されない
|
test
CHANGED
@@ -31,3 +31,167 @@
|
|
31
31
|
|
32
32
|
|
33
33
|
よろしくお願い致します。
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
追加:
|
40
|
+
|
41
|
+
当該コードですが、今までコンパイルできていたコードすべてがコンパイルできなくなりました。
|
42
|
+
|
43
|
+
例えば下記のようなコードです。
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
48
|
+
|
49
|
+
/*
|
50
|
+
|
51
|
+
* This program is free software; you can redistribute it and/or modify
|
52
|
+
|
53
|
+
* it under the terms of the GNU General Public License version 2 as
|
54
|
+
|
55
|
+
* published by the Free Software Foundation;
|
56
|
+
|
57
|
+
*
|
58
|
+
|
59
|
+
* This program is distributed in the hope that it will be useful,
|
60
|
+
|
61
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
62
|
+
|
63
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
64
|
+
|
65
|
+
* GNU General Public License for more details.
|
66
|
+
|
67
|
+
*
|
68
|
+
|
69
|
+
* You should have received a copy of the GNU General Public License
|
70
|
+
|
71
|
+
* along with this program; if not, write to the Free Software
|
72
|
+
|
73
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
74
|
+
|
75
|
+
*/
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
#include "ns3/core-module.h"
|
80
|
+
|
81
|
+
#include "ns3/network-module.h"
|
82
|
+
|
83
|
+
#include "ns3/internet-module.h"
|
84
|
+
|
85
|
+
#include "ns3/point-to-point-module.h"
|
86
|
+
|
87
|
+
#include "ns3/applications-module.h"
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
using namespace ns3;
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
NS_LOG_COMPONENT_DEFINE ("FirstScriptExample");
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
int
|
100
|
+
|
101
|
+
main (int argc, char *argv[])
|
102
|
+
|
103
|
+
{
|
104
|
+
|
105
|
+
Time::SetResolution (Time::NS);
|
106
|
+
|
107
|
+
LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);
|
108
|
+
|
109
|
+
LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
NodeContainer nodes;
|
114
|
+
|
115
|
+
nodes.Create (2);
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
PointToPointHelper pointToPoint;
|
120
|
+
|
121
|
+
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
|
122
|
+
|
123
|
+
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
NetDeviceContainer devices;
|
128
|
+
|
129
|
+
devices = pointToPoint.Install (nodes);
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
InternetStackHelper stack;
|
134
|
+
|
135
|
+
stack.Install (nodes);
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
Ipv4AddressHelper address;
|
140
|
+
|
141
|
+
address.SetBase ("10.1.1.0", "255.255.255.0");
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
Ipv4InterfaceContainer interfaces = address.Assign (devices);
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
UdpEchoServerHelper echoServer (9);
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
ApplicationContainer serverApps = echoServer.Install (nodes.Get (1));
|
154
|
+
|
155
|
+
serverApps.Start (Seconds (1.0));
|
156
|
+
|
157
|
+
serverApps.Stop (Seconds (10.0));
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
UdpEchoClientHelper echoClient (interfaces.GetAddress (1), 9);
|
162
|
+
|
163
|
+
echoClient.SetAttribute ("MaxPackets", UintegerValue (1));
|
164
|
+
|
165
|
+
echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0)));
|
166
|
+
|
167
|
+
echoClient.SetAttribute ("PacketSize", UintegerValue (1024));
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
ApplicationContainer clientApps = echoClient.Install (nodes.Get (0));
|
172
|
+
|
173
|
+
clientApps.Start (Seconds (2.0));
|
174
|
+
|
175
|
+
clientApps.Stop (Seconds (10.0));
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
Simulator::Run ();
|
180
|
+
|
181
|
+
Simulator::Destroy ();
|
182
|
+
|
183
|
+
return 0;
|
184
|
+
|
185
|
+
}
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
コマンドは
|
190
|
+
|
191
|
+
./waf --run "first"
|
192
|
+
|
193
|
+
です。
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
このコマンドでコンパイルしましたができなくなりました。
|