code: func TCP(checkers ...TransportChecker) NetworkChecker {
  	return func(t *testing.T, h []header.Network) {
  		t.Helper()
  
  		first := h[0]
  		last := h[len(h)-1]
  
  		if p := last.TransportProtocol(); p != header.TCPProtocolNumber {
  			t.Errorf("Bad protocol, got %v, want %v", p, header.TCPProtocolNumber)
  		}
  
  		// Verify the checksum.
  		tcp := header.TCP(last.Payload())
  		l := uint16(len(tcp))
  
  		xsum := header.Checksum([]byte(first.SourceAddress()), 0)
  		xsum = header.Checksum([]byte(first.DestinationAddress()), xsum)
  		xsum = header.Checksum([]byte{0, byte(last.TransportProtocol())}, xsum)
  		xsum = header.Checksum([]byte{byte(l >> 8), byte(l)}, xsum)
  		xsum = header.Checksum(tcp, xsum)
  
  		if xsum != 0 && xsum != 0xffff {
  			t.Errorf("Bad checksum: 0x%x, checksum in segment: 0x%x", xsum, tcp.Checksum())
  		}
  
  		// Run the transport checkers.
  		for _, f := range checkers {
  			f(t, tcp)
  		}
  		if t.Failed() {
  			t.FailNow()
  		}
  	}
  }
docs: // TCP creates a checker that checks that the transport protocol is TCP and
  // potentially additional transport header fields.