Переглянути джерело

h350: replace STR_PARAM with PARAM_STRING

Alekzander Spiridonov 11 роки тому
батько
коміт
7059d08c1a
3 змінених файлів з 16 додано та 16 видалено
  1. 4 4
      modules/h350/h350_exp_fn.c
  2. 9 9
      modules/h350/h350_mod.c
  3. 3 3
      modules/h350/h350_mod.h

+ 4 - 4
modules/h350/h350_exp_fn.c

@@ -84,8 +84,8 @@ int h350_sipuri_lookup(struct sip_msg* _msg, pv_elem_t* _sip_uri)
 	 * do ldap search
 	 * do ldap search
 	 */
 	 */
 	if (ldap_api.ldap_params_search(&ld_result_count,
 	if (ldap_api.ldap_params_search(&ld_result_count,
-					h350_ldap_session.s,
-					h350_base_dn.s,
+					h350_ldap_session,
+					h350_base_dn,
 					h350_search_scope_int,
 					h350_search_scope_int,
 					NULL,
 					NULL,
 					H350_SIPURI_LOOKUP_LDAP_FILTER,
 					H350_SIPURI_LOOKUP_LDAP_FILTER,
@@ -204,8 +204,8 @@ int h350_auth_lookup(
 
 
 	/* do ldap search */
 	/* do ldap search */
 	if (ldap_api.ldap_params_search(&ld_result_count,
 	if (ldap_api.ldap_params_search(&ld_result_count,
-                                        h350_ldap_session.s,
-                                        h350_base_dn.s,
+                                        h350_ldap_session,
+                                        h350_base_dn,
                                         h350_search_scope_int,
                                         h350_search_scope_int,
                                         NULL,
                                         NULL,
                                         H350_AUTH_FILTER_PATTERN,
                                         H350_AUTH_FILTER_PATTERN,

+ 9 - 9
modules/h350/h350_mod.c

@@ -61,9 +61,9 @@ static int w_h350_service_level(struct sip_msg* msg, char* avp_name_prefix, char
 /*
 /*
  * Module parameter variables
  * Module parameter variables
  */
  */
-str h350_ldap_session = str_init(H350_LDAP_SESSION);
-str h350_base_dn = str_init(H350_BASE_DN);
-str h350_search_scope = str_init(H350_SEARCH_SCOPE);
+char* h350_ldap_session = H350_LDAP_SESSION;
+char* h350_base_dn = H350_BASE_DN;
+char* h350_search_scope = H350_SEARCH_SCOPE;
 int h350_search_scope_int = -1;
 int h350_search_scope_int = -1;
 
 
 
 
@@ -96,9 +96,9 @@ static cmd_export_t cmds[] = {
  * Exported parameters
  * Exported parameters
  */
  */
 static param_export_t params[] = {
 static param_export_t params[] = {
-	{"ldap_session",     STR_PARAM, &h350_ldap_session.s},
-	{"base_dn",          STR_PARAM, &h350_base_dn.s},
-	{"search_scope",     STR_PARAM, &h350_search_scope.s},
+	{"ldap_session",     PARAM_STRING, &h350_ldap_session},
+	{"base_dn",          PARAM_STRING, &h350_base_dn},
+	{"search_scope",     PARAM_STRING, &h350_search_scope},
 	{0, 0, 0}
 	{0, 0, 0}
 };
 };
 
 
@@ -129,7 +129,7 @@ static int child_init(int rank)
         	return 0;
         	return 0;
 	}
 	}
 
 
-	h350_search_scope_int = ldap_api.ldap_str2scope(h350_search_scope.s);
+	h350_search_scope_int = ldap_api.ldap_str2scope(h350_search_scope);
 
 
         /*
         /*
          * initialize h350_exp_fn
          * initialize h350_exp_fn
@@ -161,9 +161,9 @@ static int mod_init(void)
 	/*
 	/*
 	 * check module parameters
 	 * check module parameters
 	 */
 	 */
-	if (ldap_api.ldap_str2scope(h350_search_scope.s) == -1)
+	if (ldap_api.ldap_str2scope(h350_search_scope) == -1)
 	{
 	{
-		LM_ERR("Invalid search_scope [%s]\n", h350_search_scope.s);
+		LM_ERR("Invalid search_scope [%s]\n", h350_search_scope);
 		return -1;
 		return -1;
 	}
 	}
 	
 	

+ 3 - 3
modules/h350/h350_mod.h

@@ -49,9 +49,9 @@ extern ldap_api_t ldap_api;
 #define H350_BASE_DN ""
 #define H350_BASE_DN ""
 #define H350_SEARCH_SCOPE "one"
 #define H350_SEARCH_SCOPE "one"
 
 
-extern str h350_ldap_session;
-extern str h350_base_dn;
-extern str h350_search_scope;
+extern char* h350_ldap_session;
+extern char* h350_base_dn;
+extern char* h350_search_scope;
 extern int h350_search_scope_int;
 extern int h350_search_scope_int;
 
 
 #endif /* H350_MOD_H */
 #endif /* H350_MOD_H */