A Discrete-Event Network Simulator
API
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 
38 {
39 public:
44 
48  virtual ~PcapHelperForIpv4 () {}
49 
58  virtual void EnablePcapIpv4Internal (std::string prefix,
59  Ptr<Ipv4> ipv4,
60  uint32_t interface,
61  bool explicitFilename) = 0;
62 
71  void EnablePcapIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename = false);
72 
82  void EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename = false);
83 
90  void EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c);
91 
99  void EnablePcapIpv4 (std::string prefix, NodeContainer n);
100 
112  void EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
113 
120  void EnablePcapIpv4All (std::string prefix);
121 
122 };
123 
131 {
132 public:
137 
142 
168  std::string prefix,
169  Ptr<Ipv4> ipv4,
170  uint32_t interface,
171  bool explicitFilename) = 0;
172 
181  void EnableAsciiIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename = false);
182 
191  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv4> ipv4, uint32_t interface);
192 
202  void EnableAsciiIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename = false);
203 
213  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, std::string ipv4Name, uint32_t interface);
214 
223  void EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c);
224 
235 
243  void EnableAsciiIpv4 (std::string prefix, NodeContainer n);
244 
254 
261  void EnableAsciiIpv4All (std::string prefix);
262 
271 
285  void EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename);
286 
300  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface, bool explicitFilename);
301 
302 private:
319  std::string prefix,
320  uint32_t nodeid,
321  uint32_t interface,
322  bool explicitFilename);
323 
335  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
336 
348  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv4InterfaceContainer c);
349 
365  std::string prefix,
366  std::string ipv4Name,
367  uint32_t interface,
368  bool explicitFilename);
369 
385  std::string prefix,
386  Ptr<Ipv4> ipv4,
387  uint32_t interface,
388  bool explicitFilename);
389 };
390 
398 {
399 public:
404 
408  virtual ~PcapHelperForIpv6 () {}
409 
418  virtual void EnablePcapIpv6Internal (std::string prefix,
419  Ptr<Ipv6> ipv6,
420  uint32_t interface,
421  bool explicitFilename) = 0;
422 
431  void EnablePcapIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
432 
442  void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
443 
450  void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c);
451 
459  void EnablePcapIpv6 (std::string prefix, NodeContainer n);
460 
472  void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
473 
480  void EnablePcapIpv6All (std::string prefix);
481 };
482 
490 {
491 public:
496 
501 
527  std::string prefix,
528  Ptr<Ipv6> ipv6,
529  uint32_t interface,
530  bool explicitFilename) = 0;
531 
540  void EnableAsciiIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
541 
550  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv6> ipv6, uint32_t interface);
551 
561  void EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
562 
572  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, std::string ipv6Name, uint32_t interface);
573 
582  void EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c);
583 
594 
602  void EnableAsciiIpv6 (std::string prefix, NodeContainer n);
603 
613 
627  void EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
628 
641  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface);
642 
649  void EnableAsciiIpv6All (std::string prefix);
650 
659 
660 private:
677  std::string prefix,
678  uint32_t nodeid,
679  uint32_t interface,
680  bool explicitFilename);
681 
693  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
694 
706  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv6InterfaceContainer c);
707 
723  std::string prefix,
724  std::string ipv6Name,
725  uint32_t interface,
726  bool explicitFilename);
727 
743  std::string prefix,
744  Ptr<Ipv6> ipv6,
745  uint32_t interface,
746  bool explicitFilename);
747 };
748 
749 } // namespace ns3
750 
751 #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:73
Keep track of a set of IPv6 interfaces.
holds a vector of std::pair of Ptr<Ipv4> 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...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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.