Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a52557630e
62 lines (54 sloc) 1.153 kb
#include <Packet.h>
#include <stdio.h>
using namespace std;
namespace SimplePcapNs {
Packet::Packet(
int capturedLen,
int realLen,
int secOffset,
int uSecOffset,
u_char *data
) {
this->capturedLen = capturedLen;
this->realLen = realLen;
this->secondsOffset = secOffset;
this->uSecondsOffset = uSecOffset;
this->data = string((const char *)data, capturedLen);
}
int
Packet::getCapturedLen()
{
return capturedLen;
}
int
Packet::getRealLen()
{
return realLen;
}
int
Packet::getSecondsOffset()
{
return secondsOffset;
}
int
Packet::getMicroSecondsOffset()
{
return uSecondsOffset;
}
string
Packet::getData()
{
return this->data;
}
string
Packet::__toString()
{
char buff[256];
snprintf(
buff, sizeof(buff),
"[ Packet: capLen: %d realLen: %d secOffset: %d uSecOffset: %d ]",
capturedLen, realLen, secondsOffset, uSecondsOffset
);
return string(buff);
}
}
Jump to Line
Something went wrong with that request. Please try again.