View | Details | Raw Unified | Return to bug 877
Collapse All | Expand All

(-)a/src/helper/csma-helper.h (-1 / +1 lines)
 Lines 43-49    Link Here 
43
 * encapsulates a general attribute or a set of functionality that
43
 * encapsulates a general attribute or a set of functionality that
44
 * may be of interest to many other classes.
44
 * may be of interest to many other classes.
45
 */
45
 */
46
class CsmaHelper : public PcapHelperForDevice, public AsciiTraceHelperForDevice
46
class CsmaHelper : public TraceHelperForDevice
47
{
47
{
48
public:
48
public:
49
  /**
49
  /**
(-)a/src/helper/emu-helper.h (-1 / +1 lines)
 Lines 43-49    Link Here 
43
 * encapsulates a general attribute or a set of functionality that
43
 * encapsulates a general attribute or a set of functionality that
44
 * may be of interest to many other classes.
44
 * may be of interest to many other classes.
45
 */
45
 */
46
  class EmuHelper : public PcapHelperForDevice, public AsciiTraceHelperForDevice
46
class EmuHelper : public TraceHelperForDevice
47
{
47
{
48
public:
48
public:
49
  /*
49
  /*
(-)a/src/helper/internet-stack-helper.h (-8 / +1 lines)
 Lines 45-59    Link Here 
45
 * there is no device.  This means that the creation of output file names will
45
 * there is no device.  This means that the creation of output file names will
46
 * change, and also the user-visible methods will not reference devices and
46
 * change, and also the user-visible methods will not reference devices and
47
 * therefore the number of trace enable methods is reduced.
47
 * therefore the number of trace enable methods is reduced.
48
 *
49
 * Normally we eschew multiple inheritance, however, the classes 
50
 * PcapUserHelperForIpv4 and AsciiTraceUserHelperForIpv4 are
51
 * treated as "mixins".  A mixin is a self-contained class that
52
 * encapsulates a general attribute or a set of functionality that
53
 * may be of interest to many other classes.
54
 */
48
 */
55
class InternetStackHelper : public PcapHelperForIpv4, public PcapHelperForIpv6, 
49
class InternetStackHelper : public TraceHelperForIpvx
56
                              public AsciiTraceHelperForIpv4, public AsciiTraceHelperForIpv6
57
{
50
{
58
public:
51
public:
59
  /**
52
  /**
(-)a/src/helper/point-to-point-helper.h (-1 / +1 lines)
 Lines 42-48    Link Here 
42
 * PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are
42
 * PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are
43
 * "mixins".
43
 * "mixins".
44
 */
44
 */
45
class PointToPointHelper : public PcapHelperForDevice, public AsciiTraceHelperForDevice
45
class PointToPointHelper : public TraceHelperForDevice
46
{
46
{
47
public:
47
public:
48
  /**
48
  /**
(-)a/src/helper/trace-helper.cc (-68 / +68 lines)
 Lines 398-417    Link Here 
398
}
398
}
399
399
400
void 
400
void 
401
PcapHelperForDevice::EnablePcap (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename)
401
TraceHelperForDevice::EnablePcap (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename)
402
{
402
{
403
  EnablePcapInternal (prefix, nd, promiscuous, explicitFilename);
403
  EnablePcapInternal (prefix, nd, promiscuous, explicitFilename);
404
}
404
}
405
405
406
void 
406
void 
407
PcapHelperForDevice::EnablePcap (std::string prefix, std::string ndName, bool promiscuous, bool explicitFilename)
407
TraceHelperForDevice::EnablePcap (std::string prefix, std::string ndName, bool promiscuous, bool explicitFilename)
408
{
408
{
409
  Ptr<NetDevice> nd = Names::Find<NetDevice> (ndName);
409
  Ptr<NetDevice> nd = Names::Find<NetDevice> (ndName);
410
  EnablePcap (prefix, nd, promiscuous, explicitFilename);
410
  EnablePcap (prefix, nd, promiscuous, explicitFilename);
411
}
411
}
412
412
413
void 
413
void 
414
PcapHelperForDevice::EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous)
414
TraceHelperForDevice::EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous)
415
{
415
{
416
  for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i)
416
  for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i)
417
    {
417
    {
 Lines 421-427    Link Here 
421
}
421
}
422
422
423
void
423
void
424
PcapHelperForDevice::EnablePcap (std::string prefix, NodeContainer n, bool promiscuous)
424
TraceHelperForDevice::EnablePcap (std::string prefix, NodeContainer n, bool promiscuous)
425
{
425
{
426
  NetDeviceContainer devs;
426
  NetDeviceContainer devs;
427
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
427
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
 Lines 436-448    Link Here 
436
}
436
}
437
437
438
void
438
void
439
PcapHelperForDevice::EnablePcapAll (std::string prefix, bool promiscuous)
439
TraceHelperForDevice::EnablePcapAll (std::string prefix, bool promiscuous)
440
{
440
{
441
  EnablePcap (prefix, NodeContainer::GetGlobal (), promiscuous);
441
  EnablePcap (prefix, NodeContainer::GetGlobal (), promiscuous);
442
}
442
}
443
443
444
void 
444
void 
445
PcapHelperForDevice::EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous)
445
TraceHelperForDevice::EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous)
446
{
446
{
447
  NodeContainer n = NodeContainer::GetGlobal ();
447
  NodeContainer n = NodeContainer::GetGlobal ();
448
448
 Lines 454-460    Link Here 
454
          continue;
454
          continue;
455
        }
455
        }
456
      
456
      
457
      NS_ABORT_MSG_IF (deviceid >= node->GetNDevices (), "PcapHelperForDevice::EnablePcap(): Unknown deviceid = " 
457
      NS_ABORT_MSG_IF (deviceid >= node->GetNDevices (), "TraceHelperForDevice::EnablePcap(): Unknown deviceid = " 
458
                       << deviceid);
458
                       << deviceid);
459
      Ptr<NetDevice> nd = node->GetDevice (deviceid);
459
      Ptr<NetDevice> nd = node->GetDevice (deviceid);
460
      EnablePcap (prefix, nd, promiscuous);
460
      EnablePcap (prefix, nd, promiscuous);
 Lines 466-472    Link Here 
466
// Public API
466
// Public API
467
//
467
//
468
void 
468
void 
469
AsciiTraceHelperForDevice::EnableAscii (std::string prefix, Ptr<NetDevice> nd, bool explicitFilename)
469
TraceHelperForDevice::EnableAscii (std::string prefix, Ptr<NetDevice> nd, bool explicitFilename)
470
{
470
{
471
  EnableAsciiInternal (Ptr<OutputStreamWrapper> (), prefix, nd, explicitFilename);
471
  EnableAsciiInternal (Ptr<OutputStreamWrapper> (), prefix, nd, explicitFilename);
472
}
472
}
 Lines 475-481    Link Here 
475
// Public API
475
// Public API
476
//
476
//
477
void 
477
void 
478
AsciiTraceHelperForDevice::EnableAscii (Ptr<OutputStreamWrapper> stream, Ptr<NetDevice> nd)
478
TraceHelperForDevice::EnableAscii (Ptr<OutputStreamWrapper> stream, Ptr<NetDevice> nd)
479
{
479
{
480
  EnableAsciiInternal (stream, std::string (), nd, false);
480
  EnableAsciiInternal (stream, std::string (), nd, false);
481
}
481
}
 Lines 484-490    Link Here 
484
// Public API
484
// Public API
485
//
485
//
486
void 
486
void 
487
AsciiTraceHelperForDevice::EnableAscii (std::string prefix, std::string ndName, bool explicitFilename)
487
TraceHelperForDevice::EnableAscii (std::string prefix, std::string ndName, bool explicitFilename)
488
{
488
{
489
  EnableAsciiImpl (Ptr<OutputStreamWrapper> (), prefix, ndName, explicitFilename);
489
  EnableAsciiImpl (Ptr<OutputStreamWrapper> (), prefix, ndName, explicitFilename);
490
}
490
}
 Lines 493-499    Link Here 
493
// Public API
493
// Public API
494
//
494
//
495
void 
495
void 
496
AsciiTraceHelperForDevice::EnableAscii (Ptr<OutputStreamWrapper> stream, std::string ndName)
496
TraceHelperForDevice::EnableAscii (Ptr<OutputStreamWrapper> stream, std::string ndName)
497
{
497
{
498
  EnableAsciiImpl (stream, std::string (), ndName, false);
498
  EnableAsciiImpl (stream, std::string (), ndName, false);
499
}
499
}
 Lines 502-508    Link Here 
502
// Private API
502
// Private API
503
//
503
//
504
void 
504
void 
505
AsciiTraceHelperForDevice::EnableAsciiImpl (
505
TraceHelperForDevice::EnableAsciiImpl (
506
  Ptr<OutputStreamWrapper> stream, 
506
  Ptr<OutputStreamWrapper> stream, 
507
  std::string prefix, 
507
  std::string prefix, 
508
  std::string ndName,
508
  std::string ndName,
 Lines 516-522    Link Here 
516
// Public API
516
// Public API
517
//
517
//
518
void 
518
void 
519
AsciiTraceHelperForDevice::EnableAscii (std::string prefix, NetDeviceContainer d)
519
TraceHelperForDevice::EnableAscii (std::string prefix, NetDeviceContainer d)
520
{
520
{
521
  EnableAsciiImpl (Ptr<OutputStreamWrapper> (), prefix, d);
521
  EnableAsciiImpl (Ptr<OutputStreamWrapper> (), prefix, d);
522
}
522
}
 Lines 525-531    Link Here 
525
// Public API
525
// Public API
526
//
526
//
527
void 
527
void 
528
AsciiTraceHelperForDevice::EnableAscii (Ptr<OutputStreamWrapper> stream, NetDeviceContainer d)
528
TraceHelperForDevice::EnableAscii (Ptr<OutputStreamWrapper> stream, NetDeviceContainer d)
529
{
529
{
530
  EnableAsciiImpl (stream, std::string (), d);
530
  EnableAsciiImpl (stream, std::string (), d);
531
}
531
}
 Lines 534-540    Link Here 
534
// Private API
534
// Private API
535
//
535
//
536
void 
536
void 
537
AsciiTraceHelperForDevice::EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, NetDeviceContainer d)
537
TraceHelperForDevice::EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, NetDeviceContainer d)
538
{
538
{
539
  for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i)
539
  for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i)
540
    {
540
    {
 Lines 547-553    Link Here 
547
// Public API
547
// Public API
548
//
548
//
549
void
549
void
550
AsciiTraceHelperForDevice::EnableAscii (std::string prefix, NodeContainer n)
550
TraceHelperForDevice::EnableAscii (std::string prefix, NodeContainer n)
551
{
551
{
552
  EnableAsciiImpl (Ptr<OutputStreamWrapper> (), prefix, n);
552
  EnableAsciiImpl (Ptr<OutputStreamWrapper> (), prefix, n);
553
}
553
}
 Lines 556-562    Link Here 
556
// Public API
556
// Public API
557
//
557
//
558
void
558
void
559
AsciiTraceHelperForDevice::EnableAscii (Ptr<OutputStreamWrapper> stream, NodeContainer n)
559
TraceHelperForDevice::EnableAscii (Ptr<OutputStreamWrapper> stream, NodeContainer n)
560
{
560
{
561
  EnableAsciiImpl (stream, std::string (), n);
561
  EnableAsciiImpl (stream, std::string (), n);
562
}
562
}
 Lines 565-571    Link Here 
565
// Private API
565
// Private API
566
//
566
//
567
void
567
void
568
AsciiTraceHelperForDevice::EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n)
568
TraceHelperForDevice::EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n)
569
{
569
{
570
  NetDeviceContainer devs;
570
  NetDeviceContainer devs;
571
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
571
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
 Lines 583-589    Link Here 
583
// Public API
583
// Public API
584
//
584
//
585
void
585
void
586
AsciiTraceHelperForDevice::EnableAsciiAll (std::string prefix)
586
TraceHelperForDevice::EnableAsciiAll (std::string prefix)
587
{
587
{
588
  EnableAsciiImpl (Ptr<OutputStreamWrapper> (), prefix, NodeContainer::GetGlobal ());
588
  EnableAsciiImpl (Ptr<OutputStreamWrapper> (), prefix, NodeContainer::GetGlobal ());
589
}
589
}
 Lines 592-598    Link Here 
592
// Public API
592
// Public API
593
//
593
//
594
void
594
void
595
AsciiTraceHelperForDevice::EnableAsciiAll (Ptr<OutputStreamWrapper> stream)
595
TraceHelperForDevice::EnableAsciiAll (Ptr<OutputStreamWrapper> stream)
596
{
596
{
597
  EnableAsciiImpl (stream, std::string (), NodeContainer::GetGlobal ());
597
  EnableAsciiImpl (stream, std::string (), NodeContainer::GetGlobal ());
598
}
598
}
 Lines 601-607    Link Here 
601
// Public API
601
// Public API
602
//
602
//
603
void 
603
void 
604
AsciiTraceHelperForDevice::EnableAscii (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t deviceid)
604
TraceHelperForDevice::EnableAscii (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t deviceid)
605
{
605
{
606
  EnableAsciiImpl (stream, std::string (), nodeid, deviceid, false);
606
  EnableAsciiImpl (stream, std::string (), nodeid, deviceid, false);
607
}
607
}
 Lines 610-616    Link Here 
610
// Public API
610
// Public API
611
//
611
//
612
void 
612
void 
613
AsciiTraceHelperForDevice::EnableAscii (
613
TraceHelperForDevice::EnableAscii (
614
  std::string prefix, 
614
  std::string prefix, 
615
  uint32_t nodeid, 
615
  uint32_t nodeid, 
616
  uint32_t deviceid,
616
  uint32_t deviceid,
 Lines 623-629    Link Here 
623
// Private API
623
// Private API
624
//
624
//
625
void 
625
void 
626
AsciiTraceHelperForDevice::EnableAsciiImpl (
626
TraceHelperForDevice::EnableAsciiImpl (
627
  Ptr<OutputStreamWrapper> stream, 
627
  Ptr<OutputStreamWrapper> stream, 
628
  std::string prefix, 
628
  std::string prefix, 
629
  uint32_t nodeid, 
629
  uint32_t nodeid, 
 Lines 641-647    Link Here 
641
        }
641
        }
642
      
642
      
643
      NS_ABORT_MSG_IF (deviceid >= node->GetNDevices (), 
643
      NS_ABORT_MSG_IF (deviceid >= node->GetNDevices (), 
644
                       "AsciiTraceHelperForDevice::EnableAscii(): Unknown deviceid = " << deviceid);
644
                       "TraceHelperForDevice::EnableAscii(): Unknown deviceid = " << deviceid);
645
645
646
      Ptr<NetDevice> nd = node->GetDevice (deviceid);
646
      Ptr<NetDevice> nd = node->GetDevice (deviceid);
647
647
 Lines 651-670    Link Here 
651
}
651
}
652
652
653
void 
653
void 
654
PcapHelperForIpv4::EnablePcapIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename)
654
TraceHelperForIpvx::EnablePcapIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename)
655
{
655
{
656
  EnablePcapIpv4Internal (prefix, ipv4, interface, explicitFilename);
656
  EnablePcapIpv4Internal (prefix, ipv4, interface, explicitFilename);
657
}
657
}
658
658
659
void 
659
void 
660
PcapHelperForIpv4::EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename)
660
TraceHelperForIpvx::EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename)
661
{
661
{
662
  Ptr<Ipv4> ipv4 = Names::Find<Ipv4> (ipv4Name);
662
  Ptr<Ipv4> ipv4 = Names::Find<Ipv4> (ipv4Name);
663
  EnablePcapIpv4 (prefix, ipv4, interface, explicitFilename);
663
  EnablePcapIpv4 (prefix, ipv4, interface, explicitFilename);
664
}
664
}
665
665
666
void 
666
void 
667
PcapHelperForIpv4::EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c)
667
TraceHelperForIpvx::EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c)
668
{
668
{
669
  for (Ipv4InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
669
  for (Ipv4InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
670
    {
670
    {
 Lines 674-680    Link Here 
674
}
674
}
675
675
676
void
676
void
677
PcapHelperForIpv4::EnablePcapIpv4 (std::string prefix, NodeContainer n)
677
TraceHelperForIpvx::EnablePcapIpv4 (std::string prefix, NodeContainer n)
678
{
678
{
679
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
679
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
680
    {
680
    {
 Lines 691-703    Link Here 
691
}
691
}
692
692
693
void
693
void
694
PcapHelperForIpv4::EnablePcapIpv4All (std::string prefix)
694
TraceHelperForIpvx::EnablePcapIpv4All (std::string prefix)
695
{
695
{
696
  EnablePcapIpv4 (prefix, NodeContainer::GetGlobal ());
696
  EnablePcapIpv4 (prefix, NodeContainer::GetGlobal ());
697
}
697
}
698
698
699
void 
699
void 
700
PcapHelperForIpv4::EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
700
TraceHelperForIpvx::EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
701
{
701
{
702
  NodeContainer n = NodeContainer::GetGlobal ();
702
  NodeContainer n = NodeContainer::GetGlobal ();
703
703
 Lines 722-728    Link Here 
722
// Public API
722
// Public API
723
//
723
//
724
void 
724
void 
725
AsciiTraceHelperForIpv4::EnableAsciiIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename)
725
TraceHelperForIpvx::EnableAsciiIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename)
726
{
726
{
727
  EnableAsciiIpv4Internal (Ptr<OutputStreamWrapper> (), prefix, ipv4, interface, explicitFilename);
727
  EnableAsciiIpv4Internal (Ptr<OutputStreamWrapper> (), prefix, ipv4, interface, explicitFilename);
728
}
728
}
 Lines 731-737    Link Here 
731
// Public API
731
// Public API
732
//
732
//
733
void 
733
void 
734
AsciiTraceHelperForIpv4::EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv4> ipv4, uint32_t interface)
734
TraceHelperForIpvx::EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv4> ipv4, uint32_t interface)
735
{
735
{
736
  EnableAsciiIpv4Internal (stream, std::string (), ipv4, interface, false);
736
  EnableAsciiIpv4Internal (stream, std::string (), ipv4, interface, false);
737
}
737
}
 Lines 740-746    Link Here 
740
// Public API
740
// Public API
741
//
741
//
742
void 
742
void 
743
AsciiTraceHelperForIpv4::EnableAsciiIpv4 (
743
TraceHelperForIpvx::EnableAsciiIpv4 (
744
  std::string prefix, 
744
  std::string prefix, 
745
  std::string ipv4Name, 
745
  std::string ipv4Name, 
746
  uint32_t interface,
746
  uint32_t interface,
 Lines 753-759    Link Here 
753
// Public API
753
// Public API
754
//
754
//
755
void 
755
void 
756
AsciiTraceHelperForIpv4::EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, std::string ipv4Name, uint32_t interface)
756
TraceHelperForIpvx::EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, std::string ipv4Name, uint32_t interface)
757
{
757
{
758
  EnableAsciiIpv4Impl (stream, std::string (), ipv4Name, interface, false);
758
  EnableAsciiIpv4Impl (stream, std::string (), ipv4Name, interface, false);
759
}
759
}
 Lines 762-768    Link Here 
762
// Private API
762
// Private API
763
//
763
//
764
void 
764
void 
765
AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl (
765
TraceHelperForIpvx::EnableAsciiIpv4Impl (
766
  Ptr<OutputStreamWrapper> stream, 
766
  Ptr<OutputStreamWrapper> stream, 
767
  std::string prefix, 
767
  std::string prefix, 
768
  std::string ipv4Name, 
768
  std::string ipv4Name, 
 Lines 777-783    Link Here 
777
// Public API
777
// Public API
778
//
778
//
779
void 
779
void 
780
AsciiTraceHelperForIpv4::EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c)
780
TraceHelperForIpvx::EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c)
781
{
781
{
782
  EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> (), prefix, c);
782
  EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> (), prefix, c);
783
}
783
}
 Lines 786-792    Link Here 
786
// Public API
786
// Public API
787
//
787
//
788
void 
788
void 
789
AsciiTraceHelperForIpv4::EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ipv4InterfaceContainer c)
789
TraceHelperForIpvx::EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ipv4InterfaceContainer c)
790
{
790
{
791
  EnableAsciiIpv4Impl (stream, std::string (), c);
791
  EnableAsciiIpv4Impl (stream, std::string (), c);
792
}
792
}
 Lines 795-801    Link Here 
795
// Private API
795
// Private API
796
//
796
//
797
void 
797
void 
798
AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv4InterfaceContainer c)
798
TraceHelperForIpvx::EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv4InterfaceContainer c)
799
{
799
{
800
  for (Ipv4InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
800
  for (Ipv4InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
801
    {
801
    {
 Lines 808-814    Link Here 
808
// Public API
808
// Public API
809
//
809
//
810
void
810
void
811
AsciiTraceHelperForIpv4::EnableAsciiIpv4 (std::string prefix, NodeContainer n)
811
TraceHelperForIpvx::EnableAsciiIpv4 (std::string prefix, NodeContainer n)
812
{
812
{
813
  EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> (), prefix, n);
813
  EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> (), prefix, n);
814
}
814
}
 Lines 817-823    Link Here 
817
// Public API
817
// Public API
818
//
818
//
819
void
819
void
820
AsciiTraceHelperForIpv4::EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, NodeContainer n)
820
TraceHelperForIpvx::EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, NodeContainer n)
821
{
821
{
822
  EnableAsciiIpv4Impl (stream, std::string (), n);
822
  EnableAsciiIpv4Impl (stream, std::string (), n);
823
}
823
}
 Lines 826-832    Link Here 
826
// Private API
826
// Private API
827
//
827
//
828
void
828
void
829
AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n)
829
TraceHelperForIpvx::EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n)
830
{
830
{
831
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
831
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
832
    {
832
    {
 Lines 846-852    Link Here 
846
// Public API
846
// Public API
847
//
847
//
848
void
848
void
849
AsciiTraceHelperForIpv4::EnableAsciiIpv4All (std::string prefix)
849
TraceHelperForIpvx::EnableAsciiIpv4All (std::string prefix)
850
{
850
{
851
  EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> (), prefix, NodeContainer::GetGlobal ());
851
  EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> (), prefix, NodeContainer::GetGlobal ());
852
}
852
}
 Lines 855-861    Link Here 
855
// Public API
855
// Public API
856
//
856
//
857
void
857
void
858
AsciiTraceHelperForIpv4::EnableAsciiIpv4All (Ptr<OutputStreamWrapper> stream)
858
TraceHelperForIpvx::EnableAsciiIpv4All (Ptr<OutputStreamWrapper> stream)
859
{
859
{
860
  EnableAsciiIpv4Impl (stream, std::string (), NodeContainer::GetGlobal ());
860
  EnableAsciiIpv4Impl (stream, std::string (), NodeContainer::GetGlobal ());
861
}
861
}
 Lines 864-870    Link Here 
864
// Public API
864
// Public API
865
//
865
//
866
void 
866
void 
867
AsciiTraceHelperForIpv4::EnableAsciiIpv4 (
867
TraceHelperForIpvx::EnableAsciiIpv4 (
868
  Ptr<OutputStreamWrapper> stream, 
868
  Ptr<OutputStreamWrapper> stream, 
869
  uint32_t nodeid, 
869
  uint32_t nodeid, 
870
  uint32_t interface,
870
  uint32_t interface,
 Lines 877-883    Link Here 
877
// Public API
877
// Public API
878
//
878
//
879
void 
879
void 
880
AsciiTraceHelperForIpv4::EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
880
TraceHelperForIpvx::EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
881
{
881
{
882
  EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> (), prefix, nodeid, interface, explicitFilename);
882
  EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> (), prefix, nodeid, interface, explicitFilename);
883
}
883
}
 Lines 886-892    Link Here 
886
// Private API
886
// Private API
887
//
887
//
888
void 
888
void 
889
AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl (
889
TraceHelperForIpvx::EnableAsciiIpv4Impl (
890
  Ptr<OutputStreamWrapper> stream, 
890
  Ptr<OutputStreamWrapper> stream, 
891
  std::string prefix, 
891
  std::string prefix, 
892
  uint32_t nodeid, 
892
  uint32_t nodeid, 
 Lines 914-933    Link Here 
914
}
914
}
915
915
916
void 
916
void 
917
PcapHelperForIpv6::EnablePcapIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename)
917
TraceHelperForIpvx::EnablePcapIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename)
918
{
918
{
919
  EnablePcapIpv6Internal (prefix, ipv6, interface, explicitFilename);
919
  EnablePcapIpv6Internal (prefix, ipv6, interface, explicitFilename);
920
}
920
}
921
921
922
void 
922
void 
923
PcapHelperForIpv6::EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename)
923
TraceHelperForIpvx::EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename)
924
{
924
{
925
  Ptr<Ipv6> ipv6 = Names::Find<Ipv6> (ipv6Name);
925
  Ptr<Ipv6> ipv6 = Names::Find<Ipv6> (ipv6Name);
926
  EnablePcapIpv6 (prefix, ipv6, interface, explicitFilename);
926
  EnablePcapIpv6 (prefix, ipv6, interface, explicitFilename);
927
}
927
}
928
928
929
void 
929
void 
930
PcapHelperForIpv6::EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c)
930
TraceHelperForIpvx::EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c)
931
{
931
{
932
  for (Ipv6InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
932
  for (Ipv6InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
933
    {
933
    {
 Lines 937-943    Link Here 
937
}
937
}
938
938
939
void
939
void
940
PcapHelperForIpv6::EnablePcapIpv6 (std::string prefix, NodeContainer n)
940
TraceHelperForIpvx::EnablePcapIpv6 (std::string prefix, NodeContainer n)
941
{
941
{
942
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
942
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
943
    {
943
    {
 Lines 954-966    Link Here 
954
}
954
}
955
955
956
void
956
void
957
PcapHelperForIpv6::EnablePcapIpv6All (std::string prefix)
957
TraceHelperForIpvx::EnablePcapIpv6All (std::string prefix)
958
{
958
{
959
  EnablePcapIpv6 (prefix, NodeContainer::GetGlobal ());
959
  EnablePcapIpv6 (prefix, NodeContainer::GetGlobal ());
960
}
960
}
961
961
962
void 
962
void 
963
PcapHelperForIpv6::EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
963
TraceHelperForIpvx::EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
964
{
964
{
965
  NodeContainer n = NodeContainer::GetGlobal ();
965
  NodeContainer n = NodeContainer::GetGlobal ();
966
966
 Lines 985-991    Link Here 
985
// Public API
985
// Public API
986
//
986
//
987
void 
987
void 
988
AsciiTraceHelperForIpv6::EnableAsciiIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename)
988
TraceHelperForIpvx::EnableAsciiIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename)
989
{
989
{
990
  EnableAsciiIpv6Internal (Ptr<OutputStreamWrapper> (), prefix, ipv6, interface, explicitFilename);
990
  EnableAsciiIpv6Internal (Ptr<OutputStreamWrapper> (), prefix, ipv6, interface, explicitFilename);
991
}
991
}
 Lines 994-1000    Link Here 
994
// Public API
994
// Public API
995
//
995
//
996
void 
996
void 
997
AsciiTraceHelperForIpv6::EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv6> ipv6, uint32_t interface)
997
TraceHelperForIpvx::EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv6> ipv6, uint32_t interface)
998
{
998
{
999
  EnableAsciiIpv6Internal (stream, std::string (), ipv6, interface, false);
999
  EnableAsciiIpv6Internal (stream, std::string (), ipv6, interface, false);
1000
}
1000
}
 Lines 1003-1009    Link Here 
1003
// Public API
1003
// Public API
1004
//
1004
//
1005
void 
1005
void 
1006
AsciiTraceHelperForIpv6::EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename)
1006
TraceHelperForIpvx::EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename)
1007
{
1007
{
1008
  EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> (), prefix, ipv6Name, interface, explicitFilename);
1008
  EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> (), prefix, ipv6Name, interface, explicitFilename);
1009
}
1009
}
 Lines 1012-1018    Link Here 
1012
// Public API
1012
// Public API
1013
//
1013
//
1014
void 
1014
void 
1015
AsciiTraceHelperForIpv6::EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, std::string ipv6Name, uint32_t interface)
1015
TraceHelperForIpvx::EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, std::string ipv6Name, uint32_t interface)
1016
{
1016
{
1017
  EnableAsciiIpv6Impl (stream, std::string (), ipv6Name, interface, false);
1017
  EnableAsciiIpv6Impl (stream, std::string (), ipv6Name, interface, false);
1018
}
1018
}
 Lines 1021-1027    Link Here 
1021
// Private API
1021
// Private API
1022
//
1022
//
1023
void 
1023
void 
1024
AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl (
1024
TraceHelperForIpvx::EnableAsciiIpv6Impl (
1025
  Ptr<OutputStreamWrapper> stream, 
1025
  Ptr<OutputStreamWrapper> stream, 
1026
  std::string prefix, 
1026
  std::string prefix, 
1027
  std::string ipv6Name, 
1027
  std::string ipv6Name, 
 Lines 1036-1042    Link Here 
1036
// Public API
1036
// Public API
1037
//
1037
//
1038
void 
1038
void 
1039
AsciiTraceHelperForIpv6::EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c)
1039
TraceHelperForIpvx::EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c)
1040
{
1040
{
1041
  EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> (), prefix, c);
1041
  EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> (), prefix, c);
1042
}
1042
}
 Lines 1045-1051    Link Here 
1045
// Public API
1045
// Public API
1046
//
1046
//
1047
void 
1047
void 
1048
AsciiTraceHelperForIpv6::EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ipv6InterfaceContainer c)
1048
TraceHelperForIpvx::EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ipv6InterfaceContainer c)
1049
{
1049
{
1050
  EnableAsciiIpv6Impl (stream, std::string (), c);
1050
  EnableAsciiIpv6Impl (stream, std::string (), c);
1051
}
1051
}
 Lines 1054-1060    Link Here 
1054
// Private API
1054
// Private API
1055
//
1055
//
1056
void 
1056
void 
1057
AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv6InterfaceContainer c)
1057
TraceHelperForIpvx::EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv6InterfaceContainer c)
1058
{
1058
{
1059
  for (Ipv6InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
1059
  for (Ipv6InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
1060
    {
1060
    {
 Lines 1067-1073    Link Here 
1067
// Public API
1067
// Public API
1068
//
1068
//
1069
void
1069
void
1070
AsciiTraceHelperForIpv6::EnableAsciiIpv6 (std::string prefix, NodeContainer n)
1070
TraceHelperForIpvx::EnableAsciiIpv6 (std::string prefix, NodeContainer n)
1071
{
1071
{
1072
  EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> (), prefix, n);
1072
  EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> (), prefix, n);
1073
}
1073
}
 Lines 1076-1082    Link Here 
1076
// Public API
1076
// Public API
1077
//
1077
//
1078
void
1078
void
1079
AsciiTraceHelperForIpv6::EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, NodeContainer n)
1079
TraceHelperForIpvx::EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, NodeContainer n)
1080
{
1080
{
1081
  EnableAsciiIpv6Impl (stream, std::string (), n);
1081
  EnableAsciiIpv6Impl (stream, std::string (), n);
1082
}
1082
}
 Lines 1085-1091    Link Here 
1085
// Private API
1085
// Private API
1086
//
1086
//
1087
void
1087
void
1088
AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n)
1088
TraceHelperForIpvx::EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n)
1089
{
1089
{
1090
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
1090
  for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
1091
    {
1091
    {
 Lines 1105-1111    Link Here 
1105
// Public API
1105
// Public API
1106
//
1106
//
1107
void
1107
void
1108
AsciiTraceHelperForIpv6::EnableAsciiIpv6All (std::string prefix)
1108
TraceHelperForIpvx::EnableAsciiIpv6All (std::string prefix)
1109
{
1109
{
1110
  EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> (), prefix, NodeContainer::GetGlobal ());
1110
  EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> (), prefix, NodeContainer::GetGlobal ());
1111
}
1111
}
 Lines 1114-1120    Link Here 
1114
// Public API
1114
// Public API
1115
//
1115
//
1116
void
1116
void
1117
AsciiTraceHelperForIpv6::EnableAsciiIpv6All (Ptr<OutputStreamWrapper> stream)
1117
TraceHelperForIpvx::EnableAsciiIpv6All (Ptr<OutputStreamWrapper> stream)
1118
{
1118
{
1119
  EnableAsciiIpv6Impl (stream, std::string (), NodeContainer::GetGlobal ());
1119
  EnableAsciiIpv6Impl (stream, std::string (), NodeContainer::GetGlobal ());
1120
}
1120
}
 Lines 1123-1129    Link Here 
1123
// Public API
1123
// Public API
1124
//
1124
//
1125
void 
1125
void 
1126
AsciiTraceHelperForIpv6::EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface)
1126
TraceHelperForIpvx::EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface)
1127
{
1127
{
1128
  EnableAsciiIpv6Impl (stream, std::string (), nodeid, interface, false);
1128
  EnableAsciiIpv6Impl (stream, std::string (), nodeid, interface, false);
1129
}
1129
}
 Lines 1132-1138    Link Here 
1132
// Public API
1132
// Public API
1133
//
1133
//
1134
void 
1134
void 
1135
AsciiTraceHelperForIpv6::EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
1135
TraceHelperForIpvx::EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
1136
{
1136
{
1137
  EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> (), prefix, nodeid, interface, explicitFilename);
1137
  EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> (), prefix, nodeid, interface, explicitFilename);
1138
}
1138
}
 Lines 1141-1147    Link Here 
1141
// Private API
1141
// Private API
1142
//
1142
//
1143
void 
1143
void 
1144
AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl (
1144
TraceHelperForIpvx::EnableAsciiIpv6Impl (
1145
  Ptr<OutputStreamWrapper> stream, 
1145
  Ptr<OutputStreamWrapper> stream, 
1146
  std::string prefix, 
1146
  std::string prefix, 
1147
  uint32_t nodeid, 
1147
  uint32_t nodeid, 
(-)a/src/helper/trace-helper.h (-189 / +118 lines)
 Lines 321-341    Link Here 
321
}
321
}
322
322
323
/**
323
/**
324
 * \brief Base class providing common user-level pcap operations for helpers
324
 * \brief Base class providing common user-level pcap and ascii operations for helpers
325
 * representing net devices.
325
 * representing net devices.
326
 */
326
 */
327
class PcapHelperForDevice
327
class TraceHelperForDevice
328
{
328
{
329
public:
329
public:
330
  /**
330
  /**
331
   * @brief Construct a PcapHelperForDevice
331
   * @brief Construct a PcapHelperForDevice
332
   */
332
   */
333
  PcapHelperForDevice () {}
333
  TraceHelperForDevice () {}
334
334
335
  /**
335
  /**
336
   * @brief Destroy a PcapHelperForDevice
336
   * @brief Destroy a PcapHelperForDevice
337
   */
337
   */
338
  virtual ~PcapHelperForDevice () {}
338
  virtual ~TraceHelperForDevice () {}
339
339
340
  /**
340
  /**
341
   * @brief Enable pcap output the indicated net device.
341
   * @brief Enable pcap output the indicated net device.
 Lines 408-431    Link Here 
408
   * @param promiscuous If true capture all possible packets available at the device.
408
   * @param promiscuous If true capture all possible packets available at the device.
409
   */
409
   */
410
  void EnablePcapAll (std::string prefix, bool promiscuous = false);
410
  void EnablePcapAll (std::string prefix, bool promiscuous = false);
411
};
412
413
/**
414
 * \brief Base class providing common user-level ascii trace operations for helpers
415
 * representing net devices.
416
 */
417
class AsciiTraceHelperForDevice
418
{
419
public:
420
  /**
421
   * @brief Construct an AsciiTraceHelperForDevice.
422
   */
423
  AsciiTraceHelperForDevice () {}
424
425
  /**
426
   * @brief Destroy an AsciiTraceHelperForDevice.
427
   */
428
  virtual ~AsciiTraceHelperForDevice () {}
429
411
430
  /**
412
  /**
431
   * @brief Enable ascii trace output on the indicated net device.
413
   * @brief Enable ascii trace output on the indicated net device.
 Lines 604-627    Link Here 
604
   * @internal Avoid code duplication.
586
   * @internal Avoid code duplication.
605
   */
587
   */
606
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ptr<NetDevice> nd, bool explicitFilename);
588
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ptr<NetDevice> nd, bool explicitFilename);
589
607
};
590
};
608
591
609
/**
592
/**
610
 * @brief Base class providing common user-level pcap operations for helpers
593
 * @brief Base class providing common user-level pcap and ascii operations for helpers
611
 * representing IPv4 protocols .
594
 * representing IPv4 and IPv6 protocols .
612
 */
595
 */
613
class PcapHelperForIpv4
596
class TraceHelperForIpvx
614
{
597
{
615
public:
598
public:
616
  /**
599
  /**
617
   * @brief Construct a PcapHelperForIpv4.
600
   * @brief Construct a TraceHelperForIpv4.
618
   */
601
   */
619
  PcapHelperForIpv4 () {}
602
  TraceHelperForIpvx () {}
620
603
621
  /**
604
  /**
622
   * @brief Destroy a PcapHelperForIpv4.
605
   * @brief Destroy a TraceHelperForIpv4.
623
   */
606
   */
624
  virtual ~PcapHelperForIpv4 () {}
607
  virtual ~TraceHelperForIpvx () {}
625
608
626
  /**
609
  /**
627
   * @brief Enable pcap output the indicated Ipv4 and interface pair.
610
   * @brief Enable pcap output the indicated Ipv4 and interface pair.
 Lines 696-719    Link Here 
696
   */
679
   */
697
  void EnablePcapIpv4All (std::string prefix);
680
  void EnablePcapIpv4All (std::string prefix);
698
681
699
};
700
701
/**
702
 * @brief Base class providing common user-level ascii trace operations for 
703
 * helpers representing IPv4 protocols .
704
 */
705
class AsciiTraceHelperForIpv4
706
{
707
public:
708
  /**
682
  /**
709
   * @brief Construct an AsciiTraceHelperForIpv4.
683
   * @brief Enable pcap output the indicated Ipv6 and interface pair.
684
   * @internal
685
   *
686
   * @param prefix Filename prefix to use for pcap files.
687
   * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
688
   * @param interface Interface on ipv6 on which you want to enable tracing.
689
   * @param explicitFilename Treat the prefix as an explicit filename if true.
710
   */
690
   */
711
  AsciiTraceHelperForIpv4 () {}
691
  virtual void EnablePcapIpv6Internal (std::string prefix, 
692
                                       Ptr<Ipv6> ipv6, 
693
                                       uint32_t interface,
694
                                       bool explicitFilename) = 0;
712
695
713
  /**
696
  /**
714
   * @brief Destroy an AsciiTraceHelperForIpv4
697
   * @brief Enable pcap output the indicated Ipv6 and interface pair.
698
   *
699
   * @param prefix Filename prefix to use for pcap files.
700
   * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
701
   * @param interface Interface on ipv6 on which you want to enable tracing.
702
   * @param explicitFilename Treat the prefix as an explicit filename if true.
715
   */
703
   */
716
  virtual ~AsciiTraceHelperForIpv4 () {}
704
  void EnablePcapIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
705
706
  /**
707
   * @brief Enable pcap output the indicated Ipv6 and interface pair using a
708
   * Ptr<Ipv6> previously named using the ns-3 object name service.
709
   *
710
   * @param prefix filename prefix to use for pcap files.
711
   * @param ipv6Name Name of the Ptr<Ipv6> on which you want to enable tracing.
712
   * @param interface Interface on ipv6 on which you want to enable tracing.
713
   * @param explicitFilename Treat the prefix as an explicit filename if true.
714
   */
715
  void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
716
717
  /**
718
   * @brief Enable pcap output on each Ipv6 and interface pair in the container.
719
   *
720
   * @param prefix Filename prefix to use for pcap files.
721
   * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs
722
   */
723
  void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c);
724
725
  /**
726
   * @brief Enable pcap output on all Ipv6 and interface pairs existing in the
727
   * nodes provided in the container.
728
   *
729
   * \param prefix Filename prefix to use for pcap files.
730
   * \param n container of nodes.
731
   */
732
  void EnablePcapIpv6 (std::string prefix, NodeContainer n);
733
734
  /**
735
   * @brief Enable pcap output on the Ipv6 and interface pair specified by a 
736
   * global node-id (of a previously created node) and interface.  Since there
737
   * can be only one Ipv6 aggregated to a node, the node-id unambiguously 
738
   * determines the Ipv6.
739
   *
740
   * @param prefix Filename prefix to use for pcap files.
741
   * @param nodeid The node identifier/number of the node on which to enable tracing.
742
   * @param interface Interface on ipv6 on which you want to enable tracing.
743
   * @param explicitFilename Treat the prefix as an explicit filename if true
744
   */
745
  void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
746
747
  /**
748
   * @brief Enable pcap output on all Ipv6 and interface pairs existing in the 
749
   * set of all nodes created in the simulation.
750
   *
751
   * @param prefix Filename prefix to use for pcap files.
752
   */
753
  void EnablePcapIpv6All (std::string prefix);
717
754
718
  /**
755
  /**
719
   * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
756
   * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
 Lines 875-1027    Link Here 
875
   */
912
   */
876
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface, bool explicitFilename);
913
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface, bool explicitFilename);
877
914
878
private:
879
  /**
880
   * @internal Avoid code duplication.
881
   */
882
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
883
                            std::string prefix, 
884
                            uint32_t nodeid, 
885
                            uint32_t interface,
886
                            bool explicitFilename);
887
888
  /**
889
   * @internal Avoid code duplication.
890
   */
891
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
892
893
  /**
894
   * @internal Avoid code duplication.
895
   */
896
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv4InterfaceContainer c);
897
898
  /**
899
   * @internal Avoid code duplication.
900
   */
901
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
902
                            std::string prefix, 
903
                            std::string ipv4Name, 
904
                            uint32_t interface,
905
                            bool explicitFilename);
906
907
  /**
908
   * @internal Avoid code duplication.
909
   */
910
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
911
                            std::string prefix, 
912
                            Ptr<Ipv4> ipv4, 
913
                            uint32_t interface,
914
                            bool explicitFilename);
915
};
916
917
/**
918
 * @brief Base class providing common user-level pcap operations for helpers
919
 * representing IPv6 protocols .
920
 */
921
class PcapHelperForIpv6
922
{
923
public:
924
  /**
925
   * @brief Construct a PcapHelperForIpv6.
926
   */
927
  PcapHelperForIpv6 () {}
928
929
  /**
930
   * @brief Destroy a PcapHelperForIpv6
931
   */
932
  virtual ~PcapHelperForIpv6 () {}
933
934
  /**
935
   * @brief Enable pcap output the indicated Ipv6 and interface pair.
936
   * @internal
937
   *
938
   * @param prefix Filename prefix to use for pcap files.
939
   * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
940
   * @param interface Interface on ipv6 on which you want to enable tracing.
941
   * @param explicitFilename Treat the prefix as an explicit filename if true.
942
   */
943
  virtual void EnablePcapIpv6Internal (std::string prefix, 
944
                                       Ptr<Ipv6> ipv6, 
945
                                       uint32_t interface,
946
                                       bool explicitFilename) = 0;
947
948
  /**
949
   * @brief Enable pcap output the indicated Ipv6 and interface pair.
950
   *
951
   * @param prefix Filename prefix to use for pcap files.
952
   * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
953
   * @param interface Interface on ipv6 on which you want to enable tracing.
954
   * @param explicitFilename Treat the prefix as an explicit filename if true.
955
   */
956
  void EnablePcapIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
957
958
  /**
959
   * @brief Enable pcap output the indicated Ipv6 and interface pair using a
960
   * Ptr<Ipv6> previously named using the ns-3 object name service.
961
   *
962
   * @param prefix filename prefix to use for pcap files.
963
   * @param ipv6Name Name of the Ptr<Ipv6> on which you want to enable tracing.
964
   * @param interface Interface on ipv6 on which you want to enable tracing.
965
   * @param explicitFilename Treat the prefix as an explicit filename if true.
966
   */
967
  void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
968
969
  /**
970
   * @brief Enable pcap output on each Ipv6 and interface pair in the container.
971
   *
972
   * @param prefix Filename prefix to use for pcap files.
973
   * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs
974
   */
975
  void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c);
976
977
  /**
978
   * @brief Enable pcap output on all Ipv6 and interface pairs existing in the
979
   * nodes provided in the container.
980
   *
981
   * \param prefix Filename prefix to use for pcap files.
982
   * \param n container of nodes.
983
   */
984
  void EnablePcapIpv6 (std::string prefix, NodeContainer n);
985
986
  /**
987
   * @brief Enable pcap output on the Ipv6 and interface pair specified by a 
988
   * global node-id (of a previously created node) and interface.  Since there
989
   * can be only one Ipv6 aggregated to a node, the node-id unambiguously 
990
   * determines the Ipv6.
991
   *
992
   * @param prefix Filename prefix to use for pcap files.
993
   * @param nodeid The node identifier/number of the node on which to enable tracing.
994
   * @param interface Interface on ipv6 on which you want to enable tracing.
995
   * @param explicitFilename Treat the prefix as an explicit filename if true
996
   */
997
  void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
998
999
  /**
1000
   * @brief Enable pcap output on all Ipv6 and interface pairs existing in the 
1001
   * set of all nodes created in the simulation.
1002
   *
1003
   * @param prefix Filename prefix to use for pcap files.
1004
   */
1005
  void EnablePcapIpv6All (std::string prefix);
1006
};
1007
1008
/**
1009
 * @brief Base class providing common user-level ascii trace operations for
1010
 * helpers representing IPv6 protocols .
1011
 */
1012
class AsciiTraceHelperForIpv6
1013
{
1014
public:
1015
  /**
1016
   * @brief Construct an AsciiTraceHelperForIpv6.
1017
   */
1018
  AsciiTraceHelperForIpv6 () {}
1019
1020
  /**
1021
   * @brief Destroy an AsciiTraceHelperForIpv6
1022
   */
1023
  virtual ~AsciiTraceHelperForIpv6 () {}
1024
1025
  /**
915
  /**
1026
   * @brief Enable ascii trace output on the indicated Ipv6 and interface pair.
916
   * @brief Enable ascii trace output on the indicated Ipv6 and interface pair.
1027
   * @internal
917
   * @internal
 Lines 1185-1190    Link Here 
1185
  /**
1075
  /**
1186
   * @internal Avoid code duplication.
1076
   * @internal Avoid code duplication.
1187
   */
1077
   */
1078
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
1079
                            std::string prefix, 
1080
                            uint32_t nodeid, 
1081
                            uint32_t interface,
1082
                            bool explicitFilename);
1083
1084
  /**
1085
   * @internal Avoid code duplication.
1086
   */
1087
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
1088
1089
  /**
1090
   * @internal Avoid code duplication.
1091
   */
1092
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv4InterfaceContainer c);
1093
1094
  /**
1095
   * @internal Avoid code duplication.
1096
   */
1097
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
1098
                            std::string prefix, 
1099
                            std::string ipv4Name, 
1100
                            uint32_t interface,
1101
                            bool explicitFilename);
1102
1103
  /**
1104
   * @internal Avoid code duplication.
1105
   */
1106
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
1107
                            std::string prefix, 
1108
                            Ptr<Ipv4> ipv4, 
1109
                            uint32_t interface,
1110
                            bool explicitFilename);
1111
1112
  /**
1113
   * @internal Avoid code duplication.
1114
   */
1188
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, 
1115
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, 
1189
                            std::string prefix, 
1116
                            std::string prefix, 
1190
                            uint32_t nodeid, 
1117
                            uint32_t nodeid, 
 Lines 1220-1225    Link Here 
1220
                            bool explicitFilename);
1147
                            bool explicitFilename);
1221
};
1148
};
1222
1149
1150
1151
1223
} // namespace ns3
1152
} // namespace ns3
1224
1153
1225
#endif /* TRACE_HELPER_H */
1154
#endif /* TRACE_HELPER_H */
(-)a/src/helper/wifi-helper.h (-1 / +1 lines)
 Lines 43-49    Link Here 
43
 * This base class must be implemented by new PHY implementation which wish to integrate
43
 * This base class must be implemented by new PHY implementation which wish to integrate
44
 * with the \ref ns3::WifiHelper class.
44
 * with the \ref ns3::WifiHelper class.
45
 */
45
 */
46
class WifiPhyHelper
46
class WifiPhyHelper : public TraceHelperForDevice
47
{
47
{
48
public:
48
public:
49
  virtual ~WifiPhyHelper ();
49
  virtual ~WifiPhyHelper ();
(-)a/src/helper/wimax-helper.h (-1 / +1 lines)
 Lines 49-55    Link Here 
49
/**
49
/**
50
 * \brief build a set of WimaxNetDevice objects
50
 * \brief build a set of WimaxNetDevice objects
51
 */
51
 */
52
class WimaxHelper :public PcapHelperForDevice, public AsciiTraceHelperForDevice
52
class WimaxHelper : public TraceHelperForDevice
53
{
53
{
54
public:
54
public:
55
  /**
55
  /**
(-)a/src/helper/yans-wifi-helper.h (-2 / +1 lines)
 Lines 136-143    Link Here 
136
 * in this class correspond to PHY-level traces and come to us via WifiPhyHelper
136
 * in this class correspond to PHY-level traces and come to us via WifiPhyHelper
137
 *
137
 *
138
 */
138
 */
139
class YansWifiPhyHelper : public WifiPhyHelper,
139
class YansWifiPhyHelper : public WifiPhyHelper
140
                          public PcapHelperForDevice, public AsciiTraceHelperForDevice
141
{
140
{
142
public:
141
public:
143
  /**
142
  /**

Return to bug 877