Commit | Line | Data |
---|---|---|
9319b3c3 C |
1 | .TH LIBTSAP 3N "31 May 1988" |
2 | .\" $Header: /f/osi/tsap/RCS/libtsap.3n,v 7.1 91/02/22 09:47:06 mrose Interim $ | |
3 | .\" | |
4 | .\" | |
5 | .\" $Log: libtsap.3n,v $ | |
6 | .\" Revision 7.1 91/02/22 09:47:06 mrose | |
7 | .\" Interim 6.8 | |
8 | .\" | |
9 | .\" Revision 7.0 89/11/23 22:30:28 mrose | |
10 | .\" Release 6.0 | |
11 | .\" | |
12 | .SH NAME | |
13 | libtsap \- Transport Services library | |
14 | .SH SYNOPSIS | |
15 | .B "#include <isode/tsap.h>" | |
16 | .sp | |
17 | \fIcc\fR\0...\0\fB\-ltsap\fR | |
18 | .SH DESCRIPTION | |
19 | The \fIlibtsap\fR library contains a set of routines which implement | |
20 | transport services on top of the TCP. | |
21 | In essence, | |
22 | they implement a Transport Service Access Point (TSAP) interface to the | |
23 | native TCP/IP implementation on Berkeley UNIX. | |
24 | .PP | |
25 | Although the ISO model is symmetric, | |
26 | the TCP/IP model (and this implementation) is based on a client/server | |
27 | paradigm and hence asymmetric. | |
28 | The information herein is skeletal: | |
29 | consult the \fIUser's Manual\fR for actual examples of how ISO servers and | |
30 | clients are coded and interact with the \fIlibtsap\fR library. | |
31 | .SH ADDRESSES | |
32 | TSAP addresses are represented by the \fBTSAPaddr\fR structure. | |
33 | This contains one more more network addresses, | |
34 | and a transport-selector as found in the \fIisoservices\fR\0(5) | |
35 | database. | |
36 | .SH "SERVER INITIALIZATION" | |
37 | A program providing an ISO service is invoked under \fItsapd\fR\0(8c), | |
38 | with the argument vector listed in the ISODE services database. | |
39 | The server's very first action is to re\-capture the TSAP | |
40 | state as recorded by \fItsapd\fR. | |
41 | This is accomplished by calling \fBTInit\fR. | |
42 | Information returned by this call is equivalent to the parameters passed by a | |
43 | T\-CONNECTION.INDICATION event. | |
44 | If the call is successful, | |
45 | the program can then examine the argument vector that was passed via | |
46 | \fIexecvp\fR | |
47 | (it's important to call \fBTInit\fR prior to reading \fBargc\fR and | |
48 | \fBargv\fR). | |
49 | If the call to \fBTInit\fR is not successful, | |
50 | information returned by the call indicates the reason for failure. | |
51 | .PP | |
52 | After examining the information provided by \fBTInit\fR | |
53 | (and possibly the argument vector), | |
54 | the server should either accept or reject the connection. | |
55 | If accepting, the \fBTConnResponse\fR routine is called | |
56 | (which corresponds to the T\-CONNECT.RESPONSE action). | |
57 | If the call is successful, | |
58 | the interaction is henceforth symmetric. | |
59 | If un\-successful, | |
60 | information returned by the call indicates the reason for failure. | |
61 | If rejecting, the \fBTDiscRequest\fR routine is called | |
62 | (which corresponds to the T\-DISCONNECT.REQUEST action), | |
63 | and the program may exit. | |
64 | .SH "CLIENT INITIALIZATION" | |
65 | A program requesting an ISO service calls \fBTConnRequest\fR | |
66 | (which corresponds to the T\-CONNECT.REQUEST action). | |
67 | If successful, | |
68 | the interaction is henceforth symmetric. | |
69 | If un\-successful, | |
70 | information returned by the call indicates the reason for failure. | |
71 | .SH TRANSPORT\-DESCRIPTORS | |
72 | Once a connection has been established via a successful return from | |
73 | \fBTConnResponse\fR (for servers) or \fBTConnRequest\fR (for clients), | |
74 | a connection is referenced by a small integer | |
75 | (returned in a structure passed to these calls) called a | |
76 | \fItransport\-descriptor\fR. | |
77 | The transport\-descriptor appears as an argument to the peer routines described | |
78 | below. | |
79 | .PP | |
80 | By default, | |
81 | events associated with a transport\-descriptor are synchronous in nature: | |
82 | activity in the network won't generate an INDICATION event without program | |
83 | first asking to be told of any activity. | |
84 | To mark a transport\-descriptor as asynchronous, | |
85 | a call to \fBTSetIndications\fR is made with the addresses of an integer | |
86 | function to handle these events: | |
87 | .sp | |
88 | .in +.5i | |
89 | .nf | |
90 | .ta \w'\fIroutine\fR 'u | |
91 | \fIroutine\fR \fIevents\fR | |
92 | \fBfunc1\fR T\-DATA.INDICATION, T\-EXPEDITED DATA.INDICATION | |
93 | \fBfunc2\fR T\-DISCONNECT.INDICATION | |
94 | .re | |
95 | .fi | |
96 | .in -.5i | |
97 | .sp | |
98 | Upon a successful return from \fBTSetIndications\fR, | |
99 | these functions will be called as appropriate in this fashion: | |
100 | .sp | |
101 | .in +.5i | |
102 | .B "(*func1) (sd, tx);" | |
103 | .sp | |
104 | .B "(*func2) (sd, td);" | |
105 | .in -.5i | |
106 | .sp | |
107 | where \fBsd\fR is the transport\-descriptor, | |
108 | \fBtx\fR is a pointer to a \fBTSAPdata\fR structure, | |
109 | and \fBtd\fR is a pointer to a \fBTSAPdisconnect\fR structure. | |
110 | Any value returned by these functions is ignored. | |
111 | .PP | |
112 | Note well: the \fB\-ltsap\fR library uses the SIGEMT signal to provide this | |
113 | interface. | |
114 | Programs loaded with \fB\-ltsap\fR that use asynchronous transport\-descriptors | |
115 | should NOT use SIGEMT for other purposes. | |
116 | .PP | |
117 | For synchronous multiplexing of several connections, | |
118 | the routine \fBTSelectMask\fR updates a file\-descriptor mask and counter for | |
119 | use with \fIselect\fR\0(2). | |
120 | .SH PEER | |
121 | As a rule, | |
122 | a fatal failure (consult the \fIUser's Manual\fR) | |
123 | on return from any of these routines is equivalent to a | |
124 | T\-DISCONNECT.INDICATION. | |
125 | .sp | |
126 | .in +.5i | |
127 | .nf | |
128 | .ta \w'\fBTWriteRequest\fR 'u | |
129 | \fIroutine\fR \fIaction\fR | |
130 | \fBTDataRequest\fR T\-DATA.REQUEST | |
131 | \fBTExpdRequest\fR T\-EXPEDITED\-DATA.REQUEST | |
132 | \fBTWriteRequest\fR T\-WRITE.REQUEST (write user data vectors) | |
133 | \fBTReadRequest\fR T\-READ.REQUEST (synchronous read) | |
134 | \fBTDiscRequest\fR T\-DISCONNECT.REQUEST | |
135 | .re | |
136 | .fi | |
137 | .in -.5i | |
138 | .sp | |
139 | Note that the \fBTReadRequest\fR routine returns data from the peer by | |
140 | allocating memory. | |
141 | It should be freed before the structure is re\-used. | |
142 | .PP | |
143 | Finally, | |
144 | the routine \fBTErrString\fR takes a failure code from a \fBTSAPdisconnect\fR | |
145 | structure and returns a null\-terminated diagnostic string. | |
146 | Also, | |
147 | the routine \fBTLocalHostName\fR returns a null\-terminated string | |
148 | denoting the name of the localhost. | |
149 | .SH FILES | |
150 | .nf | |
151 | .ta \w'\*(EDisoservices 'u | |
152 | \*(EDisoservices ISODE services database | |
153 | .re | |
154 | .fi | |
155 | .SH "SEE ALSO" | |
156 | isoc(1c), isoservices(5), isod(8c), isore(8c), tsapd(8c), | |
157 | .br | |
158 | \fIThe ISO Development Environment: User's Manual\fR, | |
159 | .br | |
160 | \fIRFC1006: ISO Transport Services on top of the TCP, Version: 3\fR, | |
161 | .br | |
162 | ISO 8072: | |
163 | \fIInformation Processing Systems \-\- Open Systems Interconnection \-\- | |
164 | Transport Service Definition\fR, | |
165 | .br | |
166 | CCITT Recommendation X.214: | |
167 | \fITransport Service Definition for Open Systems Interconnection (OSI) for | |
168 | CCITT Applications\fR | |
169 | .SH DIAGNOSTICS | |
170 | All routines return the manifest constant \fBNOTOK\fR (\-1) on error. | |
171 | In addition, | |
172 | those routines which take a pointer to a \fBTSAPdisconnect\fR structure | |
173 | fill\-in the structure as appropriate. | |
174 | .SH AUTHORS | |
175 | Marshall T. Rose | |
176 | .br | |
177 | Dwight E. Cass, | |
178 | Northrop Research and Technology Center | |
179 | .SH BUGS | |
180 | Do not confuse transport\-descriptors with file\-descriptors. | |
181 | Unlike file\-descriptors which are implemented by the kernel, | |
182 | transport\-descriptors do not work across \fIfork\fRs and \fIexec\fRs. |