src/helper/csma-helper.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 17 Apr 2008 13:42:25 -0700
changeset 2965 4b28e9740e3b
parent 2887 9a637e6daee0
child 2997 caf9d364c6fc
permissions -rw-r--r--
get rid of Attribute class. Use AttributeValue subclasses directly.
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"
1308da4cb3bf move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2433
diff changeset
    30
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
namespace ns3 {
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    32
2780
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
    33
class Packet;
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
    34
class PcapWriter;
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
    35
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    36
/**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    37
 * \brief build a set of CsmaNetDevice objects
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    38
 */
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
class CsmaHelper
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    40
{
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
public:
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
  CsmaHelper ();
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    43
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    44
  /**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    45
   * \param type the type of queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    46
   * \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
    47
   * \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
    48
   * \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
    49
   * \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
    50
   * \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
    51
   * \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
    52
   * \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
    53
   * \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
    54
   *
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    55
   * 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
    56
   * CsmaNetDevice created through CsmaHelper::Install.
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    57
   */
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
  void SetQueue (std::string type,
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2887
diff changeset
    59
		 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2887
diff changeset
    60
		 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2887
diff changeset
    61
		 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2887
diff changeset
    62
		 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
    63
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    64
  /**
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    65
   * \param n1 the name of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    66
   * \param v1 the value of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    67
   *
2705
a90b71c2afae doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2704
diff changeset
    68
   * Set these parameters on each ns3::CsmaNetDevice created
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2839
diff changeset
    69
   * 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
    70
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2887
diff changeset
    71
  void SetDeviceParameter (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
    72
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    73
  /**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    74
   * \param n1 the name of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    75
   * \param v1 the value of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    76
   *
2705
a90b71c2afae doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2704
diff changeset
    77
   * Set these parameters on each ns3::CsmaChannel created
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2839
diff changeset
    78
   * by CsmaHelper::Install
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    79
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2887
diff changeset
    80
  void SetChannelParameter (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
    81
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    82
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    83
   * \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
    84
   * \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
    85
   * \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
    86
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    87
   * 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
    88
   * 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
    89
   * 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
    90
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    91
   * 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
    92
   * been fully constructed.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    93
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
    94
  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
    95
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    96
   * \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
    97
   * \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
    98
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
    99
   * 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
   100
   * ns3::CsmaNetDevice type.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   101
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   102
  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
   103
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   104
   * \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
   105
   * \param n container of nodes.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   106
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   107
   * 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
   108
   * 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
   109
   * input nodes.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   110
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   111
  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
   112
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   113
   * \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
   114
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   115
   * 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
   116
   * ns3::CsmaNetDevice type
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   117
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   118
  static void EnablePcap (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
   119
2805
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   120
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   121
   * \param os output stream
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   122
   * \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
   123
   * \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
   124
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   125
   * 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
   126
   * 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
   127
   * 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
   128
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   129
  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
   130
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   131
   * \param os output stream
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   132
   * \param d device container
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   133
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   134
   * 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
   135
   * 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
   136
   * 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
   137
   * stdc++ output stream.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   138
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   139
  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
   140
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   141
   * \param os output stream
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   142
   * \param n node container
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   143
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   144
   * 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
   145
   * 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
   146
   * 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
   147
   * stdc++ output stream.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   148
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   149
  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
   150
  /**
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   151
   * \param os output stream
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   152
   *
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   153
   * 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
   154
   * 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
   155
   * stdc++ output stream.
cd246cf2edf3 add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2799
diff changeset
   156
   */
2789
47e92324cf4b configure tracing post-topology construction, not before.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2785
diff changeset
   157
  static void EnableAscii (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
   158
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
   159
  /**
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   160
   * \param c a set of nodes
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   161
   *
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   162
   * This method creates a simple ns3::CsmaChannel with the
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   163
   * attributes configured by CsmaHelper::SetChannelParameter and
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2839
diff changeset
   164
   * then calls CsmaHelper::Install.
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   165
   */
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2839
diff changeset
   166
  NetDeviceContainer Install (const NodeContainer &c);
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   167
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   168
  /**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   169
   * \param c a set of nodes
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   170
   * \param channel the channel to use as a backbone.
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   171
   *
2705
a90b71c2afae doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2704
diff changeset
   172
   * For each node in the input container, we create a ns3::CsmaNetDevice with
2704
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   173
   * the requested parameters, a queue for this NetDevice, and associate
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   174
   * the resulting ns3::NetDevice with the ns3::Node and ns3::CsmaChannel.
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
   175
   */
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2839
diff changeset
   176
  NetDeviceContainer Install (const NodeContainer &c, Ptr<CsmaChannel> channel);
2418
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   177
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   178
private:
2780
306f665014b6 add ascii and pcap tracing support to csma helper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2705
diff changeset
   179
  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
   180
  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
   181
  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
   182
  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
   183
  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
   184
  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
   185
  ObjectFactory m_queueFactory;
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   186
  ObjectFactory m_deviceFactory;
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   187
  ObjectFactory m_channelFactory;
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   188
};
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   189
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   190
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   191
} // namespace ns3
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   192
4ff45fa08781 an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   193
#endif /* CSMA_HELPER_H */