]> source.dussan.org Git - rspamd.git/commitdiff
Basic API for the new client.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 19 Jan 2014 19:26:16 +0000 (19:26 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 19 Jan 2014 19:26:16 +0000 (19:26 +0000)
src/client/rspamdclient.c
src/client/rspamdclient.h

index 126ddcd1b879f3573b4b15b58f1cb67b30debaf0..d7f1c77ddbf855862af1cd9ce0eeb79423cac57f 100644 (file)
  * 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)
+{
+
+}
index 90a4c1c274854eed0652075d9f3df0f50c2408d6..a274426fabbd7893ba93ac84822bfd7eb921c215 100644 (file)
 #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_ */