From 650ebbac8d5a5932558c305e8806aae90f8cd37b Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sat, 9 Apr 2016 16:13:32 +0000 Subject: [PATCH] connlist uses own header file FossilOrigin-Name: 5734410105aebdef354b117bc91406ad0ac961273a7c80fd56c11bf386906139 --- src/cw/connlist.c | 2 ++ src/cw/connlist.h | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/cw/connlist.h diff --git a/src/cw/connlist.c b/src/cw/connlist.c index 0d3d7a8c..3cb3d084 100644 --- a/src/cw/connlist.c +++ b/src/cw/connlist.c @@ -29,6 +29,8 @@ #include #include "conn.h" +#include "connlist.h" + #include "sock.h" diff --git a/src/cw/connlist.h b/src/cw/connlist.h new file mode 100644 index 00000000..9d254715 --- /dev/null +++ b/src/cw/connlist.h @@ -0,0 +1,26 @@ +#ifndef __CONLIST_H +#define __CONLIST_H + + +#include "conn.h" +#include "mavl.h" + +struct connlist { +/* struct conn ** connlist; */ + + struct mavl *t; + int len; + pthread_mutex_t connlist_mutex; +}; + + +struct connlist *connlist_create(int len); +void connlist_lock(struct connlist *cl); +void connlist_unlock(struct connlist *cl); +void conlist_destroy(struct connlist *cl); +struct conn *connlist_get(struct connlist *cl, const struct sockaddr *addr); +struct conn *connlist_add(struct connlist *cl, struct conn *conn); +void connlist_remove(struct connlist *cl, struct conn *conn); +void connlist_destroy(struct connlist *cl); + +#endif