src/common/pcap-file-object.cc
author Craig Dowell <craigdo@ee.washington.edu>
Fri, 29 Jan 2010 20:08:50 -0800
changeset 6035 ecd8840c3573
parent 6009 e1b696a1ed28
child 6041 b65c6d6794f8
permissions -rw-r--r--
add ability to pass a header to pcap file object
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
/*
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     3
 * Copyright (c) 2009 University of Washington
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     4
 *
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
 *
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
 *
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    17
 */
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    18
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    19
#include "ns3/log.h"
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    20
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    21
#include "buffer.h"
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    22
#include "header.h"
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    23
#include "pcap-file-object.h"
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    24
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    25
NS_LOG_COMPONENT_DEFINE ("PcapFileObject");
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    26
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    27
namespace ns3 {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    28
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    29
NS_OBJECT_ENSURE_REGISTERED (PcapFileObject);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    30
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    31
TypeId 
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    32
PcapFileObject::GetTypeId (void)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    33
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    34
  static TypeId tid = TypeId ("ns3::PcapFileObject")
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    35
    .SetParent<Object> ()
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    36
    .AddConstructor<PcapFileObject> ()
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    37
    ;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    38
  return tid;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    39
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    40
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    41
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    42
PcapFileObject::PcapFileObject ()
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    43
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    44
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    45
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    46
PcapFileObject::~PcapFileObject ()
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    47
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    48
  Close ();
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    49
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    50
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
void
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    52
PcapFileObject::Close (void)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    53
{
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    54
  m_file.Close ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    55
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    56
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    57
bool
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    58
PcapFileObject::Open (std::string const &filename, std::string const &mode)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    59
{
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    60
  return m_file.Open (filename, mode);
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    61
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    62
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    63
bool
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    64
PcapFileObject::Init (uint32_t dataLinkType, uint32_t snapLen, int32_t tzCorrection)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    65
{
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    66
  return m_file.Init (dataLinkType, snapLen, tzCorrection);
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    67
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    68
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    69
bool
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    70
PcapFileObject::Write (Time t, Ptr<const Packet> p)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    71
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    72
  uint64_t current = t.GetMicroSeconds ();
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    73
  uint64_t s = current / 1000000;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    74
  uint64_t us = current % 1000000;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    75
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    76
  uint32_t bufferSize = p->GetSize ();
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    77
  uint8_t *buffer = new uint8_t[bufferSize];
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    78
  p->CopyData (buffer, bufferSize);
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    79
  bool rc = m_file.Write (s, us, buffer, bufferSize);
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    80
  delete [] buffer;
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    81
  return rc;
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    82
}
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    83
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    84
bool
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    85
PcapFileObject::Write (Time t, Header &header, Ptr<const Packet> p)
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    86
{
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    87
  uint64_t current = t.GetMicroSeconds ();
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    88
  uint64_t s = current / 1000000;
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    89
  uint64_t us = current % 1000000;
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    90
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    91
  Buffer headerBuffer;
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    92
  uint32_t headerSize = header.GetSerializedSize ();
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    93
  uint32_t packetSize = p->GetSize ();
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    94
  uint32_t bufferSize = headerSize + packetSize;
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    95
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    96
  headerBuffer.AddAtStart (headerSize);
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    97
  header.Serialize (headerBuffer.Begin ());
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    98
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
    99
  uint8_t *buffer = new uint8_t[bufferSize];
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   100
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   101
  headerBuffer.Begin ().Read (buffer, headerSize);
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   102
  p->CopyData (&buffer[headerSize], packetSize);
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   103
  bool rc = m_file.Write (s, us, buffer, bufferSize);
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   104
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   105
  delete [] buffer;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   106
  return rc;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   107
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   108
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   109
bool
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   110
PcapFileObject::Write (Time t, uint8_t const *buffer, uint32_t length)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   111
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   112
  uint64_t current = t.GetMicroSeconds ();
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   113
  uint64_t s = current / 1000000;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   114
  uint64_t us = current % 1000000;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   115
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   116
  return m_file.Write (s, us, buffer, length);
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   117
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   118
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   119
uint32_t
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   120
PcapFileObject::GetMagic (void)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   121
{
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   122
  return m_file.GetMagic ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   123
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   124
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   125
uint16_t
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   126
PcapFileObject::GetVersionMajor (void)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   127
{
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   128
  return m_file.GetVersionMajor ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   129
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   130
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   131
uint16_t
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   132
PcapFileObject::GetVersionMinor (void)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   133
{
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   134
  return m_file.GetVersionMinor ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   135
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   136
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   137
int32_t
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   138
PcapFileObject::GetTimeZoneOffset (void)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   139
{
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   140
  return m_file.GetTimeZoneOffset ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   141
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   142
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   143
uint32_t
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   144
PcapFileObject::GetSigFigs (void)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   145
{
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   146
  return m_file.GetSigFigs ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   147
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   148
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   149
uint32_t
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   150
PcapFileObject::GetSnapLen (void)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   151
{
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   152
  return m_file.GetSnapLen ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   153
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   154
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   155
uint32_t
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   156
PcapFileObject::GetDataLinkType (void)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   157
{
6035
ecd8840c3573 add ability to pass a header to pcap file object
Craig Dowell <craigdo@ee.washington.edu>
parents: 6009
diff changeset
   158
  return m_file.GetDataLinkType ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   159
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   160
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   161
} //namespace ns3