mirror of
				https://github.com/open5gs/open5gs.git
				synced 2025-11-03 21:43:25 +00:00 
			
		
		
		
	cosmetic: HSS: Fix trailing whitespace
This commit is contained in:
		
				
					committed by
					
						
						Sukchan Lee
					
				
			
			
				
	
			
			
			
						parent
						
							69022386a6
						
					
				
				
					commit
					cb114eca5e
				
			@@ -194,7 +194,7 @@ int ogs_dbi_update_imeisv(char *supi, char *imeisv)
 | 
			
		||||
    return rv;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ogs_dbi_update_mme(char *supi, char *mme_host, char *mme_realm, 
 | 
			
		||||
int ogs_dbi_update_mme(char *supi, char *mme_host, char *mme_realm,
 | 
			
		||||
    bool purge_flag)
 | 
			
		||||
{
 | 
			
		||||
    int rv = OGS_OK;
 | 
			
		||||
@@ -273,7 +273,7 @@ int ogs_dbi_increment_sqn(char *supi)
 | 
			
		||||
 | 
			
		||||
    update = BCON_NEW("$bit",
 | 
			
		||||
            "{",
 | 
			
		||||
                "security.sqn", 
 | 
			
		||||
                "security.sqn",
 | 
			
		||||
                "{", "and", BCON_INT64(max_sqn), "}",
 | 
			
		||||
            "}");
 | 
			
		||||
    if (!mongoc_collection_update(ogs_mongoc()->collection.subscriber,
 | 
			
		||||
 
 | 
			
		||||
@@ -184,7 +184,7 @@ int hss_context_parse_config(void)
 | 
			
		||||
                const char *hss_key = ogs_yaml_iter_key(&hss_iter);
 | 
			
		||||
                ogs_assert(hss_key);
 | 
			
		||||
                if (!strcmp(hss_key, "freeDiameter")) {
 | 
			
		||||
                    yaml_node_t *node = 
 | 
			
		||||
                    yaml_node_t *node =
 | 
			
		||||
                        yaml_document_get_node(document, hss_iter.pair->value);
 | 
			
		||||
                    ogs_assert(node);
 | 
			
		||||
                    if (node->type == YAML_SCALAR_NODE) {
 | 
			
		||||
@@ -197,10 +197,10 @@ int hss_context_parse_config(void)
 | 
			
		||||
                            const char *fd_key = ogs_yaml_iter_key(&fd_iter);
 | 
			
		||||
                            ogs_assert(fd_key);
 | 
			
		||||
                            if (!strcmp(fd_key, "identity")) {
 | 
			
		||||
                                self.diam_config->cnf_diamid = 
 | 
			
		||||
                                self.diam_config->cnf_diamid =
 | 
			
		||||
                                    ogs_yaml_iter_value(&fd_iter);
 | 
			
		||||
                            } else if (!strcmp(fd_key, "realm")) {
 | 
			
		||||
                                self.diam_config->cnf_diamrlm = 
 | 
			
		||||
                                self.diam_config->cnf_diamrlm =
 | 
			
		||||
                                    ogs_yaml_iter_value(&fd_iter);
 | 
			
		||||
                            } else if (!strcmp(fd_key, "port")) {
 | 
			
		||||
                                const char *v = ogs_yaml_iter_value(&fd_iter);
 | 
			
		||||
@@ -209,7 +209,7 @@ int hss_context_parse_config(void)
 | 
			
		||||
                                const char *v = ogs_yaml_iter_value(&fd_iter);
 | 
			
		||||
                                if (v) self.diam_config->cnf_port_tls = atoi(v);
 | 
			
		||||
                            } else if (!strcmp(fd_key, "listen_on")) {
 | 
			
		||||
                                self.diam_config->cnf_addr = 
 | 
			
		||||
                                self.diam_config->cnf_addr =
 | 
			
		||||
                                    ogs_yaml_iter_value(&fd_iter);
 | 
			
		||||
                            } else if (!strcmp(fd_key, "no_fwd")) {
 | 
			
		||||
                                self.diam_config->cnf_flags.no_fwd =
 | 
			
		||||
@@ -327,7 +327,7 @@ int hss_context_parse_config(void)
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                } else if (!strcmp(hss_key, "sms_over_ims")) {
 | 
			
		||||
                            self.sms_over_ims = 
 | 
			
		||||
                            self.sms_over_ims =
 | 
			
		||||
                                ogs_yaml_iter_value(&hss_iter);
 | 
			
		||||
                } else
 | 
			
		||||
                    ogs_warn("unknown key `%s`", hss_key);
 | 
			
		||||
@@ -979,185 +979,185 @@ char *hss_cx_download_user_data(
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if(self.sms_over_ims) {
 | 
			
		||||
            user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                        ogs_diam_cx_xml_ifc_s); 
 | 
			
		||||
            user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                        ogs_diam_cx_xml_ifc_s);
 | 
			
		||||
            ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
              user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
              user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                          ogs_diam_cx_xml_priority_s,
 | 
			
		||||
                          "2", 
 | 
			
		||||
                          ogs_diam_cx_xml_priority_e); 
 | 
			
		||||
                          "2",
 | 
			
		||||
                          ogs_diam_cx_xml_priority_e);
 | 
			
		||||
              ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
              user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                          ogs_diam_cx_xml_tp_s); 
 | 
			
		||||
              user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                          ogs_diam_cx_xml_tp_s);
 | 
			
		||||
              ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                            ogs_diam_cx_xml_cnf_s, 
 | 
			
		||||
                            "1", 
 | 
			
		||||
                            ogs_diam_cx_xml_cnf_e); 
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                            ogs_diam_cx_xml_cnf_s,
 | 
			
		||||
                            "1",
 | 
			
		||||
                            ogs_diam_cx_xml_cnf_e);
 | 
			
		||||
                ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                            ogs_diam_cx_xml_spt_s); 
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                            ogs_diam_cx_xml_spt_s);
 | 
			
		||||
                ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_s, 
 | 
			
		||||
                              "0", 
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_s,
 | 
			
		||||
                              "0",
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_group_s, 
 | 
			
		||||
                              "1", 
 | 
			
		||||
                              ogs_diam_cx_xml_group_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                              ogs_diam_cx_xml_group_s,
 | 
			
		||||
                              "1",
 | 
			
		||||
                              ogs_diam_cx_xml_group_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_method_s, 
 | 
			
		||||
                              "MESSAGE", 
 | 
			
		||||
                              ogs_diam_cx_xml_method_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                              ogs_diam_cx_xml_method_s,
 | 
			
		||||
                              "MESSAGE",
 | 
			
		||||
                              ogs_diam_cx_xml_method_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_extension_s); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                              ogs_diam_cx_xml_extension_s);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                    user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_s, 
 | 
			
		||||
                                "0", 
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_e); 
 | 
			
		||||
                    user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_s,
 | 
			
		||||
                                "0",
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_e);
 | 
			
		||||
                    ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_extension_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                              ogs_diam_cx_xml_extension_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                            ogs_diam_cx_xml_spt_e); 
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                            ogs_diam_cx_xml_spt_e);
 | 
			
		||||
                ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                            ogs_diam_cx_xml_spt_s); 
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                            ogs_diam_cx_xml_spt_s);
 | 
			
		||||
                ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_s, 
 | 
			
		||||
                              "0", 
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_s,
 | 
			
		||||
                              "0",
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_group_s, 
 | 
			
		||||
                              "2", 
 | 
			
		||||
                              ogs_diam_cx_xml_group_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                              ogs_diam_cx_xml_group_s,
 | 
			
		||||
                              "2",
 | 
			
		||||
                              ogs_diam_cx_xml_group_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_sip_hdr_s); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                              ogs_diam_cx_xml_sip_hdr_s);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                    user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                                ogs_diam_cx_xml_header_s, 
 | 
			
		||||
                                "Content-Type", 
 | 
			
		||||
                                ogs_diam_cx_xml_header_e); 
 | 
			
		||||
                    user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                                ogs_diam_cx_xml_header_s,
 | 
			
		||||
                                "Content-Type",
 | 
			
		||||
                                ogs_diam_cx_xml_header_e);
 | 
			
		||||
                    ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                    user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                                ogs_diam_cx_xml_content_s, 
 | 
			
		||||
                                "application/vnd.3gpp.sms", 
 | 
			
		||||
                                ogs_diam_cx_xml_content_e); 
 | 
			
		||||
                    user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                                ogs_diam_cx_xml_content_s,
 | 
			
		||||
                                "application/vnd.3gpp.sms",
 | 
			
		||||
                                ogs_diam_cx_xml_content_e);
 | 
			
		||||
                    ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_sip_hdr_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                              ogs_diam_cx_xml_sip_hdr_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_extension_s); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                              ogs_diam_cx_xml_extension_s);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                    user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_s, 
 | 
			
		||||
                                "0", 
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_e); 
 | 
			
		||||
                    user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_s,
 | 
			
		||||
                                "0",
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_e);
 | 
			
		||||
                    ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_extension_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                              ogs_diam_cx_xml_extension_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                            ogs_diam_cx_xml_spt_e); 
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                            ogs_diam_cx_xml_spt_e);
 | 
			
		||||
                ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                            ogs_diam_cx_xml_spt_s); 
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                            ogs_diam_cx_xml_spt_s);
 | 
			
		||||
                ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_s, 
 | 
			
		||||
                              "0", 
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_s,
 | 
			
		||||
                              "0",
 | 
			
		||||
                              ogs_diam_cx_xml_condition_negated_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_group_s, 
 | 
			
		||||
                              "3", 
 | 
			
		||||
                              ogs_diam_cx_xml_group_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                              ogs_diam_cx_xml_group_s,
 | 
			
		||||
                              "3",
 | 
			
		||||
                              ogs_diam_cx_xml_group_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_session_case_s, 
 | 
			
		||||
                              "0", 
 | 
			
		||||
                              ogs_diam_cx_xml_session_case_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                              ogs_diam_cx_xml_session_case_s,
 | 
			
		||||
                              "0",
 | 
			
		||||
                              ogs_diam_cx_xml_session_case_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_extension_s); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                              ogs_diam_cx_xml_extension_s);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                    user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_s, 
 | 
			
		||||
                                "0", 
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_e); 
 | 
			
		||||
                    user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_s,
 | 
			
		||||
                                "0",
 | 
			
		||||
                                ogs_diam_cx_xml_registration_type_e);
 | 
			
		||||
                    ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                              ogs_diam_cx_xml_extension_e); 
 | 
			
		||||
                  user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                              ogs_diam_cx_xml_extension_e);
 | 
			
		||||
                  ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                            ogs_diam_cx_xml_spt_e); 
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                            ogs_diam_cx_xml_spt_e);
 | 
			
		||||
                ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
              user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                          ogs_diam_cx_xml_tp_e); 
 | 
			
		||||
              user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                          ogs_diam_cx_xml_tp_e);
 | 
			
		||||
              ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
              user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                          ogs_diam_cx_xml_app_server_s); 
 | 
			
		||||
              user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                          ogs_diam_cx_xml_app_server_s);
 | 
			
		||||
              ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                            ogs_diam_cx_xml_server_name_s, 
 | 
			
		||||
                            self.sms_over_ims, 
 | 
			
		||||
                            ogs_diam_cx_xml_server_name_e); 
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                            ogs_diam_cx_xml_server_name_s,
 | 
			
		||||
                            self.sms_over_ims,
 | 
			
		||||
                            ogs_diam_cx_xml_server_name_e);
 | 
			
		||||
                ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s%s%s", 
 | 
			
		||||
                            ogs_diam_cx_xml_default_handling_s, 
 | 
			
		||||
                user_data = ogs_mstrcatf(user_data, "%s%s%s",
 | 
			
		||||
                            ogs_diam_cx_xml_default_handling_s,
 | 
			
		||||
                            "0",
 | 
			
		||||
                            ogs_diam_cx_xml_default_handling_e); 
 | 
			
		||||
                            ogs_diam_cx_xml_default_handling_e);
 | 
			
		||||
                ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
              user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
                          ogs_diam_cx_xml_app_server_e); 
 | 
			
		||||
              user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                          ogs_diam_cx_xml_app_server_e);
 | 
			
		||||
              ogs_assert(user_data);
 | 
			
		||||
 | 
			
		||||
            user_data = ogs_mstrcatf(user_data, "%s", 
 | 
			
		||||
            user_data = ogs_mstrcatf(user_data, "%s",
 | 
			
		||||
                        ogs_diam_cx_xml_ifc_e);
 | 
			
		||||
            ogs_assert(user_data);
 | 
			
		||||
        }
 | 
			
		||||
@@ -1215,7 +1215,7 @@ int hss_handle_change_event(const bson_t *document)
 | 
			
		||||
        bson_iter_recurse(&iter, &child1_iter);
 | 
			
		||||
        while (bson_iter_next(&child1_iter)) {
 | 
			
		||||
            const char *key = bson_iter_key(&child1_iter);
 | 
			
		||||
            if (!strcmp(key, "imsi") && 
 | 
			
		||||
            if (!strcmp(key, "imsi") &&
 | 
			
		||||
                    BSON_ITER_HOLDS_UTF8(&child1_iter)) {
 | 
			
		||||
                utf8 = (char *)bson_iter_utf8(&child1_iter, &length);
 | 
			
		||||
                imsi_bcd = ogs_strndup(utf8,
 | 
			
		||||
@@ -1234,44 +1234,44 @@ int hss_handle_change_event(const bson_t *document)
 | 
			
		||||
        bson_iter_recurse(&iter, &child1_iter);
 | 
			
		||||
        while (bson_iter_next(&child1_iter)) {
 | 
			
		||||
            const char *key = bson_iter_key(&child1_iter);
 | 
			
		||||
            if (!strcmp(key, "updatedFields") && 
 | 
			
		||||
            if (!strcmp(key, "updatedFields") &&
 | 
			
		||||
                    BSON_ITER_HOLDS_DOCUMENT(&child1_iter)) {
 | 
			
		||||
                bson_iter_recurse(&child1_iter, &child2_iter);
 | 
			
		||||
                while (bson_iter_next(&child2_iter)) {
 | 
			
		||||
                    const char *child2_key = bson_iter_key(&child2_iter);
 | 
			
		||||
                    if (!strcmp(child2_key, 
 | 
			
		||||
                            "request_cancel_location") && 
 | 
			
		||||
                    if (!strcmp(child2_key,
 | 
			
		||||
                            "request_cancel_location") &&
 | 
			
		||||
                            BSON_ITER_HOLDS_BOOL(&child2_iter)) {
 | 
			
		||||
                        send_clr_flag = (char *)bson_iter_bool(&child2_iter);
 | 
			
		||||
                    } else if (!strncmp(child2_key, 
 | 
			
		||||
                    } else if (!strncmp(child2_key,
 | 
			
		||||
                            "access_restriction_data",
 | 
			
		||||
                            strlen("access_restriction_data"))) {
 | 
			
		||||
                        send_idr_flag = true;
 | 
			
		||||
                        subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_ARD);
 | 
			
		||||
                    } else if (!strncmp(child2_key, 
 | 
			
		||||
                            "subscriber_status", 
 | 
			
		||||
                    } else if (!strncmp(child2_key,
 | 
			
		||||
                            "subscriber_status",
 | 
			
		||||
                            strlen("subscriber_status"))) {
 | 
			
		||||
                        send_idr_flag = true;
 | 
			
		||||
                        subdatamask = (subdatamask | 
 | 
			
		||||
                        subdatamask = (subdatamask |
 | 
			
		||||
                            OGS_DIAM_S6A_SUBDATA_SUB_STATUS);
 | 
			
		||||
                    } else if (!strncmp(child2_key, 
 | 
			
		||||
                    } else if (!strncmp(child2_key,
 | 
			
		||||
                            "network_access_mode",
 | 
			
		||||
                            strlen("network_access_mode"))) {
 | 
			
		||||
                        send_idr_flag = true;
 | 
			
		||||
                        subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_NAM);
 | 
			
		||||
                    } else if (!strncmp(child2_key, "ambr", strlen("ambr"))) {
 | 
			
		||||
                        send_idr_flag = true;
 | 
			
		||||
                        subdatamask = (subdatamask | 
 | 
			
		||||
                        subdatamask = (subdatamask |
 | 
			
		||||
                            OGS_DIAM_S6A_SUBDATA_UEAMBR);
 | 
			
		||||
                    } else if (!strncmp(child2_key, 
 | 
			
		||||
                    } else if (!strncmp(child2_key,
 | 
			
		||||
                            "subscribed_rau_tau_timer",
 | 
			
		||||
                            strlen("subscribed_rau_tau_timer"))) {
 | 
			
		||||
                        send_idr_flag = true;
 | 
			
		||||
                        subdatamask = (subdatamask | 
 | 
			
		||||
                        subdatamask = (subdatamask |
 | 
			
		||||
                            OGS_DIAM_S6A_SUBDATA_RAU_TAU_TIMER);
 | 
			
		||||
                    } else if (!strncmp(child2_key, "slice", strlen("slice"))) {
 | 
			
		||||
                        send_idr_flag = true;
 | 
			
		||||
                        subdatamask = (subdatamask | 
 | 
			
		||||
                        subdatamask = (subdatamask |
 | 
			
		||||
                            OGS_DIAM_S6A_SUBDATA_APN_CONFIG);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ static struct session_handler *hss_s6a_reg = NULL;
 | 
			
		||||
 | 
			
		||||
/* s6a Subscription-Data builder */
 | 
			
		||||
static int hss_s6a_avp_add_subscription_data(
 | 
			
		||||
    ogs_subscription_data_t *subscription_data, struct avp *avp, 
 | 
			
		||||
    ogs_subscription_data_t *subscription_data, struct avp *avp,
 | 
			
		||||
    uint32_t subdatamask);
 | 
			
		||||
 | 
			
		||||
struct sess_state {
 | 
			
		||||
@@ -825,7 +825,7 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
 | 
			
		||||
    ogs_assert(mme_host);
 | 
			
		||||
    ogs_assert(mme_realm);
 | 
			
		||||
 | 
			
		||||
    /* If UE is not purged at MME, determine if the MME sending the ULR 
 | 
			
		||||
    /* If UE is not purged at MME, determine if the MME sending the ULR
 | 
			
		||||
     * is different from the one that was last used.  if so, send CLR.
 | 
			
		||||
     */
 | 
			
		||||
    if (subscription_data.mme_host != NULL &&
 | 
			
		||||
@@ -843,7 +843,7 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Update database with current MME and timestamp */
 | 
			
		||||
    ogs_assert(OGS_OK == hss_db_update_mme(imsi_bcd, mme_host, mme_realm, 
 | 
			
		||||
    ogs_assert(OGS_OK == hss_db_update_mme(imsi_bcd, mme_host, mme_realm,
 | 
			
		||||
        false));
 | 
			
		||||
 | 
			
		||||
    ret = fd_msg_search_avp(qry, ogs_diam_s6a_terminal_information, &avp);
 | 
			
		||||
@@ -909,7 +909,7 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
 | 
			
		||||
        /* Set the Subscription Data */
 | 
			
		||||
        ret = fd_msg_avp_new(ogs_diam_s6a_subscription_data, 0, &avp);
 | 
			
		||||
        ogs_assert(ret == 0);
 | 
			
		||||
        rv = hss_s6a_avp_add_subscription_data(&subscription_data, 
 | 
			
		||||
        rv = hss_s6a_avp_add_subscription_data(&subscription_data,
 | 
			
		||||
            avp, OGS_DIAM_S6A_SUBDATA_ALL);
 | 
			
		||||
        if (rv != OGS_OK) {
 | 
			
		||||
            result_code = OGS_DIAM_S6A_ERROR_UNKNOWN_EPS_SUBSCRIPTION;
 | 
			
		||||
@@ -1059,7 +1059,7 @@ static int hss_ogs_diam_s6a_pur_cb( struct msg **msg, struct avp *avp,
 | 
			
		||||
    ogs_cpystrn(mme_realm, (char*)hdr->avp_value->os.data,
 | 
			
		||||
        ogs_min(hdr->avp_value->os.len, OGS_MAX_FQDN_LEN)+1);
 | 
			
		||||
 | 
			
		||||
    if (!strcmp(subscription_data.mme_host, mme_host) && 
 | 
			
		||||
    if (!strcmp(subscription_data.mme_host, mme_host) &&
 | 
			
		||||
            !strcmp(subscription_data.mme_realm, mme_realm)) {
 | 
			
		||||
        rv = hss_db_update_mme(imsi_bcd, mme_host, mme_realm, true);
 | 
			
		||||
        if (rv != OGS_OK) {
 | 
			
		||||
@@ -1074,7 +1074,7 @@ static int hss_ogs_diam_s6a_pur_cb( struct msg **msg, struct avp *avp,
 | 
			
		||||
    /* Set the PUA Flags */
 | 
			
		||||
    ret = fd_msg_avp_new(ogs_diam_s6a_pua_flags, 0, &avp);
 | 
			
		||||
    ogs_assert(ret == 0);
 | 
			
		||||
    if (!strcmp(subscription_data.mme_host, mme_host) && 
 | 
			
		||||
    if (!strcmp(subscription_data.mme_host, mme_host) &&
 | 
			
		||||
            !strcmp(subscription_data.mme_realm, mme_realm)) {
 | 
			
		||||
        val.i32 = OGS_DIAM_S6A_PUA_FLAGS_FREEZE_MTMSI;
 | 
			
		||||
    } else {
 | 
			
		||||
@@ -1145,7 +1145,7 @@ outnoexp:
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* HSS Sends Cancel Location Request to MME */
 | 
			
		||||
void hss_s6a_send_clr(char *imsi_bcd, char *mme_host, char *mme_realm, 
 | 
			
		||||
void hss_s6a_send_clr(char *imsi_bcd, char *mme_host, char *mme_realm,
 | 
			
		||||
    uint32_t cancellation_type)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
@@ -1168,7 +1168,7 @@ void hss_s6a_send_clr(char *imsi_bcd, char *mme_host, char *mme_realm,
 | 
			
		||||
 | 
			
		||||
    /* Create a new session */
 | 
			
		||||
    #define OGS_DIAM_S6A_APP_SID_OPT  "app_s6a"
 | 
			
		||||
    ret = fd_msg_new_session(req, (os0_t)OGS_DIAM_S6A_APP_SID_OPT, 
 | 
			
		||||
    ret = fd_msg_new_session(req, (os0_t)OGS_DIAM_S6A_APP_SID_OPT,
 | 
			
		||||
            CONSTSTRLEN(OGS_DIAM_S6A_APP_SID_OPT));
 | 
			
		||||
    ogs_assert(ret == 0);
 | 
			
		||||
    ret = fd_msg_sess_get(fd_g_config->cnf_dict, req, &session, NULL);
 | 
			
		||||
@@ -1228,7 +1228,7 @@ void hss_s6a_send_clr(char *imsi_bcd, char *mme_host, char *mme_realm,
 | 
			
		||||
    ret = fd_msg_avp_new(ogs_diam_s6a_clr_flags, 0, &avp);
 | 
			
		||||
    ogs_assert(ret == 0);
 | 
			
		||||
    if (cancellation_type == OGS_DIAM_S6A_CT_SUBSCRIPTION_WITHDRAWL) {
 | 
			
		||||
        val.u32 = (OGS_DIAM_S6A_CLR_FLAGS_REATTACH_REQUIRED | 
 | 
			
		||||
        val.u32 = (OGS_DIAM_S6A_CLR_FLAGS_REATTACH_REQUIRED |
 | 
			
		||||
            OGS_DIAM_S6A_CLR_FLAGS_S6A_S6D_INDICATOR);
 | 
			
		||||
    } else {
 | 
			
		||||
        val.u32 = OGS_DIAM_S6A_CLR_FLAGS_S6A_S6D_INDICATOR;
 | 
			
		||||
@@ -1257,7 +1257,7 @@ void hss_s6a_send_clr(char *imsi_bcd, char *mme_host, char *mme_realm,
 | 
			
		||||
    svg = sess_data;
 | 
			
		||||
 | 
			
		||||
    /* Store this value in the session */
 | 
			
		||||
    ret = fd_sess_state_store(hss_s6a_reg, session, &sess_data); 
 | 
			
		||||
    ret = fd_sess_state_store(hss_s6a_reg, session, &sess_data);
 | 
			
		||||
    ogs_assert(ret == 0);
 | 
			
		||||
    ogs_assert(sess_data == 0);
 | 
			
		||||
 | 
			
		||||
@@ -1355,7 +1355,7 @@ int hss_s6a_send_idr(char *imsi_bcd, uint32_t idr_flags, uint32_t subdatamask)
 | 
			
		||||
 | 
			
		||||
    /* Create a new session */
 | 
			
		||||
    #define OGS_DIAM_S6A_APP_SID_OPT  "app_s6a"
 | 
			
		||||
    ret = fd_msg_new_session(req, (os0_t)OGS_DIAM_S6A_APP_SID_OPT, 
 | 
			
		||||
    ret = fd_msg_new_session(req, (os0_t)OGS_DIAM_S6A_APP_SID_OPT,
 | 
			
		||||
            CONSTSTRLEN(OGS_DIAM_S6A_APP_SID_OPT));
 | 
			
		||||
    ogs_assert(ret == 0);
 | 
			
		||||
    ret = fd_msg_sess_get(fd_g_config->cnf_dict, req, &session, NULL);
 | 
			
		||||
@@ -1429,7 +1429,7 @@ int hss_s6a_send_idr(char *imsi_bcd, uint32_t idr_flags, uint32_t subdatamask)
 | 
			
		||||
            ret = hss_s6a_avp_add_subscription_data(&subscription_data,
 | 
			
		||||
                avp, subdatamask);
 | 
			
		||||
            if (ret != OGS_OK) {
 | 
			
		||||
                ogs_error("    [%s] Could not build Subscription-Data.", 
 | 
			
		||||
                ogs_error("    [%s] Could not build Subscription-Data.",
 | 
			
		||||
                    imsi_bcd);
 | 
			
		||||
                return OGS_ERROR;
 | 
			
		||||
            }
 | 
			
		||||
@@ -1447,7 +1447,7 @@ int hss_s6a_send_idr(char *imsi_bcd, uint32_t idr_flags, uint32_t subdatamask)
 | 
			
		||||
    svg = sess_data;
 | 
			
		||||
 | 
			
		||||
    /* Store this value in the session */
 | 
			
		||||
    ret = fd_sess_state_store(hss_s6a_reg, session, &sess_data); 
 | 
			
		||||
    ret = fd_sess_state_store(hss_s6a_reg, session, &sess_data);
 | 
			
		||||
    ogs_assert(ret == 0);
 | 
			
		||||
    ogs_assert(sess_data == 0);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user