📄 svmapdisp.cpp
字号:
}
*dispbuf++=0xcc;
*dispbuf++=dfldno2+1; //MNC
*dispbuf++=8;
*dispbuf=(*recbuf&0x0f)<<4;
*dispbuf|=(*recbuf&0xf0)>>4;
dispbuf++;
recbuf++;
*dispbuf++=0xcc;
*dispbuf++=dfldno2+2; //LAC
*dispbuf++=8*2;
*dispbuf++=*recbuf++;
*dispbuf++=*recbuf++;
*dispbuf++=0xcc;
if(more6byte)
{
*dispbuf++=dfldno2+3; //CI
*dispbuf++=8*2;
*dispbuf++=*recbuf++;
*dispbuf++=*recbuf++;
*dispbuf++=0xcc;
displen += 5;
UDTlen -= 2;
}
displen += 22;
UDTlen -= 7;
}
/**********************
0x19-地理位置信息(GoegraphInfo) tag(XXX00000)
0x1a-地理位置信息(GoegraphInfo) li(8)
0x1b-外形类型(ShapeTpye) (第1字节)
0x1c-纬度(Latitude)(第2-4字节)
0x1d--经度(Longitude)(第5-7字节)
0x1e--不确定编码(UncertaintyCode)(第8字节)
void procGeographInfo(BYTE dfldno)
*************************/
void procGeographInfo(BYTE dfldno)
{
*dispbuf++=dfldno;//地理位置信息
*dispbuf++=8;
*dispbuf++=*recbuf++;
*dispbuf++=0xcc;
*dispbuf++=dfldno+1;//地理位置信息
*dispbuf++=8;
iDataLength=*dispbuf++=*recbuf++;
iAllLength=iDataLength+2;
*dispbuf++=0xcc;
*dispbuf++=dfldno; //外形类型
*dispbuf++=8;
*dispbuf++=*recbuf++;
*dispbuf++=0xcc;
*dispbuf++=dfldno+1; //纬度
*dispbuf++=8*3;
*dispbuf++=*recbuf++;
*dispbuf++=*recbuf++;
*dispbuf++=*recbuf++;
*dispbuf++=0xcc;
*dispbuf++=dfldno+2; //经度
*dispbuf++=8*3;
*dispbuf++=*recbuf++;
*dispbuf++=*recbuf++;
*dispbuf++=*recbuf++;
*dispbuf++=0xcc;
*dispbuf++=dfldno+3; //不确定编码
*dispbuf++=8;
*dispbuf++=*recbuf++;
*dispbuf++=0xcc;
displen += 28;
UDTlen -= 10;
}
//proc extensionContainer type
void procExtension(BYTE dfldno)
{
int iextensionli;
int i;
*dispbuf++=dfldno;//sequence tag
*dispbuf++=8;
*dispbuf++=*recbuf++;
UDTlen--;
*dispbuf++=0xcc;
iextensionli=procCONSTRUCTFMT(recbuf);//获取长度(包含长度本身的字节)
iAllLength=iextensionli+1;
if((*recbuf<=0x80)&&(iextensionli>=1))
{
iextensionli-=1;//short +不定格式
recbuf++;
UDTlen--;
}
else if(iextensionli>(*recbuf-0x80))//long
{
iextensionli-=*recbuf-0x80;
UDTlen-=*recbuf-0x80;
recbuf+=*recbuf-0x80;
}
else return ;
*dispbuf++=dfldno+1;
*dispbuf++=8;
*dispbuf++=iextensionli;
iDataLength=iextensionli;
*dispbuf++=0xcc;
if(iextensionli>0)
{
*dispbuf++=dfldno+2;
if(iextensionli<=32)
{
*dispbuf++=8*iextensionli;
for(i=0;i<iextensionli;i++) *dispbuf++=*recbuf++;
UDTlen-=iextensionli;
*dispbuf++=0xcc;
displen+=iextensionli+11; //li*2+16;
}
else
{
*dispbuf++=0;
*dispbuf++=iextensionli;
for(i=0;i<iextensionli;i++) *dispbuf++=*recbuf++;
UDTlen-=iextensionli;
*dispbuf++=0xcc;
displen+=iextensionli+12; //li*2+16;
}
}
}
///////////////////////////////zxf add end fu
//zxf update map2+ 2001-8-21 check all
//////////////////////////////////////
void procMAPdisp(BYTE oc,BYTE compt)
{
BYTE li,indeffmt,indeffmt2,len;
BYTE *buf;
BYTE icounter,indeffmt1,indeffmt3;//zxf use while counter
BYTE icounter1,indeffmt4,indeffmt5,indeffmt6,indeffmt7,indeffmt8 ;//zxf use while counter
unsigned char tempmap,tempmap1,tempmap2,tempmap3,tempmap4,tempmap5,tempmap6,tempmap7,tempmap8;//use len
switch(oc) //operate code
{
case 2: //update location
if(compt==1)//operate
{
indeffmt=procsequencetag(0x01);
tempmap=iDataLength-indeffmt*2;
procIMSI(0x03);//IMSI
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
//位置信息:MAP2 漫游号码/MSC号码--MAP2+
if((*recbuf&0x3f)==0&&tempmap>0)//位置信息is漫游号码
{
procsISDNADDR(0x06);
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
else if(tempmap>0)//位置信息is MSC号码
{
procsISDNADDR(0x0A);
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
//zxf 2001-8-11 begin
procsISDNADDR(0x0E); //VLR号码// map2+ (任选项)
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
if((*recbuf&0x1f)==0x0a&&tempmap>0)//存在lms Id(任选项)
{
procsbasicparamap2plus(0x12);//支持的Camel版本(SupportCamelPhase)
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if(*recbuf==0x30&&tempmap>0)//扩展sequence tag(0x30)
{
procExtension(0x19);
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if((*recbuf&0x1f)==0x06&&tempmap)//VLR能力sequence tag(tag为XXX00110)
{
indeffmt2=procsequencetag(0x1c);
tempmap1=iDataLength-indeffmt2*2;
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
if((*recbuf&0x1f)==0&&tempmap1>0)
{
procsbasicparamap2plus(0x1e);//SupportedCamelPhases
if(tempmap1>=iAllLength)
tempmap1-=iAllLength;
else
return;
}
if(*recbuf==0x30&&tempmap1>0)
{
procExtension(0x19);
if(tempmap1>=iAllLength)
tempmap1-=iAllLength;
else
return;
}
if(UDTlen>2) {recbuf+=2*indeffmt2;UDTlen-=2*indeffmt2;}
if(tempmap1!=0)
return;
}
//zxf 2001-8-11 end
if(UDTlen>0) {recbuf+=2*indeffmt;UDTlen-=2*indeffmt;}
if(tempmap!=0)
return;
//if(indeffmt!=0) {recbuf+=indeffmt*2;UDTlen-=indeffmt*2;}
}
else//result
{
if(*recbuf==0x30)
{
indeffmt=procsequencetag(0x01);
tempmap=iDataLength-indeffmt*2;
while((*recbuf&0x3f)==0x04&&tempmap>0)
{
procsISDNADDR(0x15);//HLR号码
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if(*recbuf==0x30&&tempmap>0) //zxf 2001-8-11
{
procExtension(0x19);//-扩展(extension)sequence tag(0x30)
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if(UDTlen>0) {recbuf+=2*indeffmt;UDTlen-=2*indeffmt;}
if(tempmap!=0)
return;
}
else procsISDNADDR(0x15);//HLR号码
}
break;
case 3: //cancel location
if(compt==1)
{
if(*recbuf==0x30) //sequence tag
{
indeffmt=procsequencetag(0x01);
tempmap=iDataLength-indeffmt*2;
procIMSI(0x03); //IMSI
tempmap-=iAllLength;
procsbasicparamap2plus(0x06); //LMSID
tempmap-=iAllLength;
if(UDTlen>0) {recbuf+=2*indeffmt;UDTlen-=2*indeffmt;}
if(tempmap!=0)
return;
}
else if(*recbuf==0x04)
{
procIMSI(0x03); //IMSI
}
else if((*recbuf&0x1f)==3) //for map2+
{
indeffmt=procsequencetag(0x01);
tempmap=iDataLength-indeffmt*2;
if(*recbuf==0x04&&tempmap>0)
{
procIMSI(0x03);//IMSI
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
else if(*recbuf==0x30&&tempmap>0)//imsi_withLMSI zxf 2001-8-11
{
indeffmt2=procsequencetag(0x09);
tempmap1=iDataLength-indeffmt2*2;
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
procIMSI(0x03);//IMSI
if(tempmap1>=iAllLength)
tempmap1-=iAllLength;
else
return;
procsbasicparamap2plus(0x06);//LMSI
if(tempmap1>=iAllLength)
tempmap1-=iAllLength;
else
return;
if(UDTlen>0) {recbuf+=2*indeffmt2;UDTlen-=2*indeffmt2;}
if(tempmap1!=0)
return;
}
if(*recbuf==0x0a&&tempmap>0)//zxf 2001-8-11
{
procsbasicparamap2plus(0x0a);//(CanelType)
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if(*recbuf==0x19&&tempmap>0)
{
procExtension(0x0e);//扩展(extension)sequence tag(0x30)
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if(UDTlen>0) {recbuf+=2*indeffmt;UDTlen-=2*indeffmt;}
if(tempmap!=0)
return;
}
}
else if(*recbuf==0x30)//result may
{
indeffmt=procsequencetag(0x01);
tempmap=iDataLength-indeffmt*2;
if(*recbuf==0x30&&tempmap>0)
{
procExtension(0x0e);
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if(indeffmt!=0) {recbuf+=2;UDTlen-=2;}
if(tempmap!=0)
return;
}
break;
case 4: //provide roaming number
if(compt==1) //operate
{
indeffmt=procsequencetag(0x01);
tempmap=iDataLength-indeffmt*2;
procIMSI(0x03);
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
if((*recbuf&0x3f)==1&&tempmap>0) //存在MSC号码(任选项)
{
procsISDNADDR(0x06);
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if((*recbuf&0x3f)==2&&tempmap>0) //存在MSDISDN(任选项)
{
procsISDNADDR(0x0a);
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if((*recbuf&0x3f)==3&&tempmap>0) //存在前一个漫游号码(任选项)
{
procsISDNADDR(0x0e);
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if((*recbuf&0x3f)==4&&tempmap>0) //存在lms Id(任选项)
{
procsbasicparamap2plus(0x12);
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if((*recbuf&0x1f)==5&&tempmap>0) //存在GSM承载能力(任选项)
{
indeffmt2=procsequencetag(0x15); //GSM承载能力 sequence
tempmap1=iDataLength-indeffmt2*2;
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
procsbasicparamap2plus(0x17); //规约标识
if(tempmap1>=iAllLength)
tempmap1-=iAllLength;
else
return;
procsbasicparamap2plus(0x1a); //信令信息
if(tempmap1>=iAllLength)
tempmap1-=iAllLength;
else
return;
if(*recbuf==0x30&&tempmap>0)
{
procExtension(0x23);//extension
if(tempmap1>=iAllLength)
tempmap1-=iAllLength;
else
return;
}
if(indeffmt2!=0) {recbuf+=2;UDTlen-=2;}
if(tempmap1!=0)
return;
//recbuf+=indeffmt2*2;
//UDTlen-=indeffmt2*2;
}//存在GSM承载能力
if((*recbuf&0x1f)==6&&tempmap>0) //存在网络信令信息(任选项)
{
indeffmt2=procsequencetag(0x1d); //网络信令信息 sequence
tempmap1=iDataLength-indeffmt2*2;
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
procsbasicparamap2plus(0x17); //规约标识
if(tempmap1>=iAllLength)
tempmap1-=iAllLength;
else
return;
procsbasicparamap2plus(0x1a); //信令信息
if(tempmap1>=iAllLength)
tempmap1-=iAllLength;
else
return;
if(*recbuf==0x30&&tempmap1)
{
procExtension(0x23);//extension
if(tempmap1>=iAllLength)
tempmap1-=iAllLength;
else
return;
}
if(indeffmt2!=0) {recbuf+=2;UDTlen-=2;}
if(tempmap1!=0)
return;
//recbuf+=indeffmt2*2;
//UDTlen-=indeffmt2*2;
}//存在网络信令信息
if((*recbuf&0x1f)==7&&tempmap>0)
{
procNULL(0x28);//告示抑制(SupressOfAnnounce)
if(tempmap>=2)
tempmap-=2;
else
return;
}
if((*recbuf&0x1f)==8&&tempmap>0)
{
procsISDNADDR(0x2a);//-GMSC地址
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if((*recbuf&0x1f)==9&&tempmap>0)
{
procsbasicparamap2plus(0x2e);//呼叫参考号码
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if((*recbuf&0x1f)==0x0a&&tempmap>0)
{
procNULL(0x31);//Or指示
if(tempmap>=2)
tempmap-=2;
else
return;
}
if((*recbuf&0x1f)==0x0b&&tempmap>0)
{
procsbasicparamap2plus(0x23);//扩展
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
return;
}
if((*recbuf&0x1f)==0x0c&&tempmap>0)
{
procsbasicparamap2plus(0x33);//提醒方式
if(tempmap>=iAllLength)
tempmap-=iAllLength;
else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -