src/csma/model/csma-channel.cc
author Tom Henderson <tomh@tomh.org>
Mon, 28 Sep 2015 20:27:25 -0700
changeset 11676 05ea1489e509
parent 11261 844c0a62f232
permissions -rw-r--r--
bug 2184: Integer overflow in MacLow
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
10968
2d29fee2b7b8 [Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10652
diff changeset
    27
namespace ns3 {
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    28
10968
2d29fee2b7b8 [Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10652
diff changeset
    29
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
    30
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10410
diff changeset
    31
NS_OBJECT_ENSURE_REGISTERED (CsmaChannel);
2727
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> ()
11261
844c0a62f232 SetGroupName for csma module
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10968
diff changeset
    38
    .SetGroupName ("Csma")
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    39
    .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
    40
    .AddAttribute ("DataRate", 
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
    41
                   "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
    42
                   DataRateValue (DataRate (0xffffffff)),
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    43
                   MakeDataRateAccessor (&CsmaChannel::m_bps),
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    44
                   MakeDataRateChecker ())
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    45
    .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
    46
                   TimeValue (Seconds (0)),
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    47
                   MakeTimeAccessor (&CsmaChannel::m_delay),
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    48
                   MakeTimeChecker ())
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    49
  ;
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    50
  return tid;
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    51
}
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    52
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
    53
CsmaChannel::CsmaChannel ()
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    54
  :
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    55
    Channel ()
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    56
{
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
    57
  NS_LOG_FUNCTION_NOARGS ();
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    58
  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
    59
  m_deviceList.clear ();
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    60
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    61
7872
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    62
CsmaChannel::~CsmaChannel ()
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    63
{
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    64
  NS_LOG_FUNCTION (this);
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    65
  m_deviceList.clear ();
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    66
}
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
    67
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    68
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
    69
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
    70
{
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
    71
  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
    72
  NS_ASSERT (device != 0);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    73
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
    74
  CsmaDeviceRec rec (device);
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    75
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
    76
  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
    77
  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
    78
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    79
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
    80
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
    81
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
    82
{
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
    83
  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
    84
  NS_ASSERT (device != 0);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    85
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
    86
  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
    87
  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
    88
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    89
      if (it->devicePtr == device) 
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
    90
        {
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    91
          if (!it->active) 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    92
            {
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    93
              it->active = true;
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    94
              return true;
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    95
            } 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    96
          else 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    97
            {
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    98
              return false;
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
    99
            }
977
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
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   102
  return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   103
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   104
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   105
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
   106
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
   107
{
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
   108
  NS_LOG_FUNCTION (this << deviceId);
1504
36ecc970ba96 checkpoint debug to log
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   109
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
   110
  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
   111
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   112
      return false;
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
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   115
  if (m_deviceList[deviceId].active)
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   116
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   117
      return false;
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   118
    } 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   119
  else 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   120
    {
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   121
      m_deviceList[deviceId].active = true;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   122
      return true;
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
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   125
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   126
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
   127
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
   128
{
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
   129
  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
   130
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
   131
  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
   132
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   133
      if (!m_deviceList[deviceId].active)
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   134
        {
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
   135
          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
   136
          return false;
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
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   139
      m_deviceList[deviceId].active = false;
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
   140
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   141
      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
   142
        {
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
   143
          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
   144
        }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   145
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   146
      return true;
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   147
    } 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   148
  else 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   149
    {
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   150
      return false;
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
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   153
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   154
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
   155
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
   156
{
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
   157
  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
   158
  NS_ASSERT (device != 0);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   159
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   160
  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
   161
  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
   162
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   163
      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
   164
        {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   165
          it->active = false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   166
          return true;
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
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   169
  return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   170
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   171
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   172
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
   173
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
   174
{
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
   175
  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
   176
  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
   177
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   178
  if (m_state != IDLE)
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   179
    {
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
   180
      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
   181
      return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   182
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   183
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7170
diff changeset
   184
  if (!IsActive (srcId))
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   185
    {
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
   186
      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
   187
      return false;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   188
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   189
1504
36ecc970ba96 checkpoint debug to log
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   190
  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
   191
  m_currentPkt = p;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   192
  m_currentSrc = srcId;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   193
  m_state = TRANSMITTING;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   194
  return true;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   195
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   196
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   197
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
   198
CsmaChannel::IsActive (uint32_t deviceId)
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   199
{
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
   200
  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
   201
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   202
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   203
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
   204
CsmaChannel::TransmitEnd ()
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   205
{
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
   206
  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
   207
  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
   208
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
   209
  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
   210
  m_state = PROPAGATING;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   211
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   212
  bool retVal = true;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   213
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
   214
  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
   215
    {
3504
0261c789e17e 128 column pages
Craig Dowell <craigdo@ee.washington.edu>
parents: 3447
diff changeset
   216
      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
   217
      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
   218
    }
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   219
1504
36ecc970ba96 checkpoint debug to log
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   220
  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
   221
5523
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   222
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   223
  NS_LOG_LOGIC ("Receive");
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   224
5523
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   225
  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
   226
  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
   227
  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
   228
    {
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   229
      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
   230
        {
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   231
          // 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
   232
          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
   233
                                          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
   234
                                          &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
   235
                                          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
   236
        }
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   237
      devId++;
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
86e84169c725 Call Simulator::ScheduleWithContext from ns3::Channel subclasses when sending packets to other nodes
Guillaume Seguin <guillaume@segu.in>
parents: 4322
diff changeset
   240
  // 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
   241
  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
   242
                       this);
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   243
  return retVal;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   244
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   245
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   246
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
   247
CsmaChannel::PropagationCompleteEvent ()
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   248
{
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
   249
  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
   250
  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
   251
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
   252
  NS_ASSERT (m_state == PROPAGATING);
1222
81e2d44fc8ed fix race in csma-cd channel
Craig Dowell <craigdo@ee.washington.edu>
parents: 998
diff changeset
   253
  m_state = IDLE;
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   254
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   255
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   256
uint32_t
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   257
CsmaChannel::GetNumActDevices (void)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   258
{
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   259
  int numActDevices = 0;
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   260
  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
   261
  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
   262
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   263
      if (it->active)
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   264
        {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   265
          numActDevices++;
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
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   268
  return numActDevices;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   269
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   270
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   271
uint32_t
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   272
CsmaChannel::GetNDevices (void) const
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   273
{
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
   274
  return (m_deviceList.size ());
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   275
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   276
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   277
Ptr<CsmaNetDevice>
2720
3c7d9f8c9034 make ns3::Channel wholy pure.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
   278
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
   279
{
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
   280
  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
   281
  return netDevice;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   282
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   283
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   284
int32_t
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   285
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
   286
{
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   287
  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
   288
  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
   289
  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
   290
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   291
      if (it->devicePtr == device)
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   292
        {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   293
          if (it->active) 
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   294
            {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   295
              return i;
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   296
            } 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   297
          else 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   298
            {
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   299
              return -2;
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
        }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   302
      i++;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   303
    }
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   304
  return -1;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   305
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   306
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   307
bool
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   308
CsmaChannel::IsBusy (void)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   309
{
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   310
  if (m_state == IDLE) 
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   311
    {
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   312
      return false;
998
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   313
    } 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   314
  else 
85906b732a6a fix basic coding style issues
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 977
diff changeset
   315
    {
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   316
      return true;
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
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   319
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   320
DataRate
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   321
CsmaChannel::GetDataRate (void)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   322
{
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   323
  return m_bps;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   324
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   325
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   326
Time
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1222
diff changeset
   327
CsmaChannel::GetDelay (void)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   328
{
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   329
  return m_delay;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   330
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   331
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   332
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
   333
CsmaChannel::GetState (void)
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   334
{
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   335
  return m_state;
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   336
}
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   337
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   338
Ptr<NetDevice>
2720
3c7d9f8c9034 make ns3::Channel wholy pure.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
   339
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
   340
{
2747
4796695f60fb A CSMA channel typo (Bug 152 reported by Guillaume Vu-Brugier)
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 2727
diff changeset
   341
  return GetCsmaDevice (i);
1792
bca29198a7dd Make GetDevice return pointer to appropriately subclassed NetDevice
Tom Henderson <tomh@tomh.org>
parents: 1504
diff changeset
   342
}
bca29198a7dd Make GetDevice return pointer to appropriately subclassed NetDevice
Tom Henderson <tomh@tomh.org>
parents: 1504
diff changeset
   343
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
   344
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
   345
{
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
  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
   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
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
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
   350
{
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
  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
   352
  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
   353
}
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
   354
7872
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   355
CsmaDeviceRec::CsmaDeviceRec (CsmaDeviceRec const &deviceRec)
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   356
{
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   357
  devicePtr = deviceRec.devicePtr;
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   358
  active = deviceRec.active;
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   359
}
ff978a217184 bug 1420: no python bindings for csma-layout
Tom Henderson <tomh@tomh.org>
parents: 7256
diff changeset
   360
7170
8417cff6e353 csma coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6852
diff changeset
   361
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
   362
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
   363
{
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
  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
   365
}
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
   366
977
09bf4e458015 a csma/cd NetDevice subclass and a test script
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
diff changeset
   367
} // namespace ns3