X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fset%2Fset.h;h=258e2bff9de2c69abf40c03fddab46aeef18743e;hb=dda2c14c04b6ef6275934e752c6952f9e35dbf44;hp=944881b630d644390ec99b01d616a9e83f75a794;hpb=e98619f67a3e1ddf4962c20f77c7a1a669345eaa;p=oweals%2Fgnunet.git diff --git a/src/set/set.h b/src/set/set.h index 944881b63..258e2bff9 100644 --- a/src/set/set.h +++ b/src/set/set.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2012, 2013 Christian Grothoff (and other contributing authors) + Copyright (C) 2012-2014 GNUnet e.V. GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /** * @file set/set.h @@ -28,6 +28,7 @@ #include "platform.h" #include "gnunet_common.h" +#include "gnunet_set_service.h" GNUNET_NETWORK_STRUCT_BEGIN @@ -101,6 +102,30 @@ struct GNUNET_SET_AcceptMessage * See `enum GNUNET_SET_ResultMode`. */ uint32_t result_mode GNUNET_PACKED; + + /** + * Always use delta operation instead of sending full sets, + * even it it's less efficient. + */ + uint8_t force_delta; + + /** + * Always send full sets, even if delta operations would + * be more efficient. + */ + uint8_t force_full; + + /** + * #GNUNET_YES to fail operations where Byzantine faults + * are suspected + */ + uint8_t byzantine; + + /** + * Lower bound for the set size, used only when + * byzantine mode is enabled. + */ + uint8_t byzantine_lower_bound; }; @@ -179,15 +204,45 @@ struct GNUNET_SET_EvaluateMessage /** * Id of our set to evaluate, chosen implicitly by the client when it - * calls #GNUNE_SET_commit(). + * calls #GNUNET_SET_commit(). */ uint32_t request_id GNUNET_PACKED; + /** + * Always use delta operation instead of sending full sets, + * even it it's less efficient. + */ + uint8_t force_delta; + + /** + * Always send full sets, even if delta operations would + * be more efficient. + */ + uint8_t force_full; + + /** + * #GNUNET_YES to fail operations where Byzantine faults + * are suspected + */ + uint8_t byzantine; + + /** + * Lower bound for the set size, used only when + * byzantine mode is enabled. + */ + uint8_t byzantine_lower_bound; + /* rest: context message, that is, application-specific message to convince listener to pick up */ }; +/** + * Message sent by the service to the client to indicate an + * element that is removed (set intersection) or added + * (set union) or part of the final result, depending on + * options specified for the operation. + */ struct GNUNET_SET_ResultMessage { /** @@ -195,6 +250,11 @@ struct GNUNET_SET_ResultMessage */ struct GNUNET_MessageHeader header; + /** + * Current set size. + */ + uint64_t current_size; + /** * id the result belongs to */ @@ -207,8 +267,7 @@ struct GNUNET_SET_ResultMessage uint16_t result_status GNUNET_PACKED; /** - * Type of the element attachted to the message, - * if any. + * Type of the element attachted to the message, if any. */ uint16_t element_type GNUNET_PACKED; @@ -267,7 +326,7 @@ struct GNUNET_SET_CancelMessage struct GNUNET_SET_IterResponseMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_SET_ITER_RESPONSE + * Type: #GNUNET_MESSAGE_TYPE_SET_ITER_ELEMENT */ struct GNUNET_MessageHeader header; @@ -303,6 +362,41 @@ struct GNUNET_SET_IterAckMessage uint32_t send_more; }; + +/** + * Server responds to a lazy copy request. + */ +struct GNUNET_SET_CopyLazyResponseMessage +{ + /** + * Type: #GNUNET_MESSAGE_TYPE_SET_COPY_LAZY_RESPONSE + */ + struct GNUNET_MessageHeader header; + + /** + * Temporary name for the copied set. + */ + uint32_t cookie; +}; + + +/** + * Client connects to a lazily copied set. + */ +struct GNUNET_SET_CopyLazyConnectMessage +{ + /** + * Type: #GNUNET_MESSAGE_TYPE_SET_COPY_LAZY_CONNECT + */ + struct GNUNET_MessageHeader header; + + /** + * Temporary name for the copied set. + */ + uint32_t cookie; +}; + + GNUNET_NETWORK_STRUCT_END #endif