|
|
1.1 root 1: This directory contains the work on mapping the X-Protocol onto the ISO
2: Tranport Service.
3:
4: It is based on X11 R3 and ISODE Relase 6.0 tsap libraries.
5:
6: Basically, we require to build a server that Listens on well known
7: T-SAPs. We then need clients that connect to this server.
8:
9: server/
10: contains a libos for building an X server with (this directory
11: contains a Makefile to build such a server for a Sun at UCL).
12:
13: These would replace the routines in ..../X11/R3/server/os/4.2bsd/
14: (for example)
15:
16: client/
17: contains the OS/Comms parts of Xlib, and so clients can be re-linked
18: with the .o files here before Xlib, to force the right thing to
19: happen.
20:
21: These would replace the relevant routines in .../X11/R3/lib/X/
22:
23: ...although in both cases it is simpler to change the Imakefiles or
24: Makefiles just to pick up the .o's from here prior to searching the standard
25: libraries...
26:
27: -DISOCONN in either, builds
28: ISO T-Service usage in client and server
29:
30: I would *NOT* advise defining TCPCONN or UNIXCONN or DNETCONN as well,
31: but the code is sort of there...
32:
33: client:
34: server:
35:
36: so as we have an array of transport I/O fns and init it
37: in _XConnectDisplay in XConnDis.c and in
38: CreateWellKnownSockets in connection.c appropriate for
39: DECNET/TCP or ISO TP
40:
41: THIS HAS NOT BEEN TESTED in SERVER, only for clients...
42:
43: Done this by:
44: Add array of
45: a read(v), write(v), connect, listen, accept, close
46: functions ptrs, which are used by
47:
48: TWrite(v)To[Server|Client]
49: TRead(v)From[Server|Client]
50: TConnect
51: TListen
52: TAccept
53: TCloseDown
54:
55: well sort of...
56:
57: Note that TNetAccept will function for select as well as ISO TP so we dont need a fn for that...
58:
59: -DISODEBUG adds lots of fprintf(stderr...) for me.
60: [if the variable isodexbug is set to TRUE in connection.c/XConnDis.c]
61:
62: I use isodetcpath to get my own isodetail/isoentities file. In
63: a proper installation, this aint necessary, but UCL has a weird
64: setup:-)
65:
66: Note, ISO Server names are
67: HostName:T-Name:DisplayNumber
68: where T-Name is X or T to distinguish T/N service from TCP and DECNET
69: Thus xhost must needs be changed, as must the rest of the access
70: control stuff.
71: So you could do a setenv DISPLAY `hostname`:X0 or what have you.
72:
73: Note, because we do an AEI lookup on name + TServiceDisplayNumber, we
74: dont have to do the atoi stuff on display numbers for ISOCONNS...they
75: would be separate AEI entries in isoentities or directory.
76:
77: (server/)access.c,connect.c and (client/)XConnDis.c contain
78: references to sockadd_in structs all over the place for working out
79: peers and doing access control. These are changed to be TSAPaddr
80: structs. Lenghts for authenitication of clients are the first NASIZE
81: worth of the NSAP part of the TSAP...this is by analogy with doin it
82: on the IP (i.e. per host) addr only...
83:
84: The parse of HostName:T-NameDisplayNumber goes straight into a call
85: to str2aei(HostName, T-Name+DisplayNumber). So you nneed an entry
86: in your isoentities or directory!!
87:
88: T-Name = X or T at the moment.
89:
90: i.e. xterm -display perky:X0
91:
92: The entry in isoentities looks like:
93: #
94: # X Server (use Internet + X_TCP_PORT + 1 for now
95: # The OID Is really one of Surreys at the mo!!
96: # I guess OIDs for X should be done properly sometime...
97: #
98:
99: perky T0 1.17.4.3.36.1.1 \
100: Internet=perky.cs.ucl.ac.uk+6001
101:
102: dir X0 1.17.4.3.36.1.3 \
103: Janet=00000511320041
104:
105: #
106:
107: The mapping:
108:
109: X uses non-blocking writes, reads. The Open/Close are
110: synchronous/blocking. A particular problem may lie in the nature of
111: reliable close in DECNET and TCP, but unreliable close in ISO TP, so we
112: really ought to use session; in fact, there's a lot of debate, but ideally,
113: we would map the req/reply nature of X onto Remote Operations (which,
114: contrary to popular belief, will do the streaming required by X).
115: X doesnt use async (SIGIO) as far as i could find, luckily for me!!
116:
117: Unfortunately, the X Request/Response and Presentation functionality
118: is spread throughout the X library and DDX code, which makes this
119: approach a real headache.
120:
121: But, for now, its easier to do a transport mapping, and it buys us a
122: lot, such as X over TP/X.25 and, through a TSB, between X.25 nets and
123: TCP/IP nets, at low software effort.
124:
125: routines that have changed:
126: From ddx/libos stuff (based on 4.2bsd version)
127: server/
128: access.c
129: connection.c
130: WaitFor.c
131: io.c
132:
133: From Xlib stuff
134: client/
135: XConnDis.c
136: XlibInt.c
137: Xlibint.h
138: Xlibos.h
139:
140: 1.
141: socket+bind+connect=>
142: TConnRequest
143: QoS is set low for fun, and tsdu size is set to ethernet frame size (i
144: dont understand why i did this!!).
145:
146: 2.
147: socket+bind+listen=>
148: TNetListen
149: Since an X server can handle multiple clients, we use the *static*
150: server model, rather than the tsapd model.
151:
152:
153: 3.
154: accept=>TNetAccept (blocking...) plus
155: TInit, TConnResponse
156:
157: 4.
158: read/write and readv writev go over to being
159: TReadRequest/TTDataRequest and TReadRequest/TWriteReqest respectively
160:
161: 5.
162: In the client, Xlibos.h defines macros for
163: BytesReadable, WriteToServer, ReadFromServer, WritevToServer, ReadvFromServer.
164: These map onto
165: BytesReadable,
166: TWriteToServer, TReadFromServer, TWritevToServer, TReadvFromServer.
167:
168: which are arrays of routines (currently [2]) indexed by the IO Family
169: (i.e. Unix or ISODE) initialised per X connection to call
170: TSelectBytes, TReadRequest, TWriteReqest etc...or the unix (i.e. original)
171: equivalents...a similar trick is used in the server to achieve backwards compatibility for DECNET and raw TCP access...
172:
173: Since a TReadRequest returns *all* the buffered data in the transport
174: connection, the TRead(v)FromServer routines must hold onto extra data
175: beyond the X requested amount for later calls...This is a little horrid...
176:
177: 6.
178: The select loop in server in WaitFor.c goes to a
179: TNetAccept loop, checking for
180: a) new connections
181: b) writables
182: c) readables
183: which cause scheduling actions in the server.
184: NB select can poll for much shorter times than TNetAccept which may
185: cause stickiness in X performance...
186:
187: 7.
188: getpeername=>TGetAddresses
189:
190: Finally, we have to map from ISODE back to X. Since all the tsap
191: routines can return a disconnect with a reason, but (4.2bsd)
192: X expects errno's to be meaningful, we should map the DR_*s to
193: sensible errno's. In most cases (e.g. TService over TCP) this will
194: probably happen anyway...
195:
196:
197: ***********************WARNING*******************************
198: This has not been extensively tested. It is a sort of existence proof
199: implementation rather than a proper port. I have tested it under
200: Sun OS 4.0 on a Sun 3/60C and a Sun 4/330, using ISODE Release 6 beta,
201: with TService over TCP and over Sunlink X.25 6.0 and over raw TCP
202: ! I havnt tested any X clients other than the
203: ones with subdirectories here!
204:
205: I have *not* checked that undefing ISOCONN makes a good old R3
206: TCP/UNIX/DECNET lib, and i have not bothered merging in the hpux
207: or CRAY ifdef'd stuff, since we run BSD4.3 on our HPs, and dont have
208: COS on our two Crays...
209:
210: The Makefiles are lazy simple minded peasantish and so forth...
211: ***********************WARNING*******************************
212: jon crowcroft
213:
214: --------------------Addendum------------------------
215: MakeAClient - how to make *a* client at UCL
216: MakeAServer - how to make *a* server at UCL
217: Makefile* - somethin that does all the above
218: READ-ME - what you are doing now
219: TODO - what i should be doing now
220: bin/ - where i put them
221: client/ - the client specific parts
222: ideas/ - some notes from friends
223: ../isode@ - a link to the future
224: ../isodetail/ - my (Bond Street) tailor
225: server/ - the server (dix/os) specifix
226: tsap/ - another link to the future
227: uwm/ - where i make uwm
228: xclock/ - and a clock
229: xedit/ - and something big with widgets
230: xhost/ - a not quite there yet ISO auth
231: note this is the only client that actually requires source changes ...
232: xinit/ - where i make my begining
233: xmag/ - Room for a view
234: xterm/ - terminal emulation (what zombies do)
235: xwininfo/ - and just one more client to check
236:
237: [Currently, this code all derives from the X11R3 OS/Comms 4.2BSD
238: specific code, so i guess the MIT/X Consortium Copyright should
239: remain...perhaps with an ISODE one added. I certainly dont care to put
240: my name to it :-)
241:
242: The reason for this was i was hoping we could run a raw
243: TCP+DECNET+T-Service multiprotocol X service...so i tried to make all
244: the changes additions rather than substitutions for existing X code.
245: This may be misled, but it worked for Julian Onions in his NTP
246: port...and would admit of a first cut on an X/ISODE to X/TCP a(e.g.
247: when shared X comes along...) - howz that for a boggle?
248:
249: Also, some path names are grotty, and need Xizing, or ISODEizing -
250: again that is due to UCL weird installation]
251:
252:
253: Jon Crowcroft
254:
255: [email protected] internet
256: [email protected] JANET
257: c=gb@o=University College London@ou=Computer Science@cn=Jon Crowcroft The Matrix
258:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.