From owner-p4-projects@FreeBSD.ORG Sat Jul 19 05:26:49 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 31D3F1065679; Sat, 19 Jul 2008 05:26:49 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9AC61065673 for ; Sat, 19 Jul 2008 05:26:48 +0000 (UTC) (envelope-from bilouro@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CB8158FC0C for ; Sat, 19 Jul 2008 05:26:48 +0000 (UTC) (envelope-from bilouro@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m6J5QmTT025620 for ; Sat, 19 Jul 2008 05:26:48 GMT (envelope-from bilouro@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m6J5QmZd025618 for perforce@freebsd.org; Sat, 19 Jul 2008 05:26:48 GMT (envelope-from bilouro@FreeBSD.org) Date: Sat, 19 Jul 2008 05:26:48 GMT Message-Id: <200807190526.m6J5QmZd025618@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bilouro@FreeBSD.org using -f From: Victor Hugo Bilouro To: Perforce Change Reviews Cc: Subject: PERFORCE change 145458 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2008 05:26:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=145458 Change 145458 by bilouro@bilouro_tcptest on 2008/07/19 05:26:02 Adding assertReset method. (open) Affected files ... .. //depot/projects/soc2008/bilouro_tcptest/src/scripts/tests/tcptest.py#3 edit Differences ... ==== //depot/projects/soc2008/bilouro_tcptest/src/scripts/tests/tcptest.py#3 (text+ko) ==== @@ -83,6 +83,34 @@ assertExpectedSequence(self, tcb, tcp, from_, to) +def assertReset(self, tcb, tcp, from_, to): + """ + RFC 793 - Section 3.4 Establishing a Connection + Page 36 + + If the incoming segment has an ACK field, the reset takes its + sequence number from the ACK field of the segment, otherwise the + reset has sequence number zero and the ACK field is set to the sum + of the sequence number and segment length of the incoming segment. + The connection remains in the CLOSED state. + """ + #it must be a reset + self.failIf(tcp.rst <1, 'rst bit must be set') + + #"*If* the incoming segment has..." + if (tcb.sequence[ to ] == Null or tcb.tcpsequence[ to ] <= 0): + #the only moment a segment has no ack is at syn where + #we don't know the receiver sequence, in other words, we only get the + #receiver sequence number at the first segment received back(syn+ack of + #3way handshake) + #Assuming that "incoming segment" has *NO* ACK Field we need assert that: + #(1)has sequence number zero + #(2)ACK field set to the sum of the sequence number and segment length + + else: #(tcb.sequence[ to ] > 0): + #Assuming that "incoming segment" has ACK Field we need assert that: + #(1)sequence number set to the ACK sent + def assertFin(self, tcp): """is fin flag on? """