diff options
author | Omar Tarabai <tarabai@devegypt.com> | 2014-06-25 19:29:54 +0000 |
---|---|---|
committer | Omar Tarabai <tarabai@devegypt.com> | 2014-06-25 19:29:54 +0000 |
commit | df0aabbb2fa9adc12b2882ce63e4587b9b4c2f27 (patch) | |
tree | a5930c0200d4f95843109d338436f30b0feec75f /src/include/gnunet_sensor_service.h | |
parent | 64dfcb49f62761c471b0fecce8afdbdd459e0bb6 (diff) | |
download | gnunet-df0aabbb2fa9adc12b2882ce63e4587b9b4c2f27.tar.gz gnunet-df0aabbb2fa9adc12b2882ce63e4587b9b4c2f27.zip |
towards sensor analysis functionality
Diffstat (limited to 'src/include/gnunet_sensor_service.h')
-rw-r--r-- | src/include/gnunet_sensor_service.h | 154 |
1 files changed, 153 insertions, 1 deletions
diff --git a/src/include/gnunet_sensor_service.h b/src/include/gnunet_sensor_service.h index 5a4aa82c2..cd840dd75 100644 --- a/src/include/gnunet_sensor_service.h +++ b/src/include/gnunet_sensor_service.h | |||
@@ -44,9 +44,161 @@ extern "C" | |||
44 | struct GNUNET_SENSOR_Handle; | 44 | struct GNUNET_SENSOR_Handle; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Structure containing sensor definition | ||
48 | */ | ||
49 | struct SensorInfo | ||
50 | { | ||
51 | |||
52 | /** | ||
53 | * The configuration handle | ||
54 | * carrying sensor information | ||
55 | */ | ||
56 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
57 | |||
58 | /* | ||
59 | * Sensor name | ||
60 | */ | ||
61 | char *name; | ||
62 | |||
63 | /* | ||
64 | * Path to definition file | ||
65 | */ | ||
66 | char *def_file; | ||
67 | |||
68 | /* | ||
69 | * First part of version number | ||
70 | */ | ||
71 | uint16_t version_major; | ||
72 | |||
73 | /* | ||
74 | * Second part of version number | ||
75 | */ | ||
76 | uint16_t version_minor; | ||
77 | |||
78 | /* | ||
79 | * Sensor description | ||
80 | */ | ||
81 | char *description; | ||
82 | |||
83 | /* | ||
84 | * Sensor currently enabled | ||
85 | */ | ||
86 | int enabled; | ||
87 | |||
88 | /* | ||
89 | * Category under which the sensor falls (e.g. tcp, datastore) | ||
90 | */ | ||
91 | char *category; | ||
92 | |||
93 | /* | ||
94 | * When does the sensor become active | ||
95 | */ | ||
96 | struct GNUNET_TIME_Absolute *start_time; | ||
97 | |||
98 | /* | ||
99 | * When does the sensor expire | ||
100 | */ | ||
101 | struct GNUNET_TIME_Absolute *end_time; | ||
102 | |||
103 | /* | ||
104 | * Time interval to collect sensor information (e.g. every 1 min) | ||
105 | */ | ||
106 | struct GNUNET_TIME_Relative interval; | ||
107 | |||
108 | /* | ||
109 | * Lifetime of an information sample after which it is deleted from storage | ||
110 | * If not supplied, will default to the interval value | ||
111 | */ | ||
112 | struct GNUNET_TIME_Relative lifetime; | ||
113 | |||
114 | /* | ||
115 | * A set of required peer capabilities for the sensor to collect meaningful information (e.g. ipv6) | ||
116 | */ | ||
117 | char *capabilities; | ||
118 | |||
119 | /* | ||
120 | * Either "gnunet-statistics" or external "process" | ||
121 | */ | ||
122 | char *source; | ||
123 | |||
124 | /* | ||
125 | * Name of the GNUnet service that is the source for the gnunet-statistics entry | ||
126 | */ | ||
127 | char *gnunet_stat_service; | ||
128 | |||
129 | /* | ||
130 | * Name of the gnunet-statistics entry | ||
131 | */ | ||
132 | char *gnunet_stat_name; | ||
133 | |||
134 | /** | ||
135 | * Handle to statistics get request (OR GNUNET_SCHEDULER_NO_TASK) | ||
136 | */ | ||
137 | struct GNUNET_STATISTICS_GetHandle *gnunet_stat_get_handle; | ||
138 | |||
139 | /* | ||
140 | * Name of the external process to be executed | ||
141 | */ | ||
142 | char *ext_process; | ||
143 | |||
144 | /* | ||
145 | * Arguments to be passed to the external process | ||
146 | */ | ||
147 | char *ext_args; | ||
148 | |||
149 | /* | ||
150 | * Handle to the external process | ||
151 | */ | ||
152 | struct GNUNET_OS_CommandHandle *ext_cmd; | ||
153 | |||
154 | /* | ||
155 | * Did we already receive a value | ||
156 | * from the currently running external | ||
157 | * proccess ? #GNUNET_YES / #GNUNET_NO | ||
158 | */ | ||
159 | int ext_cmd_value_received; | ||
160 | |||
161 | /* | ||
162 | * The output datatype to be expected | ||
163 | */ | ||
164 | char *expected_datatype; | ||
165 | |||
166 | /* | ||
167 | * Peer-identity of peer running collection point | ||
168 | */ | ||
169 | struct GNUNET_PeerIdentity *collection_point; | ||
170 | |||
171 | /* | ||
172 | * Time interval to send sensor information to collection point (e.g. every 30 mins) | ||
173 | */ | ||
174 | struct GNUNET_TIME_Relative *collection_interval; | ||
175 | |||
176 | /* | ||
177 | * Flag specifying if value is to be communicated to the p2p network | ||
178 | */ | ||
179 | int p2p_report; | ||
180 | |||
181 | /* | ||
182 | * Time interval to communicate value to the p2p network | ||
183 | */ | ||
184 | struct GNUNET_TIME_Relative *p2p_interval; | ||
185 | |||
186 | /* | ||
187 | * Execution task (OR GNUNET_SCHEDULER_NO_TASK) | ||
188 | */ | ||
189 | GNUNET_SCHEDULER_TaskIdentifier execution_task; | ||
190 | |||
191 | /* | ||
192 | * Is the sensor being executed | ||
193 | */ | ||
194 | int running; | ||
195 | |||
196 | }; | ||
197 | |||
198 | /** | ||
47 | * Structure containing brief info about sensor | 199 | * Structure containing brief info about sensor |
48 | */ | 200 | */ |
49 | struct SensorInfoShort //FIXME: rename | 201 | struct SensorInfoShort |
50 | { | 202 | { |
51 | 203 | ||
52 | /* | 204 | /* |