src/csma/model/csma-channel.cc
author Mitch Watrous
Tue, 14 Aug 2012 09:12:05 -0700
changeset 8974 bfe1b44645d8
parent 7872 ff978a217184
child 10410 4d4eb8097fa3
permissions -rw-r--r--
Replace src/csma usage of RandomVariable with RandomVariableStream
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
     2
/*
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
     3
 * Copyright (c) 2007 Emmanuelle Laprise
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
     4
 *
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
     8
 *
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    12
 * GNU General Public License for more details.
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    13
 *
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    17
 *
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    18
 * Author: Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    19
 */
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    20
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
    21
#include "csma-channel.h"
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
    22
#include "csma-net-device.h"
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    23
#include "ns3/packet.h"
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    24
#include "ns3/simulator.h"
1504
36ecc970ba96 checkpoint debug to log
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    25
#include "ns3/log.h"
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    26
1504
36ecc970ba96 checkpoint debug to log
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    27
NS_LOG_COMPONENT_DEFINE ("CsmaChannel");
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    28
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    29
namespace ns3 {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    30
2727
c3956ff16abf ensure registration.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2720
diff changeset
    31
NS_OBJECT_ENSURE_REGISTERED (CsmaChannel);
c3956ff16abf ensure registration.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2720
diff changeset
    32
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    33
TypeId
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    34
CsmaChannel::GetTypeId (void)
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    35
{
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2592
diff changeset
    36
  static TypeId tid = TypeId ("ns3::CsmaChannel")
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    37
    .SetParent<Channel> ()
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    38
    .AddConstructor<CsmaChannel> ()
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
    39
    .AddAttribute ("DataRate", 
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
    40
                   "The transmission data rate to be provided to devices connected to the channel",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
    41
                   DataRateValue (DataRate (0xffffffff)),
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    42
                   MakeDataRateAccessor (&CsmaChannel::m_bps),
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    43
                   MakeDataRateChecker ())
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    44
    .AddAttribute ("Delay", "Transmission delay through the channel",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
    45
                   TimeValue (Seconds (0)),
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    46
                   MakeTimeAccessor (&CsmaChannel::m_delay),
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    47
                   MakeTimeChecker ())
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    48
  ;
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    49
  return tid;
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    50
}
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    51
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
    52
CsmaChannel::CsmaChannel ()
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    53
  :
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    54
    Channel ()
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    55
{
2983
e3a416fe9dd5 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
    56
  NS_LOG_FUNCTION_NOARGS ();
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    57
  m_state = IDLE;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7170
diff changeset
    58
  m_deviceList.clear ();
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    59
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    60
7872
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    61
CsmaChannel::~CsmaChannel ()
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    62
{
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    63
  NS_LOG_FUNCTION (this);
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    64
  m_deviceList.clear ();
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    65
}
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    66
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    67
int32_t
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
    68
CsmaChannel::Attach (Ptr<CsmaNetDevice> device)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    69
{
2983
e3a416fe9dd5 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
    70
  NS_LOG_FUNCTION (this << device);
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
    71
  NS_ASSERT (device != 0);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    72
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
    73
  CsmaDeviceRec rec (device);
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    74
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
    75
  m_deviceList.push_back (rec);
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
    76
  return (m_deviceList.size () - 1);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    77
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    78
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    79
bool
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
    80
CsmaChannel::Reattach (Ptr<CsmaNetDevice> device)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    81
{
2983
e3a416fe9dd5 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
    82
  NS_LOG_FUNCTION (this << device);
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
    83
  NS_ASSERT (device != 0);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    84
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
    85
  std::vector<CsmaDeviceRec>::iterator it;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7170
diff changeset
    86
  for (it = m_deviceList.begin (); it < m_deviceList.end ( ); it++)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    87
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    88
      if (it->devicePtr == device) 
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    89
        {
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    90
          if (!it->active) 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    91
            {
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    92
              it->active = true;
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    93
              return true;
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    94
            } 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    95
          else 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    96
            {
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    97
              return false;
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    98
            }
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    99
        }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   100
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   101
  return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   102
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   103
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   104
bool
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   105
CsmaChannel::Reattach (uint32_t deviceId)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   106
{
2983
e3a416fe9dd5 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
   107
  NS_LOG_FUNCTION (this << deviceId);
1504
36ecc970ba96 checkpoint debug to log
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   108
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   109
  if (deviceId < m_deviceList.size ())
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   110
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   111
      return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   112
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   113
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   114
  if (m_deviceList[deviceId].active)
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   115
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   116
      return false;
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   117
    } 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   118
  else 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   119
    {
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   120
      m_deviceList[deviceId].active = true;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   121
      return true;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   122
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   123
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   124
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   125
bool
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   126
CsmaChannel::Detach (uint32_t deviceId)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   127
{
2983
e3a416fe9dd5 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
   128
  NS_LOG_FUNCTION (this << deviceId);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   129
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   130
  if (deviceId < m_deviceList.size ())
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   131
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   132
      if (!m_deviceList[deviceId].active)
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   133
        {
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
   134
          NS_LOG_WARN ("CsmaChannel::Detach(): Device is already detached (" << deviceId << ")");
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   135
          return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   136
        }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   137
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   138
      m_deviceList[deviceId].active = false;
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
   139
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   140
      if ((m_state == TRANSMITTING) && (m_currentSrc == deviceId))
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   141
        {
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
   142
          NS_LOG_WARN ("CsmaChannel::Detach(): Device is currently" << "transmitting (" << deviceId << ")");
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   143
        }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   144
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   145
      return true;
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   146
    } 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   147
  else 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   148
    {
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   149
      return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   150
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   151
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   152
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   153
bool
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   154
CsmaChannel::Detach (Ptr<CsmaNetDevice> device)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   155
{
2983
e3a416fe9dd5 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
   156
  NS_LOG_FUNCTION (this << device);
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   157
  NS_ASSERT (device != 0);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   158
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   159
  std::vector<CsmaDeviceRec>::iterator it;
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   160
  for (it = m_deviceList.begin (); it < m_deviceList.end (); it++) 
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   161
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   162
      if ((it->devicePtr == device) && (it->active)) 
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   163
        {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   164
          it->active = false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   165
          return true;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   166
        }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   167
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   168
  return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   169
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   170
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   171
bool
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   172
CsmaChannel::TransmitStart (Ptr<Packet> p, uint32_t srcId)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   173
{
2983
e3a416fe9dd5 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
   174
  NS_LOG_FUNCTION (this << p << srcId);
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1504
diff changeset
   175
  NS_LOG_INFO ("UID is " << p->GetUid () << ")");
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   176
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   177
  if (m_state != IDLE)
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   178
    {
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   179
      NS_LOG_WARN ("CsmaChannel::TransmitStart(): State is not IDLE");
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   180
      return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   181
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   182
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7170
diff changeset
   183
  if (!IsActive (srcId))
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   184
    {
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
   185
      NS_LOG_ERROR ("CsmaChannel::TransmitStart(): Seclected source is not currently attached to network");
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   186
      return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   187
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   188
1504
36ecc970ba96 checkpoint debug to log
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   189
  NS_LOG_LOGIC ("switch to TRANSMITTING");
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   190
  m_currentPkt = p;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   191
  m_currentSrc = srcId;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   192
  m_state = TRANSMITTING;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   193
  return true;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   194
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   195
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   196
bool
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7170
diff changeset
   197
CsmaChannel::IsActive (uint32_t deviceId)
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   198
{
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   199
  return (m_deviceList[deviceId].active);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   200
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   201
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   202
bool
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7170
diff changeset
   203
CsmaChannel::TransmitEnd ()
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   204
{
2983
e3a416fe9dd5 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
   205
  NS_LOG_FUNCTION (this << m_currentPkt << m_currentSrc);
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1504
diff changeset
   206
  NS_LOG_INFO ("UID is " << m_currentPkt->GetUid () << ")");
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   207
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   208
  NS_ASSERT (m_state == TRANSMITTING);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   209
  m_state = PROPAGATING;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   210
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   211
  bool retVal = true;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   212
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   213
  if (!IsActive (m_currentSrc))
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   214
    {
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
   215
      NS_LOG_ERROR ("CsmaChannel::TransmitEnd(): Seclected source was detached before the end of the transmission");
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   216
      retVal = false;
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   217
    }
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   218
1504
36ecc970ba96 checkpoint debug to log
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   219
  NS_LOG_LOGIC ("Schedule event in " << m_delay.GetSeconds () << " sec");
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   220
5523
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   221
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   222
  NS_LOG_LOGIC ("Receive");
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   223
5523
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   224
  std::vector<CsmaDeviceRec>::iterator it;
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   225
  uint32_t devId = 0;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7170
diff changeset
   226
  for (it = m_deviceList.begin (); it < m_deviceList.end (); it++)
5523
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   227
    {
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   228
      if (it->IsActive ())
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   229
        {
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   230
          // schedule reception events
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   231
          Simulator::ScheduleWithContext (it->devicePtr->GetNode ()->GetId (),
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   232
                                          m_delay,
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   233
                                          &CsmaNetDevice::Receive, it->devicePtr,
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   234
                                          m_currentPkt->Copy (), m_deviceList[m_currentSrc].devicePtr);
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   235
        }
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   236
      devId++;
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   237
    }
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   238
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   239
  // also schedule for the tx side to go back to IDLE
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   240
  Simulator::Schedule (m_delay, &CsmaChannel::PropagationCompleteEvent,
5523
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   241
                       this);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   242
  return retVal;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   243
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   244
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   245
void
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7170
diff changeset
   246
CsmaChannel::PropagationCompleteEvent ()
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   247
{
2983
e3a416fe9dd5 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
   248
  NS_LOG_FUNCTION (this << m_currentPkt);
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1504
diff changeset
   249
  NS_LOG_INFO ("UID is " << m_currentPkt->GetUid () << ")");
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   250
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   251
  NS_ASSERT (m_state == PROPAGATING);
1222
81e2d44fc8ed fix race in csma-cd channel
Craig Dowell <craigdo@ee.washington.edu>
parents: 998
diff changeset
   252
  m_state = IDLE;
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   253
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   254
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   255
uint32_t
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   256
CsmaChannel::GetNumActDevices (void)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   257
{
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   258
  int numActDevices = 0;
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   259
  std::vector<CsmaDeviceRec>::iterator it;
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   260
  for (it = m_deviceList.begin (); it < m_deviceList.end (); it++) 
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   261
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   262
      if (it->active)
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   263
        {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   264
          numActDevices++;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   265
        }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   266
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   267
  return numActDevices;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   268
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   269
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   270
uint32_t
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   271
CsmaChannel::GetNDevices (void) const
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   272
{
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   273
  return (m_deviceList.size ());
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   274
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   275
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   276
Ptr<CsmaNetDevice>
2720
3c7d9f8c9034 make ns3::Channel wholy pure.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
   277
CsmaChannel::GetCsmaDevice (uint32_t i) const
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   278
{
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   279
  Ptr<CsmaNetDevice> netDevice = m_deviceList[i].devicePtr;
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   280
  return netDevice;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   281
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   282
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   283
int32_t
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   284
CsmaChannel::GetDeviceNum (Ptr<CsmaNetDevice> device)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   285
{
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   286
  std::vector<CsmaDeviceRec>::iterator it;
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   287
  int i = 0;
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   288
  for (it = m_deviceList.begin (); it < m_deviceList.end (); it++) 
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   289
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   290
      if (it->devicePtr == device)
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   291
        {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   292
          if (it->active) 
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   293
            {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   294
              return i;
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   295
            } 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   296
          else 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   297
            {
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   298
              return -2;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   299
            }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   300
        }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   301
      i++;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   302
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   303
  return -1;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   304
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   305
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   306
bool
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   307
CsmaChannel::IsBusy (void)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   308
{
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   309
  if (m_state == IDLE) 
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   310
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   311
      return false;
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   312
    } 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   313
  else 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   314
    {
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   315
      return true;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   316
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   317
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   318
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   319
DataRate
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   320
CsmaChannel::GetDataRate (void)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   321
{
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   322
  return m_bps;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   323
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   324
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   325
Time
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   326
CsmaChannel::GetDelay (void)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   327
{
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   328
  return m_delay;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   329
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   330
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   331
WireState
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   332
CsmaChannel::GetState (void)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   333
{
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   334
  return m_state;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   335
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   336
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   337
Ptr<NetDevice>
2720
3c7d9f8c9034 make ns3::Channel wholy pure.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
   338
CsmaChannel::GetDevice (uint32_t i) const
1792
bca29198a7dd Make GetDevice return pointer to appropriately subclassed NetDevice
Tom Henderson <tomh@tomh.org>
parents: 1504
diff changeset
   339
{
2747
4796695f60fb A CSMA channel typo (Bug 152 reported by Guillaume Vu-Brugier)
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 2727
diff changeset
   340
  return GetCsmaDevice (i);
1792
bca29198a7dd Make GetDevice return pointer to appropriately subclassed NetDevice
Tom Henderson <tomh@tomh.org>
parents: 1504
diff changeset
   341
}
bca29198a7dd Make GetDevice return pointer to appropriately subclassed NetDevice
Tom Henderson <tomh@tomh.org>
parents: 1504
diff changeset
   342
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   343
CsmaDeviceRec::CsmaDeviceRec ()
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   344
{
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   345
  active = false;
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   346
}
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   347
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   348
CsmaDeviceRec::CsmaDeviceRec (Ptr<CsmaNetDevice> device)
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   349
{
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   350
  devicePtr = device; 
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   351
  active = true;
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   352
}
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   353
7872
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   354
CsmaDeviceRec::CsmaDeviceRec (CsmaDeviceRec const &deviceRec)
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   355
{
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   356
  devicePtr = deviceRec.devicePtr;
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   357
  active = deviceRec.active;
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   358
}
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   359
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   360
bool
3257
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   361
CsmaDeviceRec::IsActive () 
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   362
{
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   363
  return active;
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   364
}
ba198dad54a2 CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox
Craig Dowell <craigdo@ee.washington.edu>
parents: 2989
diff changeset
   365
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   366
} // namespace ns3