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

📄 ss7tranpar3.cpp

📁 VC6.0环境下的ss7isup部分的信令解释程序
💻 CPP
📖 第 1 页 / 共 2 页
字号:

#include "stdafx.h"
#include "ss7tran.h"
#include "ss7tranDlg.h"
#include "isup_def.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

extern char strchangehex(CString str1);


void CSs7tranDlg:: tranpar_Hop_counter(CString str)
{
}

void CSs7tranDlg:: tranpar_Information_indicators(CString str)
{
	long lpar;
	long ltemp,tt;
	long i;
	CString str1;
	CString stroutput;
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 ) ; 	

	stroutput=str;
	stroutput+=":Information indicators";
	pCtrl->AddString(stroutput);

	
	str1=str.Left(2);
	str.Delete(0,3);
	lpar=strchangehex(str1);

	stroutput=strbithead;
	stroutput+="bit BA:Calling party address response indicator";
	pCtrl->AddString(stroutput);

	stroutput=strtranhead;
	ltemp=(lpar&3);
	lpar>>=2;	
	switch (ltemp)
	{
		case 00:
			stroutput+="00__calling party address not included";
		break;
		case 1:
			stroutput+="01__calling party address not available";
		break;
		case 2:
			stroutput+="10__spare";
		break;
		case 3:
			stroutput+="11__calling party address included";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput="bit C:Hold provided indicator ";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__hold not provided";
		break;
		case 1:
			stroutput+="1__hold provided";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput="bit ED:spare";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&2);
	lpar>>=2;	
	switch (ltemp)
	{
		case 0:
			stroutput+="00";
		break;
		case 1:
			stroutput+="01";
		break;
		case 2:
			stroutput+="10";
		break;
		case 3:
			stroutput+="11";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput="bit F:Calling party's category response indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__calling party's category not included";
		break;
		case 1:
			stroutput+="1__calling party's category included";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput="bit G:Charge information response indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__charge information not included";
		break;
		case 1:
			stroutput+="1__charge information included";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);


	stroutput=strbithead;
	stroutput="bit H:Solicited information indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__solicited";
		break;
		case 1:
			stroutput+="1__unsolicited";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	str1=str.Left(2);
	str.Delete(0,2);
	lpar=strchangehex(str1);
	
	stroutput=strbithead;
	stroutput="   bit LKJI:Spare";
	pCtrl->AddString(stroutput);
	ltemp=(lpar&4);
	lpar>>=4;	
	tt=0x8;
	stroutput=strtranhead;
	for(i=0;i<4;i++)
	{
		ltemp=(lpar&tt)>>(3-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput="bit PONM:Reserved";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&4);
	lpar>>=4;	
	tt=0x8;
	for(i=0;i<4;i++)
	{
		ltemp=(lpar&tt)>>(3-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	pCtrl->AddString(stroutput);
}



void CSs7tranDlg:: tranpar_Information_request_indicators(CString str)
{
	long lpar;
	long ltemp,tt;
	long i;
	CString str1;
	CString stroutput;
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 ) ; 	

	stroutput=str;
	stroutput+=":Information indicators";
	pCtrl->AddString(stroutput);

	
	str1=str.Left(2);
	str.Delete(0,3);
	lpar=strchangehex(str1);

	stroutput=strbithead;
	stroutput+="bit A:Calling party address request indicator";
	pCtrl->AddString(stroutput);

	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__calling party address not requested";
		break;
		case 1:
			stroutput+="1__calling party address requested";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit B:Holding indicator ";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__holding not requested";
		break;
		case 1:
			stroutput+="1__holding requested";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit C:Spare";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0";
		break;
		case 1:
			stroutput+="1";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit D:Calling party's category request indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__calling party's category not requested";
		break;
		case 1:
			stroutput+="1__calling party's category requested";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit E:Charge information request indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__charge information not requested";
		break;
		case 1:
			stroutput+="1__charge information requested";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);


	stroutput=strbithead;
	stroutput+="bit GF:Spare";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&2);
	lpar>>=2;	
	switch (ltemp)
	{
		case 0:
			stroutput+="00";
		break;
		case 1:
			stroutput+="01";
		break;
		case 2:
			stroutput+="10";
		break;
		case 3:
			stroutput+="11";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit H:Malicious call identification request indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__malicious call identification not requested";
		break;
		case 1:
			stroutput+="1__reserved for malicious call identification requested";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);


	str1=str.Left(2);
	str.Delete(0,2);
	lpar=strchangehex(str1);
	
	stroutput=strbithead;
	stroutput+="bit LKJI:Spare";
	pCtrl->AddString(stroutput);
	ltemp=(lpar&4);
	lpar>>=4;	
	tt=0x8;
	stroutput=strtranhead;
	for(i=0;i<4;i++)
	{
		ltemp=(lpar&tt)>>(3-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit PONM:Reserved";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&4);
	lpar>>=4;	
	tt=0x8;
	for(i=0;i<4;i++)
	{
		ltemp=(lpar&tt)>>(3-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	pCtrl->AddString(stroutput);
}



void CSs7tranDlg:: tranpar_Location_number(CString str)
{
	long lpar;
	long ltemp,tt;
	long i;
	long ladroande;
	CString str1;
	CString strtemp;
	CString stroutput;
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 ) ; 	


	ladroande=0;
	stroutput=str;
	stroutput+=":Location number";
	pCtrl->AddString(stroutput);


	str1=str.Left(2);
	str.Delete(0,3);
	lpar=strchangehex(str1);


	stroutput=strbithead;
	stroutput+="byte 1:";
	stroutput+=str1;
	pCtrl->AddString(stroutput);
	stroutput=strbithead;
	stroutput="bit GFEDCBA :Nature of address indicator";
	pCtrl->AddString(stroutput);
	tt=0x40;
	stroutput=strtranhead;
	for(i=0;i<7;i++)
	{
		ltemp=(lpar&tt)>>(6-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	if ((lpar&0x7F)==0)
		stroutput+="__spare";
	else if ((lpar&0x7F)==1)
		stroutput+="__subscriber number";
	else if ((lpar&0x7F)==2)
		stroutput+="__unknown";
	else if ((lpar&0x7F)==3)
		stroutput+="__national (significant) number";
	else if ((lpar&0x7F)==4)
		stroutput+="__international number";
	else if (((lpar&0x7F)>=5) && ((lpar&0x7F)<=0x6F))
		stroutput+="__spare";
	else if (((lpar&0x7F)>=0x70) && ((lpar&0x7F)<=0x7E))
		stroutput+="__reserved for national use";
	else if ((lpar&0x7F)==0x7F)
		stroutput+="__spare";
	else
		stroutput+="__spare";
	pCtrl->AddString(stroutput);
	
	stroutput=strbithead;
	stroutput+="bit F :Odd/even indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	if ((lpar&0x80)==0x80)
	{
		stroutput+="1__odd number of address signals";
		ladroande=1;
	}
	else
	{
		stroutput+="0__even number of address signals";
		ladroande=0;
	}

⌨️ 快捷键说明

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