00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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
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