⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 layerapp.cpp

📁 map协议源代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
            presubhoRsp_print(&(hoEv->preSubHoRsp));
            break;
        case MA_SNDENDSIG:
            sndendsigRsp_print(&(hoEv->sndEndSigRsp));
            break;
    }
    
    qElm.evtType = MA_EVTHOMGMTCFM;
    qElm.suId    = suId;
    qElm.suDlgId = suDlgId;
    qElm.spDlgId = spDlgId;
    qElm.s.operEv.invId.pres = invkId->pres;
    qElm.s.operEv.invId.octet = invkId->octet;
    qElm.s.operEv.oprCode = oprType;

#if 0  /* ma009.14:change - old code */
    cmCpy((PTR)usrErr, (PTR)&qElm.s.operEv.usrErr, sizeof(MaUsrErr));
    cmCpy((PTR)prvErr, (PTR)&qElm.s.operEv.prvErr, sizeof(MaPrvErr));
    cmCpy((PTR)hoEv, (PTR)&qElm.s.operEv.oprEv.hoEv, sizeof(MaHoEv));
#else  /* ma009.14:change - new code */
    if(usrErr != NULLP)
    {
        cmCpy((PTR)usrErr, (PTR)&qElm.s.operEv.usrErr, sizeof(MaUsrErr));
    }
    if(prvErr != NULLP)
    {
        cmCpy((PTR)prvErr, (PTR)&qElm.s.operEv.prvErr, sizeof(MaPrvErr));
    }
    if(hoEv != NULLP)
    {
        cmCpy((PTR)hoEv, (PTR)&qElm.s.operEv.oprEv.hoEv, sizeof(MaHoEv));
    }
#endif /* ma009.14:change */
    RETVALUE(ROK);
} /* end of AppLiMatHOMgmtCfm */


#endif /* MAP_MSC */

/* --------------- Location Management ----------------------------- */
#if (MAP_MSC || MAP_VLR || MAP_HLR || MAP_GSN)

/*
*
*       Fun:  AppLiMatLocMgmtCfm
*
*       Desc:  This function handles the  Confirm for Location Management
*              services from the MAP user.
*
*       Ret:   ROK      - ok
*
*       Notes: None
*
*       File:  layerapp.c
*
*/

#ifdef ANSI
PUBLIC S16 AppLiMatLocMgmtCfm
(
Pst        *pst,            /* post structure */
SuId       suId,            /* service user id */
MaDlgId    suDlgId,         /* Service user dialogue Id */
MaDlgId    spDlgId,         /* Service provider dialogue Id */
MaInvokeId *invkId,         /* Invoke Id */
MaOprType  oprType,         /* Operation type */
MaUsrErr   *usrErr,         /* User Error */
MaPrvErr   *prvErr,         /* provider Error */
MaLocEv    *locEv           /* Location Event Structure */
)
#else
PUBLIC S16 AppLiMatLocMgmtCfm(pst, suId, suDlgId, spDlgId, invkId, oprType, usrErr, prvErr, locEv)
Pst      *pst;              /* post structure */
SuId     suId;              /* service user id */
MaDlgId  suDlgId;           /* Service user dialogue Id */
MaDlgId  spDlgId;           /* Service provider dialogue Id */
MaInvokeId *invkId;         /* Invoke Id */
MaOprType  oprType;         /* Operation type */
MaUsrErr  *usrErr;          /* User Error */
MaPrvErr  *prvErr;          /* provider Error */
MaLocEv    *locEv;          /* Location Event Structure */
#endif
{
/*  Txt prntBuf[MA_PRNTBUF_SIZE];*/
    MaAccMsgQElm  qElm;
    
    TRC2(AppLiMatLocMgmtCfm)
    
    AUACC_PRINT("MAP Location Management Cfm suId %d - SuDlgId %3ld   SpDlgId %3ld Operation %d\n", suId, suDlgId, spDlgId, oprType);

/* Sts */
    smAuSts.lAuOprCfm++;
    qElm.evtType = MA_EVTLOCMGMTCFM;
    qElm.suId    = suId;
    qElm.suDlgId = suDlgId;
    qElm.spDlgId = spDlgId;
    qElm.s.operEv.invId.pres = invkId->pres;
    qElm.s.operEv.invId.octet = invkId->octet;
    qElm.s.operEv.oprCode = oprType;
#if 0  /* ma009.14:change - old code */
    cmCpy((PTR)usrErr, (PTR)&qElm.s.operEv.usrErr, sizeof(MaUsrErr));
    cmCpy((PTR)prvErr, (PTR)&qElm.s.operEv.prvErr, sizeof(MaPrvErr));
    cmCpy((PTR)locEv, (PTR)&qElm.s.operEv.oprEv.locEv, sizeof(MaLocEv));
#else  /* ma009.14:change - new code */
    if(usrErr != NULLP)
    {
        cmCpy((PTR)usrErr, (PTR)&qElm.s.operEv.usrErr, sizeof(MaUsrErr));
    }
    if(prvErr != NULLP)
    {
        cmCpy((PTR)prvErr, (PTR)&qElm.s.operEv.prvErr, sizeof(MaPrvErr));
    }
    if(locEv != NULLP)
    {
        cmCpy((PTR)locEv, (PTR)&qElm.s.operEv.oprEv.locEv, sizeof(MaLocEv));
    }
#endif /* ma009.14:change */

    Dialog              *curDlg;

#ifdef _MULTI_THREAD
    pthread_mutex_lock(&(dlgQueue->Lock));
#endif

    curDlg = dlgQueue->dlgFind(suDlgId, spDlgId);
    
#ifdef _MULTI_THREAD
    pthread_mutex_unlock(&(dlgQueue->Lock));
#endif

    if (curDlg == NULLP)
    {
        AUACC_PRINT("AppLiMatUpLocCfm__________Find dlg %ld failure \n",suDlgId);
    }
    else
    {
        curDlg->auLiMatUpLocCfmPrs(&qElm);
    }
    RETVALUE(ROK);
} /* end of AppLiMatLocMgmtCfm */


#endif /* MAP_MSC || MAP_VLR || MAP_HLR || MAP_GSN */

#if (MAP_VLR || MAP_HLR || MAP_GSN)

/*
*
*       Fun:   AppLiMatLocMgmtInd
*
*       Desc:  This function handles the indication for Location Management
*              services from the MAP user.
*
*       Ret:   ROK      - ok
*
*       Notes: None
*
*       File:  layerapp.c
*
*/

#ifdef ANSI
PUBLIC S16 AppLiMatLocMgmtInd
(
Pst        *pst,            /* post structure */
SuId       suId,            /* service user id */
MaDlgId    suDlgId,         /* Service user dialogue Id */
MaDlgId    spDlgId,         /* Service provider dialogue Id */
MaInvokeId *invkId,         /* Invoke Id */
MaOprType  oprType,         /* Operation type */
MaLocEv    *locEv           /* Location Event Structure */
)
#else
PUBLIC S16 AppLiMatLocMgmtInd(pst, suId, suDlgId, spDlgId, invkId, oprType, locEv)
Pst      *pst;              /* post structure */
SuId     suId;              /* service user id */
MaDlgId  suDlgId;           /* Service user dialogue Id */
MaDlgId  spDlgId;           /* Service provider dialogue Id */
MaInvokeId *invkId;         /* Invoke Id */
MaOprType  oprType;         /* Operation type */
MaLocEv    *locEv;          /* Location Event Structure */
#endif
{
#ifdef VERBOSE
    Txt prntBuf[MA_PRNTBUF_SIZE];
#endif
    MaAccMsgQElm  qElm;
    
    TRC2(AppLiMatLocMgmtInd)
    
    AUACC_PRINT("MAP Location Management Ind suId %d - SuDlgId %3ld   SpDlgId %3ld Operation %d\n", suId, suDlgId, spDlgId, oprType);

/* Added by Bruce 2004/3/17 begin*/
    if(oprType == MA_UPLOC)
        uplocrsp_print(&locEv->upLocReq);

/* Added by Bruce 2004/3/17 end*/

    qElm.evtType = MA_EVTLOCMGMTIND;
    qElm.suId    = suId;
    qElm.suDlgId = suDlgId;
    qElm.spDlgId = spDlgId;
    qElm.s.operEv.invId.pres = invkId->pres;
    qElm.s.operEv.invId.octet = invkId->octet;
    qElm.s.operEv.oprCode = oprType;
#if 0  /* ma009.14:change - old code */
    cmCpy((PTR)locEv, (PTR)&qElm.s.operEv.oprEv.locEv, sizeof(MaLocEv));
#else  /* ma009.14:change - new code */
    if(locEv != NULLP)
    {
        cmCpy((PTR)locEv, (PTR)&qElm.s.operEv.oprEv.locEv, sizeof(MaLocEv));
    }
#endif /* ma009.14:change */
    Dialog              *curDlg;

#ifdef _MULTI_THREAD
    pthread_mutex_lock(&(dlgQueue->Lock));
#endif

    curDlg = dlgQueue->dlgFind(suDlgId, spDlgId);

#ifdef _MULTI_THREAD
    pthread_mutex_unlock(&(dlgQueue->Lock));
#endif

    if (curDlg == NULLP)
    {
        AUACC_PRINT("AppLiMatUpLocInd__________Find dlg %ld failure \n",suDlgId);
    }
    else
    {
        curDlg->auLiMatUpLocIndPrs(&qElm);
    }
    smAuSts.lAuOprInd++;
    RETVALUE(ROK);
} /* end of AppLiMatLocMgmtInd */

#endif /* MAP_VLR || MAP_HLR || MAP_GSN */

/* --------------- Authentication Management ------------------------ */
#if (MAP_VLR || MAP_GSN)

/*
*
*       Fun:   upper interface - Authintication Management Confirm
*
*       Desc:  This function handles the Confirm for Authintication
*              services from the MAP user
*
*       Ret:   ROK      - ok
*
*       Notes: None
*
*       File:  layerapp.c
*
*/

#ifdef ANSI
PUBLIC S16 AppLiMatAuthMgmtCfm
(
Pst        *pst,            /* post structure */
SuId       suId,            /* service user id */
MaDlgId    suDlgId,         /* Service user dialogue Id */
MaDlgId    spDlgId,         /* Service provider dialogue Id */
MaInvokeId *invkId,         /* Invoke Id */
MaOprType  oprType,         /* Operation type */
MaUsrErr   *usrErr,         /* User Error */
MaPrvErr   *prvErr,         /* provider Error */
MaAuthEv    *authEv         /* Authintication Event Structure */
)
#else
PUBLIC S16 AppLiMatAuthMgmtCfm(pst, suId, suDlgId, spDlgId, invkId, oprType, usrErr,prvErr, authEv)
Pst      *pst;              /* post structure */
SuId     suId;              /* service user id */
MaDlgId  suDlgId;           /* Service user dialogue Id */
MaDlgId  spDlgId;           /* Service provider dialogue Id */
MaInvokeId *invkId;         /* Invoke Id */
MaOprType  oprType;         /* Operation type */
MaUsrErr  *usrErr;          /* User Error */
MaPrvErr  *prvErr;          /* provider Error */
MaAuthEv    *authEv;        /* Authintication Event Structure */
#endif
{
    MaAccMsgQElm  qElm;
    
    TRC2(AppLiMatAuthMgmtCfm)
    
    AUACC_PRINT("MAP Authintication Management Cfm suId %d - SuDlgId %3ld   SpDlgId %3ld Operation %d\n", suId, suDlgId, spDlgId, oprType);
    
    qElm.evtType = MA_EVTAUTHMGMTCFM;
    qElm.suId    = suId;
    qElm.suDlgId = suDlgId;
    qElm.spDlgId = spDlgId;
    qElm.s.operEv.invId.pres = invkId->pres;
    qElm.s.operEv.invId.octet = invkId->octet;
    qElm.s.operEv.oprCode = oprType;

#if 0  /* ma009.14:change - old code */
    cmCpy((PTR)usrErr, (PTR)&qElm.s.operEv.usrErr, sizeof(MaUsrErr));
    cmCpy((PTR)prvErr, (PTR)&qElm.s.operEv.prvErr, sizeof(MaPrvErr));
    cmCpy((PTR)authEv, (PTR)&qElm.s.operEv.oprEv.authEv, sizeof(MaAuthEv));
#else  /* ma009.14:change - new code */
    if(usrErr != NULLP)
    {
        cmCpy((PTR)usrErr, (PTR)&qElm.s.operEv.usrErr, sizeof(MaUsrErr));
    }
    if(prvErr != NULLP)
    {
        cmCpy((PTR)prvErr, (PTR)&qElm.s.operEv.prvErr, sizeof(MaPrvErr));
    }
    if(authEv != NULLP)
    {
        cmCpy((PTR)authEv, (PTR)&qElm.s.operEv.oprEv.authEv, sizeof(MaAuthEv));
    }
#endif /* ma009.14:change */

/* added by Bruce for map performence test 2004/9/21 begin */

 if(prvErr->pres == TRUE && prvErr->errCode == MA_NO_RSP_PEER)
 {
 	MaAbrtEv abrtEv;
	Dialog *curDlg;
    AUACC_PRINT("MAP Authintication Management Cfm Error! send Abort.");
    
	abrtEv.abrtReason = MA_ABRT_APC;
	
 	AuLiMatAbrtReq(&dlgQueue->auPst, suId,  suDlgId,  spDlgId, &abrtEv);

	curDlg = dlgQueue->dlgFind(suDlgId, spDlgId);

	if (curDlg != NULLP)
	{	
		if (dlgQueue->dlgDelete(suDlgId) != ROK)
			AUACC_PRINT("Dialog delete failed, file: %s  line: %d \n" ,__FILE__,__LINE__);
	
	}
	
 }	
/* added by Bruce for map performence test 2004/9/21 end */


    RETVALUE(ROK);
} /* end of AppLiMatAuthMgmtCfm */

#endif /* MAP_VLR || MAP_GSN */

#if MAP_HLR


/*
*
*       Fun:   upper interface - Authintication Management Indication
*
*       Desc:  This function handles the  indication for Authintication
*              services from the MAP user.
*
*       Ret:   ROK      - ok
*
*       Notes: None
*
*       File:  layerapp.c
*
*/

#ifdef ANSI
PUBLIC S16 AppLiMatAuthMgmtInd
(
Pst        *pst,            /* post structure */
SuId       suId,            /* service user id */
MaDlgId    suDlgId,         /* Service user dialogue Id */
MaDlgId    spDlgId,         /* Service provider dialogue Id */
MaInvokeId *invkId,         /* Invoke Id */
MaOprType  oprType,         /* Operation type */
MaAuthEv    *authEv         /* Authintication Event Structure */
)
#else
PUBLIC S16 AppLiMatAuthMgmtInd(pst, suId, suDlgId, spDlgId, invkId, oprType, authEv)
Pst      *pst;              /* post structure */
SuId     suId;              /* service user id */
MaDlgId  suDlgId;           /* Service user dialogue Id */
MaDlgId  spDlgId;           /* Service provider dialogue Id */
MaInvokeId *invkId;         /* Invoke Id */
MaOprType  oprType;         /* Operation type */
MaAuthEv    *authEv;        /* Authintication Event Structure */
#endif
{
    MaAccMsgQElm  qElm;
    Dialog              *curDlg;
    
    TRC2(AppLiMatAuthMgmtInd)
    
    AUACC_PRINT("MAP Authintication Management Ind suId %d - SuDlgId %3ld   SpDlgId %3ld Operation %d\n", suId, suDlgId, spDlgId, oprType);
    
    qElm.evtType = MA_EVTAUTHMGMTIND;
    qElm.suId    = suId;
    qElm.suDlgId = suDlgId;
    qElm.spDlgId = spDlgId;
    qElm.s.operEv.invId.pres = invkId->pres;
    qElm.s.operEv.invId.octet = invkId->octet;
    qElm.s.operEv.oprCode = oprType;

#ifdef _MULTI_THREAD
    pthread_mutex_lock(&(dlgQueue->Lock));
#endif

    curDlg = dlgQueue->dlgFind(suDlgId, spDlgId);

#ifdef _MULTI_THREAD
    pthread_mutex_unlock(&(dlgQueue->Lock));
#endif

    if(authEv != NULLP)
    {
        cmCpy((PTR)authEv, (PTR)&qElm.s.operEv.oprEv.authEv, sizeof(MaAuthEv));
    }
    
    if (curDlg == NULLP)
    {
        AUACC_PRINT("[AppLiMatAuthInfoInd]--Find dlg %ld failure \n",suDlgId);
    }
    else
    {
        curDlg->auLiMatUpLocIndPrs(&qElm);
    }
    RETVALUE(ROK);
} /* end of AppLiMatAuthMgmtInd */

#endif /* MAP_HLR */

/* --------------- Identification Management ------------------------ */
#if (MAP_MSC || MAP_VLR || MAP_GSN)

/*
*
*       Fun:   upper interface - IMEI Management Indication
*
*       Desc:  This function handles the  indication for IMEI Management
*              services from the MAP user.
*
*       Ret:   ROK      - ok
*
*       Notes: None
*
*       File:  layerapp.c
*

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -