small cleanups
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sat, 28 Jul 2007 13:14:24 +0200
changeset 994a7252b11c8d2
parent 993 9f9d5048b710
child 995 22821dd9152e
small cleanups
src/node/ethernet-header.cc
src/node/ethernet-header.h
     1.1 --- a/src/node/ethernet-header.cc	Sat Jul 28 12:41:53 2007 +0200
     1.2 +++ b/src/node/ethernet-header.cc	Sat Jul 28 13:14:24 2007 +0200
     1.3 @@ -29,30 +29,20 @@
     1.4  
     1.5  namespace ns3 {
     1.6  
     1.7 -bool EthernetHeader::m_enPreambleSfd = false;
     1.8 +EthernetHeader::EthernetHeader (bool hasPreamble)
     1.9 +  : m_enPreambleSfd (hasPreamble),
    1.10 +    m_lengthType (0)
    1.11 +{}
    1.12  
    1.13  EthernetHeader::EthernetHeader ()
    1.14 -{
    1.15 -  Init();
    1.16 -}
    1.17 +  : m_enPreambleSfd (false),
    1.18 +    m_lengthType (0)
    1.19 +{}
    1.20  
    1.21  EthernetHeader::~EthernetHeader ()
    1.22  {}
    1.23  
    1.24  void 
    1.25 -EthernetHeader::Init()
    1.26 -{
    1.27 -  m_preambleSfd = 0;
    1.28 -  m_lengthType = 0x0;
    1.29 -}
    1.30 -
    1.31 -void 
    1.32 -EthernetHeader::EnablePreambleSfd (bool enable)
    1.33 -{
    1.34 -  m_enPreambleSfd = enable;
    1.35 -}
    1.36 -
    1.37 -void 
    1.38  EthernetHeader::SetLengthType (uint16_t lengthType)
    1.39  {
    1.40    m_lengthType = lengthType;
     2.1 --- a/src/node/ethernet-header.h	Sat Jul 28 12:41:53 2007 +0200
     2.2 +++ b/src/node/ethernet-header.h	Sat Jul 28 13:14:24 2007 +0200
     2.3 @@ -53,15 +53,17 @@
     2.4  
     2.5    /**
     2.6     * \brief Construct a null ethernet header
     2.7 +   * \param hasPreamble if true, insert and remove an ethernet preamble from the
     2.8 +   *       packet, if false, does not insert and remove it.
     2.9 +   */
    2.10 +  EthernetHeader (bool hasPreamble);
    2.11 +  /**
    2.12 +   * \brief Construct a null ethernet header
    2.13 +   * By default, does not add or remove an ethernet preamble
    2.14     */
    2.15    EthernetHeader ();
    2.16    virtual ~EthernetHeader ();
    2.17    /**
    2.18 -   * \brief Enable or disabled the serialisation of the preamble and
    2.19 -   * Sfd header fields
    2.20 -   */
    2.21 -  static void EnablePreambleSfd (bool enable);
    2.22 -  /**
    2.23     * \param size The size of the payload in bytes
    2.24     */
    2.25    void SetLengthType (uint16_t size);
    2.26 @@ -109,15 +111,12 @@
    2.27    virtual void SerializeTo (Buffer::Iterator start) const;
    2.28    virtual uint32_t DeserializeFrom (Buffer::Iterator start);
    2.29  
    2.30 -  void Init (void);
    2.31 -
    2.32    /**
    2.33     * If false, the preamble/sfd are not serialised/deserialised.
    2.34     */
    2.35 -  static bool m_enPreambleSfd;
    2.36 -
    2.37 +  bool m_enPreambleSfd;
    2.38    uint64_t m_preambleSfd;     /// Value of the Preamble/SFD fields
    2.39 -  uint16_t m_lengthType : 16; /// Length or type of the packet
    2.40 +  uint16_t m_lengthType;      /// Length or type of the packet
    2.41    MacAddress m_source;        /// Source address
    2.42    MacAddress m_destination;   /// Destination address
    2.43  };