<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6951733302331203011</id><updated>2011-07-08T07:31:36.521-04:00</updated><category term='logging'/><category term='pydev'/><category term='gsoc'/><category term='gnn'/><category term='ctb'/><category term='birthday'/><category term='blogo'/><category term='pylint'/><category term='x11'/><category term='vmware'/><category term='loopback'/><category term='macosx'/><category term='textmate'/><category term='pcs'/><category term='wireshark'/><category term='osx'/><category term='x'/><category term='cocoa'/><category term='tcp'/><category term='carbon'/><category term='python'/><category term='redbull'/><category term='pyrexc'/><category term='pcap'/><category term='freebsd'/><category term='eclipse'/><category term='pyrex'/><category term='macports'/><category term='fusion'/><category term='ide'/><category term='google'/><category term='checksum'/><title type='text'>gsoc-tcpregression</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>96</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2046631298192718562</id><published>2009-11-16T21:22:00.002-05:00</published><updated>2009-11-16T21:24:38.345-05:00</updated><title type='text'>Holy Crap How Time Flies</title><content type='html'>Lots of time has gone by since I've had a chance to put some hours into the TCP Regression framework.  I haven't forgotten it, just been busy.  A trip to New York City, followed by Halloween, and two &lt;b&gt;absolutely gorgeous&lt;/b&gt; November sundays kept me away from the computer for the past few weeks.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The coming weekends, since I'm not going home for Thanksgiving, as well as Christmas-time (since most of the other interns leave Dec. 17, and I am staying until Dec. 31) will probably see a spark of productivity.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2046631298192718562?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2046631298192718562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/11/holy-crap-how-time-flies.html#comment-form' title='37 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2046631298192718562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2046631298192718562'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/11/holy-crap-how-time-flies.html' title='Holy Crap How Time Flies'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>37</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3260819211564577464</id><published>2009-10-11T14:33:00.002-04:00</published><updated>2009-10-11T14:40:06.793-04:00</updated><title type='text'>Build Issues when Installing</title><content type='html'>In the process of investigating the build issues on Mac OS X 10.6 Snow Leopard, I decided to build on FreeBSD.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The combo:&lt;/div&gt;&lt;div&gt;python setup.py config&lt;/div&gt;&lt;div&gt;python setup.py build&lt;/div&gt;&lt;div&gt;sudo python setup.py test&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Works just fine.  However, once the package is installed... things go haywire (full output below).  The issue appears to be in the final linking stage.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;make&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;cc -shared -pthread build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap.o build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap_ex.o&lt;b&gt;&lt;i&gt; -L/usr/lib -lpcap&lt;/i&gt;&lt;/b&gt; -o build/lib.freebsd-7.1-RELEASE-i386-2.5/pcap.so&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;make install&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;cc -shared -pthread build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap.o build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap_ex.o -o build/lib.freebsd-7.1-RELEASE-i386-2.5/pcap.so&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;For whatever reason, libpcap isn't being linked in.  The tests attempt to import pcap, then make sure that it is valid, and if that doesn't work, import pcs.pcap (as seen at the end).  When attempting to import the installed version of pcap, the "import pcap" statement fails.  Grrrr...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;[zjriggl@freebsd ~/zachriggle-pypcap-1f0484c]$ ls&lt;/b&gt;&lt;/div&gt;&lt;div&gt;CHANGES&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;LICENSE&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;Makefile&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;README&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;pcap.c&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;pcap.pyx&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;pcap_ex.c&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;pcap_ex.h&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;setup.py&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;tests&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;testsniff.py&lt;/div&gt;&lt;div&gt;&lt;b&gt;[zjriggl@freebsd ~/zachriggle-pypcap-1f0484c]$ make&lt;/b&gt;&lt;/div&gt;&lt;div&gt;pyrexc pcap.pyx&lt;/div&gt;&lt;div&gt;python setup.py config &lt;/div&gt;&lt;div&gt;running config&lt;/div&gt;&lt;div&gt;found {'libraries': ['pcap'], 'library_dirs': ['/usr/lib'], 'include_dirs': ['/usr/include']}&lt;/div&gt;&lt;div&gt;python setup.py build&lt;/div&gt;&lt;div&gt;running build&lt;/div&gt;&lt;div&gt;running build_ext&lt;/div&gt;&lt;div&gt;pyrexc pcap.pyx --&gt; pcap.c&lt;/div&gt;&lt;div&gt;building 'pcap' extension&lt;/div&gt;&lt;div&gt;creating build&lt;/div&gt;&lt;div&gt;creating build/temp.freebsd-7.1-RELEASE-i386-2.5&lt;/div&gt;&lt;div&gt;cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -I/usr/include -I/usr/local/include/python2.5 -c pcap.c -o build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap.o&lt;/div&gt;&lt;div&gt;pcap.c: In function '__pyx_f_4pcap_4pcap_dispatch':&lt;/div&gt;&lt;div&gt;pcap.c:2298: warning: passing argument 3 of 'pcap_dispatch' from incompatible pointer type&lt;/div&gt;&lt;div&gt;pcap.c: In function '__pyx_f_4pcap_4pcap_nextPacket':&lt;/div&gt;&lt;div&gt;pcap.c:2381: warning: passing argument 3 of 'pcap_ex_next' from incompatible pointer type&lt;/div&gt;&lt;div&gt;pcap.c: In function '__pyx_f_4pcap_4pcap_dump':&lt;/div&gt;&lt;div&gt;pcap.c:2902: warning: passing argument 1 of 'pcap_dump' from incompatible pointer type&lt;/div&gt;&lt;div&gt;cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -I/usr/include -I/usr/local/include/python2.5 -c pcap_ex.c -o build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap_ex.o&lt;/div&gt;&lt;div&gt;pcap_ex.c: In function 'pcap_ex_next':&lt;/div&gt;&lt;div&gt;pcap_ex.c:272: warning: passing argument 3 of 'pcap_next_ex' from incompatible pointer type&lt;/div&gt;&lt;div&gt;creating build/lib.freebsd-7.1-RELEASE-i386-2.5&lt;/div&gt;&lt;div&gt;cc -shared -pthread build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap.o build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap_ex.o -L/usr/lib -lpcap -o build/lib.freebsd-7.1-RELEASE-i386-2.5/pcap.so&lt;/div&gt;&lt;div&gt;&lt;b&gt;[zjriggl@freebsd ~/zachriggle-pypcap-1f0484c]$ sudo make test&lt;/b&gt;&lt;/div&gt;&lt;div&gt;python setup.py test&lt;/div&gt;&lt;div&gt;running test&lt;/div&gt;&lt;div&gt;testDispatch (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testEnumerateInterfaces (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testErrors (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testInjectedPacketIsReceived (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testIter (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testIterable (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testOpenDefaultInterface (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testOpenLive (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testPacketFilter (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testProperties (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testReadpkts (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;testWriteDump_ReadOffline (tests.testPcap.TestPcap) ... ok&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;Ran 12 tests in 1.541s&lt;/div&gt;&lt;div&gt;&lt;b&gt;[zjriggl@freebsd ~/zachriggle-pypcap-1f0484c]$ sudo make install&lt;/b&gt;&lt;/div&gt;&lt;div&gt;python setup.py install&lt;/div&gt;&lt;div&gt;running install&lt;/div&gt;&lt;div&gt;running build&lt;/div&gt;&lt;div&gt;running build_ext&lt;/div&gt;&lt;div&gt;pyrexc pcap.pyx --&gt; pcap.c&lt;/div&gt;&lt;div&gt;building 'pcap' extension&lt;/div&gt;&lt;div&gt;cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -I/usr/local/include/python2.5 -c pcap.c -o build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap.o&lt;/div&gt;&lt;div&gt;pcap.c: In function '__pyx_f_4pcap_4pcap_dispatch':&lt;/div&gt;&lt;div&gt;pcap.c:2298: warning: passing argument 3 of 'pcap_dispatch' from incompatible pointer type&lt;/div&gt;&lt;div&gt;pcap.c: In function '__pyx_f_4pcap_4pcap_nextPacket':&lt;/div&gt;&lt;div&gt;pcap.c:2381: warning: passing argument 3 of 'pcap_ex_next' from incompatible pointer type&lt;/div&gt;&lt;div&gt;pcap.c: In function '__pyx_f_4pcap_4pcap_dump':&lt;/div&gt;&lt;div&gt;pcap.c:2902: warning: passing argument 1 of 'pcap_dump' from incompatible pointer type&lt;/div&gt;&lt;div&gt;cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -I/usr/local/include/python2.5 -c pcap_ex.c -o build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap_ex.o&lt;/div&gt;&lt;div&gt;pcap_ex.c: In function 'pcap_ex_next':&lt;/div&gt;&lt;div&gt;pcap_ex.c:272: warning: passing argument 3 of 'pcap_next_ex' from incompatible pointer type&lt;/div&gt;&lt;div&gt;cc -shared -pthread build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap.o build/temp.freebsd-7.1-RELEASE-i386-2.5/pcap_ex.o -o build/lib.freebsd-7.1-RELEASE-i386-2.5/pcap.so&lt;/div&gt;&lt;div&gt;running install_lib&lt;/div&gt;&lt;div&gt;copying build/lib.freebsd-7.1-RELEASE-i386-2.5/pcap.so -&gt; /usr/local/lib/python2.5/site-packages&lt;/div&gt;&lt;div&gt;running install_egg_info&lt;/div&gt;&lt;div&gt;Removing /usr/local/lib/python2.5/site-packages/pcap-1.2-py2.5.egg-info&lt;/div&gt;&lt;div&gt;Writing /usr/local/lib/python2.5/site-packages/pcap-1.2-py2.5.egg-info&lt;/div&gt;&lt;div&gt;&lt;b&gt;[zjriggl@freebsd ~/zachriggle-pypcap-1f0484c]$ sudo make test&lt;/b&gt;&lt;/div&gt;&lt;div&gt;python setup.py test&lt;/div&gt;&lt;div&gt;running test&lt;/div&gt;&lt;div&gt;Traceback (most recent call last):&lt;/div&gt;&lt;div&gt;  File "setup.py", line 120, in &lt;module&gt;&lt;/module&gt;&lt;/div&gt;&lt;div&gt;    provides = ['pcap'] )&lt;/div&gt;&lt;div&gt;  File "/usr/local/lib/python2.5/distutils/core.py", line 151, in setup&lt;/div&gt;&lt;div&gt;    dist.run_commands()&lt;/div&gt;&lt;div&gt;  File "/usr/local/lib/python2.5/distutils/dist.py", line 974, in run_commands&lt;/div&gt;&lt;div&gt;    self.run_command(cmd)&lt;/div&gt;&lt;div&gt;  File "/usr/local/lib/python2.5/distutils/dist.py", line 994, in run_command&lt;/div&gt;&lt;div&gt;    cmd_obj.run()&lt;/div&gt;&lt;div&gt;  File "setup.py", line 91, in run&lt;/div&gt;&lt;div&gt;    from tests.testPcap import PcapTestSuite&lt;/div&gt;&lt;div&gt;  File "/usr/home/zjriggl/zachriggle-pypcap-1f0484c/tests/testPcap.py", line 17, in &lt;module&gt;&lt;/module&gt;&lt;/div&gt;&lt;div&gt;    import pcs.pcap as pcap&lt;/div&gt;&lt;div&gt;ImportError: No module named pcs.pcap&lt;/div&gt;&lt;div&gt;*** Error code 1&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Stop in /usr/home/zjriggl/zachriggle-pypcap-1f0484c.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3260819211564577464?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3260819211564577464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/10/build-issues-when-installing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3260819211564577464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3260819211564577464'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/10/build-issues-when-installing.html' title='Build Issues when Installing'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3009333257625511103</id><published>2009-10-11T12:35:00.003-04:00</published><updated>2009-10-11T12:55:35.199-04:00</updated><title type='text'>PCS-0.5 Diff with PCS version used in TcpRegression</title><content type='html'>I've created a Diff file that shows all of the changes that I made to PCS over the course of the summer.  Some of these might be merged back into the PCS mainline, others might not.&lt;br /&gt;&lt;br /&gt;The highlight of the changes are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;BitString class.  The code for encoding individual bits, even if there is a lack of alignment on 8-bit boundaries, is a bit iffy (even the code says "This makes my head hurt").  The BitString class allows manipulation of individual bits just like a Python list object, and can be translated into an integer value, string value, binary string (via bin()), hex string (via hex()), and allows arbitrary manipulation.&lt;/li&gt;&lt;li&gt;The names of the pcs.packets.tcp.tcp class fields were assigned variables.  Instead of object['fieldName'] which is prone to typos going undetected, I made a bunch of variables so that they can be referred to as object[f_fieldname].  If mistyped, the interpreter picks up on the nonexistent variable.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;GNN: I've explicitly emailed you about this, as this was something that you requested.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Everyone else can get a copy here:&lt;/div&gt;&lt;div&gt;&lt;a href="http://p4db.freebsd.org/fileDownLoad.cgi?FSPC=//depot/projects/soc2009/zjriggl%5ftcpregression/diff/pcs%2d0.5.diff&amp;amp;REV=1"&gt;http://p4db.freebsd.org/fileDownLoad.cgi?FSPC=//depot/projects/soc2009/zjriggl%5ftcpregression/diff/pcs%2d0.5.diff&amp;amp;REV=1&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;From looking at the diff, it does not appear that my changes rely on anything in the forked PCap library (and for that matter, don't involve PCap at all).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Zach&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3009333257625511103?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3009333257625511103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/10/pcs-05-diff-with-pcs-version-used-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3009333257625511103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3009333257625511103'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/10/pcs-05-diff-with-pcs-version-used-in.html' title='PCS-0.5 Diff with PCS version used in TcpRegression'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7205318741934155508</id><published>2009-09-20T18:25:00.003-04:00</published><updated>2009-09-20T18:26:14.679-04:00</updated><title type='text'>Yep, 10.6 Did It (Methinks)</title><content type='html'>The build.py script was only set to look in the first include directory for pcap.h.  On 10.6, /usr/include/pcap.h includes /usr/local/pcap/pcap.h, which contains all of the definitions the build system was looking for.&lt;br /&gt;&lt;br /&gt;Fixed the build script, will add it to Git soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7205318741934155508?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7205318741934155508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/09/yep-106-did-it-methinks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7205318741934155508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7205318741934155508'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/09/yep-106-did-it-methinks.html' title='Yep, 10.6 Did It (Methinks)'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8913919782832495345</id><published>2009-09-13T19:42:00.000-04:00</published><updated>2009-09-13T19:43:13.408-04:00</updated><title type='text'>10.6 Breaks PyPcap?</title><content type='html'>I think Snow Leopard breaks PyPcap -- for whatever reason, I'm getting compile errors that didn't previously exist.  I'll have to boot up one of the VMs and see if everything still works OK, or if there was some change that I didn't properly test that I also completely forgot that I made in the first place.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8913919782832495345?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8913919782832495345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/09/106-breaks-pypcap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8913919782832495345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8913919782832495345'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/09/106-breaks-pypcap.html' title='10.6 Breaks PyPcap?'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8302681284049980253</id><published>2009-08-29T11:49:00.001-04:00</published><updated>2009-08-29T11:49:42.844-04:00</updated><title type='text'>Docs Added</title><content type='html'>&lt;p style="clear: both"&gt;Lots of docs added to some of the core components. I'm on my way to the Apple store to have them fix this piece-o-junk, so hopefully I'll have it back soon!&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8302681284049980253?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8302681284049980253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/docs-added.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8302681284049980253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8302681284049980253'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/docs-added.html' title='Docs Added'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7447132301085175874</id><published>2009-08-17T03:04:00.001-04:00</published><updated>2009-08-17T03:04:06.012-04:00</updated><title type='text'>Committed all changes</title><content type='html'>&lt;p style="clear: both"&gt;All changes have been committed to P4 (TcpRegression) and Git (PyPcap). Eveyrthing works on my dev box, but we all know that means nothing. I'll sort out any odds and ends tomorrow. I need to get up for work in 3 hours.&lt;/p&gt;&lt;p style="clear: both"&gt;- Zach&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7447132301085175874?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7447132301085175874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/committed-all-changes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7447132301085175874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7447132301085175874'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/committed-all-changes.html' title='Committed all changes'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-4614469674589926439</id><published>2009-08-16T23:28:00.001-04:00</published><updated>2009-08-16T23:29:42.431-04:00</updated><title type='text'>And so it ends</title><content type='html'>&lt;p style="clear: both"&gt;SoC is coming to an end tonight. &lt;/p&gt;&lt;p style="clear: both"&gt;Overall, I think the project went very well. I'm going to try to bust out a few deliverable tests tonight since those were the original goal, but I think the volume of work that I got done will speak for itself. &lt;/p&gt;&lt;ul style="clear: both"&gt;&lt;li&gt;I forked PyPcap, fixed bugs, extended the functionality, wrote better tests. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;I forked PCS-0.5, fixed bugs, extended the functionality (although I didn't write tests for PCS). &lt;br /&gt;&lt;/li&gt;&lt;li&gt;I've essentially implemented a reference userland implementation of TCP on top of PCS and PyPcap, which should allow for even more applications than a simple regression testing suite, complete with tests of the code itself, as well as a few deliverable tests that should validate functionality of various TCP stacks.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="clear: both"&gt;In addition to continuing work with the TcpRegression suite, I've sent an email to the Metasploit project to see if they could use another leisure-pace developer. That should be an interesting project, and maybe I'll be able to apply some of the knowledge about TCP that I gained over the summer. Overall, it's been very productive - for my personal benefit (fiscal and intellectual), and hopefully the FOSS community and FreeBSD as well.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;I've got a few minor changes to PyPcap that need to go up -- mostly it's just the inclusion of a function that will print out a string of bytes in the same format that they appear in Wireshark's Packet Bytes view.&lt;/p&gt;&lt;p style="clear: both"&gt;There's a load of TcpRegression functionality and tests that will be in the next commit. Over the next week or so, I'll work on the documentation and cleaning up the code, and getting Google their code sample. I'd like a nice, solid "0.1" release. It's also crossed my mind to separate the regression tests themselves from the main framework, and re-badging it "TCPython". The name looks like it hasn't been taken yet, but we'll see how that goes.&lt;/p&gt;&lt;p style="clear: both"&gt;Special thanks to Titus Brown and George Neville-Neil for helping me throughout the summer, you both helped me out of a few ruts along the way that could've made the whole project a lot less enjoyable.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-4614469674589926439?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/4614469674589926439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/and-so-it-ends_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4614469674589926439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4614469674589926439'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/and-so-it-ends_16.html' title='And so it ends'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-1799176195443241676</id><published>2009-08-16T06:12:00.001-04:00</published><updated>2009-08-16T07:06:47.965-04:00</updated><title type='text'>Published changes...</title><content type='html'>&lt;p style="clear: both"&gt;Published changes to the PyPcap library. Get the new hotness here: &lt;br /&gt;&lt;a href="http://zachriggle.github.com/pypcap/" target="_blank"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;a href="http://zachriggle.github.com/pypcap/" style="text-decoration: none;" target="_blank"&gt;http://zachriggle.github.com/pypcap/&lt;/a&gt;&lt;br /&gt;&lt;u&gt;or&lt;/u&gt;&lt;br /&gt;git clone git://github.com/zachriggle/pypcap&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;em&gt;This build tested on Mac OS X 10.5.7 and FreeBSD 7.1&lt;/em&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;u&gt;CHANGELOG&lt;/u&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;pypcap-1.2: &lt;br /&gt;- included changes from George Neville-Neil's PCS (http://pcs.sf.net) &lt;br /&gt;- added more tests &lt;br /&gt;- added logging functionality &lt;br /&gt;- implemented patches provided by several users from the original PyPcap site on Google Code. Thanks to... &lt;br /&gt; getxsick &lt;br /&gt; dirk-loss.de &lt;/p&gt;&lt;p style="clear: both"&gt;- Changed some interfaces, but made sure to allow backwards compatibility. &lt;br /&gt; Examples: &lt;/p&gt;&lt;p style="clear: both"&gt; __init__ now has separate args for interface, filename, and dump file. &lt;br /&gt; dump_close from PCS is now closeDumps &lt;br /&gt; the filter can be set by accessing the '.filter' property&lt;br /&gt; each pcap object can now be re-opened after closing with &lt;/p&gt;&lt;p style="clear: both"&gt; - openLive &lt;br /&gt; - openOffline&lt;br /&gt; - openDump &lt;/p&gt;&lt;p style="clear: both"&gt;- exposed findalldevs() [getxsick]&lt;br /&gt;- exposed lookupnet() [getxsick] &lt;br /&gt;- exposed 'cnt' arg of loop() [getxsick] &lt;br /&gt;- fixed setnonblock, loop() [dirk-loss.de] &lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-1799176195443241676?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/1799176195443241676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/published-changes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1799176195443241676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1799176195443241676'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/published-changes.html' title='Published changes...'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-4735021691848271887</id><published>2009-08-16T05:04:00.001-04:00</published><updated>2009-08-16T05:04:19.862-04:00</updated><title type='text'>Busy Day</title><content type='html'>&lt;p style="clear: both"&gt;Busy day. Added some more PyPcap functionality, fixed some bugs, and implemented tests. All of the functionality is at least touched by the tests...&lt;br /&gt;- Live capture&lt;br /&gt;- Dumping to file&lt;br /&gt;- Reading from file&lt;br /&gt;- Packet filter&lt;/p&gt;&lt;p style="clear: both"&gt;Additionally, migrated the 'tcpfilter' class to use bpf instead of manually inspecting the fields of each packet after it had been constructed by PCS. This should be MUCH faster. &lt;/p&gt;&lt;p style="clear: both"&gt;Also learned that in Python...&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;class X():&lt;br /&gt;....y = someObject()&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;... means that all X objects will be instantiated with the *same instance* of someObject, that is instantiated when the class is declared, instead of each object being allocated when the class instance is created. Weird. I thought it was run when the class was instantiated, and just allowed for the constructor to be a little bit less cluttered. Guess I was wrong (or that there's a Python bug).&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-4735021691848271887?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/4735021691848271887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/busy-day.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4735021691848271887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4735021691848271887'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/busy-day.html' title='Busy Day'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-6709869219533232495</id><published>2009-08-13T22:17:00.001-04:00</published><updated>2009-08-13T22:17:21.117-04:00</updated><title type='text'>C'mon Nose, stop being a stupid WHAAAAAAAAAT</title><content type='html'>&lt;p style="clear: both"&gt;In python...&lt;/p&gt;&lt;p style="clear: both"&gt;&amp;gt;&amp;gt;&amp;gt; t = TestPcap('')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.testEnumerateInterfaces()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.testOpenDefaultInterface()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.testOpenSpecificInterface()&lt;/p&gt;&lt;p style="clear: both"&gt;But...&lt;/p&gt;&lt;p style="clear: both"&gt;zach@Zachs-Computer:~/Documents/workspace/zjriggl_tcpregression/src/pcs/pcap/tests$nosetests testPcap.py &lt;br /&gt;E.E&lt;br /&gt;======================================================================&lt;br /&gt;ERROR: testEnumerateInterfaces (testPcap.TestPcap)&lt;br /&gt;----------------------------------------------------------------------&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt; File "/Users/zach/Documents/workspace/zjriggl_tcpregression/src/pcs/pcap/tests/testPcap.py", line 33, in testEnumerateInterfaces&lt;br /&gt; listOfIfs = pcap.findalldevs()&lt;br /&gt;AttributeError: 'module' object has no attribute 'findalldevs'&lt;/p&gt;&lt;p style="clear: both"&gt;======================================================================&lt;br /&gt;ERROR: testOpenSpecificInterface (testPcap.TestPcap)&lt;br /&gt;----------------------------------------------------------------------&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt; File "/Users/zach/Documents/workspace/zjriggl_tcpregression/src/pcs/pcap/tests/testPcap.py", line 38, in testOpenSpecificInterface&lt;br /&gt; iface = pcap.findalldevs()[0]&lt;br /&gt;AttributeError: 'module' object has no attribute 'findalldevs'&lt;/p&gt;&lt;p style="clear: both"&gt;----------------------------------------------------------------------&lt;br /&gt;Ran 3 tests in 0.004s&lt;/p&gt;&lt;p style="clear: both"&gt;FAILED (errors=2)&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;Here's the output of a "print dir(pcap)" from within the test, run through nosetests.&lt;/p&gt;&lt;p style="clear: both"&gt;-------------------- &amp;gt;&amp;gt; begin captured stdout &amp;lt;&amp;lt; ---------------------&lt;br /&gt;['DLT_ARCNET', 'DLT_AX25', 'DLT_CHAOS', 'DLT_EN10MB', 'DLT_EN3MB', 'DLT_FDDI', 'DLT_IEEE802', 'DLT_LINUX_SLL', 'DLT_LOOP', 'DLT_NULL', 'DLT_PFLOG', 'DLT_PFSYNC', 'DLT_PPP', 'DLT_PRONET', 'DLT_RAW', 'DLT_SLIP', '__author__', '__builtins__', '__copyright__', '__doc__', '__file__', '__license__', '__maintainer__', '__name__', '__revison__', '__url__', '__version__', 'bpf', 'calendar', 'dltoff', 'ex_name', 'lookupdev', 'pcap', 'sys', 'time']&lt;br /&gt;--------------------- &amp;gt;&amp;gt; end captured stdout &amp;lt;&amp;lt; ----------------------&lt;/p&gt;&lt;p style="clear: both"&gt;Obviously, it's not there. Pcap is imported as:&lt;/p&gt;&lt;p style="clear: both"&gt;try:&lt;br /&gt; import pcs.pcap as pcap&lt;br /&gt;except:&lt;br /&gt; import pcs&lt;/p&gt;&lt;p style="clear: both"&gt;Here's the output of "print pcs.__file__" from Python:&lt;br /&gt;/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pcs/pcap.so&lt;/p&gt;&lt;p style="clear: both"&gt;Aaaand from Nose-tests:&lt;br /&gt;/Library/Python/2.5/site-packages/pcs/pcap.so&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;Whaaaaaaaaaaat?&lt;/strong&gt;&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-6709869219533232495?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/6709869219533232495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/c-nose-stop-being-stupid-whaaaaaaaaat.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6709869219533232495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6709869219533232495'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/c-nose-stop-being-stupid-whaaaaaaaaat.html' title='C&amp;#39;mon Nose, stop being a stupid WHAAAAAAAAAT'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-4719726411036708179</id><published>2009-08-13T01:25:00.001-04:00</published><updated>2009-08-13T01:25:18.247-04:00</updated><title type='text'>Time</title><content type='html'>&lt;p style="clear: both"&gt;Lost track of time tonight, stayed up way later than I wanted to. Overhauled a LOT of code in the PyPcap library (both C any Python code). It's now a lot cleaner, and a lot of the functionality that was only available via creating a new pcap object is now available at runtime (i.e. open/reopen an interface or offline capture).&lt;/p&gt;&lt;p style="clear: both"&gt;Also changed a bit of the Windows code that (for whatever reason) attempted to implement pcap_lookupdev, even though WinPcap has that function. Other minor changes were included in the C code (a little bit of refactoring).&lt;/p&gt;&lt;p style="clear: both"&gt;The Python code now includes logging for most of its functionality, which is &lt;strong&gt;disabled&lt;/strong&gt; by default. It does require either [1] modifying the PYX file or [2] modifying pcap.DEBUG_LEVEL before instantiating the pcap object that logging is desired for. Lots of refactoring. Hopefully I didn't break anything.&lt;/p&gt;&lt;p style="clear: both"&gt;Must. Get. To. Sleeeeeeeeeeep.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-4719726411036708179?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/4719726411036708179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4719726411036708179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4719726411036708179'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/time.html' title='Time'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-4770392430210159457</id><published>2009-08-12T21:31:00.001-04:00</published><updated>2009-08-12T21:31:07.622-04:00</updated><title type='text'>Nope, it was Python.</title><content type='html'>&lt;p style="clear: both"&gt;&lt;a href="http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/special_methods.html" target="_blank"&gt;http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/special_methods.html&lt;/a&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;The __next__ method &lt;/strong&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;Extension types wishing to implement the iterator interface should define a method called &lt;strong&gt;__next__&lt;/strong&gt;, &lt;em&gt;not&lt;/em&gt; next. The Python system will automatically supply a next method which calls your__next__. &lt;strong&gt;Do NOT explicitly give your type a next method&lt;/strong&gt;, or bad things could happen.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-4770392430210159457?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/4770392430210159457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/nope-it-was-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4770392430210159457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4770392430210159457'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/nope-it-was-python.html' title='Nope, it was Python.'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-1914017237038543177</id><published>2009-08-12T21:29:00.001-04:00</published><updated>2009-08-12T21:29:29.225-04:00</updated><title type='text'>Wtf?</title><content type='html'>&lt;p style="clear: both"&gt;Changing the name of "__next__"... what the hell, Python? (Although I'm much more apt to blame Pyrex)&lt;/p&gt;&lt;p style="clear: both"&gt; File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/p&gt;&lt;p style="clear: both"&gt; File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/tcpregression/tcpfilter.py", line 66, in read&lt;br /&gt; return self.pcapHandle.readpkt()&lt;/p&gt;&lt;p style="clear: both"&gt; File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pcs/__init__.py", line 1009, in readpkt&lt;br /&gt; packet = self.read()&lt;/p&gt;&lt;p style="clear: both"&gt; File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pcs/__init__.py", line 991, in read&lt;br /&gt; packet = self.file.next()&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-1914017237038543177?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/1914017237038543177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/wtf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1914017237038543177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1914017237038543177'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/wtf.html' title='Wtf?'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-1396195254687046457</id><published>2009-08-12T21:12:00.001-04:00</published><updated>2009-08-12T21:12:32.479-04:00</updated><title type='text'>Yep.</title><content type='html'>&lt;p style="clear: both"&gt;Traceback (most recent call last):&lt;br /&gt; File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;br /&gt; File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/tcpregression/tcpfilter.py", line 66, in read&lt;br /&gt; return self.pcapHandle.readpkt()&lt;br /&gt; File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pcs/__init__.py", line 1009, in readpkt&lt;br /&gt; packet = self.read()&lt;br /&gt; File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pcs/__init__.py", line 991, in read&lt;br /&gt; packet = self.file.next()&lt;br /&gt; File "pcap.pyx", line 502, in pcap.pcap.__next__&lt;br /&gt;KeyboardInterrupt&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-1396195254687046457?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/1396195254687046457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/yep.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1396195254687046457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1396195254687046457'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/yep.html' title='Yep.'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8868608027709848470</id><published>2009-08-12T20:59:00.001-04:00</published><updated>2009-08-12T20:59:43.535-04:00</updated><title type='text'>Not understanding the logic flow here</title><content type='html'>&lt;p style="clear: both"&gt;Going back and testing stuff. Check this out...&lt;/p&gt;&lt;p style="clear: both"&gt;self.filter.read() # tcpregression.tcpfilter.TcpFilter.read()&lt;/p&gt;&lt;p style="clear: both"&gt;which calls:&lt;/p&gt;&lt;p style="clear: both"&gt;return self.pcapHandle.readpkt() # pcs.PcapConnector.readpkt()&lt;/p&gt;&lt;p style="clear: both"&gt;which calls:&lt;/p&gt;&lt;p style="clear: both"&gt;packet = self.file.next()[1] # pcs.pcap.pcap.next()&lt;/p&gt;&lt;p style="clear: both"&gt;However, debug statements show&lt;/p&gt;&lt;p style="clear: both"&gt;"IN __NEXT__".&lt;/p&gt;&lt;p style="clear: both"&gt;Dubbleyou Tee Eff.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8868608027709848470?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8868608027709848470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/not-understanding-logic-flow-here.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8868608027709848470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8868608027709848470'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/not-understanding-logic-flow-here.html' title='Not understanding the logic flow here'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5769244357140332891</id><published>2009-08-12T18:11:00.003-04:00</published><updated>2009-08-12T18:11:52.425-04:00</updated><title type='text'>HA!</title><content type='html'>&lt;p style="clear: both"&gt;Finally figured out the logging bit... a few changes to the config file, combined with:&lt;/p&gt;&lt;pre style="clear: both"&gt;logFiles  = [ 'logging.conf',&lt;br /&gt;             join( expanduser( '~'  ), 'logging.conf'  ), &lt;br /&gt;             join( dirname( __file__ ), 'logging.conf'  ), &lt;br /&gt;             None ] &lt;br /&gt;  &lt;br /&gt;for  logFile in  logFiles: &lt;br /&gt;     if  exists( logFile ): &lt;br /&gt;         print  "Using  logfile  %s"  % logFile &lt;br /&gt;         logging.config.fileConfig( logFile ) &lt;br /&gt;&lt;/pre&gt;&lt;p style="clear: both"&gt;Fixed the problem&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5769244357140332891?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5769244357140332891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/ha_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5769244357140332891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5769244357140332891'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/ha_12.html' title='HA!'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2223699752524143650</id><published>2009-08-10T22:34:00.001-04:00</published><updated>2009-08-10T22:36:17.338-04:00</updated><title type='text'>Modem dead</title><content type='html'>Posting from iPhone.  My router &amp; modem fried in storm.  :-/ fml&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2223699752524143650?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2223699752524143650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/modem-dead.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2223699752524143650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2223699752524143650'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/modem-dead.html' title='Modem dead'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7888668070380312615</id><published>2009-08-10T21:11:00.001-04:00</published><updated>2009-08-10T21:11:37.088-04:00</updated><title type='text'>The Issue [Nevermind, Fixed]</title><content type='html'>&lt;p style="clear: both"&gt;&lt;strong&gt;Nevermind, in the process of writing this post, I made a change at some point that made everything work all honky-dory.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;build.py in pcs-0.5 and pypcap both use the following command to link everything:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;/usr/bin/gcc-4.0 -L/opt/local/lib -bundle -undefined dynamic_lookup build/temp.macosx-10.5-i386-2.6/pcs/pcap/pcap.o build/temp.macosx-10.5-i386-2.6/pcs/pcap/pcap_ex.o -L/usr/lib -lpcap -o build/lib.macosx-10.5-i386-2.6/pcs/pcap.so&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;build.py in tcpregression links it with...&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;/usr/bin/gcc-4.0 -L/opt/local/lib -bundle -undefined dynamic_lookup build/temp.macosx-10.5-i386-2.6/src/pcs/pcap/pcap.o build/temp.macosx-10.5-i386-2.6/src/pcs/pcap/pcap_ex.o -o build/lib.macosx-10.5-i386-2.6/pcs/pcap.so&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;The discrepancy between the two being:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;strong&gt; -L/usr/lib -lpcap &lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;Exactly why this is the case, I'm unsure. Obviously, if pcap.so isn't linked with libpcap (the actual pcap library), there would be issues.&lt;/p&gt;&lt;p style="clear: both"&gt;The build system uses setup.py from pcs-0.5, with a modification to include the different source directory. Here's the diff between pcs' setup.py and my "pcssetup.py". All of the changes have to do with the source being in a "src" folder.&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;&amp;lt; pcap_cache = 'src/pcs/pcap/config.pkl'&lt;br /&gt;---&lt;br /&gt;&amp;gt; pcap_cache = 'pcs/pcap/config.pkl'&lt;br /&gt;71c71&lt;br /&gt;&amp;lt;         f = open( 'src/pcs/pcap/config.h', 'w' )&lt;br /&gt;---&lt;br /&gt;&amp;gt;         f = open( 'pcs/pcap/config.h', 'w' )&lt;br /&gt;122c122&lt;br /&gt;&amp;lt;                  sources = [ 'src/pcs/pcap/pcap.pyx', 'src/pcs/pcap/pcap_ex.c' ],&lt;br /&gt;---&lt;br /&gt;&amp;gt;                  sources = [ 'pcs/pcap/pcap.pyx', 'pcs/pcap/pcap_ex.c' ],&lt;br /&gt;129a130,140&lt;br /&gt;&amp;gt; &lt;br /&gt;&amp;gt; setup( name = 'pcs',&lt;br /&gt;&amp;gt;       version = '0.5',&lt;br /&gt;&amp;gt;       description = 'Packet Construction Set',&lt;br /&gt;&amp;gt;       author = 'George V. Neville-Neil',&lt;br /&gt;&amp;gt;       author_email = 'gnn@neville-neil.com',&lt;br /&gt;&amp;gt;       url = 'http://pcs.sf.net',&lt;br /&gt;&amp;gt;       packages = ['pcs', 'pcs.packets'],&lt;br /&gt;&amp;gt;       cmdclass = pcap_cmds,&lt;br /&gt;&amp;gt;       ext_modules = [ pcap ],&lt;br /&gt;&amp;gt;       )&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;And then the actual setup file....&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;from distutils.core import setup, Extension&lt;br /&gt;import pcssetup&lt;br /&gt;setup( name = 'tcpregression',&lt;br /&gt; version = '1.0',&lt;br /&gt; description = 'FreeBSD TCP Regression Suite',&lt;br /&gt; author = 'Zach Riggle',&lt;br /&gt; author_email = 'zjriggl@freebsd.org',&lt;br /&gt; url = 'http://freebsd.org',&lt;br /&gt; packages = ['tcpregression',&lt;br /&gt; 'tcpregression.pcsextension',&lt;br /&gt; 'tcpregression.tests',&lt;br /&gt; 'pcs',&lt;br /&gt; 'pcs.packets'],&lt;br /&gt; package_dir = {'':'src'},&lt;br /&gt; cmdclass = pcssetup.pcap_cmds,&lt;br /&gt; ext_modules = [pcssetup.pcap],&lt;br /&gt; )&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;As you can see, not too many changes.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7888668070380312615?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7888668070380312615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/issue-nevermind-fixed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7888668070380312615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7888668070380312615'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/issue-nevermind-fixed.html' title='The Issue [Nevermind, Fixed]'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5541967179879593882</id><published>2009-08-10T18:07:00.001-04:00</published><updated>2009-08-10T18:07:36.242-04:00</updated><title type='text'>Proper Building with Setup.py</title><content type='html'>&lt;p style="clear: both"&gt;Thought I'd give proper building with "setup.py" a go. Back to square one with:&lt;/p&gt;&lt;p style="clear: both"&gt;ImportError: dlopen(pcs/pcap.so, 2): Symbol not found: _bpf_filter&lt;br /&gt; Referenced from: /Users/zach/Documents/workspace/zjriggl_tcpregression/build/lib.macosx-10.5-i386-2.6/pcs/pcap.so&lt;br /&gt; Expected in: dynamic lookup&lt;/p&gt;&lt;p style="clear: both"&gt;Humbug.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5541967179879593882?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5541967179879593882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/proper-building-with-setuppy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5541967179879593882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5541967179879593882'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/proper-building-with-setuppy.html' title='Proper Building with Setup.py'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-953900720806593291</id><published>2009-08-10T00:03:00.001-04:00</published><updated>2009-08-10T00:03:22.345-04:00</updated><title type='text'>Massive Cleanup</title><content type='html'>&lt;p style="clear: both"&gt;I'm going back through a lot of the code, removing commented-out code, deleting un-used files, and restructuring a bit. Hopefully this'll make everything a lot cleaner for when I'm done :-)&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-953900720806593291?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/953900720806593291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/massive-cleanup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/953900720806593291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/953900720806593291'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/massive-cleanup.html' title='Massive Cleanup'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2563393021579374140</id><published>2009-08-09T22:32:00.001-04:00</published><updated>2009-08-09T22:32:42.275-04:00</updated><title type='text'>Problem Solved</title><content type='html'>&lt;p style="clear: both"&gt;Evidently "setup.py build_ext -i" doesn't do somethign that the regular build operation does. Not sure what. Anyway, the Python documentation for setup.py says that the output files will always end up in build/lib/ or build/lib.&lt;em&gt;arch&lt;/em&gt;/ so a "cp build/lib*/pcap.so ..." will take care of it. Hopefully that'll solve the problem.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2563393021579374140?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2563393021579374140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/problem-solved.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2563393021579374140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2563393021579374140'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/problem-solved.html' title='Problem Solved'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-1815585535944805728</id><published>2009-08-09T21:32:00.001-04:00</published><updated>2009-08-09T21:32:36.263-04:00</updated><title type='text'>PyPcap issues when running in-directory</title><content type='html'>&lt;p style="clear: both"&gt;Some of the issues I originally had when getting PyPcap setup back in June are re-surfacing, now that I've got PCS and PyPcap (as pcs.pcap) inside of the tcpregression folder:&lt;/p&gt;&lt;p style="clear: both"&gt;&amp;gt;&amp;gt;&amp;gt; import pcs.pcap&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt; File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;br /&gt; File "pcs/__init__.py", line 68, in &amp;lt;module&amp;gt;&lt;br /&gt; import pcs.pcap as pcap&lt;br /&gt;ImportError: dlopen(pcs/pcap.so, 2): Symbol not found: _bpf_filter&lt;br /&gt; Referenced from: /Users/zach/Documents/workspace/zjriggl_tcpregression/src/tcpregression/pcs/pcap.so&lt;br /&gt; Expected in: dynamic lookup&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-1815585535944805728?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/1815585535944805728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/pypcap-issues-when-running-in-directory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1815585535944805728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1815585535944805728'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/pypcap-issues-when-running-in-directory.html' title='PyPcap issues when running in-directory'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-1010885914980715983</id><published>2009-08-08T20:37:00.001-04:00</published><updated>2009-08-08T20:37:45.006-04:00</updated><title type='text'>Build system</title><content type='html'>&lt;p style="clear: both"&gt;I've integrated the PyPcap changes (&lt;a href="http://zachriggle.github.com/pypcap/" target="_blank"&gt;http://zachriggle.github.com/pypcap/&lt;/a&gt;) into the TcpRegression Perforce tree, and put the custom-modified PCS-0.5 directory in there, as well. It contains some bugfixes for PCS-0.5, as well as a few modifications to make things easier for my particular uses.&lt;/p&gt;&lt;p style="clear: both"&gt;The build system for building PyPcap, and putting the module into the PCS directory is also in place. That was kind of an interesting foray into make and setup.py, but it works very cleanly now that I've got it figured out (thanks &lt;a href="http://ivory.idyll.org/blog" target="_blank"&gt;Titus&lt;/a&gt;!).&lt;/p&gt;&lt;p style="clear: both"&gt;Next steps are to write a few quick tests for the TcpRegression library itself, mainly to make sure that the threading stuff works as expected. Assuming that it does, I'll be able to crank out some TCP tests and have a final product for FreeBSD.&lt;/p&gt;&lt;p style="clear: both"&gt;My work schedule changes quite a bit next week, so I'll be awake while most people are asleep/at work (depending on how I do it). Basically I'm working 0200-1000 next week, and need to figure out if I'm gonna wake just before 2AM, or go to bed just after 10AM.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-1010885914980715983?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/1010885914980715983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/build-system.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1010885914980715983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1010885914980715983'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/build-system.html' title='Build system'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-6939692565829465098</id><published>2009-08-06T21:16:00.001-04:00</published><updated>2009-08-06T21:16:34.064-04:00</updated><title type='text'>GitHub site, setup.py issues</title><content type='html'>&lt;p style="clear: both"&gt;"git push".&lt;/p&gt;&lt;p style="clear: both"&gt;Now the stuff is ACTUALLY on the site. My god is the default color scheme ugly. &lt;s&gt;Working to fix that!&lt;/s&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;a href="" title="http://zachriggle.github.com/pypcap"&gt;http://zachriggle.github.com/pypcap&lt;/a&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;If anybody is familiar with setup.py, please contact me via email.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-6939692565829465098?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/6939692565829465098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/github-site-setuppy-issues.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6939692565829465098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6939692565829465098'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/github-site-setuppy-issues.html' title='GitHub site, setup.py issues'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2637864842077367710</id><published>2009-08-05T22:52:00.001-04:00</published><updated>2009-08-05T22:52:12.042-04:00</updated><title type='text'>PyPcap Migrated to Git</title><content type='html'>&lt;p style="clear: both"&gt;http://github.com/zachriggle/pypcap&lt;/p&gt;&lt;p style="clear: both"&gt;A bunch of changes have been made. I'm working on going back in and documenting those changes. I'll have a changelog shortly, as well as a demo.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2637864842077367710?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2637864842077367710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/pypcap-migrated-to-git.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2637864842077367710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2637864842077367710'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/pypcap-migrated-to-git.html' title='PyPcap Migrated to Git'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3635170905135492938</id><published>2009-08-05T21:28:00.001-04:00</published><updated>2009-08-05T21:28:48.420-04:00</updated><title type='text'>Forked, Fixed, Updating</title><content type='html'>&lt;p style="clear: both"&gt;Taking some advice and forking PyPcap. Working on adding the patches provided by users. Right now I'm trying to get Pyrex to like the changes that I'm making to make the 'findalldevs' function closer to the real one. A user submitted a patch on the Google Code site, but it doesn't return ALL of the data the function should. Unfortunately, I have to add a bunch of types and unroll several linked-lists and arrays to get all of the data.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3635170905135492938?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3635170905135492938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/forked-fixed-updating.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3635170905135492938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3635170905135492938'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/forked-fixed-updating.html' title='Forked, Fixed, Updating'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7258722166171372454</id><published>2009-08-02T22:46:00.001-04:00</published><updated>2009-08-02T22:46:39.484-04:00</updated><title type='text'>Perforce Woes</title><content type='html'>&lt;p style="clear: both"&gt;I don't know if I mentioned this earlier, but Perforce is *by far* the hardest version management system that I've ever had to work with -- out of CVS and SVN, that is. &lt;/p&gt;&lt;p style="clear: both"&gt;First off, it defines its operation off of environment variables. This makes manipulation pretty hard unless I define environment variables in bashrc or something -- and changing environments pretty hard to boot.&lt;br /&gt;Second off, it complains every time my hostname changes. Right now, it keeps complaining that I can only commit from "Zachs-Computer", which is the hostname.&lt;br /&gt;Third, I have to define a workspace. This in itself is a pain. I can see the benefits, although if I have to change my hostname to use a workspace, it's kind of moot point. "svn co path/to/server" FTW.&lt;/p&gt;&lt;p style="clear: both"&gt;I'm back off to fight with P4 while I try to commit my code :-\&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7258722166171372454?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7258722166171372454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/perforce-woes.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7258722166171372454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7258722166171372454'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/perforce-woes.html' title='Perforce Woes'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-6801682954711776766</id><published>2009-08-02T19:43:00.001-04:00</published><updated>2009-08-02T19:43:45.744-04:00</updated><title type='text'>PyPcap = Abandonware</title><content type='html'>&lt;p style="clear: both"&gt;So PyPcap, the Pcap library that PCS includes in its distribution, is essentially abandonware. Hasn't been a new release since Jan 2007. The files in the included PyPcap say that GNN is the maintainer.&lt;/p&gt;&lt;p style="clear: both"&gt;George, if you are reading this, please let me know so that I may submit patches to PyPcap. There is at least one issue that is of high importance to my project, &lt;strong&gt;for which a patch already exists&lt;/strong&gt;, that I don't mind integrating into the PyPcap project on Google Code.&lt;/p&gt;&lt;p style="clear: both"&gt;I tweeted at @dugsong, so hopefully the guy in charge of the project (as far as Google Code is concerned) will give me access to make the changes. I can make the changes locally, but there's no reason not to include them online for all to use.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-6801682954711776766?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/6801682954711776766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/pypcap-abandonware.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6801682954711776766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6801682954711776766'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/pypcap-abandonware.html' title='PyPcap = Abandonware'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8403295794704367665</id><published>2009-08-01T19:45:00.001-04:00</published><updated>2009-08-01T19:45:27.334-04:00</updated><title type='text'>Okay, so that's done... but we're stuck with a hanging thread [HALP!]</title><content type='html'>&lt;p style="clear: both"&gt;The full TCP exchange of 3-way-handshake, data transfer (with acknowledgement) and active-close (Established -&amp;gt; Fin Wait 1 -&amp;gt; Fin Wait 2 -&amp;gt; Time Wait) has been successfully tested, and works fine.&lt;/p&gt;&lt;p style="clear: both"&gt;Here's the script, and subsequent output:&lt;/p&gt;&lt;pre style="clear: both"&gt;import testconfig&lt;br /&gt;from tcpstatemachine import *&lt;br /&gt;from threading import Thread&lt;br /&gt;from testserver import runServer&lt;br /&gt;from multiprocessing import Process&lt;br /&gt;&lt;br /&gt;def test():&lt;br /&gt;    t = TcpStateMachine()&lt;br /&gt;    t.die = False&lt;br /&gt;    &lt;br /&gt;    serverProcess = Process(target=runServer)&lt;br /&gt;    serverProcess.start()&lt;br /&gt;    &lt;br /&gt;    t.open()&lt;br /&gt;    t.send('COOOOOOOL!')&lt;br /&gt;    t.close()&lt;br /&gt;    &lt;br /&gt;    serverProcess.terminate()&lt;br /&gt;&lt;/pre&gt;&lt;p style="clear: both"&gt; &lt;/p&gt;&lt;pre style="clear: both"&gt;&amp;gt;&amp;gt;&amp;gt; import test&lt;br /&gt;2009-08-01 17:35:18,212 - tcpFilter - INFO - Opened lo0&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; test.test()&lt;br /&gt;2009-08-01 17:35:19,867 - TcpStateMachine - DEBUG - __init__ - (('127.0.0.3', 31765), ('127.0.0.1', 32261))&lt;br /&gt;2009-08-01 17:35:19,870 - tcpFilter - DEBUG - openInterface - Tried to re-open same interface: lo0&lt;br /&gt;2009-08-01 17:35:19,870 - tcpFilter - INFO - Opened lo0&lt;br /&gt;2009-08-01 17:35:19,870 - TcpStateMachine - INFO - Local host: 127.0.0.3:31765&lt;br /&gt;2009-08-01 17:35:19,871 - TcpStateMachine - INFO - Remote host: 127.0.0.1:32261&lt;br /&gt;~~~~~ In runServer&lt;br /&gt;~~~~~ Listening on 127.0.0.1:32261&lt;br /&gt;~~~~~ Waiting for accepted connection&lt;br /&gt;2009-08-01 17:35:19,950 - TcpStateMachine - DEBUG - open - In valid state to open connection&lt;br /&gt;2009-08-01 17:35:19,967 - TcpStateMachine - DEBUG - open - Generated ISS: 1036344287&lt;br /&gt;2009-08-01 17:35:19,969 - TcpStateMachine - DEBUG - open - Sending SYN packet&lt;br /&gt;2009-08-01 17:35:19,975 - TcpStateMachine - STATE - Setting state from Closed to Syn-Sent&lt;br /&gt;2009-08-01 17:35:19,976 - TcpRecvDaemon - INFO - Starting receive thread for object TcpStateMachine( (127.0.0.3,31765), (127.0.0.1,32261) )&lt;br /&gt;2009-08-01 17:35:19,977 - TcpSendDaemon - INFO - Starting send thread for object TcpStateMachine( (127.0.0.3,31765), (127.0.0.1,32261) )&lt;br /&gt;2009-08-01 17:35:19,980 - TcpStateMachine - DEBUG - open - Waiting for state == ESTABLISHED... Outbound Sequenes: segmentBuffer(limit=4294967296,base=1036344287,copyList=['[SYN]']+[])&lt;br /&gt;2009-08-01 17:35:20,047 - TcpSendDaemon - DEBUG - sendThread - Sending items 1036344287 to 1036345633 in ['[SYN]']&lt;br /&gt;2009-08-01 17:35:20,049 - TcpSendDaemon - DEBUG - sendThread - Sending sequences 1036344287 to 1036344288: ['[SYN]']&lt;br /&gt;2009-08-01 17:35:20,050 - TcpSendDaemon - DEBUG - sendThread - Haz a SYN!&lt;br /&gt;2009-08-01 17:35:20,054 - TcpStateMachine - SENT - [&amp;lt;class tcp Seq: 1036344287, 31765-&amp;gt;32261, [S], reserved: 0, checksum: 7711, offset: 5, window: 65535L&amp;gt;, &lt;br /&gt;&amp;lt;class payload {payload: ''}&amp;gt;]&lt;br /&gt;2009-08-01 17:35:20,484 - TcpStateMachine - INFO - Segment arrived!&lt;br /&gt;2009-08-01 17:35:20,485 - TcpStateMachine - RECVD - [&amp;lt;class tcp Seq: 1883201111, 32261-&amp;gt;31765, [AS], reserved: 0, checksum: 65058, offset: 6, window: 65535, ack_number: 1036344288&amp;gt;]&lt;br /&gt;2009-08-01 17:35:20,487 - TcpStateMachine - DEBUG - debugWithState - [Syn-Sent] IN SYN_SENT&lt;br /&gt;2009-08-01 17:35:20,489 - TcpStateMachine - DEBUG - debugWithState - [Syn-Sent] Has ACK&lt;br /&gt;2009-08-01 17:35:20,490 - TcpStateMachine - DEBUG - debugWithState - [Syn-Sent] Accepted ACK&lt;br /&gt;2009-08-01 17:35:20,492 - TcpStateMachine - DEBUG - debugWithState - [Syn-Sent] Has SYN and either good ACK or no ACK&lt;br /&gt;2009-08-01 17:35:20,492 - TcpStateMachine - STATE - Setting state from Syn-Sent to Established&lt;br /&gt;Sending ack: {seq: 1036344288, ack: 1, ack#: 1883201112}&lt;br /&gt;2009-08-01 17:35:20,497 - TcpStateMachine - SENT - [&amp;lt;class tcp Seq: 1036344288, 31765-&amp;gt;32261, [A], reserved: 0, checksum: 20344, offset: 5, window: 65535L, ack_number: 1883201112L&amp;gt;]&lt;br /&gt;~~~~~ Connected&lt;br /&gt;~~~~~ Waiting on Data&lt;br /&gt;2009-08-01 17:35:20,499 - TcpStateMachine - DEBUG - open - Established&lt;br /&gt;2009-08-01 17:35:20,507 - TcpSendDaemon - DEBUG - sendThread - Sending items 1036344288 to 1036345634 in ['C', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'L', '!', 'C', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'L', '!']&lt;br /&gt;2009-08-01 17:35:20,508 - TcpSendDaemon - DEBUG - sendThread - Sending sequences 1036344288 to 1036344308: ['C', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'L', '!', 'C', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'L', '!']&lt;br /&gt;2009-08-01 17:35:20,511 - TcpStateMachine - SENT - [&amp;lt;class tcp Seq: 1036344288, 31765-&amp;gt;32261, [A], reserved: 0, checksum: 21671, offset: 5, window: 65535L, ack_number: 1883201112L&amp;gt;, &lt;br /&gt;&amp;lt;class payload {payload: 'COOOOOOOL!COOOOOOOL!'}&amp;gt;]&lt;br /&gt;Received Data: COOOOOOOL!COOOOOOOL!&lt;br /&gt;~~~~~ Waiting on Data&lt;br /&gt;2009-08-01 17:35:21,008 - TcpStateMachine - INFO - Segment arrived!&lt;br /&gt;2009-08-01 17:35:21,009 - TcpStateMachine - RECVD - [&amp;lt;class tcp Seq: 1883201112, 32261-&amp;gt;31765, [A], reserved: 0, checksum: 65054, offset: 5, window: 65535, ack_number: 1036344308&amp;gt;]&lt;br /&gt;2009-08-01 17:35:21,009 - TcpStateMachine - ERROR - This point should never be reached!&lt;br /&gt;2009-08-01 17:35:21,059 - TcpStateMachine - STATE - Setting state from Established to Fin-Wait-1&lt;br /&gt;2009-08-01 17:35:22,021 - TcpSendDaemon - DEBUG - sendThread - Sending items 1036344308 to 1036345654 in ['[FIN]']&lt;br /&gt;2009-08-01 17:35:22,023 - TcpSendDaemon - DEBUG - sendThread - Sending sequences 1036344308 to 1036344309: ['[FIN]']&lt;br /&gt;2009-08-01 17:35:22,024 - TcpSendDaemon - DEBUG - sendThread - Haz an FIN!&lt;br /&gt;2009-08-01 17:35:22,028 - TcpStateMachine - SENT - [&amp;lt;class tcp Seq: 1036344308, 31765-&amp;gt;32261, [AF], reserved: 0, checksum: 20323, offset: 5, window: 65535L, ack_number: 1883201112L&amp;gt;, &lt;br /&gt;&amp;lt;class payload {payload: ''}&amp;gt;]&lt;br /&gt;Received Data: &lt;br /&gt;~~~~~ No more data&lt;br /&gt;2009-08-01 17:35:23,016 - TcpStateMachine - INFO - Segment arrived!&lt;br /&gt;2009-08-01 17:35:23,017 - TcpStateMachine - RECVD - [&amp;lt;class tcp Seq: 1883201112, 32261-&amp;gt;31765, [A], reserved: 0, checksum: 65054, offset: 5, window: 65535, ack_number: 1036344309&amp;gt;]&lt;br /&gt;2009-08-01 17:35:23,019 - TcpStateMachine - DEBUG - debugWithState - [Fin-Wait-1] Our FIN is ACKed&lt;br /&gt;2009-08-01 17:35:23,019 - TcpStateMachine - STATE - Setting state from Fin-Wait-1 to Fin-Wait-2&lt;br /&gt;2009-08-01 17:35:23,020 - TcpStateMachine - ERROR - This point should never be reached!&lt;br /&gt;2009-08-01 17:35:23,023 - TcpStateMachine - INFO - Segment arrived!&lt;br /&gt;2009-08-01 17:35:23,024 - TcpStateMachine - RECVD - [&amp;lt;class tcp Seq: 1883201112, 32261-&amp;gt;31765, [AF], reserved: 0, checksum: 65054, offset: 5, window: 65535, ack_number: 1036344309&amp;gt;]&lt;br /&gt;2009-08-01 17:35:23,025 - TcpStateMachine - DEBUG - debugWithState - [Fin-Wait-2] connection closing&lt;br /&gt;2009-08-01 17:35:23,027 - TcpStateMachine - DEBUG - debugWithState - [Fin-Wait-2] sending ACK of FIN&lt;br /&gt;Sending ack: {seq: 1036344309, ack: 1, ack#: 1883201113}&lt;br /&gt;2009-08-01 17:35:23,029 - TcpStateMachine - SENT - [&amp;lt;class tcp Seq: 1036344309, 31765-&amp;gt;32261, [A], reserved: 0, checksum: 20322, offset: 5, window: 65535L, ack_number: 1883201113L&amp;gt;]&lt;br /&gt;2009-08-01 17:35:23,030 - TcpStateMachine - STATE - Setting state from Fin-Wait-2 to Time-Wait&lt;br /&gt;2009-08-01 17:35:23,031 - TcpStateMachine - DEBUG - debugWithState - [Time-Wait] Starting TIME_WAIT timer&lt;br /&gt;2009-08-01 17:35:24,035 - TcpSendDaemon - DEBUG - sendThread - Quitting send thread&lt;br /&gt;2009-08-01 17:35:33,032 - TcpStateMachine - STATE - Setting state from Time-Wait to Closed&lt;br /&gt;&lt;/pre&gt;&lt;p style="clear: both"&gt; It's a bit more verbose than it needs to be, and there's a few things that will be taken out (i.e. "Haz a SYN!") but overall I'm pleased with the way it works.&lt;/p&gt;&lt;p style="clear: both"&gt;However, the only remaining problem before the real-real test-writing gets going is that the call to retrieve the next packet from PCAP is a blocking call that's performed by a Python thread (which has no terminate() or equivalent method).&lt;/p&gt;&lt;p style="clear: both"&gt;Looking into the issue a bit, pypcap has a "setnonblock(nonblock=True)" method, but due to the way everything is done, this isn't quite so easy to work with (there are also some bug reports that say that this functionality doesn't necessarily work as expected).&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8403295794704367665?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8403295794704367665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/okay-so-that-done-but-we-stuck-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8403295794704367665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8403295794704367665'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/08/okay-so-that-done-but-we-stuck-with.html' title='Okay, so that&amp;#39;s done... but we&amp;#39;re stuck with a hanging thread [HALP!]'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5951799302396011775</id><published>2009-07-31T00:18:00.001-04:00</published><updated>2009-07-31T00:18:42.775-04:00</updated><title type='text'>Diagram</title><content type='html'>&lt;p style="clear: both"&gt;Sexy.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;a href="http://www.eventhelix.com/RealtimeMantra/Networking/Tcp.pdf" target="_blank"&gt;http://www.eventhelix.com/RealtimeMantra/Networking/Tcp.pdf&lt;/a&gt;&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5951799302396011775?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5951799302396011775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/diagram.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5951799302396011775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5951799302396011775'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/diagram.html' title='Diagram'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8326411278947092083</id><published>2009-07-24T11:49:00.001-04:00</published><updated>2009-07-24T11:49:08.731-04:00</updated><title type='text'>BitString Cleanup</title><content type='html'>&lt;p style="clear: both"&gt;Finally settled on the below design for BitString. I had added, and then removed, functionality for AND, OR, and XOR because it is ambiguous as to what length to use if the operands are not the same length.&lt;/p&gt;&lt;p style="clear: both"&gt;For example, it should be possible to AND&lt;br /&gt;0xFFFF &amp;amp; 0x7&lt;br /&gt;To get 0x7.&lt;/p&gt;&lt;p style="clear: both"&gt;However, is that '0b0000000000000111' or '0b0111' or some other variant. Given that the values are indexes from the most-significant-bit, this creates an issue.&lt;/p&gt;&lt;p style="clear: both"&gt;Anyway, here it is below. Modding PCS to use this for decoding simple values.&lt;/p&gt;&lt;pre style="clear: both"&gt;class  BitString(list):&lt;br /&gt;     '''  &lt;br /&gt;     Creates a list containing the individual bits from a byte-string, integer, &lt;br /&gt;     or list of values (where each list is interpreted as 1 or 0 based on its &lt;br /&gt;     truth balue ). &lt;br /&gt;      &lt;br /&gt;     Bits are ordered from most-significant to least-significant. &lt;br /&gt;      &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; import pcs  &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; x = pcs.BitString(0xDEADBEEF)   &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; x &lt;br /&gt;     [1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1] &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; x[4:12] &lt;br /&gt;     [1, 1, 1, 0, 1, 0, 1, 0] &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; int (x) &lt;br /&gt;     3735928559L &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; hex(x) &lt;br /&gt;     '0xdeadbeefL' &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; hex(x[16:32]) &lt;br /&gt;     '0xbeef' &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; bin(int (x)) &lt;br /&gt;     '0b11011110101011011011111011101111' &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; str (x) &lt;br /&gt;     '\xde \xad \xbe \xef ' &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; x[0:8] = 0xAA &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; x[8:16] = [1,1,1,1,0,0,0,0] &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; hex(x) &lt;br /&gt;     '0xaaf0beefL' &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; int (x) == 0xAAF0BEEF &lt;br /&gt;     True &lt;br /&gt;     ''' &lt;br /&gt;  &lt;br /&gt;     def  __init__(self,bytes): &lt;br /&gt;          # Convert integer values to their byte representation &lt;br /&gt;         if  isinstance(bytes,int) or  isinstance(bytes,long): &lt;br /&gt;             packString = ''  &lt;br /&gt;             if  abs(bytes) &amp;lt;= 0xff : &lt;br /&gt;                 packString = '!B'  &lt;br /&gt;             elif  abs(bytes) &amp;lt;= 0xffff : &lt;br /&gt;                 packString = '!H'  &lt;br /&gt;             elif  abs(bytes) &amp;lt;= 0xffffffff : &lt;br /&gt;                 packString = '!I'  &lt;br /&gt;             bytes = struct.pack(packString, bytes) &lt;br /&gt;          &lt;br /&gt;          # Convert a list into a byte representation by taking each item &lt;br /&gt;          # and turning it into a bit. &lt;br /&gt;         if  isinstance(bytes,list) or  isinstance(bytes,tuple): &lt;br /&gt;             self.length = len(bytes)*8  &lt;br /&gt;             for  index,i in  enumerate(bytes): &lt;br /&gt;                 self.append(1  if  i else  0 )   &lt;br /&gt;          &lt;br /&gt;          # For strings or string'ized integers, do bit-shifty stuff &lt;br /&gt;          # &amp;gt;&amp;gt;&amp;gt; bin(0xFF00) &lt;br /&gt;          # '0b1111111100000000' &lt;br /&gt;         if  isinstance(bytes, str): &lt;br /&gt;             self.length = len(bytes)*8  &lt;br /&gt;              # Do each byte in-order &lt;br /&gt;             for  i,byte in  enumerate(bytes): &lt;br /&gt;                  # Most-significant-bit first &lt;br /&gt;                 for  bit in  range(8 )[::-1 ]: &lt;br /&gt;                     self.append(1  if  ord(byte) &amp;amp; (1  &amp;lt;&amp;lt; bit) else  0 ) &lt;br /&gt;              &lt;br /&gt;                      &lt;br /&gt;     def  __int__(self): &lt;br /&gt;         intVal = 0  &lt;br /&gt;         for  index,i in  enumerate(self):       &lt;br /&gt;             intVal += self[-index-1 ] &amp;lt;&amp;lt; index &lt;br /&gt;         return  intVal &lt;br /&gt;      &lt;br /&gt;     def  __str__(self): &lt;br /&gt;         value = int(self) &lt;br /&gt;         formatString = "%0"  + ("%s"  % (len(self)/8 )) + "x"  &lt;br /&gt;         hexstring = formatString % value &lt;br /&gt;         while  len(hexstring) % 2  != 0 : &lt;br /&gt;             hexstring = '0'  + hexstring   &lt;br /&gt;         byteString = binascii.unhexlify(hexstring) &lt;br /&gt;          &lt;br /&gt;         while  len(byteString) &amp;lt; len(self)/8 : &lt;br /&gt;             byteString = "\x00"  + byteString &lt;br /&gt;         return  byteString        &lt;br /&gt;      &lt;br /&gt;     def  __hex__(self): &lt;br /&gt;         return  hex(int(self)) &lt;br /&gt;      &lt;br /&gt;     def  __getitem__(self, x): &lt;br /&gt;         return  list.__getitem__(self,x) &lt;br /&gt;      &lt;br /&gt;     def  __getslice__(self,i,j): &lt;br /&gt;         return  BitString(list.__getslice__(self,i,j)) &lt;br /&gt;      &lt;br /&gt;     def  __setitem__(self, i, x): &lt;br /&gt;         x = 1  if  x else  0  &lt;br /&gt;         list.__setitem__(self,i,x) &lt;br /&gt;          &lt;br /&gt;     def  __setslice__(self,i,j,x): &lt;br /&gt;         bs = BitString(x) &lt;br /&gt;         list.__setslice__(self,i,j,bs) &lt;br /&gt;      &lt;br /&gt;     def  __invert__(self): &lt;br /&gt;         return  BitString([0  if  x else  1  for  x in  self]) &lt;br /&gt;          &lt;br /&gt;     def  __add__(self,x): &lt;br /&gt;         return  BitString(list.__add__(self,x)) &lt;/pre&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8326411278947092083?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8326411278947092083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/bitstring-cleanup.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8326411278947092083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8326411278947092083'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/bitstring-cleanup.html' title='BitString Cleanup'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7792176483877659264</id><published>2009-07-23T22:52:00.001-04:00</published><updated>2009-07-23T22:52:03.392-04:00</updated><title type='text'>Untitled</title><content type='html'>&lt;p style="clear: both"&gt;asdfasdf&lt;/p&gt;&lt;pre style="clear: both"&gt;class  BitString(object): &lt;br /&gt;     '''  &lt;br /&gt;     Allows bit-level manipulation of a string as if it were an array. &lt;br /&gt;      &lt;br /&gt;     Example: &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; x = pcs.BitString('\xff \xff ') &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; print x &lt;br /&gt;     0b1111111111111111 &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; print repr (x.bytes) &lt;br /&gt;     '\xff \xff ' &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; x[4:12] = 0 &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; print x &lt;br /&gt;     0b1111000000001111 &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; print bin(x[:8]) &lt;br /&gt;     0b11110000 &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; print bin(x[8:12]) &lt;br /&gt;     0b0 &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; print bin(x[12:]) &lt;br /&gt;     0b1111 &lt;br /&gt;     &amp;gt;&amp;gt;&amp;gt; print repr (x.bytes) &lt;br /&gt;     '\xf0\x0f' &lt;br /&gt;     '''       &lt;br /&gt;     def  __init__(self, bytes): &lt;br /&gt;         self.value = 0  &lt;br /&gt;         self.length = len(bytes)*8  &lt;br /&gt;         for  i,byte in  enumerate(bytes[::-1 ]):              &lt;br /&gt;             self.value += ord(byte) &amp;lt;&amp;lt; (i*8 ) &lt;br /&gt;     def  __getitem__(self, n):          &lt;br /&gt;         if  n &amp;gt; len(self): &lt;br /&gt;             raise  IndexError &lt;br /&gt;         return  1  if  self.value &amp;amp; (1  &amp;lt;&amp;lt; (len(self)-n-1 )) else  0  &lt;br /&gt;     def  __getslice__(self, i, j): &lt;br /&gt;         retVal= 0  &lt;br /&gt;         i = max(i,0 ) &lt;br /&gt;         j = min(j,len(self)) &lt;br /&gt;         for  n,bit in  enumerate(range(i,j)): &lt;br /&gt;             retVal &amp;lt;&amp;lt;= 1  &lt;br /&gt;             retVal += self[bit] &lt;br /&gt;         return  retVal &lt;br /&gt;      @property &lt;br /&gt;     def  bytes(self): return  self.getBytes() &lt;br /&gt;     def  getBytes(self): &lt;br /&gt;         formatString = "%0"  + ("%s"  % (len(self)/8 )) + "x"  &lt;br /&gt;         hexstring = formatString % self.value &lt;br /&gt;         byteString = binascii.unhexlify(hexstring) &lt;br /&gt;          &lt;br /&gt;         while  len(byteString) &amp;lt; len(self)/8 : &lt;br /&gt;             byteString = "\x00"  + byteString &lt;br /&gt;         return  byteString          &lt;br /&gt;     def  __len__(self): &lt;br /&gt;         return  self.length &lt;br /&gt;     def  __str__(self): &lt;br /&gt;         return  self.bin() &lt;br /&gt;     def  __repr__(self): &lt;br /&gt;         return  self.__class__.__name__ + "(%s)"  % repr(self.getBytes()) &lt;br /&gt;     def  __setitem__(self, n, x): &lt;br /&gt;         x = 1  if  x else  0  &lt;br /&gt;         if  x: &lt;br /&gt;             self.value |= (x &amp;lt;&amp;lt; (len(self)-n-1 )) &lt;br /&gt;         else : &lt;br /&gt;             self.value = self.value &amp;amp; self._makeMask(n) &lt;br /&gt;     def  __setslice__(self, i, j, x): &lt;br /&gt;         i = max(i,0 ) &lt;br /&gt;         j = min(j,len(self)) &lt;br /&gt;          &lt;br /&gt;         isAList = True  &lt;br /&gt;         if  isinstance(x,int) or  isinstance(x,long) or  isinstance(x,bool): &lt;br /&gt;             isAList = False  &lt;br /&gt;          &lt;br /&gt;         for  index,n in  enumerate(range(i,j)): &lt;br /&gt;             if  isAList: &lt;br /&gt;                 self[n] = x[index] &lt;br /&gt;             else : &lt;br /&gt;                 self[n] = x &lt;br /&gt;     def  _makeMask(self, bit): &lt;br /&gt;         mask = 0  &lt;br /&gt;         bitSkip = (len(self)-bit-1 ) &lt;br /&gt;         for  i in  range(len(self)): &lt;br /&gt;             if  i == bitSkip: &lt;br /&gt;                 continue  &lt;br /&gt;             mask += 1  &amp;lt;&amp;lt; i &lt;br /&gt;         return  mask &lt;br /&gt;     def  hex(self): &lt;br /&gt;         return  hex(self.value) &lt;br /&gt;     def  bin(self): &lt;br /&gt;         return  bin(self.value) &lt;/pre&gt;&lt;pre style="clear: both"&gt;&lt;/pre&gt;&lt;p style="clear: both"&gt;When used in conjunction with pcs.Field, I've set it up to calculate the value with the new method, but still *use* the value from the old method, to show the difference between the new vs. old method. Pay particular attention to syn, ack, fin, reset, and push.&lt;/p&gt;&lt;pre style="clear: both"&gt;&amp;gt;&amp;gt;&amp;gt; synAckPkt = tcp('09\xd4191\xf6\xae\x00\x00\x00\x01`\x12\xff\xff\xfe"\x00\x00')&lt;br /&gt;Decoding sport --&amp;gt; 12345&lt;br /&gt;Decoding dport --&amp;gt; 54321&lt;br /&gt;Decoding sequence --&amp;gt; 959575726&lt;br /&gt;Decoding ack_number --&amp;gt; 1&lt;br /&gt;Decoding offset --&amp;gt; 6&lt;br /&gt;Decoding reserved --&amp;gt; 0&lt;br /&gt;Decoding urgent --&amp;gt; 0&lt;br /&gt;Decoding ack --&amp;gt; 1&lt;br /&gt;Decoding psh --&amp;gt; 0&lt;br /&gt;Decoding reset --&amp;gt; 0&lt;br /&gt;Decoding syn --&amp;gt; 1&lt;br /&gt;Decoding fin --&amp;gt; 0&lt;br /&gt;Decoding window --&amp;gt; 65535&lt;br /&gt;Decoding checksum --&amp;gt; 65058&lt;br /&gt;Decoding urg_pointer --&amp;gt; 0&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; print repr(synAckPkt)&lt;br /&gt;&amp;lt;class tcp {reset: 4, psh: 2, reserved: 0, sequence: 959575726, ack: 1, checksum: 65058, offset: 6, syn: 9, urgent: 0, window: 65535, ack_number: 1, dport: 54321, sport: 12345, fin: 0, urg_pointer: 0}&amp;gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; print repr(synAckPkt.data)&lt;br /&gt;&amp;lt;class payload {payload: ''}&amp;gt; &lt;/pre&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7792176483877659264?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7792176483877659264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/untitled.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7792176483877659264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7792176483877659264'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/untitled.html' title='Untitled'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-4226786674640210434</id><published>2009-07-22T16:37:00.003-04:00</published><updated>2009-07-22T16:49:50.045-04:00</updated><title type='text'>Just Kooky</title><content type='html'>So PCS can pick up the fields just fine, as long as they're zeros.  Make SYN *and* ACK set to '1' and everything is FUBAR.&lt;br /&gt;&lt;br /&gt;Packet data taken from:&lt;br /&gt;http://support.microsoft.com/kb/172983&lt;br /&gt;&lt;br /&gt;Syn Packet Data:&lt;br /&gt;TCP: ....S., len: 4, seq: 8221822-8221825, ack: 0, win: 8192, src: 1037&lt;br /&gt;dst:  139 (NBT Session)&lt;br /&gt;&lt;br /&gt;Syn-Ack Packet Data:&lt;br /&gt;TCP: .A..S., len:    4, seq:   1109645-1109648, ack:   8221823, win: 8760,&lt;br /&gt;src:  139 (NBT Session)  dst: 1037&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; from pcs.packets.tcp import tcp&lt;br /&gt;&gt;&gt;&gt; import binascii&lt;br /&gt;&gt;&gt;&gt; synAck = "008B040D0010EE8D007D747F60122238012D0000020405B42020"&lt;br /&gt;&gt;&gt;&gt; syn = "040D008B007D747E0000000060022000F2130000020405B42020"&lt;br /&gt;&gt;&gt;&gt; &lt;br /&gt;&gt;&gt;&gt; synPkt = tcp(binascii.a2b_hex(syn))&lt;br /&gt;&gt;&gt;&gt; synAckPkt = tcp(binascii.a2b_hex(synAck))&lt;br /&gt;&gt;&gt;&gt; &lt;br /&gt;&gt;&gt;&gt; print repr(synPkt)&lt;br /&gt;[TCP: reset: 0, reserved: 0, sequence: 8221822, ack: 0, checksum: 61971, offset: 6, syn: 1, urgent: 0, window: 8192, push: 0, ack_number: 0, dport: 139, sport: 1037, fin: 0, urg_pointer: 0]&lt;br /&gt;&gt;&gt;&gt; &lt;br /&gt;&gt;&gt;&gt; print repr(synAckPkt)&lt;br /&gt;[TCP: reset: 4, reserved: 0, sequence: 1109645, ack: 1, checksum: 301, offset: 6, syn: 9, urgent: 0, window: 8760, push: 2, ack_number: 8221823, dport: 1037, sport: 139, fin: 0, urg_pointer: 0]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-4226786674640210434?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/4226786674640210434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/just-kooky.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4226786674640210434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4226786674640210434'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/just-kooky.html' title='Just Kooky'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5173193430763892214</id><published>2009-07-21T15:05:00.002-04:00</published><updated>2009-07-21T15:07:27.845-04:00</updated><title type='text'>PCS Bit Encoding</title><content type='html'>&lt;div&gt;Just some interesting code that I found in PCS.  As far as I can tell, the bits of code are the exact same, except for the "shift" field, which is not even used in the scope of the conditional.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;br /&gt;            # These two bits of code are the same.&lt;br /&gt;            elif fieldBR &gt; byteBR:&lt;br /&gt;                print "Cannot fit field into current byte"&lt;br /&gt;                shift = fieldBR - byteBR&lt;br /&gt;                mask = 2 ** byteBR - 1&lt;br /&gt;                value = (ord(bytes[curr]) &amp; mask)&lt;br /&gt;                fieldBR -= byteBR&lt;br /&gt;                byteBR = 8&lt;br /&gt;                curr += 1 # next byte&lt;br /&gt;            elif fieldBR == byteBR:&lt;br /&gt;                mask = 2 ** byteBR - 1&lt;br /&gt;                value = ord(bytes[curr]) &amp; mask&lt;br /&gt;                fieldBR -= byteBR&lt;br /&gt;                byteBR = 8&lt;br /&gt;                curr += 1 # next byte&lt;br /&gt;            real_value += value &lt;&lt; fieldBR&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5173193430763892214?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5173193430763892214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/pcs-bit-encoding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5173193430763892214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5173193430763892214'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/pcs-bit-encoding.html' title='PCS Bit Encoding'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5307725738863107716</id><published>2009-07-21T14:58:00.002-04:00</published><updated>2009-07-21T14:59:08.410-04:00</updated><title type='text'>Yeah</title><content type='html'>Working on the aforementioned PCS bug brought to my attention that I've fixed a few bugs in PCS that need to be fixed in the general distribution before running the below script will work.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rather, try this (which should work in PCS-0.5 without modification):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;from pcs.packets.tcp import tcp&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;t = tcp('09\xd4191\xf6\xae\x00\x00\x00\x01`\x12\xff\xff\xfe"\x00\x00')&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;print repr(t)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5307725738863107716?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5307725738863107716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/yeah.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5307725738863107716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5307725738863107716'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/yeah.html' title='Yeah'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5804402818675975132</id><published>2009-07-21T14:41:00.000-04:00</published><updated>2009-07-21T14:42:07.980-04:00</updated><title type='text'>PyDev</title><content type='html'>Just found out that PyDev has a built-in Python shell that does completion.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;FML.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5804402818675975132?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5804402818675975132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/pydev.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5804402818675975132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5804402818675975132'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/pydev.html' title='PyDev'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-1588060990955320845</id><published>2009-07-21T09:41:00.006-04:00</published><updated>2009-07-21T09:47:43.534-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='x'/><title type='text'>Full-Stop</title><content type='html'>Ran into a &lt;b&gt;BIG&lt;/b&gt; issue with PCS last night.  Evidently it's mis-identifying packet fields for TCP.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Demo included below:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;from pcs.packets.localhost import *&lt;br /&gt;import binascii&lt;br /&gt;x = '020000004500002cca844000400600007f0000017f0000033039d4313931f6ae000000016012fffffe220000'&lt;br /&gt;bytes = binascii.a2b_hex(x)&lt;br /&gt;l = localhost(bytes)&lt;br /&gt;ip = l.data&lt;br /&gt;tcp = ip.data&lt;br /&gt;print repr(tcp)&lt;br /&gt;print tcp&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Prints out the following.  Notice that instead of SYN/ACK, it is identified as SYN/ACK/RST/PSH.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; [class tcp {reset: 4, psh: 2, reserved: 0, sequence: 959575726, ack: 1, checksum: 65058, offset: 6, syn: 9, urgent: 0, window: 65535, ack_number: 1, dport: 54321, sport: 12345, fin: 0, urg_pointer: 0}, &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;class payload {payload: ''}]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;That packet is a loopback-ipv4-tcp packet, should look like the following:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Transmission Control Protocol, Src Port: italk (12345), Dst Port: 54321 (54321), Seq: 959575726, Ack: 1, Len: 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia, -webkit-fantasy;"&gt;Here's the bytes printed in an easier-to-read format.  Emphasis on the flags mine.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;02 00 00 00 45 00 00 2c    ca 84 40 00 40 06 00 00    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;7f 00 00 01 7f 00 00 03    30 39 d4 31 39 31 f6 ae    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;00 00 00 01 60 &lt;b&gt;&lt;i&gt;12&lt;/i&gt;&lt;/b&gt; ff ff    fe 22 00 00 &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-1588060990955320845?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/1588060990955320845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/full-stop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1588060990955320845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1588060990955320845'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/full-stop.html' title='Full-Stop'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-646762540998184624</id><published>2009-07-17T21:13:00.000-04:00</published><updated>2009-07-19T19:30:36.073-04:00</updated><title type='text'>Interesting Observation</title><content type='html'>&lt;p style="clear: both"&gt;In Python, None is so truly equivalent to *nothing* that help(None) spawns the interactive help.&lt;/p&gt;&lt;p style="clear: both"&gt;I thought that was interesting.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-646762540998184624?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/646762540998184624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/interesting-observation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/646762540998184624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/646762540998184624'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/interesting-observation.html' title='Interesting Observation'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7882386641619779087</id><published>2009-07-17T20:43:00.001-04:00</published><updated>2009-07-17T20:43:19.989-04:00</updated><title type='text'>Got Money, Got Paid</title><content type='html'>&lt;p style="clear: both"&gt;Finally!&lt;/p&gt;&lt;p style="clear: both"&gt;Anyway, I haven't mad a blog post in waaaaaaaaaaaaaay too long. Anyway, the bit that I'm working on now is to resolve the issue of sequence number wrap-around. The way that I'm implementing it will (hopefully) have the benefit of automating the calculation of SND.NXT and a buffer of octets that need to be retransmitted based off of the send/sent segments, and SND.UNA.&lt;/p&gt;&lt;p style="clear: both"&gt;Essentially, it's a continuous list with an offset. Less simple than it would originally appear due to the way slices work. Here's a quick example:&lt;/p&gt;&lt;p style="clear: both"&gt; Example:&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; from segmentBuffer import *&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb = segmentBuffer(base=10, max=15)&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb += range(8)&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb[10] # The first item is at [10]&lt;br /&gt; 0&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb[11] # The second item is at [11]&lt;br /&gt; 1&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb # However, the items are in the proper order&lt;br /&gt; [0, 1, 2, 3, 4, 5, 6, 7]&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb[10:] # And are properly sliced&lt;br /&gt; [0, 1, 2, 3, 4, 5, 6, 7]&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb[10:2] # And the slices wrap-around at max&lt;br /&gt; [0, 1, 2, 3, 4, 5, 6]&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb[2:10] # And slices stop when it hits a gap.&lt;br /&gt; [7]&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb == sb[10:] # Truth works just fine.&lt;br /&gt; True&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb += 2 # The offset is incremented easily&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb # Notice that the first two items are deleted&lt;br /&gt; [2, 3, 4, 5, 6, 7]&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; len(sb) # The length indeed goes down 8-&amp;gt;2&lt;br /&gt; 6&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb += range(100,200)&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; len(sb) # Adding 100 items keeps the correct length&lt;br /&gt; 15&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb # Only items up to the limit are added&lt;br /&gt; [2, 3, 4, 5, 6, 7, 100, 101, 102, 103, 104, 105, 106, 107, 108]&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb2 = sb + range(300,400)&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb is sb2 # Addition operator returns a new object.&lt;br /&gt; False&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb2 += 3 # The other object can be incremented&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; [i for i in sb if i not in sb2]&lt;br /&gt; [2, 3, 4] # Just an example to show the difference&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb[12:15] # This shows that the items were taken off the front&lt;br /&gt; [2, 3, 4]&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb[12:2]&lt;br /&gt; [2, 3, 4, 5, 6]&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb2[12:2] # The indexes for the remaining items do not change&lt;br /&gt; [5, 6] # Although the deleted items are gone.&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb&lt;br /&gt; [2, 3, 4, 5, 6, 7, 100, 101, 102, 103, 104, 105, 106, 107, 108]&lt;br /&gt; &amp;gt;&amp;gt;&amp;gt; sb2&lt;br /&gt; [5, 6, 7, 100, 101, 102, 103, 104, 105, 106, 107, 108]&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7882386641619779087?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7882386641619779087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/got-money-got-paid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7882386641619779087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7882386641619779087'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/got-money-got-paid.html' title='Got Money, Got Paid'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-6273168546395462557</id><published>2009-07-09T20:15:00.001-04:00</published><updated>2009-07-09T20:15:59.923-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='carbon'/><category scheme='http://www.blogger.com/atom/ns#' term='birthday'/><category scheme='http://www.blogger.com/atom/ns#' term='cocoa'/><title type='text'>Birthday and Eclipse Galileo</title><content type='html'>&lt;p style="clear: both"&gt;The birthday went pretty well (I'm still alive, after all) and I just grabbed Galileo and installed all of my tools (PyDev, CDT, Perforce) that I need on a regular basis. Excited to see that there's a Cocoa implementation of Eclipse now, and Galileo seems to start up a lot faster than Ganymeade (don't know if that's an effect of Cocoa-Carbon or general bloat reduction).&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-6273168546395462557?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/6273168546395462557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/birthday-and-eclipse-galileo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6273168546395462557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6273168546395462557'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/birthday-and-eclipse-galileo.html' title='Birthday and Eclipse Galileo'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3099220964799992674</id><published>2009-07-06T22:01:00.001-04:00</published><updated>2009-07-06T22:01:27.831-04:00</updated><title type='text'>WTF</title><content type='html'>&lt;div&gt;Evidently Ecto ate my last SEVERAL blog posts, by not actually posting anything.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style="clear: both"&gt;&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3099220964799992674?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3099220964799992674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/wtf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3099220964799992674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3099220964799992674'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/wtf.html' title='WTF'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5639466779557499641</id><published>2009-07-06T01:43:00.000-04:00</published><updated>2009-07-06T21:59:52.702-04:00</updated><title type='text'>Hmm</title><content type='html'>&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5639466779557499641?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5639466779557499641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/hmm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5639466779557499641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5639466779557499641'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/hmm.html' title='Hmm'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8318619647928394817</id><published>2009-07-06T01:07:00.000-04:00</published><updated>2009-07-06T01:08:06.561-04:00</updated><title type='text'>No, no, no</title><content type='html'>&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8318619647928394817?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8318619647928394817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/no-no-no.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8318619647928394817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8318619647928394817'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/no-no-no.html' title='No, no, no'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8767601287767314352</id><published>2009-07-05T23:33:00.000-04:00</published><updated>2009-07-06T00:33:00.498-04:00</updated><title type='text'>Okay, okay, okay</title><content type='html'>&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8767601287767314352?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8767601287767314352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/okay-okay-okay.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8767601287767314352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8767601287767314352'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/okay-okay-okay.html' title='Okay, okay, okay'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2092911367510094504</id><published>2009-07-05T22:26:00.003-04:00</published><updated>2009-07-05T22:27:55.790-04:00</updated><title type='text'>I Think I've Got It!</title><content type='html'>&lt;p&gt;I might have finally figured out the packet flow for the most flexibility and utility.&lt;/p&gt;&lt;ol&gt;&lt;br /&gt; &lt;li&gt;Packet arrives on interface&lt;/li&gt;  &lt;li&gt;Is queued by libpcap&lt;/li&gt;  &lt;li&gt;Thread grabs packet off of pcap queue&lt;/li&gt;  &lt;li&gt;IF the packet is NOT the packet we are expecting next (seg.sequence != rcv.nxt)&lt;ol&gt;      &lt;li&gt;Throw it into a list used by the thread.&lt;/li&gt;      &lt;li&gt;Go back up one level&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;  &lt;li&gt;ELSE the packet is one we were expecting&lt;ol&gt;      &lt;li&gt;Add the packet to the State Machine's recv() queue, IF there is not already a packet with the same sequence number&lt;/li&gt;      &lt;li&gt;IF processing is enabled&lt;ol&gt;          &lt;li&gt;Process the packet (i.e. "Segment Arrives" stuff)&lt;/li&gt;          &lt;li&gt;Advance the 'processed packet' index, which points to the last packet in the recv() queue that has been processed.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;      &lt;li&gt;Iterate over all packets in the thread's personal queue. This is done because we might have already received the 'next' packet, but it was received out-of-order.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Okay, so now the packets are being added to a queue, and they are in the correct order. They are also conditionally processed/handled/whatever you want to call it.&lt;/p&gt;&lt;p&gt;Now, we are writing a test. We want to stop when [1] A certain packet is received or [2] A specific state change occurs. This means that two methods need to be hooked into: the state-change method, and the packet-handling method. With the state change, we will want to pass control to the user (i.e. disable auto-processing) AFTER the state transition. With the packet-recv stuff, we want to do it BEFORE the packet is processed. This means that there needs to be a step between '5.1' and '5.2' that checks to see if the packet is flagged, and appropriately disables processing when the packet is encountered.&lt;/p&gt;&lt;p&gt;The test-writer then can call the 'recv()' method and be guaranteed to get the next packet, in the proper order. Additionally, the test-writer can set "break points" that disable auto-processing. This is important, because auto-processing can lead to sending out additional packets (i.e. response to a SYN-ACK, response to a FIN packet, etc.) that may need to be omitted for a test to be successful.&lt;/p&gt;&lt;p&gt;Whew.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2092911367510094504?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2092911367510094504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/i-think-i-got-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2092911367510094504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2092911367510094504'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/i-think-i-got-it.html' title='I Think I&amp;#39;ve Got It!'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2829743929748254111</id><published>2009-07-04T02:51:00.001-04:00</published><updated>2009-07-04T02:51:19.940-04:00</updated><title type='text'>Multiprocessing</title><content type='html'>Hmm. Multiprocessing may not be the way to go, as it runs into issues.&lt;br /&gt;&lt;div&gt;Might have to think about this some more.&lt;/div&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2829743929748254111?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2829743929748254111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/multiprocessing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2829743929748254111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2829743929748254111'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/multiprocessing.html' title='Multiprocessing'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3305179219623760322</id><published>2009-07-04T00:43:00.001-04:00</published><updated>2009-07-04T00:45:53.704-04:00</updated><title type='text'>Implementing TCP Stack Stuff</title><content type='html'>&lt;p style="clear: both"&gt;So I'm implementing more and more of the TCP stack. The idea is that if I actually &lt;strong&gt;implement&lt;/strong&gt; a TCP stack (which was expected, in small chunks) then I [1] understand how TCP should operate much better which allows me to [2] write tests much better and [3] identify corner-cases much better.&lt;/p&gt;&lt;p style="clear: both"&gt;One of the issues that I ran into tonight reaches back to my idea to run a separate process that's always "listening" for new packets, and does all of the "Segment Arrives" processing (see &lt;a href="http://tools.ietf.org/html/rfc793#page-65" target="_blank"&gt;pp65 in the RFC&lt;/a&gt;).&lt;/p&gt;&lt;p style="clear: both"&gt;In order to manipulate the TCP stack of some remote host, it is expected that it will be necessary to get one side of the connection into a specific state (e.g., get the remote state to be SYN-SENT, or the local state to be SYN-RECEIVED) and then perform specific operations that test very specific points of the specification.&lt;/p&gt;&lt;p style="clear: both"&gt;In order to do this efficiently, it becomes of the utmost importance to be able to get into these states very easily. Connection buildup and tear-down must be simple, as they are not important except for the individual tests that test these portions (and even then, we might want to skip right to receiving the SYN-ACK packet, before sending the ACK packet to enter the Established state).&lt;/p&gt;&lt;p style="clear: both"&gt;In order to perform these state transitions gracefully and properly, it becomes necessary to implement the entire TCP stack, and build in hooks that halt at certain points (on a state transition, specific packet sent or received, malformed packet, etc.).&lt;/p&gt;&lt;p style="clear: both"&gt;Now, it turns out that I still hadn't done enough planning to foresee the issue with packet ordering. The model that I thought would work would be to call a "recv()" method that would receive the next packet, and then the test would do something interesting with it. That becomes a problem when the test is expecting a specific field -- say, with a specific ACK number -- but receives that packet after receiving some other packet. The test might not properly realize that the first packet (which didn't match the expected pattern) was pertinent, and would be needed later in the test.&lt;/p&gt;&lt;p style="clear: both"&gt;This gives two options:&lt;/p&gt;&lt;ol style="clear: both"&gt;&lt;li&gt;The recv() method should only return the next packet (i.e. the segment's sequence number == rcv.nxt)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The recv() method simply fetches the next packet off of a queue, to which packets are added in-order by a separate thread/process that manages the state.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style="clear: both"&gt;Both of these approaches have their limitations. Consider a test in which we want to send a malformed ACK packet in response to a SYN-ACK packet. The code for that might look something like this:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt; &lt;pre style="clear: both"&gt;tsm = TcpStateMachine()&lt;br /&gt;i = tsm.packetsRecvd.size()&lt;br /&gt;syn = tsm.newPacket({'syn':1})&lt;br /&gt;tsm.sendRawTcp(syn)&lt;br /&gt;startTime = time.time()&lt;br /&gt;# Keep looping. Note that this loop would be rolled into a seperate method.&lt;br /&gt;while True:&lt;br /&gt;  # 30 second timeout. Test fails.&lt;br /&gt;  if time.time() &amp;lt; startTime + 30:&lt;br /&gt;    return False&lt;br /&gt;  # If no new packets we received, sleep&lt;br /&gt;  if tsm.packetsRecvd.size() &amp;lt;= i:&lt;br /&gt;    time.sleep(0.1)&lt;br /&gt;&lt;br /&gt;  # Loop through available packets.&lt;br /&gt;  for i in range(i, tsm.packetsRecvd.size()):&lt;br /&gt;    p = tsm.packetsRecvd[i]&lt;br /&gt;    # See if it's a SYN-ACK and the ack number matches.&lt;br /&gt;    if p.ack and p.syn and p.ack_number == syn.sequence + 1:&lt;br /&gt;      break&lt;br /&gt;  # Do stuff with packet at offset 'i'.&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;The code would send a SYN packet, with the other fields auto-filled, then wait until some packet is received, then do processing based on that.&lt;/p&gt;&lt;p style="clear: both"&gt;Actually, after writing that, performing some method of callback on a state transition could lead to un-necessary complications. What might be more useful is a way to turn off auto-processing (not receipt of, just processing of) packets upon some trigger (i.e. after transitioning to state 'FIN-WAIT-1', don't do anything with the packets), and a way to see if that trigger has been hit (although checking to see if the state is FIN-WAIT-1 should be sufficient).&lt;/p&gt;&lt;p style="clear: both"&gt;Hmm.&lt;/p&gt;&lt;p style="clear: both"&gt;Working all of this out in writing might have cleared things up a bit.&lt;/p&gt;&lt;p style="clear: both"&gt;Thanks!&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3305179219623760322?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3305179219623760322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/implementing-tcp-stack-stuff.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3305179219623760322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3305179219623760322'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/implementing-tcp-stack-stuff.html' title='Implementing TCP Stack Stuff'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5261951185236197610</id><published>2009-07-02T21:51:00.001-04:00</published><updated>2009-07-02T21:51:41.278-04:00</updated><title type='text'>Time Off Did The Trick</title><content type='html'>&lt;p style="clear: both"&gt;Looks like a little time-off did the trick. Got back into the problem that I was working on last (fighting with the operating system, and the various interfaces). Looks like using 127.0.0.X where X is not '1' works to elicit the correct SYN/ACK response, on the correct interface (lo0), and the host OS doesn't try to fight me about it.&lt;/p&gt;&lt;p style="clear: both"&gt;Now all I've gotta do is get the test working :-)&lt;/p&gt;&lt;p style="clear: both"&gt;Hopefully, things will be smooth sailing from here on forward!&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5261951185236197610?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5261951185236197610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/time-off-did-trick.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5261951185236197610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5261951185236197610'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/time-off-did-trick.html' title='Time Off Did The Trick'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2442289744794396015</id><published>2009-07-02T19:26:00.001-04:00</published><updated>2009-07-02T19:26:58.956-04:00</updated><title type='text'>Soy Libre!</title><content type='html'>&lt;p style="clear: both"&gt;Just finished up the last of my exams. About friggin' time. I feel pretty confident about all of them -- and I've been doing better this semester than a usually do.&lt;/p&gt;&lt;p style="clear: both"&gt;Schedule for the rest of the evening is GSoC, same for tomorrow. Saturday I've got a BBQ for the 4th. GSoC starts accepting status reports on the 6th, they're due on the 13th (which means I have to submit it to Google/GNN, and they/he has to approve it by then).&lt;/p&gt;&lt;p style="clear: both"&gt;Should be an interesting weekend.&lt;/p&gt;&lt;p style="clear: both"&gt;I turn 21 next Wednesday (the 8th) so count on nothing getting done on the 8th/9th (Maybe on the 9th, I took the day off from work).&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2442289744794396015?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2442289744794396015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/soy-libre.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2442289744794396015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2442289744794396015'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/07/soy-libre.html' title='Soy Libre!'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-9206856552750056703</id><published>2009-06-28T21:30:00.001-04:00</published><updated>2009-06-28T21:30:00.338-04:00</updated><title type='text'>Also</title><content type='html'>&lt;p style="clear: both"&gt;Enabling "stealth mode" (which should kill all responses to an unsolicited [from the OS's point of view] SYN/ACK packets) does not prevent the OS from responding on lo0. Evidently stealth mode is not active on the loopback interface.&lt;/p&gt;&lt;p style="clear: both"&gt;Grrrrrrr.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-9206856552750056703?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/9206856552750056703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/also.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/9206856552750056703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/9206856552750056703'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/also.html' title='Also'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-4001255296381754453</id><published>2009-06-28T21:01:00.001-04:00</published><updated>2009-06-28T21:01:43.362-04:00</updated><title type='text'>Power is back on, But network problems continue</title><content type='html'>&lt;p style="clear: both"&gt;Power's back on, woooooooooo.&lt;/p&gt;&lt;p style="clear: both"&gt;Okay, so I have two problems:&lt;br /&gt;[1] If I attempt to 'send' packets 'from' an IP address that my computer actually has, the host OS's TCP stack sends a RST packet when it sees a SYN/ACK response to my 'sent' SYN packet.&lt;br /&gt;[2] If I attempt to 'send' packets 'from' a different IP address, the packets get bounced back and forth several times between my computer and the router. For whatever reason, the listening server ('nc -l &amp;lt;port&amp;gt;') doesn't respond at all.&lt;/p&gt;&lt;p style="clear: both"&gt;Yay.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-4001255296381754453?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/4001255296381754453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/power-is-back-on-but-network-problems.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4001255296381754453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4001255296381754453'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/power-is-back-on-but-network-problems.html' title='Power is back on, But network problems continue'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2889811428358095473</id><published>2009-06-28T17:12:00.000-04:00</published><updated>2009-06-28T17:14:07.824-04:00</updated><title type='text'></title><content type='html'>Power is out.  Posting this from my iPhone.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2889811428358095473?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2889811428358095473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/power-is-out.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2889811428358095473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2889811428358095473'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/power-is-out.html' title=''/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-693904158089404688</id><published>2009-06-28T14:24:00.001-04:00</published><updated>2009-06-28T14:24:16.934-04:00</updated><title type='text'>Fighting with the host OS</title><content type='html'>&lt;p style="clear: both"&gt;After finding out that Wireshark is stupid, and considers 0x2000 to be the same as 0x0002 for Loopback-layer family fields, I am now battling with the host OS. Sending a connection request properly elicits a SYN/ACK response, but the OS is quickly sending out a RST packet to kill the connection.&lt;/p&gt;&lt;p style="clear: both"&gt;Changing the source IP to be something other than an IP the operating system should care about results in no SYN/ACK packet. I tried moving back over to a non-loopback interface, with a different source IP address (using the correct destination IP address). It gets sent back from the router (the packet is duplicated with the source MAC being the router MAC), but it does not elicit a SYN/ACK response.&lt;/p&gt;&lt;p style="clear: both"&gt;Wierd. And frustrating.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-693904158089404688?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/693904158089404688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/fighting-with-host-os.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/693904158089404688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/693904158089404688'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/fighting-with-host-os.html' title='Fighting with the host OS'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-6732520556478764727</id><published>2009-06-28T00:32:00.001-04:00</published><updated>2009-06-28T00:32:46.803-04:00</updated><title type='text'>Ah.</title><content type='html'>&lt;p style="clear: both"&gt;So, evidently even if you have a host that is listening on 0.0.0.0:12345 (e.g. "nc -l 12345") and inject packets onto an active interface, pointed at that interface's IP address (e.g. "en1" has IP 172.16.0.10) -- any normally-generated packets to/from a local IP address go over "lo0".&lt;/p&gt;&lt;p style="clear: both"&gt;That would have been good to know, what, a few hours ago? &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-6732520556478764727?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/6732520556478764727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/ah.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6732520556478764727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6732520556478764727'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/ah.html' title='Ah.'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8598430574668383446</id><published>2009-06-27T22:23:00.001-04:00</published><updated>2009-06-27T22:23:02.134-04:00</updated><title type='text'>Troubleshooting</title><content type='html'>&lt;p style="clear: both"&gt;Lots of troubleshooting the code right now, trying to get the 3-way connect to work. Lots of issues with typos, unfortunately. A lot of it had to do with using (for example) "off" in place of "offset" to access the offset of a TCP packet, because of the way it's declared:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;off = pcs.Field( "offset", 4 )&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;My eyes just saw the first part, and ignored the second half when I started writing code. Thought I went back and fixed all of the fields, evidently not!&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8598430574668383446?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8598430574668383446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/troubleshooting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8598430574668383446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8598430574668383446'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/troubleshooting.html' title='Troubleshooting'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5497491034258347577</id><published>2009-06-26T00:04:00.001-04:00</published><updated>2009-06-26T00:04:35.222-04:00</updated><title type='text'>P4 Is Getting Kind of Annoying</title><content type='html'>&lt;p style="clear: both"&gt;I don't know if it's P4 itself, or P4 integration with Eclipse, but a versioning system should &lt;strong&gt;never&lt;/strong&gt; prevent editing local files because a connection attempt failed, or because the host-name of the machine changed.&lt;/p&gt;&lt;p style="clear: both"&gt;That is all.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5497491034258347577?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5497491034258347577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/p4-is-getting-kind-of-annoying.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5497491034258347577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5497491034258347577'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/p4-is-getting-kind-of-annoying.html' title='P4 Is Getting Kind of Annoying'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3436921136218776284</id><published>2009-06-20T21:12:00.001-04:00</published><updated>2009-06-20T21:12:47.911-04:00</updated><title type='text'>Checksumming No Se Funciona</title><content type='html'>&lt;p style="clear: both"&gt;Alright, so the last part of the puzzle that needs to fall in place is the checksum. Conveniently, the algorithm for checksumming IP and TCP packets is the same (albeit you feed them different sets of information).&lt;/p&gt;&lt;p style="clear: both"&gt;The algorithm works somewhat like so (source IBM):&lt;/p&gt;&lt;pre style="clear: both"&gt;ushort checksum16(uchar* data, int len)&lt;br /&gt;{&lt;br /&gt;    uint sum = 0;&lt;br /&gt;    if ((len &amp;amp; 1) == 0)&lt;br /&gt;        len = len &amp;gt;&amp;gt; 1;&lt;br /&gt;    else&lt;br /&gt;        len = (len &amp;gt;&amp;gt; 1) + 1;&lt;br /&gt;    while (len &amp;gt; 0) {&lt;br /&gt;        sum += *((ushort*)data);&lt;br /&gt;        data += sizeof(ushort);&lt;br /&gt;        len--;&lt;br /&gt;    }&lt;br /&gt;    sum = (sum &amp;gt;&amp;gt; 16) + (sum &amp;amp; 0xffff);&lt;br /&gt;    sum += (sum &amp;gt;&amp;gt; 16);&lt;br /&gt;    return htons(~sum);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p style="clear: both"&gt;That is, it sums all of the 16-bit words, does some 1's compliment fanciness, and then returns the 16 least significant bits (inverted). Of course, the operation can be done with any arbitrary multiple of 16 bits. Since most machines nowadays use 32- or 64-bit arithmetic, there's no reason not to do it with 32 bits (or 64). However, the final result is always 16 bits wide.&lt;/p&gt;&lt;p style="clear: both"&gt;In Python, the code looks like (or so I think) the following:&lt;/p&gt;&lt;pre style="clear: both"&gt;def checksum( bytes ):&lt;br /&gt;    tmpbytes = bytes&lt;br /&gt;    total = 0&lt;br /&gt;    # Must be a number of bytes equal to a multiple of two.&lt;br /&gt;    if len( tmpbytes ) % 2 == 1:&lt;br /&gt;        tmpbytes += "\0"&lt;br /&gt;    # For each pair, add the value to the total.&lt;br /&gt;    for i in range( len( tmpbytes ) / 2 ):&lt;br /&gt;        total += ( unpack( "!H", tmpbytes[( 2 * i ):( 2 * i ) + 2] )[0] )&lt;br /&gt;    # Keep shifting&lt;br /&gt;    while total &amp;gt;&amp;gt; 16:&lt;br /&gt;        total = ( total &amp;gt;&amp;gt; 16 ) + ( total &amp;amp; 0xffff )&lt;br /&gt;    # One's complement&lt;br /&gt;    total = ~total&lt;br /&gt;    # Make into 2 bytes&lt;br /&gt;    total = total &amp;amp; 0xffff&lt;br /&gt;    # Return value&lt;br /&gt;    return total&lt;br /&gt;&lt;/pre&gt;&lt;p style="clear: both"&gt;However, given an IP layer: 0x4500004096da40004006&lt;strong&gt;eca1&lt;/strong&gt;c0a80168d04524e6, the checksum is 0xECA1. When calculating the checksum, the checksum field is set to zero (0x0000). So, the checksum is calculated like so:&lt;/p&gt;&lt;pre style="clear: both"&gt;&amp;gt;&amp;gt;&amp;gt; from binascii import *&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; from struct import *&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; data = unhexlify('4500004096da40004006&amp;lt;b&gt;0000&amp;lt;/b&gt;c0a80168d04524e6')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; data&lt;br /&gt;'E\x00\x00@\x96\xda@\x00@\x06\x00\x00\xc0\xa8\x01h\xd0E$\xe6'&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; cksum = checksum(data)&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; cksum&lt;br /&gt;60577&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; hex(cksum)&lt;br /&gt;'0xeca1'&lt;br /&gt;&lt;/pre&gt;&lt;p style="clear: both"&gt;Obviously, the end result is &lt;s&gt;in&lt;/s&gt;correct. Turns out that the values that I was using for testing were incorrect. I've since fixed them in the blog post and the offending code.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3436921136218776284?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3436921136218776284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/checksumming-no-se-funciona.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3436921136218776284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3436921136218776284'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/checksumming-no-se-funciona.html' title='Checksumming No Se Funciona'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2166791974384459772</id><published>2009-06-19T08:31:00.001-04:00</published><updated>2009-06-19T22:55:34.890-04:00</updated><title type='text'>Glad I got up early</title><content type='html'>&lt;p style="clear: both"&gt;So I got up early before class today to work on the problem. I don't know what the issue was, I think it was a matter of incorrectly setting the TCP offset that made Wireshark freak out.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;Another PCS Architecture Rant&lt;br /&gt;&lt;/strong&gt;This time, I'm a bit curious about the design of the pcs.Chain class. It inherits from the 'list' base type, but instead of using itself to store the data, it actually *contains* a seperate list. Example:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt; &lt;pre style="clear: both"&gt;&amp;gt;&amp;gt;&amp;gt; isinstance(myChain,list)&lt;br /&gt;True&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; myChain&lt;br /&gt;[]&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; myChain.packets&lt;br /&gt;[&amp;lt;ethernet: src:="" \x00\x1bc\x06\x82\xb2',="" dst:="" \x00!)\xa5\xa9?',="" type:="" 2048=""&amp;gt;, &amp;lt;ipv4: hlen:="" 5,="" protocol:="" 6,="" src:="" 2886729738l,="" tos:="" 0,="" dst:="" 3494107623l,="" ttl:="" 64,="" length:="" 44,="" version:="" 4,="" flags:="" offset:="" checksum:="" id:="" 56649=""&amp;gt;, &amp;lt;tcp: reset:="" 0,="" reserved:="" sequence:="" 3915041816l,="" ack:="" checksum:="" 60177,="" offset:="" 5,="" syn:="" 1,="" urgent:="" window:="" 65535,="" push:="" ack_number:="" 0l,="" dport:="" 80,="" sport:="" 52722,="" fin:="" urg_pointer:="" 0=""&amp;gt;, &amp;lt;payload:&amp;gt;]&lt;br /&gt;&amp;lt;/payload:&amp;gt;&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;Not sure what's going on with that. Its constructor only takes a list object:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;class  Chain(list):&lt;br /&gt;     def  __init__(self, packets = None ):&lt;br /&gt;         list.__init__(self) &lt;br /&gt;         self.packets = packets &lt;br /&gt;         self.encode() &lt;br /&gt;# Versus&lt;br /&gt;class  Chain(list):&lt;br /&gt;     def  __init__(self, packets = None ):&lt;br /&gt;         list.__init__(self, packets)&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;This would end up saving a lot of time and make the resulting code look cleaner:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;That would make it easier to perform nifty operations. pcs.Chain offers a "checksum" operation, that operates on the whole chain. However, consider the utility of "myChain[-2:].calc_checksum()". Now we can checksum an arbitrary range of packets! Not immediately useful, unless you realize that this is a nifty way to calculate the IP checksum ;-).&lt;/p&gt;&lt;p style="clear: both"&gt;Also, I have to wonder about the duplication of functionality offered by the pcs.Chain class, and the pcs.Packet.data member. It seems that, for the large part, they perform the exact same function. Consider:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;&amp;gt;&amp;gt;&amp;gt; p = payload()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t = tcp()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; i = ipv4()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; e = ethernet()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; e.data = i&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; i.data = t&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.data = p&lt;br /&gt;# Finally, these two should have the same ultimate result&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; e.chain()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; chain([e,i,t,p])&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;I can see the reasoning behind the "data" member -- it makes it easy to set-and-forget what the next level is, and the "chain()" method is a nice helper that builds a chain. Consider the earlier example of &lt;em&gt;myChain[-2:].calc_checksum() &lt;/em&gt;currently looks like: &lt;em&gt;myChain.packets[-2].chain().calc_checksum()&lt;/em&gt;.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2166791974384459772?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2166791974384459772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/glad-i-got-up-early.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2166791974384459772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2166791974384459772'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/glad-i-got-up-early.html' title='Glad I got up early'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3328656237080718795</id><published>2009-06-18T08:01:00.001-04:00</published><updated>2009-06-18T08:01:08.901-04:00</updated><title type='text'>Malformed Packet Bull@$!#</title><content type='html'>&lt;p style="clear: both"&gt;Getting pretty sick and tired of Wireshark being useless in telling me exactly why my TCP packets are malformed.&lt;br /&gt;Just sayin'.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3328656237080718795?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3328656237080718795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/malformed-packet-bull.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3328656237080718795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3328656237080718795'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/malformed-packet-bull.html' title='Malformed Packet Bull@$!#'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5818323810550276875</id><published>2009-06-13T22:48:00.001-04:00</published><updated>2009-06-13T22:48:37.533-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='macosx'/><title type='text'>Unrelated Note</title><content type='html'>&lt;p style="clear: both"&gt;On an unrelated note, FreeBSD handles pthread_mutex's shared status properly. Mac OS X does not.&lt;/p&gt;&lt;p style="clear: both"&gt;Debugging code that relies on this on Mac OSX may cause hair loss.&lt;/p&gt;&lt;p style="clear: both"&gt;(This was from my first CSE410 project, thought I'd post it here while I was posting things).&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5818323810550276875?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5818323810550276875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/unrelated-note.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5818323810550276875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5818323810550276875'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/unrelated-note.html' title='Unrelated Note'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8529609767489595335</id><published>2009-06-13T22:09:00.001-04:00</published><updated>2009-06-13T22:09:03.621-04:00</updated><title type='text'>Bailed on previous idea</title><content type='html'>&lt;p style="clear: both"&gt;Also of note, I bailed on the idea from last night (and before) of using raw IP sockets to do the sending. The idea was to avoid needing to ever touch the physical or IP layer, thus removing some amount of work (e.g., no setting of the IP length fields, IP checksum calculation).&lt;/p&gt;&lt;p style="clear: both"&gt;However, using raw sockets has the caveat of not providing a receive buffer. If using raw IP sockets, one cannot override the 'protocol' field to be IPPROTO_TCP. Haven't put much more thought into using raw TCP sockets.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;Short Rant on pcs.Field&lt;/strong&gt;&lt;br /&gt;The class pcs.Field is used as a base class to represent any field inside of a packet. It provides bit-width flexibility, and the ability to encode/decode values of arbitrary bit-width. This is very useful when defining the various fields of a packet, as you can specify their exact size, and then with the pcs.Layout class, specify their exact order.&lt;/p&gt;&lt;p style="clear: both"&gt;However, in order to string these two things together, you get somewhat of a kluge. Consider the following code in tcp.py:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;     def  __init__(self, bytes = None ):&lt;br /&gt;          """initialize a TCP packet""" &lt;br /&gt;         sport = pcs.Field("sport" , 16 ) &lt;br /&gt;         dport = pcs.Field("dport" , 16 ) &lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;And then the corresponding code to manipulate those fields...&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;&amp;gt;&amp;gt;&amp;gt; from pcs.packets.tcp import tcp&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t = tcp()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; type(t.offset)&lt;br /&gt;&amp;lt;type 'int'&amp;gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; type(t.sport)&lt;br /&gt;&amp;lt;type 'int'&amp;gt; &lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;Okay, great. In the __init__ method, they were working on local variables with the same name as the variables to be used. The pcs.Field objects are supplied with a name to correspond to the object property (e.g. the pcs.Field object with (... name="sport",...) corresponds to the actual field "pcs.Field.sport". Great.&lt;/p&gt;&lt;p style="clear: both"&gt;However, the approach falls short here. pcs.Field provides no way of setting the bit-&lt;strong&gt;order&lt;/strong&gt; of whatever field it is manipulating, so users are stuck doing this:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;t.sport = socket.htons(80)&lt;br /&gt;# Instead of&lt;br /&gt;t.sport = 80&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;And having the "magic" just happen. This prevents simple comparisons, as well. Which of the following is easier to read?&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;if ntohs(t.sport) == 80: ...&lt;br /&gt;if t.sport == htons(80): ...&lt;br /&gt;if t.sport == 20480: ...&lt;br /&gt;if t.sport == 80: ...&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;This is less trivially simple for fields that may have more than one representation. This was discussed in a previous post (IIRC) with relation to IP and Hardware addresses. Consider the following. The IP address "127.0.0.1" can be represented as:&lt;/p&gt;&lt;ul style="clear: both"&gt;&lt;li&gt;16777343 (host-byte-order) &lt;br /&gt;&lt;/li&gt;&lt;li&gt;2130706433 (network-byte-order)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;'\x01\x00\x00\x7f' (host-byte-order byte-string)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;'\x7f\x00\x00\x01' (network-byte-order byte-string)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;And of course, "127.0.0.1"&lt;/li&gt;&lt;/ul&gt;&lt;p style="clear: both"&gt;Obviously, this makes things a bit difficult to work with. However, the current method does not just use network-byte order. An IP address is a NBO long. A port is a NBO short. An ethernet address is a NBO byte-string. Figuring out what the proper internal representation for everything is a pain, and translating between HBO and NBO makes it worse.&lt;/p&gt;&lt;p style="clear: both"&gt;The simple solution is to allow multiple ways of getting and setting a field. Example using ports (also works with IP addresses, ethernet addresses):&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;&amp;gt;&amp;gt;&amp;gt; t.sport.setAscii('80')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.sport.setInteger(80)&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.sport.setNetworkInteger(20480)&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.sport.setBytes('P\x00\x00\x00')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.sport.setNetworkBytes('\x00\x00\x00P')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.sport == 80&lt;br /&gt;True&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.sport.getInteger() == 80&lt;br /&gt;True&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.sport == '80'&lt;br /&gt;True&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.sport == 'P\x00\x00\x00'&lt;br /&gt;True&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.sport == '\x00\x00\x00P'&lt;br /&gt;False&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.sport.getNetworkBytes() == '\x00\x00\x00P'&lt;br /&gt;True&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;This allows us all the flexibility in the world that is needed. Assuming that all of the different types support the base functions (get/set for ASCII, Integer, and Bytes in both host- and network-byte order), everything is quickly extendible.&lt;/p&gt;&lt;p style="clear: both"&gt;Visiting the original code, things have improved slightly. No longer do we need to worry about bit-ordering.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;# Old&lt;br /&gt;t.sport = htons(80)&lt;br /&gt;t.sport = htons(str('80'))&lt;br /&gt;t.sport = struct.unpack('!L','\x00\x00\x00P')&lt;br /&gt;# New&lt;br /&gt;t.sport.setInteger(80)&lt;br /&gt;t.sport.setAscii('80')&lt;br /&gt;t.sport.setNetworkBytes('\x00\x00\x00P')&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;Alright, now we face the problem of making the encoding 'cleaner'. Encoding things is extremely simple if everything is aligned on an 8-bit byte boundary. One could simply use "t.sport.getNetworkBytes() + t.dport.getNetworkBytes()" ad infinitum. However, that approach is ugly. Overriding __add__() with some gentle application of isinstance() and you can get the bytes pretty easily (even without 8-bit byte boundaries).&lt;/p&gt;&lt;p style="clear: both"&gt;Will do some work tonight on this front. Will make for a very worthwhile patch to PCS.&lt;/p&gt;&lt;p style="clear: both"&gt;[/rant]&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8529609767489595335?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8529609767489595335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/bailed-on-previous-idea.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8529609767489595335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8529609767489595335'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/bailed-on-previous-idea.html' title='Bailed on previous idea'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-6324663276484146088</id><published>2009-06-13T17:46:00.001-04:00</published><updated>2009-06-13T17:46:25.602-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='redbull'/><category scheme='http://www.blogger.com/atom/ns#' term='gsoc'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>If Red Bull would just...</title><content type='html'>...sponsor Google Summer of Code, it would make my life much easier (and less expensive).&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-6324663276484146088?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/6324663276484146088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/if-red-bull-would-just.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6324663276484146088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6324663276484146088'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/if-red-bull-would-just.html' title='If Red Bull would just...'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-4064333837598612401</id><published>2009-06-13T04:17:00.001-04:00</published><updated>2009-06-13T04:17:02.002-04:00</updated><title type='text'>Works pretty well</title><content type='html'>&lt;p style="clear: both"&gt;After moving everything to Python 2.6 (read: re-installing Pyrex, PyLint, PyLibPcap, and PCS), the packet-queueing process was extremely easy to do. Much easier than I thought it would be. Here's an example of it in action (note that the TCP data that is interpreted by PCS is whatever the equivalent of the ASCII data is).&lt;/p&gt;&lt;p style="clear: both"&gt;Note that the output gets a little bit wacky as both processes fight for StdOut.&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;Python 2.6.2 (r262:71600, May  2 2009, 17:25:25)&lt;br /&gt;[GCC 4.0.1 (Apple Inc. build 5490)] on darwin&lt;br /&gt;Type "help", "copyright", "credits" or "license" for more information.&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; from packetQueue import *&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; ipl = IpListener("127.0.0.1")&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; ipl.process.start()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; from socket import *&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; host = gethostbyname(gethostname())&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; port = 0&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; text = "Hello"&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; def send(data=text):&lt;br /&gt;...   sender = socket(AF_INET,SOCK_RAW,IPPROTO_IP)&lt;br /&gt;...   sender.sendto(data, (host,port))&lt;br /&gt;... &lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; send()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; send(Hello&lt;br /&gt;'This is a test')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; ipl.recvQueue.get()&lt;br /&gt;This is a test&lt;br /&gt;&amp;lt;TCP: reset: 0, reserved: 0, dport: 27756, sequence: 1862270976, ack: 0, checksum: 0, ack_number: 0, syn: 0, urgent: 0, window: 0, offset: 0, push: 0, sport: 18533, fin: 0, urg_pointer: 0&amp;gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; ipl.recvQueue.get()&lt;br /&gt;&amp;lt;TCP: reset: 29, reserved: 13, dport: 26995, sequence: 543781664, ack: 7, checksum: 0, ack_number: 1629516901, syn: 58, urgent: 3, window: 0, offset: 7, push: 14, sport: 21608, fin: 0, urg_pointer: 0&amp;gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; ipl.process.terminate()&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-4064333837598612401?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/4064333837598612401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/works-pretty-well.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4064333837598612401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/4064333837598612401'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/works-pretty-well.html' title='Works pretty well'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7902715226157025632</id><published>2009-06-13T01:21:00.001-04:00</published><updated>2009-06-13T01:21:39.374-04:00</updated><title type='text'>First Round Done</title><content type='html'>&lt;p style="clear: both"&gt;Not really a project update, but a worthwhile note: the first round of exams are done at MSU, and I have already completed my second-semester project for my CSE course. There's a paper due on the 25th, and the homework for all of the next week is already done. Should be able to put in some extra time this weekend and the upcoming week. Right now is about 3 weeks from the end of the semester, then my it's hyperspeed.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7902715226157025632?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7902715226157025632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/first-round-done.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7902715226157025632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7902715226157025632'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/first-round-done.html' title='First Round Done'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3701327021859300744</id><published>2009-06-11T02:20:00.001-04:00</published><updated>2009-06-11T02:20:49.368-04:00</updated><title type='text'>Although...</title><content type='html'>&lt;p style="clear: both"&gt;Although there IS the catch that if we do not call recv() before the response TCP packet arrives, it will be lost forever (since we are using raw sockets). The easy solution to this is to have a thread that does all of the buffering, as I imagine happens in a real TCP stack. Might have to look into the 'multiprocessing' module. It seems like passing pcs.packets.tcp.tcp objects via a multiprocessing.queue would be the way to go about doing things.&lt;/p&gt;&lt;p style="clear: both"&gt;Actually, after reading a bit about the multiprocessing module, this may end up being a non-issue. Just a have a reader thread that reads all of the raw IP data, checks to see if it is the right stuff (i.e. the IP addresses are what were expected, the TCP ports are the expected ports) and then passes it along to the queue. Behind-the-scenes, a call to recv() will just fetch the next item off the queue.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3701327021859300744?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3701327021859300744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/although.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3701327021859300744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3701327021859300744'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/although.html' title='Although...'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-5037109989799976151</id><published>2009-06-11T02:13:00.001-04:00</published><updated>2009-06-11T02:13:43.579-04:00</updated><title type='text'>Working with Raw IP</title><content type='html'>&lt;p style="clear: both"&gt;I figure that messing with IP stuff at any point in time is a Bad Idea (TM), so doing anything at all with the pcs IP or Ethernet layer shouldn't be done. Ideally, I should be able to point an IP packet (filled with TCP data and payload) at some IP address, and everything will get sorted out.&lt;/p&gt;&lt;p style="clear: both"&gt;I figure it'll work something like the code below (need root, open two Terminals, call recv() before send()). Not sure that much more robustness is needed...&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;from socket import *&lt;br /&gt;host = gethostbyname(gethostname())&lt;br /&gt;port = 0&lt;br /&gt;text = "Hello"&lt;br /&gt;def send():&lt;br /&gt; sender = socket(AF_INET,SOCK_RAW,IPPROTO_IP)&lt;br /&gt; sender.sendto(text, (host,port))&lt;br /&gt;def recv():&lt;br /&gt; recver = socket(AF_INET,SOCK_RAW,IPPROTO_IP)&lt;br /&gt; data = recver.recv(1024)&lt;br /&gt; print data[20:]&lt;/p&gt;&lt;/blockquote&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-5037109989799976151?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/5037109989799976151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/working-with-raw-ip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5037109989799976151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/5037109989799976151'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/working-with-raw-ip.html' title='Working with Raw IP'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7285962606529419864</id><published>2009-06-07T17:06:00.001-04:00</published><updated>2009-06-07T17:06:08.230-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='pydev'/><category scheme='http://www.blogger.com/atom/ns#' term='pylint'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Sexy</title><content type='html'>&lt;p style="clear: both"&gt;Is what &lt;a href="http://www.logilab.org/project/pylint" title="pylint website" target="_blank"&gt;pylint&lt;/a&gt; is.&lt;br /&gt;&lt;a href="http://pydev.sourceforge.net/pylint.html" target="_blank"&gt;Integration with PyDev&lt;/a&gt; (Eclipse) makes it even better.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7285962606529419864?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7285962606529419864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/sexy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7285962606529419864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7285962606529419864'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/sexy.html' title='Sexy'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7591675306129595971</id><published>2009-06-04T21:44:00.001-04:00</published><updated>2009-06-04T21:44:33.761-04:00</updated><title type='text'>Hi, George</title><content type='html'>&lt;p style="clear: both"&gt;George&lt;/p&gt;&lt;p style="clear: both"&gt;Looks like there's been an issue again...&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;THIS IS A WARNING MESSAGE ONLY.&lt;br /&gt;&lt;br /&gt;YOU DO NOT NEED TO RESEND YOUR MESSAGE.&lt;br /&gt;&lt;br /&gt;Delivery to the following recipient has been delayed:&lt;br /&gt;&lt;br /&gt;  &lt;a href="mailto:gnn@neville-neil.com"&gt;YOU@neville-neil.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Message will be retried for 2 more day(s)&lt;br /&gt;...&lt;br /&gt;For help, please quote incident ID 13500304. (state 18).&lt;/p&gt;&lt;/blockquote&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7591675306129595971?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7591675306129595971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/hi-george.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7591675306129595971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7591675306129595971'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/06/hi-george.html' title='Hi, George'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2949934801657896959</id><published>2009-05-31T05:50:00.003-04:00</published><updated>2009-05-31T19:39:14.237-04:00</updated><title type='text'>Logic Validation</title><content type='html'>&lt;p style="clear: both"&gt;Looking for some input on folks familiar with low-level TCP. I've got some general questions about proper values of Sequence # and Ack # over the course of a TCP session.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;ACKing Packets&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;A segment on the retransmission queue is fully acknowledged if the sum of its sequence number and length is less or equal than the acknowledgment value in the incoming segment. &lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;A packet is received with sequence number "seqn" and TCP payload with "len" octets of data. The receiving party should compare "seqn" to the variable outlined in the RFC, "rcv.nxt". If they match, "rcv.next" is incremented by "len".&lt;/p&gt;&lt;p style="clear: both"&gt;The ACK number of outgoing packets is always sent to 'rcv.next'-1.&lt;/p&gt;&lt;p style="clear: both"&gt;What is done with packets received out-of-order, but that are entirely valid? Buffer them, then check each one's SEQ number when rcv.nxt is incremented?&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;Delayed ACK response&lt;/strong&gt;&lt;br /&gt;This also raises the question of how to properly ACK a received message, when packets aren't already being set. In some instances, it may be necessary to send an empty packet with the ACK flag set. How to determine when this needs to be done?&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2949934801657896959?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2949934801657896959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/logic-validation_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2949934801657896959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2949934801657896959'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/logic-validation_31.html' title='Logic Validation'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-562200400512691987</id><published>2009-05-31T05:50:00.001-04:00</published><updated>2009-05-31T05:50:15.181-04:00</updated><title type='text'>IP and Port Representation</title><content type='html'>&lt;p style="clear: both"&gt;Small hurdle that I tried to tackle tonight is the representation of IP addresses and ports. There are at least 4 representations of each that will need to be dealt with regularly:&lt;/p&gt;&lt;p style="clear: both"&gt;- ASCII (e.g. "127.0.0.1", "80")&lt;br /&gt;- Host-byte-order integer, useful for ports (16777343, 80)&lt;br /&gt;- Network-byte-order integer, used in raw packets (2130706433, 20480)&lt;br /&gt;- Network-byte-order byte-string, used by "inet_aton" and the like. ('\x7f\x00\x00\x01', '\x00\x00\x00P')&lt;/p&gt;&lt;p style="clear: both"&gt;So, the IP address and Port were encapsulated in classes. This &lt;strong&gt;should&lt;/strong&gt; make dealing with them slightly easier.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-562200400512691987?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/562200400512691987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/ip-and-port-representation.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/562200400512691987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/562200400512691987'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/ip-and-port-representation.html' title='IP and Port Representation'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7400322576796417924</id><published>2009-05-31T02:41:00.001-04:00</published><updated>2009-05-31T02:41:41.352-04:00</updated><title type='text'>Oh.</title><content type='html'>&lt;p style="clear: both"&gt;I was having some issues earlier wrapping my mind around why, exactly, packing strings didn't give me a string with the "\x##\x##\x##" format. Evidently, that is only necessary for characters that do not have a normal, printable equivalent.&lt;/p&gt;&lt;p style="clear: both"&gt;Example:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; "\x7D" + "\x7B"&lt;br /&gt;'}{'&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;Anyway, the following output is what had me confused, and why I spent about an hour or so now looking into the 'struct' package and why it wasn't giving me what I &lt;em&gt;thought&lt;/em&gt; I wanted. Notice the plaintext "test" at the end. It seemed out of place, so I was assuming that I was doing &lt;strong&gt;something&lt;/strong&gt; wrong.&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; from pcsextension.payload import payload&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; from pcs.packets.tcp import tcp&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p = payload('test')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t = tcp()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.data = p&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; t.chain().bytes&lt;br /&gt;'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00test'&lt;/p&gt;&lt;/blockquote&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7400322576796417924?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7400322576796417924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/oh.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7400322576796417924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7400322576796417924'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/oh.html' title='Oh.'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-6571393222615627877</id><published>2009-05-31T01:25:00.001-04:00</published><updated>2009-05-31T01:25:28.374-04:00</updated><title type='text'>Rejected Email</title><content type='html'>&lt;p style="clear: both"&gt;George&lt;/p&gt;&lt;p style="clear: both"&gt;If you're reading this, I'm having some issues contacting you via email:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;This is an automatically generated Delivery Status Notification&lt;br /&gt;&lt;br /&gt;THIS IS A WARNING MESSAGE ONLY.&lt;br /&gt;&lt;br /&gt;YOU DO NOT NEED TO RESEND YOUR MESSAGE.&lt;br /&gt;&lt;br /&gt;Delivery to the following recipient has been delayed:&lt;br /&gt;&lt;br /&gt;  &lt;a href="mailto:gnn@neville-neil.com"&gt;gnn@neville-neil.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Message will be retried for 2 more day(s)&lt;br /&gt;&lt;br /&gt;Technical details of temporary failure: &lt;br /&gt;Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 451 451 4.3.0 Message held for human verification before permitting delivery. For help, please quote incident ID 13393043. (state 18).&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-6571393222615627877?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/6571393222615627877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/rejected-email.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6571393222615627877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6571393222615627877'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/rejected-email.html' title='Rejected Email'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2539781007220596695</id><published>2009-05-25T14:51:00.001-04:00</published><updated>2009-05-25T14:51:51.485-04:00</updated><title type='text'>Memorial Day</title><content type='html'>&lt;p style="clear: both"&gt;Happy Memorial Day, All!&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2539781007220596695?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2539781007220596695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/memorial-day.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2539781007220596695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2539781007220596695'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/memorial-day.html' title='Memorial Day'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8184090586962010403</id><published>2009-05-24T19:50:00.000-04:00</published><updated>2009-05-25T14:55:52.248-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tcp'/><category scheme='http://www.blogger.com/atom/ns#' term='logging'/><category scheme='http://www.blogger.com/atom/ns#' term='blogo'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Logging Framework Change</title><content type='html'>&lt;p style="clear: both"&gt;Decided I was going about it all wrong (it was getting late). Changed the implementation to simply provide convenience methods on top of the Python 'logging' package's framework -- with the added benefit of not having to worry about the nitty-gritty of the 'logging' package. Just simple, direct access to the log methods.&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;/p&gt;&lt;pre style="clear: both"&gt;&lt;br /&gt;     &gt;&gt;&gt; from loggable  import Loggable&lt;br /&gt;     &gt;&gt;&gt; class A(object): &lt;br /&gt;     ...    def  __init__(self): &lt;br /&gt;     ...      self.log = Loggable (self) &lt;br /&gt;     ...   &lt;br /&gt;     &gt;&gt;&gt; a = A() &lt;br /&gt;     &gt;&gt;&gt; a.log.info('test') &lt;br /&gt;     2009-05-24 12:48:08,654 - __main__.A - INFO - test &lt;br /&gt;     &gt;&gt;&gt; a.log.critical('test') &lt;br /&gt;     2009-05-24 12:48:19,475 - __main__.A - CRITICAL - test &lt;br /&gt;     &gt;&gt;&gt; a.log.state('test') &lt;br /&gt;     2009-05-24 12:48:22,978 - __main__.A - STATE_CHANGE - test &lt;br /&gt;     &gt;&gt;&gt; a.log.pktsent ('test') &lt;br /&gt;     2009-05-24 12:48:26,402 - __main__.A - PACKET_SENT - test &lt;br /&gt;     &gt;&gt;&gt; a.log.generated('test') &lt;br /&gt;     2009-05-24 12:48:49,516 - __main__.A - RESPONSE_GEN - test &lt;br /&gt;     &gt;&gt;&gt; a.log.field('test') &lt;br /&gt;     2009-05-24 12:48:52,475 - __main__.A - FIELD_CHANGE - test&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;Also have been working on a simple TCP State Machine today. My theory is that we will need to know [1] what state the local TCP connection is in, and [2] what state the remote TCP connection &lt;em&gt;should&lt;/em&gt; be in. A simple state machine should allow us to do this with some flexibility. Here is the base class/interface. Suggestions are highly welcomed:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;/p&gt;&lt;pre style="clear: both"&gt;class  TcpState(object):&lt;br /&gt;    ''' &lt;br /&gt;    Base TCP State class.   Note that it will, by design, ignore all non-TCP layers.&lt;br /&gt;    The TCP State classes will not perform verification that the packets are all&lt;br /&gt;    to/from the same hosts.   That filtering will be implemented elsewhere in the&lt;br /&gt;    framework.&lt;br /&gt;    '''&lt;br /&gt;    &lt;br /&gt;    def  __init__(self):&lt;br /&gt;        self._nextState = None &lt;br /&gt;    &lt;br /&gt;    def  packetSent(self, tcpPacket):&lt;br /&gt;        ''' &lt;br /&gt;        Hand off a packet to the TcpState object, where the object will perform&lt;br /&gt;        any necessary calculation, and determine if a state change should be&lt;br /&gt;        caused by the provided packet.&lt;br /&gt;        &lt;br /&gt;        The packet should be a packet that is considered 'sent' from&lt;br /&gt;        the TCP stack that this state belongs to.&lt;br /&gt;        &lt;br /&gt;        @return True if the packet causes a state change.   False otherwise.&lt;br /&gt;        '''&lt;br /&gt;         return  False&lt;br /&gt;    &lt;br /&gt;    def  packetRecvd(self, tcpPacket):&lt;br /&gt;        ''' &lt;br /&gt;        Same as packetSent, but in the opposite direction.&lt;br /&gt;        &lt;br /&gt;        The packet should be a packet that is considered 'received' from&lt;br /&gt;        the remote TCP stack.&lt;br /&gt;        &lt;br /&gt;        @see packetSent&lt;br /&gt;        '''&lt;br /&gt;         return  False&lt;br /&gt;    &lt;br /&gt;    def  causedStateChange(self):&lt;br /&gt;        ''' &lt;br /&gt;        Returns true if a previous call to packetSent/packetRecvd caused a  &lt;br /&gt;        state-change.&lt;br /&gt;        '''&lt;br /&gt;        return  self._nextState != None &lt;br /&gt;    &lt;br /&gt;    def  getNextState(self):&lt;br /&gt;        ''' &lt;br /&gt;        Returns the class (subclass of TcpState) that represents the state that&lt;br /&gt;        the TCP stack should be in, as a result of previous packetSent/Recvd  calls.&lt;br /&gt;        @return A class object, or None if no state change should occur.&lt;br /&gt;        '''&lt;br /&gt;        return  self._nextState&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;Interesting Predicament: Blogo does not like pasting HTML code inside of "pre" tags. It tries to make the HTML code visible, by changing each &lt; and &gt; to "&lt;" or "&gt;", respectively. It seems that I can't find a Blog client that does everything perfectly. So no Python syntax highlighting for now.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8184090586962010403?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8184090586962010403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/logging-framework-change.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8184090586962010403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8184090586962010403'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/logging-framework-change.html' title='Logging Framework Change'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3006233673112513299</id><published>2009-05-24T03:38:00.001-04:00</published><updated>2009-05-24T03:38:47.784-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='logging'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Logging Framework</title><content type='html'>&lt;p style="clear: both"&gt;I think I've got the Logging stuff set up the way I'd like it to work.&lt;/p&gt;&lt;p style="clear: both"&gt;Here's an example (the doc for the responsible class)...&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;    &amp;gt;&amp;gt;&amp;gt; from loggable import Loggable&lt;br /&gt;    &amp;gt;&amp;gt;&amp;gt; Loggable().logfield('test')&lt;br /&gt;    2009-05-24 03:23:40,851 - loggable.Loggable - FIELD_CHANGE - test&lt;br /&gt;    &amp;gt;&amp;gt;&amp;gt; Loggable().loginfo('test')&lt;br /&gt;    2009-05-24 03:24:26,108 - loggable.Loggable - INFO - test&lt;br /&gt;    &amp;gt;&amp;gt;&amp;gt; class B(Loggable):&lt;br /&gt;    ...   pass&lt;br /&gt;    ... &lt;br /&gt;    &amp;gt;&amp;gt;&amp;gt; B().loginfo('test')&lt;br /&gt;    2009-05-24 03:24:38,306 - __main__.B - INFO - test &lt;br /&gt;    &amp;gt;&amp;gt;&amp;gt; B().logpacket('packet XYZ sent')&lt;br /&gt;    2009-05-24 03:26:05,299 - __main__.B - PACKET_SENT - packet XYZ sent&lt;br /&gt;    &amp;gt;&amp;gt;&amp;gt; B().logresponse('response ABC generated for packet XYZ')&lt;br /&gt;    2009-05-24 03:26:15,745 - __main__.B - RESPONSE_GEN - response ABC generated for packet XYZ&lt;br /&gt;    &amp;gt;&amp;gt;&amp;gt; B().logfield('field abc123 set to newValue')&lt;br /&gt;    2009-05-24 03:26:42,292 - __main__.B - FIELD_CHANGE - field abc123 set to newValue&lt;br /&gt;    &amp;gt;&amp;gt;&amp;gt; Loggable().logstate('state changed to CONNECTED')&lt;br /&gt;    2009-05-24 03:31:16,848 - loggable.Loggable - STATE_CHANGE - state changed to CONNECTED&lt;/pre&gt;&lt;pre style="clear: both"&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3006233673112513299?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3006233673112513299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/logging-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3006233673112513299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3006233673112513299'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/logging-framework.html' title='Logging Framework'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-1771712434900568638</id><published>2009-05-24T01:08:00.001-04:00</published><updated>2009-05-24T01:09:55.899-04:00</updated><title type='text'>Further thoughts on design</title><content type='html'>&lt;p style="clear: both"&gt;A few more thoughts on the design of the framework:&lt;/p&gt;&lt;ol style="clear: both"&gt;&lt;li&gt;Logging (textual)&lt;/li&gt;&lt;li&gt;Logging (packets)&lt;/li&gt;&lt;li&gt;Diff'ing (packets)&lt;/li&gt;&lt;li&gt;Live history&lt;/li&gt;&lt;/ol&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;Logging (textual)&lt;/strong&gt;&lt;br /&gt;The way that the textual output of the framework is delivered needs to be well-thought-out. While it's obvious that "test passed" / "test failed" is all that should be necessary for standard runs (INFO level), there are many distinct levels below INFO that will be necessary. A few of these off the top of my head:&lt;/p&gt;&lt;ul style="clear: both"&gt;&lt;li&gt;&lt;em&gt;Full packet sent'd/recv'd over network IF&lt;br /&gt;&lt;/em&gt;This is obvious. Just a Packet sent/recv, with the BinHex print-out&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;State-change&lt;br /&gt;&lt;/em&gt;This should somewhat reflect the diagram provided on Page 23 of RFC 793. This behavior will also make it easier to track issues in the flow.&lt;br /&gt;&lt;ol style="clear: both"&gt;&lt;li&gt;Closed&lt;/li&gt;&lt;li&gt;Listen&lt;/li&gt;&lt;li&gt;SYN sent&lt;br /&gt;&lt;/li&gt;&lt;li&gt;SYN recvd&lt;/li&gt;&lt;li&gt;Established&lt;/li&gt;&lt;li&gt;Fin Wait-1/2&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Close Wait&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Closing&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Time Wait&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Closed&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Response generation&lt;br /&gt;&lt;/em&gt;Automated response generation (i.e. Send packet X, recv packet Y. Validate that Packet Y is what we were expecting, and then generate Packet Z that is a valid response/ACK for Packet Y).&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Field generation (dynamic)&lt;br /&gt;&lt;/em&gt;When sending information, some fields (like IP length, checksums) may be generated dynamically/on-the-fly. &lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Manual field override&lt;br /&gt;&lt;/em&gt;Testing invalid states/data will also be necessary. Manually overriding fields (e.g. bad checksum) should provide extra insight. This might belong on the same logging level as Field Generation, but with a different prefix.&lt;/li&gt;&lt;/ul&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;Logging (Packets)&lt;/strong&gt;&lt;br /&gt;Creating a TCPDUMP-formatted file with the contents of all of the packets from a test session will be invaluable in determining what, specifically, went wrong during the tests. This will make the use of third-party tools possible, and should complement the configurable logging well.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;Differential Analysis&lt;/strong&gt;&lt;br /&gt;Simple packet replay, will only be useful in select circumstances. Ideally, sending packet X will &lt;em&gt;always&lt;/em&gt; generate response Y (with some variables, such as timestamp). Playback of a TCPDUMPed session would allow this, but it would need a framework to determine what fields are important for validity, and which aren't. Since it would be difficult to require the specific &lt;em&gt;lack&lt;/em&gt; of a particular response, this application may be very limited.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;Live History&lt;/strong&gt;&lt;br /&gt;Having a history (in memory) of all of the packets sent/received during the current test will be a necessity. This is required to make sure that, for example, all of the packets were properly ack'ed as we continue sending packets. Also, it will be necessary to have internal state information about how much data has been ack'ed, and its correlation to the window size.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-1771712434900568638?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/1771712434900568638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/further-thoughts-on-design_23.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1771712434900568638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1771712434900568638'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/further-thoughts-on-design_23.html' title='Further thoughts on design'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8353184793610321050</id><published>2009-05-23T20:21:00.001-04:00</published><updated>2009-05-23T20:21:10.924-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='pcs'/><category scheme='http://www.blogger.com/atom/ns#' term='osx'/><title type='text'>Not Just OS X</title><content type='html'>&lt;p style="clear: both"&gt;The reason for my previous post, was to ensure that the issues that I encountered building the Hg-current build of PCS were not a result of running on Darwin/OSX instead of FreeBSD. This worry has been alleviated - the same issues occur on FreeBSD.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8353184793610321050?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8353184793610321050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/not-just-os-x.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8353184793610321050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8353184793610321050'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/not-just-os-x.html' title='Not Just OS X'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-7426590349762812196</id><published>2009-05-23T20:15:00.001-04:00</published><updated>2009-05-23T20:27:11.269-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='x11'/><category scheme='http://www.blogger.com/atom/ns#' term='fusion'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><category scheme='http://www.blogger.com/atom/ns#' term='osx'/><title type='text'>I Love X</title><content type='html'>&lt;p style="clear: both"&gt;I just wanted to note that X11, for its age, is amazing. X11 + SSH with X Forwarding + VMWare Fusion + OS X for the win. Saves me from having to run a full GUI &lt;strong&gt;inside&lt;/strong&gt; the virtual machine.&lt;/p&gt;&lt;p style="clear: both"&gt;(Of course, it wouldn't be necessary if FreeBSD shipped with links, lynx, or wget. I understand that there's licensing issues, and that it comes with package management and curl.)&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-7426590349762812196?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/7426590349762812196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/i-love-x.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7426590349762812196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/7426590349762812196'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/i-love-x.html' title='I Love X'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2588175231323536498</id><published>2009-05-23T16:12:00.001-04:00</published><updated>2009-05-23T16:12:55.752-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gnn'/><category scheme='http://www.blogger.com/atom/ns#' term='pcs'/><category scheme='http://www.blogger.com/atom/ns#' term='pyrex'/><title type='text'>PCS-Current</title><content type='html'>&lt;p style="clear: both"&gt;Working on getting the latest PCS from Hg working, because it will be necessary to have proper Checksum and Length generation on-the-fly for easy generation of valid packets.&lt;/p&gt;&lt;p style="clear: both"&gt;Contacted GNN with (hopefully) the last few issues to getting this to work for me.&lt;/p&gt;&lt;p style="clear: both"&gt;Zach&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2588175231323536498?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2588175231323536498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/pcs-current.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2588175231323536498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2588175231323536498'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/pcs-current.html' title='PCS-Current'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-60223420645702814</id><published>2009-05-22T23:01:00.001-04:00</published><updated>2009-05-22T23:01:21.455-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tcp'/><category scheme='http://www.blogger.com/atom/ns#' term='checksum'/><category scheme='http://www.blogger.com/atom/ns#' term='loopback'/><category scheme='http://www.blogger.com/atom/ns#' term='wireshark'/><title type='text'>Wireshark Behavior</title><content type='html'>&lt;p style="clear: both"&gt;Looks like the issue is the adapter.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;a href="http://www.mail-archive.com/wireshark-users@wireshark.org/msg03669.html" title="Re: [Wireshark-users] BAD TCP CHECKSUM in loopback interface"&gt;http://www.mail-archive.com/wireshark-users@wireshark.org/msg03669.html&lt;/a&gt;&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-60223420645702814?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/60223420645702814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/wireshark-behavior.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/60223420645702814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/60223420645702814'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/wireshark-behavior.html' title='Wireshark Behavior'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-6626205978966949398</id><published>2009-05-22T22:46:00.001-04:00</published><updated>2009-05-22T22:46:32.717-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tcp'/><category scheme='http://www.blogger.com/atom/ns#' term='checksum'/><category scheme='http://www.blogger.com/atom/ns#' term='pcap'/><category scheme='http://www.blogger.com/atom/ns#' term='loopback'/><category scheme='http://www.blogger.com/atom/ns#' term='wireshark'/><title type='text'>Wireshark Strangeness</title><content type='html'>&lt;p style="clear: both"&gt;Playing around with Wireshark, looking at the dissected data, and getting some weird results. Evidently the small echo server I wrote (see below) does not create the correct TCP checksum. I thought that this might be an issue when using &lt;strong&gt;lo0&lt;/strong&gt; (loopback), but the data simply doesn't show up in Wireshark when going to/from the same IP address (in my case, 172.16.0.10). Shows up in netstat:&lt;/p&gt;&lt;blockquote style="clear: both"&gt;&lt;p&gt;&lt;pre style="clear: both"&gt;tcp4       0      0  172.16.0.10.46002      172.16.0.10.55074      ESTABLISHED&lt;br /&gt;tcp4       0      0  172.16.0.10.55074      172.16.0.10.46002      ESTABLISHED&lt;br /&gt;tcp4       0      0  *.46002                *.*                    LISTEN&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="clear: both"&gt;Not sure what its issue is. &lt;/p&gt;&lt;p style="clear: both"&gt;Loopback pcap file available &lt;a href="http://gsoc-tcpregression.googlecode.com/files/FailedChecksums.pcap" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-6626205978966949398?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/6626205978966949398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/wireshark-strangeness.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6626205978966949398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6626205978966949398'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/wireshark-strangeness.html' title='Wireshark Strangeness'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3229923121925903737</id><published>2009-05-22T18:01:00.001-04:00</published><updated>2009-05-22T18:12:43.731-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pcs'/><category scheme='http://www.blogger.com/atom/ns#' term='blogo'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Structure</title><content type='html'>&lt;p style="clear: both"&gt;Thinking about the best way to structure the TCP regression framework. A few things immediately jump out at me:&lt;/p&gt;&lt;ul style="clear: both"&gt;&lt;li&gt;Handle either IPv4 or IPv6 gracefully&lt;/li&gt;&lt;li&gt;Reuse the most code possible&lt;/li&gt;&lt;li&gt;Easy generations of responses (e.g. create new Chain, with corresponding TCP layer with filled-in fields like Sequence number, Ack number, Ack flag, etc.)&lt;/li&gt;&lt;li&gt;Ability to test that the opposite side is actually getting a connection and recv'ing data&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Handling IPv4 and IPv6 Gracefully&lt;br /&gt;&lt;/strong&gt;&lt;div&gt;The simplest way to do this would be to define an interface and two implementations. However, I need to look into the differences between IPv4 and IPv6 a bit more -- static header size may preclude IPv6 from needing some tests, and there may yet be other differences.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;Code Reuse&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Code reuse will likely fit into the same category as above. Simple interface/implementation class hierarchy may do the trick. However, aside from the direct manipulation of the tests, there may be some tests which are a subset of other tests, or the same test may need to be run under multiple circumstances. Preventing duplicated code is something I really put a high priority on.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Response Generation&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Response generation will also be a subset of the two above areas. For example, let's say I send a SYN packet, and I find the corresponding SYN/ACK packet. Having a method that generates the final ACK packet would be beneficial (or that generates an ACK packet to any packet).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Connectivity Testing&lt;/strong&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Connectivity testing &lt;em&gt;should&lt;/em&gt; be fairly trivial. Basically, set up an echo server. If the connection is properly established, the data should be echoed back without problem. This particular solution should also lend itself to testing window sizes.&lt;br /&gt;&lt;br /&gt;Side Note:&lt;br /&gt;The blog client &lt;a href="http://www.drinkbrainjuice.com/blogo" title="Blogo" target="_blank"&gt;Blogo&lt;/a&gt; is amazing. Full-screen, rich-text editing FTW.&lt;/div&gt;&lt;br class='final-break' style='clear: both' /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3229923121925903737?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3229923121925903737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/structure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3229923121925903737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3229923121925903737'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/structure.html' title='Structure'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8863068324016111033</id><published>2009-05-18T22:32:00.001-04:00</published><updated>2009-05-18T22:32:56.989-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gnn'/><category scheme='http://www.blogger.com/atom/ns#' term='pcs'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Adding functionality to PCS</title><content type='html'>Sent the below to GNN, hopefully it'll make its way into PCS.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;inet_lton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;integer&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;struct&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&amp;gt;L&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;integer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;inet_ltoa&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;integer&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inet_ntoa&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inet_lton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;integer&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;inet_ntol&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;byteString&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;struct&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;unpack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&amp;gt;L&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;byteString&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mf"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;inet_atol&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ipString&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;inet_ntol&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inet_aton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ipString&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8863068324016111033?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8863068324016111033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/adding-functionality-to-pcs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8863068324016111033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8863068324016111033'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/adding-functionality-to-pcs.html' title='Adding functionality to PCS'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2199133341343186020</id><published>2009-05-18T21:03:00.001-04:00</published><updated>2009-05-18T21:03:34.727-04:00</updated><title type='text'>Real Coding Begins!</title><content type='html'>First Step&lt;br /&gt;&lt;br /&gt;	Create a class that allows filtering of packets based on the IP address and/or port, and works with both IPv4/IPv6 and TCP/TCPv6.  Since this is a &lt;b&gt;TCP&lt;/b&gt; testing framework, this should allow a lot of &lt;i&gt;isinstance(packet,pcs.packets.tcp.tcp)&lt;/i&gt; calls.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2199133341343186020?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2199133341343186020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/real-coding-begins.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2199133341343186020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2199133341343186020'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/real-coding-begins.html' title='Real Coding Begins!'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-387595218519906746</id><published>2009-05-14T22:50:00.001-04:00</published><updated>2009-05-14T22:50:01.859-04:00</updated><title type='text'>Worthwhile Note</title><content type='html'>I thought it pertinent to note that I resolved the earlier-mentioned problem by setting the &lt;i&gt;data&lt;/i&gt; member in the &lt;i&gt;Packet&lt;/i&gt; class directly:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Packet:&lt;br /&gt;  ...&lt;br /&gt;  data = None&lt;br /&gt;  ...&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-387595218519906746?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/387595218519906746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/worthwhile-note.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/387595218519906746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/387595218519906746'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/worthwhile-note.html' title='Worthwhile Note'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-291231560183877277</id><published>2009-05-13T21:18:00.001-04:00</published><updated>2009-05-13T21:48:44.295-04:00</updated><title type='text'>More PCS Issues, Bugreport</title><content type='html'>Issued a bug report on the SF.net tracker.  Didn't realized that I wasn't logged in, and subsequently cannot modify the report.  Oops.&lt;br /&gt;&lt;br /&gt;Anyways, the problem is that &lt;i&gt;dns.py&lt;/i&gt; defines the &lt;span class="nc"&gt;dnsheader&lt;/span&gt; class doesn't define the 'data' member.  This is present in the Hg revision, which is why I was trying to get it working earlier.&lt;br /&gt;&lt;br /&gt;Looks like merging won't be easy, since the newer version relies on &lt;i&gt;is_tcp&lt;/i&gt;.  Might just add a 'Data' field that sets &lt;i&gt;data=None&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;I am beginning to wonder why many of these variables are not defined in the Packet class body, since they are expected to exist.  This would also facilitate contextual help systems (like the Python/Eclipse stuff).&lt;br /&gt;&lt;br /&gt;Also not sure why &lt;i&gt;is_tcp&lt;/i&gt; is used instead of &lt;i&gt;isinstance(self,tcp)&lt;/i&gt;.  Looking back through the code is painful, because I haven't (to this point) found any high-level design documents.  Might have to email GNN about this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-291231560183877277?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/291231560183877277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/more-pcs-issues-bugreport.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/291231560183877277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/291231560183877277'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/more-pcs-issues-bugreport.html' title='More PCS Issues, Bugreport'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-336319698038906024</id><published>2009-05-13T17:15:00.001-04:00</published><updated>2009-05-13T17:15:59.111-04:00</updated><title type='text'>Attempted to update to PCS from Hg</title><content type='html'>Attempted to update to PCS from Mercurial.  Greeted with a bunch of this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/Users/zach/Documents/workspace/PCS/pcs/bpf/bpf.pyx:391:53: Attempting to index non-array type '&lt;error&gt;'&lt;br /&gt;&lt;br /&gt;Error converting Pyrex file to C:&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;...&lt;br /&gt;        li = []&lt;br /&gt;        n = self.bp.bf_len&lt;br /&gt;        if n &gt; 0:&lt;br /&gt;            ip = self.bp.bf_insns&lt;br /&gt;            for 0 &lt;= i &lt; n:&lt;br /&gt;                li.append(op(ip[0].code, ip[0].jt, ip[0].jf, ip[0].k))&lt;br /&gt;                                                              ^&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-336319698038906024?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/336319698038906024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/attempted-to-update-to-pcs-from-hg.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/336319698038906024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/336319698038906024'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/attempted-to-update-to-pcs-from-hg.html' title='Attempted to update to PCS from Hg'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8003296832878950204</id><published>2009-05-12T22:34:00.001-04:00</published><updated>2009-05-12T23:15:54.469-04:00</updated><title type='text'>Finally!</title><content type='html'>Finally, some time to do some investigative work with PCS.&lt;br /&gt;&lt;br /&gt;Well, turns out that the code was doing exactly what it should have been doing, just not what I expected.&lt;br /&gt;&lt;br /&gt;Consider the following:&lt;pre&gt;&lt;span class="n"&gt;sniffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pcs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PcapConnector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;interface&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;rawPacket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sniffer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;etherPacket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ethernet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rawPacket&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;     &lt;br /&gt;&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;RAW&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;ByteToHex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rawPacket&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;Ether.bytes&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;ByteToHex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;etherPacket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getbytes&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;Ether.chain().bytes&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;ByteToHex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;etherPacket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chain&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This results in the output:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;RAW&lt;br /&gt;00 21 29 A5 A9 3F 00 1B 63 06 82 B2 08 00 45 00 00 4A DD AA 40 00 40 06 54 A1 AC 10 00 0A 40 0C 1C 3C C8 5B 14 46 03 BC CB 8B 8B 23 09 EF 50 18 FF FF EE FD 00 00 2A 02 01 C4 00 1F 00 04 00 14 00 00 00 00 01 C0 00 00 00 00 00 00 00 00 00 01 08 6C 7A 61 62 61 64 61&lt;br /&gt;Ether.bytes&lt;br /&gt;00 21 29 A5 A9 3F 00 1B 63 06 82 B2 08 00&lt;br /&gt;Ether.chain().bytes&lt;br /&gt;00 21 29 A5 A9 3F 00 1B 63 06 82 B2 08 00 45 00 00 4A DD AA 40 00 40 06 54 A1 AC 10 00 0A 40 0C 1C 3C C8 5B 14 46 03 BC CB 8B 8B 23 09 EF 50 18 FF FF EE FD 00 00 2A 02 01 C4 00 1F 00 04 00 14 00 00 00 00 01 C0 00 00 00 00 00 00 00 00 00 01 08 6C 7A 61 62 61 64 61&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Looks like the ".getBytes()" function only returns the bytes for that level (which is obviously useful with the Chain object).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8003296832878950204?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8003296832878950204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/finally.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8003296832878950204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8003296832878950204'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/finally.html' title='Finally!'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-2360964520688912315</id><published>2009-05-11T17:28:00.001-04:00</published><updated>2009-05-11T17:28:36.106-04:00</updated><title type='text'>Back Home</title><content type='html'>Back at home for now, moving to Lansing tomorrow afternoon.  Things should really get moving :-D&lt;br /&gt;&lt;br /&gt;Turns out that all of my Summer courses are for the &lt;b&gt;first&lt;/b&gt; half of the summer.  This may result in a disproportionate amount of time being spent after July 2, versus the time spent before it.  I still plan to stick fully to all of my previously-outlined commitments, especially this project.&lt;br /&gt;&lt;br /&gt;Course Schedule:&lt;br /&gt;&lt;a href="http://www.google.com/calendar/embed?src=g3e5bdcjfekj6tiapvl7sjdb7s%40group.calendar.google.com&amp;ctz=America/New_York"&gt;HTML&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.google.com/calendar/ical/g3e5bdcjfekj6tiapvl7sjdb7s%40group.calendar.google.com/public/basic.ics"&gt;iCal&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Embedded:&lt;br /&gt;&lt;iframe src="http://www.google.com/calendar/embed?src=g3e5bdcjfekj6tiapvl7sjdb7s%40group.calendar.google.com&amp;ctz=America/New_York" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-2360964520688912315?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/2360964520688912315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/back-home.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2360964520688912315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/2360964520688912315'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/back-home.html' title='Back Home'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-1474964053013671602</id><published>2009-05-09T00:47:00.001-04:00</published><updated>2009-05-09T00:47:28.873-04:00</updated><title type='text'>Moving Back Home</title><content type='html'>I'm moving back home from the DC area on Sunday.  I've got some of my stuff packed up in the car already, and depending on how tomorrow goes (packing more stuff, tying up loose ends, mailing off eBay packages, biking if there's time) I should get some more time to play with PCS.&lt;br /&gt;&lt;br /&gt;Once I get home, I have some errands to run on Monday, and will be moving into my new place in East Lansing on Tuesday.  That should give me the rest of the week to get situated, and spend some real time in PCS before the actual "coding period" begins.&lt;br /&gt;&lt;br /&gt;Here's to hoping that GNN gets the new version pushed out soon! Looking forward to it :-D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-1474964053013671602?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/1474964053013671602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/moving-back-home.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1474964053013671602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1474964053013671602'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/moving-back-home.html' title='Moving Back Home'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-9113566431239280979</id><published>2009-05-05T19:43:00.001-04:00</published><updated>2009-05-05T19:43:17.334-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gnn'/><category scheme='http://www.blogger.com/atom/ns#' term='pcs'/><title type='text'>Issues with PCS</title><content type='html'>Not sure why the below code doesn't print out the same values three times...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pcs&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;pcs.packets.ethernet&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;pcs.packets.ipv4&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;pcs.packets.tcp&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;&lt;br /&gt;    &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;optparse&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OptionParser&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="n"&gt;parser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;OptionParser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br /&gt;    &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;-i&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;--interface&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br /&gt;                      &lt;span class="n"&gt;dest&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;interface&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br /&gt;                      &lt;span class="n"&gt;help&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Which interface to use for testing.&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse_args&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br /&gt;    &lt;span class="n"&gt;sniffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pcs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PcapConnector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;interface&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="mf"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;        &lt;span class="n"&gt;rawPacket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sniffer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br /&gt;        &lt;span class="n"&gt;etherPacket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ethernet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rawPacket&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;etherPacket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;ipv4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;            &lt;span class="n"&gt;ipv4Packet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ipv4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;etherPacket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getbytes&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ipv4Packet&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;tcp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;                &lt;span class="n"&gt;tcpPacket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tcp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ipv4Packet&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getbytes&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;br /&gt;                &lt;br /&gt;                &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;etherPacket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;br /&gt;                &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;ipv4Packet&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;br /&gt;                &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;tcpPacket&lt;/span&gt;&lt;br /&gt;        &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;-------------------------------------&amp;#39;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-9113566431239280979?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/9113566431239280979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/issues-with-pcs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/9113566431239280979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/9113566431239280979'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/issues-with-pcs.html' title='Issues with PCS'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-8876542239365698122</id><published>2009-05-04T22:56:00.001-04:00</published><updated>2009-05-04T22:56:59.938-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ide'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='textmate'/><title type='text'>Playing around with PCS</title><content type='html'>Doing some non-constructive playing around with PCS.  I've decided that I may very well use Eclipse with some Python plugins for development, as I've gotten used to the IDE, along with contextual help (member, method lists, etc.) and its debugger.  &lt;br /&gt;&lt;br /&gt;I'm very, very sorry TextMate.  You've served me well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-8876542239365698122?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/8876542239365698122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/playing-around-with-pcs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8876542239365698122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/8876542239365698122'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/playing-around-with-pcs.html' title='Playing around with PCS'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-3441601871800917612</id><published>2009-05-01T22:55:00.001-04:00</published><updated>2009-05-02T18:56:09.755-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='macports'/><category scheme='http://www.blogger.com/atom/ns#' term='pyrexc'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pyrex'/><title type='text'>Installing PCS and Pyrex on a Mac</title><content type='html'>Found this out a while ago, but figure it might be useful to users of PCS... (since I couldn't find this information anywhere else)&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; Download PCS from &lt;a href="http://pcs.sf.net"&gt;SF.net&lt;/a&gt;&lt;br /&gt;&lt;li&gt; Download Pyrex from &lt;a href="http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/"&gt;canterbury.ac.nz&lt;/a&gt;&lt;br /&gt;&lt;li&gt; Extract Pyrex.   Then run &lt;pre&gt;sudo python setup.py install&lt;/pre&gt;&lt;br /&gt;&lt;li&gt; Extract PCS.  Then run &lt;pre&gt;sudo python setup.py install&lt;/pre&gt;&lt;br /&gt;&lt;li&gt; Don't bother with the MacPort of pylibpcap.  Just download it from &lt;a href="http://pylibpcap.sourceforge.net/"&gt;SF.net&lt;/a&gt;, and run &lt;pre&gt;sudo python setup.py install&lt;/pre&gt;&lt;br /&gt;&lt;li&gt; To make sure everything works, bring up Python and type &lt;pre&gt;import pcs&lt;/pre&gt;As long as you don't get any errors, it's safe to assume everything went well :-)&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;In retrospect, this all is extremely straightforward.  I was trying to do it the "MacPorts" way instead of just *doing* it.  Would've saved myself a lot of hassle...&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-3441601871800917612?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/3441601871800917612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/installing-pcs-and-pyrex-on-mac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3441601871800917612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/3441601871800917612'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/installing-pcs-and-pyrex-on-mac.html' title='Installing PCS and Pyrex on a Mac'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-1757207165202138392</id><published>2009-05-01T20:35:00.001-04:00</published><updated>2009-05-01T20:35:33.803-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='gsoc'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><category scheme='http://www.blogger.com/atom/ns#' term='pyrex'/><title type='text'>Some Time to Work...</title><content type='html'>Hopefully I'll have some time to get some things done this weekend, now that I don't have to worry about getting the apartment cleaned up, things sold, and paying for school.&lt;br /&gt;&lt;br /&gt;Started getting things set up on my Mac for the project.  So far I've got FreeBSD installed in a VMWare machine, Python 2.5 installed (because the MacPort of 2.6 doesn't want to, for whatever reason).  Downloaded PCS and started getting it set up, although I've run into a snag getting it to find Pyrex properly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-1757207165202138392?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/1757207165202138392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/some-time-to-work.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1757207165202138392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/1757207165202138392'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/05/some-time-to-work.html' title='Some Time to Work...'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6951733302331203011.post-6332184233798093576</id><published>2009-04-20T21:41:00.000-04:00</published><updated>2009-04-20T21:52:40.169-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ctb'/><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='gnn'/><category scheme='http://www.blogger.com/atom/ns#' term='gsoc'/><title type='text'>GSoC 2009 Acceptance</title><content type='html'>Google just posted the &lt;a href="http://socghop.appspot.com/program/accepted_orgs/google/gsoc2009"&gt;list of approved student applications&lt;/a&gt;, and it looks like &lt;a href="http://socghop.appspot.com/student_project/show/google/gsoc2009/freebsd/t124022320693"&gt;mine&lt;/a&gt; made it in :-).  Hopefully I'll be able to find a blogging client this summer that [1] makes readable HTML and [2] also has decent support for inline code.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks to &lt;a href="http://www.freebsd.org/"&gt;FreeBSD&lt;/a&gt; for being my mentoring organization, and &lt;a href="http://www.neville-neil.com/"&gt;George Neville-Neil&lt;/a&gt; for being my mentor.  Advance thanks to &lt;a href="http://ivory.idyll.org/blog"&gt;Prof. Titus Brown&lt;/a&gt; for all the hassle I'm about to give him this summer. [/sarcasm?]&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;More news as it happens.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6951733302331203011-6332184233798093576?l=gsoc-tcpregression.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gsoc-tcpregression.blogspot.com/feeds/6332184233798093576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/04/gsoc-2009-acceptance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6332184233798093576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6951733302331203011/posts/default/6332184233798093576'/><link rel='alternate' type='text/html' href='http://gsoc-tcpregression.blogspot.com/2009/04/gsoc-2009-acceptance.html' title='GSoC 2009 Acceptance'/><author><name>Zach</name><uri>http://www.blogger.com/profile/03008329063902532712</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp2.blogger.com/_A95zAiNZLCo/SCfLLmt7EzI/AAAAAAAAAGw/wmGh6aY_T6k/S220/Photo+23.jpg'/></author><thr:total>0</thr:total></entry></feed>
