예제 #1
0
        public bool OnPacketArrival(TimePacket packet, ISet <object> changedSet)
        {
            var tcpPkt = (TcpPacket)packet.Packet;
            var ipPkt  = tcpPkt.ParentPacket as IpPacket;

            if (ipPkt == null) // Only TCP/IP is supported
            {
                return(false);
            }

            // Build SocketTuple
            var socketTuple = new TcpTuple(ipPkt.SourceAddress, tcpPkt.SourcePort, ipPkt.DestinationAddress,
                                           tcpPkt.DestinationPort);

            Debug.WriteLine(socketTuple);

            TcpSeq seq;

            if (!_activeTcpSeqs.TryGetValue(socketTuple, out seq))
            {
                seq = new TcpSeq(socketTuple);
                _activeTcpSeqs[socketTuple] = seq;
            }

            // TODO: Update TcpSeq

            changedSet.Add(seq);

            return(false);
        }
예제 #2
0
 public TcpSeq(TcpTuple socketIdent)
 {
     SocketIdent = socketIdent;
 }