src/helper/csma-helper.h
author Craig Dowell <craigdo@ee.washington.edu>
Tue, 20 Jan 2009 17:39:18 -0800
changeset 4140 6bbf05bf4826
parent 3848 affd0834debc
child 4263 fec2f830d015
permissions -rw-r--r--
Brute force all of the helpers to use object name service
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2833
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
     2
/*
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
     3
 * Copyright (c) 2008 INRIA
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
     4
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
     7
 * published by the Free Software Foundation;
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
     8
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
    12
 * GNU General Public License for more details.
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
    13
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
    14
 * You should have received a copy of the GNU General Public License
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
    15
 * along with this program; if not, write to the Free Software
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
    17
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2805
diff changeset
    19
 */
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
#ifndef CSMA_HELPER_H
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
#define CSMA_HELPER_H
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
2603
1308da4cb3bf move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2433
diff changeset
    23
#include <string>
2780
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
    24
#include <ostream>
2603
1308da4cb3bf move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2433
diff changeset
    25
#include "ns3/attribute.h"
1308da4cb3bf move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2433
diff changeset
    26
#include "ns3/object-factory.h"
1308da4cb3bf move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2433
diff changeset
    27
#include "ns3/net-device-container.h"
1308da4cb3bf move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2433
diff changeset
    28
#include "ns3/node-container.h"
1308da4cb3bf move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2433
diff changeset
    29
#include "ns3/csma-channel.h"
3403
ac82ff1f6736 use NS_DEPRECATED for bug 232.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3381
diff changeset
    30
#include "ns3/deprecated.h"
2603
1308da4cb3bf move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2433
diff changeset
    31
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    32
namespace ns3 {
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
2780
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
    34
class Packet;
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
    35
class PcapWriter;
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
    36
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    37
/**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    38
 * \brief build a set of CsmaNetDevice objects
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    39
 */
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    40
class CsmaHelper
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
{
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
public:
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    43
  CsmaHelper ();
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    44
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    45
  /**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    46
   * \param type the type of queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    47
   * \param n1 the name of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    48
   * \param v1 the value of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    49
   * \param n2 the name of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    50
   * \param v2 the value of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    51
   * \param n3 the name of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    52
   * \param v3 the value of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    53
   * \param n4 the name of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    54
   * \param v4 the value of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    55
   *
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    56
   * Set the type of queue to create and associated to each
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2839
diff changeset
    57
   * CsmaNetDevice created through CsmaHelper::Install.
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    58
   */
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
  void SetQueue (std::string type,
3786
9f384deadb46 replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3403
diff changeset
    60
                 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
9f384deadb46 replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3403
diff changeset
    61
                 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
9f384deadb46 replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3403
diff changeset
    62
                 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
9f384deadb46 replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3403
diff changeset
    63
                 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    64
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    65
  /**
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    66
   * \param n1 the name of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    67
   * \param v1 the value of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    68
   *
3381
3cdd9d60f7c7 bug 232, references to Parameter obsolete
Craig Dowell <craigdo@ee.washington.edu>
parents: 2997
diff changeset
    69
   * Set these attributes on each ns3::CsmaNetDevice created
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2839
diff changeset
    70
   * by CsmaHelper::Install
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    71
   */
3381
3cdd9d60f7c7 bug 232, references to Parameter obsolete
Craig Dowell <craigdo@ee.washington.edu>
parents: 2997
diff changeset
    72
  void SetDeviceAttribute (std::string n1, const AttributeValue &v1);
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    73
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    74
  /**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    75
   * \param n1 the name of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    76
   * \param v1 the value of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    77
   *
3381
3cdd9d60f7c7 bug 232, references to Parameter obsolete
Craig Dowell <craigdo@ee.washington.edu>
parents: 2997
diff changeset
    78
   * Set these attributes on each ns3::CsmaChannel created
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2839
diff changeset
    79
   * by CsmaHelper::Install
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    80
   */
3381
3cdd9d60f7c7 bug 232, references to Parameter obsolete
Craig Dowell <craigdo@ee.washington.edu>
parents: 2997
diff changeset
    81
  void SetChannelAttribute (std::string n1, const AttributeValue &v1);
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    82
3403
ac82ff1f6736 use NS_DEPRECATED for bug 232.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3381
diff changeset
    83
  void SetDeviceParameter (std::string n1, const AttributeValue &v1) NS_DEPRECATED;
ac82ff1f6736 use NS_DEPRECATED for bug 232.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3381
diff changeset
    84
  void SetChannelParameter (std::string n1, const AttributeValue &v1) NS_DEPRECATED;
ac82ff1f6736 use NS_DEPRECATED for bug 232.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3381
diff changeset
    85
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    86
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    87
   * \param filename filename prefix to use for pcap files.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    88
   * \param nodeid the id of the node to generate pcap output for.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    89
   * \param deviceid the id of the device to generate pcap output for.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    90
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    91
   * Generate a pcap file which contains the link-level data observed
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    92
   * by the specified deviceid within the specified nodeid. The pcap
2839
b30d4ece2bbb generate .pcap postfix for pcap filenames
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
    93
   * data is stored in the file prefix-nodeid-deviceid.pcap.
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    94
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    95
   * This method should be invoked after the network topology has 
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    96
   * been fully constructed.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    97
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
    98
  static void EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid);
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    99
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   100
   * \param filename filename prefix to use for pcap files.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   101
   * \param d container of devices of type ns3::CsmaNetDevice
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   102
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   103
   * Enable pcap output on each input device which is of the
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   104
   * ns3::CsmaNetDevice type.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   105
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   106
  static void EnablePcap (std::string filename, NetDeviceContainer d);
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   107
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   108
   * \param filename filename prefix to use for pcap files.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   109
   * \param n container of nodes.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   110
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   111
   * Enable pcap output on each device which is of the
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   112
   * ns3::CsmaNetDevice type and which is located in one of the 
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   113
   * input nodes.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   114
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   115
  static void EnablePcap (std::string filename, NodeContainer n);
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   116
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   117
   * \param filename filename prefix to use for pcap files.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   118
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   119
   * Enable pcap output on each device which is of the
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   120
   * ns3::CsmaNetDevice type
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   121
   */
2996
a83b94e277d4 EnablePcap()->EnablePcapAll(); EnableAscii()->EnableAsciiAll()
Tom Henderson <tomh@tomh.org>
parents: 2887
diff changeset
   122
  static void EnablePcapAll (std::string filename);
2780
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
   123
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   124
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   125
   * \param os output stream
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   126
   * \param nodeid the id of the node to generate ascii output for.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   127
   * \param deviceid the id of the device to generate ascii output for.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   128
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   129
   * Enable ascii output on the specified deviceid within the
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   130
   * specified nodeid if it is of type ns3::CsmaNetDevice and dump 
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   131
   * that to the specified stdc++ output stream.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   132
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   133
  static void EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid);
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   134
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   135
   * \param os output stream
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   136
   * \param d device container
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   137
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   138
   * Enable ascii output on each device which is of the
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   139
   * ns3::CsmaNetDevice type and which is located in the input
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   140
   * device container and dump that to the specified
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   141
   * stdc++ output stream.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   142
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   143
  static void EnableAscii (std::ostream &os, NetDeviceContainer d);
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   144
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   145
   * \param os output stream
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   146
   * \param n node container
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   147
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   148
   * Enable ascii output on each device which is of the
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   149
   * ns3::CsmaNetDevice type and which is located in one
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   150
   * of the input node and dump that to the specified
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   151
   * stdc++ output stream.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   152
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   153
  static void EnableAscii (std::ostream &os, NodeContainer n);
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   154
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   155
   * \param os output stream
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   156
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   157
   * Enable ascii output on each device which is of the
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   158
   * ns3::CsmaNetDevice type and dump that to the specified
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   159
   * stdc++ output stream.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   160
   */
2996
a83b94e277d4 EnablePcap()->EnablePcapAll(); EnableAscii()->EnableAsciiAll()
Tom Henderson <tomh@tomh.org>
parents: 2887
diff changeset
   161
  static void EnableAsciiAll (std::ostream &os);
2780
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
   162
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
   163
  /**
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   164
   * This method creates an ns3::CsmaChannel with the attributes configured by
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   165
   * CsmaHelper::SetChannelAttribute, an ns3::CsmaNetDevice with the attributes
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   166
   * configured by CsmaHelper::SetDeviceAttribute and then adds the device
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   167
   * to the node and attaches the channel to the device.
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   168
   *
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   169
   * \param node The node to install the device in
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   170
   * \returns A containter holding the added net device.
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   171
   */
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   172
  NetDeviceContainer Install (Ptr<Node> node) const;
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   173
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   174
  /**
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   175
   * This method creates an ns3::CsmaChannel with the attributes configured by
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   176
   * CsmaHelper::SetChannelAttribute, an ns3::CsmaNetDevice with the attributes
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   177
   * configured by CsmaHelper::SetDeviceAttribute and then adds the device
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   178
   * to the node and attaches the channel to the device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   179
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   180
   * \param name The name of the node to install the device in
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   181
   * \returns A containter holding the added net device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   182
   */
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   183
  NetDeviceContainer Install (std::string name) const;
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   184
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   185
  /**
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   186
   * This method creates an ns3::CsmaNetDevice with the attributes configured by
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   187
   * CsmaHelper::SetDeviceAttribute and then adds the device to the node and 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   188
   * attaches the provided channel to the device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   189
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   190
   * \param node The node to install the device in
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   191
   * \param channel The channel to attach to the device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   192
   * \returns A containter holding the added net device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   193
   */
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   194
  NetDeviceContainer Install (Ptr<Node> node, Ptr<CsmaChannel> channel) const;
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   195
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   196
  /**
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   197
   * This method creates an ns3::CsmaNetDevice with the attributes configured by
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   198
   * CsmaHelper::SetDeviceAttribute and then adds the device to the node and 
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   199
   * attaches the provided channel to the device.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   200
   *
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   201
   * \param node The node to install the device in
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   202
   * \param channelName The name of the channel to attach to the device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   203
   * \returns A containter holding the added net device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   204
   */
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   205
  NetDeviceContainer Install (Ptr<Node> node, std::string channelName) const;
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   206
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   207
  /**
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   208
   * This method creates an ns3::CsmaNetDevice with the attributes configured by
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   209
   * CsmaHelper::SetDeviceAttribute and then adds the device to the node and 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   210
   * attaches the provided channel to the device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   211
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   212
   * \param nodeName The name of the node to install the device in
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   213
   * \param channel The chanel to attach to the device.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   214
   * \returns A containter holding the added net device.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   215
   */
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   216
  NetDeviceContainer Install (std::string nodeName, Ptr<CsmaChannel> channel) const;
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   217
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   218
  /**
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   219
   * This method creates an ns3::CsmaNetDevice with the attributes configured by
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   220
   * CsmaHelper::SetDeviceAttribute and then adds the device to the node and 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   221
   * attaches the provided channel to the device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   222
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   223
   * \param nodeName The name of the node to install the device in
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   224
   * \param channelName The name of the chanel to attach to the device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   225
   * \returns A containter holding the added net device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   226
   */
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   227
  NetDeviceContainer Install (std::string nodeName, std::string channelName) const;
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   228
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   229
  /**
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   230
   * This method creates an ns3::CsmaChannel with the attributes configured by
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   231
   * CsmaHelper::SetChannelAttribute.  For each Ptr<node> in the provided
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   232
   * container: it creates an ns3::CsmaNetDevice (with the attributes 
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   233
   * configured by CsmaHelper::SetDeviceAttribute); adds the device to the 
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   234
   * node; and attaches the channel to the device.
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   235
   *
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   236
   * \param c The NodeContainer holding the nodes to be changed.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   237
   * \returns A containter holding the added net devices.
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   238
   */
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   239
  NetDeviceContainer Install (const NodeContainer &c) const;
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   240
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   241
  /**
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   242
   * For each Ptr<node> in the provided container, this method creates an 
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   243
   * ns3::CsmaNetDevice (with the attributes configured by 
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   244
   * CsmaHelper::SetDeviceAttribute); adds the device to the node; and attaches 
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   245
   * the provided channel to the device.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   246
   *
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   247
   * \param c The NodeContainer holding the nodes to be changed.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   248
   * \param channel The channel to attach to the devices.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   249
   * \returns A containter holding the added net devices.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   250
   */
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   251
  NetDeviceContainer Install (const NodeContainer &c, Ptr<CsmaChannel> channel) const;
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   252
3795
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   253
  /**
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   254
   * For each Ptr<node> in the provided container, this method creates an 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   255
   * ns3::CsmaNetDevice (with the attributes configured by 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   256
   * CsmaHelper::SetDeviceAttribute); adds the device to the node; and attaches 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   257
   * the provided channel to the device.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   258
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   259
   * \param c The NodeContainer holding the nodes to be changed.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   260
   * \param channelName The name of the channel to attach to the devices.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   261
   * \returns A containter holding the added net devices.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   262
   */
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   263
  NetDeviceContainer Install (const NodeContainer &c, std::string channelName) const;
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   264
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   265
  /**
3795
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   266
   * \brief Make a star network topology.
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   267
   *
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   268
   * Given a pointer to a node that  will become the hub of the star, and a 
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   269
   * NodeContainer containing pointers to the nodes that will become the 
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   270
   * spokes; we construct CSMA net devices on the hub (corresponding to the 
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   271
   * spokes) and store them in the hubDevices NetDeviceContainer.  We add a 
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   272
   * net device to each spoke node and store them in the spokeDevices 
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   273
   * NetDeviceContainer.  A CSMA is created for each spoke.
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   274
   *
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   275
   * Usually when one thinks of a star network, one thinks of point-to-point
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   276
   * links.  We're just using a single pair of devices on a multi-point-to-point
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   277
   * network "drops" as the link.  You are free to add any number of other 
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   278
   * devices on the link if you want.
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   279
   *
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   280
   * The ordering of the devices in the hubDevices container is according to
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   281
   * the order of the spokes container -- that is, hubDevices[0] will be the
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   282
   * net device used on the hub that talks to spokes[0].  the container entry
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   283
   * spokeDevices[0] will have the device that hubDevices[0] talks to -- those
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   284
   * two devices are the ones that connect hub to spokes[0].
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   285
   *
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   286
   * \param hub The central node of the star network
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   287
   * \param spokes A NodeContainer of the nodes that will be the spoke (leaf)
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   288
   *               nodes
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   289
   * \param hubDevices A NetDeviceContainer that will be filled with pointers
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   290
   *                   to the point-to-point net devices created on the hub.
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   291
   * \param spokeDevices A NetDeviceContainer that will be filled with pointers
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   292
   *                    to the point-to-point net devices created on each of 
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   293
   *                    the spokes.
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   294
   */
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   295
  void InstallStar (Ptr<Node> hub, NodeContainer spokes, 
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   296
                    NetDeviceContainer& hubDevices, NetDeviceContainer& spokeDevices);
707acdf0f8b3 csma version of install star and example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3786
diff changeset
   297
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   298
  /**
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   299
   * \brief Make a star network topology.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   300
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   301
   * Given a pointer to a node that  will become the hub of the star, and a 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   302
   * NodeContainer containing pointers to the nodes that will become the 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   303
   * spokes; we construct CSMA net devices on the hub (corresponding to the 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   304
   * spokes) and store them in the hubDevices NetDeviceContainer.  We add a 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   305
   * net device to each spoke node and store them in the spokeDevices 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   306
   * NetDeviceContainer.  A CSMA is created for each spoke.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   307
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   308
   * Usually when one thinks of a star network, one thinks of point-to-point
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   309
   * links.  We're just using a single pair of devices on a multi-point-to-point
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   310
   * network "drops" as the link.  You are free to add any number of other 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   311
   * devices on the link if you want.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   312
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   313
   * The ordering of the devices in the hubDevices container is according to
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   314
   * the order of the spokes container -- that is, hubDevices[0] will be the
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   315
   * net device used on the hub that talks to spokes[0].  the container entry
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   316
   * spokeDevices[0] will have the device that hubDevices[0] talks to -- those
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   317
   * two devices are the ones that connect hub to spokes[0].
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   318
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   319
   * \param hubName The name of the central node of the star network
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   320
   * \param spokes A NodeContainer of the nodes that will be the spoke (leaf)
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   321
   *               nodes
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   322
   * \param hubDevices A NetDeviceContainer that will be filled with pointers
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   323
   *                   to the point-to-point net devices created on the hub.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   324
   * \param spokeDevices A NetDeviceContainer that will be filled with pointers
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   325
   *                     to the point-to-point net devices created on each of 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   326
   *                     the spokes.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   327
   */
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   328
  void InstallStar (std::string hubName, NodeContainer spokes, 
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   329
                    NetDeviceContainer& hubDevices, NetDeviceContainer& spokeDevices);
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   330
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   331
private:
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   332
  Ptr<NetDevice> InstallPriv (Ptr<Node> node, Ptr<CsmaChannel> channel) const;
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3795
diff changeset
   333
2780
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
   334
  static void RxEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet);
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
   335
  static void EnqueueEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet);
2799
17660e306cab Prepend ascii trace lines with action and time
Tom Henderson <tomh@tomh.org>
parents: 2789
diff changeset
   336
  static void AsciiEnqueueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
17660e306cab Prepend ascii trace lines with action and time
Tom Henderson <tomh@tomh.org>
parents: 2789
diff changeset
   337
  static void AsciiDequeueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
17660e306cab Prepend ascii trace lines with action and time
Tom Henderson <tomh@tomh.org>
parents: 2789
diff changeset
   338
  static void AsciiDropEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
17660e306cab Prepend ascii trace lines with action and time
Tom Henderson <tomh@tomh.org>
parents: 2789
diff changeset
   339
  static void AsciiRxEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   340
  ObjectFactory m_queueFactory;
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   341
  ObjectFactory m_deviceFactory;
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   342
  ObjectFactory m_channelFactory;
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   343
};
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   344
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   345
} // namespace ns3
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   346
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   347
#endif /* CSMA_HELPER_H */