Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 108 lines (84 sloc) 3.203 kb
e8c1018 @bcarrier Added first release of framework
bcarrier authored
1 /*
2 * The Sleuth Kit
3 *
4 * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org]
b18f7a0 @rcordovano Updated copyright notices for 2012
rcordovano authored
5 * Copyright (c) 2010-2012 Basis Technology Corporation. All Rights
e8c1018 @bcarrier Added first release of framework
bcarrier authored
6 * reserved.
7 *
8 * This software is distributed under the Common Public License 1.0
9 */
10
11 /**
12 * \file TskModule.h
13 * Contains the interface for the Module class.
14 */
15
16 #ifndef _TSK_MODULE_H
17 #define _TSK_MODULE_H
18
19 #include "File/TskFile.h"
20
21 /**
8cdaa46 @bcarrier Updated Doxygen comments
bcarrier authored
22 * Interface for classes that represent different types of modules
23 * in the pipeline. Example module types include dynamic library
24 * and executables. These modules perform some operation in the
25 * context of a TskPipeline.
e8c1018 @bcarrier Added first release of framework
bcarrier authored
26 */
27 class TSK_FRAMEWORK_API TskModule
28 {
29 public:
89a72b5 @rcordovano Changes related to TskSystemProperties enhancements.
rcordovano authored
30 /**
31 * The TskModule class supports the use of a string macro that is expanded
32 * to the path of the file currently under analysis. This macro is intended
33 * to be used in the arguments strings passed to the initialization
34 * functions of file analysis modules. "#CURRENT_FILE#" is the literal form
35 * of the macro.
36 */
37 static const std::string CURRENT_FILE_MACRO;
e8c1018 @bcarrier Added first release of framework
bcarrier authored
38
feec991 @bcarrier doc updates
bcarrier authored
39 /// Standard values that module methods can return.
e8c1018 @bcarrier Added first release of framework
bcarrier authored
40 enum Status
41 {
feec991 @bcarrier doc updates
bcarrier authored
42 OK = 0, ///< Indicates that the module sucessfully analyzed the data or was able to decide that it should not analyze the data.
43 FAIL, ///< Indicates that the module wanted to perform analysis on the data, but was unable to because of an error.
44 STOP ///< Indicates that the module wants the pipeline to stop processing.
e8c1018 @bcarrier Added first release of framework
bcarrier authored
45 };
46
47 // Default Constructor
48 TskModule();
49
50 // Virtual destructor since Module must be subclassed to be useful
51 virtual ~TskModule();
52
8448eaf @bcarrier Updated doxygen for new system properties
bcarrier authored
53 /**
54 * Method that is used to run file analysis modules.
55 * @returns Status of module
56 */
e8c1018 @bcarrier Added first release of framework
bcarrier authored
57 virtual Status run(TskFile* fileToAnalyze) = 0;
58
8448eaf @bcarrier Updated doxygen for new system properties
bcarrier authored
59 /**
60 * Method that is used to run report modules.
61 * @returns Status of module
62 */
e8c1018 @bcarrier Added first release of framework
bcarrier authored
63 virtual Status report() { return TskModule::OK; };
64
65 virtual void setPath(const std::string& location);
66
8448eaf @bcarrier Updated doxygen for new system properties
bcarrier authored
67 /**
68 * Returns the fully qualified path to the module.
69 */
e8c1018 @bcarrier Added first release of framework
bcarrier authored
70 virtual std::string getPath() const { return m_modulePath; }
71
72 /// Set the arguments to be passed to the module.
73 void setArguments(const std::string& args) { m_arguments = args; }
74
75 /// Get the arguments
76 std::string getArguments() const { return m_arguments; }
77
78 /// Get the module name
79 std::string getName() const { return m_name; }
80
b4913ed @rcordovano Added code to store plugin module name and description in the image data...
rcordovano authored
81 /// Get the module description
82 std::string getDescription() const { return m_description; }
83
84 /// Get the module version
85 std::string getVersion() const { return m_version; }
86
e8c1018 @bcarrier Added first release of framework
bcarrier authored
87 /// Set the module id
88 void setModuleId(int moduleId) { m_moduleId = moduleId; }
89
90 /// Get the module id
91 int getModuleId() const { return m_moduleId; }
92
93 protected:
94 std::string m_modulePath;
95 std::string m_arguments;
96 std::string m_name;
b4913ed @rcordovano Added code to store plugin module name and description in the image data...
rcordovano authored
97 std::string m_description;
98 std::string m_version;
e8c1018 @bcarrier Added first release of framework
bcarrier authored
99 int m_moduleId;
100
89a72b5 @rcordovano Changes related to TskSystemProperties enhancements.
rcordovano authored
101 static std::string expandArgumentMacros(const std::string &args, const TskFile *fileToAnalyze);
e8c1018 @bcarrier Added first release of framework
bcarrier authored
102
103 private:
104
105 };
106
107 #endif
Something went wrong with that request. Please try again.