tn3270e.h
2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Copyright 1996, 1999, 2001 by Paul Mattes.
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation.
*
* x3270, c3270, s3270, tcl3270 and pr3287 are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* file LICENSE for more details.
*/
/*
* tn3270e.h
*
* Header file for the TN3270E Protocol, RFC 2355.
*/
/* Negotiation operations. */
#define TN3270E_OP_ASSOCIATE 0
#define TN3270E_OP_CONNECT 1
#define TN3270E_OP_DEVICE_TYPE 2
#define TN3270E_OP_FUNCTIONS 3
#define TN3270E_OP_IS 4
#define TN3270E_OP_REASON 5
#define TN3270E_OP_REJECT 6
#define TN3270E_OP_REQUEST 7
#define TN3270E_OP_SEND 8
/* Negotiation reason-codes. */
#define TN3270E_REASON_CONN_PARTNER 0
#define TN3270E_REASON_DEVICE_IN_USE 1
#define TN3270E_REASON_INV_ASSOCIATE 2
#define TN3270E_REASON_INV_DEVICE_NAME 3
#define TN3270E_REASON_INV_DEVICE_TYPE 4
#define TN3270E_REASON_TYPE_NAME_ERROR 5
#define TN3270E_REASON_UNKNOWN_ERROR 6
#define TN3270E_REASON_UNSUPPORTED_REQ 7
/* Negotiation function Names. */
#define TN3270E_FUNC_BIND_IMAGE 0
#define TN3270E_FUNC_DATA_STREAM_CTL 1
#define TN3270E_FUNC_RESPONSES 2
#define TN3270E_FUNC_SCS_CTL_CODES 3
#define TN3270E_FUNC_SYSREQ 4
/* Header data type names. */
#define TN3270E_DT_3270_DATA 0x00
#define TN3270E_DT_SCS_DATA 0x01
#define TN3270E_DT_RESPONSE 0x02
#define TN3270E_DT_BIND_IMAGE 0x03
#define TN3270E_DT_UNBIND 0x04
#define TN3270E_DT_NVT_DATA 0x05
#define TN3270E_DT_REQUEST 0x06
#define TN3270E_DT_SSCP_LU_DATA 0x07
#define TN3270E_DT_PRINT_EOJ 0x08
/* Header request flags. */
#define TN3270E_RQF_ERR_COND_CLEARED 0x00
/* Header response flags. */
#define TN3270E_RSF_NO_RESPONSE 0x00
#define TN3270E_RSF_ERROR_RESPONSE 0x01
#define TN3270E_RSF_ALWAYS_RESPONSE 0x02
#define TN3270E_RSF_POSITIVE_RESPONSE 0x00
#define TN3270E_RSF_NEGATIVE_RESPONSE 0x01
/* Header response data. */
#define TN3270E_POS_DEVICE_END 0x00
#define TN3270E_NEG_COMMAND_REJECT 0x00
#define TN3270E_NEG_INTERVENTION_REQUIRED 0x01
#define TN3270E_NEG_OPERATION_CHECK 0x02
#define TN3270E_NEG_COMPONENT_DISCONNECTED 0x03
/* TN3270E data header. */
typedef struct {
unsigned char data_type;
unsigned char request_flag;
unsigned char response_flag;
unsigned char seq_number[2]; /* actually, 16 bits, unaligned (!) */
} tn3270e_header;
#define EH_SIZE 5