Skip to content

Commit

Permalink
Make some fields available for external use
Browse files Browse the repository at this point in the history
  • Loading branch information
wnagele committed Oct 20, 2013
1 parent 2f37743 commit 468817f
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@ public class PcapReader implements Iterable<Packet> {

private Multimap<Flow, SequencePayload> flows = TreeMultimap.create();

public byte[] pcapHeader;
public byte[] pcapPacketHeader;
public byte[] packetData;

public PcapReader(DataInputStream is) throws IOException {
this.is = is;
iterator = new PacketIterator();

byte[] pcapHeader = new byte[HEADER_SIZE];
pcapHeader = new byte[HEADER_SIZE];
if (!readBytes(pcapHeader)) {
//
// This special check for EOF is because we don't want
Expand Down Expand Up @@ -144,7 +148,7 @@ private int getUdpLength(byte[] packetData, int ipStart, int ipHeaderLen) {
}

private Packet nextPacket() {
byte[] pcapPacketHeader = new byte[PACKET_HEADER_SIZE];
pcapPacketHeader = new byte[PACKET_HEADER_SIZE];
if (!readBytes(pcapPacketHeader))
return null;

Expand All @@ -162,7 +166,7 @@ private Packet nextPacket() {
packet.put(Packet.TS_USEC, packetTimestampUsec);

long packetSize = PcapReaderUtil.convertInt(pcapPacketHeader, CAP_LEN_OFFSET, reverseHeaderByteOrder);
byte[] packetData = new byte[(int)packetSize];
packetData = new byte[(int)packetSize];
if (!readBytes(packetData))
return packet;

Expand Down

0 comments on commit 468817f

Please sign in to comment.