Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jun 2006 08:32:32 GMT
From:      Clément Lecigne <clem1@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 100274 for review
Message-ID:  <200606290832.k5T8WWRM024968@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=100274

Change 100274 by clem1@clem1_ipv6vulns on 2006/06/29 08:32:18

	improvements and bug fix around tcp packet manipulation in pcs.	

Affected files ...

.. //depot/projects/soc2006/clem1_ipv6vulns/pcs/pcs/packets/tcp.py#2 edit
.. //depot/projects/soc2006/clem1_ipv6vulns/pcs/pcs/packets/tcpv6.py#1 add

Differences ...

==== //depot/projects/soc2006/clem1_ipv6vulns/pcs/pcs/packets/tcp.py#2 (text+ko) ====

@@ -56,6 +56,17 @@
         fin = pcs.Field("fin", 1)
         window = pcs.Field("window", 16)
         cksum = pcs.Field("checksum", 16)
+        urgp = pcs.Field("urg_pointer",16)
         pcs.Packet.__init__(self, [sport, dport, seq, acknum, off, reserved,
-                                   urg, ack, psh, rst, syn, fin, window, cksum],
+                                   urg, ack, psh, rst, syn, fin, window, cksum, urg_pointer],
                             bytes = bytes)
+
+    def __str__(self):
+        """Walk the entire packet and pretty print the values of the fields.  Addresses are printed if and only if they are set and not 0."""
+        retval = ""
+        for field in self.layout:
+            if (field.type == str):
+                retval += "%s %s\n" % (field.name, value)
+            else:
+                retval += "%s %d\n" % (field.name, self.__dict__[field.name])
+        return retval



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606290832.k5T8WWRM024968>