A Discrete-Event Network Simulator
API
simple-net-device-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Universita' di Firenze
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  * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19  */
20 #ifndef SIMPLE_NETDEVICE_HELPER_H
21 #define SIMPLE_NETDEVICE_HELPER_H
22 
23 #include <string>
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/simple-channel.h"
30 
31 namespace ns3 {
32 
37 {
38 public:
43  virtual ~SimpleNetDeviceHelper () {}
44 
63  void SetQueue (std::string type,
64  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
65  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
66  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
67  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
68 
87  void SetChannel (std::string type,
88  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
89  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
90  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
91  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
92 
93 
101  void SetDeviceAttribute (std::string n1, const AttributeValue &v1);
102 
110  void SetChannelAttribute (std::string n1, const AttributeValue &v1);
111 
121  void SetNetDevicePointToPointMode (bool pointToPointMode);
122 
132  NetDeviceContainer Install (Ptr<Node> node) const;
133 
144 
155  NetDeviceContainer Install (const NodeContainer &c) const;
156 
168 
169 private:
180 
185 
186 };
187 
188 } // namespace ns3
189 
190 #endif /* SIMPLE_NETDEVICE_HELPER_H */
ObjectFactory m_deviceFactory
NetDevice factory.
Hold a value for an Attribute.
Definition: attribute.h:68
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
channel
Definition: third.py:85
A class for an empty attribute value.
Definition: attribute.h:232
holds a vector of ns3::NetDevice pointers
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
ObjectFactory m_channelFactory
Channel factory.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
SimpleNetDeviceHelper()
Construct a SimpleNetDeviceHelper.
ObjectFactory m_queueFactory
Queue factory.
bool m_pointToPointMode
Install PointToPoint SimpleNetDevice or Broadcast ones.
void SetNetDevicePointToPointMode(bool pointToPointMode)
SimpleNetDevice is Broadcast capable and ARP needing.
Ptr< NetDevice > InstallPriv(Ptr< Node > node, Ptr< SimpleChannel > channel) const
This method creates an ns3::SimpleNetDevice with the attributes configured by SimpleNetDeviceHelper::...
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())
Each net device must have a queue to pass packets through.
Instantiate subclasses of ns3::Object.
build a set of SimpleNetDevice objects
void SetChannel(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())
Each net device must have a channel to pass packets through.
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::Se...