Use C++ linker
[oweals/cde.git] / cde / programs / dtlogin / vgproto.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: vgproto.h /main/4 1995/11/21 14:03:25 rswiston $ */
24 /*                                                                      *
25  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
26  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
27  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
28  * (c) Copyright 1993, 1994 Novell, Inc.                                *
29  */
30 /************************************<+>*************************************
31  ****************************************************************************
32  **
33  **   File:        vgproto.h
34  **
35  **   Project:     HP Visual User Environment (DT)
36  **
37  **   Description: Communications protocol between Dtlogin and Dtgreet.
38  **
39  **
40  **   (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
41  **
42  **
43  **
44  ****************************************************************************
45  ************************************<+>*************************************/
46
47 #ifndef _VGREET_H
48 #define _VGREET_H
49
50 #ifdef SIA
51 #include <siad.h>
52 #include <X11/Intrinsic.h>
53 #endif
54
55 /***********************************************************************
56  *
57  * Environment variable definitions
58  *
59  ***********************************************************************/
60
61 #define ERRORLOG        "ERRORLOG"
62 #define GRABSERVER      "GRABSERVER"
63 #define GRABTIMEOUT     "GRABTIMEOUT"
64 #define LANGLIST        "LANGLIST"
65 #define LOCATION        "DTXSERVERLOCATION"
66 #define PINGINTERVAL    "PINGINTERVAL"
67 #define PINGTIMEOUT     "PINGTIMEOUT"
68 #define SESSIONTYPE     "SESSIONTYPE"
69 #define VERIFYNAME      "VERIFYNAME"
70 #define VN_AFS          "AFS"
71 #define VN_HPBLS        "HPBLS"
72 #define VN_KRB          "Kerberos"
73 #define DTLITE          "DTLITE"
74 #define SESSION         "SESSION"
75 #define SESSION_SET     "SESSION_SET"
76 #define XFORCEINTERNET  "XFORCE_INTERNET"
77
78
79
80 /***********************************************************************
81  *
82  * Exit codes from Greeter
83  *
84  ***********************************************************************/
85
86
87 # define NOTIFY_OK              0
88 # define NOTIFY_ABORT           1
89 # define NOTIFY_RESTART         2
90 # define NOTIFY_ABORT_DISPLAY   3
91 # define NOTIFY_NO_WINDOWS      4
92 # define NOTIFY_LANG_CHANGE     5
93 # define NOTIFY_FAILSAFE        6
94 # define NOTIFY_PASSWD_EXPIRED  7
95 # define NOTIFY_DTLITE          8
96 # define NOTIFY_DT              9
97 # define NOTIFY_XDM             10
98 # define NOTIFY_BAD_SECLEVEL    11
99 # define NOTIFY_LAST_DT         12
100 # define NOTIFY_ALT_DTS         20
101
102 /***********************************************************************
103  *
104  * Request protocol definitions
105  *
106  ***********************************************************************/
107
108 #define REQUEST_OP_NONE         0
109 #define REQUEST_OP_EXIT         2
110 #define REQUEST_OP_MESSAGE      3
111 #define REQUEST_OP_CHPASS       4
112 #define REQUEST_OP_CHALLENGE    5
113 #define REQUEST_OP_LANG         6
114 #define REQUEST_OP_HOSTNAME     7
115 #define REQUEST_OP_EXPASSWORD   8
116 #define REQUEST_OP_CLEAR        9
117 #ifdef SIA
118 #define REQUEST_OP_FORM        10
119 #endif
120 #define REQUEST_OP_DEBUG        255
121
122 #ifdef SIA
123 #define REQUEST_LIM_MAXLEN      768
124 #else
125 #define REQUEST_LIM_MAXLEN      512
126 #endif
127 /*
128  * Protocol structures. Offsets and lengths are from top of header.
129  *
130  * Request header.
131  */ 
132 typedef struct {
133   unsigned char opcode;         /* REQUEST_OP_* */
134   unsigned char reserved;       /* reserved */
135   unsigned short length;        /* total length */
136   /* op specific data */
137 } RequestHeader;
138
139 typedef struct {
140   RequestHeader hdr;
141 } RequestExit;
142
143 typedef struct {
144   RequestHeader hdr;
145   unsigned short idMC;          /* MC_* message catalog id */
146   unsigned short offMessage;   
147   /* variable length message string */
148 } RequestMessage;
149
150 typedef struct {
151   RequestHeader hdr;
152 } RequestHostname;
153
154 typedef struct {
155   RequestHeader hdr;
156 } RequestExpassword;
157
158 typedef struct {
159   RequestHeader hdr;
160 } RequestChpass;
161
162 typedef struct {
163   RequestHeader hdr;           
164   int bEcho;
165   unsigned short idMC;          /* MC_* message catalog id */
166   unsigned short offChallenge; 
167   unsigned short offUserNameSeed; 
168   /* variable length challenge string */
169   /* variable length user name seed */
170 } RequestChallenge;
171
172 #ifdef SIA
173
174 typedef struct {
175   RequestHeader hdr;
176   short num_prompts;
177   Boolean visible[MAX_PROMPTS];  /* MAX_PROMPTS defined in siad.h */
178   int rendition;
179   unsigned short offTitle;
180   unsigned short offPrompts;
181   /* variable length title string */
182   /* variable length prompt strings */
183 } RequestForm;
184
185 #endif
186
187 /***********************************************************************
188  *
189  * Response protocol definitions
190  *
191  ***********************************************************************/
192
193 /*
194  * Response header.
195  */
196 typedef struct {
197   unsigned char opcode;         /* REQUEST_OP_* */
198   unsigned char reserved;       /* reserved */
199   unsigned short length;        /* total length */
200   /* op specific data */
201 } ResponseHeader;
202
203 typedef struct {
204   ResponseHeader hdr;
205 } ResponseExit;
206
207 typedef struct {
208   ResponseHeader hdr;
209 } ResponseClear;
210
211 typedef struct {
212   ResponseHeader hdr;
213 } ResponseMessage;
214
215 typedef struct {
216   ResponseHeader hdr;
217 } ResponseHostname;
218
219 typedef struct {
220   ResponseHeader hdr;
221 } ResponseExpassword;
222
223 typedef struct {
224   ResponseHeader hdr;
225   unsigned short offOldPassword;
226   unsigned short offNewPassword;
227   unsigned short offNewPasswordAgain;
228   /* variable length old password string */
229   /* variable length new password string */
230   /* variable length new password string */
231 } ResponseChpass;
232
233 typedef struct {
234   ResponseHeader hdr;
235   unsigned short offResponse; 
236   /* variable length challenge response string */
237 } ResponseChallenge;
238
239 typedef struct {
240   ResponseHeader hdr;
241   unsigned short offString;
242   /* variable length debug string */
243 } ResponseDebug;
244
245 typedef struct {
246   ResponseHeader hdr;
247   unsigned short offLang;  
248   /* variable length lang string */
249 } ResponseLang;
250
251 #ifdef SIA
252
253 typedef struct {
254   ResponseHeader hdr;
255   int collect_status;
256   short num_answers;
257   unsigned short offAnswers;
258   /* variable length answer strings */
259 } ResponseForm;
260
261
262 typedef struct {
263     int num_prompts;
264     int rendition;
265     int collect_status;
266     Boolean visible[MAX_PROMPTS];
267     char *title;
268     char *prompts[MAX_PROMPTS];
269     char *answers[MAX_PROMPTS];
270     Widget sia_form_widget;
271     Widget answer_widgets[MAX_PROMPTS];
272 } SiaFormInfo;
273
274 #endif
275
276 #endif /* _VGREET_H */
277 /* DON'T ADD STUFF AFTER THIS #endif */