src/helper/emu-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:
3828
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
/*
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     3
 * Copyright (c) 2008 University of Washington
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     4
 *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
 *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
 *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    17
 */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    18
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    19
#ifndef EMU_HELPER_H
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    20
#define EMU_HELPER_H
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    21
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    22
#include <string>
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    23
#include <ostream>
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    24
#include "ns3/attribute.h"
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    25
#include "ns3/object-factory.h"
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    26
#include "ns3/net-device-container.h"
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    27
#include "ns3/node-container.h"
3830
8862b9be62bb rework to address suid root issues
Craig Dowell <craigdo@ee.washington.edu>
parents: 3828
diff changeset
    28
#include "ns3/emu-net-device.h"
3828
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    29
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    30
namespace ns3 {
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    31
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    32
class Packet;
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    33
class PcapWriter;
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    34
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    35
/**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    36
 * \brief build a set of EmuNetDevice objects
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    37
 */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    38
class EmuHelper
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    39
{
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    40
public:
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    41
  EmuHelper ();
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    42
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    43
  /**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    44
   * \param type the type of queue
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    45
   * \param n1 the name of the attribute to set on the queue
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    46
   * \param v1 the value of the attribute to set on the queue
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    47
   * \param n2 the name of the attribute to set on the queue
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    48
   * \param v2 the value of the attribute to set on the queue
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    49
   * \param n3 the name of the attribute to set on the queue
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    50
   * \param v3 the value of the attribute to set on the queue
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
   * \param n4 the name of the attribute to set on the queue
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    52
   * \param v4 the value of the attribute to set on the queue
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    53
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    54
   * Set the type of queue to create and associated to each
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    55
   * EmuNetDevice created through EmuHelper::Install.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    56
   */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    57
  void SetQueue (std::string type,
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    58
    std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    59
    std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    60
    std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    61
    std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    62
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    63
  /**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    64
   * \param n1 the name of the attribute to set
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    65
   * \param v1 the value of the attribute to set
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    66
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    67
   * Set these attributes on each ns3::EmuNetDevice created
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    68
   * by EmuHelper::Install
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    69
   */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    70
  void SetAttribute (std::string n1, const AttributeValue &v1);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    71
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    72
  /**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    73
   * \param filename filename prefix to use for pcap files.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    74
   * \param nodeid the id of the node to generate pcap output for.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    75
   * \param deviceid the id of the device to generate pcap output for.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    76
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    77
   * Generate a pcap file which contains the link-level data observed
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    78
   * by the specified deviceid within the specified nodeid. The pcap
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    79
   * data is stored in the file prefix-nodeid-deviceid.pcap.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    80
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    81
   * This method should be invoked after the network topology has 
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    82
   * been fully constructed.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    83
   */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    84
  static void EnablePcap (std::string filename, uint32_t nodeid, 
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    85
    uint32_t deviceid);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    86
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    87
  /**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    88
   * \param filename filename prefix to use for pcap files.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    89
   * \param d container of devices of type ns3::EmuNetDevice
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    90
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    91
   * Enable pcap output on each input device which is of the
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    92
   * ns3::EmuNetDevice type.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    93
   */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    94
  static void EnablePcap (std::string filename, NetDeviceContainer d);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    95
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    96
  /**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    97
   * \param filename filename prefix to use for pcap files.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    98
   * \param n container of nodes.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    99
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   100
   * Enable pcap output on each device which is of the
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   101
   * ns3::EmuNetDevice type and which is located in one of the 
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   102
   * input nodes.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   103
   */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   104
  static void EnablePcap (std::string filename, NodeContainer n);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   105
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   106
  /**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   107
   * \param filename filename prefix to use for pcap files.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   108
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   109
   * Enable pcap output on each device which is of the
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   110
   * ns3::EmuNetDevice type
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   111
   */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   112
  static void EnablePcapAll (std::string filename);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   113
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   114
  /**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   115
   * \param os output stream
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   116
   * \param nodeid the id of the node to generate ascii output for.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   117
   * \param deviceid the id of the device to generate ascii output for.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   118
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   119
   * Enable ascii output on the specified deviceid within the
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   120
   * specified nodeid if it is of type ns3::EmuNetDevice and dump 
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   121
   * that to the specified stdc++ output stream.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   122
   */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   123
  static void EnableAscii (std::ostream &os, uint32_t nodeid, 
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   124
    uint32_t deviceid);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   125
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   126
  /**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   127
   * \param os output stream
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   128
   * \param d device container
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   129
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   130
   * Enable ascii output on each device which is of the
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   131
   * ns3::EmuNetDevice type and which is located in the input
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   132
   * device container and dump that to the specified
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   133
   * stdc++ output stream.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   134
   */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   135
  static void EnableAscii (std::ostream &os, NetDeviceContainer d);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   136
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   137
  /**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   138
   * \param os output stream
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   139
   * \param n node container
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   140
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   141
   * Enable ascii output on each device which is of the
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   142
   * ns3::EmuNetDevice type and which is located in one
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   143
   * of the input node and dump that to the specified
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   144
   * stdc++ output stream.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   145
   */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   146
  static void EnableAscii (std::ostream &os, NodeContainer n);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   147
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   148
  /**
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   149
   * \param os output stream
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   150
   *
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   151
   * Enable ascii output on each device which is of the
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   152
   * ns3::EmuNetDevice type and dump that to the specified
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   153
   * stdc++ output stream.
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   154
   */
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   155
  static void EnableAsciiAll (std::ostream &os);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   156
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   157
  /**
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   158
   * This method creates an ns3::EmuNetDevice with the attributes configured by 
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   159
   * EmuHelper::SetDeviceAttribute and then adds the device to the node.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   160
   *
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   161
   * \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: 3830
diff changeset
   162
   * \returns A containter holding the added net device.
3828
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   163
   */
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   164
  NetDeviceContainer Install (Ptr<Node> node) const;
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   165
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   166
  /**
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   167
   * This method creates an ns3::EmuNetDevice 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
   168
   * EmuHelper::SetDeviceAttribute and then adds the device to the node.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   169
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   170
   * \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
   171
   * \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
   172
   */
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   173
  NetDeviceContainer Install (std::string nodeName) const;
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   174
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
   175
  /**
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   176
   * 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: 3830
diff changeset
   177
   * ns3::EmuNetDevice (with the attributes configured by 
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   178
   * EmuHelper::SetDeviceAttribute); adds the device to the node.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   179
   *
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   180
   * \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: 3830
diff changeset
   181
   * \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: 3830
diff changeset
   182
   */
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   183
  NetDeviceContainer Install (const NodeContainer &c) const;
3828
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   184
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   185
private:
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3830
diff changeset
   186
  Ptr<NetDevice> InstallPriv (Ptr<Node> node) const;
3828
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   187
  static void RxEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   188
  static void EnqueueEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   189
  static void AsciiEnqueueEvent (std::ostream *os, std::string path, 
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   190
    Ptr<const Packet> packet);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   191
  static void AsciiDequeueEvent (std::ostream *os, std::string path, 
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   192
    Ptr<const Packet> packet);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   193
  static void AsciiDropEvent (std::ostream *os, std::string path, 
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   194
    Ptr<const Packet> packet);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   195
  static void AsciiRxEvent (std::ostream *os, std::string path, 
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   196
    Ptr<const Packet> packet);
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   197
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   198
  ObjectFactory m_queueFactory;
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   199
  ObjectFactory m_deviceFactory;
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   200
};
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   201
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   202
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   203
} // namespace ns3
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   204
337b244e6d8f add in the helpers
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   205
#endif /* EMU_HELPER_H */