pktType -> encapMode
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sat, 28 Jul 2007 12:41:53 +0200
changeset 9939f9d5048b710
parent 992 37953a86a975
child 994 a7252b11c8d2
pktType -> encapMode
src/devices/csma-cd/csma-cd-net-device.cc
src/devices/csma-cd/csma-cd-net-device.h
     1.1 --- a/src/devices/csma-cd/csma-cd-net-device.cc	Sat Jul 28 12:30:31 2007 +0200
     1.2 +++ b/src/devices/csma-cd/csma-cd-net-device.cc	Sat Jul 28 12:41:53 2007 +0200
     1.3 @@ -36,22 +36,22 @@
     1.4  namespace ns3 {
     1.5  
     1.6  CsmaCdNetDevice::CsmaCdNetDevice (Ptr<Node> node, MacAddress addr, 
     1.7 -                                  CsmaCdEncapsulationMode pktType) 
     1.8 +                                  CsmaCdEncapsulationMode encapMode) 
     1.9    : NetDevice(node, addr), m_bps (DataRate (0xffffffff))
    1.10  {
    1.11    NS_DEBUG ("CsmaCdNetDevice::CsmaCdNetDevice (" << node << ")");
    1.12 -  m_pktType = pktType;
    1.13 +  m_encapMode = encapMode;
    1.14  
    1.15    Init(true, true);
    1.16  }
    1.17  
    1.18  CsmaCdNetDevice::CsmaCdNetDevice (Ptr<Node> node, MacAddress addr, 
    1.19 -                                  CsmaCdEncapsulationMode pktType,
    1.20 +                                  CsmaCdEncapsulationMode encapMode,
    1.21                                    bool sendEnable, bool receiveEnable) 
    1.22    : NetDevice(node, addr), m_bps (DataRate (0xffffffff))
    1.23  {
    1.24    NS_DEBUG ("CsmaCdNetDevice::CsmaCdNetDevice (" << node << ")");
    1.25 -  m_pktType = pktType;
    1.26 +  m_encapMode = encapMode;
    1.27  
    1.28    Init(sendEnable, receiveEnable);
    1.29  }
    1.30 @@ -152,14 +152,14 @@
    1.31  CsmaCdNetDevice::AddHeader (Packet& p, const MacAddress& dest,
    1.32                                    uint16_t protocolNumber)
    1.33  {
    1.34 -  if ((m_pktType == ETHERNET_V1) || (m_pktType == IP_ARP))
    1.35 +  if ((m_encapMode == ETHERNET_V1) || (m_encapMode == IP_ARP))
    1.36      {
    1.37        EthernetHeader  header;
    1.38        EthernetTrailer trailer;
    1.39        
    1.40        header.SetSource(this->GetAddress());
    1.41        header.SetDestination(dest);
    1.42 -      switch (m_pktType)
    1.43 +      switch (m_encapMode)
    1.44          {
    1.45          case IP_ARP:
    1.46            header.SetLengthType(protocolNumber);
    1.47 @@ -172,7 +172,7 @@
    1.48        trailer.CalcFcs(p);
    1.49        p.AddTrailer(trailer);
    1.50      } 
    1.51 -  else if (m_pktType == LLC) 
    1.52 +  else if (m_encapMode == LLC) 
    1.53      {
    1.54        LlcSnapHeader llc;
    1.55        llc.SetType (protocolNumber);
    1.56 @@ -184,7 +184,7 @@
    1.57  {
    1.58    bool retVal = true;
    1.59  
    1.60 -  if ((m_pktType == ETHERNET_V1) || (m_pktType == IP_ARP))
    1.61 +  if ((m_encapMode == ETHERNET_V1) || (m_encapMode == IP_ARP))
    1.62      {
    1.63        EthernetHeader  header;
    1.64        EthernetTrailer trailer;
    1.65 @@ -200,7 +200,7 @@
    1.66            retVal = false;
    1.67          }
    1.68      }
    1.69 -  else if (m_pktType == LLC)
    1.70 +  else if (m_encapMode == LLC)
    1.71      {
    1.72        LlcSnapHeader llc;
    1.73        p.RemoveHeader (llc);
    1.74 @@ -214,7 +214,7 @@
    1.75  bool
    1.76  CsmaCdNetDevice::DoNeedsArp (void) const
    1.77  {
    1.78 -  if ((m_pktType == IP_ARP) || (m_pktType == LLC))
    1.79 +  if ((m_encapMode == IP_ARP) || (m_encapMode == LLC))
    1.80      {
    1.81        return true;
    1.82      } else {
     2.1 --- a/src/devices/csma-cd/csma-cd-net-device.h	Sat Jul 28 12:30:31 2007 +0200
     2.2 +++ b/src/devices/csma-cd/csma-cd-net-device.h	Sat Jul 28 12:41:53 2007 +0200
     2.3 @@ -351,7 +351,7 @@
     2.4     * function and that should be processed by the ProcessHeader
     2.5     * function.
     2.6     */
     2.7 -  CsmaCdEncapsulationMode m_pktType;
     2.8 +  CsmaCdEncapsulationMode m_encapMode;
     2.9    /**
    2.10     * The data rate that the Net Device uses to simulate packet transmission
    2.11     * timing.