Fix up some documentation.

This commit is contained in:
Keith J. Jones 2019-10-28 09:29:35 -04:00
parent 505ed8f32f
commit 05788a2c02

View file

@ -14,7 +14,7 @@
namespace file_analysis { namespace file_analysis {
/** /**
* An analyzer to produce a hash of file contents. * An analyzer to produce entropy of file contents.
*/ */
class Entropy : public file_analysis::Analyzer { class Entropy : public file_analysis::Analyzer {
public: public:
@ -25,16 +25,16 @@ public:
~Entropy() override; ~Entropy() override;
/** /**
* Create a new instance of an Extract analyzer. * Create a new instance of an Entropy analyzer.
* @param args the \c AnalyzerArgs value which represents the analyzer. * @param args the \c AnalyzerArgs value which represents the analyzer.
* @param file the file to which the analyzer will be attached. * @param file the file to which the analyzer will be attached.
* @return the new Extract analyzer instance or a null pointer if the * @return the new Entropy analyzer instance or a null pointer if the
* the "extraction_file" field of \a args wasn't set. * the "extraction_file" field of \a args wasn't set.
*/ */
static file_analysis::Analyzer* Instantiate(RecordVal* args, File* file); static file_analysis::Analyzer* Instantiate(RecordVal* args, File* file);
/** /**
* Incrementally hash next chunk of file contents. * Calculate entropy of next chunk of file contents.
* @param data pointer to start of a chunk of a file data. * @param data pointer to start of a chunk of a file data.
* @param len number of bytes in the data chunk. * @param len number of bytes in the data chunk.
* @return false if the digest is in an invalid state, else true. * @return false if the digest is in an invalid state, else true.
@ -42,14 +42,14 @@ public:
bool DeliverStream(const u_char* data, uint64_t len) override; bool DeliverStream(const u_char* data, uint64_t len) override;
/** /**
* Finalizes the hash and raises a "file_entropy_test" event. * Finalizes the calculation and raises a "file_entropy_test" event.
* @return always false so analyze will be deteched from file. * @return always false so analyze will be detached from file.
*/ */
bool EndOfFile() override; bool EndOfFile() override;
/** /**
* Missing data can't be handled, so just indicate the this analyzer should * Missing data can't be handled, so just indicate the this analyzer should
* be removed from receiving further data. The hash will not be finalized. * be removed from receiving further data. The entropy will not be finalized.
* @param offset byte offset in file at which missing chunk starts. * @param offset byte offset in file at which missing chunk starts.
* @param len number of missing bytes. * @param len number of missing bytes.
* @return always false so analyzer will detach from file. * @return always false so analyzer will detach from file.
@ -68,8 +68,8 @@ protected:
Entropy(RecordVal* args, File* file); Entropy(RecordVal* args, File* file);
/** /**
* If some file contents have been seen, finalizes the hash of them and * If some file contents have been seen, finalizes the entropy of them and
* raises the "file_hash" event with the results. * raises the "file_entropy" event with the results.
*/ */
void Finalize(); void Finalize();