Scopri come trovare un cuoco a domicilio perfetto per le tue esigenze! Questo articolo ti guiderà attraverso i passaggi fondamentali per scegliere il professionista giusto, valutare le competenze culinarie e garantire un servizio di alta qualità. Non perdere l'occasione di trasformare i tuoi pasti in esperienze uniche!
Trova professionisti vicino a te
Trova professionisti
/*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/********************************************************************20**
Name: MME NAS layer - S1AP
Type: C source file
Desc: C source code for MME NAS layer - S1AP
File: vb_mme_s1ap.c
Sid: vb_mme_s1ap.c@@/main/1 - Thu Jul 8 21:22:17 2010
Prg: sk
*********************************************************************21*/
/* header include files (.h) */
#include "envopt.h" /* environment options */
#include "envdep.h" /* environment dependent */
#include "envind.h" /* environment independent */
#include "gen.h" /* general layer */
#include "ssi.h" /* system services */
#include "cm_hash.h" /* common hashing */
#include "cm_err.h" /* common error */
#include "cm_llist.h" /* common link list */
#include "cm5.h" /* common timer */
#include "cm_tpt.h" /* common transport defines */
#include "cm_tpt_ul.h"
#include "cm_inet.h" /* common sockets */
#include "cm_dns.h" /* common DNS Library */
#include "cm_mblk.h" /* common memory link list library */
#include "cm_tkns.h" /* common tokens */
#include "cm_pasn.h" /* common ASN */
#include "vb_hss_common.h"
#include "vb_mme.h"
#include "vb_mme_s1ap.h"
#include "vb_hss_autn.h"
#include "vb_hss_edm.h"
#include "vb_s1_utl.h"
#include "vb_s1_enb.h"
#include "vb_s1_hndl.h"
#include "vb_s1_edm.h"
#include "vb_hss_enb.h"
#include "vb_hss.h"
#include "vb_s1_msg.h"
#include "vb_s1_utl.h"
#include "vb_mme_utl.h"
/* header/extern include files (.x) */
#include "gen.x" /* general layer */
#include "ssi.x" /* system services */
#include "cm_hash.x" /* common hashing */
#include "cm_lib.x" /* common library */
#include "cm_err.x" /* common error */
#include "cm_llist.x" /* common link list */
#include "cm5.x" /* common timer */
#include "cm_tpt.x" /* common transport typedefs */
#include "cm_tpt_ul.x"
#include "cm_inet.x" /* common sockets */
#include "cm_dns.x" /* common DNS Library */
#include "cm_mblk.x" /* common memory link list library */
#include "cm_tkns.x" /* common tokens */
#include "cm_pasn.x" /* common ASN */
#include "vb_hss_common.x"
#include "vb_mme.x"
#include "vb_mme_s1ap.x"
#include "vb_hss_autn.x"
#include "vb_hss_edm.x"
#include "vb_s1_utl.x"
#include "vb_s1_enb.x"
#include "vb_s1_hndl.x"
#include "vb_s1_edm.x"
#include "vb_hss_enb.x"
#include "vb_hss.x"
#include "vb_s1_msg.x"
#include "vb_s1_utl.x"
#include "vb_mme_utl.x"
/* local defines */
/* local typedefs */
/* local externs */
/* forward references */
#ifdef __cplusplus
extern "C" {
#endif
/************************************************************************
S1AP Interface
************************************************************************/
/*
*
* Fun: vbMmeHndlS1APMsg
*
* Desc: This function handles the S1AP messages
*
* Ret: ROK
*
* Notes: None
*
* File: vb_mme_s1ap.c
*
*/
#ifdef ANSI
PUBLIC S16 vbMmeHndlS1APMsg
(
VbMmeUeCb *ueCb,
VbMmeEnbCb *eNbCb,
S1apPdu *pdu
)
#else
PUBLIC S16 vbMmeHndlS1APMsg(ueCb, eNbCb, pdu)
VbMmeUeCb *ueCb;
VbMmeEnbCb *eNbCb;
S1apPdu *pdu;
#endif
{
S16 ret = ROK;
U32 mmeId;
VbMmeUeCb *ueCb1 = NULLP;
U8 msgType;
U32 presId;
VB_TRC2(vbMmeHndlS1APMsg);
VB_MME_DBG_INFO((VB_MME_PRNTBUF,
"Received S1AP message from eNodeB"));
/* Decode the message type */
ret = vbMmeUtlGetMsgType(pdu, &msgType);
if (ret != ROK)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Decoding S1AP message type failed"));
ret = RFAILED;
RETVALUE(ret);
}
VB_MME_DBG_INFO((VB_MME_PRNTBUF,
"Decoded S1AP message type: %d",
msgType));
switch (msgType)
{
case S1AP_PDU_INITIATINGMSG:
{
VbMmeUeCb *ueCb = NULLP;
ret = vbMmeUtlGetMmeId(pdu, &mmeId);
if (ret != ROK)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Decoding MME Id failed"));
ret = RFAILED;
break;
}
/* Check if UeCb is already present or not */
ret = vbMmeUtlFndUeCb(mmeId, &ueCb1);
if(ROK != ret)
{
VB_MME_DBG_INFO((VB_MME_PRNTBUF,
"UeCb not present, creating UeCb"));
/* Create a New UeCb */
ret = vbMmeUtlCreateUeCb(mmeId, &ueCb);
if (ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Creating UeCb failed"));
break;
}
ueCb->eNbCb = eNbCb;
ret = vbMmeUtlUpdUeCb(ueCb);
if (ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Updating UeCb failed"));
break;
}
ret = vbMmeHndlInStg(ueCb, pdu);
if (ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Handling Initial stage message failed"));
break;
}
}
else
{
/* Check if UeCb is in Init stage or not */
if (VB_MME_UE_ST_INIT == ueCb1->ueCtxt.ueSta.state)
{
VB_MME_DBG_INFO((VB_MME_PRNTBUF,
"UeCb already present, updating UeCb"));
/* Update the UeCb */
ueCb1->eNbCb = eNbCb;
ret = vbMmeUtlUpdUeCb(ueCb1);
if (ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Updating UeCb failed"));
break;
}
/* Handle the Initial stage message */
ret = vbMmeHndlInStg(ueCb1, pdu);
if (ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Handling Initial stage message failed"));
break;
}
}
else
{
VB_MME_DBG_INFO((VB_MME_PRNTBUF,
"UeCb present in non-Init stage, discarding"));
}
}
break;
}
case S1AP_PDU_SUCCESSFULOUTCOME:
{
ret = vbMmeUtlGetMmeId(pdu, &mmeId);
if (ret != ROK)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Decoding MME Id failed"));
ret = RFAILED;
break;
}
ret = vbMmeUtlFndUeCb(mmeId, &ueCb1);
if(ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"UeCb not present"));
ret = RFAILED;
break;
}
else
{
ret = vbMmeHndlSuccOut(ueCb1, pdu);
if (ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Handling Succ Outcome message failed"));
break;
}
}
break;
}
case S1AP_PDU_UNSUCCESSFULOUTCOME:
{
ret = vbMmeUtlGetMmeId(pdu, &mmeId);
if (ret != ROK)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Decoding MME Id failed"));
ret = RFAILED;
break;
}
ret = vbMmeUtlFndUeCb(mmeId, &ueCb1);
if(ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"UeCb not present"));
ret = RFAILED;
break;
}
else
{
ret = vbMmeHndlUnSuccOut(ueCb1, pdu);
if (ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Handling UnSucc Outcome message failed"));
break;
}
}
break;
}
case S1AP_PDU_INITIATINGMSG_UE_CTX_REL_CMD:
{
ret = vbMmeUtlGetMmeId(pdu, &mmeId);
if (ret != ROK)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Decoding MME Id failed"));
ret = RFAILED;
break;
}
ret = vbMmeUtlFndUeCb(mmeId, &ueCb1);
if(ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"UeCb not present"));
ret = RFAILED;
break;
}
else
{
ret = vbMmeHndlUeCtxtRelCmd(ueCb1, pdu);
if (ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Handling UE Context Release command failed"));
break;
}
}
break;
}
case S1AP_PDU_INITIATINGMSG_UE_CTX_REL_COMP:
{
ret = vbMmeUtlGetMmeId(pdu, &mmeId);
if (ret != ROK)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Decoding MME Id failed"));
ret = RFAILED;
break;
}
ret = vbMmeUtlFndUeCb(mmeId, &ueCb1);
if(ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"UeCb not present"));
ret = RFAILED;
break;
}
else
{
ret = vbMmeHndlUeCtxtRelComp(ueCb1, pdu);
if (ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Handling UE Context Release Complete failed"));
break;
}
}
break;
}
case S1AP_PDU_INITIATINGMSG_UE_CTX_MOD_REQ:
{
ret = vbMmeUtlGetMmeId(pdu, &mmeId);
if (ret != ROK)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"Decoding MME Id failed"));
ret = RFAILED;
break;
}
ret = vbMmeUtlFndUeCb(mmeId, &ueCb1);
if(ROK != ret)
{
VB_MME_DBG_ERROR((VB_MME_PRNTBUF,
"UeCb not present"));
ret = RFAILED;
break;
}
else
{
ret = vbMmeHndlS1UeCtxtModReq(ueCb1, pdu);
if (ROK != ret)