xref: /titanic_53/usr/src/lib/libbsm/common/adt_event.h (revision f808c858fa61e7769218966759510a8b1190dfcf)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * adt_event.h
23  *
24  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
25  * Use is subject to license terms.
26  *
27  * AUTOMATICALLY GENERATED CODE; DO NOT EDIT; CONTACT AUDIT PROJECT
28  *
29  * This is an evolving interface; additions will be made without
30  * notice.  It is also part of a contract private interface and
31  * any changes made that are not upward compatible are subject to
32  * the contract's rules.
33  */
34 
35 #ifndef _ADT_EVENT_H
36 #define	_ADT_EVENT_H
37 
38 #pragma ident	"%Z%%M%	%I%	%E% SMI"
39 
40 #include <bsm/adt.h>
41 
42 #ifdef	__cplusplus
43 extern "C" {
44 #endif
45 
46 /*
47  * adt_put_event() status values.  Positive values are for kernel-generated
48  * failure, -1 for user-space.  For ADT_SUCCESS, the adt_put_event() return_val
49  * is not used; the convention is to set it to ADT_SUCCESS.
50  */
51 #define	ADT_SUCCESS	0
52 #define	ADT_FAILURE	-1
53 
54 #define	ADT_FAIL_PAM	2000
55 #define	ADT_FAIL_VALUE	1000
56 enum	adt_fail_value {
57 	ADT_FAIL_VALUE_PW_ATTR = 1000,	/* Attribute update */
58 	ADT_FAIL_VALUE_PW,		/* Password update */
59 	ADT_FAIL_VALUE_USERNAME,		/* bad username */
60 	ADT_FAIL_VALUE_AUTH,		/* authorization failed */
61 	ADT_FAIL_VALUE_UID,		/* bad uid */
62 	ADT_FAIL_VALUE_UNKNOWN,		/* unknown failure */
63 	ADT_FAIL_VALUE_EXPIRED,		/* password expired */
64 	ADT_FAIL_VALUE_ACCOUNT_LOCKED,		/* Account is locked */
65 	ADT_FAIL_VALUE_BAD_DIALUP,		/* Bad dial up */
66 	ADT_FAIL_VALUE_BAD_ID,		/* Invalid ID */
67 	ADT_FAIL_VALUE_BAD_PW,		/* Invalid password */
68 	ADT_FAIL_VALUE_CONSOLE,		/* Not on console */
69 	ADT_FAIL_VALUE_MAX_TRIES,		/* Too many failed attempts */
70 	ADT_FAIL_VALUE_PROTOCOL_FAILURE,		/* Protocol failure */
71 	ADT_FAIL_VALUE_EXCLUDED_USER,		/* Excluded user */
72 	ADT_FAIL_VALUE_ANON_USER,		/* No anonymous */
73 	ADT_FAIL_VALUE_BAD_CMD,		/* Invalid command */
74 	ADT_FAIL_VALUE_BAD_TTY,		/* Standard input not a tty line */
75 	ADT_FAIL_VALUE_PROGRAM,		/* Program failure */
76 	ADT_FAIL_VALUE_CHDIR_FAILED,		/* chdir to home directory */
77 	ADT_FAIL_VALUE_INPUT_OVERFLOW,		/* Input line too long. */
78 	ADT_FAIL_VALUE_DEVICE_PERM,		/* login device override */
79 	ADT_FAIL_VALUE_AUTH_BYPASS,		/* authorization bypass */
80 	ADT_FAIL_VALUE_LOGIN_DISABLED		/* login disabled */
81 };
82 /* Deprecated message list */
83 enum	adt_login_text {
84 	ADT_LOGIN_NO_MSG,		/* (no token will be generated) */
85 	ADT_LOGIN_ACCOUNT_LOCKED,		/* Account is locked */
86 	ADT_LOGIN_BAD_DIALUP,		/* Bad dial up */
87 	ADT_LOGIN_BAD_ID,		/* Invalid ID */
88 	ADT_LOGIN_BAD_PW,		/* Invalid password */
89 	ADT_LOGIN_CONSOLE,		/* Not on console */
90 	ADT_LOGIN_MAX_TRIES,		/* Too many failed attempts */
91 	ADT_LOGIN_PROTOCOL_FAILURE,		/* Protocol failure */
92 	ADT_LOGIN_EXCLUDED_USER,		/* Excluded user */
93 	ADT_LOGIN_ANON_USER		/* No anonymous */
94 };
95 #define	ADT_admin_authenticate	3
96 #define	ADT_filesystem_add	4
97 #define	ADT_filesystem_delete	5
98 #define	ADT_filesystem_modify	6
99 #define	ADT_inetd_connect	34
100 #define	ADT_inetd_copylimit	36
101 #define	ADT_inetd_failrate	37
102 #define	ADT_inetd_ratelimit	35
103 #define	ADT_init_solaris	32
104 #define	ADT_login		25
105 #define	ADT_logout		1
106 #define	ADT_network_add		7
107 #define	ADT_network_delete	8
108 #define	ADT_network_modify	9
109 #define	ADT_passwd		27
110 #define	ADT_printer_add		10
111 #define	ADT_printer_delete	11
112 #define	ADT_printer_modify	12
113 #define	ADT_prof_cmd		24
114 #define	ADT_rlogin		28
115 #define	ADT_role_login		13
116 #define	ADT_role_logout		40
117 #define	ADT_scheduledjob_add	14
118 #define	ADT_scheduledjob_delete	15
119 #define	ADT_scheduledjob_modify	16
120 #define	ADT_screenlock		26
121 #define	ADT_screenunlock	31
122 #define	ADT_serialport_add	17
123 #define	ADT_serialport_delete	18
124 #define	ADT_serialport_modify	19
125 #define	ADT_ssh			2
126 #define	ADT_su			30
127 #define	ADT_su_logout		39
128 #define	ADT_telnet		29
129 #define	ADT_uauth		20
130 #define	ADT_usermgr_add		21
131 #define	ADT_usermgr_delete	22
132 #define	ADT_usermgr_modify	23
133 #define	ADT_zlogin		38
134 #define	ADT_zone_state		33
135 
136 
137 struct adt_admin_authenticate {	/* ADT_admin_authenticate */
138 	enum adt_login_text	message;	/*  optional  */
139 };
140 typedef struct adt_admin_authenticate adt_admin_authenticate_t;
141 
142 struct adt_filesystem_add {	/* ADT_filesystem_add */
143 	char 	*object_name;	/* required */
144 	char 	*domain;	/* optional */
145 	char 	*name_service;	/* required */
146 	char 	*auth_used;	/* optional */
147 	char 	*initial_values;	/* required */
148 };
149 typedef struct adt_filesystem_add adt_filesystem_add_t;
150 
151 struct adt_filesystem_delete {	/* ADT_filesystem_delete */
152 	char 	*object_name;	/* required */
153 	char 	*domain;	/* optional */
154 	char 	*name_service;	/* required */
155 	char 	*auth_used;	/* optional */
156 	char 	*delete_values;	/* required */
157 };
158 typedef struct adt_filesystem_delete adt_filesystem_delete_t;
159 
160 struct adt_filesystem_modify {	/* ADT_filesystem_modify */
161 	char 	*object_name;	/* required */
162 	char 	*domain;	/* optional */
163 	char 	*name_service;	/* required */
164 	char 	*auth_used;	/* optional */
165 	char 	*changed_values;	/* required */
166 };
167 typedef struct adt_filesystem_modify adt_filesystem_modify_t;
168 
169 struct adt_inetd_connect {	/* ADT_inetd_connect */
170 	char 	*service_name;	/* optional */
171 	uint32_t	ip_type;	/*  required  */
172 	uint16_t	ip_remote_port;	/*  required  */
173 	uint16_t	ip_local_port;	/*  required  */
174 	uint32_t	ip_adr[4];	/*  required  */
175 	char 	*cmd;	/* required */
176 	priv_set_t 	*privileges;	/* required */
177 };
178 typedef struct adt_inetd_connect adt_inetd_connect_t;
179 
180 struct adt_inetd_copylimit {	/* ADT_inetd_copylimit */
181 	char 	*service_name;	/* optional */
182 	char 	*limit;	/* required */
183 };
184 typedef struct adt_inetd_copylimit adt_inetd_copylimit_t;
185 
186 struct adt_inetd_failrate {	/* ADT_inetd_failrate */
187 	char 	*service_name;	/* optional */
188 	char 	*values;	/* required */
189 };
190 typedef struct adt_inetd_failrate adt_inetd_failrate_t;
191 
192 struct adt_inetd_ratelimit {	/* ADT_inetd_ratelimit */
193 	char 	*service_name;	/* optional */
194 	char 	*limit;	/* required */
195 };
196 typedef struct adt_inetd_ratelimit adt_inetd_ratelimit_t;
197 
198 struct adt_init_solaris {	/* ADT_init_solaris */
199 	char 	*info;	/* optional */
200 };
201 typedef struct adt_init_solaris adt_init_solaris_t;
202 
203 struct adt_login {	/* ADT_login */
204 	enum adt_login_text	message;	/*  optional  */
205 };
206 typedef struct adt_login adt_login_t;
207 
208 struct adt_logout {	/* ADT_logout */
209 	char 	*user_name;	/* optional (format: logout %s) */
210 };
211 typedef struct adt_logout adt_logout_t;
212 
213 struct adt_network_add {	/* ADT_network_add */
214 	char 	*object_name;	/* required */
215 	char 	*domain;	/* optional */
216 	char 	*name_service;	/* required */
217 	char 	*auth_used;	/* optional */
218 	char 	*initial_values;	/* required */
219 };
220 typedef struct adt_network_add adt_network_add_t;
221 
222 struct adt_network_delete {	/* ADT_network_delete */
223 	char 	*object_name;	/* required */
224 	char 	*domain;	/* optional */
225 	char 	*name_service;	/* required */
226 	char 	*auth_used;	/* optional */
227 	char 	*delete_values;	/* required */
228 };
229 typedef struct adt_network_delete adt_network_delete_t;
230 
231 struct adt_network_modify {	/* ADT_network_modify */
232 	char 	*object_name;	/* required */
233 	char 	*domain;	/* optional */
234 	char 	*name_service;	/* required */
235 	char 	*auth_used;	/* optional */
236 	char 	*changed_values;	/* required */
237 };
238 typedef struct adt_network_modify adt_network_modify_t;
239 
240 struct adt_passwd {	/* ADT_passwd */
241 	char 	*username;	/* optional */
242 };
243 typedef struct adt_passwd adt_passwd_t;
244 
245 struct adt_printer_add {	/* ADT_printer_add */
246 	char 	*object_name;	/* required */
247 	char 	*domain;	/* optional */
248 	char 	*name_service;	/* required */
249 	char 	*auth_used;	/* optional */
250 	char 	*initial_values;	/* required */
251 };
252 typedef struct adt_printer_add adt_printer_add_t;
253 
254 struct adt_printer_delete {	/* ADT_printer_delete */
255 	char 	*object_name;	/* required */
256 	char 	*domain;	/* optional */
257 	char 	*name_service;	/* required */
258 	char 	*auth_used;	/* optional */
259 	char 	*delete_values;	/* required */
260 };
261 typedef struct adt_printer_delete adt_printer_delete_t;
262 
263 struct adt_printer_modify {	/* ADT_printer_modify */
264 	char 	*object_name;	/* required */
265 	char 	*domain;	/* optional */
266 	char 	*name_service;	/* required */
267 	char 	*auth_used;	/* optional */
268 	char 	*changed_values;	/* required */
269 };
270 typedef struct adt_printer_modify adt_printer_modify_t;
271 
272 struct adt_prof_cmd {	/* ADT_prof_cmd */
273 	char	*cwdpath;	/* required */
274 	char	*cmdpath;	/* required */
275 	int	argc;	/*  required  */
276 	char	**argv;	/*  required  */
277 	char	**envp;	/*  required  */
278 	uid_t	proc_auid;	/*  required  */
279 	uid_t	proc_euid;	/*  required  */
280 	gid_t	proc_egid;	/*  required  */
281 	uid_t	proc_ruid;	/*  required  */
282 	gid_t	proc_rgid;	/*  required  */
283 	pid_t	proc_pid;	/*  required  */
284 	au_asid_t	proc_sid;	/*  required  */
285 	adt_termid_t	*proc_termid;	/*  required  */
286 	priv_set_t	*limit_set;	/* optional */
287 	priv_set_t	*inherit_set;	/* optional */
288 };
289 typedef struct adt_prof_cmd adt_prof_cmd_t;
290 
291 struct adt_rlogin {	/* ADT_rlogin */
292 	enum adt_login_text	message;	/*  optional  */
293 };
294 typedef struct adt_rlogin adt_rlogin_t;
295 
296 struct adt_role_login {	/* ADT_role_login */
297 	enum adt_login_text	message;	/*  optional  */
298 };
299 typedef struct adt_role_login adt_role_login_t;
300 
301 struct adt_role_logout {	/* ADT_role_logout */
302 	int	dummy;	/* not used */
303 };
304 typedef struct adt_role_logout adt_role_logout_t;
305 
306 struct adt_scheduledjob_add {	/* ADT_scheduledjob_add */
307 	char 	*object_name;	/* required */
308 	char 	*domain;	/* optional */
309 	char 	*name_service;	/* required */
310 	char 	*auth_used;	/* optional */
311 	char 	*initial_values;	/* required */
312 };
313 typedef struct adt_scheduledjob_add adt_scheduledjob_add_t;
314 
315 struct adt_scheduledjob_delete {	/* ADT_scheduledjob_delete */
316 	char 	*object_name;	/* required */
317 	char 	*domain;	/* optional */
318 	char 	*name_service;	/* required */
319 	char 	*auth_used;	/* optional */
320 	char 	*delete_values;	/* required */
321 };
322 typedef struct adt_scheduledjob_delete adt_scheduledjob_delete_t;
323 
324 struct adt_scheduledjob_modify {	/* ADT_scheduledjob_modify */
325 	char 	*object_name;	/* required */
326 	char 	*domain;	/* optional */
327 	char 	*name_service;	/* required */
328 	char 	*auth_used;	/* optional */
329 	char 	*changed_values;	/* required */
330 };
331 typedef struct adt_scheduledjob_modify adt_scheduledjob_modify_t;
332 
333 struct adt_screenlock {	/* ADT_screenlock */
334 	int	dummy;	/* not used */
335 };
336 typedef struct adt_screenlock adt_screenlock_t;
337 
338 struct adt_screenunlock {	/* ADT_screenunlock */
339 	int	dummy;	/* not used */
340 };
341 typedef struct adt_screenunlock adt_screenunlock_t;
342 
343 struct adt_serialport_add {	/* ADT_serialport_add */
344 	char 	*object_name;	/* required */
345 	char 	*domain;	/* optional */
346 	char 	*name_service;	/* required */
347 	char 	*auth_used;	/* optional */
348 	char 	*initial_values;	/* required */
349 };
350 typedef struct adt_serialport_add adt_serialport_add_t;
351 
352 struct adt_serialport_delete {	/* ADT_serialport_delete */
353 	char 	*object_name;	/* required */
354 	char 	*domain;	/* optional */
355 	char 	*name_service;	/* required */
356 	char 	*auth_used;	/* optional */
357 	char 	*delete_values;	/* required */
358 };
359 typedef struct adt_serialport_delete adt_serialport_delete_t;
360 
361 struct adt_serialport_modify {	/* ADT_serialport_modify */
362 	char 	*object_name;	/* required */
363 	char 	*domain;	/* optional */
364 	char 	*name_service;	/* required */
365 	char 	*auth_used;	/* optional */
366 	char 	*changed_values;	/* required */
367 };
368 typedef struct adt_serialport_modify adt_serialport_modify_t;
369 
370 struct adt_ssh {	/* ADT_ssh */
371 	enum adt_login_text	message;	/*  optional  */
372 };
373 typedef struct adt_ssh adt_ssh_t;
374 
375 struct adt_su {	/* ADT_su */
376 	char 	*message;	/* optional */
377 };
378 typedef struct adt_su adt_su_t;
379 
380 struct adt_su_logout {	/* ADT_su_logout */
381 	int	dummy;	/* not used */
382 };
383 typedef struct adt_su_logout adt_su_logout_t;
384 
385 struct adt_telnet {	/* ADT_telnet */
386 	enum adt_login_text	message;	/*  optional  */
387 };
388 typedef struct adt_telnet adt_telnet_t;
389 
390 struct adt_uauth {	/* ADT_uauth */
391 	char 	*auth_used;	/* required */
392 	char 	*objectname;	/* required */
393 };
394 typedef struct adt_uauth adt_uauth_t;
395 
396 struct adt_usermgr_add {	/* ADT_usermgr_add */
397 	char 	*object_name;	/* required */
398 	char 	*domain;	/* optional */
399 	char 	*name_service;	/* required */
400 	char 	*auth_used;	/* optional */
401 	char 	*initial_values;	/* required */
402 };
403 typedef struct adt_usermgr_add adt_usermgr_add_t;
404 
405 struct adt_usermgr_delete {	/* ADT_usermgr_delete */
406 	char 	*object_name;	/* required */
407 	char 	*domain;	/* optional */
408 	char 	*name_service;	/* required */
409 	char 	*auth_used;	/* optional */
410 	char 	*delete_values;	/* required */
411 };
412 typedef struct adt_usermgr_delete adt_usermgr_delete_t;
413 
414 struct adt_usermgr_modify {	/* ADT_usermgr_modify */
415 	char 	*object_name;	/* required */
416 	char 	*domain;	/* optional */
417 	char 	*name_service;	/* required */
418 	char 	*auth_used;	/* optional */
419 	char 	*changed_values;	/* required */
420 };
421 typedef struct adt_usermgr_modify adt_usermgr_modify_t;
422 
423 struct adt_zlogin {	/* ADT_zlogin */
424 	char 	*message;	/* optional */
425 };
426 typedef struct adt_zlogin adt_zlogin_t;
427 
428 struct adt_zone_state {	/* ADT_zone_state */
429 	char 	*new_state;	/* required */
430 	char 	*zonename;	/* required */
431 };
432 typedef struct adt_zone_state adt_zone_state_t;
433 
434 union adt_event_data {
435 		adt_admin_authenticate_t	adt_admin_authenticate;
436 		adt_filesystem_add_t	adt_filesystem_add;
437 		adt_filesystem_delete_t	adt_filesystem_delete;
438 		adt_filesystem_modify_t	adt_filesystem_modify;
439 		adt_inetd_connect_t	adt_inetd_connect;
440 		adt_inetd_copylimit_t	adt_inetd_copylimit;
441 		adt_inetd_failrate_t	adt_inetd_failrate;
442 		adt_inetd_ratelimit_t	adt_inetd_ratelimit;
443 		adt_init_solaris_t	adt_init_solaris;
444 		adt_login_t	adt_login;
445 		adt_logout_t	adt_logout;
446 		adt_network_add_t	adt_network_add;
447 		adt_network_delete_t	adt_network_delete;
448 		adt_network_modify_t	adt_network_modify;
449 		adt_passwd_t	adt_passwd;
450 		adt_printer_add_t	adt_printer_add;
451 		adt_printer_delete_t	adt_printer_delete;
452 		adt_printer_modify_t	adt_printer_modify;
453 		adt_prof_cmd_t	adt_prof_cmd;
454 		adt_rlogin_t	adt_rlogin;
455 		adt_role_login_t	adt_role_login;
456 		adt_role_logout_t	adt_role_logout;
457 		adt_scheduledjob_add_t	adt_scheduledjob_add;
458 		adt_scheduledjob_delete_t	adt_scheduledjob_delete;
459 		adt_scheduledjob_modify_t	adt_scheduledjob_modify;
460 		adt_screenlock_t	adt_screenlock;
461 		adt_screenunlock_t	adt_screenunlock;
462 		adt_serialport_add_t	adt_serialport_add;
463 		adt_serialport_delete_t	adt_serialport_delete;
464 		adt_serialport_modify_t	adt_serialport_modify;
465 		adt_ssh_t	adt_ssh;
466 		adt_su_t	adt_su;
467 		adt_su_logout_t	adt_su_logout;
468 		adt_telnet_t	adt_telnet;
469 		adt_uauth_t	adt_uauth;
470 		adt_usermgr_add_t	adt_usermgr_add;
471 		adt_usermgr_delete_t	adt_usermgr_delete;
472 		adt_usermgr_modify_t	adt_usermgr_modify;
473 		adt_zlogin_t	adt_zlogin;
474 		adt_zone_state_t	adt_zone_state;
475 };
476 
477 
478 #ifndef	ADT_PRIVATE
479 #define	ADT_PRIVATE
480 
481 /*
482  * These interfaces are project private and will change without
483  * notice as needed for the BSM API project.
484  */
485 
486 extern	void	adt_get_auid(const adt_session_data_t *, au_id_t *);
487 extern	void	adt_set_auid(const adt_session_data_t *, const au_id_t);
488 
489 extern	void	adt_get_mask(const adt_session_data_t *, au_mask_t *);
490 extern	void	adt_set_mask(const adt_session_data_t *, const au_mask_t *);
491 
492 extern	void	adt_get_termid(const adt_session_data_t *, au_tid_addr_t *);
493 extern	void	adt_set_termid(const adt_session_data_t *,
494     const au_tid_addr_t *);
495 
496 extern	void	adt_get_asid(const adt_session_data_t *, au_asid_t *);
497 extern	void	adt_set_asid(const adt_session_data_t *, const au_asid_t);
498 
499 #endif
500 
501 #ifdef	__cplusplus
502 }
503 #endif
504 
505 #endif	/* _ADT_EVENT_H */
506