From adc6e8a159ce05cc65f7b4d6f4a6b006300877b0 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 19 Jan 2014 19:26:16 +0000 Subject: Basic API for the new client. --- src/client/rspamdclient.c | 10 ++++++++++ src/client/rspamdclient.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) (limited to 'src/client') diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c index 126ddcd1b..d7f1c77dd 100644 --- a/src/client/rspamdclient.c +++ b/src/client/rspamdclient.c @@ -21,3 +21,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "rspamdclient.h" +#include "util.h" + +gboolean +rspamd_client_command (struct event_base *ev_base, const gchar *name, + guint16 port, const gchar *command, GHashTable *attrs, + gdouble timeout, FILE *in, gpointer ud) +{ + +} diff --git a/src/client/rspamdclient.h b/src/client/rspamdclient.h index 90a4c1c27..a274426fa 100644 --- a/src/client/rspamdclient.h +++ b/src/client/rspamdclient.h @@ -27,6 +27,41 @@ #include "config.h" #include "ucl.h" +/** + * Callback is called on client request completed + * @param name name of server + * @param port port for server + * @param result result object + * @param ud opaque user data + * @param err error pointer (should be freed if not NULL) + */ +typedef void (*rspamd_client_callback) ( + const gchar *name, + guint16 port, + ucl_object_t *result, + gpointer ud, + GError *err); +/** + * Start rspamd worker or controller command + * @param ev_base event base + * @param name server name (hostname or unix socket) + * @param command command name + * @param attrs additional attributes + * @param port port number (in host order) + * @param timeout timeout in seconds + * @param in input file or NULL if no input required + * @param ud opaque user data + * @return + */ +gboolean rspamd_client_command ( + struct event_base *ev_base, + const gchar *name, + guint16 port, + const gchar *command, + GHashTable *attrs, + gdouble timeout, + FILE *in, + gpointer ud); #endif /* RSPAMDCLIENT_H_ */ -- cgit v1.2.3