sensor: merged reporting module
[oweals/gnunet.git] / src / sensor / sensor.h
index 044adac697086669cc80950794c48e5122fed373..5d75ee42780a7dd9ead3c50d2695ef3d82c5a51b 100644 (file)
 
 
 GNUNET_NETWORK_STRUCT_BEGIN
-
 /**
  * Carries a summary of a sensor
  *
  */
-struct SensorInfoMessage
+    struct SensorInfoMessage
 {
   /**
    * Message header
@@ -62,38 +61,54 @@ struct SensorInfoMessage
 };
 
 GNUNET_NETWORK_STRUCT_END
-
-/*
+/**
  * Stop the sensor analysis module
  */
-void SENSOR_analysis_stop();
+    void
+SENSOR_analysis_stop ();
 
-/*
+
+/**
  * Start the sensor analysis module
  *
  * @param c our service configuration
- * @param sensors_mhm multihashmap of loaded sensors
+ * @param sensors multihashmap of loaded sensors
  * @return #GNUNET_OK if started successfully, #GNUNET_SYSERR otherwise
  */
 int
-SENSOR_analysis_start(const struct GNUNET_CONFIGURATION_Handle *c,
-    struct GNUNET_CONTAINER_MultiHashMap *sensors_mhm);
+SENSOR_analysis_start (const struct GNUNET_CONFIGURATION_Handle *c,
+                       struct GNUNET_CONTAINER_MultiHashMap *sensors);
+
 
 /**
- * Stop sensor reporting module
+ * Stop sensor anomaly reporting module
  */
-void SENSOR_reporting_stop();
+void
+SENSOR_reporting_stop ();
 
 /**
- * Start the sensor reporting module
+ * Used by the analysis module to tell the reporting module about a change in
+ * the anomaly status of a sensor.
+ *
+ * @param sensor Related sensor
+ * @param anomalous The new sensor anomalous status
+ */
+void
+SENSOR_reporting_anomaly_update (struct GNUNET_SENSOR_SensorInfo *sensor,
+                                 int anomalous);
+
+
+/**
+ * Start the sensor anomaly reporting module
  *
  * @param c our service configuration
- * @param sensors multihashmap of loaded sensors
+ * @param s multihashmap of loaded sensors
  * @return #GNUNET_OK if started successfully, #GNUNET_SYSERR otherwise
  */
 int
-SENSOR_reporting_start(const struct GNUNET_CONFIGURATION_Handle *c,
-    struct GNUNET_CONTAINER_MultiHashMap *sensors);
+SENSOR_reporting_start (const struct GNUNET_CONFIGURATION_Handle *c,
+                                struct GNUNET_CONTAINER_MultiHashMap *s);
+
 
 /**
  * Stop the sensor update module
@@ -101,14 +116,15 @@ SENSOR_reporting_start(const struct GNUNET_CONFIGURATION_Handle *c,
 void
 SENSOR_update_stop ();
 
+
 /**
  * Start the sensor update module
  *
  * @param c our service configuration
- * @param sensors multihashmap of loaded sensors
+ * @param s multihashmap of loaded sensors
+ * @param cb callback to reset service components when we have new updates
  * @return #GNUNET_OK if started successfully, #GNUNET_SYSERR otherwise
  */
 int
 SENSOR_update_start (const struct GNUNET_CONFIGURATION_Handle *c,
-                     struct GNUNET_CONTAINER_MultiHashMap *sensors);
-
+                     struct GNUNET_CONTAINER_MultiHashMap *s, void (*cb) ());