ip_set_rpc.h

00001 /* 
00002  * $Id$
00003  *
00004  * allow_trusted related functions
00005  *
00006  * Copyright (C) 2008 iptelorg GmbH
00007  *
00008  * This file is part of ser, a free SIP server.
00009  *
00010  * ser is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version
00014  *
00015  * For a license to use the ser software under conditions
00016  * other than those described here, or to purchase support for this
00017  * software, please contact iptel.org by e-mail at the following addresses:
00018  *    info@iptel.org
00019  *
00020  * ser is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  * GNU General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU General Public License 
00026  * along with this program; if not, write to the Free Software 
00027  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028  */
00029 
00030 #ifndef _IP_SET_RPC_H
00031 #define _IP_SET_RPC_H 1
00032 
00033 #include "ip_set.h"
00034 #include "../../atomic_ops.h"
00035 #include "../../lock_ops.h"
00036 #include "../../rpc.h"
00037 
00038 struct ip_set_ref {
00039         struct ip_set ip_set;
00040         atomic_t refcnt;
00041 };
00042 
00043 struct ip_set_list_item {
00044         int idx;
00045         str name;
00046         gen_lock_t read_lock;
00047         gen_lock_t write_lock;
00048         struct ip_set_ref *ip_set;
00049         struct ip_set ip_set_pending;
00050 };
00051             
00052 extern int ip_set_list_malloc(int num, str *names);
00053 extern void ip_set_list_free();
00054 extern struct ip_set_list_item* ip_set_list_find_by_name(str name);
00055 
00056 /* RPC functions */
00057 
00058 extern const char* rpc_ip_set_clean_doc[];
00059 extern void rpc_ip_set_clean(rpc_t* rpc, void* ctx);
00060 
00061 extern const char* rpc_ip_set_add_doc[];
00062 extern void rpc_ip_set_add(rpc_t* rpc, void* ctx);
00063 
00064 extern const char* rpc_ip_set_commit_doc[];
00065 extern void rpc_ip_set_commit(rpc_t* rpc, void* ctx);
00066 
00067 extern const char* rpc_ip_set_list_doc[];
00068 extern void rpc_ip_set_list(rpc_t* rpc, void* ctx);
00069 
00070 extern const char* rpc_ip_set_print_doc[];
00071 extern void rpc_ip_set_print(rpc_t* rpc, void* ctx);
00072 
00073 #endif /* _IP_SET_RPC_H */