public Boolean PayloadsOverlapMismatch(EffectiveFrame other) { // Check if effective frames are overlapping if (this.RelativeOffsetBegin > other.RelativeOffsetEnd || other.RelativeOffsetBegin > this.RelativeOffsetEnd) { // If there is no overlap, there is no mismatch return(false); } if (this.Frame.IsTcpKeepAlive || other.Frame.IsTcpKeepAlive) { return(false); } var overlapBegin = Math.Max(this.RelativeOffsetBegin, other.RelativeOffsetBegin); var overlapEnd = Math.Min(this.RelativeOffsetEnd, other.RelativeOffsetEnd); var overlapLen = (Int32)(overlapEnd - overlapBegin); var payloadOffset = (Int32)(overlapBegin - this.RelativeOffsetBegin); var otherPayloadOffset = (Int32)(overlapBegin - other.RelativeOffsetBegin); var payloadDataSegment = this.Frame.L7PayloadDataSegment; var otherPayloadDataSegment = other.Frame.L7PayloadDataSegment; return(!payloadDataSegment.ContentsEqual(otherPayloadDataSegment, payloadOffset, otherPayloadOffset, overlapLen)); }
public Boolean PayloadsOverlapMismatch(EffectiveFrame other) { if (this.RelativeOffsetBegin <= other.RelativeOffsetEnd && other.RelativeOffsetBegin <= this.RelativeOffsetEnd) { var overlapBegin = Math.Max(this.RelativeOffsetBegin, other.RelativeOffsetBegin); var overlapEnd = Math.Min(this.RelativeOffsetEnd, other.RelativeOffsetEnd); var overlapLen = (Int32)(overlapEnd - overlapBegin); var payloadOffset = (Int32)(overlapBegin - this.RelativeOffsetBegin); var otherPayloadOffset = (Int32)(overlapBegin - other.RelativeOffsetBegin); return(!this.Payload.ContentsEqual(other.Payload, payloadOffset, otherPayloadOffset, overlapLen)); } // If there is no overlap, there is no mismatch return(false); }
public Boolean Equals(EffectiveFrame other) => Equals(this.Frame, other.Frame);