aboutsummaryrefslogtreecommitdiffstats
path: root/libglouglou
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-11-26 23:16:22 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-11-26 23:16:22 +0100
commit234daed1807eff0e9d383ee601334f40dcc35851 (patch)
tree44d581504f093426e88a2180632efa0c12b3c4d6 /libglouglou
parentupdate to new architecture (diff)
downloadglouglou-234daed1807eff0e9d383ee601334f40dcc35851.tar.xz
glouglou-234daed1807eff0e9d383ee601334f40dcc35851.zip
add skeleton from ARCHITECTURE.txt
Diffstat (limited to 'libglouglou')
-rw-r--r--libglouglou/libglouglou.c49
-rw-r--r--libglouglou/libglouglou.h13
2 files changed, 61 insertions, 1 deletions
diff --git a/libglouglou/libglouglou.c b/libglouglou/libglouglou.c
index 4fdd07d..3882a6c 100644
--- a/libglouglou/libglouglou.c
+++ b/libglouglou/libglouglou.c
@@ -9,7 +9,54 @@ struct gg_server {
struct gg_packet {
};
+/*
+ * start a server
+ * totaly unblocking, using libevent
+ */
struct gg_server *
gg_server_start(char *ip, int port,
int (*handle_conn)(struct gg_server *s, int client_id, struct sockaddr_in *addr),
- int (*handle_packet)(struct gg_server *s, struct gg_packet *p));
+ int (*handle_packet)(struct gg_server *s, struct gg_packet *p))
+{
+ struct gg_server *s;
+
+ return s;
+}
+
+int
+gg_server_send(struct gg_server *s, int client_id, struct gg_packet *p)
+{
+ return -1;
+}
+
+void
+gg_server_stop(struct gg_server *s)
+{
+
+}
+
+/*
+ * connect to a server
+ * totaly unblocking, using libevent
+ */
+struct gg_client *
+gg_client_connect(char *ip, int port,
+ int (*handle_conn)(struct gg_client *c, int status),
+ int (*handle_packet)(struct gg_client *c, struct gg_packet *p))
+{
+ struct gg_client *c;
+
+ return c;
+}
+
+int
+gg_client_send(struct gg_client *c, struct gg_packet *p)
+{
+ return -1;
+}
+
+void
+gg_client_disconnect(struct gg_client *c)
+{
+
+}
diff --git a/libglouglou/libglouglou.h b/libglouglou/libglouglou.h
index 62d601c..4906bab 100644
--- a/libglouglou/libglouglou.h
+++ b/libglouglou/libglouglou.h
@@ -48,3 +48,16 @@ struct packet {
#define name_fqdn pdat.name.fqdn
};
+struct gg_server *gg_server_start(char *ip, int port,
+ int (*handle_conn)(struct gg_server *s, int client_id, struct sockaddr_in *addr),
+ int (*handle_packet)(struct gg_server *s, struct gg_packet *p));
+int gg_server_send(struct gg_server *s, int client_id,
+ struct gg_packet *p);
+void gg_server_stop(struct gg_server *s);
+
+struct gg_client *gg_client_connect(char *ip, int port,
+ int (*handle_conn)(struct gg_client *c, int status),
+ int (*handle_packet)(struct gg_client *c,
+ struct gg_packet *p));
+int gg_client_send(struct gg_client *c, struct gg_packet *p);
+void gg_client_disconnect(struct gg_client *c);