8fd790e3bdb353fba85b7d9741419b2cd8f84df7
[cascardo/rnetproxy.git] / proto_detect.c
1 #include <gnet.h>
2 #include <glib.h>
3 #include "proto_detect.h"
4
5 static void proto_connect (net_hook_t* hook)
6 {
7 }
8
9 static void proto_close (net_hook_t* hook)
10 {
11 }
12
13 static void proto_write (net_hook_t* hook)
14 {
15 }
16
17 static void proto_read (net_hook_t* hook, gchar* buffer, size_t len)
18 {
19 }
20
21 net_hook_t* proto_detect_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 = proto_connect;
29   hook->close = proto_close;
30   hook->write = proto_write;
31   hook->read = proto_read;
32   hook->data = NULL;
33   return hook;
34 }
35
36 void proto_detect_destroy (net_hook_t* hook)
37 {
38   g_slice_free (net_hook_t, hook);
39 }