128 column pages
authorCraig Dowell <craigdo@ee.washington.edu>
Sun Aug 03 21:55:49 2008 -0700 (18 months ago)
changeset 35040261c789e17e
parent 3503 b8cccd54da26
child 3505 16005bad2e0b
child 3506 cba7b2b80fe8
128 column pages
src/devices/csma/backoff.cc
src/devices/csma/backoff.h
src/devices/csma/csma-channel.cc
src/devices/csma/csma-channel.h
src/devices/csma/csma-net-device.cc
src/devices/csma/csma-net-device.h
     1.1 --- a/src/devices/csma/backoff.cc	Sun Aug 03 09:14:07 2008 -0700
     1.2 +++ b/src/devices/csma/backoff.cc	Sun Aug 03 21:55:49 2008 -0700
     1.3 @@ -22,7 +22,7 @@
     1.4  
     1.5  namespace ns3 {
     1.6  
     1.7 -Backoff::Backoff() 
     1.8 +Backoff::Backoff () 
     1.9  {
    1.10    m_slotTime = MicroSeconds(1);
    1.11    m_minSlots = 1;
    1.12 @@ -33,8 +33,7 @@
    1.13    ResetBackoffTime();
    1.14  }
    1.15  
    1.16 -Backoff::Backoff(Time slotTime, uint32_t minSlots, uint32_t maxSlots,
    1.17 -                 uint32_t ceiling, uint32_t maxRetries)
    1.18 +Backoff::Backoff(Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t ceiling, uint32_t maxRetries)
    1.19  {
    1.20    m_slotTime = slotTime;
    1.21    m_minSlots = minSlots;
    1.22 @@ -50,32 +49,42 @@
    1.23    uint32_t ceiling;
    1.24  
    1.25    if ((m_ceiling > 0) &&(m_numBackoffRetries > m_ceiling))
    1.26 -    ceiling = m_ceiling;
    1.27 +    {
    1.28 +      ceiling = m_ceiling;
    1.29 +    }
    1.30    else
    1.31 -    ceiling = m_numBackoffRetries;
    1.32 +    {
    1.33 +      ceiling = m_numBackoffRetries;
    1.34 +    }
    1.35  
    1.36    uint32_t minSlot = m_minSlots;
    1.37 -  uint32_t maxSlot = (uint32_t)pow(2, ceiling) - 1;
    1.38 +  uint32_t maxSlot = (uint32_t)pow (2, ceiling) - 1;
    1.39    if (maxSlot > m_maxSlots)
    1.40 -    maxSlot = m_maxSlots;
    1.41 +    {
    1.42 +      maxSlot = m_maxSlots;
    1.43 +    }
    1.44  
    1.45 -  uint32_t backoffSlots = 
    1.46 -    (uint32_t)UniformVariable::GetSingleValue(minSlot, maxSlot);
    1.47 +  uint32_t backoffSlots = (uint32_t)UniformVariable::GetSingleValue(minSlot, maxSlot);
    1.48  
    1.49    backoff = Scalar(backoffSlots) * m_slotTime;
    1.50    return (backoff);
    1.51  }
    1.52  
    1.53 -void Backoff::ResetBackoffTime (void)
    1.54 +void 
    1.55 +Backoff::ResetBackoffTime (void)
    1.56  {
    1.57    m_numBackoffRetries = 0;
    1.58  }
    1.59  
    1.60 -bool Backoff::MaxRetriesReached(void) {
    1.61 +bool 
    1.62 +Backoff::MaxRetriesReached (void) 
    1.63 +{
    1.64    return (m_numBackoffRetries >= m_maxRetries);
    1.65  }
    1.66  
    1.67 -void Backoff::IncrNumRetries(void) {
    1.68 +void 
    1.69 +Backoff::IncrNumRetries (void) 
    1.70 +{
    1.71    m_numBackoffRetries++;
    1.72  }
    1.73  
     2.1 --- a/src/devices/csma/backoff.h	Sun Aug 03 09:14:07 2008 -0700
     2.2 +++ b/src/devices/csma/backoff.h	Sun Aug 03 21:55:49 2008 -0700
     2.3 @@ -36,49 +36,63 @@
     2.4  
     2.5  class Backoff {
     2.6  public:
     2.7 -  uint32_t m_minSlots; // Minimum number of backoff slots (when
     2.8 -                       // multiplied by m_slotTime, determines minimum
     2.9 -                       // backoff time)
    2.10 -  uint32_t m_maxSlots; // Maximim number of backoff slots (when
    2.11 -                       // multiplied by m_slotTime, determines
    2.12 -                       // maximum backoff time)
    2.13 -  uint32_t m_ceiling;  // Caps the exponential function when the
    2.14 -                       // number of retries reaches m_ceiling
    2.15 -  uint32_t m_maxRetries; // Maximum number of transmission retries
    2.16 -                         // before the packet is dropped.
    2.17 -  Time     m_slotTime; // Length of one slot. A slot time, it usually
    2.18 -                       // the packet transmission time, if the packet
    2.19 -                       // size is fixed.
    2.20 +  /**
    2.21 +   * Minimum number of backoff slots (when multiplied by m_slotTime, determines minimum backoff time)
    2.22 +   */
    2.23 +  uint32_t m_minSlots; 
    2.24  
    2.25 -  Backoff();
    2.26 -  Backoff(Time slotTime, uint32_t minSlots, uint32_t maxSlots, 
    2.27 -          uint32_t ceiling, uint32_t maxRetries);
    2.28 +  /**
    2.29 +   * Maximim number of backoff slots (when multiplied by m_slotTime, determines maximum backoff time)
    2.30 +   */
    2.31 +  uint32_t m_maxSlots; 
    2.32 +
    2.33 +  /**
    2.34 +   * Caps the exponential function when the number of retries reaches m_ceiling.
    2.35 +   */
    2.36 +  uint32_t m_ceiling;
    2.37 +
    2.38 +  /**
    2.39 +   * Maximum number of transmission retries before the packet is dropped.
    2.40 +   */
    2.41 +  uint32_t m_maxRetries;
    2.42 +
    2.43 +  /**
    2.44 +   * Length of one slot. A slot time, it usually the packet transmission time, if the packet size is fixed.
    2.45 +   */
    2.46 +  Time m_slotTime;
    2.47 +
    2.48 +  Backoff (void);
    2.49 +  Backoff (Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t ceiling, uint32_t maxRetries);
    2.50  
    2.51    /**
    2.52     * \return The amount of time that the net device should wait before
    2.53     * trying to retransmit the packet
    2.54     */
    2.55    Time GetBackoffTime();
    2.56 +
    2.57    /**
    2.58     * Indicates to the backoff object that the last packet was
    2.59     * successfully transmitted and that the number of retries should be
    2.60     * reset to 0.
    2.61     */
    2.62 -  void ResetBackoffTime();
    2.63 +  void ResetBackoffTime (void);
    2.64 +
    2.65    /**
    2.66     * \return True if the maximum number of retries has been reached
    2.67     */
    2.68 -  bool MaxRetriesReached();
    2.69 +  bool MaxRetriesReached (void);
    2.70 +
    2.71    /**
    2.72     * Increments the number of retries by 1.
    2.73     */
    2.74 -  void IncrNumRetries();
    2.75 +  void IncrNumRetries (void);
    2.76  
    2.77  private:
    2.78 -  uint32_t m_numBackoffRetries; // Number of times that the
    2.79 -                                // transmitter has tried to
    2.80 -                                // unsuccessfully transmit the current
    2.81 -                                // packet
    2.82 +
    2.83 +  /**
    2.84 +   * Number of times that the transmitter has tried to unsuccessfully transmit the current packet.
    2.85 +   */
    2.86 +  uint32_t m_numBackoffRetries;
    2.87  };
    2.88  
    2.89  }; // namespace ns3
     3.1 --- a/src/devices/csma/csma-channel.cc	Sun Aug 03 09:14:07 2008 -0700
     3.2 +++ b/src/devices/csma/csma-channel.cc	Sun Aug 03 21:55:49 2008 -0700
     3.3 @@ -37,8 +37,7 @@
     3.4      .SetParent<Channel> ()
     3.5      .AddConstructor<CsmaChannel> ()
     3.6      .AddAttribute ("DataRate", 
     3.7 -                   "The transmission data rate to be provided to devices "
     3.8 -                   "connected to the channel",
     3.9 +                   "The transmission data rate to be provided to devices connected to the channel",
    3.10                     DataRateValue (DataRate (0xffffffff)),
    3.11                     MakeDataRateAccessor (&CsmaChannel::m_bps),
    3.12                     MakeDataRateChecker ())
    3.13 @@ -126,16 +125,15 @@
    3.14      {
    3.15        if (!m_deviceList[deviceId].active)
    3.16          {
    3.17 -          NS_LOG_WARN ("CsmaChannel::Detach(): "
    3.18 -            "Device is already detached (" << deviceId << ")");
    3.19 +          NS_LOG_WARN ("CsmaChannel::Detach(): Device is already detached (" << deviceId << ")");
    3.20            return false;
    3.21          }
    3.22  
    3.23        m_deviceList[deviceId].active = false;
    3.24 +
    3.25        if ((m_state == TRANSMITTING) && (m_currentSrc == deviceId))
    3.26          {
    3.27 -          NS_LOG_WARN ("CsmaChannel::Detach(): Device is currently" << 
    3.28 -            "transmitting (" << deviceId << ")");
    3.29 +          NS_LOG_WARN ("CsmaChannel::Detach(): Device is currently" << "transmitting (" << deviceId << ")");
    3.30          }
    3.31  
    3.32        return true;
    3.33 @@ -178,8 +176,7 @@
    3.34  
    3.35    if (!IsActive(srcId))
    3.36      {
    3.37 -      NS_LOG_ERROR ("CsmaChannel::TransmitStart(): "
    3.38 -        "Seclected source is not currently attached to network");
    3.39 +      NS_LOG_ERROR ("CsmaChannel::TransmitStart(): Seclected source is not currently attached to network");
    3.40        return false;
    3.41      }
    3.42  
    3.43 @@ -209,8 +206,7 @@
    3.44  
    3.45    if (!IsActive (m_currentSrc))
    3.46      {
    3.47 -      NS_LOG_ERROR ("CsmaChannel::TransmitEnd(): "
    3.48 -        "Seclected source was detached before the end of the transmission");
    3.49 +      NS_LOG_ERROR ("CsmaChannel::TransmitEnd(): Seclected source was detached before the end of the transmission");
    3.50        retVal = false;
    3.51      }
    3.52  
    3.53 @@ -259,10 +255,6 @@
    3.54    return numActDevices;
    3.55  }
    3.56  
    3.57 -//
    3.58 -// This is not the number of active devices. This is the total number
    3.59 -// of devices even if some were detached after.
    3.60 -//
    3.61    uint32_t 
    3.62  CsmaChannel::GetNDevices (void) const
    3.63  {
     4.1 --- a/src/devices/csma/csma-channel.h	Sun Aug 03 09:14:07 2008 -0700
     4.2 +++ b/src/devices/csma/csma-channel.h	Sun Aug 03 21:55:49 2008 -0700
     4.3 @@ -32,38 +32,36 @@
     4.4  
     4.5  class CsmaNetDevice;
     4.6  
     4.7 -  /**
     4.8 -   * \brief CsmaNetDevice Record 
     4.9 -   *
    4.10 -   * Stores the information related to each net device that is
    4.11 -   * connected to the channel. 
    4.12 -   */
    4.13 -  class CsmaDeviceRec {
    4.14 -  public:
    4.15 -    Ptr< CsmaNetDevice > devicePtr; /// Pointer to the net device
    4.16 -    bool                       active;    /// Is net device enabled to TX/RX
    4.17 +/**
    4.18 + * \brief CsmaNetDevice Record 
    4.19 + *
    4.20 + * Stores the information related to each net device that is
    4.21 + * connected to the channel. 
    4.22 + */
    4.23 +class CsmaDeviceRec {
    4.24 +public:
    4.25 +  Ptr< CsmaNetDevice > devicePtr; /// Pointer to the net device
    4.26 +  bool                       active;    /// Is net device enabled to TX/RX
    4.27  
    4.28 -    CsmaDeviceRec();
    4.29 -    CsmaDeviceRec(Ptr< CsmaNetDevice > device);
    4.30 -    /*
    4.31 -     * \return If the net device pointed to by the devicePtr is active
    4.32 -     * and ready to RX/TX.
    4.33 -     */
    4.34 -    bool IsActive();                   
    4.35 -  };
    4.36 +  CsmaDeviceRec();
    4.37 +  CsmaDeviceRec(Ptr< CsmaNetDevice > device);
    4.38  
    4.39    /**
    4.40 -   * Current state of the channel
    4.41 -   */ 
    4.42 -  enum WireState
    4.43 -    {
    4.44 -      IDLE,          /**< Channel is IDLE, no packet is being
    4.45 -                        transmitted */
    4.46 -      TRANSMITTING,  /**< Channel is BUSY, a packet is being written
    4.47 -                        by a net device */
    4.48 -      PROPAGATING    /**< Channel is BUSY, packet is propagating to
    4.49 -                        all attached net devices */
    4.50 -    };
    4.51 +   * \return If the net device pointed to by the devicePtr is active
    4.52 +   * and ready to RX/TX.
    4.53 +   */
    4.54 +  bool IsActive();                   
    4.55 +};
    4.56 +
    4.57 +/**
    4.58 + * Current state of the channel
    4.59 + */ 
    4.60 +enum WireState
    4.61 +  {
    4.62 +    IDLE,          /**< Channel is IDLE, no packet is being transmitted */
    4.63 +    TRANSMITTING,  /**< Channel is BUSY, a packet is being written by a net device */
    4.64 +    PROPAGATING    /**< Channel is BUSY, packet is propagating to all attached net devices */
    4.65 +  };
    4.66  
    4.67  /**
    4.68   * \brief Csma Channel.
     5.1 --- a/src/devices/csma/csma-net-device.cc	Sun Aug 03 09:14:07 2008 -0700
     5.2 +++ b/src/devices/csma/csma-net-device.cc	Sun Aug 03 21:55:49 2008 -0700
     5.3 @@ -39,61 +39,61 @@
     5.4  
     5.5  NS_OBJECT_ENSURE_REGISTERED (CsmaNetDevice);
     5.6  
     5.7 -TypeId 
     5.8 +  TypeId 
     5.9  CsmaNetDevice::GetTypeId (void)
    5.10  {
    5.11    static TypeId tid = TypeId ("ns3::CsmaNetDevice")
    5.12      .SetParent<NetDevice> ()
    5.13      .AddConstructor<CsmaNetDevice> ()
    5.14      .AddAttribute ("Address", 
    5.15 -       "The MAC address of this device.",
    5.16 -       Mac48AddressValue (Mac48Address ("ff:ff:ff:ff:ff:ff")),
    5.17 -       MakeMac48AddressAccessor (&CsmaNetDevice::m_address),
    5.18 -       MakeMac48AddressChecker ())
    5.19 +                   "The MAC address of this device.",
    5.20 +                   Mac48AddressValue (Mac48Address ("ff:ff:ff:ff:ff:ff")),
    5.21 +                   MakeMac48AddressAccessor (&CsmaNetDevice::m_address),
    5.22 +                   MakeMac48AddressChecker ())
    5.23      .AddAttribute ("PayloadLength", 
    5.24 -       "The max PHY-level payload length of packets sent over this device.",
    5.25 -       UintegerValue (DEFAULT_FRAME_LENGTH),
    5.26 -       MakeUintegerAccessor (&CsmaNetDevice::m_maxPayloadLength),
    5.27 -       MakeUintegerChecker<uint16_t> ())
    5.28 +                   "The max PHY-level payload length of packets sent over this device.",
    5.29 +                   UintegerValue (DEFAULT_FRAME_LENGTH),
    5.30 +                   MakeUintegerAccessor (&CsmaNetDevice::m_maxPayloadLength),
    5.31 +                   MakeUintegerChecker<uint16_t> ())
    5.32      .AddAttribute ("MTU", 
    5.33 -       "The MAC-level MTU (client payload) of packets sent over this device.",
    5.34 -       UintegerValue (DEFAULT_MTU),
    5.35 -       MakeUintegerAccessor (&CsmaNetDevice::m_mtu),
    5.36 -       MakeUintegerChecker<uint16_t> ())
    5.37 +                   "The MAC-level MTU (client payload) of packets sent over this device.",
    5.38 +                   UintegerValue (DEFAULT_MTU),
    5.39 +                   MakeUintegerAccessor (&CsmaNetDevice::m_mtu),
    5.40 +                   MakeUintegerChecker<uint16_t> ())
    5.41      .AddAttribute ("EncapsulationMode", 
    5.42 -       "The link-layer encapsulation type to use.",
    5.43 -       EnumValue (LLC),
    5.44 -       MakeEnumAccessor (&CsmaNetDevice::m_encapMode),
    5.45 -       MakeEnumChecker (ETHERNET_V1, "EthernetV1",
    5.46 -                        IP_ARP, "IpArp",
    5.47 -                        RAW, "Raw",
    5.48 -                        LLC, "Llc"))
    5.49 +                   "The link-layer encapsulation type to use.",
    5.50 +                   EnumValue (LLC),
    5.51 +                   MakeEnumAccessor (&CsmaNetDevice::m_encapMode),
    5.52 +                   MakeEnumChecker (ETHERNET_V1, "EthernetV1",
    5.53 +                                    IP_ARP, "IpArp",
    5.54 +                                    RAW, "Raw",
    5.55 +                                    LLC, "Llc"))
    5.56      .AddAttribute ("SendEnable", 
    5.57 -       "Enable or disable the transmitter section of the device.",
    5.58 -       BooleanValue (true),
    5.59 -       MakeBooleanAccessor (&CsmaNetDevice::m_sendEnable),
    5.60 -       MakeBooleanChecker ())
    5.61 +                   "Enable or disable the transmitter section of the device.",
    5.62 +                   BooleanValue (true),
    5.63 +                   MakeBooleanAccessor (&CsmaNetDevice::m_sendEnable),
    5.64 +                   MakeBooleanChecker ())
    5.65      .AddAttribute ("ReceiveEnable",
    5.66 -       "Enable or disable the receiver section of the device.",
    5.67 -       BooleanValue (true),
    5.68 -       MakeBooleanAccessor (&CsmaNetDevice::m_receiveEnable),
    5.69 -       MakeBooleanChecker ())
    5.70 +                   "Enable or disable the receiver section of the device.",
    5.71 +                   BooleanValue (true),
    5.72 +                   MakeBooleanAccessor (&CsmaNetDevice::m_receiveEnable),
    5.73 +                   MakeBooleanChecker ())
    5.74      .AddAttribute ("RxErrorModel", 
    5.75 -       "The receiver error model used to simulate packet loss",
    5.76 -       PointerValue (),
    5.77 -       MakePointerAccessor (&CsmaNetDevice::m_receiveErrorModel),
    5.78 -       MakePointerChecker<ErrorModel> ())
    5.79 +                   "The receiver error model used to simulate packet loss",
    5.80 +                   PointerValue (),
    5.81 +                   MakePointerAccessor (&CsmaNetDevice::m_receiveErrorModel),
    5.82 +                   MakePointerChecker<ErrorModel> ())
    5.83      .AddAttribute ("TxQueue", 
    5.84 -       "A queue to use as the transmit queue in the device.",
    5.85 -       PointerValue (),
    5.86 -       MakePointerAccessor (&CsmaNetDevice::m_queue),
    5.87 -       MakePointerChecker<Queue> ())
    5.88 +                   "A queue to use as the transmit queue in the device.",
    5.89 +                   PointerValue (),
    5.90 +                   MakePointerAccessor (&CsmaNetDevice::m_queue),
    5.91 +                   MakePointerChecker<Queue> ())
    5.92      .AddTraceSource ("Rx", 
    5.93 -       "The trace source to fire on reception of a MAC packet.",
    5.94 -       MakeTraceSourceAccessor (&CsmaNetDevice::m_rxTrace))
    5.95 +                     "The trace source to fire on reception of a MAC packet.",
    5.96 +                     MakeTraceSourceAccessor (&CsmaNetDevice::m_rxTrace))
    5.97      .AddTraceSource ("Drop", 
    5.98 -       "Trace source to fire on when a MAC packet is dropped.",
    5.99 -       MakeTraceSourceAccessor (&CsmaNetDevice::m_dropTrace))
   5.100 +                     "Trace source to fire on when a MAC packet is dropped.",
   5.101 +                     MakeTraceSourceAccessor (&CsmaNetDevice::m_dropTrace))
   5.102      ;
   5.103    return tid;
   5.104  }
   5.105 @@ -148,14 +148,14 @@
   5.106  CsmaNetDevice::IsSendEnabled (void)
   5.107  {
   5.108    NS_LOG_FUNCTION_NOARGS ();
   5.109 -  return (m_sendEnable);
   5.110 +  return m_sendEnable;
   5.111  }
   5.112  
   5.113    bool
   5.114  CsmaNetDevice::IsReceiveEnabled (void)
   5.115  {
   5.116    NS_LOG_FUNCTION_NOARGS ();
   5.117 -  return (m_receiveEnable);
   5.118 +  return m_receiveEnable;
   5.119  }
   5.120  
   5.121    void 
   5.122 @@ -166,12 +166,7 @@
   5.123  }
   5.124  
   5.125    void 
   5.126 -CsmaNetDevice::SetBackoffParams (
   5.127 -  Time slotTime, 
   5.128 -  uint32_t minSlots, 
   5.129 -  uint32_t maxSlots, 
   5.130 -  uint32_t ceiling, 
   5.131 -  uint32_t maxRetries)
   5.132 +CsmaNetDevice::SetBackoffParams (Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t ceiling, uint32_t maxRetries)
   5.133  {
   5.134    NS_LOG_FUNCTION (slotTime << minSlots << maxSlots << ceiling << maxRetries);
   5.135    m_backoff.m_slotTime = slotTime;
   5.136 @@ -182,11 +177,7 @@
   5.137  }
   5.138  
   5.139    void 
   5.140 -CsmaNetDevice::AddHeader (
   5.141 -  Ptr<Packet> p, 
   5.142 -  Mac48Address source,
   5.143 -  Mac48Address dest,
   5.144 -  uint16_t protocolNumber)
   5.145 +CsmaNetDevice::AddHeader (Ptr<Packet> p,   Mac48Address source,  Mac48Address dest,  uint16_t protocolNumber)
   5.146  {
   5.147    NS_LOG_FUNCTION (p << source << dest << protocolNumber);
   5.148  
   5.149 @@ -210,24 +201,24 @@
   5.150      {
   5.151      case IP_ARP:
   5.152        NS_LOG_LOGIC ("Encapsulating packet as IP_ARP (type interpretation)");
   5.153 -//
   5.154 -// This corresponds to the type interpretation of the lengthType field.
   5.155 -//
   5.156 +      //
   5.157 +      // This corresponds to the type interpretation of the lengthType field.
   5.158 +      //
   5.159        lengthType = protocolNumber;
   5.160        break;
   5.161      case ETHERNET_V1:
   5.162        NS_LOG_LOGIC ("Encapsulating packet as ETHERNET_V1 "
   5.163          "(length interpretation)");
   5.164 -//
   5.165 -// This corresponds to the length interpretation of the lengthType field.
   5.166 -// The ethernet header and trailer are not counted, see RFC 1042 and
   5.167 -// http://standards.ieee.org/getieee802/download/802.3-2005_section1.pdf,
   5.168 -// Section 3.2.6 a.  We just include the size of the "payload."
   5.169 -//
   5.170 +      //
   5.171 +      // This corresponds to the length interpretation of the lengthType field.
   5.172 +      // The ethernet header and trailer are not counted, see RFC 1042 and
   5.173 +      // http://standards.ieee.org/getieee802/download/802.3-2005_section1.pdf,
   5.174 +      // Section 3.2.6 a.  We just include the size of the "payload."
   5.175 +      //
   5.176        lengthType = p->GetSize ();
   5.177        NS_ASSERT_MSG (lengthType <= m_maxPayloadLength,
   5.178 -        "CsmaNetDevice::AddHeader(): 802.3 Length/Type field: "
   5.179 -        "length interpretation must not exceed device max payload length");
   5.180 +                     "CsmaNetDevice::AddHeader(): 802.3 Length/Type field: "
   5.181 +                     "length interpretation must not exceed device max payload length");
   5.182        break;
   5.183      case LLC: 
   5.184        {
   5.185 @@ -236,10 +227,10 @@
   5.186          LlcSnapHeader llc;
   5.187          llc.SetType (protocolNumber);
   5.188          p->AddHeader (llc);
   5.189 -//
   5.190 -// This corresponds to the length interpretation of the lengthType field,
   5.191 -// but with an LLC/SNAP header added to the payload.
   5.192 -//      
   5.193 +        //
   5.194 +        // This corresponds to the length interpretation of the lengthType field,
   5.195 +        // but with an LLC/SNAP header added to the payload.
   5.196 +        //      
   5.197          lengthType = p->GetSize ();
   5.198          NS_ASSERT_MSG (lengthType <= m_maxPayloadLength,
   5.199            "CsmaNetDevice::AddHeader(): 802.3 Length/Type field with LLC/SNAP: "
   5.200 @@ -309,18 +300,18 @@
   5.201  
   5.202    NS_LOG_LOGIC ("m_currentPkt=" << m_currentPkt);
   5.203    NS_LOG_LOGIC ("UID is " << m_currentPkt->GetUid ());
   5.204 -//
   5.205 -// This function is called to start the process of transmitting a packet.
   5.206 -// We need to tell the channel that we've started wiggling the wire and
   5.207 -// schedule an event that will be executed when it's time to tell the 
   5.208 -// channel that we're done wiggling the wire.
   5.209 -//
   5.210 +  //
   5.211 +  // This function is called to start the process of transmitting a packet.
   5.212 +  // We need to tell the channel that we've started wiggling the wire and
   5.213 +  // schedule an event that will be executed when it's time to tell the 
   5.214 +  // channel that we're done wiggling the wire.
   5.215 +  //
   5.216    NS_ASSERT_MSG ((m_txMachineState == READY) || (m_txMachineState == BACKOFF), 
   5.217 -    "Must be READY to transmit. Tx state is: " << m_txMachineState);
   5.218 +                 "Must be READY to transmit. Tx state is: " << m_txMachineState);
   5.219  
   5.220 -//
   5.221 -// Only transmit if send side of net device is enabled
   5.222 -//
   5.223 +  //
   5.224 +  // Only transmit if send side of net device is enabled
   5.225 +  //
   5.226    if (IsSendEnabled () == false)
   5.227      {
   5.228        return;
   5.229 @@ -328,16 +319,16 @@
   5.230  
   5.231    if (m_channel->GetState () != IDLE)
   5.232      {
   5.233 -//
   5.234 -// The channel is busy -- backoff and rechedule TransmitStart ()
   5.235 -//
   5.236 +      //
   5.237 +      // The channel is busy -- backoff and rechedule TransmitStart ()
   5.238 +      //
   5.239        m_txMachineState = BACKOFF;
   5.240  
   5.241        if (m_backoff.MaxRetriesReached ())
   5.242          { 
   5.243 -//
   5.244 -// Too many retries, abort transmission of packet
   5.245 -//
   5.246 +          //
   5.247 +          // Too many retries, abort transmission of packet
   5.248 +          //
   5.249            TransmitAbort ();
   5.250          } 
   5.251        else 
   5.252 @@ -345,38 +336,33 @@
   5.253            m_backoff.IncrNumRetries ();
   5.254            Time backoffTime = m_backoff.GetBackoffTime ();
   5.255  
   5.256 -          NS_LOG_LOGIC ("Channel busy, backing off for " << 
   5.257 -            backoffTime.GetSeconds () << " sec");
   5.258 +          NS_LOG_LOGIC ("Channel busy, backing off for " << backoffTime.GetSeconds () << " sec");
   5.259  
   5.260 -          Simulator::Schedule (backoffTime, &CsmaNetDevice::TransmitStart,
   5.261 -            this);
   5.262 +          Simulator::Schedule (backoffTime, &CsmaNetDevice::TransmitStart, this);
   5.263          }
   5.264      } 
   5.265    else 
   5.266      {
   5.267 -//
   5.268 -// The channel is free, transmit the packet
   5.269 -//
   5.270 +      //
   5.271 +      // The channel is free, transmit the packet
   5.272 +      //
   5.273        m_txMachineState = BUSY;
   5.274        Time tEvent = Seconds (m_bps.CalculateTxTime (m_currentPkt->GetSize ()));
   5.275        
   5.276 -      NS_LOG_LOGIC ("Schedule TransmitCompleteEvent in " << 
   5.277 -        tEvent.GetSeconds () << "sec");
   5.278 +      NS_LOG_LOGIC ("Schedule TransmitCompleteEvent in " << tEvent.GetSeconds () << "sec");
   5.279        
   5.280 -      Simulator::Schedule (tEvent, &CsmaNetDevice::TransmitCompleteEvent, 
   5.281 -        this);
   5.282 +      Simulator::Schedule (tEvent, &CsmaNetDevice::TransmitCompleteEvent, this);
   5.283  
   5.284        if (m_channel->TransmitStart (m_currentPkt, m_deviceId) == false)
   5.285          {
   5.286 -          NS_LOG_WARN ("Channel transmit start did not work at " << 
   5.287 -            tEvent.GetSeconds () << "sec");
   5.288 +          NS_LOG_WARN ("Channel transmit start did not work at " << tEvent.GetSeconds () << "sec");
   5.289            m_txMachineState = READY;
   5.290          } 
   5.291        else 
   5.292          {
   5.293 -//
   5.294 -// Transmission succeeded, reset the backoff time parameters.
   5.295 -//
   5.296 +          //
   5.297 +          // Transmission succeeded, reset the backoff time parameters.
   5.298 +          //
   5.299            m_backoff.ResetBackoffTime ();
   5.300          }
   5.301      }
   5.302 @@ -390,17 +376,15 @@
   5.303  
   5.304    NS_LOG_LOGIC ("Pkt UID is " << m_currentPkt->GetUid () << ")");
   5.305  
   5.306 -//
   5.307 -// Since we were transmitting a packet, that packet had better be on the
   5.308 -// transmit queue.
   5.309 -//
   5.310 +  //
   5.311 +  // Since we were transmitting a packet, that packet had better be on the transmit queue.
   5.312 +  //
   5.313    m_currentPkt = m_queue->Dequeue ();
   5.314 -  NS_ASSERT_MSG (m_currentPkt != 0, "No Packet on queue during"
   5.315 -    "CsmaNetDevice::TransmitAbort()");
   5.316 +  NS_ASSERT_MSG (m_currentPkt != 0, "No Packet on queue during CsmaNetDevice::TransmitAbort()");
   5.317  
   5.318 -//
   5.319 -// The last one failed.  Let's try to transmit the next one (if there)
   5.320 -//
   5.321 +  //
   5.322 +  // The last one failed.  Let's try to transmit the next one (if there)
   5.323 +  //
   5.324    m_backoff.ResetBackoffTime ();
   5.325    m_txMachineState = READY;
   5.326    TransmitStart ();
   5.327 @@ -411,12 +395,12 @@
   5.328  {
   5.329    NS_LOG_FUNCTION_NOARGS ();
   5.330  
   5.331 -//
   5.332 -// This function is called to finish the  process of transmitting a packet.
   5.333 -// We need to tell the channel that we've stopped wiggling the wire and
   5.334 -// schedule an event that will be executed when it's time to re-enable
   5.335 -// the transmitter after the interframe gap.
   5.336 -//
   5.337 +  //
   5.338 +  // This function is called to finish the  process of transmitting a packet.
   5.339 +  // We need to tell the channel that we've stopped wiggling the wire and
   5.340 +  // schedule an event that will be executed when it's time to re-enable
   5.341 +  // the transmitter after the interframe gap.
   5.342 +  //
   5.343    NS_ASSERT_MSG (m_txMachineState == BUSY, "Must be BUSY if transmitting");
   5.344    NS_ASSERT (m_channel->GetState () == TRANSMITTING);
   5.345    m_txMachineState = GAP;
   5.346 @@ -424,11 +408,9 @@
   5.347    NS_LOG_LOGIC ("Pkt UID is " << m_currentPkt->GetUid () << ")");
   5.348    m_channel->TransmitEnd (); 
   5.349  
   5.350 -  NS_LOG_LOGIC ("Schedule TransmitReadyEvent in "
   5.351 -    << m_tInterframeGap.GetSeconds () << "sec");
   5.352 +  NS_LOG_LOGIC ("Schedule TransmitReadyEvent in " << m_tInterframeGap.GetSeconds () << "sec");
   5.353  
   5.354 -  Simulator::Schedule (m_tInterframeGap, &CsmaNetDevice::TransmitReadyEvent, 
   5.355 -    this);
   5.356 +  Simulator::Schedule (m_tInterframeGap, &CsmaNetDevice::TransmitReadyEvent, this);
   5.357  }
   5.358  
   5.359    void
   5.360 @@ -436,17 +418,17 @@
   5.361  {
   5.362    NS_LOG_FUNCTION_NOARGS ();
   5.363  
   5.364 -//
   5.365 -// This function is called to enable the transmitter after the interframe
   5.366 -// gap has passed.  If there are pending transmissions, we use this opportunity
   5.367 -// to start the next transmit.
   5.368 -//
   5.369 +  //
   5.370 +  // This function is called to enable the transmitter after the interframe
   5.371 +  // gap has passed.  If there are pending transmissions, we use this opportunity
   5.372 +  // to start the next transmit.
   5.373 +  //
   5.374    NS_ASSERT_MSG (m_txMachineState == GAP, "Must be in interframe gap");
   5.375    m_txMachineState = READY;
   5.376  
   5.377 -//
   5.378 -// Get the next packet from the queue for transmitting
   5.379 -//
   5.380 +  //
   5.381 +  // Get the next packet from the queue for transmitting
   5.382 +  //
   5.383    if (m_queue->IsEmpty ())
   5.384      {
   5.385        return;
   5.386 @@ -454,8 +436,7 @@
   5.387    else
   5.388      {
   5.389        m_currentPkt = m_queue->Dequeue ();
   5.390 -      NS_ASSERT_MSG (m_currentPkt != 0, "CsmaNetDevice::TransmitReadyEvent():"
   5.391 -        " IsEmpty false but no Packet on queue?");
   5.392 +      NS_ASSERT_MSG (m_currentPkt != 0, "CsmaNetDevice::TransmitReadyEvent(): IsEmpty false but no Packet on queue?");
   5.393        TransmitStart ();
   5.394      }
   5.395  }
   5.396 @@ -469,19 +450,19 @@
   5.397  
   5.398    m_deviceId = m_channel->Attach (this);
   5.399  
   5.400 -//
   5.401 -// The channel provides us with the transmitter data rate.
   5.402 -//
   5.403 +  //
   5.404 +  // The channel provides us with the transmitter data rate.
   5.405 +  //
   5.406    m_bps = m_channel->GetDataRate ();
   5.407  
   5.408 -//
   5.409 -// We use the Ethernet interframe gap of 96 bit times.
   5.410 -//
   5.411 +  //
   5.412 +  // We use the Ethernet interframe gap of 96 bit times.
   5.413 +  //
   5.414    m_tInterframeGap = Seconds (m_bps.CalculateTxTime (96/8));
   5.415  
   5.416 -//
   5.417 -// This device is up whenever a channel is attached to it.
   5.418 -//
   5.419 +  //
   5.420 +  // This device is up whenever a channel is attached to it.
   5.421 +  //
   5.422    NotifyLinkUp ();
   5.423    return true;
   5.424  }
   5.425 @@ -500,25 +481,25 @@
   5.426    m_receiveErrorModel = em; 
   5.427  }
   5.428  
   5.429 -void
   5.430 +  void
   5.431  CsmaNetDevice::Receive (Ptr<Packet> packet, Ptr<CsmaNetDevice> senderDevice)
   5.432  {
   5.433    NS_LOG_FUNCTION (packet << senderDevice);
   5.434    NS_LOG_LOGIC ("UID is " << packet->GetUid ());
   5.435  
   5.436 -//
   5.437 -// We never forward up packets that we sent. Real devices don't do this since
   5.438 -// their receivers are disabled during send, so we don't. Drop the packet
   5.439 -// silently (no tracing) since it would really never get here in a real device.
   5.440 -// 
   5.441 +  //
   5.442 +  // We never forward up packets that we sent. Real devices don't do this since
   5.443 +  // their receivers are disabled during send, so we don't. Drop the packet
   5.444 +  // silently (no tracing) since it would really never get here in a real device.
   5.445 +  // 
   5.446    if (senderDevice == this)
   5.447      {
   5.448        return;
   5.449      }
   5.450  
   5.451 -// 
   5.452 -// Only receive if the send side of net device is enabled
   5.453 -//
   5.454 +  // 
   5.455 +  // Only receive if the send side of net device is enabled
   5.456 +  //
   5.457    if (IsReceiveEnabled () == false)
   5.458      {
   5.459        m_dropTrace (packet);
   5.460 @@ -530,17 +511,16 @@
   5.461        m_rxTrace (packet);
   5.462        if (!m_promiscRxCallback.IsNull ())
   5.463          {
   5.464 -          m_promiscRxCallback (this, packet, 0, GetBroadcast (), 
   5.465 -            GetAddress (), PACKET_HOST);
   5.466 +          m_promiscRxCallback (this, packet, 0, GetBroadcast (), GetAddress (), PACKET_HOST);
   5.467          }
   5.468        m_rxCallback (this, packet, 0, GetBroadcast ());
   5.469        return;
   5.470      }
   5.471  
   5.472 -//
   5.473 -// Trace sinks will expect complete packets, not packets without some of the
   5.474 -// headers.
   5.475 -//
   5.476 +  //
   5.477 +  // Trace sinks will expect complete packets, not packets without some of the
   5.478 +  // headers.
   5.479 +  //
   5.480    Ptr<Packet> originalPacket = packet->Copy ();
   5.481  
   5.482    EthernetTrailer trailer;
   5.483 @@ -553,14 +533,14 @@
   5.484    NS_LOG_LOGIC ("Pkt source is " << header.GetSource ());
   5.485    NS_LOG_LOGIC ("Pkt destination is " << header.GetDestination ());
   5.486  
   5.487 -//
   5.488 -// An IP host group address is mapped to an Ethernet multicast address
   5.489 -// by placing the low-order 23-bits of the IP address into the low-order
   5.490 -// 23 bits of the Ethernet multicast address 01-00-5E-00-00-00 (hex).
   5.491 -//
   5.492 -// We are going to receive all packets destined to any multicast address,
   5.493 -// which means clearing the low-order 23 bits the header destination 
   5.494 -//
   5.495 +  //
   5.496 +  // An IP host group address is mapped to an Ethernet multicast address
   5.497 +  // by placing the low-order 23-bits of the IP address into the low-order
   5.498 +  // 23 bits of the Ethernet multicast address 01-00-5E-00-00-00 (hex).
   5.499 +  //
   5.500 +  // We are going to receive all packets destined to any multicast address,
   5.501 +  // which means clearing the low-order 23 bits the header destination 
   5.502 +  //
   5.503    Mac48Address mcDest;
   5.504    uint8_t      mcBuf[6];
   5.505  
   5.506 @@ -581,10 +561,9 @@
   5.507      }
   5.508    else
   5.509      {
   5.510 -//
   5.511 -// variable <protocol> must be initialized to avoid a compiler warning in the 
   5.512 -// RAW case that breaks the optimized build.
   5.513 -//
   5.514 +      //
   5.515 +      // variable <protocol> must be initialized to avoid a compiler warning in the RAW case that breaks the optimized build.
   5.516 +      //
   5.517        uint16_t protocol = 0;
   5.518  
   5.519        switch (m_encapMode)
   5.520 @@ -629,8 +608,7 @@
   5.521        
   5.522        if (!m_promiscRxCallback.IsNull ())
   5.523          {
   5.524 -          m_promiscRxCallback (this, packet, protocol, header.GetSource (), 
   5.525 -            header.GetDestination (), packetType);
   5.526 +          m_promiscRxCallback (this, packet, protocol, header.GetSource (), header.GetDestination (), packetType);
   5.527          }
   5.528  
   5.529        if (packetType != PACKET_OTHERHOST)
   5.530 @@ -762,49 +740,55 @@
   5.531  CsmaNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const
   5.532  {
   5.533    NS_LOG_FUNCTION (multicastGroup);
   5.534 -//
   5.535 -// First, get the generic multicast address.
   5.536 -//
   5.537 +  //
   5.538 +  // First, get the generic multicast address.
   5.539 +  //
   5.540    Address hardwareDestination = GetMulticast ();
   5.541  
   5.542    NS_LOG_LOGIC ("Device multicast address: " << hardwareDestination);
   5.543 -//
   5.544 -// It's our address, and we know we're playing with an EUI-48 address here
   5.545 -// primarily since we know that by construction, but also since the parameter
   5.546 -// is an Ipv4Address.
   5.547 -//
   5.548 +
   5.549 +  //
   5.550 +  // It's our address, and we know we're playing with an EUI-48 address here
   5.551 +  // primarily since we know that by construction, but also since the parameter
   5.552 +  // is an Ipv4Address.
   5.553 +  //
   5.554    Mac48Address etherAddr = Mac48Address::ConvertFrom (hardwareDestination);
   5.555 -//
   5.556 -// We now have the multicast address in an abstract 48-bit container.  We 
   5.557 -// need to pull it out so we can play with it.  When we're done, we have the 
   5.558 -// high order bits in etherBuffer[0], etc.
   5.559 -//
   5.560 +
   5.561 +  //
   5.562 +  // We now have the multicast address in an abstract 48-bit container.  We 
   5.563 +  // need to pull it out so we can play with it.  When we're done, we have the 
   5.564 +  // high order bits in etherBuffer[0], etc.
   5.565 +  //
   5.566    uint8_t etherBuffer[6];
   5.567    etherAddr.CopyTo (etherBuffer);
   5.568 -//
   5.569 -// Now we need to pull the raw bits out of the Ipv4 destination address.
   5.570 -//
   5.571 +
   5.572 +  //
   5.573 +  // Now we need to pull the raw bits out of the Ipv4 destination address.
   5.574 +  //
   5.575    uint8_t ipBuffer[4];
   5.576    multicastGroup.Serialize (ipBuffer);
   5.577 -//
   5.578 -// RFC 1112 says that an Ipv4 host group address is mapped to an EUI-48
   5.579 -// multicast address by placing the low-order 23-bits of the IP address into 
   5.580 -// the low-order 23 bits of the Ethernet multicast address 
   5.581 -// 01-00-5E-00-00-00 (hex). 
   5.582 -//
   5.583 +
   5.584 +  //
   5.585 +  // RFC 1112 says that an Ipv4 host group address is mapped to an EUI-48
   5.586 +  // multicast address by placing the low-order 23-bits of the IP address into 
   5.587 +  // the low-order 23 bits of the Ethernet multicast address 
   5.588 +  // 01-00-5E-00-00-00 (hex). 
   5.589 +  //
   5.590    etherBuffer[3] |= ipBuffer[1] & 0x7f;
   5.591    etherBuffer[4] = ipBuffer[2];
   5.592    etherBuffer[5] = ipBuffer[3];
   5.593 -//
   5.594 -// Now, etherBuffer has the desired ethernet multicast address.  We have to
   5.595 -// suck these bits back into the Mac48Address,
   5.596 -//
   5.597 +
   5.598 +  //
   5.599 +  // Now, etherBuffer has the desired ethernet multicast address.  We have to
   5.600 +  // suck these bits back into the Mac48Address,
   5.601 +  //
   5.602    etherAddr.CopyFrom (etherBuffer);
   5.603 -//
   5.604 -// Implicit conversion (operator Address ()) is defined for Mac48Address, so
   5.605 -// use it by just returning the EUI-48 address which is automagically converted
   5.606 -// to an Address.
   5.607 -//
   5.608 +
   5.609 +  //
   5.610 +  // Implicit conversion (operator Address ()) is defined for Mac48Address, so
   5.611 +  // use it by just returning the EUI-48 address which is automagically converted
   5.612 +  // to an Address.
   5.613 +  //
   5.614    NS_LOG_LOGIC ("multicast address is " << etherAddr);
   5.615  
   5.616    return etherAddr;
   5.617 @@ -817,20 +801,15 @@
   5.618    return false;
   5.619  }
   5.620  
   5.621 -bool
   5.622 -CsmaNetDevice::Send (Ptr<Packet> packet, 
   5.623 -                     const Address& dest, 
   5.624 -                     uint16_t protocolNumber)
   5.625 +  bool
   5.626 +CsmaNetDevice::Send (Ptr<Packet> packet,const Address& dest, uint16_t protocolNumber)
   5.627  {
   5.628    NS_LOG_FUNCTION (packet << dest << protocolNumber);
   5.629    return SendFrom (packet, m_address, dest, protocolNumber);
   5.630  }
   5.631  
   5.632 -bool
   5.633 -CsmaNetDevice::SendFrom (Ptr<Packet> packet,
   5.634 -                         const Address& src,
   5.635 -                         const Address& dest,
   5.636 -                         uint16_t protocolNumber)
   5.637 +  bool
   5.638 +CsmaNetDevice::SendFrom (Ptr<Packet> packet, const Address& src, const Address& dest, uint16_t protocolNumber)
   5.639  {
   5.640    NS_LOG_FUNCTION (packet << src << dest << protocolNumber);
   5.641    NS_LOG_LOGIC ("p=" << packet);
   5.642 @@ -838,9 +817,9 @@
   5.643  
   5.644    NS_ASSERT (IsLinkUp ());
   5.645  
   5.646 -//
   5.647 -// Only transmit if send side of net device is enabled
   5.648 -//
   5.649 +  //
   5.650 +  // Only transmit if send side of net device is enabled
   5.651 +  //
   5.652    if (IsSendEnabled () == false)
   5.653      {
   5.654        return false;
   5.655 @@ -850,23 +829,24 @@
   5.656    Mac48Address source = Mac48Address::ConvertFrom (src);
   5.657    AddHeader (packet, source, destination, protocolNumber);
   5.658  
   5.659 -//
   5.660 -// Place the packet to be sent on the send queue
   5.661 -//
   5.662 +  //
   5.663 +  // Place the packet to be sent on the send queue
   5.664 +  //
   5.665    if (m_queue->Enqueue(packet) == false)
   5.666      {
   5.667        return false;
   5.668      }
   5.669 -//
   5.670 -// If the device is idle, we need to start a transmission. Otherwise,
   5.671 -// the transmission will be started when the current packet finished
   5.672 -// transmission (see TransmitCompleteEvent)
   5.673 -//
   5.674 +
   5.675 +  //
   5.676 +  // If the device is idle, we need to start a transmission. Otherwise,
   5.677 +  // the transmission will be started when the current packet finished
   5.678 +  // transmission (see TransmitCompleteEvent)
   5.679 +  //
   5.680    if (m_txMachineState == READY) 
   5.681      {
   5.682 -//
   5.683 -// The next packet to be transmitted goes in m_currentPkt
   5.684 -//
   5.685 +      //
   5.686 +      // The next packet to be transmitted goes in m_currentPkt
   5.687 +      //
   5.688        m_currentPkt = m_queue->Dequeue ();
   5.689        if (m_currentPkt != 0)
   5.690          {
   5.691 @@ -931,14 +911,14 @@
   5.692    m_rxCallback = cb;
   5.693  }
   5.694  
   5.695 -void 
   5.696 +  void 
   5.697  CsmaNetDevice::SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb)
   5.698  {
   5.699    NS_LOG_FUNCTION (&cb);
   5.700    m_promiscRxCallback = cb;
   5.701  }
   5.702  
   5.703 -bool 
   5.704 +  bool 
   5.705  CsmaNetDevice::SupportsPromiscuous () const
   5.706  {
   5.707    NS_LOG_FUNCTION_NOARGS ();
     6.1 --- a/src/devices/csma/csma-net-device.h	Sun Aug 03 09:14:07 2008 -0700
     6.2 +++ b/src/devices/csma/csma-net-device.h	Sun Aug 03 21:55:49 2008 -0700
     6.3 @@ -103,7 +103,7 @@
     6.4     * Set the backoff parameters used to determine the wait to retry
     6.5     * transmitting a packet when the channel is busy.
     6.6     *
     6.7 -   * @see Attach ()
     6.8 +   * \see Attach ()
     6.9     * \param slotTime Length of a packet slot (or average packet time)
    6.10     * \param minSlots Minimum number of slots to wait
    6.11     * \param maxSlots Maximum number of slots to wait
    6.12 @@ -118,8 +118,8 @@
    6.13     *
    6.14     * The function Attach is used to add a CsmaNetDevice to a CsmaChannel.
    6.15     *
    6.16 -   * @see SetDataRate ()
    6.17 -   * @see SetInterframeGap ()
    6.18 +   * \see SetDataRate ()
    6.19 +   * \see SetInterframeGap ()
    6.20     * \param ch a pointer to the channel to which this object is being attached.
    6.21     */
    6.22    bool Attach (Ptr<CsmaChannel> ch);
    6.23 @@ -131,8 +131,8 @@
    6.24     * level topology objects to implement a particular queueing method such as
    6.25     * DropTail or RED.  
    6.26     *
    6.27 -   * @see Queue
    6.28 -   * @see DropTailQueue
    6.29 +   * \see Queue
    6.30 +   * \see DropTailQueue
    6.31     * \param queue a Ptr to the queue for being assigned to the device.
    6.32     */
    6.33    void SetQueue (Ptr<Queue> queue);
    6.34 @@ -143,8 +143,8 @@
    6.35     * The CsmaNetDevice may optionally include an ErrorModel in
    6.36     * the packet receive chain to simulate data errors in during transmission.
    6.37     *
    6.38 -   * @see ErrorModel
    6.39 -   * @param em a pointer to the ErrorModel 
    6.40 +   * \see ErrorModel
    6.41 +   * \param em a pointer to the ErrorModel 
    6.42     */
    6.43    void SetReceiveErrorModel (Ptr<ErrorModel> em);
    6.44  
    6.45 @@ -156,7 +156,7 @@
    6.46     * used by the channel to indicate that the last bit of a packet has 
    6.47     * arrived at the device.
    6.48     *
    6.49 -   * @see CsmaChannel
    6.50 +   * \see CsmaChannel
    6.51     * \param p a reference to the received packet
    6.52     * \param sender the CsmaNetDevice that transmitted the packet in the first place
    6.53     */
    6.54 @@ -216,7 +216,7 @@
    6.55    virtual Address GetMulticast (void) const;
    6.56  
    6.57    /**
    6.58 -   * @brief Make and return a MAC multicast address using the provided
    6.59 +   * \brief Make and return a MAC multicast address using the provided
    6.60     *        multicast group
    6.61     *
    6.62     * RFC 1112 says that an Ipv4 host group address is mapped to an Ethernet 
    6.63 @@ -228,14 +228,14 @@
    6.64     * to an EUI-48-based CSMA device.  This MAC address is encapsulated in an
    6.65     *  abstract Address to avoid dependencies on the exact address format.
    6.66     *
    6.67 -   * @param multicastGroup The IP address for the multicast group destination
    6.68 +   * \param multicastGroup The IP address for the multicast group destination
    6.69     * of the packet.
    6.70 -   * @return The MAC multicast Address used to send packets to the provided
    6.71 +   * \return The MAC multicast Address used to send packets to the provided
    6.72     * multicast group.
    6.73     *
    6.74 -   * @see Ipv4Address
    6.75 -   * @see Mac48Address
    6.76 -   * @see Address
    6.77 +   * \see Ipv4Address
    6.78 +   * \see Mac48Address
    6.79 +   * \see Address
    6.80     */
    6.81    virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
    6.82  
    6.83 @@ -368,8 +368,8 @@
    6.84     * If the channel is found to be BUSY, this method reschedules itself for
    6.85     * execution at a later time (within the backoff period).
    6.86     *
    6.87 -   * @see CsmaChannel::TransmitStart ()
    6.88 -   * @see TransmitCompleteEvent ()
    6.89 +   * \see CsmaChannel::TransmitStart ()
    6.90 +   * \see TransmitCompleteEvent ()
    6.91     */
    6.92    void TransmitStart ();
    6.93  
    6.94 @@ -386,8 +386,8 @@
    6.95     * method, the net device also schedules the TransmitReadyEvent at which
    6.96     * time the transmitter becomes ready to send the next packet.
    6.97     *
    6.98 -   * @see CsmaChannel::TransmitEnd ()
    6.99 -   * @see TransmitReadyEvent ()
   6.100 +   * \see CsmaChannel::TransmitEnd ()
   6.101 +   * \see TransmitReadyEvent ()
   6.102     */
   6.103    void TransmitCompleteEvent (void);
   6.104  
   6.105 @@ -403,7 +403,7 @@
   6.106     * If a packet is in the queue, it is extracted for the queue as the
   6.107     * next packet to be transmitted by the net device.
   6.108     *
   6.109 -   * @see TransmitStart ()
   6.110 +   * \see TransmitStart ()
   6.111     */
   6.112    void TransmitReadyEvent (void);
   6.113  
   6.114 @@ -451,7 +451,7 @@
   6.115  
   6.116    /**
   6.117     * The state of the Net Device transmit state machine.
   6.118 -   * @see TxMachineState
   6.119 +   * \see TxMachineState
   6.120     */
   6.121    TxMachineState m_txMachineState;
   6.122    
   6.123 @@ -465,14 +465,14 @@
   6.124    /**
   6.125     * The data rate that the Net Device uses to simulate packet transmission
   6.126     * timing.
   6.127 -   * @see class DataRate
   6.128 +   * \see class DataRate
   6.129     */
   6.130    DataRate m_bps;
   6.131  
   6.132    /**
   6.133     * The interframe gap that the Net Device uses insert time between packet
   6.134     * transmission
   6.135 -   * @see class Time
   6.136 +   * \see class Time
   6.137     */
   6.138    Time m_tInterframeGap;
   6.139  
   6.140 @@ -493,7 +493,7 @@
   6.141    /**
   6.142     * The CsmaChannel to which this CsmaNetDevice has been
   6.143     * attached.
   6.144 -   * @see class CsmaChannel
   6.145 +   * \see class CsmaChannel
   6.146     */
   6.147    Ptr<CsmaChannel> m_channel;
   6.148  
   6.149 @@ -501,8 +501,8 @@
   6.150     * The Queue which this CsmaNetDevice uses as a packet source.
   6.151     * Management of this Queue has been delegated to the CsmaNetDevice
   6.152     * and it has the responsibility for deletion.
   6.153 -   * @see class Queue
   6.154 -   * @see class DropTailQueue
   6.155 +   * \see class Queue
   6.156 +   * \see class DropTailQueue
   6.157     */
   6.158    Ptr<Queue> m_queue;
   6.159  
   6.160 @@ -515,7 +515,7 @@
   6.161     * The trace source for the packet reception events that the device can
   6.162     * fire.
   6.163     *
   6.164 -   * @see class CallBackTraceSource
   6.165 +   * \see class CallBackTraceSource
   6.166     */
   6.167    TracedCallback<Ptr<const Packet> > m_rxTrace;
   6.168  
   6.169 @@ -523,7 +523,7 @@
   6.170     * The trace source for the packet drop events that the device can
   6.171     * fire.
   6.172     *
   6.173 -   * @see class CallBackTraceSource
   6.174 +   * \see class CallBackTraceSource
   6.175     */
   6.176    TracedCallback<Ptr<const Packet> > m_dropTrace;
   6.177