Browse code

Fixed userblacklist exported function See http://lists.sip-router.org/pipermail/sr-dev/2009-October/004393.html thread for a complete description

Marius Zbihlei authored on 19/10/2009 08:27:25
Showing 1 changed files
... ...
@@ -82,6 +82,10 @@ static int check_user_blacklist_fixup(void** param, int param_no);
82 82
 /* ---- exported commands: */
83 83
 static int check_user_blacklist(struct sip_msg *msg, char* str1, char* str2, char* str3, char* str4);
84 84
 static int check_user_whitelist(struct sip_msg *msg, char* str1, char* str2, char* str3, char* str4);
85
+static int check_user_blacklist2(struct sip_msg *msg, char* str1, char* str2);
86
+static int check_user_whitelist2(struct sip_msg *msg, char* str1, char* str2);
87
+static int check_user_blacklist3(struct sip_msg *msg, char* str1, char* str2, char* str3);
88
+static int check_user_whitelist3(struct sip_msg *msg, char* str1, char* str2, char* str3);
85 89
 static int check_blacklist(struct sip_msg *msg, struct check_blacklist_fs_t *arg1);
86 90
 
87 91
 /* ---- module init functions: */
... ...
@@ -95,10 +99,10 @@ struct mi_root * mi_reload_blacklist(struct mi_root* cmd, void* param);  /* usag
95 99
 
96 100
 
97 101
 static cmd_export_t cmds[]={
98
-	{ "check_user_blacklist", (cmd_function)check_user_blacklist, 2, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
99
-	{ "check_user_whitelist", (cmd_function)check_user_whitelist, 2, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
100
-	{ "check_user_blacklist", (cmd_function)check_user_blacklist, 3, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
101
-	{ "check_user_whitelist", (cmd_function)check_user_whitelist, 3, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
102
+	{ "check_user_blacklist", (cmd_function)check_user_blacklist2, 2, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
103
+	{ "check_user_whitelist", (cmd_function)check_user_whitelist2, 2, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
104
+	{ "check_user_blacklist", (cmd_function)check_user_blacklist3, 3, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
105
+	{ "check_user_whitelist", (cmd_function)check_user_whitelist3, 3, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
102 106
 	{ "check_user_blacklist", (cmd_function)check_user_blacklist, 4, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
103 107
 	{ "check_user_whitelist", (cmd_function)check_user_whitelist, 4, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
104 108
 	{ "check_blacklist", (cmd_function)check_blacklist, 1, check_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE },
... ...
@@ -313,6 +317,27 @@ static int check_user_blacklist(struct sip_msg *msg, char* str1, char* str2, cha
313 317
 	return check_user_list(msg, str1, str2, str3, str4, 0);
314 318
 }
315 319
 
320
+static int check_user_whitelist2(struct sip_msg *msg, char* str1, char* str2)
321
+{
322
+	return check_user_list(msg, str1, str2, NULL, NULL, 1);
323
+}
324
+
325
+
326
+static int check_user_blacklist2(struct sip_msg *msg, char* str1, char* str2)
327
+{
328
+	return check_user_list(msg, str1, str2, NULL, NULL, 0);
329
+}
330
+
331
+static int check_user_whitelist3(struct sip_msg *msg, char* str1, char* str2, char* str3)
332
+{
333
+	return check_user_list(msg, str1, str2, str3, NULL, 1);
334
+}
335
+
336
+
337
+static int check_user_blacklist3(struct sip_msg *msg, char* str1, char* str2, char* str3)
338
+{
339
+	return check_user_list(msg, str1, str2, str3, NULL, 0);
340
+}
316 341
 
317 342
 
318 343
 /**