1 /* $XConsortium: Xdmcp.h,v 1.9 95/06/07 18:30:59 gildea Exp $ */
2 /* $XFree86: xc/lib/Xdmcp/Xdmcp.h,v 3.1 1996/01/05 13:12:04 dawes Exp $ */
4 * Copyright 1989 Network Computing Devices, Inc., Mountain View, California.
6 * Permission to use, copy, modify, and distribute this software and its
7 * documentation for any purpose and without fee is hereby granted, provided
8 * that the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of N.C.D. not be used in advertising or
11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. N.C.D. makes no representations about the
13 * suitability of this software for any purpose. It is provided "as is"
14 * without express or implied warranty.
20 #define XDM_PROTOCOL_VERSION 1
21 #define XDM_UDP_PORT 177
22 #define XDM_MAX_MSGLEN 8192
24 #define XDM_MAX_RTX 32
25 #define XDM_RTX_LIMIT 7
26 #define XDM_KA_RTX_LIMIT 4
27 #define XDM_DEF_DORMANCY (3 * 60) /* 3 minutes */
28 #define XDM_MAX_DORMANCY (24 * 60 * 60) /* 24 hours */
31 BROADCAST_QUERY = 1, QUERY, INDIRECT_QUERY, FORWARD_QUERY,
32 WILLING, UNWILLING, REQUEST, ACCEPT, DECLINE, MANAGE, REFUSE,
33 FAILED, KEEPALIVE, ALIVE
37 XDM_QUERY, XDM_BROADCAST, XDM_INDIRECT, XDM_COLLECT_QUERY,
38 XDM_COLLECT_BROADCAST_QUERY, XDM_COLLECT_INDIRECT_QUERY,
39 XDM_START_CONNECTION, XDM_AWAIT_REQUEST_RESPONSE,
40 XDM_AWAIT_MANAGE_RESPONSE, XDM_MANAGE, XDM_RUN_SESSION, XDM_OFF,
41 XDM_AWAIT_USER_INPUT, XDM_KEEPALIVE, XDM_AWAIT_ALIVE_RESPONSE
47 #define XDM_MAX_STR_LEN 21
48 #define XDM_MAX_HOSTS 20
49 struct xdm_host_table {
50 struct sockaddr_in sockaddr;
51 char name[XDM_MAX_STR_LEN];
52 char status[XDM_MAX_STR_LEN];
56 typedef CARD8 *CARD8Ptr;
57 typedef CARD16 *CARD16Ptr;
58 typedef CARD32 *CARD32Ptr;
60 typedef struct _ARRAY8 {
65 typedef struct _ARRAY16 {
68 } ARRAY16, *ARRAY16Ptr;
70 typedef struct _ARRAY32 {
73 } ARRAY32, *ARRAY32Ptr;
75 typedef struct _ARRAYofARRAY8 {
78 } ARRAYofARRAY8, *ARRAYofARRAY8Ptr;
80 typedef struct _XdmcpHeader {
81 CARD16 version, opcode, length;
82 } XdmcpHeader, *XdmcpHeaderPtr;
84 typedef struct _XdmcpBuffer {
86 int size; /* size of buffer pointed by to data */
87 int pointer; /* current index into data */
88 int count; /* bytes read from network into data */
89 } XdmcpBuffer, *XdmcpBufferPtr;
91 typedef struct _XdmAuthKey {
93 } XdmAuthKeyRec, *XdmAuthKeyPtr;
96 /* implementation-independent network address structure.
97 Equiv to sockaddr* for sockets and netbuf* for STREAMS. */
99 typedef char *XdmcpNetaddr;
102 extern int XdmcpWriteCARD8(), XdmcpWriteCARD16();
103 extern int XdmcpWriteCARD32();
104 extern int XdmcpWriteARRAY8(), XdmcpWriteARRAY16();
105 extern int XdmcpWriteARRAY32(), XdmcpWriteARRAYofARRAY8();
106 extern int XdmcpWriteHeader(), XdmcpFlush();
108 extern int XdmcpReadCARD8(), XdmcpReadCARD16();
109 extern int XdmcpReadCARD32();
110 extern int XdmcpReadARRAY8(), XdmcpReadARRAY16();
111 extern int XdmcpReadARRAY32(), XdmcpReadARRAYofARRAY8();
112 extern int XdmcpReadHeader(), XdmcpFill();
114 extern int XdmcpReadRemaining();
116 extern void XdmcpDisposeARRAY8(), XdmcpDisposeARRAY16();
117 extern void XdmcpDisposeARRAY32(), XdmcpDisposeARRAYofARRAY8();
119 extern int XdmcpCopyARRAY8();
121 extern int XdmcpARRAY8Equal();
124 extern void XdmcpGenerateKey();
125 extern void XdmcpIncrementKey();
126 extern void XdmcpDecrementKey();
127 extern void XdmcpWrap();
128 extern void XdmcpUnwrap();
136 #if !defined(Xalloc) && !defined(xalloc) && !defined(Xrealloc)
137 extern long *Xalloc (), *Xrealloc ();
141 #endif /* _XDMCP_H_ */