📄 stmu.cpp
字号:
// Stmu.cpp: implementation of the CStmu class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "decode.h"
#include "Stmu.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CStmu::CStmu()
{
this->createH1h0Table();
}
CStmu::~CStmu()
{
}
void CStmu::createH1h0Table()
{
strcpy(m_h1h0Table[0], "SLTM");
strcpy(m_h1h0Table[1], "SLTA");
strcpy(m_h1h0Table[2], "Unrecognized");
}
char *CStmu::getH1h0FromTable(BYTE u_index)
{
char *pH1h0;
if(SS7_STMU_H1H0_SLTM == u_index)
{
pH1h0 = m_h1h0Table[0];
}
else if(SS7_STMU_H1H0_SLTA == u_index)
{
pH1h0 = m_h1h0Table[1];
}
else
{
pH1h0 = m_h1h0Table[2];
}
return pH1h0;
}
BOOL CStmu::GetH1H0(BYTE *u_pMsg, DWORD u_msgLength, char *v_pH1H0)
{
sprintf(v_pH1H0, "%02X", u_pMsg[SS7_STMU_H1H0_OFFSET]);
return TRUE;
}
BOOL CStmu::GetSls(BYTE *u_pMsg, DWORD u_msgLength, char *v_pSls)
{
sprintf(v_pSls, "%X", u_pMsg[SS7_STMU_SLC_OFFSET] & SS7_STMU_SLC_MASK);
return TRUE;
}
BOOL CStmu::GetCic(BYTE *u_pMsg, DWORD u_msgLength, char *v_pCic)
{
v_pCic[0] = 0;
return TRUE;
}
BOOL CStmu::GetData(BYTE *u_pMsg, DWORD u_msgLength, char *v_pData)
{
extern CDecodeApp theApp;
int dataLength;
int i, temp;
temp = SS7_STMU_DATA_OFFSET + MAX_DATA_BYTE_NUMBER - 1;
if(temp > ((int )u_msgLength))
{
dataLength = u_msgLength - SS7_STMU_DATA_OFFSET;
}
else
{
dataLength = MAX_DATA_BYTE_NUMBER;
}
temp = 0;
for(i=0; i<dataLength; i++)
{
theApp.ConvertOneByte(u_pMsg[SS7_STMU_DATA_OFFSET + i], \
&v_pData[temp]);
temp += 3;
}
return TRUE;
}
BOOL CStmu::GetMessageDecodeInfo(BYTE *u_pMsg, DWORD u_msgLength, char *v_pDecodeResult)
{
int strLength;
BYTE temp;
strLength = 0;
temp = u_pMsg[SS7_STMU_SLC_OFFSET];
sprintf(&v_pDecodeResult[strLength],
"%02X SLC :....%d%d%d%d \n",
temp, (temp >> 3) & 0x01, (temp >> 2) & 0x01, (temp >> 1) & 0x01, temp & 0x01);
strLength = strlen(v_pDecodeResult);
sprintf(&v_pDecodeResult[strLength], \
" SPARE :%d%d%d%d.... \n",
(temp >> 7) & 0x01, (temp >> 6) & 0x01, (temp >> 5) & 0x01, (temp >> 4) & 0x01);
strLength = strlen(v_pDecodeResult);
temp = u_pMsg[SS7_SNMU_H1H0_OFFSET];
sprintf(&v_pDecodeResult[strLength], \
"%02X H1H0 :%s \n",
temp, getH1h0FromTable(temp));
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -