A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
internet-trace-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 University of Washington
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */
18 
19 #ifndef INTERNET_TRACE_HELPER_H
20 #define INTERNET_TRACE_HELPER_H
21 
22 #include "ns3/assert.h"
23 #include "ns3/ipv4-interface-container.h"
24 #include "ns3/ipv6-interface-container.h"
25 #include "ns3/ipv4.h"
26 #include "ns3/ipv6.h"
27 #include "ns3/trace-helper.h"
28 
29 namespace ns3 {
30 
36 {
37 public:
42 
46  virtual ~PcapHelperForIpv4 () {}
47 
57  virtual void EnablePcapIpv4Internal (std::string prefix,
58  Ptr<Ipv4> ipv4,
59  uint32_t interface,
60  bool explicitFilename) = 0;
61 
70  void EnablePcapIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename = false);
71 
81  void EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename = false);
82 
89  void EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c);
90 
98  void EnablePcapIpv4 (std::string prefix, NodeContainer n);
99 
111  void EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
112 
119  void EnablePcapIpv4All (std::string prefix);
120 
121 };
122 
128 {
129 public:
134 
139 
166  std::string prefix,
167  Ptr<Ipv4> ipv4,
168  uint32_t interface,
169  bool explicitFilename) = 0;
170 
179  void EnableAsciiIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename = false);
180 
189  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv4> ipv4, uint32_t interface);
190 
200  void EnableAsciiIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename = false);
201 
211  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, std::string ipv4Name, uint32_t interface);
212 
221  void EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c);
222 
233 
241  void EnableAsciiIpv4 (std::string prefix, NodeContainer n);
242 
252 
259  void EnableAsciiIpv4All (std::string prefix);
260 
269 
283  void EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename);
284 
298  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface, bool explicitFilename);
299 
300 private:
319  std::string prefix,
320  uint32_t nodeid,
321  uint32_t interface,
322  bool explicitFilename);
323 
337  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
338 
352  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv4InterfaceContainer c);
353 
371  std::string prefix,
372  std::string ipv4Name,
373  uint32_t interface,
374  bool explicitFilename);
375 
393  std::string prefix,
394  Ptr<Ipv4> ipv4,
395  uint32_t interface,
396  bool explicitFilename);
397 };
398 
404 {
405 public:
410 
414  virtual ~PcapHelperForIpv6 () {}
415 
425  virtual void EnablePcapIpv6Internal (std::string prefix,
426  Ptr<Ipv6> ipv6,
427  uint32_t interface,
428  bool explicitFilename) = 0;
429 
438  void EnablePcapIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
439 
449  void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
450 
457  void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c);
458 
466  void EnablePcapIpv6 (std::string prefix, NodeContainer n);
467 
479  void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
480 
487  void EnablePcapIpv6All (std::string prefix);
488 };
489 
495 {
496 public:
501 
506 
533  std::string prefix,
534  Ptr<Ipv6> ipv6,
535  uint32_t interface,
536  bool explicitFilename) = 0;
537 
546  void EnableAsciiIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
547 
556  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv6> ipv6, uint32_t interface);
557 
567  void EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
568 
578  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, std::string ipv6Name, uint32_t interface);
579 
588  void EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c);
589 
600 
608  void EnableAsciiIpv6 (std::string prefix, NodeContainer n);
609 
619 
633  void EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
634 
647  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface);
648 
655  void EnableAsciiIpv6All (std::string prefix);
656 
665 
666 private:
685  std::string prefix,
686  uint32_t nodeid,
687  uint32_t interface,
688  bool explicitFilename);
689 
703  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
704 
718  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv6InterfaceContainer c);
719 
737  std::string prefix,
738  std::string ipv6Name,
739  uint32_t interface,
740  bool explicitFilename);
741 
759  std::string prefix,
760  Ptr<Ipv6> ipv6,
761  uint32_t interface,
762  bool explicitFilename);
763 };
764 
765 } // namespace ns3
766 
767 #endif /* INTERNET_TRACE_HELPER_H */
Base class providing common user-level pcap operations for helpers representing IPv6 protocols ...
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
Keep track of a set of IPv6 interfaces.
holds a vector of std::pair of Ptr and interface index.
void EnablePcapIpv4(std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename=false)
Enable pcap output the indicated Ipv4 and interface pair.
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...
virtual ~PcapHelperForIpv4()
Destroy a PcapHelperForIpv4.
virtual ~AsciiTraceHelperForIpv6()
Destroy an AsciiTraceHelperForIpv6.
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.
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.
Base class providing common user-level ascii trace operations for helpers representing IPv6 protocols...
virtual ~AsciiTraceHelperForIpv4()
Destroy an AsciiTraceHelperForIpv4.
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.
AsciiTraceHelperForIpv6()
Construct an AsciiTraceHelperForIpv6.
PcapHelperForIpv4()
Construct a PcapHelperForIpv4.
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...
keep track of a set of node pointers.
Base class providing common user-level pcap operations for helpers representing IPv4 protocols ...
void EnablePcapIpv6(std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename=false)
Enable pcap output the indicated Ipv6 and interface pair.
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...
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 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...
virtual void EnablePcapIpv4Internal(std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename)=0
Enable pcap output the indicated Ipv4 and interface pair.
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...
PcapHelperForIpv6()
Construct a PcapHelperForIpv6.
Base class providing common user-level ascii trace operations for helpers representing IPv4 protocols...
virtual void EnablePcapIpv6Internal(std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename)=0
Enable pcap output the indicated Ipv6 and interface pair.
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 ~PcapHelperForIpv6()
Destroy a PcapHelperForIpv6.