📄 mgcpdef.c
字号:
* * Return value : * * Comments : * * History : * 2005/07/12 : Creation * * Date : July 12 2005, Frank ZHANG ******************************************************************************/void CopySdpMediaDescriptions(MEDIA_DESCRIPTIONS *pDesData, MEDIA_DESCRIPTIONS *pSrcData){ Assert(pDesData); if (pSrcData != NULL) { CopySdpMediaField(&pDesData->MediaField, &pSrcData->MediaField); pDesData->wNum = pSrcData->wNum; if (pDesData->wNum > 0) { WORD i; for (i = 0; i < pDesData->wNum; i++) CopySdpAttributeField(pDesData->pAttributeFields+i, pSrcData->pAttributeFields+i); } }}/******************************************************************************* * Function : ClearSdpConnectionDescriptor * * Description : Clear the Sdp Connection Descriptor * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/14 : Creation * * Date : July 14 2005, Frank ZHANG ******************************************************************************/void ClearSdpConnectionDescriptor(CONNECTION_DESCRIPTOR *pData){ if (pData != NULL) { if (pData->pConnectionField != NULL) { ClearSdpConnectionField(pData->pConnectionField); free(pData->pConnectionField); pData->pConnectionField = NULL; } if (pData->wAttributeNum > 0) { while (pData->wAttributeNum-- > 0) ClearSdpAttributeField(pData->pAttributeFields+pData->wAttributeNum); pData->wAttributeNum = 0; free(pData->pAttributeFields); pData->pAttributeFields = NULL; } if (pData->wMediaNum > 0) { while (pData->wMediaNum-- > 0) ClearSdpMediaDescriptions(pData->pMediaDesc+pData->wMediaNum); pData->wMediaNum = 0; free(pData->pMediaDesc); pData->pMediaDesc = NULL; } }}/******************************************************************************* * Function : CopySdpConnectionDescriptor * * Description : Copy the Sdp Connection Descriptor * * Input parameters : pDesData - Pointer to the destination data be copied into * pSrcData - Pointer to the source data to be copied * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/14 : Creation * * Date : July 14 2005, Frank ZHANG ******************************************************************************/void CopySdpConnectionDescriptor(CONNECTION_DESCRIPTOR *pDesData, CONNECTION_DESCRIPTOR *pSrcData){ WORD i; Assert(pDesData); if (pSrcData != NULL) { if (pSrcData->pConnectionField != NULL) { pDesData->pConnectionField = (CONNECTION_FIELD*)calloc(1, sizeof(CONNECTION_FIELD)); CopySdpConnectionField(pDesData->pConnectionField, pSrcData->pConnectionField); } pDesData->wAttributeNum = pSrcData->wAttributeNum; if (pDesData->wAttributeNum > 0) { pDesData->pAttributeFields = (ATTRIBUTE_FIELD*)calloc(pDesData->wAttributeNum, sizeof(ATTRIBUTE_FIELD)); for (i = 0; i < pDesData->wAttributeNum; i++) { StrClone(&pDesData->pAttributeFields[i].pcAttibuteName, pSrcData->pAttributeFields[i].pcAttibuteName); StrClone(&pDesData->pAttributeFields[i].pcAttibuteValue, pSrcData->pAttributeFields[i].pcAttibuteValue); } } pDesData->wMediaNum = pSrcData->wMediaNum; if (pDesData->wMediaNum > 0) { pDesData->pMediaDesc = (MEDIA_DESCRIPTIONS*)calloc(pDesData->wMediaNum, sizeof(MEDIA_DESCRIPTIONS)); for (i = 0; i < pDesData->wMediaNum; i++) CopySdpMediaDescriptions(pDesData->pMediaDesc+i, pSrcData->pMediaDesc+i); } }}/******************************************************************************* * Function : ClearResponseAck * * Description : Clear the Response Ack * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/14 : Creation * * Date : July 14 2005, Frank ZHANG ******************************************************************************/void ClearResponseAck(RESPONSE_ACK *pData){ if (pData != NULL) { if (pData->wNum > 0) { free(pData->pTranIdRange); pData->wNum = 0; pData->pTranIdRange = NULL; } }}/******************************************************************************* * Function : ClearBeaerAttribute * * Description : Clear the Beaer Attribute * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/14 : Creation * * Date : July 14 2005, Frank ZHANG ******************************************************************************/void ClearBeaerAttribute(BEARER_ATTRIBUTE *pData){ if (pData != NULL) { if (pData->pBearerExtension.pcExtenPackageName != NULL) { free(pData->pBearerExtension.pcExtenPackageName); pData->pBearerExtension.pcExtenPackageName = NULL; } if (pData->pBearerExtension.pcBearerExtenName != NULL) { free(pData->pBearerExtension.pcBearerExtenName); pData->pBearerExtension.pcBearerExtenName = NULL; } if (pData->pBearerExtension.pcBearerExtenValue != NULL) { free(pData->pBearerExtension.pcBearerExtenValue); pData->pBearerExtension.pcBearerExtenValue = NULL; } pData->eBearerEncodingType = 0; }}/******************************************************************************* * Function : ClearBearerInfo * * Description : Clear the Bearer Info * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/14 : Creation * * Date : July 14 2005, Frank ZHANG ******************************************************************************/void ClearBearerInfo(BEARER_INFO *pData){ if (pData != NULL) { if (pData->wNum > 0) { while (pData->wNum-- > 0) ClearBeaerAttribute(pData->pBearerAttributes+pData->wNum); free(pData->pBearerAttributes); pData->pBearerAttributes = NULL; } }}/******************************************************************************* * Function : CopyBearerInfo * * Description : Copy the Bearer Info * * Input parameters : pDesData - Pointer to the destination data be copied into * pSrcData - Pointer to the source data to be copied * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/14 : Creation * * Date : July 14 2005, Frank ZHANG ******************************************************************************/void CopyBearerInfo(BEARER_INFO *pDesData, BEARER_INFO *pSrcData){ WORD i; BEARER_ATTRIBUTE *pBearerAttri; Assert(pDesData); if (pSrcData != NULL && pSrcData->wNum > 0) { pDesData->wNum = pSrcData->wNum; pDesData->pBearerAttributes = (BEARER_ATTRIBUTE*)calloc(pDesData->wNum, sizeof(BEARER_ATTRIBUTE)); for (i = 0; i < pDesData->wNum; i++) { pBearerAttri = pDesData->pBearerAttributes + i; pBearerAttri->eBearerEncodingType = pSrcData->pBearerAttributes[i].eBearerEncodingType; if (pBearerAttri->eBearerEncodingType == BEARER_ENCODE_EXTENSION) { StrClone(&pBearerAttri->pBearerExtension.pcExtenPackageName, pSrcData->pBearerAttributes[i].pBearerExtension.pcExtenPackageName); StrClone(&pBearerAttri->pBearerExtension.pcBearerExtenName, pSrcData->pBearerAttributes[i].pBearerExtension.pcBearerExtenName); StrClone(&pBearerAttri->pBearerExtension.pcBearerExtenValue, pSrcData->pBearerAttributes[i].pBearerExtension.pcBearerExtenValue); } } }}/******************************************************************************* * Function : ClearNotifiedEntity * * Description : Clear the Notified Entity * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/14 : Creation * * Date : July 14 2005, Frank ZHANG ******************************************************************************/void ClearNotifiedEntity(NOTIFIED_ENTITY *pData){ if (pData != NULL) { if (pData->pcLocalName != NULL) { free(pData->pcLocalName); pData->pcLocalName = NULL; } if (pData->pcDomainName != NULL) { free(pData->pcDomainName); pData->pcDomainName = NULL; } pData->wAddrNum = 0; pData->wCurAddrIndex = 0; }}/******************************************************************************* * Function : CopyNotifiedEntity * * Description : Copy the Notified Entity * * Input parameters : pDesData - Pointer to the destination data be copied into * pSrcData - Pointer to the source data to be copied * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/14 : Creation * * Date : July 14 2005, Frank ZHANG ******************************************************************************/void CopyNotifiedEntity(NOTIFIED_ENTITY *pDesNE, NOTIFIED_ENTITY *pSrcNE){ Assert(pDesNE); Assert(pSrcNE); if (pSrcNE) { /* Copy the data */ StrClone(&pDesNE->pcLocalName, pSrcNE->pcLocalName); StrClone(&pDesNE->pcDomainName, pSrcNE->pcDomainName); pDesNE->wPort = pSrcNE->wPort; pDesNE->wAddrNum = pSrcNE->wAddrNum; pDesNE->wCurAddrIndex = pSrcNE->wCurAddrIndex; memcpy(pDesNE->pIPAddrList, pSrcNE->pIPAddrList, sizeof(pSrcNE->pIPAddrList)); }}/******************************************************************************* * Function : ClearCompressionAlgorithm * * Description : Clear the Compression Algorithm * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/15 : Creation * * Date : July 15 2005, Frank ZHANG ******************************************************************************/void ClearCompressionAlgorithm(COMPRESSION_ALGORITHM *pData){ if (pData != NULL) { if (pData->wNum > 0) { while (pData->wNum-- > 0) free(pData->ppcAlgorithmList[pData->wNum]); pData->wNum = 0; free(pData->ppcAlgorithmList); pData->ppcAlgorithmList = NULL; } }}/******************************************************************************* * Function : ClearEncriptionData * * Description : Clear the Encription Data * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/15 : Creation * * Date : July 15 2005, Frank ZHANG ******************************************************************************/void ClearEncriptionData(ENCRYPTION_DATA *pData){ if (pData != NULL) { if (pData->pEncryKey != NULL) { free(pData->pEncryKey); pData->pEncryKey = NULL; } pData->eType = 0; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -