psyc/social: transmit/announcement flags; multicast: re-added sig. purpose
authorGabor X Toth <*@tg-x.net>
Mon, 12 Aug 2013 17:45:22 +0000 (17:45 +0000)
committerGabor X Toth <*@tg-x.net>
Mon, 12 Aug 2013 17:45:22 +0000 (17:45 +0000)
src/include/gnunet_multicast_service.h
src/include/gnunet_psyc_service.h
src/include/gnunet_social_service.h

index 418afd34bca11a14c869cee5a3b988e1ca5d6b9c..b4f9bc099bbbf3940ceb3ad3bb194d0123242dcd 100644 (file)
@@ -170,6 +170,11 @@ struct GNUNET_MULTICAST_MessageHeader
    */
   struct GNUNET_CRYPTO_EccSignature signature;
 
+  /** 
+   * Purpose for the signature and size of the signed data.
+   */
+  struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+
   /** 
    * Number of the message fragment, monotonically increasing.
    */
@@ -243,6 +248,11 @@ struct GNUNET_MULTICAST_RequestHeader
    */
   struct GNUNET_CRYPTO_EccSignature signature;
 
+  /** 
+   * Purpose for the signature and size of the signed data.
+   */
+  struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+
   /** 
    * Number of the request fragment, monotonically increasing.
    */
@@ -291,6 +301,11 @@ struct GNUNET_MULTICAST_JoinRequest {
    */
   struct GNUNET_CRYPTO_EccSignature signature;
 
+  /** 
+   * Purpose for the signature and size of the signed data.
+   */
+  struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+
   /**
    * Public key of the target group.
    */
index 3c01ab4805d95e9f7245235b737a536ff2ecf87d..ceb8290c27f0d31d73f35df3bf48c91398562fb5 100644 (file)
@@ -287,6 +287,26 @@ typedef int
                                  void *data);
 
 
+
+/**
+ * Flags for transmitting messages to a channel by the master.
+ */
+enum GNUNET_PSYC_MasterTransmitFlags
+{
+  /** 
+   * Whether this message should reset the channel state,
+   * i.e. remove all previously stored state variables.
+   */
+  GNUNET_PSYC_MASTER_TRANSMIT_RESET_STATE = 1 << 0,
+
+  /** 
+   * Whether we need to increment the group generation counter after
+   * transmitting this message.
+   */
+  GNUNET_PSYC_MASTER_TRANSMIT_INC_GROUP_GEN = 1 << 1,
+};
+
+
 /** 
  * Handle for a pending PSYC transmission operation.
  */
@@ -302,11 +322,7 @@ struct GNUNET_PSYC_MasterTransmitHandle;
  *            for the message, or NULL.
  * @param notify Function to call to obtain the arguments.
  * @param notify_cls Closure for @a notify.
- * @param reset_state #GNUNET_YES if this message should reset the channel
- *        state, i.e. remove all previously stored state variables.
- *        #GNUNET_NO to keep the state as is.
- * @param increment_group_generation #GNUNET_YES if we need to increment
- *        the group generation counter after transmitting this message.
+ * @param flags Flags for the message being transmitted.
  * @return Transmission handle, NULL on error (i.e. more than one request queued).
  */
 struct GNUNET_PSYC_MasterTransmitHandle *
@@ -315,8 +331,7 @@ GNUNET_PSYC_master_transmit (struct GNUNET_PSYC_Master *master,
                              const struct GNUNET_ENV_Environment *env,
                              GNUNET_PSYC_MasterReadyNotify notify,
                              void *notify_cls,
-                             int reset_state,
-                             int increment_group_generation);
+                             enum GNUNET_PSYC_TransmitFlags flags);
 
 
 /** 
index 079290a3aec8c620dfed857c41ae236e7d9c3f12..8a7e1362d1f418772206e2cd670e6353b7d8ae8e 100644 (file)
@@ -331,6 +331,21 @@ GNUNET_SOCIAL_home_advertise (struct GNUNET_SOCIAL_Home *home,
                               GNUNET_TIME_Relative expiration_time);
 
 
+/**
+ * Flags for announcements in a home.
+ */
+enum GNUNET_PSYC_AnnouncementFlags
+{
+  /** 
+   * Whether this announcement removes all objects from the home.
+   * 
+   * New objects can be still added to the now empty home using the @e env
+   * parameter of the same announcement.
+   */
+  GNUNET_SOCIAL_ANNOUNCEMENT_CLEAR_OBJECTS = 1 << 0,
+};
+
+
 /** 
  * Handle for an announcement request.
  */
@@ -349,8 +364,7 @@ struct GNUNET_SOCIAL_Announcement;
  *        objects of the home, or NULL.
  * @param notify Function to call to get the payload of the announcement.
  * @param notify_cls Closure for @a notify.
- * @param clear_objects #GNUNET_YES to remove all objects from the home, #GNUNET_NO otherwise.
- *        New objects can be added to the now empty home using the @a env parameter.
+ * @param flags Flags for this announcement.
  * @return NULL on error (announcement already in progress?).
  */
 struct GNUNET_SOCIAL_Announcement *
@@ -359,7 +373,7 @@ GNUNET_SOCIAL_home_announce (struct GNUNET_SOCIAL_Home *home,
                              const struct GNUNET_ENV_Environment *env,
                              GNUNET_CONNECTION_TransmitReadyNotify notify,
                              void *notify_cls,
-                             int clear_objects);
+                             GNUNET_SOCIAL_AnnouncementFlags flags);
 
 
 /**