浏览代码

ims_registrar_scscf: clang-format

Victor Seva 1 月之前
父节点
当前提交
5ac0428c22

+ 44 - 44
src/modules/ims_registrar_scscf/config.c

@@ -48,47 +48,47 @@ struct cfg_group_registrar default_registrar_cfg = {
 
 void *registrar_cfg = &default_registrar_cfg;
 
-cfg_def_t registrar_cfg_def[] =
-		{{"default_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0,
-				 default_expires_stats_update,
-				 "Contains number of second to expire if no expire hf or "
-				 "contact expire present"},
-				{"default_expires_range", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0,
-						100, 0, default_expires_range_update,
-						"Percent from default_expires that will be used in "
-						"generating the range for the expire interval"},
-				{"min_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0, 0,
-						"The minimum expires value of a Contact. Value 0 "
-						"disables the checking. "},
-				{"max_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0,
-						max_expires_stats_update,
-						"The maximum expires value of a Contact. Value 0 "
-						"disables the checking. "},
-				{"em_default_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0,
-						0, "The default emergency expires value of a Contact."},
-				{"em_max_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0, 0,
-						"The maximum emergency expires value of a Contact. "
-						"Value 0 disables the checking. "},
-				{"em_min_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0, 0,
-						"The maximum emergency expires value of a Contact. "
-						"Value 0 disables the checking. "},
-				{"max_contacts", CFG_VAR_INT | CFG_ATOMIC, 0, 0, 0, 0,
-						"The maximum number of Contacts for an AOR. Value 0 "
-						"disables the checking. "},
-				{"retry_after", CFG_VAR_INT | CFG_ATOMIC, 0, 0, 0, 0,
-						"If you want to add the Retry-After header field in "
-						"5xx replies, set this parameter to a value grater "
-						"than zero"},
-				{"case_sensitive", CFG_VAR_INT | CFG_ATOMIC, 0, 0, 0, 0,
-						"If set to 1 then AOR comparison will be case "
-						"sensitive. Recommended and default is 0, case "
-						"insensitive"},
-				{"default_q", CFG_VAR_INT | CFG_ATOMIC, -1, 1000, 0, 0,
-						"The parameter represents default q value for new "
-						"contacts."}, /* Q_UNSPECIFIED is -1 */
-				{"append_branches", CFG_VAR_INT, 0, 0, 0, 0,
-						"If set to 1(default), lookup will put all contacts "
-						"found in msg structure"},
-				{"realm_pref", CFG_VAR_STRING, 0, 0, 0, 0,
-						"Realm prefix to be removed. Default is \"\""},
-				{0, 0, 0, 0, 0, 0}};
+cfg_def_t registrar_cfg_def[] = {
+		{"default_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0,
+				default_expires_stats_update,
+				"Contains number of second to expire if no expire hf or "
+				"contact expire present"},
+		{"default_expires_range", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 100, 0,
+				default_expires_range_update,
+				"Percent from default_expires that will be used in "
+				"generating the range for the expire interval"},
+		{"min_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0, 0,
+				"The minimum expires value of a Contact. Value 0 "
+				"disables the checking. "},
+		{"max_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0,
+				max_expires_stats_update,
+				"The maximum expires value of a Contact. Value 0 "
+				"disables the checking. "},
+		{"em_default_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0, 0,
+				"The default emergency expires value of a Contact."},
+		{"em_max_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0, 0,
+				"The maximum emergency expires value of a Contact. "
+				"Value 0 disables the checking. "},
+		{"em_min_expires", CFG_VAR_INT | CFG_CB_ONLY_ONCE, 0, 0, 0, 0,
+				"The maximum emergency expires value of a Contact. "
+				"Value 0 disables the checking. "},
+		{"max_contacts", CFG_VAR_INT | CFG_ATOMIC, 0, 0, 0, 0,
+				"The maximum number of Contacts for an AOR. Value 0 "
+				"disables the checking. "},
+		{"retry_after", CFG_VAR_INT | CFG_ATOMIC, 0, 0, 0, 0,
+				"If you want to add the Retry-After header field in "
+				"5xx replies, set this parameter to a value grater "
+				"than zero"},
+		{"case_sensitive", CFG_VAR_INT | CFG_ATOMIC, 0, 0, 0, 0,
+				"If set to 1 then AOR comparison will be case "
+				"sensitive. Recommended and default is 0, case "
+				"insensitive"},
+		{"default_q", CFG_VAR_INT | CFG_ATOMIC, -1, 1000, 0, 0,
+				"The parameter represents default q value for new "
+				"contacts."}, /* Q_UNSPECIFIED is -1 */
+		{"append_branches", CFG_VAR_INT, 0, 0, 0, 0,
+				"If set to 1(default), lookup will put all contacts "
+				"found in msg structure"},
+		{"realm_pref", CFG_VAR_STRING, 0, 0, 0, 0,
+				"Realm prefix to be removed. Default is \"\""},
+		{0, 0, 0, 0, 0, 0}};

+ 2 - 1
src/modules/ims_registrar_scscf/cxdx_avp.h

@@ -48,7 +48,8 @@
 #ifndef IS_CSCF_CXDX_AVP_H
 #define IS_CSCF_CXDX_AVP_H
 
-extern struct cdp_binds cdpb; /**< Structure with pointers to cdp funcs 		*/
+extern struct cdp_binds
+		cdpb; /**< Structure with pointers to cdp funcs 		*/
 extern struct tm_binds tmb;
 
 struct AAAMessage;

+ 1 - 2
src/modules/ims_registrar_scscf/cxdx_sar.c

@@ -317,8 +317,7 @@ error:
 	if(data->sar_assignment_type != AVP_IMS_SAR_UNREGISTERED_USER)
 		reg_send_reply_transactional(req, data->contact_header, t);
 
-error_no_send
-	: //if we don't have the transaction then we can't send a transaction response
+error_no_send: //if we don't have the transaction then we can't send a transaction response
 	update_stat(rejected_registrations, 1);
 	//free memory
 	if(saa)

+ 4 - 8
src/modules/ims_registrar_scscf/registrar_notify.c

@@ -282,14 +282,12 @@ int can_publish_reg(struct sip_msg *msg, char *_t, char *str2)
 
 done:
 	if(presentity_uri.s)
-		shm_free(
-				presentity_uri
+		shm_free(presentity_uri
 						.s); // shm_malloc in cscf_get_public_identity_from_requri
 	return ret;
 error:
 	if(presentity_uri.s)
-		shm_free(
-				presentity_uri
+		shm_free(presentity_uri
 						.s); // shm_malloc in cscf_get_public_identity_from_requri
 	ret = CSCF_RETURN_ERROR;
 	return ret;
@@ -461,15 +459,13 @@ int can_subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2)
 
 done:
 	if(presentity_uri.s)
-		shm_free(
-				presentity_uri
+		shm_free(presentity_uri
 						.s); // shm_malloc in cscf_get_public_identity_from_requri or get_presentity_from_subscriber_dialog
 	return ret;
 error:
 	ret = CSCF_RETURN_ERROR;
 	if(presentity_uri.s)
-		shm_free(
-				presentity_uri
+		shm_free(presentity_uri
 						.s); // shm_malloc in cscf_get_public_identity_from_requri or get_presentity_from_subscriber_dialog
 	return ret;
 }

+ 38 - 39
src/modules/ims_registrar_scscf/save.c

@@ -406,12 +406,12 @@ void free_ims_subscription_data(ims_subscription *s)
 		for(j = 0; j < s->service_profiles[i].public_identities_cnt; j++) {
 			if(s->service_profiles[i].public_identities[j].public_identity.s)
 				shm_free(s->service_profiles[i]
-								 .public_identities[j]
-								 .public_identity.s);
+								.public_identities[j]
+								.public_identity.s);
 			if(s->service_profiles[i].public_identities[j].wildcarded_psi.s)
 				shm_free(s->service_profiles[i]
-								 .public_identities[j]
-								 .wildcarded_psi.s);
+								.public_identities[j]
+								.wildcarded_psi.s);
 		}
 		if(s->service_profiles[i].public_identities)
 			shm_free(s->service_profiles[i].public_identities);
@@ -419,8 +419,8 @@ void free_ims_subscription_data(ims_subscription *s)
 		for(j = 0; j < s->service_profiles[i].filter_criteria_cnt; j++) {
 			if(s->service_profiles[i].filter_criteria[j].trigger_point) {
 				for(k = 0; k < s->service_profiles[i]
-									   .filter_criteria[j]
-									   .trigger_point->spt_cnt;
+								   .filter_criteria[j]
+								   .trigger_point->spt_cnt;
 						k++) {
 					switch(s->service_profiles[i]
 									.filter_criteria[j]
@@ -432,9 +432,9 @@ void free_ims_subscription_data(ims_subscription *s)
 											.trigger_point->spt[k]
 											.request_uri.s)
 								shm_free(s->service_profiles[i]
-												 .filter_criteria[j]
-												 .trigger_point->spt[k]
-												 .request_uri.s);
+												.filter_criteria[j]
+												.trigger_point->spt[k]
+												.request_uri.s);
 							break;
 						case IFC_METHOD:
 							if(s->service_profiles[i]
@@ -442,9 +442,9 @@ void free_ims_subscription_data(ims_subscription *s)
 											.trigger_point->spt[k]
 											.method.s)
 								shm_free(s->service_profiles[i]
-												 .filter_criteria[j]
-												 .trigger_point->spt[k]
-												 .method.s);
+												.filter_criteria[j]
+												.trigger_point->spt[k]
+												.method.s);
 							break;
 						case IFC_SIP_HEADER:
 							if(s->service_profiles[i]
@@ -452,17 +452,17 @@ void free_ims_subscription_data(ims_subscription *s)
 											.trigger_point->spt[k]
 											.sip_header.header.s)
 								shm_free(s->service_profiles[i]
-												 .filter_criteria[j]
-												 .trigger_point->spt[k]
-												 .sip_header.header.s);
+												.filter_criteria[j]
+												.trigger_point->spt[k]
+												.sip_header.header.s);
 							if(s->service_profiles[i]
 											.filter_criteria[j]
 											.trigger_point->spt[k]
 											.sip_header.content.s)
 								shm_free(s->service_profiles[i]
-												 .filter_criteria[j]
-												 .trigger_point->spt[k]
-												 .sip_header.content.s);
+												.filter_criteria[j]
+												.trigger_point->spt[k]
+												.sip_header.content.s);
 							break;
 						case IFC_SESSION_CASE:
 							break;
@@ -472,44 +472,44 @@ void free_ims_subscription_data(ims_subscription *s)
 											.trigger_point->spt[k]
 											.session_desc.line.s)
 								shm_free(s->service_profiles[i]
-												 .filter_criteria[j]
-												 .trigger_point->spt[k]
-												 .session_desc.line.s);
+												.filter_criteria[j]
+												.trigger_point->spt[k]
+												.session_desc.line.s);
 							if(s->service_profiles[i]
 											.filter_criteria[j]
 											.trigger_point->spt[k]
 											.session_desc.content.s)
 								shm_free(s->service_profiles[i]
-												 .filter_criteria[j]
-												 .trigger_point->spt[k]
-												 .session_desc.content.s);
+												.filter_criteria[j]
+												.trigger_point->spt[k]
+												.session_desc.content.s);
 							break;
 					}
 				}
 				if(s->service_profiles[i].filter_criteria[j].trigger_point->spt)
 					shm_free(s->service_profiles[i]
-									 .filter_criteria[j]
-									 .trigger_point->spt);
+									.filter_criteria[j]
+									.trigger_point->spt);
 				shm_free(s->service_profiles[i]
-								 .filter_criteria[j]
-								 .trigger_point);
+								.filter_criteria[j]
+								.trigger_point);
 			}
 			if(s->service_profiles[i]
 							.filter_criteria[j]
 							.application_server.server_name.s)
 				shm_free(s->service_profiles[i]
-								 .filter_criteria[j]
-								 .application_server.server_name.s);
+								.filter_criteria[j]
+								.application_server.server_name.s);
 			if(s->service_profiles[i]
 							.filter_criteria[j]
 							.application_server.service_info.s)
 				shm_free(s->service_profiles[i]
-								 .filter_criteria[j]
-								 .application_server.service_info.s);
+								.filter_criteria[j]
+								.application_server.service_info.s);
 			if(s->service_profiles[i].filter_criteria[j].profile_part_indicator)
 				shm_free(s->service_profiles[i]
-								 .filter_criteria[j]
-								 .profile_part_indicator);
+								.filter_criteria[j]
+								.profile_part_indicator);
 		}
 		if(s->service_profiles[i].filter_criteria)
 			shm_free(s->service_profiles[i].filter_criteria);
@@ -1023,7 +1023,7 @@ int update_contacts(struct sip_msg *msg, udomain_t *_d, str *public_identity,
 			//now update the implicit set
 			for(i = 0; i < subscription->service_profiles_cnt; i++) {
 				for(j = 0; j < subscription->service_profiles[i]
-									   .public_identities_cnt;
+								   .public_identities_cnt;
 						j++) {
 					pi = &(subscription->service_profiles[i]
 									.public_identities[j]);
@@ -1181,7 +1181,7 @@ int update_contacts(struct sip_msg *msg, udomain_t *_d, str *public_identity,
 			if(subscription) {
 				for(i = 0; i < subscription->service_profiles_cnt; i++) {
 					for(j = 0; j < subscription->service_profiles[i]
-										   .public_identities_cnt;
+									   .public_identities_cnt;
 							j++) {
 						pi = &(subscription->service_profiles[i]
 										.public_identities[j]);
@@ -1221,7 +1221,7 @@ int update_contacts(struct sip_msg *msg, udomain_t *_d, str *public_identity,
 						for(h = msg->contact; h; h = h->next) {
 							if(h->type == HDR_CONTACT_T && h->parsed) {
 								for(chi = ((contact_body_t *)h->parsed)
-												  ->contacts;
+												->contacts;
 										chi; chi = chi->next) {
 									if(ul.get_ucontact(&chi->uri, &callid,
 											   &path, 0, &ucontact)
@@ -1481,8 +1481,7 @@ int assign_server_unreg(
 	}
 
 	if(public_identity.s && dir == CSCF_MOBILE_TERMINATING)
-		shm_free(
-				public_identity
+		shm_free(public_identity
 						.s); // shm_malloc in cscf_get_public_identity_from_requri
 
 	return CSCF_RETURN_BREAK;

+ 6 - 6
src/modules/ims_registrar_scscf/userdata_parser.c

@@ -914,8 +914,8 @@ static int parse_service_profile(
 				case 'P':
 				case 'p':
 					returncode = parse_public_identity(doc, child,
-							&(sp->public_identities
-											[sp->public_identities_cnt]));
+							&(sp->public_identities[sp
+											->public_identities_cnt]));
 					if(returncode)
 						sp->public_identities_cnt++;
 					break;
@@ -1171,8 +1171,8 @@ void print_user_data(ims_subscription *s)
 									.filter_criteria[j]
 									.profile_part_indicator
 							? *(s->service_profiles[i]
-											.filter_criteria[j]
-											.profile_part_indicator)
+											  .filter_criteria[j]
+											  .profile_part_indicator)
 							: -1);
 			if(s->service_profiles[i].filter_criteria[j].trigger_point) {
 				LM_DBG("\t\t\tTrigger Point: CNF [%c] %s\n",
@@ -1187,8 +1187,8 @@ void print_user_data(ims_subscription *s)
 								? "(_|_)&(_|_)"
 								: "(_&_)|(_&_)");
 				for(k = 0; k < s->service_profiles[i]
-									   .filter_criteria[j]
-									   .trigger_point->spt_cnt;
+								   .filter_criteria[j]
+								   .trigger_point->spt_cnt;
 						k++) {
 					LM_DBG("\t\t\t\tSPT: Grp[%d] NOT[%c] RegType[%d]\n",
 							s->service_profiles[i]