From adc6489d9b8cc8dc37c034d1116550383e9a9f42 Mon Sep 17 00:00:00 2001
From: "7u83@mail.ru" <7u83@mail.ru@noemail.net>
Date: Sat, 9 Apr 2016 16:07:30 +0000
Subject: [PATCH] uses mavl now
FossilOrigin-Name: 2b3ecb32b8512b81e2a973950c57a26e86bfa85e1d15d1af5c30ffade595a82f
---
src/cw/connlist.c | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/src/cw/connlist.c b/src/cw/connlist.c
index ffa08c33..0d3d7a8c 100644
--- a/src/cw/connlist.c
+++ b/src/cw/connlist.c
@@ -1,3 +1,20 @@
+/*
+ This file is part of actube.
+
+ actube is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ libcapwap is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Foobar. If not, see .
+
+*/
#include
#include
@@ -32,7 +49,7 @@ struct connlist * connlist_create(int len)
return 0;
- cl->t = avltree_create(connlist_cmp,0);
+ cl->t = mavl_create(connlist_cmp,0);
if (!cl->t){
free(cl);
@@ -40,7 +57,7 @@ struct connlist * connlist_create(int len)
}
if (pthread_mutex_init(&cl->connlist_mutex,NULL)){
- avltree_destroy(cl->t);
+ mavl_destroy(cl->t);
free(cl);
return 0;
};
@@ -67,7 +84,7 @@ void connlist_destroy(struct connlist * cl)
return;
if (cl->t)
- avltree_destroy(cl->t);
+ mavl_destroy(cl->t);
pthread_mutex_destroy(&cl->connlist_mutex);
free(cl);
@@ -78,7 +95,7 @@ struct conn * connlist_get(struct connlist * cl, const struct sockaddr * addr)
{
struct conn dummy;
sock_copyaddr(&dummy.addr,addr);
- return avltree_get(cl->t,&dummy);
+ return mavl_get(cl->t,&dummy);
}
@@ -88,13 +105,13 @@ struct conn * connlist_add(struct connlist * cl, struct conn * conn)
if (cl->t->count>=cl->len)
return 0;
- return avltree_add(cl->t,conn);
+ return mavl_add(cl->t,conn);
}
void connlist_remove(struct connlist *cl,struct conn * conn)
{
- avltree_del(cl->t,conn);
+ mavl_del(cl->t,conn);
}