458 * when writing trace data. |
460 * when writing trace data. |
459 * @param prefix Filename prefix to use for ascii trace files. |
461 * @param prefix Filename prefix to use for ascii trace files. |
460 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing. |
462 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing. |
461 * @param interface The interface on which you want to enable tracing. |
463 * @param interface The interface on which you want to enable tracing. |
462 */ |
464 */ |
463 virtual void EnableAsciiInternal (Ptr<OutputStreamObject> stream, std::string prefix, |
465 virtual void EnableAsciiIpv4Internal (Ptr<OutputStreamObject> stream, std::string prefix, |
464 Ptr<Ipv4> ipv4, uint32_t interface) = 0; |
466 Ptr<Ipv4> ipv4, uint32_t interface) = 0; |
465 |
467 |
466 /** |
468 /** |
467 * @brief Enable ascii trace output on the indicated Ipv4 and interface pair. |
469 * @brief Enable ascii trace output on the indicated Ipv4 and interface pair. |
468 * |
470 * |
469 * @param prefix Filename prefix to use for ascii files. |
471 * @param prefix Filename prefix to use for ascii files. |
470 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing. |
472 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing. |
471 * @param interface The interface on which you want to enable tracing. |
473 * @param interface The interface on which you want to enable tracing. |
472 */ |
474 */ |
473 void EnableAscii (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface); |
475 void EnableAsciiIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface); |
474 |
476 |
475 /** |
477 /** |
476 * @brief Enable ascii trace output on the indicated Ipv4 and interface pair. |
478 * @brief Enable ascii trace output on the indicated Ipv4 and interface pair. |
477 * |
479 * |
478 * @param stream An OutputStreamObject representing an existing file to use |
480 * @param stream An OutputStreamObject representing an existing file to use |
479 * when writing trace data. |
481 * when writing trace data. |
480 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing. |
482 * @param ipv4 Ptr<Ipv4> on which you want to enable tracing. |
481 * @param interface The interface on which you want to enable tracing. |
483 * @param interface The interface on which you want to enable tracing. |
482 */ |
484 */ |
483 void EnableAscii (Ptr<OutputStreamObject> stream, Ptr<Ipv4> ipv4, uint32_t interface); |
485 void EnableAsciiIpv4 (Ptr<OutputStreamObject> stream, Ptr<Ipv4> ipv4, uint32_t interface); |
484 |
486 |
485 /** |
487 /** |
486 * @brief Enable ascii trace output the indicated Ipv4 and interface pair |
488 * @brief Enable ascii trace output the indicated Ipv4 and interface pair |
487 * using an Ipv4 previously named using the ns-3 object name service. |
489 * using an Ipv4 previously named using the ns-3 object name service. |
488 * |
490 * |
489 * @param filename filename prefix to use for ascii files. |
491 * @param filename filename prefix to use for ascii files. |
490 * @param ipv4Name The name of the Ipv4 on which you want to enable tracing. |
492 * @param ipv4Name The name of the Ipv4 on which you want to enable tracing. |
491 * @param interface The interface on which you want to enable tracing. |
493 * @param interface The interface on which you want to enable tracing. |
492 */ |
494 */ |
493 void EnableAscii (std::string prefix, std::string ipv4Name, uint32_t interface); |
495 void EnableAsciiIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface); |
494 |
496 |
495 /** |
497 /** |
496 * @brief Enable ascii trace output the indicated net device using a device |
498 * @brief Enable ascii trace output the indicated net device using a device |
497 * previously named using the ns-3 object name service. |
499 * previously named using the ns-3 object name service. |
498 * |
500 * |
499 * @param stream An OutputStreamObject representing an existing file to use |
501 * @param stream An OutputStreamObject representing an existing file to use |
500 * when writing trace data. |
502 * when writing trace data. |
501 * @param ipv4Name The name of the Ipv4 on which you want to enable tracing. |
503 * @param ipv4Name The name of the Ipv4 on which you want to enable tracing. |
502 * @param interface The interface on which you want to enable tracing. |
504 * @param interface The interface on which you want to enable tracing. |
503 */ |
505 */ |
504 void EnableAscii (Ptr<OutputStreamObject> stream, std::string ipv4Name, uint32_t interface); |
506 void EnableAsciiIpv4 (Ptr<OutputStreamObject> stream, std::string ipv4Name, uint32_t interface); |
505 |
507 |
506 /** |
508 /** |
507 * @brief Enable ascii trace output on each Ipv4 and interface pair in the |
509 * @brief Enable ascii trace output on each Ipv4 and interface pair in the |
508 * container |
510 * container |
509 * |
511 * |
510 * @param prefix Filename prefix to use for ascii files. |
512 * @param prefix Filename prefix to use for ascii files. |
511 * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs on which to |
513 * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs on which to |
512 * enable tracing. |
514 * enable tracing. |
513 */ |
515 */ |
514 void EnableAscii (std::string prefix, Ipv4InterfaceContainer c); |
516 void EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c); |
515 |
517 |
516 /** |
518 /** |
517 * @brief Enable ascii trace output on each device in the container which is |
519 * @brief Enable ascii trace output on each device in the container which is |
518 * of the appropriate type. |
520 * of the appropriate type. |
519 * |
521 * |
520 * @param stream An OutputStreamObject representing an existing file to use |
522 * @param stream An OutputStreamObject representing an existing file to use |
521 * when writing trace data. |
523 * when writing trace data. |
522 * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs on which to |
524 * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs on which to |
523 * enable tracing. |
525 * enable tracing. |
524 */ |
526 */ |
525 void EnableAscii (Ptr<OutputStreamObject> stream, Ipv4InterfaceContainer c); |
527 void EnableAsciiIpv4 (Ptr<OutputStreamObject> stream, Ipv4InterfaceContainer c); |
526 |
528 |
527 /** |
529 /** |
528 * @brief Enable ascii trace output on all Ipv4 and interface pairs existing |
530 * @brief Enable ascii trace output on all Ipv4 and interface pairs existing |
529 * in the nodes provided in the container. |
531 * in the nodes provided in the container. |
530 * |
532 * |
531 * \param prefix Filename prefix to use for ascii files. |
533 * \param prefix Filename prefix to use for ascii files. |
532 * \param n container of nodes. |
534 * \param n container of nodes. |
533 */ |
535 */ |
534 void EnableAscii (std::string prefix, NodeContainer n); |
536 void EnableAsciiIpv4 (std::string prefix, NodeContainer n); |
535 |
537 |
536 /** |
538 /** |
537 * @brief Enable ascii trace output on all Ipv4 and interface pairs existing |
539 * @brief Enable ascii trace output on all Ipv4 and interface pairs existing |
538 * in the nodes provided in the container. |
540 * in the nodes provided in the container. |
539 * |
541 * |
540 * @param stream An OutputStreamObject representing an existing file to use |
542 * @param stream An OutputStreamObject representing an existing file to use |
541 * when writing trace data. |
543 * when writing trace data. |
542 * \param n container of nodes. |
544 * \param n container of nodes. |
543 */ |
545 */ |
544 void EnableAscii (Ptr<OutputStreamObject> stream, NodeContainer n); |
546 void EnableAsciiIpv4 (Ptr<OutputStreamObject> stream, NodeContainer n); |
545 |
547 |
546 /** |
548 /** |
547 * @brief Enable ascii trace output on all Ipv4 and interface pairs existing |
549 * @brief Enable ascii trace output on all Ipv4 and interface pairs existing |
548 * in the set of all nodes created in the simulation. |
550 * in the set of all nodes created in the simulation. |
549 * |
551 * |
550 * @param prefix Filename prefix to use for ascii files. |
552 * @param prefix Filename prefix to use for ascii files. |
551 */ |
553 */ |
552 void EnableAsciiAll (std::string prefix); |
554 void EnableAsciiIpv4All (std::string prefix); |
553 |
555 |
554 /** |
556 /** |
555 * @brief Enable ascii trace output on each device (which is of the |
557 * @brief Enable ascii trace output on each device (which is of the |
556 * appropriate type) in the set of all nodes created in the simulation. |
558 * appropriate type) in the set of all nodes created in the simulation. |
557 * |
559 * |
558 * @param stream An OutputStreamObject representing an existing file to use |
560 * @param stream An OutputStreamObject representing an existing file to use |
559 * when writing trace data. |
561 * when writing trace data. |
560 */ |
562 */ |
561 void EnableAsciiAll (Ptr<OutputStreamObject> stream); |
563 void EnableAsciiIpv4All (Ptr<OutputStreamObject> stream); |
562 |
564 |
563 /** |
565 /** |
564 * @brief Enable pcap output on the Ipv4 and interface pair specified by a |
566 * @brief Enable pcap output on the Ipv4 and interface pair specified by a |
565 * global node-id (of a previously created node) and interface. Since there |
567 * global node-id (of a previously created node) and interface. Since there |
566 * can be only one Ipv4 aggregated to a node, the node-id unambiguously |
568 * can be only one Ipv4 aggregated to a node, the node-id unambiguously |
584 * when writing trace data. |
586 * when writing trace data. |
585 * @param nodeid The node identifier/number of the node on which to enable |
587 * @param nodeid The node identifier/number of the node on which to enable |
586 * ascii tracing |
588 * ascii tracing |
587 * @param interface The interface on which you want to enable tracing. |
589 * @param interface The interface on which you want to enable tracing. |
588 */ |
590 */ |
589 void EnableAscii (Ptr<OutputStreamObject> stream, uint32_t nodeid, uint32_t interface); |
591 void EnableAsciiIpv4 (Ptr<OutputStreamObject> stream, uint32_t nodeid, uint32_t interface); |
590 |
592 |
591 private: |
593 private: |
592 /** |
594 /** |
593 * @internal Avoid code duplication. |
595 * @internal Avoid code duplication. |
594 */ |
596 */ |
595 void EnableAsciiImpl (Ptr<OutputStreamObject> stream, std::string prefix, uint32_t nodeid, uint32_t interface); |
597 void EnableAsciiIpv4Impl (Ptr<OutputStreamObject> stream, std::string prefix, uint32_t nodeid, uint32_t interface); |
596 |
598 |
597 /** |
599 /** |
598 * @internal Avoid code duplication. |
600 * @internal Avoid code duplication. |
599 */ |
601 */ |
600 void EnableAsciiImpl (Ptr<OutputStreamObject> stream, std::string prefix, NodeContainer n); |
602 void EnableAsciiIpv4Impl (Ptr<OutputStreamObject> stream, std::string prefix, NodeContainer n); |
601 |
603 |
602 /** |
604 /** |
603 * @internal Avoid code duplication. |
605 * @internal Avoid code duplication. |
604 */ |
606 */ |
605 void EnableAsciiImpl (Ptr<OutputStreamObject> stream, std::string prefix, Ipv4InterfaceContainer c); |
607 void EnableAsciiIpv4Impl (Ptr<OutputStreamObject> stream, std::string prefix, Ipv4InterfaceContainer c); |
606 |
608 |
607 /** |
609 /** |
608 * @internal Avoid code duplication. |
610 * @internal Avoid code duplication. |
609 */ |
611 */ |
610 void EnableAsciiImpl (Ptr<OutputStreamObject> stream, std::string prefix, std::string ipv4Name, uint32_t interface); |
612 void EnableAsciiIpv4Impl (Ptr<OutputStreamObject> stream, std::string prefix, std::string ipv4Name, uint32_t interface); |
611 |
613 |
612 /** |
614 /** |
613 * @internal Avoid code duplication. |
615 * @internal Avoid code duplication. |
614 */ |
616 */ |
615 void EnableAsciiImpl (Ptr<OutputStreamObject> stream, std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface); |
617 void EnableAsciiIpv4Impl (Ptr<OutputStreamObject> stream, std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface); |
616 |
618 |
617 }; |
619 }; |
618 |
620 |
|
621 /** |
|
622 * @brief Base class providing common ascii trace operations for helpers |
|
623 * working with Ipv6 interfaces. |
|
624 * |
|
625 * There are two basic flavors of ascii tracing. The first kind will case a |
|
626 * trace file to be created for every traced device in the form |
|
627 * <file prefix>-<node number>-<device index>.tr just like the pcap trace |
|
628 * helpers would do. Additionally, if the object name service is used to |
|
629 * define either the node or device, the name will be substituted in the |
|
630 * file name. This form of ascii tracing does not include a context string |
|
631 * and makes it easier to determine the source of the event. |
|
632 * |
|
633 * The second kind of tracing is more like ns-2 tracing in that there is |
|
634 * one trace file into which all of the specified events of the specified |
|
635 * devices are written. This form of ascii tracing does include a context |
|
636 * string and interleaves the trace hits from all of the devices into a |
|
637 * single file. |
|
638 */ |
|
639 class AsciiTraceUserHelperForIpv6 |
|
640 { |
|
641 public: |
|
642 /** |
|
643 * @brief Enable ascii trace output on the indicated Ipv6 and interface pair. |
|
644 * @internal |
|
645 * |
|
646 * The implementation is expected to use a provided Ptr<OutputStreamObject> |
|
647 * if it is non-null. If the OutputStreamObject is null, the implementation |
|
648 * is expected to use a provided prefix to construct a new file name for |
|
649 * each net device using the rules described in the class overview. |
|
650 * |
|
651 * If the prefix is provided, there will be one file per Ipv6 and interface pair |
|
652 * created. In this case, adding a trace context to the file would be pointless, |
|
653 * so the helper implementation is expected to TraceConnectWithoutContext. |
|
654 * |
|
655 * If the output stream object is provided, there may be many different Ipv6 |
|
656 * and interface pairs writing to a single file. In this case, the trace |
|
657 * context could be important, so the helper implementation is expected to |
|
658 * TraceConnect. |
|
659 * |
|
660 * @param stream An OutputStreamObject representing an existing file to use |
|
661 * when writing trace data. |
|
662 * @param prefix Filename prefix to use for ascii trace files. |
|
663 * @param ipv6 Ptr<Ipv6> on which you want to enable tracing. |
|
664 * @param interface The interface on which you want to enable tracing. |
|
665 */ |
|
666 virtual void EnableAsciiIpv6Internal (Ptr<OutputStreamObject> stream, std::string prefix, |
|
667 Ptr<Ipv6> ipv6, uint32_t interface) = 0; |
|
668 |
|
669 /** |
|
670 * @brief Enable ascii trace output on the indicated Ipv6 and interface pair. |
|
671 * |
|
672 * @param prefix Filename prefix to use for ascii files. |
|
673 * @param ipv6 Ptr<Ipv6> on which you want to enable tracing. |
|
674 * @param interface The interface on which you want to enable tracing. |
|
675 */ |
|
676 void EnableAsciiIpv6 (std::string prefix, |
|
677 Ptr<Ipv6> ipv6, uint32_t interface); |
|
678 |
|
679 /** |
|
680 * @brief Enable ascii trace output on the indicated Ipv6 and interface pair. |
|
681 * |
|
682 * @param stream An OutputStreamObject representing an existing file to use |
|
683 * when writing trace data. |
|
684 * @param ipv6 Ptr<Ipv6> on which you want to enable tracing. |
|
685 * @param interface The interface on which you want to enable tracing. |
|
686 */ |
|
687 void EnableAsciiIpv6 (Ptr<OutputStreamObject> stream, |
|
688 Ptr<Ipv6> ipv6, uint32_t interface); |
|
689 |
|
690 /** |
|
691 * @brief Enable ascii trace output the indicated Ipv6 and interface pair |
|
692 * using an Ipv6 previously named using the ns-3 object name service. |
|
693 * |
|
694 * @param filename filename prefix to use for ascii files. |
|
695 * @param ipv6Name The name of the Ipv6 on which you want to enable tracing. |
|
696 * @param interface The interface on which you want to enable tracing. |
|
697 */ |
|
698 void EnableAsciiIpv6 (std::string prefix, |
|
699 std::string ipv6Name, uint32_t interface); |
|
700 |
|
701 /** |
|
702 * @brief Enable ascii trace output the indicated net device using a device |
|
703 * previously named using the ns-3 object name service. |
|
704 * |
|
705 * @param stream An OutputStreamObject representing an existing file to use |
|
706 * when writing trace data. |
|
707 * @param ipv6Name The name of the Ipv6 on which you want to enable tracing. |
|
708 * @param interface The interface on which you want to enable tracing. |
|
709 */ |
|
710 void EnableAsciiIpv6 (Ptr<OutputStreamObject> stream, |
|
711 std::string ipv6Name, uint32_t interface); |
|
712 |
|
713 /** |
|
714 * @brief Enable ascii trace output on each Ipv6 and interface pair in the |
|
715 * container |
|
716 * |
|
717 * @param prefix Filename prefix to use for ascii files. |
|
718 * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs on which to |
|
719 * enable tracing. |
|
720 */ |
|
721 void EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c); |
|
722 |
|
723 /** |
|
724 * @brief Enable ascii trace output on each device in the container which is |
|
725 * of the appropriate type. |
|
726 * |
|
727 * @param stream An OutputStreamObject representing an existing file to use |
|
728 * when writing trace data. |
|
729 * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs on which to |
|
730 * enable tracing. |
|
731 */ |
|
732 void EnableAsciiIpv6 (Ptr<OutputStreamObject> stream, Ipv6InterfaceContainer c); |
|
733 |
|
734 /** |
|
735 * @brief Enable ascii trace output on all Ipv6 and interface pairs existing |
|
736 * in the nodes provided in the container. |
|
737 * |
|
738 * \param prefix Filename prefix to use for ascii files. |
|
739 * \param n container of nodes. |
|
740 */ |
|
741 void EnableAsciiIpv6 (std::string prefix, NodeContainer n); |
|
742 |
|
743 /** |
|
744 * @brief Enable ascii trace output on all Ipv6 and interface pairs existing |
|
745 * in the nodes provided in the container. |
|
746 * |
|
747 * @param stream An OutputStreamObject representing an existing file to use |
|
748 * when writing trace data. |
|
749 * \param n container of nodes. |
|
750 */ |
|
751 void EnableAsciiIpv6 (Ptr<OutputStreamObject> stream, NodeContainer n); |
|
752 |
|
753 /** |
|
754 * @brief Enable pcap output on the Ipv6 and interface pair specified by a |
|
755 * global node-id (of a previously created node) and interface. Since there |
|
756 * can be only one Ipv6 aggregated to a node, the node-id unambiguously |
|
757 * determines the Ipv6. |
|
758 * |
|
759 * @param prefix Filename prefix to use when creating ascii trace files |
|
760 * @param nodeid The node identifier/number of the node on which to enable |
|
761 * ascii tracing |
|
762 * @param interface The device identifier/index of the device on which to enable |
|
763 * ascii tracing |
|
764 */ |
|
765 void EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t deviceid); |
|
766 |
|
767 /** |
|
768 * @brief Enable pcap output on the Ipv6 and interface pair specified by a |
|
769 * global node-id (of a previously created node) and interface. Since there |
|
770 * can be only one Ipv6 aggregated to a node, the node-id unambiguously |
|
771 * determines the Ipv6. |
|
772 * |
|
773 * @param stream An OutputStreamObject representing an existing file to use |
|
774 * when writing trace data. |
|
775 * @param nodeid The node identifier/number of the node on which to enable |
|
776 * ascii tracing |
|
777 * @param interface The interface on which you want to enable tracing. |
|
778 */ |
|
779 void EnableAsciiIpv6 (Ptr<OutputStreamObject> stream, uint32_t nodeid, uint32_t interface); |
|
780 |
|
781 /** |
|
782 * @brief Enable ascii trace output on all Ipv6 and interface pairs existing |
|
783 * in the set of all nodes created in the simulation. |
|
784 * |
|
785 * @param prefix Filename prefix to use for ascii files. |
|
786 */ |
|
787 void EnableAsciiIpv6All (std::string prefix); |
|
788 |
|
789 /** |
|
790 * @brief Enable ascii trace output on each device (which is of the |
|
791 * appropriate type) in the set of all nodes created in the simulation. |
|
792 * |
|
793 * @param stream An OutputStreamObject representing an existing file to use |
|
794 * when writing trace data. |
|
795 */ |
|
796 void EnableAsciiIpv6All (Ptr<OutputStreamObject> stream); |
|
797 |
|
798 private: |
|
799 /** |
|
800 * @internal Avoid code duplication. |
|
801 */ |
|
802 void EnableAsciiIpv6Impl (Ptr<OutputStreamObject> stream, std::string prefix, uint32_t nodeid, uint32_t interface); |
|
803 |
|
804 /** |
|
805 * @internal Avoid code duplication. |
|
806 */ |
|
807 void EnableAsciiIpv6Impl (Ptr<OutputStreamObject> stream, std::string prefix, NodeContainer n); |
|
808 |
|
809 /** |
|
810 * @internal Avoid code duplication. |
|
811 */ |
|
812 void EnableAsciiIpv6Impl (Ptr<OutputStreamObject> stream, std::string prefix, Ipv6InterfaceContainer c); |
|
813 |
|
814 /** |
|
815 * @internal Avoid code duplication. |
|
816 */ |
|
817 void EnableAsciiIpv6Impl (Ptr<OutputStreamObject> stream, std::string prefix, std::string ipv6Name, uint32_t interface); |
|
818 |
|
819 /** |
|
820 * @internal Avoid code duplication. |
|
821 */ |
|
822 void EnableAsciiIpv6Impl (Ptr<OutputStreamObject> stream, std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface); |
|
823 |
|
824 }; |
|
825 |
619 } // namespace ns3 |
826 } // namespace ns3 |
620 |
827 |
621 #endif /* ASCIITRACE_HELPER_H */ |
828 #endif /* ASCIITRACE_HELPER_H */ |