1 | /* UNIX Unified Stream Protocol Header File |
---|
2 | |
---|
3 | Copyright 1986 by the Massachusetts Institute of Technology |
---|
4 | See permission and disclaimer notice in file "notice.h" |
---|
5 | */ |
---|
6 | |
---|
7 | /* useful constants */ |
---|
8 | |
---|
9 | #define CLOSED 99 /* connection ahs been closed */ |
---|
10 | #define EOB_FLAG 0x8000 /* end of block flag */ |
---|
11 | #define MAX_SUB_BLOCK_LENGTH 508 /* max sub-block length less hdr len */ |
---|
12 | |
---|
13 | #define CONNECTION_OPEN 10 /* USP connection-open block type */ |
---|
14 | #define CONNECTION_ERROR 20 /* USP connection-error block type */ |
---|
15 | #define CONNECTION_END 254 /* USP connection-end block type */ |
---|
16 | #define CONNECTION_END_REPLY 255 /* USP connection-end-reply block type */ |
---|
17 | |
---|
18 | |
---|
19 | #define FOREIGN_DETECT 1 /* error detected by foreign USP */ |
---|
20 | #define TRANSPORT_DETECT 2 /* error detected by transport layer */ |
---|
21 | #define INTERMEDIATE_DETECT 3 /* error detected by protocol converter */ |
---|
22 | |
---|
23 | /* USP internal error codes transmitted in CONNECTION_ERROR block */ |
---|
24 | |
---|
25 | #define CE_UNKNOWN 1 |
---|
26 | |
---|
27 | /* during connection establishment */ |
---|
28 | |
---|
29 | #define CE_NAME_UNKNOWN 10 |
---|
30 | #define CE_SERVICE_UNKNOWN 11 |
---|
31 | #define CE_HOST_DOWN 12 |
---|
32 | #define CE_SERVICE_UNSUPPORTED 13 |
---|
33 | #define CE_SERVICE_UNAVAILABLE 14 |
---|
34 | #define CE_CONVERSION_UNAVAILABLE 15 |
---|
35 | |
---|
36 | /* after connection establishment */ |
---|
37 | |
---|
38 | |
---|
39 | #define CE_TRANSPORT_FAILURE 20 |
---|
40 | #define CE_TRANSPORT_TIMEOUT 21 |
---|
41 | #define CE_CLIENT_FAILURE 22 |
---|
42 | #define CE_PATH_TRANSLATION 23 |
---|
43 | |
---|
44 | /* internal choice numbers for USP host names */ |
---|
45 | |
---|
46 | #define GLOBAL_NAME 0 |
---|
47 | #define PATH_NAME 1 |
---|
48 | |
---|
49 | |
---|
50 | /* USP-to-client error codes */ |
---|
51 | |
---|
52 | #include "usp_et.h" |
---|
53 | |
---|
54 | /* USP data types */ |
---|
55 | |
---|
56 | typedef unsigned short USPBoolean; |
---|
57 | typedef short USPInteger; |
---|
58 | typedef unsigned short USPCardinal; |
---|
59 | typedef int USPLong_integer; |
---|
60 | typedef unsigned int USPLong_cardinal; |
---|
61 | typedef char *USPString; |
---|
62 | |
---|
63 | typedef struct { |
---|
64 | FILE *us_read; |
---|
65 | FILE *us_write; |
---|
66 | int us_in_receiving_p; /* input: receiving block? */ |
---|
67 | unsigned us_last_sub_block_p; /* last sub-block flag */ |
---|
68 | unsigned us_nunread_sub_block_bytes; /* #bytes remaining in subblock */ |
---|
69 | int us_out_sending_p; /* output: sending block? */ |
---|
70 | unsigned us_nsent_sub_block_bytes; /* buffer pointer */ |
---|
71 | char us_outbuf[MAX_SUB_BLOCK_LENGTH]; /* output sub-block buf */ |
---|
72 | } USPStream; |
---|
73 | |
---|
74 | USPStream *USP_make_connection(); |
---|
75 | USPStream *USP_associate(); |
---|
76 | char *usp_error(); |
---|
77 | |
---|