A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
csma-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 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 #ifndef CSMA_HELPER_H
21 #define CSMA_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/csma-channel.h"
30 #include "ns3/deprecated.h"
31 #include "ns3/trace-helper.h"
32 
33 namespace ns3 {
34 
35 class Packet;
36 
47 {
48 public:
52  CsmaHelper ();
53  virtual ~CsmaHelper () {}
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 SetDeviceAttribute (std::string n1, const AttributeValue &v1);
83 
91  void SetChannelAttribute (std::string n1, const AttributeValue &v1);
92 
102  NetDeviceContainer Install (Ptr<Node> node) const;
103 
113  NetDeviceContainer Install (std::string name) const;
114 
125 
135  NetDeviceContainer Install (Ptr<Node> node, std::string channelName) const;
136 
146  NetDeviceContainer Install (std::string nodeName, Ptr<CsmaChannel> channel) const;
147 
157  NetDeviceContainer Install (std::string nodeName, std::string channelName) const;
158 
169  NetDeviceContainer Install (const NodeContainer &c) const;
170 
181  NetDeviceContainer Install (const NodeContainer &c, Ptr<CsmaChannel> channel) const;
182 
193  NetDeviceContainer Install (const NodeContainer &c, std::string channelName) const;
194 
206  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
207 
208 private:
209  /*
210  * \internal
211  */
213 
226  virtual void EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename);
227 
240  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
241  std::string prefix,
242  Ptr<NetDevice> nd,
243  bool explicitFilename);
244 
248 };
249 
250 } // namespace ns3
251 
252 #endif /* CSMA_HELPER_H */