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