/*
This file is part of GNUnet.
- (C) 2009, 2010, 2011, 2012, 2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009, 2010, 2011, 2012, 2013 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-
/**
* @file scalarproduct.h
* @brief Scalar Product Message Types
* @author Christian M. Fuchs
- *
- * Created on September 2, 2013, 3:43 PM
*/
-
#ifndef SCALARPRODUCT_H
#define SCALARPRODUCT_H
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
GNUNET_NETWORK_STRUCT_BEGIN
/**
* Message type passed from client to service
* to initiate a request or responder role
*/
-struct ComputationMessage
+struct AliceComputationMessage
{
/**
- * GNUNET message header
+ * GNUNET message header with type
+ * #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_TO_ALICE
*/
struct GNUNET_MessageHeader header;
};
+/**
+ * Message type passed from client to service
+ * to initiate a request or responder role
+ */
+struct BobComputationMessage
+{
+ /**
+ * GNUNET message header with type
+ * #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_TO_BOB
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * how many elements the vector in payload contains
+ */
+ uint32_t element_count_total GNUNET_PACKED;
+
+ /**
+ * contained elements the vector in payload contains
+ */
+ uint32_t element_count_contained GNUNET_PACKED;
+
+ /**
+ * Always zero.
+ */
+ uint32_t reserved GNUNET_PACKED;
+
+ /**
+ * the transaction/session key used to identify a session
+ */
+ struct GNUNET_HashCode session_key;
+
+ /**
+ * followed by struct GNUNET_SCALARPRODUCT_Element[]
+ */
+};
+
+
/**
* multipart messages following `struct ComputationMessage`
*/
-struct ComputationMultipartMessage
+struct ComputationBobCryptodataMultipartMessage
{
/**
* GNUNET message header
uint32_t product_length GNUNET_PACKED;
/**
- * status information about the outcome of this session
+ * Status information about the outcome of this session,
+ * An `enum GNUNET_SCALARPRODUCT_ResponseStatus` (in NBO).
*/
- int32_t status GNUNET_PACKED;
+ uint32_t status GNUNET_PACKED;
/**
* Workaround for libgcrypt: -1 if negative, 0 if zero, else 1
GNUNET_NETWORK_STRUCT_END
-#ifdef __cplusplus
-}
-#endif
-
#endif /* SCALARPRODUCT_H */