Fix/add comments for gopacket.SerializeLayers.
Add simple routing using the kernel's routing tables.

For packet-generation tasks, figuring out where to send packets (which
interface/gateway) is non-trivial.  This library uses the kernel's routing
table (gathered via Netlink) to make routing decisions.

The current implementation is by no means particularly fast (or possibly even
accurate ;), but it seems to work pretty well for simple tasks.
Example program: arpscan.

arpscan scans all local networks for machines using simple ARP scanning
techniques.
Fix TCP assembly example.

The current TCP assembly example hung forever because the reader stream wasn't
correctly initialized.  Fixed it, and also changed the library to panic should
that type of issue happen to others, so it's easy to trace what the issue is.
Move all example code into example subdirectory.
Fix copyrights, add copyright check to gc, changelog update.
Merge branch 'master' into scanner
Add syn scanner example, update generated files.
Update changelog for v1.0.4
Convert PCap/PFRing timestamps correctly.

We were incorrectly converting pcap and pfring timestamps into Go time.Time
objects... they returned micros, but we treated them as nanos.

Thanks to Peter Membrey for pointing this out.
Changelog update for v1.0.5
BENCH TCP Assembly work, small behavior changes.

I've added a new example to show how tcpassembly can be used without tcpreader.
It also illustrates the use of DecodingLayerParser and ZeroCopyReadPacketData.

Along the way, found and fixed a few minor issues with TCP assembly, and added a
debugging flag to provide VERY verbose logging should the need arise.

Bug 1)  If a TCP stream is stopped halfway through, one side may continue to
send some packet data until the RST reaches the other side.  All packets sent
during this time will also trigger RSTs, meaning a bunch of packets being sent
back over the wire without any data in them.  The problem is that with the old
code this created a new connection object (empty, of course).  This has been
fixed to not create connections for these "empty" packets.

Bug 2)  TCP SYN received out of order:  If a SYN was received after other data
had already been flushed (it was SUPER late), the old code would have actually
reset nextSeq to the SYN and blindly sent it along, not a good story at all.
The new code only sends a SYN if nextSeq shows that no packets have been sent
yet.

----------------------------------------------------------
BENCHMARK_MARKER_DO_NOT_CHANGE
----------------------------------------------------------

Go version go version go1.2 linux/amd64

TEST BENCHMARKS
PASS
BenchmarkTypeAssertion	500000000	         3.63 ns/op
BenchmarkMapLookup	500000000	         3.58 ns/op
BenchmarkNilMapLookup	500000000	         3.23 ns/op
BenchmarkNilMapLookupWithNilCheck	2000000000	         0.82 ns/op
BenchmarkArrayLookup	2000000000	         0.56 ns/op
BenchmarkTypeToInterface1	2000000000	         0.81 ns/op
BenchmarkTypeToInterface2	2000000000	         0.53 ns/op
BenchmarkPassDecodeOptionsByValue	2000000000	         0.27 ns/op
BenchmarkPassDecodeOptionsByPointer	2000000000	         0.27 ns/op
BenchmarkLockOSThread	500000000	         4.09 ns/op
BenchmarkUnlockOSThread	500000000	         4.53 ns/op
BenchmarkLockUnlockOSThread	200000000	         9.50 ns/op
BenchmarkLockDeferUnlockOSThread	50000000	        59.0 ns/op
BenchmarkUnbufferedChannel	10000000	       253 ns/op
BenchmarkSmallBufferedChannel	 5000000	       308 ns/op
BenchmarkLargeBufferedChannel	 5000000	       309 ns/op
BenchmarkEndpointFastHashShort	100000000	        16.1 ns/op
BenchmarkEndpointFastHashLong	50000000	        34.9 ns/op
BenchmarkFlowFastHashShort	100000000	        22.6 ns/op
BenchmarkFlowFastHashLong	50000000	        62.2 ns/op
ok  	code.google.com/p/gopacket	39.620s
PASS
BenchmarkLayerClassSliceContains	2000000000	         1.08 ns/op
BenchmarkLayerClassMapContains	500000000	         3.94 ns/op
BenchmarkLazyNoCopyEthLayer	 2000000	       877 ns/op
BenchmarkLazyNoCopyIPLayer	 1000000	      1362 ns/op
BenchmarkLazyNoCopyTCPLayer	 1000000	      2139 ns/op
BenchmarkLazyNoCopyAllLayers	 1000000	      2303 ns/op
BenchmarkDefault	 1000000	      2706 ns/op
BenchmarkSerializeTcpNoOptions	10000000	       230 ns/op
BenchmarkSerializeTcpFixLengths	10000000	       240 ns/op
BenchmarkSerializeTcpComputeChecksums	 5000000	       572 ns/op
BenchmarkSerializeTcpFixLengthsComputeChecksums	 5000000	       574 ns/op
BenchmarkLazy	 1000000	      1108 ns/op
BenchmarkNoCopy	 1000000	      2068 ns/op
BenchmarkLazyNoCopy	 5000000	       471 ns/op
BenchmarkKnownStack	10000000	       177 ns/op
BenchmarkDecodingLayerParserIgnorePanic	10000000	       238 ns/op
BenchmarkDecodingLayerParserHandlePanic	 5000000	       299 ns/op
BenchmarkAlloc	50000000	        31.9 ns/op
BenchmarkFlow	50000000	        44.0 ns/op
BenchmarkEndpoints	50000000	        54.3 ns/op
BenchmarkTCPLayerFromDecodedPacket	100000000	        12.0 ns/op
BenchmarkTCPLayerClassFromDecodedPacket	50000000	        37.6 ns/op
BenchmarkTCPTransportLayerFromDecodedPacket	1000000000	         2.98 ns/op
BenchmarkDecodeFuncCallOverheadDirectCall	2000000000	         1.09 ns/op
BenchmarkDecodeFuncCallOverheadDecoderCall	500000000	         6.15 ns/op
BenchmarkDecodeFuncCallOverheadArrayCall	200000000	         9.76 ns/op
BenchmarkFmtVerboseString	   10000	    173119 ns/op
BenchmarkPacketString	   50000	     58455 ns/op
BenchmarkPacketDumpString	   50000	     58198 ns/op
BenchmarkDecodeICMP	 1000000	      1692 ns/op
BenchmarkDecodeICMP6	 1000000	      1980 ns/op
BenchmarkDecodeMPLS	 1000000	      1867 ns/op
BenchmarkDecodePPPoE_ICMPv6	 1000000	      2406 ns/op
BenchmarkDecodePacketIPSecESP	 1000000	      1516 ns/op
ok  	code.google.com/p/gopacket/layers	83.607s

PCAP BENCHMARK
Local pcap file /tmp/gopacket_benchmark.pcap doesn't exist, reading from http://www.ll.mit.edu/mission/communications/cyber/CSTcorpora/ideval/data/1999/training/week1/tuesday/inside.tcpdump.gz
Successfully read 341401548 bytes from url, unzipped to local storage
Reading file once through to hopefully cache most of it
Read in file /tmp/gopacket_benchmark.pcap , total of 341401548 bytes
Opening file "/tmp/gopacket_benchmark.pcap" for read
Reading all packets into memory with BufferPacketSource.
Reading packet data into memory: 1237119 packets in 949.154065ms, 767ns per packet
Time to read packet data into memory from file: 949.182945ms
Benchmarking decode 1/10
	Read in 1237119 packets in 1.764314354s, 1.426us per packet
Benchmarking decode 2/10
	Read in 1237119 packets in 1.518063063s, 1.227us per packet
Benchmarking decode 3/10
	Read in 1237119 packets in 1.56021317s, 1.261us per packet
Benchmarking decode 4/10
	Read in 1237119 packets in 1.602134797s, 1.295us per packet
Benchmarking decode 5/10
	Read in 1237119 packets in 1.604758522s, 1.297us per packet
Benchmarking decode 6/10
	Read in 1237119 packets in 1.583547905s, 1.28us per packet
Benchmarking decode 7/10
	Read in 1237119 packets in 1.561558827s, 1.262us per packet
Benchmarking decode 8/10
	Read in 1237119 packets in 1.640037612s, 1.325us per packet
Benchmarking decode 9/10
	Read in 1237119 packets in 1.757084824s, 1.42us per packet
Benchmarking decode 10/10
	Read in 1237119 packets in 1.675972214s, 1.354us per packet
----------------------------------------------------------
BENCHMARKING AGAINST COMMIT 7556c6c5158ed6f6ba7174825ef5b05d8d4a6fdc
----------------------------------------------------------

OLD TEST BENCHMARKS
PASS
BenchmarkTypeAssertion	500000000	         4.09 ns/op
BenchmarkMapLookup	500000000	         4.26 ns/op
BenchmarkNilMapLookup	500000000	         3.79 ns/op
BenchmarkNilMapLookupWithNilCheck	2000000000	         0.94 ns/op
BenchmarkArrayLookup	2000000000	         0.63 ns/op
BenchmarkTypeToInterface1	2000000000	         0.94 ns/op
BenchmarkTypeToInterface2	2000000000	         0.64 ns/op
BenchmarkPassDecodeOptionsByValue	2000000000	         0.31 ns/op
BenchmarkPassDecodeOptionsByPointer	2000000000	         0.31 ns/op
BenchmarkLockOSThread	500000000	         4.80 ns/op
BenchmarkUnlockOSThread	500000000	         5.36 ns/op
BenchmarkLockUnlockOSThread	100000000	        11.0 ns/op
BenchmarkLockDeferUnlockOSThread	50000000	        69.6 ns/op
BenchmarkUnbufferedChannel	10000000	       300 ns/op
BenchmarkSmallBufferedChannel	 5000000	       364 ns/op
BenchmarkLargeBufferedChannel	 5000000	       365 ns/op
BenchmarkEndpointFastHashShort	100000000	        19.1 ns/op
BenchmarkEndpointFastHashLong	50000000	        41.0 ns/op
BenchmarkFlowFastHashShort	100000000	        26.3 ns/op
BenchmarkFlowFastHashLong	50000000	        70.5 ns/op
ok  	code.google.com/p/gopacket	44.046s
PASS
BenchmarkLayerClassSliceContains	2000000000	         1.26 ns/op
BenchmarkLayerClassMapContains	500000000	         4.67 ns/op
BenchmarkLazyNoCopyEthLayer	 1000000	      1038 ns/op
BenchmarkLazyNoCopyIPLayer	 1000000	      1645 ns/op
BenchmarkLazyNoCopyTCPLayer	 1000000	      2573 ns/op
BenchmarkLazyNoCopyAllLayers	 1000000	      2794 ns/op
BenchmarkDefault	 1000000	      3246 ns/op
BenchmarkSerializeTcpNoOptions	10000000	       281 ns/op
BenchmarkSerializeTcpFixLengths	10000000	       289 ns/op
BenchmarkSerializeTcpComputeChecksums	 5000000	       670 ns/op
BenchmarkSerializeTcpFixLengthsComputeChecksums	 5000000	       676 ns/op
BenchmarkLazy	 1000000	      1328 ns/op
BenchmarkNoCopy	 1000000	      2461 ns/op
BenchmarkLazyNoCopy	 5000000	       563 ns/op
BenchmarkKnownStack	10000000	       233 ns/op
BenchmarkDecodingLayerParserIgnorePanic	10000000	       284 ns/op
BenchmarkDecodingLayerParserHandlePanic	 5000000	       359 ns/op
BenchmarkAlloc	50000000	        37.7 ns/op
BenchmarkFlow	50000000	        46.8 ns/op
BenchmarkEndpoints	50000000	        58.4 ns/op
BenchmarkTCPLayerFromDecodedPacket	100000000	        13.7 ns/op
BenchmarkTCPLayerClassFromDecodedPacket	50000000	        42.0 ns/op
BenchmarkTCPTransportLayerFromDecodedPacket	500000000	         3.45 ns/op
BenchmarkDecodeFuncCallOverheadDirectCall	2000000000	         1.27 ns/op
BenchmarkDecodeFuncCallOverheadDecoderCall	500000000	         7.25 ns/op
BenchmarkDecodeFuncCallOverheadArrayCall	100000000	        11.3 ns/op
BenchmarkFmtVerboseString	   10000	    200931 ns/op
BenchmarkPacketString	   50000	     68417 ns/op
BenchmarkPacketDumpString	   50000	     67297 ns/op
BenchmarkDecodeICMP	 1000000	      1930 ns/op
BenchmarkDecodeICMP6	 1000000	      2181 ns/op
BenchmarkDecodeMPLS	 1000000	      2144 ns/op
BenchmarkDecodePPPoE_ICMPv6	 1000000	      2754 ns/op
BenchmarkDecodePacketIPSecESP	 1000000	      1658 ns/op
ok  	code.google.com/p/gopacket/layers	91.764s

OLD PCAP BENCHMARK
Reading file once through to hopefully cache most of it
Read in file /tmp/gopacket_benchmark.pcap , total of 341401548 bytes
Opening file "/tmp/gopacket_benchmark.pcap" for read
Reading all packets into memory with BufferPacketSource.
Reading packet data into memory: 1237119 packets in 925.00163ms, 747ns per packet
Time to read packet data into memory from file: 925.030333ms
Benchmarking decode 1/10
	Read in 1237119 packets in 1.865679504s, 1.508us per packet
Benchmarking decode 2/10
	Read in 1237119 packets in 1.767544157s, 1.428us per packet
Benchmarking decode 3/10
	Read in 1237119 packets in 1.806912137s, 1.46us per packet
Benchmarking decode 4/10
	Read in 1237119 packets in 1.824212874s, 1.474us per packet
Benchmarking decode 5/10
	Read in 1237119 packets in 1.845799292s, 1.492us per packet
Benchmarking decode 6/10
	Read in 1237119 packets in 1.84048428s, 1.487us per packet
Benchmarking decode 7/10
	Read in 1237119 packets in 1.834548144s, 1.482us per packet
Benchmarking decode 8/10
	Read in 1237119 packets in 1.827650238s, 1.477us per packet
Benchmarking decode 9/10
	Read in 1237119 packets in 1.83048333s, 1.479us per packet
Benchmarking decode 10/10
	Read in 1237119 packets in 1.878186782s, 1.518us per packet
Move CHANGELOG just to wiki
Update docstring to mention other subpackages and examples