+void *
+GNUNET_SERVER_client_get_user_context_ (struct GNUNET_SERVER_Client *client,
+ size_t size)
+{
+ if ((0 == client->user_context_size) &&
+ (NULL == client->user_context))
+ return NULL; /* never set */
+ GNUNET_assert (size == client->user_context_size);
+ return client->user_context;
+}
+
+
+/**
+ * Set user context to be associated with the given client.
+ * Note: you should probably use the macro (call without the underscore).
+ *
+ * @param client client to query
+ * @param ptr pointer to user context
+ * @param size number of bytes in user context struct (for verification only)
+ */
+void
+GNUNET_SERVER_client_set_user_context_ (struct GNUNET_SERVER_Client *client,
+ void *ptr,
+ size_t size)
+{
+ if (NULL == ptr)
+ {
+ client->user_context_size = 0;
+ client->user_context = ptr;
+ return;
+ }
+ client->user_context_size = size;
+ client->user_context = ptr;
+}