|
20 |
#define TRACE_HELPER_H |
20 |
#define TRACE_HELPER_H |
21 |
|
21 |
|
22 |
#include "ns3/assert.h" |
22 |
#include "ns3/assert.h" |
|
|
23 |
#include "ns3/unused.h" |
23 |
#include "ns3/net-device-container.h" |
24 |
#include "ns3/net-device-container.h" |
24 |
#include "ns3/node-container.h" |
25 |
#include "ns3/node-container.h" |
25 |
#include "ns3/simulator.h" |
26 |
#include "ns3/simulator.h" |
|
94 |
template <typename T> void |
95 |
template <typename T> void |
95 |
PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileWrapper> file) |
96 |
PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileWrapper> file) |
96 |
{ |
97 |
{ |
97 |
bool __attribute__ ((unused)) result = |
98 |
bool result = |
98 |
object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file)); |
99 |
object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file)); |
99 |
NS_ASSERT_MSG (result == true, "PcapHelper::HookDefaultSink(): Unable to hook \"" << tracename << "\""); |
100 |
NS_ASSERT_MSG (result == true, "PcapHelper::HookDefaultSink(): Unable to hook \"" << tracename << "\""); |
|
|
101 |
NS_UNUSED (result); |
100 |
} |
102 |
} |
101 |
|
103 |
|
102 |
/** |
104 |
/** |
|
231 |
template <typename T> void |
233 |
template <typename T> void |
232 |
AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file) |
234 |
AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file) |
233 |
{ |
235 |
{ |
234 |
bool __attribute__ ((unused)) result = |
236 |
bool result = |
235 |
object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultEnqueueSinkWithoutContext, file)); |
237 |
object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultEnqueueSinkWithoutContext, file)); |
236 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext(): Unable to hook \"" |
238 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext(): Unable to hook \"" |
237 |
<< tracename << "\""); |
239 |
<< tracename << "\""); |
|
|
240 |
NS_UNUSED (result); |
238 |
} |
241 |
} |
239 |
|
242 |
|
240 |
template <typename T> void |
243 |
template <typename T> void |
|
244 |
std::string tracename, |
247 |
std::string tracename, |
245 |
Ptr<OutputStreamWrapper> stream) |
248 |
Ptr<OutputStreamWrapper> stream) |
246 |
{ |
249 |
{ |
247 |
bool __attribute__ ((unused)) result = |
250 |
bool result = |
248 |
object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultEnqueueSinkWithContext, stream)); |
251 |
object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultEnqueueSinkWithContext, stream)); |
249 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithContext(): Unable to hook \"" |
252 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithContext(): Unable to hook \"" |
250 |
<< tracename << "\""); |
253 |
<< tracename << "\""); |
|
|
254 |
NS_UNUSED (result); |
251 |
} |
255 |
} |
252 |
|
256 |
|
253 |
template <typename T> void |
257 |
template <typename T> void |
254 |
AsciiTraceHelper::HookDefaultDropSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file) |
258 |
AsciiTraceHelper::HookDefaultDropSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file) |
255 |
{ |
259 |
{ |
256 |
bool __attribute__ ((unused)) result = |
260 |
bool result = |
257 |
object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDropSinkWithoutContext, file)); |
261 |
object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDropSinkWithoutContext, file)); |
258 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithoutContext(): Unable to hook \"" |
262 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithoutContext(): Unable to hook \"" |
259 |
<< tracename << "\""); |
263 |
<< tracename << "\""); |
|
|
264 |
NS_UNUSED (result); |
260 |
} |
265 |
} |
261 |
|
266 |
|
262 |
template <typename T> void |
267 |
template <typename T> void |
|
266 |
std::string tracename, |
271 |
std::string tracename, |
267 |
Ptr<OutputStreamWrapper> stream) |
272 |
Ptr<OutputStreamWrapper> stream) |
268 |
{ |
273 |
{ |
269 |
bool __attribute__ ((unused)) result = |
274 |
bool result = |
270 |
object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDropSinkWithContext, stream)); |
275 |
object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDropSinkWithContext, stream)); |
271 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithContext(): Unable to hook \"" |
276 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithContext(): Unable to hook \"" |
272 |
<< tracename << "\""); |
277 |
<< tracename << "\""); |
|
|
278 |
NS_UNUSED (result); |
273 |
} |
279 |
} |
274 |
|
280 |
|
275 |
template <typename T> void |
281 |
template <typename T> void |
276 |
AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file) |
282 |
AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file) |
277 |
{ |
283 |
{ |
278 |
bool __attribute__ ((unused)) result = |
284 |
bool result = |
279 |
object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDequeueSinkWithoutContext, file)); |
285 |
object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDequeueSinkWithoutContext, file)); |
280 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext(): Unable to hook \"" |
286 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext(): Unable to hook \"" |
281 |
<< tracename << "\""); |
287 |
<< tracename << "\""); |
|
|
288 |
NS_UNUSED (result); |
282 |
} |
289 |
} |
283 |
|
290 |
|
284 |
template <typename T> void |
291 |
template <typename T> void |
|
288 |
std::string tracename, |
295 |
std::string tracename, |
289 |
Ptr<OutputStreamWrapper> stream) |
296 |
Ptr<OutputStreamWrapper> stream) |
290 |
{ |
297 |
{ |
291 |
bool __attribute__ ((unused)) result = |
298 |
bool result = |
292 |
object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDequeueSinkWithContext, stream)); |
299 |
object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDequeueSinkWithContext, stream)); |
293 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithContext(): Unable to hook \"" |
300 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithContext(): Unable to hook \"" |
294 |
<< tracename << "\""); |
301 |
<< tracename << "\""); |
|
|
302 |
NS_UNUSED (result); |
295 |
} |
303 |
} |
296 |
|
304 |
|
297 |
template <typename T> void |
305 |
template <typename T> void |
298 |
AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file) |
306 |
AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file) |
299 |
{ |
307 |
{ |
300 |
bool __attribute__ ((unused)) result = |
308 |
bool result = |
301 |
object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultReceiveSinkWithoutContext, file)); |
309 |
object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultReceiveSinkWithoutContext, file)); |
302 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext(): Unable to hook \"" |
310 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext(): Unable to hook \"" |
303 |
<< tracename << "\""); |
311 |
<< tracename << "\""); |
|
|
312 |
NS_UNUSED (result); |
304 |
} |
313 |
} |
305 |
|
314 |
|
306 |
template <typename T> void |
315 |
template <typename T> void |
|
310 |
std::string tracename, |
319 |
std::string tracename, |
311 |
Ptr<OutputStreamWrapper> stream) |
320 |
Ptr<OutputStreamWrapper> stream) |
312 |
{ |
321 |
{ |
313 |
bool __attribute__ ((unused)) result = |
322 |
bool result = |
314 |
object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultReceiveSinkWithContext, stream)); |
323 |
object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultReceiveSinkWithContext, stream)); |
315 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithContext(): Unable to hook \"" |
324 |
NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithContext(): Unable to hook \"" |
316 |
<< tracename << "\""); |
325 |
<< tracename << "\""); |
|
|
326 |
NS_UNUSED (result); |
317 |
} |
327 |
} |
318 |
|
328 |
|
319 |
/** |
329 |
/** |