diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2012-11-29 05:23:38 +0100 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2012-11-29 05:23:38 +0100 |
commit | fa31bcce44fd1990c68a68cea963b94faba7b314 (patch) | |
tree | cad20cc1b3cf6839e1566a20c149b9f32feafa23 /libglouglou/libglouglou.h | |
parent | better naming (diff) | |
download | glouglou-fa31bcce44fd1990c68a68cea963b94faba7b314.tar.xz glouglou-fa31bcce44fd1990c68a68cea963b94faba7b314.zip |
correctly handle new users
Diffstat (limited to 'libglouglou/libglouglou.h')
-rw-r--r-- | libglouglou/libglouglou.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libglouglou/libglouglou.h b/libglouglou/libglouglou.h index 2a7e1c7..03ed2f1 100644 --- a/libglouglou/libglouglou.h +++ b/libglouglou/libglouglou.h @@ -1,4 +1,5 @@ #include <sys/types.h> +#include "contrib/queue.h" #define PACKET_VERSION 1 #define DNSNAME_MAX 20 @@ -50,6 +51,12 @@ struct gg_packet { #define name_fqdn pdat.name.fqdn }; +struct gg_user { + LIST_ENTRY(gg_user) entry; + int id; + struct sockaddr_in addr; +}; + struct gg_server { const char *ip; int port; @@ -57,6 +64,8 @@ struct gg_server { int sock; int (*handle_conn)(struct gg_server *, int, struct sockaddr_in *); int (*handle_packet)(struct gg_server *, struct gg_packet *); + LIST_HEAD(, gg_user) user_list; + int user_id_count; }; struct gg_client { @@ -84,3 +93,4 @@ void gg_client_disconnect(struct gg_client *); void *xmalloc(size_t); void *xcalloc(size_t, size_t); void fd_nonblock(int); +void addrcpy(struct sockaddr_in *, struct sockaddr_in *); |