A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
internet-trace-helper.h
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:
305  std::string prefix,
306  uint32_t nodeid,
307  uint32_t interface,
308  bool explicitFilename);
309 
313  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
314 
318  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv4InterfaceContainer c);
319 
324  std::string prefix,
325  std::string ipv4Name,
326  uint32_t interface,
327  bool explicitFilename);
328 
333  std::string prefix,
334  Ptr<Ipv4> ipv4,
335  uint32_t interface,
336  bool explicitFilename);
337 };
338 
344 {
345 public:
350 
354  virtual ~PcapHelperForIpv6 () {}
355 
365  virtual void EnablePcapIpv6Internal (std::string prefix,
366  Ptr<Ipv6> ipv6,
367  uint32_t interface,
368  bool explicitFilename) = 0;
369 
378  void EnablePcapIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
379 
389  void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
390 
397  void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c);
398 
406  void EnablePcapIpv6 (std::string prefix, NodeContainer n);
407 
419  void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
420 
427  void EnablePcapIpv6All (std::string prefix);
428 };
429 
435 {
436 public:
441 
446 
473  std::string prefix,
474  Ptr<Ipv6> ipv6,
475  uint32_t interface,
476  bool explicitFilename) = 0;
477 
486  void EnableAsciiIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
487 
496  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv6> ipv6, uint32_t interface);
497 
507  void EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
508 
518  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, std::string ipv6Name, uint32_t interface);
519 
528  void EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c);
529 
540 
548  void EnableAsciiIpv6 (std::string prefix, NodeContainer n);
549 
559 
573  void EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
574 
587  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface);
588 
595  void EnableAsciiIpv6All (std::string prefix);
596 
605 
606 private:
611  std::string prefix,
612  uint32_t nodeid,
613  uint32_t interface,
614  bool explicitFilename);
615 
619  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
620 
624  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv6InterfaceContainer c);
625 
630  std::string prefix,
631  std::string ipv6Name,
632  uint32_t interface,
633  bool explicitFilename);
634 
639  std::string prefix,
640  Ptr<Ipv6> ipv6,
641  uint32_t interface,
642  bool explicitFilename);
643 };
644 
645 } // namespace ns3
646 
647 #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:59
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)
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)
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.