VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/7.0/X11/Xdmcp.h@ 17234

最後變更 在這個檔案從17234是 17234,由 vboxsync 提交於 16 年 前

Additions/x11/x11include: blast! Corrected svn:keywords property on all files as per http://linserv.germany/vbox/wiki/SvnKeywords

  • 屬性 svn:eol-style 設為 native
檔案大小: 6.6 KB
 
1/* $XdotOrg: xc/lib/Xdmcp/Xdmcp.h,v 1.2 2004/04/23 18:43:41 eich Exp $ */
2/* $Xorg: Xdmcp.h,v 1.7 2001/04/13 14:43:00 steve Exp $ */
3/*
4 * Copyright 1989 Network Computing Devices, Inc., Mountain View, California.
5 *
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.
15 *
16 */
17/* $XFree86: xc/lib/Xdmcp/Xdmcp.h,v 3.7 2003/07/09 15:27:29 tsi Exp $ */
18
19#ifndef _XDMCP_H_
20#define _XDMCP_H_
21
22#include <X11/Xmd.h>
23
24#include <X11/Xfuncproto.h>
25
26_XFUNCPROTOBEGIN
27
28#define XDM_PROTOCOL_VERSION 1
29#define XDM_UDP_PORT 177
30
31/* IANA has assigned FF0X:0:0:0:0:0:0:12B as the permanently assigned
32 * multicast addresses for XDMCP, where X in the prefix may be replaced
33 * by any valid scope identifier, such as 1 for Node-Local, 2 for Link-Local,
34 * 5 for Site-Local, and so on. We set the default here to the Link-Local
35 * version to most closely match the old IPv4 subnet broadcast behavior.
36 * Both xdm and X -query allow specifying a different address if a different
37 * scope is defined.
38 */
39#define XDM_DEFAULT_MCAST_ADDR6 "ff02:0:0:0:0:0:0:12b"
40
41#define XDM_MAX_MSGLEN 8192
42#define XDM_MIN_RTX 2
43#define XDM_MAX_RTX 32
44#define XDM_RTX_LIMIT 7
45#define XDM_KA_RTX_LIMIT 4
46#define XDM_DEF_DORMANCY (3 * 60) /* 3 minutes */
47#define XDM_MAX_DORMANCY (24 * 60 * 60) /* 24 hours */
48
49typedef enum {
50 BROADCAST_QUERY = 1, QUERY, INDIRECT_QUERY, FORWARD_QUERY,
51 WILLING, UNWILLING, REQUEST, ACCEPT, DECLINE, MANAGE, REFUSE,
52 FAILED, KEEPALIVE, ALIVE
53} xdmOpCode;
54
55typedef enum {
56 XDM_QUERY, XDM_BROADCAST, XDM_INDIRECT, XDM_COLLECT_QUERY,
57 XDM_COLLECT_BROADCAST_QUERY, XDM_COLLECT_INDIRECT_QUERY,
58 XDM_START_CONNECTION, XDM_AWAIT_REQUEST_RESPONSE,
59 XDM_AWAIT_MANAGE_RESPONSE, XDM_MANAGE, XDM_RUN_SESSION, XDM_OFF,
60 XDM_AWAIT_USER_INPUT, XDM_KEEPALIVE, XDM_AWAIT_ALIVE_RESPONSE,
61#if defined(IPv6) && defined(AF_INET6)
62 XDM_MULTICAST, XDM_COLLECT_MULTICAST_QUERY,
63#endif
64 XDM_KEEP_ME_LAST
65} xdmcp_states;
66
67#ifdef NOTDEF
68/* table of hosts */
69
70#define XDM_MAX_STR_LEN 21
71#define XDM_MAX_HOSTS 20
72struct xdm_host_table {
73 struct sockaddr_in sockaddr;
74 char name[XDM_MAX_STR_LEN];
75 char status[XDM_MAX_STR_LEN];
76};
77#endif /* NOTDEF */
78
79typedef CARD8 *CARD8Ptr;
80typedef CARD16 *CARD16Ptr;
81typedef CARD32 *CARD32Ptr;
82
83typedef struct _ARRAY8 {
84 CARD16 length;
85 CARD8Ptr data;
86} ARRAY8, *ARRAY8Ptr;
87
88typedef struct _ARRAY16 {
89 CARD8 length;
90 CARD16Ptr data;
91} ARRAY16, *ARRAY16Ptr;
92
93typedef struct _ARRAY32 {
94 CARD8 length;
95 CARD32Ptr data;
96} ARRAY32, *ARRAY32Ptr;
97
98typedef struct _ARRAYofARRAY8 {
99 CARD8 length;
100 ARRAY8Ptr data;
101} ARRAYofARRAY8, *ARRAYofARRAY8Ptr;
102
103typedef struct _XdmcpHeader {
104 CARD16 version, opcode, length;
105} XdmcpHeader, *XdmcpHeaderPtr;
106
107typedef struct _XdmcpBuffer {
108 BYTE *data;
109 int size; /* size of buffer pointed by to data */
110 int pointer; /* current index into data */
111 int count; /* bytes read from network into data */
112} XdmcpBuffer, *XdmcpBufferPtr;
113
114typedef struct _XdmAuthKey {
115 BYTE data[8];
116} XdmAuthKeyRec, *XdmAuthKeyPtr;
117
118
119/* implementation-independent network address structure.
120 Equiv to sockaddr* for sockets and netbuf* for STREAMS. */
121
122typedef char *XdmcpNetaddr;
123
124extern int XdmcpWriteARRAY16(XdmcpBufferPtr buffer, ARRAY16Ptr array);
125extern int XdmcpWriteARRAY32(XdmcpBufferPtr buffer, ARRAY32Ptr array);
126extern int XdmcpWriteARRAY8(XdmcpBufferPtr buffer, ARRAY8Ptr array);
127extern int XdmcpWriteARRAYofARRAY8(XdmcpBufferPtr buffer, ARRAYofARRAY8Ptr array);
128extern int XdmcpWriteCARD16(XdmcpBufferPtr buffer, unsigned value);
129extern int XdmcpWriteCARD32(XdmcpBufferPtr buffer, unsigned value);
130extern int XdmcpWriteCARD8(XdmcpBufferPtr buffer, unsigned value);
131extern int XdmcpWriteHeader(XdmcpBufferPtr buffer, XdmcpHeaderPtr header);
132
133extern int XdmcpFlush(int fd, XdmcpBufferPtr buffer, XdmcpNetaddr to, int tolen);
134
135extern int XdmcpReadARRAY16(XdmcpBufferPtr buffer, ARRAY16Ptr array);
136extern int XdmcpReadARRAY32(XdmcpBufferPtr buffer, ARRAY32Ptr array);
137extern int XdmcpReadARRAY8(XdmcpBufferPtr buffer, ARRAY8Ptr array);
138extern int XdmcpReadARRAYofARRAY8(XdmcpBufferPtr buffer, ARRAYofARRAY8Ptr array);
139extern int XdmcpReadCARD16(XdmcpBufferPtr buffer, CARD16Ptr valuep);
140extern int XdmcpReadCARD32(XdmcpBufferPtr buffer, CARD32Ptr valuep);
141extern int XdmcpReadCARD8(XdmcpBufferPtr buffer, CARD8Ptr valuep);
142extern int XdmcpReadHeader(XdmcpBufferPtr buffer, XdmcpHeaderPtr header);
143
144extern int XdmcpFill(int fd, XdmcpBufferPtr buffer, XdmcpNetaddr from, int *fromlen);
145
146extern int XdmcpReadRemaining(XdmcpBufferPtr buffer);
147
148extern void XdmcpDisposeARRAY8(ARRAY8Ptr array);
149extern void XdmcpDisposeARRAY16(ARRAY16Ptr array);
150extern void XdmcpDisposeARRAY32(ARRAY32Ptr array);
151extern void XdmcpDisposeARRAYofARRAY8(ARRAYofARRAY8Ptr array);
152
153extern int XdmcpCopyARRAY8(ARRAY8Ptr src, ARRAY8Ptr dst);
154
155extern int XdmcpARRAY8Equal(ARRAY8Ptr array1, ARRAY8Ptr array2);
156
157extern void XdmcpGenerateKey (XdmAuthKeyPtr key);
158extern void XdmcpIncrementKey (XdmAuthKeyPtr key);
159extern void XdmcpDecrementKey (XdmAuthKeyPtr key);
160#ifdef HASXDMAUTH
161extern void XdmcpWrap(unsigned char *input, unsigned char *wrapper, unsigned char *output, int bytes);
162extern void XdmcpUnwrap(unsigned char *input, unsigned char *wrapper, unsigned char *output, int bytes);
163#endif
164
165#ifndef TRUE
166#define TRUE 1
167#define FALSE 0
168#endif
169
170#if !defined(Xalloc) && !defined(xalloc) && !defined(Xrealloc)
171extern void *Xalloc (unsigned long amount);
172extern void *Xrealloc (void *old, unsigned long amount);
173extern void Xfree(void *old);
174#endif
175
176extern int XdmcpCompareKeys (XdmAuthKeyPtr a, XdmAuthKeyPtr b);
177
178extern int XdmcpAllocARRAY16 (ARRAY16Ptr array, int length);
179extern int XdmcpAllocARRAY32 (ARRAY32Ptr array, int length);
180extern int XdmcpAllocARRAY8 (ARRAY8Ptr array, int length);
181extern int XdmcpAllocARRAYofARRAY8 (ARRAYofARRAY8Ptr array, int length);
182
183extern int XdmcpReallocARRAY16 (ARRAY16Ptr array, int length);
184extern int XdmcpReallocARRAY32 (ARRAY32Ptr array, int length);
185extern int XdmcpReallocARRAY8 (ARRAY8Ptr array, int length);
186extern int XdmcpReallocARRAYofARRAY8 (ARRAYofARRAY8Ptr array, int length);
187
188_XFUNCPROTOEND
189
190#endif /* _XDMCP_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette