A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
pcap-file-test-suite.cc File Reference
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <cstring>
#include "ns3/test.h"
#include "ns3/pcap-file.h"
+ Include dependency graph for pcap-file-test-suite.cc:

Go to the source code of this file.

Classes

class  DiffTestCase
class  FileHeaderTestCase
struct  PacketEntry
class  PcapFileTestSuite
class  ReadFileTestCase
class  ReadModeCreateTestCase
class  RecordHeaderTestCase
class  WriteModeCreateTestCase

Functions

static bool CheckFileExists (std::string filename)
static bool CheckFileLength (std::string filename, uint64_t sizeExpected)
static uint16_t Swap (uint16_t val)
static uint32_t Swap (uint32_t val)

Variables

PacketEntry knownPackets []
const uint32_t N_KNOWN_PACKETS = 6
const uint32_t N_PACKET_BYTES = 16
static PcapFileTestSuite pcapFileTestSuite

Function Documentation

static bool CheckFileExists ( std::string  filename)
static

Definition at line 47 of file pcap-file-test-suite.cc.

Referenced by WriteModeCreateTestCase::DoRun(), and ReadModeCreateTestCase::DoRun().

+ Here is the caller graph for this function:

static bool CheckFileLength ( std::string  filename,
uint64_t  sizeExpected 
)
static

Definition at line 61 of file pcap-file-test-suite.cc.

Referenced by WriteModeCreateTestCase::DoRun().

+ Here is the caller graph for this function:

static uint16_t Swap ( uint16_t  val)
static

Definition at line 35 of file pcap-file-test-suite.cc.

Referenced by FileHeaderTestCase::DoRun(), and RecordHeaderTestCase::DoRun().

+ Here is the caller graph for this function:

static uint32_t Swap ( uint32_t  val)
static

Definition at line 41 of file pcap-file-test-suite.cc.

Variable Documentation

PacketEntry knownPackets[]
Initial value:
{
{ 2, 3696, 46, 46, { 0x0001, 0x0800, 0x0604, 0x0001, 0x0000, 0x0000, 0x0003, 0x0a01,
0x0201, 0xffff, 0xffff, 0xffff, 0x0a01, 0x0204, 0x0000, 0x0000}},
{ 2, 3707, 46, 46, { 0x0001, 0x0800, 0x0604, 0x0002, 0x0000, 0x0000, 0x0006, 0x0a01,
0x0204, 0x0000, 0x0000, 0x0003, 0x0a01, 0x0201, 0x0000, 0x0000}},
{ 2, 3801, 1070, 1070, { 0x4500, 0x041c, 0x0000, 0x0000, 0x3f11, 0x0000, 0x0a01, 0x0101,
0x0a01, 0x0204, 0xc001, 0x0009, 0x0408, 0x0000, 0x0000, 0x0000}},
{ 2, 3811, 46, 46, { 0x0001, 0x0800, 0x0604, 0x0001, 0x0000, 0x0000, 0x0006, 0x0a01,
0x0204, 0xffff, 0xffff, 0xffff, 0x0a01, 0x0201, 0x0000, 0x0000}},
{ 2, 3822, 46, 46, { 0x0001, 0x0800, 0x0604, 0x0002, 0x0000, 0x0000, 0x0003, 0x0a01,
0x0201, 0x0000, 0x0000, 0x0006, 0x0a01, 0x0204, 0x0000, 0x0000}},
{ 2, 3915, 1070, 1070, { 0x4500, 0x041c, 0x0000, 0x0000, 0x4011, 0x0000, 0x0a01, 0x0204,
0x0a01, 0x0101, 0x0009, 0xc001, 0x0408, 0x0000, 0x0000, 0x0000}}
}

Definition at line 988 of file pcap-file-test-suite.cc.

Referenced by ReadFileTestCase::DoRun(), and DiffTestCase::DoRun().

const uint32_t N_KNOWN_PACKETS = 6

Definition at line 977 of file pcap-file-test-suite.cc.

Referenced by ReadFileTestCase::DoRun(), and DiffTestCase::DoRun().

const uint32_t N_PACKET_BYTES = 16

Definition at line 978 of file pcap-file-test-suite.cc.

Referenced by ReadFileTestCase::DoRun(), and DiffTestCase::DoRun().

PcapFileTestSuite pcapFileTestSuite
static

Definition at line 1123 of file pcap-file-test-suite.cc.