public int CompareTo(NetworkTcpSession session) { if (this.ClientHost.CompareTo(session.ClientHost) != 0) { return(this.ClientHost.CompareTo(session.ClientHost)); } else if (this.ServerHost.CompareTo(session.ServerHost) != 0) { return(this.ServerHost.CompareTo(session.ServerHost)); } else if (this.ClientTcpPort != session.ClientTcpPort) { return(this.ClientTcpPort - session.ClientTcpPort); } else if (this.ServerTcpPort != session.ServerTcpPort) { return(this.ServerTcpPort - session.ServerTcpPort); } else if (this.StartTime.CompareTo(session.StartTime) != 0) { return(this.StartTime.CompareTo(session.StartTime)); } else { return(0); } }
public int CompareTo(NetworkTcpSession session) { if (this.clientHost.CompareTo(session.clientHost) != 0) { return(this.clientHost.CompareTo(session.clientHost)); } else if (this.serverHost.CompareTo(session.serverHost) != 0) { return(this.serverHost.CompareTo(session.serverHost)); } else if (this.clientTcpPort != session.clientTcpPort) { return(this.clientTcpPort - session.clientTcpPort); } else if (this.serverTcpPort != session.serverTcpPort) { return(this.serverTcpPort - session.serverTcpPort); } else if (this.SessionStartTimestamp.CompareTo(session.SessionStartTimestamp) != 0) { return(this.SessionStartTimestamp.CompareTo(session.SessionStartTimestamp)); } else { return(0); } }
internal TcpDataStream(uint initialTcpSequenceNumber, ushort sourcePort, ushort destinationPort, NetworkTcpSession session) { this.initialTcpSequenceNumber = initialTcpSequenceNumber; this.expectedTcpSequenceNumber = initialTcpSequenceNumber; this.sourcePort = sourcePort; this.destinationPort = destinationPort; this.dataList = new SortedList <uint, byte[]>(); this.dataListMaxSize = 64;//i hope I shouldn't need more than 64 packets in the list. It depends on how late a misordered packet might get received. Smaller number gives better performance, larger number gives better tolerance to reordered packets this.totalByteCount = 0; this.virtualTcpData = null; this.session = session; }
public TcpDataStream(uint initialTcpSequenceNumber, bool streamIsClientToServer, NetworkTcpSession session) { this.initialTcpSequenceNumber = initialTcpSequenceNumber; this.expectedTcpSequenceNumber = initialTcpSequenceNumber; //this.sourcePort=sourcePort; //this.destinationPort=destinationPort; this.dataList = new SortedList <uint, byte[]>(); //this.dataListMaxSize=64;//i hope I shouldn't need more than 64 packets in the list. It depends on how late a misordered packet might get received. Smaller number gives better performance, larger number gives better tolerance to reordered packets this.dataListMaxSize = 256;//allows data packets to be out-of-order up to 256 packets apart from each other in the same unidirectional stream //this.totalByteCount=0; this.virtualTcpData = null; this.session = session; this.networkFlow = session.Flow; //this.protocolFinder = session.protocolFinder; this.streamIsClientToServer = streamIsClientToServer; }
public int CompareTo(object obj) { NetworkTcpSession s = (NetworkTcpSession)obj; return(CompareTo(s)); }
//int PacketsSentServer { get; }//not required //int PacketsSentClient { get; }//not required public NetworkFlow(NetworkTcpSession networkTcpSession) : this(new FiveTuple(networkTcpSession.ClientHost, networkTcpSession.ClientTcpPort, networkTcpSession.ServerHost, networkTcpSession.ServerTcpPort, FiveTuple.TransportProtocol.TCP), networkTcpSession.StartTime, networkTcpSession.EndTime, networkTcpSession.ClientToServerTcpDataStream.TotalByteCount, networkTcpSession.ServerToClientTcpDataStream.TotalByteCount) { //nothing more required }