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 
131  void DisableFlowControl (void);
132 
142  NetDeviceContainer Install (Ptr<Node> node) const;
143 
154 
165  NetDeviceContainer Install (const NodeContainer &c) const;
166 
178 
179 private:
190 
196 };
197 
198 } // namespace ns3
199 
200 #endif /* SIMPLE_NETDEVICE_HELPER_H */
Hold a value for an Attribute.
Definition: attribute.h:69
A class for an empty attribute value.
Definition: attribute.h:233
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
build a set of SimpleNetDevice objects
bool m_enableFlowControl
whether to enable flow control
Ptr< NetDevice > InstallPriv(Ptr< Node > node, Ptr< SimpleChannel > channel) const
This method creates an ns3::SimpleNetDevice with the attributes configured by SimpleNetDeviceHelper::...
ObjectFactory m_deviceFactory
NetDevice factory.
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.
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
ObjectFactory m_channelFactory
Channel factory.
ObjectFactory m_queueFactory
Queue factory.
void SetNetDevicePointToPointMode(bool pointToPointMode)
SimpleNetDevice is Broadcast capable and ARP needing.
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
SimpleNetDeviceHelper()
Construct a 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.
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::Se...
bool m_pointToPointMode
Install PointToPoint SimpleNetDevice or Broadcast ones.
void DisableFlowControl(void)
Disable flow control only if you know what you are doing.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
channel
Definition: third.py:92