示例#1
0
bool TCPStream::update(IP *ip, TCP *tcp) {
    RawPDU *raw = tcp->find_pdu<RawPDU>();
    if(!syn_ack_sent && tcp->get_flag(TCP::SYN) && tcp->get_flag(TCP::ACK)) {
        server_seq = tcp->seq() + 1;
        client_seq = tcp->ack_seq();
        syn_ack_sent = true;
        return false;
    }
    else {
        if(ip->src_addr() == info.client_addr)
            return generic_process(client_seq, server_seq, client_payload_, client_frags, tcp, raw);
        else
            return generic_process(server_seq, client_seq, server_payload_, server_frags, tcp, raw);
    }
}
示例#2
0
bool TCPStream::update(IP *ip, TCP *tcp) {
    if(!syn_ack_sent) {
        if(tcp->flags() == (TCP::SYN | TCP::ACK)) {
            server_seq = tcp->seq() + 1;
            client_seq = tcp->ack_seq();
            syn_ack_sent = true;
        }
        return false;
    }
    else {
        if(ip->src_addr() == info.client_addr && tcp->sport() == info.client_port)
            return generic_process(client_seq, server_seq, client_payload_, client_frags, tcp);
        else {
            return generic_process(server_seq, client_seq, server_payload_, server_frags, tcp);
        }
    }
}