mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
- all RAN code, CI code, configuration files, dockerfiles, in CSSL v1.0
- all deployment code (openshift, charts, ancillary files like shell
scripts), in MIT
- documentation in CC-BY-4.0
- exceptions might apply and are listed in NOTICE
- there is a new LICENSES folder with all licenses
- CONTRIBUTIONS.md has been updated accordingly
For automated changes based on OAI PL v1.1:
perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.{c,h,cpp}
perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.ts
perl -i~ -0pe 's/<!--.*Licensed to the OpenAirInterface.*openairinterface.org\n.*-->/<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->/s' **/*.xml
The rest (cmake, files with missing license, cmake) manually.
103 lines
3.4 KiB
C
103 lines
3.4 KiB
C
/*
|
|
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
|
*/
|
|
|
|
/*!
|
|
* \brief m2ap handler procedures for eNB
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "intertask_interface.h"
|
|
|
|
#include "m2ap_common.h"
|
|
#include "m2ap_eNB_defs.h"
|
|
#include "m2ap_eNB_handler.h"
|
|
#include "m2ap_decoder.h"
|
|
#include "m2ap_ids.h"
|
|
|
|
#include "m2ap_eNB_management_procedures.h"
|
|
#include "m2ap_eNB_generate_messages.h"
|
|
|
|
//#include "m2ap_MCE_interface_management.h"
|
|
#include "m2ap_eNB_interface_management.h"
|
|
|
|
#include "assertions.h"
|
|
#include "conversions.h"
|
|
|
|
/* Handlers matrix. Only eNB related procedure present here */
|
|
static const m2ap_eNB_message_decoded_callback m2ap_eNB_messages_callback[][3] = {
|
|
{eNB_handle_MBMS_SESSION_START_REQUEST, 0, 0}, /* MBMSSessionStart */
|
|
{eNB_handle_MBMS_SESSION_STOP_REQUEST, 0, 0}, /* MBMSSessionStop */
|
|
{eNB_handle_MBMS_SCHEDULING_INFORMATION, 0, 0}, /* MBMSSchedulingInformation */
|
|
{0, 0, 0}, /* Error Indication */
|
|
{0, 0, 0}, /* Reset */
|
|
{0, eNB_handle_M2_SETUP_RESPONSE, eNB_handle_M2_SETUP_FAILURE}, /* M2 Setup */
|
|
{0, 0, 0}, /* eNBConfigurationUpdate */
|
|
{0, 0, 0}, /* MCEConfigurationUpdate */
|
|
{0, 0, 0}, /* privateMessage */
|
|
{0, 0, 0}, /* MBMSSessionUpdate */
|
|
{0, 0, 0}, /* MBMSServiceCounting */
|
|
{0, 0, 0}, /* MBMSServiceCountingResultReport */
|
|
{0, 0, 0} /* MBMSOverloadNotification */
|
|
};
|
|
|
|
static char *m2ap_direction2String(int m2ap_dir) {
|
|
static char *m2ap_direction_String[] = {
|
|
"", /* Nothing */
|
|
"Originating message", /* originating message */
|
|
"Successfull outcome", /* successfull outcome */
|
|
"UnSuccessfull outcome", /* successfull outcome */
|
|
};
|
|
return(m2ap_direction_String[m2ap_dir]);
|
|
}
|
|
|
|
int m2ap_eNB_handle_message(instance_t instance,
|
|
sctp_assoc_t assoc_id,
|
|
int32_t stream,
|
|
const uint8_t *const data,
|
|
const uint32_t data_length)
|
|
{
|
|
M2AP_M2AP_PDU_t pdu;
|
|
int ret;
|
|
|
|
DevAssert(data != NULL);
|
|
|
|
memset(&pdu, 0, sizeof(pdu));
|
|
|
|
if (m2ap_decode_pdu(&pdu, data, data_length) < 0) {
|
|
LOG_E(M2AP, "Failed to decode PDU\n");
|
|
return -1;
|
|
}
|
|
|
|
/* Checking procedure Code and direction of message */
|
|
if (pdu.choice.initiatingMessage.procedureCode > sizeof(m2ap_eNB_messages_callback) / (3 * sizeof(
|
|
m2ap_message_decoded_callback))
|
|
|| (pdu.present > M2AP_M2AP_PDU_PR_unsuccessfulOutcome)) {
|
|
LOG_E(M2AP, "[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n",
|
|
assoc_id, pdu.choice.initiatingMessage.procedureCode, pdu.present);
|
|
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_M2AP_M2AP_PDU, &pdu);
|
|
return -1;
|
|
}
|
|
|
|
/* No handler present.
|
|
* This can mean not implemented or no procedure for eNB (wrong direction).
|
|
*/
|
|
if (m2ap_eNB_messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1] == NULL) {
|
|
LOG_E(M2AP, "[SCTP %d] No handler for procedureCode %ld in %s\n",
|
|
assoc_id, pdu.choice.initiatingMessage.procedureCode,
|
|
m2ap_direction2String(pdu.present - 1));
|
|
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_M2AP_M2AP_PDU, &pdu);
|
|
return -1;
|
|
}
|
|
|
|
/* Calling the right handler */
|
|
LOG_I(M2AP, "Calling handler with instance %ld\n",instance);
|
|
ret = (*m2ap_eNB_messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1])
|
|
(instance, assoc_id, stream, &pdu);
|
|
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_M2AP_M2AP_PDU, &pdu);
|
|
return ret;
|
|
}
|
|
|
|
|