PERFORCE change 100274 for review
Clément Lecigne
clem1 at FreeBSD.org
Thu Jun 29 08:32:43 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=100274
Change 100274 by clem1 at 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
More information about the p4-projects
mailing list