diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-01-19 19:26:16 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-01-19 19:26:16 +0000 |
commit | adc6e8a159ce05cc65f7b4d6f4a6b006300877b0 (patch) | |
tree | f20e5c3dd349f6d9e8d143c1194a40917b2c803c /src/client | |
parent | 44b9ea9f740e5ba5a4af45874e9a96becf7f8325 (diff) | |
download | rspamd-adc6e8a159ce05cc65f7b4d6f4a6b006300877b0.tar.gz rspamd-adc6e8a159ce05cc65f7b4d6f4a6b006300877b0.zip |
Basic API for the new client.
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/rspamdclient.c | 10 | ||||
-rw-r--r-- | src/client/rspamdclient.h | 35 |
2 files changed, 45 insertions, 0 deletions
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_ */ |