aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorOmar Tarabai <tarabai@devegypt.com>2014-08-05 16:27:13 +0000
committerOmar Tarabai <tarabai@devegypt.com>2014-08-05 16:27:13 +0000
commitd5d82faf0c8ef87b9bd4171f3e880ff006ec693c (patch)
treed55cdf69e6e3e33f9709db2f120ae36f529305d9 /src/include
parent8a9baa7ae446c2eacb18a5290c98ae59bc2ad857 (diff)
downloadgnunet-d5d82faf0c8ef87b9bd4171f3e880ff006ec693c.tar.gz
gnunet-d5d82faf0c8ef87b9bd4171f3e880ff006ec693c.zip
sensor: towards anomaly reporting
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_protocols.h5
-rw-r--r--src/include/gnunet_sensor_util_lib.h38
2 files changed, 43 insertions, 0 deletions
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index ea295197c..246f7f836 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -2447,6 +2447,11 @@ extern "C"
2447 */ 2447 */
2448#define GNUNET_MESSAGE_TYPE_SENSOR_FULL 808 2448#define GNUNET_MESSAGE_TYPE_SENSOR_FULL 808
2449 2449
2450/**
2451 * Sensor anomaly report
2452 */
2453#define GNUNET_MESSAGE_TYPE_SENSOR_ANOMALY_REPORT 809
2454
2450 2455
2451/******************************************************************************* 2456/*******************************************************************************
2452 * PEERSTORE message types 2457 * PEERSTORE message types
diff --git a/src/include/gnunet_sensor_util_lib.h b/src/include/gnunet_sensor_util_lib.h
index b497d05d6..3ff6097c7 100644
--- a/src/include/gnunet_sensor_util_lib.h
+++ b/src/include/gnunet_sensor_util_lib.h
@@ -297,6 +297,44 @@ struct GNUNET_SENSOR_SensorFullMessage
297 297
298}; 298};
299 299
300/**
301 * Message carrying an anomaly status change report
302 */
303struct AnomalyReportMessage
304{
305
306 /**
307 * Message header
308 */
309 struct GNUNET_MessageHeader header;
310
311 /**
312 * Hash of sensor name
313 */
314 struct GNUNET_HashCode sensorname_hash;
315
316 /**
317 * First part of sensor version number
318 */
319 uint16_t sensorversion_major;
320
321 /**
322 * Second part of sensor version name
323 */
324 uint16_t sensorversion_minor;
325
326 /**
327 * New anomaly status
328 */
329 uint8_t anomalous;
330
331 /**
332 * Percentage of neighbors reported the same anomaly
333 */
334 float anomalous_neighbors;
335
336};
337
300GNUNET_NETWORK_STRUCT_END 338GNUNET_NETWORK_STRUCT_END
301 339
302/** 340/**