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 
56  virtual void EnablePcapIpv4Internal (std::string prefix,
57  Ptr<Ipv4> ipv4,
58  uint32_t interface,
59  bool explicitFilename) = 0;
60 
69  void EnablePcapIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename = false);
70 
80  void EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename = false);
81 
88  void EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c);
89 
97  void EnablePcapIpv4 (std::string prefix, NodeContainer n);
98 
110  void EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
111 
118  void EnablePcapIpv4All (std::string prefix);
119 
120 };
121 
127 {
128 public:
133 
138 
164  std::string prefix,
165  Ptr<Ipv4> ipv4,
166  uint32_t interface,
167  bool explicitFilename) = 0;
168 
177  void EnableAsciiIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename = false);
178 
187  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv4> ipv4, uint32_t interface);
188 
198  void EnableAsciiIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename = false);
199 
209  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, std::string ipv4Name, uint32_t interface);
210 
219  void EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c);
220 
231 
239  void EnableAsciiIpv4 (std::string prefix, NodeContainer n);
240 
250 
257  void EnableAsciiIpv4All (std::string prefix);
258 
267 
281  void EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename);
282 
296  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface, bool explicitFilename);
297 
298 private:
315  std::string prefix,
316  uint32_t nodeid,
317  uint32_t interface,
318  bool explicitFilename);
319 
331  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
332 
344  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv4InterfaceContainer c);
345 
361  std::string prefix,
362  std::string ipv4Name,
363  uint32_t interface,
364  bool explicitFilename);
365 
381  std::string prefix,
382  Ptr<Ipv4> ipv4,
383  uint32_t interface,
384  bool explicitFilename);
385 };
386 
392 {
393 public:
398 
402  virtual ~PcapHelperForIpv6 () {}
403 
412  virtual void EnablePcapIpv6Internal (std::string prefix,
413  Ptr<Ipv6> ipv6,
414  uint32_t interface,
415  bool explicitFilename) = 0;
416 
425  void EnablePcapIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
426 
436  void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
437 
444  void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c);
445 
453  void EnablePcapIpv6 (std::string prefix, NodeContainer n);
454 
466  void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
467 
474  void EnablePcapIpv6All (std::string prefix);
475 };
476 
482 {
483 public:
488 
493 
519  std::string prefix,
520  Ptr<Ipv6> ipv6,
521  uint32_t interface,
522  bool explicitFilename) = 0;
523 
532  void EnableAsciiIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
533 
542  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv6> ipv6, uint32_t interface);
543 
553  void EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
554 
564  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, std::string ipv6Name, uint32_t interface);
565 
574  void EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c);
575 
586 
594  void EnableAsciiIpv6 (std::string prefix, NodeContainer n);
595 
605 
619  void EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
620 
633  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface);
634 
641  void EnableAsciiIpv6All (std::string prefix);
642 
651 
652 private:
669  std::string prefix,
670  uint32_t nodeid,
671  uint32_t interface,
672  bool explicitFilename);
673 
685  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
686 
698  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv6InterfaceContainer c);
699 
715  std::string prefix,
716  std::string ipv6Name,
717  uint32_t interface,
718  bool explicitFilename);
719 
735  std::string prefix,
736  Ptr<Ipv6> ipv6,
737  uint32_t interface,
738  bool explicitFilename);
739 };
740 
741 } // namespace ns3
742 
743 #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...
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.