psyc/social: get state from psycstore
[oweals/gnunet.git] / src / social / social.h
1 /*
2  * This file is part of GNUnet
3  * Copyright (C) 2013 Christian Grothoff (and other contributing authors)
4  *
5  * GNUnet is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published
7  * by the Free Software Foundation; either version 3, or (at your
8  * option) any later version.
9  *
10  * GNUnet is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with GNUnet; see the file COPYING.  If not, write to the
17  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20
21 /**
22  * @file social/social.h
23  * @brief Common type definitions for the Social service and API.
24  * @author Gabor X Toth
25  */
26
27 #ifndef SOCIAL_H      
28 #define SOCIAL_H
29
30 #include "platform.h"
31 #include "gnunet_social_service.h"
32
33 enum MessageState
34 {
35   MSG_STATE_START    = 0,
36   MSG_STATE_HEADER   = 1,
37   MSG_STATE_METHOD   = 2,
38   MSG_STATE_MODIFIER = 3,
39   MSG_STATE_MOD_CONT = 4,
40   MSG_STATE_DATA     = 5,
41   MSG_STATE_END      = 6,
42   MSG_STATE_CANCEL   = 7,
43   MSG_STATE_ERROR    = 8,
44 };
45
46
47 GNUNET_NETWORK_STRUCT_BEGIN
48
49 /**** library -> service ****/
50
51
52 struct HostEnterRequest
53 {
54   /**
55    * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER
56    */
57   struct GNUNET_MessageHeader header;
58
59   uint32_t policy GNUNET_PACKED;
60
61   struct GNUNET_CRYPTO_EcdsaPrivateKey host_key;
62
63   struct GNUNET_CRYPTO_EddsaPrivateKey place_key;
64 };
65
66
67 struct GuestEnterRequest
68 {
69   /**
70    * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_ADDR
71    */
72   struct GNUNET_MessageHeader header;
73
74   uint32_t relay_count GNUNET_PACKED;
75
76   struct GNUNET_CRYPTO_EcdsaPrivateKey guest_key;
77
78   struct GNUNET_CRYPTO_EddsaPublicKey place_key;
79
80   struct GNUNET_PeerIdentity origin;
81
82   /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
83
84   /* Followed by struct GNUNET_MessageHeader join_msg */
85 };
86
87
88 /**** service -> library ****/
89
90
91 #if REMOVE
92 struct NymEnterRequest
93 {
94   /**
95    * Type: GNUNET_MESSAGE_TYPE_SOCIAL_NYM_ENTER
96    */
97   struct GNUNET_MessageHeader header;
98   /**
99    * Public key of the joining slave.
100    */
101   struct GNUNET_CRYPTO_EcdsaPublicKey nym_key;
102
103   /* Followed by struct GNUNET_MessageHeader join_request */
104 };
105 #endif
106
107
108 GNUNET_NETWORK_STRUCT_END
109
110 #endif