protocol 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606
  1. ./" * *
  2. ./" * (c) Copyright 1993, 1994 Hewlett-Packard Company *
  3. ./" * (c) Copyright 1993, 1994 International Business Machines Corp. *
  4. ./" * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
  5. ./" * (c) Copyright 1993, 1994 Novell, Inc. *
  6. ./" *
  7. .EQ
  8. delim @@
  9. define oc % "\\fR{\\fP" %
  10. define cc % "\\fR}\\fP" %
  11. .EN
  12. .de PT
  13. ..
  14. .de BT
  15. ..
  16. .fp 6 I
  17. .fp 7 C
  18. .fp 8 CB
  19. .ps 10
  20. .nr PS 10
  21. \&
  22. .sp 8
  23. .ce 1
  24. \s+2\fBX Display Manager Control Protocol\fP\s-2
  25. .sp 6
  26. .ce 4
  27. Keith Packard
  28. .sp 6p
  29. X Consortium
  30. Laboratory for Computer Science
  31. Massachusetts Institute of Technology
  32. .sp 8
  33. .LP
  34. Copyright \(co 1989 by the Massachusetts Institute of Technology
  35. .LP
  36. This document is for internal use by Member and Affiliate
  37. organizations of the MIT X Consortium. It may be redistributed
  38. internally within such organizations, provided the above copyright
  39. notice and this permission notice appear in all copies, but it is not
  40. to be published and it is not to be redistributed externally. MIT
  41. makes no representations about the suitability for any purpose of the
  42. information in this document. It is provided ``as is'' without express
  43. or implied warranty. The information in this document is a
  44. preliminary draft and therefore subject to change, and does not
  45. represent an approved specification of the MIT X Consortium.
  46. .bp
  47. .AB
  48. .LP
  49. Since the X Display Manager (xdm) may be used to manage remote displays (such
  50. as X terminals), a protocol for requesting service over the network is
  51. needed. Since the display manager is a scarce resource, the X Display
  52. Manager Control Protocol (also called XDMCP) is designed to use unreliable
  53. datagrams and places the bulk of the burden for sequencing and retransmission
  54. on the display. A standard byte order and synchronous responses reduces the
  55. complexity of the protocol.
  56. .AE
  57. .de PT
  58. .ie o .tl 'XDMCP''X Display Manager Control Protocol '
  59. .el .tl 'X Display Manager Control Protocol ''XDMCP'
  60. ..
  61. .bp 1
  62. .de BT
  63. .tl ''\fB % \fP''
  64. ..
  65. .NH 1
  66. Overview
  67. .LP
  68. XDMCP is designed to provide authenticated access to display management
  69. services for remote displays. A new network server, called a \fBDisplay
  70. Manager\fP will use XDMCP to communicate with displays to negotiate the
  71. startup of X sessions. The protocol allows the display to authenticate the
  72. manager. It also allows most of the configuration information to be
  73. centralized with the manager, to ease the burden of system administration in
  74. a large network of displays. The essential goal is to provide plug-and-play
  75. services similar to those provided in the familiar mainframe/terminal world.
  76. .LP
  77. Displays may be turned off by the user at any time. Any existing session
  78. running on a display which has been turned off must be identifiable. This
  79. is made possible by requiring a three-way handshake to start a session. If
  80. the handshake succeeds, any existing session is terminated immediately and a
  81. new session started. There is the problem (at least with TCP) that
  82. connections may not be closed when the display is turned off. The manager
  83. could reduce this problem by periodically XSync'ing on its own connection,
  84. and terminating the session if its own connection ever closes. This,
  85. however, could add considerable network load in a large network.
  86. .LP
  87. Displays should not be required to retain permanent state for purposes of
  88. the control protocol. One solution to packets received out of sequence
  89. would be to use monotonically-increasing message identifiers in each message
  90. to allow both sides to ignore messages which arrive out-of-sequence. For
  91. this to work, displays would at a minimum have to increment a stable "crash
  92. count" each time they are powered on, and use that number as part of a
  93. larger sequence number. But if displays cannot retain permanent state this
  94. cannot work. Instead, the manager assumes the responsibility for permanent
  95. state by generating unique numbers which identify a particular session and
  96. the protocol simply ignores packets which correspond to an invalid session.
  97. .LP
  98. The Manager must not be responsible for packet reception. To prevent the
  99. Manager from becoming stuck because of a hostile display, no portion of the
  100. protocol requires the Manager to retransmit a packet. Part of this means
  101. that any valid packet which the Manager does receive \fImust\fP be
  102. acknowledged in some way, to prevent the display from continuously resending
  103. packets. The display can keep the protocol running as it will always know
  104. when the Manager has received (at least one copy of) a packet. On the
  105. Manager side, this means that any packet may be received more than once (if
  106. the response was lost) and duplicates must be ignored.
  107. .NH 1
  108. Data Types
  109. .LP
  110. XDMCP packets contain several types of data. For multi-byte integers, the
  111. values are stored in ``Big Endian'' order; most significant byte first.
  112. As XDMCP will not be used to transport large quantities of data, this
  113. restriction will not substantially hamper the efficiency of any
  114. implementation. Also, no padding of any sort will occur within the packets.
  115. .TS
  116. expand;
  117. c c c
  118. c c c
  119. l l l.
  120. Type Name Length Description
  121. (in bytes)
  122. CARD8 1 A single byte unsigned integer
  123. CARD16 2 Two byte unsigned integer
  124. CARD32 4 Four byte unsigned integer
  125. ARRAY8 n+1 This is actually a CARD8 followed by
  126. a collection of CARD8. The value of the first CARD8
  127. field (n) specifies the number of CARD8 values to
  128. follow
  129. ARRAY16 2*m+1 This is a CARD8 (m) which specifies the
  130. number of CARD16 values to follow
  131. ARRAY32 4*l+1 This is a CARD8 (l) which specifies the
  132. number of CARD32 values to follow
  133. ARRAYofARRAY8 ? This is a CARD8 which specifies the
  134. number of ARRAY8 values to follow.
  135. .TE
  136. .NH 1
  137. Packet Format
  138. .LP
  139. All XDMCP packets have the following information:
  140. .TS
  141. expand;
  142. c c c c
  143. c c c c
  144. _ _ _
  145. | c l l | c
  146. | c l l | c
  147. | c l l | c
  148. _ _ _
  149. c l l c.
  150. Length in Field Description of field
  151. Bytes Type
  152. 2 CARD16 version number
  153. 2 CARD16 opcode packet header
  154. 2 CARD16 n = length of remaining data in bytes
  155. n ??? packet-specific data
  156. .TE
  157. .LP
  158. The fields are as follows:
  159. .LP
  160. Version Number
  161. .RS
  162. This specifies the version of XDMCP that generated this packet in
  163. case changes in this protocol are required. Displays and
  164. managers may choose to support older versions for compatibility.
  165. This field will initially be 1.
  166. .RE
  167. .LP
  168. Opcode
  169. .RS
  170. This specifies what step of the protocol this packet represents and should
  171. contain one of the following values (encoding provided in section below):
  172. \f8BroadcastQuery\fP, \f8Query\fP, \f8IndirectQuery\fP, \f8ForwardQuery\fP,
  173. \f8Willing\fP, \f8Unwilling\fP, \f8Request\fP, \f8Accept\fP, \f8Decline\fP,
  174. \f8Manage\fP, \f8Refuse\fP, \f8Failed\fP.
  175. .RE
  176. .LP
  177. Length of data in bytes
  178. .RS
  179. This specifies the length of the information following the first 6 bytes.
  180. Each packet-type has a different format, and will need to be separately
  181. length-checked against this value. As every data item has either an
  182. explicit length, or an implicit length, this can be easily accomplished.
  183. Packets that have too little or too much data should be ignored.
  184. .RE
  185. .LP
  186. Packets should be checked to make sure that they satisfy the following
  187. conditions:
  188. .RS
  189. .IP 1
  190. They must contain valid opcodes.
  191. .IP 2
  192. The length of the remaining data should correspond to the sum of the
  193. lengths of the individual remaining data items.
  194. .IP 3
  195. The
  196. \f7opcode\fP
  197. should be expected (a finite state diagram is given
  198. in a later section).
  199. .IP 4
  200. If the packet is of type \f8Manage\fP or \f8Refuse\fP, the \f7Session ID\fP
  201. should match the value sent in the preceding \f8Accept\fP packet.
  202. .RE
  203. .NH 1
  204. Protocol
  205. .LP
  206. Each of the opcodes is described below. Since a given packet type is only
  207. ever sent one way, each packet description below indicates the direction.
  208. Most of the packets have additional information included beyond the
  209. description above. The additional information is appended to the packet
  210. header in the order described without padding, and the length field is
  211. computed accordingly.
  212. .LP
  213. \f8Query\fP
  214. .br
  215. \f8BroadcastQuery\fP
  216. .br
  217. \f8IndirectQuery\fP
  218. .RS
  219. Display \(-> Manager
  220. .br
  221. Additional Fields:
  222. .RS
  223. \f7Authentication Names\fP:
  224. ARRAYofARRAY8
  225. .RS
  226. A list of authentication names which the display supports. The manager will
  227. choose one of these and return it in the \f8Willing\fP packet.
  228. .RE
  229. .RE
  230. Semantics:
  231. .RS
  232. A \f8Query\fP packet is sent from the display to a specific host to ask if
  233. that host is willing to provide management services to this display. The
  234. host should respond with \f8Willing\fP if it is willing to service the
  235. display or \f8Unwilling\fP if it is not.
  236. .LP
  237. A \f8BroadcastQuery\fP packet is similar to the \f8Query\fP packet except
  238. that it is intended to be received by all hosts on the network (or
  239. sub-network). However, unlike \f8Query\fP requests, hosts that are not
  240. willing to service the display should simply ignore \f8BroadcastQuery\fP
  241. requests.
  242. .LP
  243. An \f8IndirectQuery\fP packet is sent to a well-known manager which forwards
  244. the request to a larger collection of secondary managers using
  245. \f8ForwardQuery\fP packets. In this way, the collection of managers which
  246. respond can be grouped on other than network boundaries; the use of a
  247. central manager reduces system administrative overhead. The primary manager
  248. may also send a \f8Willing\fP packet in response to this packet.
  249. .LP
  250. Each packet type has slightly different semantics:
  251. .IP
  252. The \f8Query\fP packet is destined only for a single host. If the display
  253. is instructed to \f8Query\fP multiple managers, it will send multiple
  254. \f8Query\fP packets. The \f8Query\fP packet also demands a response from
  255. the manager, either \f8Willing\fP or \f8Unwilling\fP.
  256. .IP
  257. The \f8BroadcastQuery\fP packet is sent to many hosts. Each manager which
  258. receives this packet will not respond with an \f8Unwilling\fP packet.
  259. .IP
  260. The \f8IndirectQuery\fP packet is sent to only one manager, with the request
  261. that the request be forwarded to a larger list of managers using
  262. \f8ForwardQuery\fP packets. This list is expected to be maintained at one
  263. central site to reduce administrative overhead. The function of this packet
  264. type is similar to \f8BroadcastQuery\fP except that \f8BroadcastQuery\fP is
  265. not forwarded.
  266. .RE
  267. Valid Responses:
  268. .RS
  269. \f8Willing\fP, \f8Unwilling\fP
  270. .RE
  271. Problems/Solutions:
  272. .RS
  273. Problem:
  274. .RS
  275. Not all managers receive the query packet.
  276. .RE
  277. .RS
  278. Indication:
  279. .RS
  280. none if \f8BroadcastQuery\fP or \f8IndirectQuery\fP was sent, else failure
  281. to receive \f8Willing\fP.
  282. .RE
  283. Solution:
  284. .RS
  285. Repeatedly send the packet while waiting for user to choose a manager.
  286. .RE
  287. .RE
  288. .RE
  289. Timeout/Retransmission policy:
  290. .RS
  291. An exponential backoff algorithm should be used here to reduce network load
  292. for long-standing idle displays. Start at 2 seconds, back off by factors of
  293. 2 to 32 seconds and discontinue retransmit after 126 seconds. The display
  294. should reset the timeout when user-input is detected. In this way, the
  295. display will ``wakeup'' when touched by the user.
  296. .RE
  297. .RE
  298. .LP
  299. \f8ForwardQuery\fP
  300. .RS
  301. Primary Manager \(-> Secondary Manager
  302. .br
  303. Additional Fields:
  304. .RS
  305. \f7Client Address\fP:
  306. ARRAY8
  307. .RS
  308. The network address of the client display.
  309. .RE
  310. \f7Client Port\fP:
  311. ARRAY8
  312. .RS
  313. An identification of the client task on the client display.
  314. .RE
  315. \f7Authentication Names\fP:
  316. ARRAYofARRAY8
  317. .RS
  318. This is a duplicate of \f7Authentication Names\fP array which was received
  319. in the \f8IndirectQuery\fP
  320. packet.
  321. .RE
  322. .RE
  323. Semantics:
  324. .RS
  325. When primary manager receives a \f8IndirectQuery\fP packet, it is
  326. responsible for sending \f8ForwardQuery\fP packets to an appropriate list of
  327. managers which can provide service to the display using the same network
  328. type as the one the original \f8IndirectQuery\fP packet was received from.
  329. The \f7Client Address\fP and \f7Client Port\fP fields must contain an
  330. address which the secondary manager can use to reach the display also using
  331. this same network. Each secondary manager sends a \f8Willing\fP packet to
  332. the display if it is willing to provide service.
  333. .LP
  334. \f8ForwardQuery\fP packets are similar to \f8BroadcastQuery\fP packets in
  335. that managers which are not willing to service particular displays should
  336. not send a \f8Unwilling\fP packet.
  337. .RE
  338. Valid Responses:
  339. .RS
  340. \f8Willing\fP
  341. .RE
  342. Problems/Solutions:
  343. .RS
  344. Identical to \f8BroadcastQuery\fP
  345. .RE
  346. Timeout/Retransmission policy:
  347. .RS
  348. Like all packets sent from a manager, this packet should never be
  349. retransmitted.
  350. .RE
  351. .RE
  352. .RE
  353. .LP
  354. \f8Willing\fP
  355. .RS
  356. Manager \(-> Display
  357. .br
  358. Additional Fields:
  359. .RS
  360. \f7Authentication Name\fP:
  361. ARRAY8
  362. .RS
  363. This specifies the authentication method, selected from the list offered in
  364. the \f8Query\fP, \f8BroadcastQuery\fP or \f8IndirectQuery\fP packet that the
  365. manger expects the display to use in the subsequent \f8Request\fP packet.
  366. This choice should remain as constant as feasible so that displays which
  367. send multiple \f8Query\fP packets can use the \f7Authentication Name\fP from
  368. any \f8Willing\fP packet which arrives.
  369. .LP
  370. The display is free to ignore managers which request an insufficient level
  371. of authentication.
  372. .RE
  373. \f7Hostname\fP:
  374. ARRAY8
  375. .RS
  376. A human readable string describing the host from which the packet was sent.
  377. The protocol specifies no interpretation of the data in this field.
  378. .RE
  379. \f7Status\fP:
  380. ARRAY8
  381. .RS
  382. A human readable string describing the ``status'' of the host. This could
  383. include load average/number of users connected or other information. The
  384. protocol specifies no interpretation of the data in this field.
  385. .RE
  386. .RE
  387. Semantics:
  388. .RS
  389. A \f8Willing\fP packet is sent by managers that may service connections from
  390. this display. It is sent in response to either a \f8Query\fP,
  391. \f8BroadcastQuery\fP or \f8ForwardQuery\fP but does not imply a commitment
  392. to provide service (e.g. it may later decide that it has accepted enough
  393. connections already).
  394. .RE
  395. Problems/Solutions:
  396. .RS
  397. Problem:
  398. .RS
  399. \f8Willing\fP not received by the display.
  400. .br
  401. Indication:
  402. .RS
  403. none if \f8BroadcastQuery\fP or \f8IndirectQuery\fP was sent, else failure to
  404. receive \f8Willing\fP.
  405. .RE
  406. Solution:
  407. .RS
  408. The display should continue to send the query until a response is received.
  409. .RE
  410. .RE
  411. .RE
  412. Timeout/Retransmission policy:
  413. .RS
  414. Like all packets sent from the manager to the display, this packet should
  415. never be retransmitted.
  416. .RE
  417. .RE
  418. .LP
  419. \f8Unwilling\fP
  420. .RS
  421. Manager \(-> Display
  422. .br
  423. Additional Fields:
  424. .RS
  425. The same fields as in the \f8Willing\fP packet. The \f7Status\fP field
  426. should indicate to the user a reason for the refusal of service.
  427. .RE
  428. Semantics:
  429. .RS
  430. An \f8Unwilling\fP packet is sent by managers in response to direct
  431. \f8Query\fP requests (as opposed to \f8BroadcastQuery\fP or
  432. \f8IndirectQuery\fP requests) if the manager will not accept requests for
  433. management. This is typically sent by managers that wish to only service
  434. particular displays or which handle a limited number of displays at once.
  435. .RE
  436. Problems/Solutions:
  437. .RS
  438. Problem:
  439. .RS
  440. \f8Unwilling\fP not received by the display.
  441. .br
  442. Indication:
  443. .RS
  444. Display fails to receive \f8Unwilling\fP.
  445. .RE
  446. Solution:
  447. .RS
  448. The display should continue to send \f8Query\fP messages until a response is
  449. received.
  450. .RE
  451. .RE
  452. .RE
  453. Timeout/Retransmission policy:
  454. .RS
  455. Like all packets sent from the manager to the display, this packet should
  456. never be retransmitted.
  457. .RE
  458. .RE
  459. .LP
  460. \f8Request\fP
  461. .br
  462. .RS
  463. Display \(-> Manager
  464. .br
  465. Additional Fields:
  466. .RS
  467. \f7Display Number\fP:
  468. CARD16
  469. .RS
  470. The index of this particular server for the host on which the display is
  471. resident.
  472. .RE
  473. \f7Connection Types\fP:
  474. ARRAY16
  475. .RS
  476. An array indicating the stream services accepted by the display. If the
  477. high-order byte in a particular entry is zero, the low-order byte
  478. corresponds to an X-protocol host family type.
  479. .RE
  480. \f7Connection Addresses\fP:
  481. ARRAYofARRAY8
  482. .RS
  483. For each connection type in the previous array, the corresponding entry in
  484. this array indicates the network address of the display device.
  485. .RE
  486. \f7Authentication Name\fP:
  487. ARRAY8
  488. .br
  489. \f7Authentication Data\fP:
  490. ARRAY8
  491. .RS
  492. This specifies the authentication protocol that the display expects
  493. the manager to validate itself with. The Authentication Data is
  494. expected to contain data which the manager will interpret, modify
  495. and use to authenticate itself.
  496. .RE
  497. \f7Authorization Names\fP:
  498. ARRAYofARRAY8
  499. .RS
  500. This array specifies which types of authorization the display supports. The
  501. manager may decide to reject displays with which it cannot perform
  502. authorization.
  503. .RE
  504. \f7Manufacturer Display ID\fP:
  505. ARRAY8
  506. .RS
  507. This field can be used by the manager to determine how to decrypt the
  508. Authentication Data field in this packet. See the section below on
  509. Manufacturer Display ID Format.
  510. .RE
  511. .RE
  512. Semantics:
  513. .RS
  514. A \f8Request\fP packet is sent by a display to a specific host to request a
  515. session id in preparation for a establishing a connection. If the manager
  516. is willing to service a connection to this display, it should return an
  517. \f8Accept\fP packet with a valid session id and should be ready for a
  518. subsequent Manage request. Otherwise, it should return a \f8Decline\fP
  519. packet.
  520. .RE
  521. Valid Responses:
  522. .RS
  523. \f8Accept\fP, \f8Decline\fP
  524. .RE
  525. Problems/Solutions:
  526. .RS
  527. Problem:
  528. .RS
  529. Request not received by manager.
  530. .br
  531. Indication:
  532. .RS
  533. Display timeout waiting for response.
  534. .RE
  535. Solution:
  536. .RS
  537. Display resends \f8Request\fP message.
  538. .RE
  539. .RE
  540. Problem:
  541. .RS
  542. _DtMessage received out of order by manager.
  543. .br
  544. Indication:
  545. .RS
  546. none
  547. .RE
  548. Solution:
  549. .RS
  550. Each time a \f8Request\fP is sent, the manager sends the \f7Session ID\fP
  551. associated with the next session in the \f8Acknowledge\fP. If that next
  552. session is not yet started, the manager will simply resend with the same
  553. \f7Session ID\fP. If the session is in progress, the manager will reply
  554. with a new \f7Session ID\fP; in which case, the \f8Acknowledge\fP will be
  555. discarded by the display.
  556. .RE
  557. .RE
  558. .RE
  559. Timeout/Retransmission policy:
  560. .RS
  561. Timeout after 2 seconds, exponential backoff to 32 seconds. After no more
  562. than 126 seconds, give up and report an error to the user.
  563. .RE
  564. .RE
  565. .LP
  566. \f8Accept\fP
  567. .RS
  568. Manager \(-> Display
  569. .br
  570. Additional Fields:
  571. .RS
  572. \f7Session ID\fP:
  573. CARD32
  574. .RS
  575. This identifies the session which can be started by the manager.
  576. .RE
  577. \f7Authentication Name\fP:
  578. ARRAY8
  579. .br
  580. \f7Authentication Data\fP:
  581. ARRAY8
  582. .RS
  583. This data is sent back to the display to authenticate the manager.
  584. If the Authentication Data is not the value expected by the display, it
  585. should terminate the protocol at this point and display an error to the user.
  586. .RE
  587. \f7Authorization Name\fP:
  588. ARRAY8
  589. .br
  590. \f7Authorization Data\fP:
  591. ARRAY8
  592. .RS
  593. This data is sent to the display to indicate the type of authorization the
  594. manager will be using in the first XOpenDisplay request after the
  595. Manage packet is received.
  596. .RE
  597. .RE
  598. Semantics:
  599. .RS
  600. An \f8Accept\fP packet is sent by a manager in response to a \f8Request\fP
  601. packet if the manager is willing to establish a connection for the display.
  602. The \f7Session ID\fP is used to identify this connection from any preceding
  603. ones and will be used by the display in its subsequent \f8Manage\fP packet.
  604. The \f7Session ID\fP is a 32 bit number which is incremented each time an
  605. \f8Accept\fP packet is sent as it must be reasonably unique over a long
  606. period of time.
  607. .LP
  608. If the authentication information is invalid, a \f8Decline\fP packet will be
  609. returned with an appropriate \f7Status\fP message.
  610. .RE
  611. Problems/Solutions:
  612. .RS
  613. Problem:
  614. .RS
  615. \f8Accept\fP or \f8Decline\fP not received by display.
  616. .br
  617. Indication:
  618. .RS
  619. Display timeout waiting for response to \f8Request\fP.
  620. .RE
  621. Solution:
  622. .RS
  623. Display resends \f8Request\fP message.
  624. .RE
  625. .RE
  626. Problem:
  627. .RS
  628. _DtMessage received out of order by display.
  629. .br
  630. Indication:
  631. .RS
  632. Display receives \f8Accept\fP after \f8Manage\fP has been sent.
  633. .RE
  634. Solution:
  635. .RS
  636. Display discards \f8Accept\fP messages after it has sent a \f8Manage\fP
  637. message.
  638. .RE
  639. .RE
  640. .RE
  641. Timeout/Retransmission policy:
  642. .RS
  643. Like all packets sent from the manager to the display, this packet should
  644. never be retransmitted.
  645. .RE
  646. .RE
  647. .LP
  648. \f8Decline\fP
  649. .RS
  650. Manager \(-> Display
  651. .br
  652. Additional Fields:
  653. .RS
  654. \f7Status\fP:
  655. ARRAY8
  656. .RS
  657. This is a human readable string indicating the reason for refusal of
  658. service.
  659. .RE
  660. \f7Authentication Name\fP:
  661. ARRAY8
  662. .br
  663. \f7Authentication Data\fP:
  664. ARRAY8
  665. .RS
  666. This data is sent back to the display to authenticate the manager. If the
  667. \f7Authentication Data\fP is not the value expected by the display, it
  668. should terminate the protocol at this point and display an error to the user.
  669. .RE
  670. .RE
  671. Semantics:
  672. .RS
  673. A \f8Decline\fP packet is sent by a manager in response to a \f8Request\fP
  674. packet if the manager is unwilling to establish a connection for the
  675. display. This is allowed even if the manager had responded \f8Willing\fP to
  676. a previous query.
  677. .RE
  678. Problems/Solutions:
  679. .RS
  680. same as for
  681. \f8Accept\fP.
  682. .RE
  683. Timeout/Retransmission policy:
  684. .RS
  685. Like all packets sent from a manager to a display, this packet should never
  686. be retransmitted.
  687. .RE
  688. .RE
  689. .LP
  690. \f8Manage\fP
  691. .RS
  692. Display \(-> Manager
  693. .br
  694. Additional Fields:
  695. .RS
  696. \f7Session ID\fP:
  697. CARD32
  698. .RS
  699. This field should contain the non-zero session id returned
  700. in the
  701. \f8Accept\fP
  702. packet.
  703. .RE
  704. \f7Display Number\fP:
  705. CARD32
  706. .RS
  707. This field must match the value sent in the previous
  708. \f8Request\fP
  709. packet.
  710. .RE
  711. \f7Display Class\fP:
  712. ARRAY8
  713. .RS
  714. This array specifies the class of the display. Please refer to the section
  715. below (Display Class Format) which discusses the format of this field.
  716. .RE
  717. .RE
  718. Semantics:
  719. .RS
  720. A \f8Manage\fP packet is sent by a display to ask the manager to begin a
  721. session on the display. If the \f7Session ID\fP is correct the manager
  722. should open a connection, otherwise it should respond with a \f8Refuse\fP or
  723. \f8Failed\fP packet.
  724. .RE
  725. Valid Responses:
  726. .RS
  727. X connection with correct auth info,
  728. \f8Refuse\fP,
  729. \f8Failed\fP.
  730. .RE
  731. Problems/Solutions:
  732. .RS
  733. Problem:
  734. .RS
  735. \f8Manage\fP
  736. not received by manager.
  737. .br
  738. Indication:
  739. .RS
  740. Display timeout waiting for response.
  741. .RE
  742. Solution:
  743. .RS
  744. Display resends
  745. \f8Manage\fP
  746. message.
  747. .RE
  748. .RE
  749. Problem:
  750. .RS
  751. \f8Manage\fP received out of order by manager.
  752. .br
  753. Indication:
  754. .RS
  755. session already in progress.
  756. .RE
  757. Solution:
  758. .RS
  759. \f8Refuse\fP message is sent.
  760. .RE
  761. Indication:
  762. .RS
  763. \f7Session ID\fP doesn't match next \f7Session ID\fP
  764. .RE
  765. Solution:
  766. .RS
  767. \f8Refuse\fP message is sent.
  768. .RE
  769. .RE
  770. Problem:
  771. .RS
  772. Display cannot be opened on selected stream.
  773. .br
  774. Indication:
  775. .RS
  776. open display fails.
  777. .RE
  778. Solution:
  779. .RS
  780. \f8Failed\fP message is sent including a human readable reason.
  781. .RE
  782. .RE
  783. .RE
  784. Timeout/Retransmission policy:
  785. .RS
  786. Timeout after 2 seconds, exponential backoff to 32 seconds. After no more
  787. than 126 seconds, give up and report an error to the user.
  788. .RE
  789. .RE
  790. .LP
  791. \f8Refuse\fP
  792. .RS
  793. Manager \(-> Display
  794. .br
  795. Additional Fields:
  796. .RS
  797. \f7Session ID\fP:
  798. .RS
  799. This field should be set to the
  800. \f7Session ID\fP
  801. received in the
  802. \f8Manage\fP
  803. packet.
  804. .RE
  805. .RE
  806. Semantics:
  807. .RS
  808. A \f8Refuse\fP packet is sent by a manager when the \f7Session ID\fP
  809. received in the \f8Manage\fP packet does not match the current \f7Session
  810. ID\fP. The display should assume that it received an old \f8Accept\fP
  811. packet and should resend its \f8Request\fP packet.
  812. .RE
  813. Problems/Solutions:
  814. .RS
  815. Problem:
  816. .RS
  817. Error message is lost.
  818. .br
  819. Indication:
  820. .RS
  821. display times out waiting for OpenDisplay, \f8Refuse\fP or \f8Failed\fP.
  822. .RE
  823. Solution:
  824. .RS
  825. display resends \f8Manage\fP message.
  826. .RE
  827. .RE
  828. .RE
  829. Timeout/Retransmission policy:
  830. .RS
  831. Like all packets sent from a manager to a display, this packet should never be
  832. retransmitted.
  833. .RE
  834. .RE
  835. .LP
  836. \f8Failed\fP
  837. .RS Manager \(-> Display
  838. .br
  839. Additional Fields:
  840. .RS
  841. \f7Session ID\fP:
  842. CARD32
  843. .RS
  844. This field should be set to the \f7Session ID\fP received in the
  845. \f8Manage\fP packet.
  846. .RE
  847. \f7Status\fP:
  848. ARRAY8
  849. .RS
  850. A human readable string indicating the reason for failure.
  851. .RE
  852. .RE
  853. Semantics:
  854. .RS
  855. A \f8Failed\fP packet is sent by a manager when it has problems establishing
  856. the initial X connection in response to the \f8Manage\fP packet.
  857. .RE
  858. Problems/Solutions
  859. .RS
  860. Same as for \f8Refuse\fP.
  861. .RE
  862. .RE
  863. .RE
  864. .NH 1
  865. Session Termination
  866. .LP
  867. When the session is over, the initial connection with the display (the one
  868. which ack's the \f8Manage\fP packet) will be closed by the manager. At this
  869. point, all other display connections should be closed by the display and the
  870. display can request another session.
  871. .NH 1
  872. State Diagrams
  873. .LP
  874. These state diagrams are designed to cover all actions of both
  875. the display and the manager. Any packet which is received out-of-sequence
  876. will be ignored.
  877. .LP
  878. Display:
  879. .RS
  880. .LP
  881. \f6start\fP:
  882. .RS
  883. user-requested connect to one host \(-> \f6query\fP
  884. .br
  885. user-requested connect to some host \(-> \f6broadcast\fP
  886. .br
  887. user-requested connect to site host-list \(-> \f6indirect\fP
  888. .RE
  889. .LP
  890. \f6query\fP:
  891. .RS
  892. Send \f8Query\fP packet
  893. .br
  894. \(-> \f6collect-query\fP
  895. .RE
  896. .LP
  897. \f6collect-query\fP:
  898. .RS
  899. receive \f8Willing\fP \(-> \f6start-connection\fP
  900. .br
  901. receive \f8Unwilling\fP \(-> \f6stop-connection\fP
  902. .br
  903. timeout \(-> \f6query\fP
  904. .RE
  905. .LP
  906. \f6broadcast\fP:
  907. .RS
  908. Send \f8BroadcastQuery\fP packet
  909. .br
  910. \(-> \f6collect-broadcast-query\fP
  911. .RE
  912. .LP
  913. \f6collect-broadcast-query\fP:
  914. .RS
  915. receive \f8Willing\fP \(-> \f6update-broadcast-willing\fP
  916. .br
  917. user-requested connect to one host \(-> \f6start-connection\fP
  918. .br
  919. timeout \(-> \f6broadcast\fP
  920. .RE
  921. .LP
  922. \f6update-broadcast-willing\fP:
  923. .RS
  924. Add new host to the host list presented to the user.
  925. .br
  926. \(-> \f6collect-broadcast-query\fP
  927. .RE
  928. .LP
  929. \f6indirect\fP:
  930. .RS
  931. Send \f8IndirectQuery\fP packet
  932. .br
  933. \(-> \f6collect-indirect-query\fP
  934. .RE
  935. .LP
  936. \f6collect-indirect-query\fP:
  937. .RS
  938. receive \f8Willing\fP \(-> \f6update-indirect-willing\fP
  939. .br
  940. user-requested connect to one host \(-> \f6start-connection\fP
  941. .br
  942. timeout \(-> \f6indirect\fP
  943. .RE
  944. .LP
  945. \f6update-indirect-willing\fP:
  946. .RS
  947. Add new host to the host list presented to the user.
  948. .br
  949. \(-> \f6collect-indirect-query\fP
  950. .RE
  951. .LP
  952. \f6start-connection\fP:
  953. .RS
  954. Send \f8Request\fP packet
  955. .br
  956. \(-> \f6await-request-response\fP
  957. .RE
  958. .LP
  959. \f6await-request-response\fP:
  960. .RS
  961. receive \f8Accept\fP \(-> \f6manage\fP
  962. .br
  963. receive \f8Decline\fP \(-> \f6stop-connection\fP
  964. .br
  965. timeout \(-> \f6start-connection\fP
  966. .RE
  967. .LP
  968. \f6manage\fP:
  969. .RS
  970. Save \f7Session ID\fP
  971. .br
  972. Close all existing display connections.
  973. .br
  974. Send \f8Manage\fP packet with \f7Session ID\fP
  975. .br
  976. \(-> \f6await-manage-response\fP
  977. .RE
  978. .LP
  979. \f6await-manage-response\fP:
  980. .RS
  981. receive XOpenDisplay: \(-> \f6run-session\fP
  982. .br
  983. receive \f8Refuse\fP with matching \f7Session ID\fP \(-> \f6start-connection\fP
  984. .br
  985. receive \f8Failed\fP with matching \f7Session ID\fP \(-> \f6stop-connection\fP
  986. .br
  987. timeout \(-> \f6manage\fP
  988. .RE
  989. .LP
  990. \f6stop-connection\fP:
  991. .RS
  992. Display cause of termination to user
  993. .br
  994. \(-> \f6start\fP
  995. .RE
  996. \f6run-session\fP:
  997. .RS
  998. await close of first display connection
  999. .br
  1000. \(-> \f6reset-display\fP
  1001. .RE
  1002. .LP
  1003. \f6reset-display\fP:
  1004. .RS
  1005. close all display connections
  1006. .br
  1007. \(-> \f6start\fP
  1008. .RE
  1009. .RE
  1010. .LP
  1011. Manager:
  1012. .RS
  1013. .LP
  1014. \f6idle\fP:
  1015. .RS
  1016. receive \f8Query\fP \(-> \f6query-respond\fP
  1017. .br
  1018. receive \f8BroadcastQuery\fP \(-> \f6broadcast-respond\fP
  1019. .br
  1020. receive \f8IndirectQuery\fP \(-> \f6indirect-respond\fP
  1021. .br
  1022. receive \f8ForwardQuery\fP \(-> \f6forward-respond\fP
  1023. .br
  1024. receive \f8Request\fP \(-> \f6request-respond\fP
  1025. .br
  1026. receive \f8Manage\fP \(-> \f6manage\fP
  1027. .br
  1028. an active session terminates \(-> \f6finish-session\fP
  1029. .br
  1030. \(-> \f6idle\fP
  1031. .RE
  1032. .LP
  1033. \f6query-respond\fP:
  1034. .RS
  1035. if willing to manage \(-> \f6send-willing\fP
  1036. .br
  1037. \(-> \f6send-unwilling\fP
  1038. .RE
  1039. .LP
  1040. \f6broadcast-respond\fP:
  1041. .RS
  1042. if willing to manage \(-> \f6send-willing\fP
  1043. .br
  1044. \(-> \f6idle\fP
  1045. .RE
  1046. .LP
  1047. \f6indirect-respond\fP:
  1048. .RS
  1049. Send \f8ForwardQuery\fP packets to all managers on redirect list.
  1050. .br
  1051. if willing to manage \(-> \f6send-willing\fP
  1052. .br
  1053. \(-> \f6idle\fP
  1054. .RE
  1055. .LP
  1056. \f6forward-respond\fP:
  1057. .RS
  1058. Decode destination address, if willing to manage \(-> \f6send-willing\fP
  1059. .br
  1060. \(-> \f6idle\fP
  1061. .RE
  1062. .LP
  1063. \f6send-willing\fP:
  1064. .RS
  1065. Send \f8Willing\fP packet
  1066. .br
  1067. \(-> \f6idle\fP
  1068. .RE
  1069. .LP
  1070. \f6send-unwilling\fP:
  1071. .RS
  1072. Send \f8Unwilling\fP packet
  1073. .br
  1074. \(-> \f6idle\fP
  1075. .RE
  1076. .LP
  1077. \f6request-respond\fP:
  1078. .RS
  1079. if manager is willing to allow a session on display \(-> \f6accept-session\fP
  1080. .br
  1081. \(-> \f6decline-session\fP
  1082. .RE
  1083. .LP
  1084. \f6accept-session\fP:
  1085. .RS
  1086. Generate \f7Session ID\fP. Save \f7Session ID\fP, display address and
  1087. display number somewhere
  1088. .br
  1089. Send \f8Accept\fP packet
  1090. .br
  1091. \(-> \f6idle\fP
  1092. .RE
  1093. .LP
  1094. \f6decline-session\fP:
  1095. .RS
  1096. Send \f8Decline\fP packet
  1097. .br
  1098. \(-> \f6idle\fP
  1099. .RE
  1100. .LP
  1101. \f6manage\fP:
  1102. .RS
  1103. If \f7Session ID\fP matches saved \f7Session ID\fP \(-> \f6run-session\fP
  1104. .br
  1105. \(-> \f6refuse\fP
  1106. .RE
  1107. .LP
  1108. \f6refuse\fP:
  1109. .RS
  1110. Send
  1111. \f8Refuse\fP
  1112. packet
  1113. .br
  1114. \(->
  1115. \f6idle\fP
  1116. .RE
  1117. .LP
  1118. \f6run-session\fP:
  1119. .RS
  1120. Terminate any session in progress
  1121. .br
  1122. XOpenDisplay
  1123. .br
  1124. open display succeeds \(->
  1125. \f6start-session\fP
  1126. .br
  1127. \(->
  1128. \f6failed\fP
  1129. .RE
  1130. .LP
  1131. \f6failed\fP:
  1132. .RS
  1133. send \f8Failed\fP packet
  1134. .br
  1135. \(-> \f6idle\fP
  1136. .RE
  1137. .LP
  1138. \f6start-session\fP:
  1139. .RS
  1140. Start a new session
  1141. .br
  1142. \(-> \f6idle\fP
  1143. .RE
  1144. .LP
  1145. \f6finish-session\fP:
  1146. .RS
  1147. XCloseDisplay
  1148. .br
  1149. \(-> \f6idle\fP
  1150. .RE
  1151. .RE
  1152. .NH 1
  1153. Protocol Encoding
  1154. .LP
  1155. The version number in all packets will be 1.
  1156. .LP
  1157. Packet opcodes are 16 bit integers.
  1158. .RS
  1159. .TS
  1160. c c
  1161. l l.
  1162. Packet Name Encoding
  1163. _
  1164. BroadcastQuery 1
  1165. Query 2
  1166. IndirectQuery 3
  1167. ForwardQuery 4
  1168. Willing 5
  1169. Unwilling 6
  1170. Request 7
  1171. Accept 8
  1172. Decline 9
  1173. Manage 10
  1174. Refuse 11
  1175. Failed 12
  1176. .TE
  1177. .RE
  1178. .LP
  1179. Per packet information follows:
  1180. .LP
  1181. \f8Query\fP
  1182. .br
  1183. \f8BroadcastQuery\fP
  1184. .br
  1185. \f8IndirectQuery\fP
  1186. .RS
  1187. These packets are identical except for the opcode field.
  1188. .TS
  1189. c c c
  1190. c l l.
  1191. Length Type Description
  1192. _
  1193. 2 CARD16 version number (always 1)
  1194. 2 CARD16 opcode (always \f8Query\fP, \f8BroadcastQuery\fP or \f8IndirectQuery\fP)
  1195. 2 CARD16 length
  1196. 1 CARD8 number of \f7Authentication Names\fP sent (m)
  1197. 1 CARD8 length of first \f7Authentication Name\fP (m\d\s-21\s+2\u)
  1198. m\d\s-21\s+2\u CARD8 first \f7Authentication Name\fP
  1199. \&... Other \f7Authentication Names\fP
  1200. .TE
  1201. .RE
  1202. .LP
  1203. \f8ForwardQuery\fP
  1204. .RS
  1205. .TS
  1206. c c c
  1207. c l l.
  1208. Length Type Description
  1209. _
  1210. 2 CARD16 version number (always 1)
  1211. 2 CARD16 opcode (always \f8ForwardQuery\fP)
  1212. 2 CARD16 length
  1213. 1 CARD8 length of \f7Client Address\fP (m)
  1214. m CARD8 \f7Client Address\fP
  1215. 1 CARD8 length of \f7Client Port\fP (n)
  1216. n CARD8 \f7Client Port\fP
  1217. 1 CARD8 number of \f7Authentication Names\fP sent (o)
  1218. 1 CARD8 length of first \f7Authentication Name\fP (o\d\s-21\s+2\u)
  1219. o\d\s-21\s+2\u CARD8 first \f7Authentication Name\fP
  1220. \&... Other \f7Authentication Names\fP
  1221. .TE
  1222. .RE
  1223. .LP
  1224. \f8Willing\fP
  1225. .RS
  1226. .TS
  1227. c c c
  1228. c l l.
  1229. Length Type Description
  1230. _
  1231. 2 CARD16 version number (always 1)
  1232. 2 CARD16 opcode (always \f8Willing\fP
  1233. 2 CARD16 length (2 + m + n + o)
  1234. 1 CARD8 Length of \f7Authentication Name\fP (m)
  1235. m CARD8 \f7Authentication Name\fP
  1236. 1 CARD8 \f7Hostname\fP length (n)
  1237. n CARD8 \f7Hostname\fP
  1238. 1 CARD8 \f7Status\fP length (o)
  1239. o CARD8 \f7Status\fP
  1240. .TE
  1241. .RE
  1242. .LP
  1243. \f8Unwilling\fP
  1244. .RS
  1245. .TS
  1246. c c c
  1247. c l l.
  1248. Length Type Description
  1249. _
  1250. 2 CARD16 version number (always 1)
  1251. 2 CARD16 opcode (always \f8Unwilling\fP)
  1252. 2 CARD16 length (2 + m + n)
  1253. 1 CARD8 \f7Hostname\fP length (m)
  1254. m CARD8 \f7Hostname\fP
  1255. 1 CARD8 \f7Status\fP length (n)
  1256. n CARD8 \f7Status\fP
  1257. .TE
  1258. .RE
  1259. .LP
  1260. \f8Request\fP
  1261. .RS
  1262. .TS
  1263. c c c
  1264. c l l.
  1265. Length Type Description
  1266. _
  1267. 2 CARD16 version number (always 1)
  1268. 2 CARD16 opcode (always \f8Request\fP)
  1269. 2 CARD16 length
  1270. 2 CARD16 \f7Display Number\fP
  1271. 1 CARD8 Count of \f7Connection Types\fP (m)
  1272. 2 \(mu m CARD16 \f7Connection Types\fP
  1273. 1 CARD8 Count of \f7Connection Addresses\fP (n)
  1274. 1 CARD8 Length of first \f7Connection Address\fP (n\s-2\d1\u\s+2)
  1275. n\s-2\d1\u\s+2 CARD8 First \f7Connection Address\fP
  1276. \&... Other connection addresses
  1277. 1 CARD8 Length of \f7Authentication Name\fP (o)
  1278. o CARD8 \f7Authentication Name\fP
  1279. 1 CARD8 Length of \f7Authentication Data\fP (p)
  1280. p CARD8 \f7Authentication Data\fP
  1281. 1 CARD8 Length of \f7Manufacturer Display ID\fP (q)
  1282. q CARD8 \f7Manufacturer Display ID\fP
  1283. .TE
  1284. .RE
  1285. .LP
  1286. \f8Accept\fP
  1287. .RS
  1288. .TS
  1289. c c c
  1290. c l l.
  1291. Length Type Description
  1292. _
  1293. 2 CARD16 version number (always 1)
  1294. 2 CARD16 opcode (always \f8Accept\fP)
  1295. 2 CARD16 length (8 + n + m + o + p)
  1296. 4 CARD32 \f7Session ID\fP
  1297. 1 CARD8 Length of \f7Authentication Name\fP (n)
  1298. n CARD8 \f7Authentication Name\fP
  1299. 1 CARD8 Length of \f7Authentication Data\fP (m)
  1300. m CARD8 \f7Authentication Data\fP
  1301. 1 CARD8 Length of \f7Authorization Name\fP (o)
  1302. o CARD8 \f7Authorization Name\fP
  1303. 1 CARD8 Length of \f7Authorization Data\fP (p)
  1304. p CARD8 \f7Authorization Data\fP
  1305. .TE
  1306. .RE
  1307. .LP
  1308. \f8Decline\fP
  1309. .RS
  1310. .TS
  1311. c c c
  1312. c l l.
  1313. Length Type Description
  1314. _
  1315. 2 CARD16 version number (always 1)
  1316. 2 CARD16 opcode (always \f8Decline\fP)
  1317. 2 CARD16 length (3 + m + n + o)
  1318. 1 CARD8 Length of \f7Status\fP (m)
  1319. m CARD8 \f7Status\fP
  1320. 1 CARD8 Length of \f7Authentication Name\fP (n)
  1321. n CARD8 \f7Authentication Name\fP
  1322. 1 CARD8 Length of \f7Authentication Data\fP (o)
  1323. o CARD8 \f7Authentication Data\fP
  1324. .TE
  1325. .RE
  1326. .LP
  1327. \f8Manage\fP
  1328. .RS
  1329. .TS
  1330. c c c
  1331. c l l.
  1332. Length Type Description
  1333. _
  1334. 2 CARD16 version number (always 1)
  1335. 2 CARD16 opcode (always \f8Manage\fP)
  1336. 2 CARD16 length (9 + m)
  1337. 4 CARD32 \f7Session ID\fP
  1338. 4 CARD32 \f7Display Number\fP
  1339. 1 CARD8 Length of \f7Display Class\fP (m)
  1340. m CARD8 \f7Display Class\fP
  1341. .TE
  1342. .RE
  1343. .LP
  1344. \f8Refuse\fP
  1345. .RS
  1346. .TS
  1347. c c c
  1348. c l l.
  1349. Length Type Description
  1350. _
  1351. 2 CARD16 version number (always 1)
  1352. 2 CARD16 opcode (always \f8Refuse\fP)
  1353. 2 CARD16 length (4)
  1354. 4 CARD32 \f7Session ID\fP
  1355. .TE
  1356. .RE
  1357. .LP
  1358. \f8Failed\fP
  1359. .RS
  1360. .TS
  1361. c c c
  1362. c l l.
  1363. Length Type Description
  1364. _
  1365. 2 CARD16 version number (always 1)
  1366. 2 CARD16 opcode (always \f8Failed\fP)
  1367. 2 CARD16 length (5 + m)
  1368. 4 CARD32 \f7Session ID\fP
  1369. 1 CARD8 Length of \f7Status\fP (m)
  1370. m CARD8 \f7Status\fP
  1371. .TE
  1372. .RE
  1373. .NH 1
  1374. Display Class Format
  1375. .LP
  1376. The
  1377. \f7Display Class\fP
  1378. packet field is used by the display manager to collect common sorts of
  1379. displays into manageable groups. This field is a string encoded of
  1380. ISO-LATIN-1 characters in the following format:
  1381. .nf
  1382. .sp
  1383. .ta 1i
  1384. ManufacturerID-ModelNumber
  1385. .fi
  1386. .sp
  1387. .LP
  1388. Both elements of this string must exclude characters of the set { \fB-\fP,
  1389. \&\fB.\fP, \fB:\fP, \fB*\fP, \fB?\fP, \fI<space>\fP }. The ManufacturerID is a
  1390. string which should be registered with the X Consortium. The ModelNumber is
  1391. designed to identify characteristics of the display within the manufacturer's
  1392. product line. This string should be documented in the users manual for the
  1393. particular device. This string should probably not be specifiable by the
  1394. display user to avoid unexpected configuration errors.
  1395. .NH 1
  1396. Manufacturer Display ID Format
  1397. .LP
  1398. To authenticate the manager, the display and manager will share a private
  1399. key. The manager, then, must be able to discover which key to use for a
  1400. particular device. The
  1401. \f7Manufacturer Display ID\fP
  1402. field is intended for this purpose. Typically, the manager host will
  1403. contain a map between this number and the key. This field is intended to be
  1404. unique per display, possibly the ethernet address of the display in the form:
  1405. .nf
  1406. .sp
  1407. .ta 1i
  1408. -Ethernet-8:0:2b:a:f:d2
  1409. .sp
  1410. .fi
  1411. or string
  1412. of the form:
  1413. .nf
  1414. .sp
  1415. .ta 1i
  1416. ManufacturerID-ModelNumber-SerialNumber
  1417. .sp
  1418. .fi
  1419. where ManufacturerID, ModelNumber and SerialNumber are encoded using
  1420. ISO-LATIN-1 characters, excluding { \fB-\fP,
  1421. \&\fB.\fP, \fB*\fP, \fB?\fP, \fI<space>\fP }
  1422. .LP
  1423. When the display is shipped to a customer, it should include both the
  1424. \f7Manufacturer Display ID\fP
  1425. and the private key in the documentation set. This information should not
  1426. be modifiable by the display user.
  1427. .NH 1
  1428. Authentication
  1429. .LP
  1430. In an environment where authentication is not needed, XDMCP can disable
  1431. authentication by having the display send empty \f7Authentication Name\fP
  1432. and \f7Authentication Data\fP fields in the \f8Request\fP packet. In this
  1433. case, the manager will not attempt to authenticate itself. Other
  1434. authentication protocols may be developed, depending on local needs.
  1435. .LP
  1436. In an unsecure environment, the display must be able to verify that the
  1437. source of the various packets is a trusted manager. These packets will
  1438. contain authentication information. As an example of such a system, the
  1439. following discussion describes the "XDM-AUTHENTICATION-1" authentication
  1440. system. This system uses a 56 bit shared private key, and 64 bits of
  1441. authentication data. An associated example X authorization protocol
  1442. "XDM-AUTHORIZATION-1" will also be discussed.
  1443. .LP
  1444. Assumptions:
  1445. .IP
  1446. The display and manager share a private key. This key could be programmed
  1447. into the display by the manufacturer and shipped with the unit. It must not
  1448. be available from the display itself, but should allow the value to be
  1449. modified in some way. The system administrator would be responsible for
  1450. managing a database of terminal keys.
  1451. .IP
  1452. The display can generate random authentication numbers.
  1453. .LP
  1454. Some definitions first:
  1455. .EQ
  1456. oc D cc sup kappa mark = "encryption of plain text " D " by key " kappa
  1457. .EN C
  1458. .EQ
  1459. oc DELTA cc * sup kappa lineup = "decryption of crypto text " DELTA " with key " kappa
  1460. .EN C
  1461. .EQ
  1462. { tau } lineup = "private key shared by display and manager"
  1463. .EN C
  1464. .EQ
  1465. rho lineup = "64 bit random number generated by display"
  1466. .EN C
  1467. .EQ
  1468. alpha lineup = "authentication data in XDMCP packets"
  1469. .EN C
  1470. .EQ
  1471. sigma lineup = "per-session private key, generated by manager"
  1472. .EN C
  1473. .EQ
  1474. beta lineup = "authorization data"
  1475. .EN
  1476. .LP
  1477. Encryption will use the DES; blocks shorter than 64 bits will be zero-filled
  1478. on the right to 64 bits. Blocks longer than 64 bits will use block chaining:
  1479. .EQ
  1480. oc { D } cc sup kappa lineup = oc { D sub 1 } cc sup kappa " "
  1481. oc { D sub 2 } " " xor " " oc { D sub 1 } cc sup kappa cc sup kappa
  1482. .EN
  1483. .LP
  1484. The display generates the first authentication data in the
  1485. \f8Request\fP
  1486. packet:
  1487. .EQ
  1488. alpha sub roman Request mark = oc rho cc sup tau
  1489. .EN
  1490. .LP
  1491. For the
  1492. \f8Accept\fP
  1493. packet, the manager decrypts the initial message and returns
  1494. @alpha sub roman Accept@:
  1495. .EQ
  1496. rho lineup = oc alpha sub roman Request cc * sup tau
  1497. .EN C
  1498. .EQ
  1499. alpha sub roman Accept lineup = oc rho + 1 cc sup tau
  1500. .EN
  1501. .LP
  1502. The \f8Accept\fP packet also contains the authorization intended for use by
  1503. the X server. A description of authorization type ``XDM-AUTHORIZATION-1''
  1504. follows:
  1505. .LP
  1506. The \f8Accept\fP packet contains the authorization name
  1507. ``XDM-AUTHORIZATION-1''. The authorization data is the string:
  1508. .EQ
  1509. beta sub Accept mark = oc sigma cc sup tau
  1510. .EN
  1511. .LP
  1512. To create authorization information for connection setup with the X server
  1513. using the XDM-AUTHORIZATION-1 authorization protocol, the client computes the
  1514. following:
  1515. .EQ
  1516. A mark = "X client host address (32 bits)"
  1517. .EN C
  1518. .EQ
  1519. P lineup = "X client ``uniquifier''. Typically socket port id (16 bits)"
  1520. .EN C
  1521. .EQ
  1522. T lineup = "Current time in seconds on client host (32 bits)"
  1523. .EN
  1524. .EQ C
  1525. beta lineup = oc rho A P T cc sup sigma
  1526. .EN
  1527. .LP
  1528. The result is 192 bits of authorization data, which is sent in the
  1529. connection setup to the server. The server receives the packet, decrypts
  1530. the contents. To accept the connection, the following must hold:
  1531. .IP 1
  1532. @rho@ must match the value generated for the most recent XDMCP negotiation.
  1533. .IP 2
  1534. @T@ must be within 1200 seconds of the internally stored time. If no time
  1535. been received before, the current time is set to @T@.
  1536. .IP 3
  1537. No packet containing the same triple (@A@, @P@, @T@) may have been received
  1538. in the last 1200 seconds (20 minutes).