src/common/pcap-writer.h
changeset 4709 b0743dbc4e55
parent 4645 d53223aae797
child 4715 d0041768ff60
     1.1 --- a/src/common/pcap-writer.h	Thu Jul 02 16:38:53 2009 +0200
     1.2 +++ b/src/common/pcap-writer.h	Thu Aug 13 09:36:53 2009 +0200
     1.3 @@ -22,7 +22,7 @@
     1.4  #define PCAP_WRITER_H
     1.5  
     1.6  #include <stdint.h>
     1.7 -#include "ns3/ref-count-base.h"
     1.8 +#include "ns3/object.h"
     1.9  
    1.10  namespace ns3 {
    1.11  
    1.12 @@ -36,9 +36,10 @@
    1.13   * Log Packets to a file in pcap format which can be
    1.14   * read by pcap readers.
    1.15   */
    1.16 -class PcapWriter : public RefCountBase
    1.17 +class PcapWriter : public Object
    1.18  {
    1.19  public:
    1.20 +  static TypeId GetTypeId (void);
    1.21    PcapWriter ();
    1.22    ~PcapWriter ();
    1.23  
    1.24 @@ -128,7 +129,13 @@
    1.25                                uint32_t rate, bool isShortPreamble, bool isTx, 
    1.26                                double signalDbm, double noiseDbm);
    1.27  
    1.28 -
    1.29 +  /** 
    1.30 +   * Set the maximum number of bytes to be captured for each packet. 
    1.31 +   * 
    1.32 +   * @param size the maximum number of bytes to be captured. If zero
    1.33 +   * (default), the whole packet will be captured. 
    1.34 +   */
    1.35 +  void SetCaptureSize (uint32_t size);
    1.36  
    1.37  
    1.38  private:
    1.39 @@ -141,6 +148,8 @@
    1.40    int8_t RoundToInt8 (double value);
    1.41    std::ofstream *m_writer;
    1.42    uint32_t m_pcapMode;
    1.43 +  uint32_t m_captureSize;
    1.44 +  
    1.45  };
    1.46  
    1.47  } // namespace ns3