From 29f73bb496a579a5a7600b3e3b2ab88b859bee65 Mon Sep 17 00:00:00 2001 From: Omar Tarabai Date: Fri, 25 Jul 2014 18:02:46 +0000 Subject: sensor: towards update functionality --- src/include/gnunet_protocols.h | 10 ++++++++ src/include/gnunet_sensor_util_lib.h | 46 ++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) (limited to 'src/include') diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index a95c0107a..4063b2efd 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h @@ -2438,6 +2438,16 @@ extern "C" */ #define GNUNET_MESSAGE_TYPE_SENSOR_BRIEF 806 +/** + * Request for full sensor information + */ +#define GNUNET_MESSAGE_TYPE_SENSOR_FULL_REQ 807 + +/** + * Full sensor information + */ +#define GNUNET_MESSAGE_TYPE_SENSOR_FULL 808 + /******************************************************************************* * PEERSTORE message types diff --git a/src/include/gnunet_sensor_util_lib.h b/src/include/gnunet_sensor_util_lib.h index 1e5108d29..a9651bc1b 100644 --- a/src/include/gnunet_sensor_util_lib.h +++ b/src/include/gnunet_sensor_util_lib.h @@ -258,9 +258,55 @@ struct GNUNET_SENSOR_SensorBriefMessage }; +/** + * Used to communicate full information about a sensor. + */ +struct GNUNET_SENSOR_SensorFullMessage +{ + + /** + * GNUNET general message header. + */ + struct GNUNET_MessageHeader header; + + /** + * Size of the config file carrying full sensor information. + * Allocated at position 0 after this struct. + */ + uint16_t cfg_size; + + /** + * Name of the file (usually script) associated with this sensor. + * At the moment we only support having one file since that's all our sensors + * need at the moment. + * The file name is allocated at position 1 after this struct. + */ + uint16_t scriptname_size; + + /** + * Size of the file (usually script) associated with this sensor. + * The file binary is allocated at position 2 after this struct. + */ + uint16_t script_size; + +}; + GNUNET_NETWORK_STRUCT_END +/** + * Given two version numbers as major and minor, compare them. + * + * @param v1_major First part of first version number + * @param v1_minor Second part of first version number + * @param v2_major First part of second version number + * @param v2_minor Second part of second version number + */ +int +GNUNET_SENSOR_version_compare (uint16_t v1_major, uint16_t v1_minor, + uint16_t v2_major, uint16_t v2_minor); + + /** * Reads sensor definitions from local data files * -- cgit v1.2.3