Find the session for this TCP packet. This function is called for every TCP packet; it searches for its corresponding session, updates the state of both streams (cli->srv and srv->cli), and remounts the payload of the packets of this same session, to apply checks upon the remounted buffer.
- See also:
- FindIPPair()
Definition at line 713 of file session.c.
References tcp_header::ack, tcp_header::ack_seq, BlockPacket(), port_pair::ClientAck, port_pair::ClientSeq, port_pair::ClientState, tcp_data::Data, tcp_data::DataLen, DBG, DBGDIR, DEBUGPATH, tcp_header::dest, port_pair::Direction, port_pair::Error, FALSE, tcp_header::fin, FindIPPair(), FindPortPair(), GetDataByID(), Globals, tcp_data::Header, IP_BYTES, IPDecoderID, tcp_stream::LastSeq, MALLOC, port_pair::noreassemble, NULL, tcp_stream::NumPieces, global_vars::Packets, tcp_stream_piece::PacketSlot, tcp_stream::Payloads, PAYLOADS_SIZE, tcp_stream_piece::piece_end, PIECE_SIZE, tcp_stream_piece::piece_start, tcp_stream::Pieces, PRINT, PRINT2, PRINTERROR, PRINTERROR4, PrintPacketSummary(), PRINTPKTERROR, PRINTSESERROR, tcp_header::rst, tcp_header::seq, port_pair::ServerAck, port_pair::ServerFin, port_pair::ServerSeq, port_pair::ServerState, SESSION_IP1_SERVER, SESSION_IP2_SERVER, tcp_header::source, packet_rec::Stream, port_pair::Stream0, port_pair::Stream1, tcp_header::syn, TCP_PAYLOAD_PIECES_SIZE, TCP_STATE_DATA, TCP_STATE_FIN, TCP_STATE_LATE, TCP_STATE_NEW, TCP_STATE_RESET, TCP_STATE_SYN, TCP_STATE_SYNACK, port_pair::TCPCount, TimeoutSessions(), tcp_stream::TopSeq, TRUE, packet_rec::tv, and UnblockPacket().
Referenced by DecodeTCP().