Files
openairinterface5g/openair3/NAS/UE/EMM/SAP/emm_esm.c
T
Robert Schmidt 8107939f08 Change OAI license to CSSL v1.0 (and others)
- 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.
2026-03-27 16:36:37 +01:00

156 lines
5.6 KiB
C

/*
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
*/
/*****************************************************************************
Source emm_esm.c
Version 0.1
Date 2012/10/16
Product NAS stack
Subsystem EPS Mobility Management
Description Defines the EMMESM Service Access Point that provides
interlayer services to the EPS Session Management sublayer
for service registration and activate/deactivate PDN
connections.
*****************************************************************************/
#include "emm_esm.h"
#include "commonDef.h"
#include "nas_log.h"
#include "LowerLayer.h"
#include "emm_proc.h"
/****************************************************************************/
/**************** E X T E R N A L D E F I N I T I O N S ****************/
/****************************************************************************/
/****************************************************************************/
/******************* L O C A L D E F I N I T I O N S *******************/
/****************************************************************************/
/*
* String representation of EMMESM-SAP primitives
*/
const char *emm_esm_primitive2str(int esmprim) {
static const char *_emm_esm_primitive_str[] = {
"EMMESM_ESTABLISH_REQ",
"EMMESM_ESTABLISH_CNF",
"EMMESM_ESTABLISH_REJ",
"EMMESM_RELEASE_IND",
"EMMESM_UNITDATA_REQ",
"EMMESM_UNITDATA_IND",
};
return _emm_esm_primitive_str[esmprim];
}
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: emm_esm_initialize() **
** **
** Description: Initializes the EMMESM Service Access Point **
** **
** Inputs: None **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: NONE **
** **
***************************************************************************/
void emm_esm_initialize(void)
{
LOG_FUNC_IN;
/* TODO: Initialize the EMMESM-SAP */
LOG_FUNC_OUT;
}
/****************************************************************************
** **
** Name: emm_esm_send() **
** **
** Description: Processes the EMMESM Service Access Point primitive **
** **
** Inputs: msg: The EMMESM-SAP primitive to process **
** Others: None **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_esm_send(nas_user_t *user, const emm_esm_t *msg)
{
LOG_FUNC_IN;
int rc = RETURNerror;
emm_esm_primitive_t primitive = msg->primitive;
LOG_TRACE(INFO, "EMMESM-SAP - Received primitive %s (%d)",
emm_esm_primitive2str(primitive - _EMMESM_START - 1), primitive);
switch (primitive) {
case _EMMESM_ESTABLISH_REQ:
/* ESM requests EMM to initiate an attach procedure before
* requesting subsequent connectivity to additional PDNs */
rc = emm_proc_attach_restart(user);
break;
case _EMMESM_ESTABLISH_CNF:
/* ESM notifies EMM that PDN connectivity procedure successfully
* processed */
if (msg->u.establish.is_attached) {
if (msg->u.establish.is_emergency) {
/* Consider the UE attached for emergency bearer services
* only */
rc = emm_proc_attach_set_emergency(user->emm_data);
}
} else {
/* Consider the UE locally detached from the network */
rc = emm_proc_attach_set_detach(user);
}
break;
case _EMMESM_ESTABLISH_REJ:
/* ESM notifies EMM that PDN connectivity procedure failed */
break;
case _EMMESM_UNITDATA_REQ:
/* ESM requests EMM to transfer ESM data unit to lower layer */
rc = lowerlayer_data_req(user, &msg->u.data.msg);
break;
default:
break;
}
if (rc != RETURNok) {
LOG_TRACE(WARNING, "EMMESM-SAP - Failed to process primitive %s (%d)",
emm_esm_primitive2str(primitive - _EMMESM_START - 1),
primitive);
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/