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

📄 isup.cpp.bak

📁 No。7七号信令网协议64K链路协议解码程序
💻 BAK
📖 第 1 页 / 共 5 页
字号:
}
////////////////////////////////////////////////////////////////////
////释放消息----REL		case  0x0C
BOOL CIsup::GetDataDecode_REL(BYTE *u_pMsg, DWORD u_msgLength, char *v_pParseData)   //释放
{
	int dataLength=0; 
	int strLength=0, indexByte=0;
	int i=0, j=0, k=0;
	int indexVarParm=0, indexOptParm=0;

	dataLength = u_msgLength - SS7_ISUP_H1H0_OFFSET;
	indexByte = SS7_ISUP_DATA_OFFSET;

	///////////////////////////////////////////////////////////////////////////////////////////
	//必备可变长 或 任选参数群 的指针
	strLength += sprintf(&v_pParseData[strLength], "\n******** PARAMETERS POINTER ********\n" );

	strLength += sprintf(&v_pParseData[strLength], \
        "%02X \t\t\t\t\t\t MVP \t\t\t :0x%02X\t\t  %s\n",   
        u_pMsg[indexByte], u_pMsg[indexByte],  \
		"必备可变长度参数指针" );	//Oft of Mandatory Var. Parameter
	indexVarParm = indexByte + (int)u_pMsg[indexByte]; 
	
	indexByte += 1;
	strLength += sprintf(&v_pParseData[strLength], \
        "%02X \t\t\t\t\t\t SOP \t\t\t :0x%02X\t\t  %s\n",   
        u_pMsg[indexByte], u_pMsg[indexByte],  \
		"任选参数群的开始位置指针" );	//Offset of Start of Optional Part
	indexOptParm = indexByte + (int)u_pMsg[indexByte];
 
	///////////////////////////////////////////////////////////////////////////////////////////////
	//必备可变长部分
	strLength += sprintf(&v_pParseData[strLength], "\n******** MANDATORY VARIABLE PART ********\n" );

	////////////////////////////////////////////
	//原因表示语((3~?)*8) 	Cause indicators
	strLength += sprintf(&v_pParseData[strLength], " === Cause Indicators === \n" );
 
	indexByte = indexVarParm;
	strLength += sprintf(&v_pParseData[strLength], \
        "%02X \t\t\t\t\t\t LEN \t\t\t :0x%02X\t\t  %s\n",   
        u_pMsg[indexByte], u_pMsg[indexByte],  \
		"必备可变长度参数长度" );	
	int nLenVarParm = 0;
	nLenVarParm = (int)u_pMsg[indexByte];

	indexByte += 1;
    strLength += sprintf(&v_pParseData[strLength], \
        "%02X \t\t\t\t\t\t LOC \t\t\t :....%d%d%d%d  %s\n",   
		u_pMsg[indexByte],  \
		(u_pMsg[indexByte]>>3 & 0x01),  (u_pMsg[indexByte]>>2 & 0x01), \
		(u_pMsg[indexByte]>>1 & 0x01),  (u_pMsg[indexByte] & 0x01), \
		m_locationID_Table[(u_pMsg[indexByte] & 0x0F)] );
    strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t SPARE \t\t :...%d....  \n",   
		(u_pMsg[indexByte]>>4 & 0x01) );
    strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t CODSTD  \t :.%d%d.....  %s\n",   
		(u_pMsg[indexByte]>>6 & 0x01),  (u_pMsg[indexByte]>>5 & 0x01), \
		m_codeStd2ID_Table[(u_pMsg[indexByte] & 0x03)] );
	strLength += sprintf(&v_pParseData[strLength], \
		"   \t\t\t\t\t\t EXT \t\t\t :%d.......  %s\n",   
		(u_pMsg[indexByte]>>7 & 0x01),  \
		((u_pMsg[indexByte]>>7 & 0x01) == 0x01) ? ("最后一个八位组") : ("信息在下一个八位组中继续") );

	indexByte += 1;
    strLength += sprintf(&v_pParseData[strLength], \
        "%02X \t\t\t\t\t\t CAUSE \t\t :.%d%d%d%d%d%d%d  %s\n",   
		u_pMsg[indexByte],  \
		(u_pMsg[indexByte]>>6 & 0x01),  \
		(u_pMsg[indexByte]>>5 & 0x01),  (u_pMsg[indexByte]>>4 & 0x01), \
		(u_pMsg[indexByte]>>3 & 0x01),  (u_pMsg[indexByte]>>2 & 0x01), \
		(u_pMsg[indexByte]>>1 & 0x01),  (u_pMsg[indexByte] & 0x01), \
		m_causeVal_Table[(u_pMsg[indexByte] & 0x7F)] );
	strLength += sprintf(&v_pParseData[strLength], \
		"   \t\t\t\t\t\t EXT \t\t\t :%d.......  %s\n",   
		(u_pMsg[indexByte]>>7 & 0x01),  \
		((u_pMsg[indexByte]>>7 & 0x01) == 0x01) ? ("最后一个八位组") : ("信息在下一个八位组中继续") );
	int flagOddEven;
	flagOddEven = (int)(u_pMsg[indexByte]>>7 & 0x01);
	////=============================================
	//"诊断码"有待进一步解析
	int nDiagByteCnt;
	nDiagByteCnt = 0;
	nLenVarParm -= 2;
	do{
		indexByte += 1;
		strLength += sprintf(&v_pParseData[strLength], "%02X ", u_pMsg[indexByte]);   
		nDiagByteCnt++;
	}while( (flagOddEven == 0x00) && (nDiagByteCnt < nLenVarParm) );
	strLength += sprintf(&v_pParseData[strLength], " \t\t DIAG : %s \n", "诊断码");   
	////=============================================

	////////////////////////////////////////////////////////////////////////////////////////////////
	//任选参数群部分
    strLength += sprintf(&v_pParseData[strLength], "\n******** OPTIONAL PARAMETERS PART ********\n" );
		
	indexByte = indexOptParm;
	while(indexByte < ((int)u_msgLength-1))
	{
	  switch(u_pMsg[indexByte])
	  {
	   case 0x13:	//改发信息 Redirection information
		    getOptionParm_13(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x0C:	//改发号码   Redirection number (与“被叫用户号码参数”完全相同) 
		    getOptionParm_0C(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x03:	//接入转送  Access transport
		    getOptionParm_03(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x1E:	//信令点编码  	Signalling point code (national use)
		    getOptionParm_1E(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x20:	//用户-用户信息  User-to-user information
		    getOptionParm_20(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x27:	//自动拥塞级  	Automatic congestion level
		    getOptionParm_27(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x2F:	//网络专用性能  Network specific facility (national use)
		    getOptionParm_2F(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x2E:	//接入转交信息  Access delivery information (目前暂不用)
		    getOptionParm_2E(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x39:	//参数兼容性信息  Parameter compatibility information
		    getOptionParm_39(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x2A:	//用户-用户表示语  User-to-user indicators
		    getOptionParm_2A(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

/*	   //(中文版协议中没有)  

	   case 0x73:	//显示信息   	Display information
		    getOptionParm_73(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;
	   case 0x32:	//远端操作  Remote operations (national use) (目前暂不使用)
		    getOptionParm_32(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;
*/
	   default:
			break;
	  } // switch(u_pMsg[indexByte])
	  indexByte += 1;
	  if(indexByte == ((int)u_msgLength-1))
	  {
		strLength += sprintf(&v_pParseData[strLength], " === End of Optional Parameters === \n" );
		strLength += sprintf(&v_pParseData[strLength], \
			"%02X \t\t\t\t\t\t END \t\t\t :0x%02X \t\t %s\n",   
			u_pMsg[indexByte], u_pMsg[indexByte],  \
			SS7_ISUP_OPTPARM_END );
	  }
	}
	return TRUE;
}

////////////////////////////////////////////////////////////////////
////连接消息----CON		case 0x07 
BOOL CIsup::GetDataDecode_CON(BYTE *u_pMsg, DWORD u_msgLength, char *v_pParseData)   //连接
{
	int dataLength=0; 
	int strLength=0, indexByte=0;
	int i=0, j=0, k=0;
	int indexVarParm=0, indexOptParm=0;

	dataLength = u_msgLength - SS7_ISUP_H1H0_OFFSET;
	indexByte = SS7_ISUP_DATA_OFFSET;

	////////////////////////////////////////////////////////////////////////////////////////////
	//必备固定长度
    strLength += sprintf(&v_pParseData[strLength], "\n******** MANDATORY FIXED PART ********\n" );

	////////////////////////////////////////////
	//后向呼叫表示语(16)  Backward call indicators
	strLength += sprintf(&v_pParseData[strLength], " === Backward Call Indicators === \n" );

    strLength += sprintf(&v_pParseData[strLength], \
        "%02X %02X  \t\t\t\t CHGID \t\t :......%d%d  %s\n",   
        u_pMsg[indexByte+1],  u_pMsg[indexByte],  \
		(u_pMsg[indexByte]>>1 & 0x01),  (u_pMsg[indexByte] & 0x01),\
		m_backwardCallID_BA_Table[(u_pMsg[indexByte]&0x03)] );
    strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t CPSID \t\t :....%d%d..  %s\n",   
		(u_pMsg[indexByte]>>3 & 0x01), (u_pMsg[indexByte]>>2 & 0x01), \
		m_backwardCallID_DC_Table[(u_pMsg[indexByte]>>2 & 0x03)] );
    strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t CPCID \t\t :..%d%d....  %s\n",   
		(u_pMsg[indexByte]>>5 & 0x01), (u_pMsg[indexByte]>>4 & 0x01), \
		m_backwardCallID_FE_Table[(u_pMsg[indexByte]>>4 & 0x03)] );
    strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t EEMID \t\t :%d%d......  %s\n",   
		(u_pMsg[indexByte]>>7 & 0x01), (u_pMsg[indexByte]>>6 & 0x01), \
		m_forwardCallID_CB_Table[(u_pMsg[indexByte]>>6 & 0x03)] );

	indexByte += 1;
    strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t IID \t\t\t :.......%d  %s\n",   
		(u_pMsg[indexByte] & 0x01),  \
		((u_pMsg[indexByte] & 0x01) == 0x01) ? ("遇到互通") : ("未遇到互通") );
	strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t EEIID \t\t :......%d.  %s\n",   
		(u_pMsg[indexByte]>>1 & 0x01),  \
		((u_pMsg[indexByte]>>1 & 0x01) == 0x01) ? ("端到端信息可用") : ("无端到端信息可用") );
	strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t IUPID \t\t :.....%d..  %s\n",   
		(u_pMsg[indexByte]>>2 & 0x01),  \
		((u_pMsg[indexByte]>>2 & 0x01) == 0x01) ? ("所以方向使用ISDN用户部分") : ("不是所以方向使用ISDN用户部分") );
    strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t HID \t\t\t :....%d...  %s\n", \
		(u_pMsg[indexByte]>>3 & 0x01),  \
		((u_pMsg[indexByte]>>3 & 0x01) == 0x01) ? ("请求保持") : ("未请求保持") );
    strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t ISDNAID \t :...%d....  %s\n", \
		(u_pMsg[indexByte]>>4 & 0x01),  \
		((u_pMsg[indexByte]>>4 & 0x01) == 0x01) ? ("终端接入ISDN") : ("终端接入非ISDN") );
    strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t ECDID \t\t :..%d.....  %s\n", \
		(u_pMsg[indexByte]>>5 & 0x01),  \
		((u_pMsg[indexByte]>>5 & 0x01) == 0x01) ? ("包括来话半回声控制装置") : ("未包括来话半回声控制装置") );
    strLength += sprintf(&v_pParseData[strLength], \
        "   \t\t\t\t\t\t SCCPID  \t :%d%d......  %s\n", \
		(u_pMsg[indexByte] >> 7) & 0x01, (u_pMsg[indexByte] >> 6) & 0x01,  \
		m_forwardCallID_KJ_Table[(u_pMsg[indexByte]>>6 & 0x03)] );

	///////////////////////////////////////////////////////////////////////////////////////////
	//必备可变长 或 任选参数群 的指针
    strLength += sprintf(&v_pParseData[strLength], "\n******** PARAMETERS POINTER ********\n" );
		  
	indexByte += 1;
	strLength += sprintf(&v_pParseData[strLength], \
        "%02X \t\t\t\t\t\t SOP \t\t\t :0x%02X\t\t  %s\n",   
        u_pMsg[indexByte], u_pMsg[indexByte],  \
		"任选参数群的开始位置指针" );	//Offset of Start of Optional Part
	indexOptParm = indexByte + (int)u_pMsg[indexByte];

	////////////////////////////////////////////////////////////////////////////////////////////////
	//任选参数群部分
    strLength += sprintf(&v_pParseData[strLength], "\n******** OPTIONAL PARAMETERS PART ********\n" );
		
	indexByte = indexOptParm;
	while(indexByte < ((int)u_msgLength-1))
	{
	  switch(u_pMsg[indexByte])
	  {
	   case 0x29:	//任选后向呼叫表示语  Optional backward call indicators
		    getOptionParm_29(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

/*	   //(中文版协议中没有)  
	   case 0x4D:	//后向 GVNS   Backward GVNS 
		    getOptionParm_4D(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;
*/
	   case 0x21:	//被连接的号码   Connected number 
		    getOptionParm_21(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x01:	//呼叫参考  Call reference (national use) (目前暂不用)
		    getOptionParm_01(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x2A:	//用户-用户表示语  User-to-user indicators
		    getOptionParm_2A(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x20:	//用户-用户信息  User-to-user information
		    getOptionParm_20(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByte+1] + 1);
			strLength = strlen(v_pParseData);
			break;

	   case 0x03:	//接入转送  Access transport
		    getOptionParm_03(u_pMsg, strLength, indexByte, v_pParseData);
			indexByte += ((int)u_pMsg[indexByt

⌨️ 快捷键说明

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