8583报文及各域详解

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

[精彩] 8583问题

作者:lcunix发表于:2006-02-19 00:03:51

【发表评论】【查看原文】【C/C++讨论区】【关闭】

各位高手能否详细的解释一下8583协议

htldm回复于:2003-08-31 22:15:18

ISO8583包(简称8583包)是一个国际标准的包格式,最多由128个字段域组成,每个域都有统一的规定,并有定长与变长之分。8583包前面一段为位图,用来确定包的字段域组成情况。

其中位图是8583包的灵魂,它是打包解包确定字段域的关键,而了解每个字段域的属性则是填写数据的基础,

1、位图描述如下:

位图位置:1

格式:定长

类型:B16(二进制16位,16*8=128bit)

描述:

如将位图的第一位设为'1',表示使用扩展位图(128个域),否则表示只使用基本位图(64个域)。

如使用某数据域,应在位图中将相应的位设位'1',如使用41域,需将位图的41位设为'1'。选用条件:如使用65到128域,需设位图域第一位为'1'

2、每个域的定义如下:

typedef struct ISO8583

{

int bit_flag; /*域数据类型0 -- string, 1 -- int, 2 -- binary*/

char *data_name; /*域名*/

int length; /*数据域长度*/

int length_in_byte;/*实际长度(如果是变长)*/

int variable_flag; /*是否变长标志0:否2:2位变长,

3:3位变长*/

int datatyp; /*0 -- string, 1 -- int, 2 -- binary*/

char *data; /*存放具体值*/

int attribute; /*保留*/

} ISO8583;

ISO8583 Tbl8583[128] =

{

/* FLD 1 */ {0,"BIT MAP,EXTENDED ", 8, 0, 0, 2, NULL,0},

/* FLD 2 */ {0,"PRIMARY ACCOUNT NUMBER ", 22, 0, 2, 0, NULL,0},

/* FLD 3 */ {0,"PROCESSING CODE ", 6, 0, 0, 0, NULL,0},

/* FLD 4 */ {0,"AMOUNT, TRANSACTION ", 12, 0, 0, 1, NULL,0},

/* FLD 5 */ {0,"NO USE ", 12, 0, 0, 0, NULL,0},

/* FLD 6 */ {0,"NO USE ", 12, 0, 0, 0, NULL,0},

/* FLD 7 */ {0,"TRANSACTION DATE AND TIME ", 10, 0, 0, 0, NULL,0},

/* FLD 8 */ {0,"NO USE ", 8, 0, 0, 0, NULL,0},

/* FLD 9 */ {0,"NO USE ", 8, 0, 0, 0, NULL,0},

/* FLD 10 */ {0,"NO USE ", 8, 0, 0, 0, NULL,0},

/* FLD 11 */ {0,"SYSTEM TRACE AUDIT NUMBER ", 6, 0, 0, 1, NULL,0},

/* FLD 12 */ {0,"TIME, LOCAL TRANSACTION ", 6, 0, 0, 0, NULL,0}, /* FLD 13 */ {0,"DATE, LOCAL TRANSACTION ", 4, 0, 0, 0, NULL,0}, /* FLD 14 */ {0,"DATE, EXPIRATION ", 4, 0, 0, 0, NULL,0},

/* FLD 15 */ {0,"DATE, SETTLEMENT ", 4, 0, 0, 0, NULL,0},

/* FLD 16 */ {0,"NO USE ", 4, 0, 0, 0, NULL,0},

/* FLD 17 */ {0,"DATE, CAPTURE ", 4, 0, 0, 0, NULL,0},

/* FLD 18 */ {0,"MERCHANT'S TYPE ", 4, 0, 0, 0, NULL,0},

/* FLD 19 */ {0,"NO USE ", 3, 0, 0, 0, NULL,0},

/* FLD 20 */ {0,"NO USE ", 3, 0, 0, 0, NULL,0},

/* FLD 21 */ {0,"NO USE ", 3, 0, 0, 0, NULL,0},

/* FLD 22 */ {0,"POINT OF SERVICE ENTRY MODE ", 3, 0, 0, 0, NULL, 0},

/* FLD 23 */ {0,"NO USE ", 3, 0, 0, 0, NULL,0},

/* FLD 24 */ {0,"NO USE ", 3, 0, 0, 0, NULL,0},

/* FLD 25 */ {0,"POINT OF SERVICE CONDITION CODE ", 2, 0, 0, 0, N ULL,0},

/* FLD 26 */ {0,"NO USE ", 2, 0, 0, 0, NULL,0},

/* FLD 27 */ {0,"NO USE ", 1, 0, 0, 0, NULL,0},

/* FLD 28 */ {0,"field27 ", 6, 0, 0, 0, NULL,0},

/* FLD 29 */ {0,"NO USE ", 8, 0, 1, 0, NULL,0},

/* FLD 30 */ {0,"NO USE ", 8, 0, 1, 0, NULL,0},

/* FLD 31 */ {0,"NO USE ", 8, 0, 1, 0, NULL,0},

/* FLD 32 */ {0,"ACQUIRER INSTITUTION ID. CODE ", 11, 0, 2, 0, NUL L,0},

/* FLD 33 */ {0,"FORWARDING INSTITUTION ID. CODE ", 11, 0, 2, 0, N ULL,0},

/* FLD 34 */ {0,"NO USE ", 28, 0, 2, 0, NULL,0},

/* FLD 35 */ {0,"TRACK 2 DATA ", 37, 0, 2, 0, NULL,0},

/* FLD 36 */ {0,"TRACK 3 DATA ",104, 0, 3, 0, NULL,0},

/* FLD 37 */ {0,"RETRIEVAL REFERENCE NUMBER ", 12, 0, 0, 0, NULL,0} ,

/* FLD 38 */ {0,"AUTH. IDENTIFICATION RESPONSE ", 6, 0, 0, 0, NULL,

相关文档
最新文档