/* * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "ogs-diameter-cx.h" #define CHECK_dict_search( _type, _criteria, _what, _result ) \ CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) ); struct dict_object *ogs_diam_cx_application = NULL; struct dict_object *ogs_diam_cx_cmd_uar = NULL; struct dict_object *ogs_diam_cx_cmd_uaa = NULL; struct dict_object *ogs_diam_cx_cmd_mar = NULL; struct dict_object *ogs_diam_cx_cmd_maa = NULL; struct dict_object *ogs_diam_cx_cmd_sar = NULL; struct dict_object *ogs_diam_cx_cmd_saa = NULL; struct dict_object *ogs_diam_cx_cmd_lir = NULL; struct dict_object *ogs_diam_cx_cmd_lia = NULL; struct dict_object *ogs_diam_cx_public_identity = NULL; struct dict_object *ogs_diam_cx_server_name = NULL; struct dict_object *ogs_diam_cx_sip_number_auth_items = NULL; struct dict_object *ogs_diam_cx_sip_item_number = NULL; struct dict_object *ogs_diam_cx_sip_auth_data_item = NULL; struct dict_object *ogs_diam_cx_sip_authentication_scheme = NULL; struct dict_object *ogs_diam_cx_sip_authenticate = NULL; struct dict_object *ogs_diam_cx_sip_authorization = NULL; struct dict_object *ogs_diam_cx_confidentiality_key = NULL; struct dict_object *ogs_diam_cx_integrity_key = NULL; struct dict_object *ogs_diam_cx_server_assignment_type = NULL; struct dict_object *ogs_diam_cx_user_data_already_available = NULL; struct dict_object *ogs_diam_cx_user_data = NULL; struct dict_object *ogs_diam_cx_charging_information = NULL; struct dict_object *ogs_diam_cx_primary_event_charging_function_name = NULL; struct dict_object *ogs_diam_cx_secondary_event_charging_function_name = NULL; struct dict_object *ogs_diam_cx_primary_charging_collection_function_name = NULL; struct dict_object *ogs_diam_cx_secondary_charging_collection_function_name = NULL; const char *ogs_diam_cx_xml_version=""; const char *ogs_diam_cx_xml_ims_subscription_s=""; const char *ogs_diam_cx_xml_ims_subscription_e=""; const char *ogs_diam_cx_xml_private_id_s=""; const char *ogs_diam_cx_xml_private_id_e=""; const char *ogs_diam_cx_xml_service_profile_s=""; const char *ogs_diam_cx_xml_service_profile_e=""; const char *ogs_diam_cx_xml_public_id_s=""; const char *ogs_diam_cx_xml_public_id_e=""; const char *ogs_diam_cx_xml_barring_indication_s=""; const char *ogs_diam_cx_xml_barring_indication_e=""; const char *ogs_diam_cx_xml_identity_s=""; const char *ogs_diam_cx_xml_identity_e=""; const char *ogs_diam_cx_xml_identity_type_s=""; const char *ogs_diam_cx_xml_identity_type_e=""; const char *ogs_diam_cx_xml_wildcarded_psi_s=""; const char *ogs_diam_cx_xml_wildcarded_psi_e=""; const char *ogs_diam_cx_xml_display_name_s=""; const char *ogs_diam_cx_xml_display_name_e=""; const char *ogs_diam_cx_xml_ifc_s=""; const char *ogs_diam_cx_xml_ifc_e=""; const char *ogs_diam_cx_xml_priority_s=""; const char *ogs_diam_cx_xml_priority_e=""; const char *ogs_diam_cx_xml_tp_s=""; const char *ogs_diam_cx_xml_tp_e=""; const char *ogs_diam_cx_xml_cnf_s=""; const char *ogs_diam_cx_xml_cnf_e=""; const char *ogs_diam_cx_xml_spt_s=""; const char *ogs_diam_cx_xml_spt_e=""; const char *ogs_diam_cx_xml_condition_negated_s=""; const char *ogs_diam_cx_xml_condition_negated_e=""; const char *ogs_diam_cx_xml_group_s=""; const char *ogs_diam_cx_xml_group_e=""; const char *ogs_diam_cx_xml_req_uri_s=""; const char *ogs_diam_cx_xml_req_uri_e=""; const char *ogs_diam_cx_xml_method_s=""; const char *ogs_diam_cx_xml_method_e=""; const char *ogs_diam_cx_xml_sip_hdr_s=""; const char *ogs_diam_cx_xml_sip_hdr_e=""; const char *ogs_diam_cx_xml_session_case_s=""; const char *ogs_diam_cx_xml_session_case_e=""; const char *ogs_diam_cx_xml_session_desc_s=""; const char *ogs_diam_cx_xml_session_desc_e=""; const char *ogs_diam_cx_xml_registration_type_s=""; const char *ogs_diam_cx_xml_registration_type_e=""; const char *ogs_diam_cx_xml_header_s="
"; const char *ogs_diam_cx_xml_header_e="
"; const char *ogs_diam_cx_xml_content_s=""; const char *ogs_diam_cx_xml_content_e=""; const char *ogs_diam_cx_xml_line_s=""; const char *ogs_diam_cx_xml_line_e=""; const char *ogs_diam_cx_xml_app_server_s=""; const char *ogs_diam_cx_xml_app_server_e=""; const char *ogs_diam_cx_xml_server_name_s=""; const char *ogs_diam_cx_xml_server_name_e=""; const char *ogs_diam_cx_xml_default_handling_s=""; const char *ogs_diam_cx_xml_default_handling_e=""; const char *ogs_diam_cx_xml_service_info_s=""; const char *ogs_diam_cx_xml_service_info_e=""; const char *ogs_diam_cx_xml_include_register_request=""; const char *ogs_diam_cx_xml_include_register_response=""; const char *ogs_diam_cx_xml_profile_part_ind_s=""; const char *ogs_diam_cx_xml_profile_part_ind_e=""; const char *ogs_diam_cx_xml_cn_services_auth_s=""; const char *ogs_diam_cx_xml_cn_services_auth_e=""; const char *ogs_diam_cx_xml_subs_media_profile_id_s=""; const char *ogs_diam_cx_xml_subs_media_profile_id_e=""; const char *ogs_diam_cx_xml_shared_ifc_set_id_s=""; const char *ogs_diam_cx_xml_shared_ifc_set_id_e=""; const char *ogs_diam_cx_xml_extension_s=""; const char *ogs_diam_cx_xml_extension_e=""; extern int ogs_dict_cx_entry(char *conffile); int ogs_diam_cx_init(void) { application_id_t id = OGS_DIAM_CX_APPLICATION_ID; ogs_assert(ogs_dict_cx_entry(NULL) == 0); CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID, (void *)&id, &ogs_diam_cx_application); CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "3GPP/User-Authorization-Request", &ogs_diam_cx_cmd_uar); CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "3GPP/User-Authorization-Answer", &ogs_diam_cx_cmd_uaa); CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "3GPP/Multimedia-Auth-Request", &ogs_diam_cx_cmd_mar); CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "3GPP/Multimedia-Auth-Answer", &ogs_diam_cx_cmd_maa); CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "3GPP/Server-Assignment-Request", &ogs_diam_cx_cmd_sar); CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "3GPP/Server-Assignment-Answer", &ogs_diam_cx_cmd_saa); CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "3GPP/Location-Info-Request", &ogs_diam_cx_cmd_lir); CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "3GPP/Location-Info-Answer", &ogs_diam_cx_cmd_lia); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Public-Identity", &ogs_diam_cx_public_identity); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Server-Name", &ogs_diam_cx_server_name); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "SIP-Number-Auth-Items", &ogs_diam_cx_sip_number_auth_items); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "SIP-Item-Number", &ogs_diam_cx_sip_item_number); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "SIP-Auth-Data-Item", &ogs_diam_cx_sip_auth_data_item); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "SIP-Authentication-Scheme", &ogs_diam_cx_sip_authentication_scheme); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "SIP-Authenticate", &ogs_diam_cx_sip_authenticate); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "SIP-Authorization", &ogs_diam_cx_sip_authorization); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Confidentiality-Key", &ogs_diam_cx_confidentiality_key); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Integrity-Key", &ogs_diam_cx_integrity_key); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Server-Assignment-Type", &ogs_diam_cx_server_assignment_type); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "User-Data-Already-Available", &ogs_diam_cx_user_data_already_available); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "User-Data", &ogs_diam_cx_user_data); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Information", &ogs_diam_cx_charging_information); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Primary-Event-Charging-Function-Name", &ogs_diam_cx_primary_event_charging_function_name); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Secondary-Event-Charging-Function-Name", &ogs_diam_cx_secondary_event_charging_function_name); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Primary-Charging-Collection-Function-Name", &ogs_diam_cx_primary_charging_collection_function_name); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Secondary-Charging-Collection-Function-Name", &ogs_diam_cx_secondary_charging_collection_function_name); return 0; }