///// ************************************************************************ ///// Copyright (C) 2001, Patrick Charles and Jonas Lehmann * ///// Distributed under the Mozilla Public License * ///// http://www.mozilla.org/NPL/MPL-1.1.txt * ///// ************************************************************************* ///// //using System; //using HexHelper = SharpPcap.Packets.Util.HexHelper; //using Timeval = SharpPcap.Packets.Util.Timeval; //namespace SharpPcap.Packets //{ // /// A captured packet containing raw data. // ///

// /// Encapsulation for data captured on a network device by PacketCapture's // /// raw capture interface. // /// // ///

// [Serializable] // public class RawPacket // { // /// Fetch the timeval containing the time the packet arrived on the // /// device where it was captured. // /// // virtual public Timeval Timeval // { // get // { // return timeval; // } // } // /// Fetch the raw packet data. // virtual public byte[] Data // { // get // { // return bytes; // } // } // /// Fetch the number of bytes dropped (if any) when the packet // /// was captured. // ///

// /// Bytes are dropped when the snapshot length (a ceiling on the number of // /// bytes per packet to capture) is smaller than the actual number of bytes // /// in the packet on the wire. In other words, when caplen exceeds snaplen, // /// bytes are dropped and droplen will be nonzero. Otherwise, all the // /// packet bytes were captured and droplen is zero. // ///

// virtual public int Droplen // { // get // { // return droplen; // } // } // /// Create a new raw packet. // /// // /// // /// the time the packet arrived on the device where it was // /// captured. // /// // /// the raw packet data, including headers. // /// // /// the number of bytes dropped (if any) when the packet // /// was captured. // /// // public RawPacket(Timeval timeval, byte[] bytes, int droplen) // { // this.timeval = timeval; // this.bytes = bytes; // this.droplen = droplen; // } // /// Convert this packet to a readable string. // public override System.String ToString() // { // System.Text.StringBuilder buffer = new System.Text.StringBuilder(); // int length = bytes.Length; // buffer.Append("[RawPacket: "); // buffer.Append("l = " + length + " of " + (length + droplen) + ", "); // buffer.Append("t = " + timeval + ", "); // buffer.Append("d = "); // buffer.Append(HexHelper.toString(bytes)); // buffer.Append(']'); // return buffer.ToString(); // } // private Timeval timeval; // private byte[] bytes; // private int droplen; // private System.String _rcsid = "$Id: RawPacket.cs,v 1.1.1.1 2007-07-03 10:15:18 tamirgal Exp $"; // } //}