-#include "gnunet_common.h"
-#include "gnunet_configuration_lib.h"
-#include "gnunet_connection_lib.h"
-#include "gnunet_scheduler_lib.h"
-#include "gnunet_time_lib.h"
-
-/**
- * Opaque handle for a connection to a service.
- */
-struct GNUNET_CLIENT_Connection;
-
-/**
- * Get a connection with a service.
- *
- * @param sched scheduler to use
- * @param service_name name of the service
- * @param cfg configuration to use
- * @return NULL on error (service unknown to configuration)
- */
-struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (struct
- GNUNET_SCHEDULER_Handle
- *sched,
- const char
- *service_name,
- const struct
- GNUNET_CONFIGURATION_Handle
- *cfg);
-
-
-/**
- * Configure this connection to ignore shutdown signals.
- *
- * @param h client handle
- * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default
- */
-void
-GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h,
- int do_ignore);
-
-
-
-/**
- * Destroy connection with the service. This will automatically
- * cancel any pending "receive" request (however, the handler will
- * *NOT* be called, not even with a NULL message). Any pending
- * transmission request will also be cancelled UNLESS the callback for
- * the transmission request has already been called, in which case the
- * transmission 'finish_pending_write' argument determines whether or
- * not the write is guaranteed to complete before the socket is fully
- * destroyed (unless, of course, there is an error with the server in
- * which case the message may still be lost).
- *
- * @param sock handle to the service connection
- * @param finish_pending_write should a transmission already passed to the
- * handle be completed?
- */
-void GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock,
- int finish_pending_write);
-
-/**
- * Type of a function to call when we receive a message
- * from the service.
- *
- * @param cls closure
- * @param msg message received, NULL on timeout or fatal error
- */
-typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls,
- const struct
- GNUNET_MessageHeader * msg);
-
-/**
- * Type of a function to call when we have finished shutting
- * down a service, or failed.
- *
- * @param cls closure
- * @param reason what is the result of the shutdown
- * GNUNET_NO on shutdown (not running)
- * GNUNET_YES on running
- * GNUNET_SYSERR on failure to transmit message
- */
-typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls,
- int reason);
-
-/**
- * Read from the service.
- *
- * @param sock the service
- * @param handler function to call with the message
- * @param handler_cls closure for handler
- * @param timeout how long to wait until timing out
- */
-void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock,
- GNUNET_CLIENT_MessageHandler handler,
- void *handler_cls,
- struct GNUNET_TIME_Relative timeout);