Detects Jabber protocol and hook to it
[cascardo/rnetproxy.git] / jabber.c
1 #include <gnet.h>
2 #include <glib.h>
3 #include "jabber.h"
4
5 static void jabber_connect (net_hook_t* hook)
6 {
7 }
8
9 static void jabber_close (net_hook_t* hook)
10 {
11 }
12
13 static void jabber_write (net_hook_t* hook)
14 {
15 }
16
17 static void jabber_read (net_hook_t* hook, gchar* buffer, size_t len)
18 {
19 }
20
21 net_hook_t* jabber_hook_new (GConn* conn)
22 {
23   net_hook_t* hook;
24   hook = g_slice_new (net_hook_t);
25   hook->conn = conn;
26   hook->peer = NULL;
27   hook->server = FALSE;
28   hook->connect = jabber_connect;
29   hook->close = jabber_close;
30   hook->write = jabber_write;
31   hook->read = jabber_read;
32   hook->data = NULL;
33   gnet_conn_set_callback (hook->conn, nethook_event, hook);
34   return hook;
35 }
36
37 void jabber_destroy (net_hook_t* hook)
38 {
39   g_slice_free (net_hook_t, hook);
40 }