aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2013-07-12 09:43:07 +0000
committerGabor X Toth <*@tg-x.net>2013-07-12 09:43:07 +0000
commitde4a07bc496f9267010837edbd135d73a6518fd0 (patch)
treec554c1def8e15284541454f76f2b9104c7e8e4f4
parent0c053e7ae2e82c5664c68cddb8d1ecec8108b926 (diff)
downloadgnunet-de4a07bc496f9267010837edbd135d73a6518fd0.tar.gz
gnunet-de4a07bc496f9267010837edbd135d73a6518fd0.zip
PSYC/social: header for method callbacks
-rw-r--r--src/include/gnunet_psyc_lib.h26
-rw-r--r--src/include/gnunet_psyc_service.h10
-rw-r--r--src/include/gnunet_social_service.h14
3 files changed, 49 insertions, 1 deletions
diff --git a/src/include/gnunet_psyc_lib.h b/src/include/gnunet_psyc_lib.h
index bd8cbf025..50f346048 100644
--- a/src/include/gnunet_psyc_lib.h
+++ b/src/include/gnunet_psyc_lib.h
@@ -78,6 +78,32 @@ enum GNUNET_PSYC_Type
78}; 78};
79 79
80 80
81/**
82 * PSYC state modifier.
83 */
84struct GNUNET_PSYC_Modifier {
85 /**
86 * State operation.
87 */
88 GNUNET_PSYC_Operator oper;
89
90 /**
91 * Variable name.
92 */
93 const char *name;
94
95 /**
96 * Size of @a value.
97 */
98 size_t value_size;
99
100 /**
101 * Value of variable.
102 */
103 const void *value;
104};
105
106
81/** 107/**
82 * Get the type of variable. 108 * Get the type of variable.
83 * 109 *
diff --git a/src/include/gnunet_psyc_service.h b/src/include/gnunet_psyc_service.h
index 6987bab82..4828cc460 100644
--- a/src/include/gnunet_psyc_service.h
+++ b/src/include/gnunet_psyc_service.h
@@ -155,6 +155,8 @@ struct GNUNET_PSYC_PartHandle;
155 * @param method_name Original method name from PSYC (may be more 155 * @param method_name Original method name from PSYC (may be more
156 * specific than the registered method name due to try-and-slice matching). 156 * specific than the registered method name due to try-and-slice matching).
157 * FIXME: no try-and-slice for methods defined here. 157 * FIXME: no try-and-slice for methods defined here.
158 * @param header_length Number of modifiers in header.
159 * @param header Modifiers present in the message.
158 * @param data_off Byte offset of @a data in the overall data of the method. 160 * @param data_off Byte offset of @a data in the overall data of the method.
159 * @param data_size Number of bytes in @a data. 161 * @param data_size Number of bytes in @a data.
160 * @param data Data stream given to the method (might not be zero-terminated 162 * @param data Data stream given to the method (might not be zero-terminated
@@ -178,6 +180,8 @@ typedef int (*GNUNET_PSYC_Method)(void *cls,
178 * @param cls Closure. 180 * @param cls Closure.
179 * @param sender Who transmitted the message. 181 * @param sender Who transmitted the message.
180 * @param method_name Method name in the join request. 182 * @param method_name Method name in the join request.
183 * @param header_length Number of modifiers in header.
184 * @param header Modifiers present in the message.
181 * @param data_size Number of bytes in @a data. 185 * @param data_size Number of bytes in @a data.
182 * @param data Data stream given to the method (might not be zero-terminated 186 * @param data Data stream given to the method (might not be zero-terminated
183 * if data is binary). 187 * if data is binary).
@@ -185,6 +189,8 @@ typedef int (*GNUNET_PSYC_Method)(void *cls,
185typedef int (*GNUNET_PSYC_JoinCallback)(void *cls, 189typedef int (*GNUNET_PSYC_JoinCallback)(void *cls,
186 const struct GNUNET_PeerIdentity *sender, 190 const struct GNUNET_PeerIdentity *sender,
187 const char *method_name, 191 const char *method_name,
192 size_t header_length,
193 GNUNET_PSYC_Modifier *header,
188 size_t data_size, 194 size_t data_size,
189 const void *data, 195 const void *data,
190 struct GNUNET_PSYC_JoinHandle *jh); 196 struct GNUNET_PSYC_JoinHandle *jh);
@@ -196,6 +202,8 @@ typedef int (*GNUNET_PSYC_JoinCallback)(void *cls,
196 * @param cls Closure. 202 * @param cls Closure.
197 * @param sender Who transmitted the message. 203 * @param sender Who transmitted the message.
198 * @param method_name Method name in the part request. 204 * @param method_name Method name in the part request.
205 * @param header_length Number of modifiers in header.
206 * @param header Modifiers present in the message.
199 * @param data_size Number of bytes in @a data. 207 * @param data_size Number of bytes in @a data.
200 * @param data Data stream given to the method (might not be zero-terminated 208 * @param data Data stream given to the method (might not be zero-terminated
201 * if data is binary). 209 * if data is binary).
@@ -203,6 +211,8 @@ typedef int (*GNUNET_PSYC_JoinCallback)(void *cls,
203typedef int (*GNUNET_PSYC_PartCallback)(void *cls, 211typedef int (*GNUNET_PSYC_PartCallback)(void *cls,
204 const struct GNUNET_PeerIdentity *sender, 212 const struct GNUNET_PeerIdentity *sender,
205 const char *method_name, 213 const char *method_name,
214 size_t header_length,
215 GNUNET_PSYC_Modifier *header,
206 size_t data_size, 216 size_t data_size,
207 const void *data, 217 const void *data,
208 struct GNUNET_PSYC_PartHandle *ph); 218 struct GNUNET_PSYC_PartHandle *ph);
diff --git a/src/include/gnunet_social_service.h b/src/include/gnunet_social_service.h
index ea643de5a..1d2b2096c 100644
--- a/src/include/gnunet_social_service.h
+++ b/src/include/gnunet_social_service.h
@@ -84,6 +84,8 @@ struct GNUNET_SOCIAL_Slicer;
84 * @param message_id Unique message counter for this message 84 * @param message_id Unique message counter for this message
85 * (unique only in combination with the given sender for 85 * (unique only in combination with the given sender for
86 * this channel). 86 * this channel).
87 * @param header_length Number of modifiers in header.
88 * @param header Modifiers present in the message.
87 * @param data_off Byte offset of @a data in the overall data of the method. 89 * @param data_off Byte offset of @a data in the overall data of the method.
88 * @param data_size Number of bytes in @a data. 90 * @param data_size Number of bytes in @a data.
89 * @param data Data stream given to the method (might not be zero-terminated 91 * @param data Data stream given to the method (might not be zero-terminated
@@ -93,6 +95,8 @@ struct GNUNET_SOCIAL_Slicer;
93typedef int (*GNUNET_SOCIAL_Method)(void *cls, 95typedef int (*GNUNET_SOCIAL_Method)(void *cls,
94 const char *full_method_name, 96 const char *full_method_name,
95 uint64_t message_id, 97 uint64_t message_id,
98 size_t header_length,
99 GNUNET_PSYC_Modifier *header,
96 uint64_t data_off, 100 uint64_t data_off,
97 size_t data_size, 101 size_t data_size,
98 const void *data, 102 const void *data,
@@ -172,11 +176,15 @@ GNUNET_SOCIAL_ego_destroy (struct GNUNET_SOCIAL_Ego *ego);
172 * 176 *
173 * @param cls Closure. 177 * @param cls Closure.
174 * @param nym Handle for the user who wants to join. 178 * @param nym Handle for the user who wants to join.
179 * @param header_length Number of modifiers in header.
180 * @param header Modifiers present in the message.
175 * @param msg_size Number of bytes in @a msg. 181 * @param msg_size Number of bytes in @a msg.
176 * @param msg Payload given on enter (e.g. a password). 182 * @param msg Payload given on enter (e.g. a password).
177 */ 183 */
178typedef void (*GNUNET_SOCIAL_AnswerDoorCallback)(void *cls, 184typedef void (*GNUNET_SOCIAL_AnswerDoorCallback)(void *cls,
179 struct GNUNET_SOCIAL_Nym *nym, 185 struct GNUNET_SOCIAL_Nym *nym,
186 size_t header_length,
187 GNUNET_PSYC_Modifier *header,
180 size_t msg_size, 188 size_t msg_size,
181 const void *msg); 189 const void *msg);
182 190
@@ -189,9 +197,13 @@ typedef void (*GNUNET_SOCIAL_AnswerDoorCallback)(void *cls,
189 * 197 *
190 * @param cls Closure. 198 * @param cls Closure.
191 * @param nym Handle for the user who left. 199 * @param nym Handle for the user who left.
200 * @param header_length Number of modifiers in header.
201 * @param header Modifiers present in the message.
192 */ 202 */
193typedef void (*GNUNET_SOCIAL_FarewellCallback)(void *cls, 203typedef void (*GNUNET_SOCIAL_FarewellCallback)(void *cls,
194 struct GNUNET_SOCIAL_Nym *nym); 204 struct GNUNET_SOCIAL_Nym *nym,
205 size_t header_length,
206 GNUNET_PSYC_Modifier *header);
195 207
196 208
197/** 209/**