2
0
Эх сурвалжийг харах

permissions: exported allow_source_address_group() to kemi framework

Daniel-Constantin Mierla 7 жил өмнө
parent
commit
20ebfcf315

+ 11 - 1
src/modules/permissions/address.c

@@ -525,7 +525,7 @@ int w_allow_source_address(struct sip_msg* _msg, char* _addr_group, char* _str2)
  * subnet table in any group. If yes, returns that group. If not returns -1.
  * Port value 0 in cached address and group table matches any port.
  */
-int allow_source_address_group(struct sip_msg* _msg, char* _str1, char* _str2)
+int ki_allow_source_address_group(sip_msg_t* _msg)
 {
 	int group = -1;
 
@@ -550,6 +550,16 @@ int allow_source_address_group(struct sip_msg* _msg, char* _str1, char* _str2)
 
 }
 
+/*
+ * Checks if source address/port is found in cached address or
+ * subnet table in any group. If yes, returns that group. If not returns -1.
+ * Port value 0 in cached address and group table matches any port.
+ */
+int allow_source_address_group(struct sip_msg* _msg, char* _str1, char* _str2)
+{
+	return ki_allow_source_address_group(_msg);
+}
+
 /*
  * Checks if address/port is found in cached address or
  * subnet table in any group. If yes, returns that group. If not returns -1.

+ 1 - 0
src/modules/permissions/address.h

@@ -88,6 +88,7 @@ int w_allow_source_address(struct sip_msg* _msg, char* _addr_group, char* _str2)
  */
 int allow_source_address_group(struct sip_msg* _msg, char* _str1, char* _str2);
 
+int ki_allow_source_address_group(sip_msg_t* _msg);
 
 /*
  * Checks if address/port is found in cached address or

+ 5 - 0
src/modules/permissions/permissions.c

@@ -1036,6 +1036,11 @@ static sr_kemi_t sr_kemi_permissions_exports[] = {
 		{ SR_KEMIP_INT, SR_KEMIP_STR, SR_KEMIP_INT,
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
 	},
+	{ str_init("permissions"), str_init("allow_source_address_group"),
+		SR_KEMIP_INT, ki_allow_source_address_group,
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+	},
 
 	{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
 };