social: api, doc
[oweals/gnunet.git] / src / social / social.h
index 0a9792b354eba848f4d7cfaa64908edc3c929faa..3e32a446465a474b54803c835cbbc2f995c3e176 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of GNUnet
- * Copyright (C) 2013 Christian Grothoff (and other contributing authors)
+ * Copyright (C) 2013 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
@@ -24,7 +24,7 @@
  * @author Gabor X Toth
  */
 
-#ifndef SOCIAL_H      
+#ifndef SOCIAL_H
 #define SOCIAL_H
 
 #include "platform.h"
@@ -49,6 +49,53 @@ GNUNET_NETWORK_STRUCT_BEGIN
 /**** library -> service ****/
 
 
+struct AppConnectRequest
+{
+  /**
+   * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_CONNECT
+   */
+  struct GNUNET_MessageHeader header;
+
+  /* Followed by char *app_id */
+};
+
+
+struct AppDetachRequest
+{
+  /**
+   * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_DETACH
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Public key of place.
+   */
+  struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
+
+  /**
+   * Operation ID.
+   */
+  uint64_t op_id GNUNET_PACKED;
+
+};
+
+
+struct MsgProcRequest
+{
+  /**
+   * Type: GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_SET
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * @see enum GNUNET_SOCIAL_MsgProcFlags
+   */
+  uint32_t flags;
+
+  /* Followed by char *method_prefix */
+};
+
+
 struct HostEnterRequest
 {
   /**
@@ -58,51 +105,182 @@ struct HostEnterRequest
 
   uint32_t policy GNUNET_PACKED;
 
-  struct GNUNET_CRYPTO_EcdsaPrivateKey host_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
+
+  struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
 
   struct GNUNET_CRYPTO_EddsaPrivateKey place_key;
+
+  /* Followed by char *app_id */
 };
 
 
 struct GuestEnterRequest
 {
   /**
-   * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_ADDR
+   * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER
    */
   struct GNUNET_MessageHeader header;
 
   uint32_t relay_count GNUNET_PACKED;
 
-  struct GNUNET_CRYPTO_EcdsaPrivateKey guest_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
 
-  struct GNUNET_CRYPTO_EddsaPublicKey place_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
 
   struct GNUNET_PeerIdentity origin;
 
+  uint32_t flags GNUNET_PACKED;
+
+  /* Followed by char *app_id */
   /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
+  /* Followed by struct GNUNET_MessageHeader *join_msg */
+};
+
+
+/** Compatible parts of HostEnterRequest and GuestEnterRequest */
+struct PlaceEnterRequest
+{
+  struct GNUNET_MessageHeader header;
+
+  uint32_t reserved GNUNET_PACKED;
+
+  struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
+
+  struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
+};
+
+
+struct EgoPlacePublicKey
+{
+  struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
+};
+
+
+struct GuestEnterByNameRequest
+{
+  /**
+   * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_BY_NAME
+   */
+  struct GNUNET_MessageHeader header;
+
+  struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
+
+  /* Followed by char *app_id */
+  /* Followed by char *gns_name */
+  /* Followed by char *password */
+  /* Followed by struct GNUNET_MessageHeader *join_msg */
+};
 
-  /* Followed by struct GNUNET_MessageHeader join_msg */
+
+struct ZoneAddPlaceRequest
+{
+  struct GNUNET_MessageHeader header;
+
+  uint32_t relay_count GNUNET_PACKED;
+
+  /**
+   * Operation ID.
+   */
+  uint64_t op_id;
+
+  /**
+   * Expiration time: absolute value in us.
+   */
+  uint64_t expiration_time;
+
+  struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
+
+  struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
+
+  struct GNUNET_PeerIdentity origin;
+
+  /* Followed by const char *name */
+  /* Followed by const char *password */
+  /* Followed by  struct GNUNET_PeerIdentity *relays[relay_count] */
+};
+
+
+struct ZoneAddNymRequest
+{
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Operation ID.
+   */
+  uint64_t op_id;
+
+  /**
+   * Expiration time: absolute value in us.
+   */
+  uint64_t expiration_time;
+
+  struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
+
+  struct GNUNET_CRYPTO_EcdsaPublicKey nym_pub_key;
+
+  /* Followed by const char *name */
 };
 
 
 /**** service -> library ****/
 
 
-#if REMOVE
-struct NymEnterRequest
+struct AppEgoMessage
 {
   /**
-   * Type: GNUNET_MESSAGE_TYPE_SOCIAL_NYM_ENTER
+   * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO
    */
   struct GNUNET_MessageHeader header;
+
   /**
-   * Public key of the joining slave.
+   * Public key of ego.
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey nym_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
 
-  /* Followed by struct GNUNET_MessageHeader join_request */
+  /* Followed by char *name */
+};
+
+
+struct AppPlaceMessage
+{
+  /**
+   * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE
+   */
+  struct GNUNET_MessageHeader header;
+
+  struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
+
+  struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
+
+  uint8_t is_host;
+
+  uint8_t place_state;
+};
+
+
+struct HostEnterAck {
+  /**
+   * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Status code for the operation.
+   */
+  uint32_t result_code GNUNET_PACKED;
+
+  /**
+   * Last message ID sent to the channel.
+   */
+  uint64_t max_message_id GNUNET_PACKED;
+
+  /**
+   * Public key of the place.
+   */
+  struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
 };
-#endif
 
 
 GNUNET_NETWORK_STRUCT_END