A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
emu-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 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 EMU_HELPER_H
20 #define EMU_HELPER_H
21 
22 #include <string>
23 #include <ostream>
24 
25 #include "ns3/attribute.h"
26 #include "ns3/object-factory.h"
27 #include "ns3/net-device-container.h"
28 #include "ns3/node-container.h"
29 #include "ns3/emu-net-device.h"
30 
31 #include "ns3/trace-helper.h"
32 
33 namespace ns3 {
34 
35 class Packet;
36 
47 {
48 public:
49  /*
50  * Construct an EmuHelper() which is used to make installing and configuring
51  * Emulated Net Devices easier.
52  */
53  EmuHelper ();
54 
69  void SetQueue (std::string type,
70  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
71  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
72  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
73  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
74 
82  void SetAttribute (std::string n1, const AttributeValue &v1);
83 
92 
100  NetDeviceContainer Install (std::string nodeName) const;
101 
110  NetDeviceContainer Install (const NodeContainer &c) const;
111 
112 private:
113  /*
114  * \internal
115  */
116  Ptr<NetDevice> InstallPriv (Ptr<Node> node) const;
117 
129  virtual void EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename);
130 
143  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
144  std::string prefix,
145  Ptr<NetDevice> nd,
146  bool explicitFilename);
147 
150 };
151 
152 
153 } // namespace ns3
154 
155 #endif /* EMU_HELPER_H */
Base class providing common user-level ascii trace operations for helpers representing net devices...
Definition: trace-helper.h:480
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
Definition: emu-helper.cc:106
Ptr< NetDevice > InstallPriv(Ptr< Node > node) const
Definition: emu-helper.cc:233
Hold a value for an Attribute.
Definition: attribute.h:56
build a set of EmuNetDevice objects
Definition: emu-helper.h:46
Base class providing common user-level pcap operations for helpers representing net devices...
Definition: trace-helper.h:390
void SetAttribute(std::string n1, const AttributeValue &v1)
Definition: emu-helper.cc:61
A class for an empty attribute value.
Definition: attribute.h:222
holds a vector of ns3::NetDevice pointers
ObjectFactory m_deviceFactory
Definition: emu-helper.h:149
keep track of a set of node pointers.
instantiate subclasses of ns3::Object.
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
Definition: emu-helper.cc:68
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::EmuNetDevice with the attributes configured by EmuHelper::SetDeviceAttrib...
Definition: emu-helper.cc:207
void SetQueue(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue())
Definition: emu-helper.cc:45
ObjectFactory m_queueFactory
Definition: emu-helper.h:148