HKDF (does not work yet)
[oweals/gnunet.git] / src / include / gnunet_server_lib.h
index c3d11eae1506a55381b3306ed57940d066206a97..fb6713b84eb6b1ac6ddd192e3dcfd88294a7ed83 100644 (file)
@@ -108,6 +108,29 @@ struct GNUNET_SERVER_MessageHandler
 };
 
 
+/**
+ * Create a new server.
+ *
+ * @param sched scheduler to use
+ * @param access function for access control
+ * @param access_cls closure for access
+ * @param lsocks NULL-terminated array of listen sockets
+ * @param maxbuf maximum write buffer size for accepted sockets
+ * @param idle_timeout after how long should we timeout idle connections?
+ * @param require_found if YES, connections sending messages of unknown type
+ *        will be closed
+ * @return handle for the new server, NULL on error
+ *         (typically, "port" already in use)
+ */
+struct GNUNET_SERVER_Handle *
+GNUNET_SERVER_create_with_sockets (struct GNUNET_SCHEDULER_Handle *sched,
+                                  GNUNET_CONNECTION_AccessCheck access, void *access_cls,
+                                  struct GNUNET_NETWORK_Handle **lsocks,
+                                  size_t maxbuf,
+                                  struct GNUNET_TIME_Relative
+                                  idle_timeout,
+                                  int require_found);
+
 /**
  * Create a new server.
  *
@@ -521,15 +544,12 @@ typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls,
  *
  * @param maxbuf maximum message size to support (typically
  *    GNUNET_SERVER_MAX_MESSAGE_SIZE)
- * @param client_identity ID of client for which this is a buffer,
- *        can be NULL (will be passed back to 'cb')
  * @param cb function to call on completed messages
  * @param cb_cls closure for cb
  * @return handle to tokenizer
  */
 struct GNUNET_SERVER_MessageStreamTokenizer *
 GNUNET_SERVER_mst_create (size_t maxbuf,
-                         void *client_identity,
                          GNUNET_SERVER_MessageTokenizerCallback cb,
                          void *cb_cls);
 
@@ -539,6 +559,8 @@ GNUNET_SERVER_mst_create (size_t maxbuf,
  * callback for all complete messages.
  *
  * @param mst tokenizer to use
+ * @param client_identity ID of client for which this is a buffer,
+ *        can be NULL (will be passed back to 'cb')
  * @param buf input data to add
  * @param size number of bytes in buf
  * @param purge should any excess bytes in the buffer be discarded 
@@ -550,6 +572,7 @@ GNUNET_SERVER_mst_create (size_t maxbuf,
  */
 int
 GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst,
+                          void *client_identity,
                           const char *buf,
                           size_t size,
                           int purge,