A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
internet-trace-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 University of Washington
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 */
6
7#ifndef INTERNET_TRACE_HELPER_H
8#define INTERNET_TRACE_HELPER_H
9
12
13#include "ns3/assert.h"
14#include "ns3/ipv4.h"
15#include "ns3/ipv6.h"
16#include "ns3/trace-helper.h"
17
18namespace ns3
19{
20
21/**
22 * \ingroup ipv4Helpers
23 *
24 * @brief Base class providing common user-level pcap operations for helpers
25 * representing IPv4 protocols .
26 */
28{
29 public:
30 /**
31 * @brief Construct a PcapHelperForIpv4.
32 */
34 {
35 }
36
37 /**
38 * @brief Destroy a PcapHelperForIpv4.
39 */
41 {
42 }
43
44 /**
45 * @brief Enable pcap output the indicated Ipv4 and interface pair.
46 *
47 * @param prefix Filename prefix to use for pcap files.
48 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
49 * @param interface Interface on ipv4 on which you want to enable tracing.
50 * @param explicitFilename Treat the prefix as an explicit filename if true
51 */
52 virtual void EnablePcapIpv4Internal(std::string prefix,
53 Ptr<Ipv4> ipv4,
54 uint32_t interface,
55 bool explicitFilename) = 0;
56
57 /**
58 * @brief Enable pcap output the indicated Ipv4 and interface pair.
59 *
60 * @param prefix Filename prefix to use for pcap files.
61 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
62 * @param interface Interface on ipv4 on which you want to enable tracing.
63 * @param explicitFilename Treat the prefix as an explicit filename if true.
64 */
65 void EnablePcapIpv4(std::string prefix,
66 Ptr<Ipv4> ipv4,
67 uint32_t interface,
68 bool explicitFilename = false);
69
70 /**
71 * @brief Enable pcap output the indicated Ipv4 and interface pair using a
72 * Ptr<Ipv4> previously named using the ns-3 object name service.
73 *
74 * @param prefix filename prefix to use for pcap files.
75 * @param ipv4Name Name of the Ptr<Ipv4> on which you want to enable tracing.
76 * @param interface Interface on ipv4 on which you want to enable tracing.
77 * @param explicitFilename Treat the prefix as an explicit filename if true.
78 */
79 void EnablePcapIpv4(std::string prefix,
80 std::string ipv4Name,
81 uint32_t interface,
82 bool explicitFilename = false);
83
84 /**
85 * @brief Enable pcap output on each Ipv4 and interface pair in the container.
86 *
87 * @param prefix Filename prefix to use for pcap files.
88 * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs
89 */
90 void EnablePcapIpv4(std::string prefix, Ipv4InterfaceContainer c);
91
92 /**
93 * @brief Enable pcap output on all Ipv4 and interface pairs existing in the
94 * nodes provided in the container.
95 *
96 * \param prefix Filename prefix to use for pcap files.
97 * \param n container of nodes.
98 */
99 void EnablePcapIpv4(std::string prefix, NodeContainer n);
100
101 /**
102 * @brief Enable pcap output on the Ipv4 and interface pair specified by a
103 * global node-id (of a previously created node) and interface. Since there
104 * can be only one Ipv4 aggregated to a node, the node-id unambiguously
105 * determines the Ipv4.
106 *
107 * @param prefix Filename prefix to use for pcap files.
108 * @param nodeid The node identifier/number of the node on which to enable tracing.
109 * @param interface Interface on ipv4 on which you want to enable tracing.
110 * @param explicitFilename Treat the prefix as an explicit filename if true
111 */
112 void EnablePcapIpv4(std::string prefix,
113 uint32_t nodeid,
114 uint32_t interface,
115 bool explicitFilename);
116
117 /**
118 * @brief Enable pcap output on all Ipv4 and interface pairs existing in the
119 * set of all nodes created in the simulation.
120 *
121 * @param prefix Filename prefix to use for pcap files.
122 */
123 void EnablePcapIpv4All(std::string prefix);
124};
125
126/**
127 * \ingroup ipv4Helpers
128 *
129 * @brief Base class providing common user-level ascii trace operations for
130 * helpers representing IPv4 protocols .
131 */
133{
134 public:
135 /**
136 * @brief Construct an AsciiTraceHelperForIpv4.
137 */
141
142 /**
143 * @brief Destroy an AsciiTraceHelperForIpv4
144 */
146 {
147 }
148
149 /**
150 * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
151 *
152 * The implementation is expected to use a provided Ptr<OutputStreamWrapper>
153 * if it is non-null. If the OutputStreamWrapper is null, the implementation
154 * is expected to use a provided prefix to construct a new file name for
155 * each net device using the rules described in the class overview.
156 *
157 * If the prefix is provided, there will be one file per Ipv4 and interface pair
158 * created. In this case, adding a trace context to the file would be pointless,
159 * so the helper implementation is expected to TraceConnectWithoutContext.
160 *
161 * If the output stream object is provided, there may be many different Ipv4
162 * and interface pairs writing to a single file. In this case, the trace
163 * context could be important, so the helper implementation is expected to
164 * TraceConnect.
165 *
166 * @param stream An OutputStreamWrapper representing an existing file to use
167 * when writing trace data.
168 * @param prefix Filename prefix to use for ascii trace files.
169 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
170 * @param interface The interface on which you want to enable tracing.
171 * @param explicitFilename Treat the prefix as an explicit filename if true.
172 */
174 std::string prefix,
175 Ptr<Ipv4> ipv4,
176 uint32_t interface,
177 bool explicitFilename) = 0;
178
179 /**
180 * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
181 *
182 * @param prefix Filename prefix to use for ascii files.
183 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
184 * @param interface The interface on which you want to enable tracing.
185 * @param explicitFilename Treat the prefix as an explicit filename if true.
186 */
187 void EnableAsciiIpv4(std::string prefix,
188 Ptr<Ipv4> ipv4,
189 uint32_t interface,
190 bool explicitFilename = false);
191
192 /**
193 * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
194 *
195 * @param stream An OutputStreamWrapper representing an existing file to use
196 * when writing trace data.
197 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
198 * @param interface The interface on which you want to enable tracing.
199 */
200 void EnableAsciiIpv4(Ptr<OutputStreamWrapper> stream, Ptr<Ipv4> ipv4, uint32_t interface);
201
202 /**
203 * @brief Enable ascii trace output the indicated Ipv4 and interface pair
204 * using an Ipv4 previously named using the ns-3 object name service.
205 *
206 * @param prefix filename prefix to use for ascii files.
207 * @param ipv4Name The name of the Ipv4 on which you want to enable tracing.
208 * @param interface The interface on which you want to enable tracing.
209 * @param explicitFilename Treat the prefix as an explicit filename if true.
210 */
211 void EnableAsciiIpv4(std::string prefix,
212 std::string ipv4Name,
213 uint32_t interface,
214 bool explicitFilename = false);
215
216 /**
217 * @brief Enable ascii trace output the indicated net device using a device
218 * previously named using the ns-3 object name service.
219 *
220 * @param stream An OutputStreamWrapper representing an existing file to use
221 * when writing trace data.
222 * @param ipv4Name The name of the Ipv4 on which you want to enable tracing.
223 * @param interface The interface on which you want to enable tracing.
224 */
225 void EnableAsciiIpv4(Ptr<OutputStreamWrapper> stream, std::string ipv4Name, uint32_t interface);
226
227 /**
228 * @brief Enable ascii trace output on each Ipv4 and interface pair in the
229 * container
230 *
231 * @param prefix Filename prefix to use for ascii files.
232 * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs on which to
233 * enable tracing.
234 */
235 void EnableAsciiIpv4(std::string prefix, Ipv4InterfaceContainer c);
236
237 /**
238 * @brief Enable ascii trace output on each device in the container which is
239 * of the appropriate type.
240 *
241 * @param stream An OutputStreamWrapper representing an existing file to use
242 * when writing trace data.
243 * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs on which to
244 * enable tracing.
245 */
247
248 /**
249 * @brief Enable ascii trace output on all Ipv4 and interface pairs existing
250 * in the nodes provided in the container.
251 *
252 * \param prefix Filename prefix to use for ascii files.
253 * \param n container of nodes.
254 */
255 void EnableAsciiIpv4(std::string prefix, NodeContainer n);
256
257 /**
258 * @brief Enable ascii trace output on all Ipv4 and interface pairs existing
259 * in the nodes provided in the container.
260 *
261 * @param stream An OutputStreamWrapper representing an existing file to use
262 * when writing trace data.
263 * \param n container of nodes.
264 */
266
267 /**
268 * @brief Enable ascii trace output on all Ipv4 and interface pairs existing
269 * in the set of all nodes created in the simulation.
270 *
271 * @param prefix Filename prefix to use for ascii files.
272 */
273 void EnableAsciiIpv4All(std::string prefix);
274
275 /**
276 * @brief Enable ascii trace output on each device (which is of the
277 * appropriate type) in the set of all nodes created in the simulation.
278 *
279 * @param stream An OutputStreamWrapper representing an existing file to use
280 * when writing trace data.
281 */
283
284 /**
285 * @brief Enable ascii trace output on the Ipv4 and interface pair specified by a
286 * global node-id (of a previously created node) and interface. Since there
287 * can be only one Ipv4 aggregated to a node, the node-id unambiguously
288 * determines the Ipv4.
289 *
290 * @param prefix Filename prefix to use when creating ascii trace files
291 * @param nodeid The node identifier/number of the node on which to enable
292 * ascii tracing
293 * @param deviceid The device identifier/index of the device on which to enable
294 * ascii tracing
295 * @param explicitFilename Treat the prefix as an explicit filename if true
296 */
297 void EnableAsciiIpv4(std::string prefix,
298 uint32_t nodeid,
299 uint32_t deviceid,
300 bool explicitFilename);
301
302 /**
303 * @brief Enable ascii trace output on the Ipv4 and interface pair specified by a
304 * global node-id (of a previously created node) and interface. Since there
305 * can be only one Ipv4 aggregated to a node, the node-id unambiguously
306 * determines the Ipv4.
307 *
308 * @param stream An OutputStreamWrapper representing an existing file to use
309 * when writing trace data.
310 * @param nodeid The node identifier/number of the node on which to enable
311 * ascii tracing
312 * @param interface The interface on which you want to enable tracing.
313 * @param explicitFilename Treat the prefix as an explicit filename if true
314 */
316 uint32_t nodeid,
317 uint32_t interface,
318 bool explicitFilename);
319
320 private:
321 /**
322 * @brief Enable ascii trace output on the Ipv4 and interface pair specified by a
323 * global node-id (of a previously created node) and interface. Since there
324 * can be only one Ipv4 aggregated to a node, the node-id unambiguously
325 * determines the Ipv4.
326 *
327 * @param stream An OutputStreamWrapper representing an existing file to use
328 * when writing trace data.
329 * @param prefix Filename prefix to use when creating ascii trace files
330 * @param nodeid The node identifier/number of the node on which to enable
331 * ascii tracing
332 * @param interface The device identifier/index of the device on which to enable
333 * ascii tracing
334 * @param explicitFilename Treat the prefix as an explicit filename if true.
335 */
337 std::string prefix,
338 uint32_t nodeid,
339 uint32_t interface,
340 bool explicitFilename);
341
342 /**
343 * @brief Enable ascii trace output on the Ipv4 and interface pair specified by a
344 * global node-id (of a previously created node) and interface. Since there
345 * can be only one Ipv4 aggregated to a node, the node-id unambiguously
346 * determines the Ipv4.
347 *
348 * @param stream An OutputStreamWrapper representing an existing file to use
349 * when writing trace data.
350 * @param prefix Filename prefix to use when creating ascii trace files
351 * @param n container of nodes.
352 */
353 void EnableAsciiIpv4Impl(Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
354
355 /**
356 * @brief Enable ascii trace output on the Ipv4 and interface pair specified by a
357 * global node-id (of a previously created node) and interface. Since there
358 * can be only one Ipv4 aggregated to a node, the node-id unambiguously
359 * determines the Ipv4.
360 *
361 * @param stream An OutputStreamWrapper representing an existing file to use
362 * when writing trace data.
363 * @param prefix Filename prefix to use when creating ascii trace files
364 * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs
365 */
367 std::string prefix,
369
370 /**
371 * @brief Enable ascii trace output on the Ipv4 and interface pair specified by a
372 * global node-id (of a previously created node) and interface. Since there
373 * can be only one Ipv4 aggregated to a node, the node-id unambiguously
374 * determines the Ipv4.
375 *
376 * @param stream An OutputStreamWrapper representing an existing file to use
377 * when writing trace data.
378 * @param prefix Filename prefix to use when creating ascii trace files
379 * @param ipv4Name Name of the Ptr<Ipv4> on which you want to enable tracing.
380 * @param interface The device identifier/index of the device on which to enable
381 * ascii tracing
382 * @param explicitFilename Treat the prefix as an explicit filename if true.
383 */
385 std::string prefix,
386 std::string ipv4Name,
387 uint32_t interface,
388 bool explicitFilename);
389
390 /**
391 * @brief Enable ascii trace output on the Ipv4 and interface pair specified by a
392 * global node-id (of a previously created node) and interface. Since there
393 * can be only one Ipv4 aggregated to a node, the node-id unambiguously
394 * determines the Ipv4.
395 *
396 * @param stream An OutputStreamWrapper representing an existing file to use
397 * when writing trace data.
398 * @param prefix Filename prefix to use when creating ascii trace files
399 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
400 * @param interface The device identifier/index of the device on which to enable
401 * ascii tracing
402 * @param explicitFilename Treat the prefix as an explicit filename if true.
403 */
405 std::string prefix,
406 Ptr<Ipv4> ipv4,
407 uint32_t interface,
408 bool explicitFilename);
409};
410
411/**
412 * \ingroup ipv6Helpers
413 *
414 * @brief Base class providing common user-level pcap operations for helpers
415 * representing IPv6 protocols .
416 */
418{
419 public:
420 /**
421 * @brief Construct a PcapHelperForIpv6.
422 */
424 {
425 }
426
427 /**
428 * @brief Destroy a PcapHelperForIpv6
429 */
431 {
432 }
433
434 /**
435 * @brief Enable pcap output the indicated Ipv6 and interface pair.
436 *
437 * @param prefix Filename prefix to use for pcap files.
438 * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
439 * @param interface Interface on ipv6 on which you want to enable tracing.
440 * @param explicitFilename Treat the prefix as an explicit filename if true.
441 */
442 virtual void EnablePcapIpv6Internal(std::string prefix,
443 Ptr<Ipv6> ipv6,
444 uint32_t interface,
445 bool explicitFilename) = 0;
446
447 /**
448 * @brief Enable pcap output the indicated Ipv6 and interface pair.
449 *
450 * @param prefix Filename prefix to use for pcap files.
451 * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
452 * @param interface Interface on ipv6 on which you want to enable tracing.
453 * @param explicitFilename Treat the prefix as an explicit filename if true.
454 */
455 void EnablePcapIpv6(std::string prefix,
456 Ptr<Ipv6> ipv6,
457 uint32_t interface,
458 bool explicitFilename = false);
459
460 /**
461 * @brief Enable pcap output the indicated Ipv6 and interface pair using a
462 * Ptr<Ipv6> previously named using the ns-3 object name service.
463 *
464 * @param prefix filename prefix to use for pcap files.
465 * @param ipv6Name Name of the Ptr<Ipv6> on which you want to enable tracing.
466 * @param interface Interface on ipv6 on which you want to enable tracing.
467 * @param explicitFilename Treat the prefix as an explicit filename if true.
468 */
469 void EnablePcapIpv6(std::string prefix,
470 std::string ipv6Name,
471 uint32_t interface,
472 bool explicitFilename = false);
473
474 /**
475 * @brief Enable pcap output on each Ipv6 and interface pair in the container.
476 *
477 * @param prefix Filename prefix to use for pcap files.
478 * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs
479 */
480 void EnablePcapIpv6(std::string prefix, Ipv6InterfaceContainer c);
481
482 /**
483 * @brief Enable pcap output on all Ipv6 and interface pairs existing in the
484 * nodes provided in the container.
485 *
486 * \param prefix Filename prefix to use for pcap files.
487 * \param n container of nodes.
488 */
489 void EnablePcapIpv6(std::string prefix, NodeContainer n);
490
491 /**
492 * @brief Enable pcap output on the Ipv6 and interface pair specified by a
493 * global node-id (of a previously created node) and interface. Since there
494 * can be only one Ipv6 aggregated to a node, the node-id unambiguously
495 * determines the Ipv6.
496 *
497 * @param prefix Filename prefix to use for pcap files.
498 * @param nodeid The node identifier/number of the node on which to enable tracing.
499 * @param interface Interface on ipv6 on which you want to enable tracing.
500 * @param explicitFilename Treat the prefix as an explicit filename if true
501 */
502 void EnablePcapIpv6(std::string prefix,
503 uint32_t nodeid,
504 uint32_t interface,
505 bool explicitFilename);
506
507 /**
508 * @brief Enable pcap output on all Ipv6 and interface pairs existing in the
509 * set of all nodes created in the simulation.
510 *
511 * @param prefix Filename prefix to use for pcap files.
512 */
513 void EnablePcapIpv6All(std::string prefix);
514};
515
516/**
517 * \ingroup ipv6Helpers
518 *
519 * @brief Base class providing common user-level ascii trace operations for
520 * helpers representing IPv6 protocols .
521 */
523{
524 public:
525 /**
526 * @brief Construct an AsciiTraceHelperForIpv6.
527 */
531
532 /**
533 * @brief Destroy an AsciiTraceHelperForIpv6
534 */
536 {
537 }
538
539 /**
540 * @brief Enable ascii trace output on the indicated Ipv6 and interface pair.
541 *
542 * The implementation is expected to use a provided Ptr<OutputStreamWrapper>
543 * if it is non-null. If the OutputStreamWrapper is null, the implementation
544 * is expected to use a provided prefix to construct a new file name for
545 * each net device using the rules described in the class overview.
546 *
547 * If the prefix is provided, there will be one file per Ipv6 and interface pair
548 * created. In this case, adding a trace context to the file would be pointless,
549 * so the helper implementation is expected to TraceConnectWithoutContext.
550 *
551 * If the output stream object is provided, there may be many different Ipv6
552 * and interface pairs writing to a single file. In this case, the trace
553 * context could be important, so the helper implementation is expected to
554 * TraceConnect.
555 *
556 * @param stream An OutputStreamWrapper representing an existing file to use
557 * when writing trace data.
558 * @param prefix Filename prefix to use for ascii trace files.
559 * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
560 * @param interface The interface on which you want to enable tracing.
561 * @param explicitFilename Treat the prefix as an explicit filename if true.
562 */
564 std::string prefix,
565 Ptr<Ipv6> ipv6,
566 uint32_t interface,
567 bool explicitFilename) = 0;
568
569 /**
570 * @brief Enable ascii trace output on the indicated Ipv6 and interface pair.
571 *
572 * @param prefix Filename prefix to use for ascii files.
573 * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
574 * @param interface The interface on which you want to enable tracing.
575 * @param explicitFilename Treat the prefix as an explicit filename if true.
576 */
577 void EnableAsciiIpv6(std::string prefix,
578 Ptr<Ipv6> ipv6,
579 uint32_t interface,
580 bool explicitFilename = false);
581
582 /**
583 * @brief Enable ascii trace output on the indicated Ipv6 and interface pair.
584 *
585 * @param stream An OutputStreamWrapper representing an existing file to use
586 * when writing trace data.
587 * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
588 * @param interface The interface on which you want to enable tracing.
589 */
590 void EnableAsciiIpv6(Ptr<OutputStreamWrapper> stream, Ptr<Ipv6> ipv6, uint32_t interface);
591
592 /**
593 * @brief Enable ascii trace output the indicated Ipv6 and interface pair
594 * using an Ipv6 previously named using the ns-3 object name service.
595 *
596 * @param prefix filename prefix to use for ascii files.
597 * @param ipv6Name The name of the Ipv6 on which you want to enable tracing.
598 * @param interface The interface on which you want to enable tracing.
599 * @param explicitFilename Treat the prefix as an explicit filename if true.
600 */
601 void EnableAsciiIpv6(std::string prefix,
602 std::string ipv6Name,
603 uint32_t interface,
604 bool explicitFilename = false);
605
606 /**
607 * @brief Enable ascii trace output the indicated net device using a device
608 * previously named using the ns-3 object name service.
609 *
610 * @param stream An OutputStreamWrapper representing an existing file to use
611 * when writing trace data.
612 * @param ipv6Name The name of the Ipv6 on which you want to enable tracing.
613 * @param interface The interface on which you want to enable tracing.
614 */
615 void EnableAsciiIpv6(Ptr<OutputStreamWrapper> stream, std::string ipv6Name, uint32_t interface);
616
617 /**
618 * @brief Enable ascii trace output on each Ipv6 and interface pair in the
619 * container
620 *
621 * @param prefix Filename prefix to use for ascii files.
622 * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs on which to
623 * enable tracing.
624 */
625 void EnableAsciiIpv6(std::string prefix, Ipv6InterfaceContainer c);
626
627 /**
628 * @brief Enable ascii trace output on each device in the container which is
629 * of the appropriate type.
630 *
631 * @param stream An OutputStreamWrapper representing an existing file to use
632 * when writing trace data.
633 * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs on which to
634 * enable tracing.
635 */
637
638 /**
639 * @brief Enable ascii trace output on all Ipv6 and interface pairs existing
640 * in the nodes provided in the container.
641 *
642 * \param prefix Filename prefix to use for ascii files.
643 * \param n container of nodes.
644 */
645 void EnableAsciiIpv6(std::string prefix, NodeContainer n);
646
647 /**
648 * @brief Enable ascii trace output on all Ipv6 and interface pairs existing
649 * in the nodes provided in the container.
650 *
651 * @param stream An OutputStreamWrapper representing an existing file to use
652 * when writing trace data.
653 * \param n container of nodes.
654 */
656
657 /**
658 * @brief Enable ascii trace output on the Ipv6 and interface pair specified by a
659 * global node-id (of a previously created node) and interface. Since there
660 * can be only one Ipv6 aggregated to a node, the node-id unambiguously
661 * determines the Ipv6.
662 *
663 * @param prefix Filename prefix to use when creating ascii trace files
664 * @param nodeid The node identifier/number of the node on which to enable
665 * ascii tracing
666 * @param interface The device identifier/index of the device on which to enable
667 * ascii tracing
668 * @param explicitFilename Treat the prefix as an explicit filename if true.
669 */
670 void EnableAsciiIpv6(std::string prefix,
671 uint32_t nodeid,
672 uint32_t interface,
673 bool explicitFilename);
674
675 /**
676 * @brief Enable ascii trace output on the Ipv6 and interface pair specified by a
677 * global node-id (of a previously created node) and interface. Since there
678 * can be only one Ipv6 aggregated to a node, the node-id unambiguously
679 * determines the Ipv6.
680 *
681 * @param stream An OutputStreamWrapper representing an existing file to use
682 * when writing trace data.
683 * @param nodeid The node identifier/number of the node on which to enable
684 * ascii tracing
685 * @param interface The interface on which you want to enable tracing.
686 */
687 void EnableAsciiIpv6(Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface);
688
689 /**
690 * @brief Enable ascii trace output on all Ipv6 and interface pairs existing
691 * in the set of all nodes created in the simulation.
692 *
693 * @param prefix Filename prefix to use for ascii files.
694 */
695 void EnableAsciiIpv6All(std::string prefix);
696
697 /**
698 * @brief Enable ascii trace output on each device (which is of the
699 * appropriate type) in the set of all nodes created in the simulation.
700 *
701 * @param stream An OutputStreamWrapper representing an existing file to use
702 * when writing trace data.
703 */
705
706 private:
707 /**
708 * @brief Enable ascii trace output on the Ipv6 and interface pair specified by a
709 * global node-id (of a previously created node) and interface. Since there
710 * can be only one Ipv6 aggregated to a node, the node-id unambiguously
711 * determines the Ipv6.
712 *
713 * @param stream An OutputStreamWrapper representing an existing file to use
714 * when writing trace data.
715 * @param prefix Filename prefix to use when creating ascii trace files
716 * @param nodeid The node identifier/number of the node on which to enable
717 * ascii tracing
718 * @param interface The device identifier/index of the device on which to enable
719 * ascii tracing
720 * @param explicitFilename Treat the prefix as an explicit filename if true.
721 */
723 std::string prefix,
724 uint32_t nodeid,
725 uint32_t interface,
726 bool explicitFilename);
727
728 /**
729 * @brief Enable ascii trace output on the Ipv6 and interface pair specified by a
730 * global node-id (of a previously created node) and interface. Since there
731 * can be only one Ipv6 aggregated to a node, the node-id unambiguously
732 * determines the Ipv6.
733 *
734 * @param stream An OutputStreamWrapper representing an existing file to use
735 * when writing trace data.
736 * @param prefix Filename prefix to use when creating ascii trace files
737 * @param n container of nodes.
738 */
739 void EnableAsciiIpv6Impl(Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
740
741 /**
742 * @brief Enable ascii trace output on the Ipv6 and interface pair specified by a
743 * global node-id (of a previously created node) and interface. Since there
744 * can be only one Ipv6 aggregated to a node, the node-id unambiguously
745 * determines the Ipv6.
746 *
747 * @param stream An OutputStreamWrapper representing an existing file to use
748 * when writing trace data.
749 * @param prefix Filename prefix to use when creating ascii trace files
750 * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs
751 */
753 std::string prefix,
755
756 /**
757 * @brief Enable ascii trace output on the Ipv6 and interface pair specified by a
758 * global node-id (of a previously created node) and interface. Since there
759 * can be only one Ipv6 aggregated to a node, the node-id unambiguously
760 * determines the Ipv6.
761 *
762 * @param stream An OutputStreamWrapper representing an existing file to use
763 * when writing trace data.
764 * @param prefix Filename prefix to use when creating ascii trace files
765 * @param ipv6Name Name of the Ptr<Ipv6> on which you want to enable tracing.
766 * @param interface The device identifier/index of the device on which to enable
767 * ascii tracing
768 * @param explicitFilename Treat the prefix as an explicit filename if true.
769 */
771 std::string prefix,
772 std::string ipv6Name,
773 uint32_t interface,
774 bool explicitFilename);
775
776 /**
777 * @brief Enable ascii trace output on the Ipv6 and interface pair specified by a
778 * global node-id (of a previously created node) and interface. Since there
779 * can be only one Ipv6 aggregated to a node, the node-id unambiguously
780 * determines the Ipv6.
781 *
782 * @param stream An OutputStreamWrapper representing an existing file to use
783 * when writing trace data.
784 * @param prefix Filename prefix to use when creating ascii trace files
785 * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
786 * @param interface The device identifier/index of the device on which to enable
787 * ascii tracing
788 * @param explicitFilename Treat the prefix as an explicit filename if true.
789 */
791 std::string prefix,
792 Ptr<Ipv6> ipv6,
793 uint32_t interface,
794 bool explicitFilename);
795};
796
797} // namespace ns3
798
799#endif /* INTERNET_TRACE_HELPER_H */
Base class providing common user-level ascii trace operations for helpers representing IPv4 protocols...
void EnableAsciiIpv4Impl(Ptr< OutputStreamWrapper > stream, std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
Enable ascii trace output on the Ipv4 and interface pair specified by a global node-id (of a previous...
virtual ~AsciiTraceHelperForIpv4()
Destroy an AsciiTraceHelperForIpv4.
void EnableAsciiIpv4Impl(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename)
Enable ascii trace output on the Ipv4 and interface pair specified by a global node-id (of a previous...
AsciiTraceHelperForIpv4()
Construct an AsciiTraceHelperForIpv4.
void EnableAsciiIpv4All(std::string prefix)
Enable ascii trace output on all Ipv4 and interface pairs existing in the set of all nodes created in...
void EnableAsciiIpv4(std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename=false)
Enable ascii trace output on the indicated Ipv4 and interface pair.
virtual void EnableAsciiIpv4Internal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename)=0
Enable ascii trace output on the indicated Ipv4 and interface pair.
Base class providing common user-level ascii trace operations for helpers representing IPv6 protocols...
void EnableAsciiIpv6All(std::string prefix)
Enable ascii trace output on all Ipv6 and interface pairs existing in the set of all nodes created in...
void EnableAsciiIpv6(std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename=false)
Enable ascii trace output on the indicated Ipv6 and interface pair.
virtual void EnableAsciiIpv6Internal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename)=0
Enable ascii trace output on the indicated Ipv6 and interface pair.
AsciiTraceHelperForIpv6()
Construct an AsciiTraceHelperForIpv6.
virtual ~AsciiTraceHelperForIpv6()
Destroy an AsciiTraceHelperForIpv6.
void EnableAsciiIpv6Impl(Ptr< OutputStreamWrapper > stream, std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
Enable ascii trace output on the Ipv6 and interface pair specified by a global node-id (of a previous...
void EnableAsciiIpv6Impl(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename)
Enable ascii trace output on the Ipv6 and interface pair specified by a global node-id (of a previous...
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Keep track of a set of IPv6 interfaces.
keep track of a set of node pointers.
Base class providing common user-level pcap operations for helpers representing IPv4 protocols .
virtual void EnablePcapIpv4Internal(std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename)=0
Enable pcap output the indicated Ipv4 and interface pair.
virtual ~PcapHelperForIpv4()
Destroy a PcapHelperForIpv4.
void EnablePcapIpv4(std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename=false)
Enable pcap output the indicated Ipv4 and interface pair.
PcapHelperForIpv4()
Construct a PcapHelperForIpv4.
void EnablePcapIpv4All(std::string prefix)
Enable pcap output on all Ipv4 and interface pairs existing in the set of all nodes created in the si...
Base class providing common user-level pcap operations for helpers representing IPv6 protocols .
void EnablePcapIpv6All(std::string prefix)
Enable pcap output on all Ipv6 and interface pairs existing in the set of all nodes created in the si...
PcapHelperForIpv6()
Construct a PcapHelperForIpv6.
virtual ~PcapHelperForIpv6()
Destroy a PcapHelperForIpv6.
void EnablePcapIpv6(std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename=false)
Enable pcap output the indicated Ipv6 and interface pair.
virtual void EnablePcapIpv6Internal(std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename)=0
Enable pcap output the indicated Ipv6 and interface pair.
Smart pointer class similar to boost::intrusive_ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.