/// <summary> /// Gets the number of bytes in the packet capture between time1 and time2 in the timestamp file /// </summary> /// <param name="time1">the start time (inclusive)</param> /// <param name="time2">the end time (exclusive)</param> /// <returns>the packet count</returns> public long GetDataSpan(DateTime time1, DateTime time2) { long packetStartIndex, packetEndIndex; TimeFile.GetPacketIndices(time1, time2, out packetStartIndex, out packetEndIndex); return(GetDataSpan(packetStartIndex, packetEndIndex)); }
/// <summary> /// Gets the number of packets contained between time1 and time2 /// </summary> /// <param name="time1">the start time (inclusive)</param> /// <param name="time2">the end time (exclusive)</param> /// <returns>the packet count</returns> public long GetIndexSpan(DateTime time1, DateTime time2) { long start, end; TimeFile.GetPacketIndices(time1, time2, out start, out end); return(end - start); }
/// <summary> /// Gets all packets between time1 and time2 from the capture file. /// </summary> /// <param name="time">the inclusive time of the first record in the time index file</param> /// <param name="count">the exclusive time at which to stop collecting</param> /// <returns>a new packet collection object</returns> public PacketCollection GetPackets(DateTime time1, DateTime time2) { long packetIndex1; long packetIndex2; TimeFile.GetPacketIndices(time1, time2, out packetIndex1, out packetIndex2); int count = (int)(packetIndex2 - packetIndex1); return(GetPackets(packetIndex1, count)); }