3. データ・ストリーム形式
クライアントとサーバの間で交換される実際のデータ・ストリームは、ヘッダーと、それに続く 5250 ワークステーション・データ・ストリームから構成される。5250 ワークステーション・データ・ストリームの詳細については、IBM 5250 Information Display System, Functions Reference Manual (SA21-9247) を参照されたい。5250 データ・ストリームの前に付加されるこのヘッダーは、もともと 5250 Display Station Pass-Through (DSPT) アプリケーション向けに設計されたものである。5250 DSPT は Telnet に似たアプリケーションであり、SNA ネットワーク上で IBM AS/400、System/36、System/38 上で動作する。このヘッダーは可変長となるように設計されており、2 つの部分から構成される。最初の固定部分は常に 6 オクテット長であり、以下の形式を持つ:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Logical Record Length | Record Type |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Logical Record Length (論理レコード長): 16 ビット
このフィールドは、ヘッダー長を含むこの論理レコードの長さをオクテット単位で示す。長さは、データ・ストリーム内の IAC 文字を二重化する前に計算される。この長さには、この論理レコードの終わりを示すためにデータ・ストリームの末尾に付加される
Record Type (レコード・タイプ): 16 ビット
このフィールドは SNA レコード・タイプを示す。General Data Stream (GDS) レコード・タイプを示すために、常に '12A0'X に設定すべきである。
Reserved (予約): 16 ビット
このフィールドは現在使用されていない。
ヘッダーの 2 番目の部分は可変長となるように設計されている。この可変部分の長さは最初のオクテットで指定される。現在、ヘッダーのこの部分は常に 4 オクテット長であり、以下の形式を持つ:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |E|A| | | |S|T|H| | |
| Var Hdr Len |R|T| | | |R|R|L| | Opcode |
| |R|N| | | |Q|Q|P| | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Var Hdr Len (可変ヘッダー長): 8 ビット
ヘッダーの可変部分の長さをオクテット単位で示す。現在は常に '04'X である。
Flags (フラグ): 16 ビット
Bit 0: ERR This bit is set to indicate a data stream
output error. The negative response code
is sent as data following the opcode field.
Bit 1: ATN This bit is set to indicate that the 5250
attention key was pressed.
Bits 2-4: * These bits are reserved (set to zero).
Bit 5: SRQ This bit is set to indicate that the 5250
System Request key was pressed.
Bit 6: TRQ This bit is set to indicate that the 5250
Test Request key was pressed.
Bit 7: HLP This bit is set to indicate the Help in
Error State function. The error code is
sent as data following the header and is
a four digit packed decimal number. For
example, an error code of '0005'X indicates
the operator attempted to type in an area of
the display that is not enabled for input.
Bits 8-15: * These bits are reserved (set to zero).
Opcode (オペコード): 8 ビット
このフィールドはオペレーション・コードを含む。送信者が要求するオペレーションのタイプを示すように設定される。有効な値は以下のとおりである:
'00'X: No Operation
'01'X: Invite Operation
'02'X: Output Only
'03'X: Put/Get Operation
'04'X: Save Screen Operation
'05'X: Restore Screen Operation
'06'X: Read Immediate Operation
'07'X: Reserved
'08'X: Read Screen Operation
'09'X: Reserved
'0A'X: Cancel Invite Operation
'0B'X: Turn On Message Light
'0C'X: Turn Off Message Light
実際の 5250 ワークステーション・データ・ストリームは、ヘッダーのオペコード・フィールドの直後に続き、
000A 12A0 0000 0400 000B FFEF
| | | | | | |
| | | | | | End Of Record marker
| | | | | |
| | | | | Opcode = Turn On Message Light ('0B'X)
| | | | |
| | | | Flags = '0000'X
| | | |
| | | Variable Header Length = '04'X
| | |
| | Reserved - Set to '0000'X
| |
| Record Type = General Data Stream ('12A0'X)
|
Logical Record Length = '000A'X for this record
この例では、要求されたオペレーションはオペコードによって示され、関連するワークステーション・データ・ストリームは存在しない。