资源描述:
《ISO8583报文协议详情详解》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实用ISO8583报文协议详解ISO8583包(简称8583包)是一个国际标准的包格式,最多由128个字段域组成,每个域都有统一的规定,并有定长与变长之分。8583包前面一段为位图,用来确定包的字段域组成情况。其中位图是8583包的灵魂,它是打包解包确定字段域的关键,而了解每个字段域的属性则是填写数据的基础。1、位图描述如下:位图位置:1格式:定长类型:B16(二进制16位,16*8=128bit)描述:如将位图的第一位设为'1',表示使用扩展位图(128个域),否则表示只使用基本位图(64个域)。如使用某数据域,应在位图中将相
2、应的位设位'1',如使用41域,需将位图的41位设为'1'。选用条件:如使用65到128域,需设位图域第一位为'1'2、每个域的定义如下:typedefstructISO8583{intbit_flag;/*域数据类型0--string,1--int,2--binary*/文档实用char*data_name;/*域名*/intlength;/*数据域长度*/intlength_in_byte;/*实际长度(如果是变长)*/intvariable_flag;/*是否变长标志0:否2:2位变长,3:3位变长*/intdatatyp
3、;/*0--string,1--int,2--binary*/char*data;/*存放具体值*/intattribute;/*保留*/}ISO8583;ISO8583Tbl8583[128]={/*FLD1*/{0,"BITMAP,EXTENDED",8,0,0,2,NULL,0},/*FLD2*/{0,"PRIMARYACCOUNTNUMBER",22,0,2,0,NULL,0},/*FLD3*/{0,"PROCESSINGCODE",6,0,0,0,NULL,0},/*FLD4*/{0,"AMOUNT,TRANSACTI
4、ON",12,0,0,1,NULL,0},/*FLD5*/{0,"NOUSE",12,0,0,0,NULL,0},/*FLD6*/{0,"NOUSE",12,0,0,0,NULL,0},/*FLD7*/{0,"TRANSACTIONDATEANDTIME",10,0,0,0,NULL,0},/*FLD8*/{0,"NOUSE",8,0,0,0,NULL,0},/*FLD9*/{0,"NOUSE",8,0,0,0,NULL,0},/*FLD10*/{0,"NOUSE",8,0,0,0,NULL,0},/*FLD11*/{0,"SY
5、STEMTRACEAUDITNUMBER",6,0,0,1,NULL,0},文档实用/*FLD12*/{0,"TIME,LOCALTRANSACTION",6,0,0,0,NULL,0},/*FLD13*/{0,"DATE,LOCALTRANSACTION",4,0,0,0,NULL,0},/*FLD14*/{0,"DATE,EXPIRATION",4,0,0,0,NULL,0},/*FLD15*/{0,"DATE,SETTLEMENT",4,0,0,0,NULL,0},/*FLD16*/{0,"NOUSE",4,0,0,0,N
6、ULL,0},/*FLD17*/{0,"DATE,CAPTURE",4,0,0,0,NULL,0},/*FLD18*/{0,"MERCHANT'STYPE",4,0,0,0,NULL,0},/*FLD19*/{0,"NOUSE",3,0,0,0,NULL,0},/*FLD20*/{0,"NOUSE",3,0,0,0,NULL,0},/*FLD21*/{0,"NOUSE",3,0,0,0,NULL,0},/*FLD22*/{0,"POINTOFSERVICEENTRYMODE",3,0,0,0,NULL,0},/*FLD23*/{
7、0,"NOUSE",3,0,0,0,NULL,0},/*FLD24*/{0,"NOUSE",3,0,0,0,NULL,0},/*FLD25*/{0,"POINTOFSERVICECONDITIONCODE",2,0,0,0,NULL,0},/*FLD26*/{0,"NOUSE",2,0,0,0,NULL,0},/*FLD27*/{0,"NOUSE",1,0,0,0,NULL,0},/*FLD28*/{0,"field27",6,0,0,0,NULL,0},/*FLD29*/{0,"NOUSE",8,0,1,0,NULL,0},/
8、*FLD30*/{0,"NOUSE",8,0,1,0,NULL,0},/*FLD31*/{0,"NOUSE",8,0,1,0,NULL,0},/*FLD32*/{0,"ACQUIRERINSTITUTIONID.CODE",11,0,2,0,NULL,0},/*