xref: /titanic_53/usr/src/lib/libbsm/common/adt_event.h (revision bb25c06cca41ca78e5fb87fbb8e81d55beb18c95)
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_attach		42
97 #define	ADT_detach		43
98 #define	ADT_filesystem_add	4
99 #define	ADT_filesystem_delete	5
100 #define	ADT_filesystem_modify	6
101 #define	ADT_inetd_connect	34
102 #define	ADT_inetd_copylimit	36
103 #define	ADT_inetd_failrate	37
104 #define	ADT_inetd_ratelimit	35
105 #define	ADT_init_solaris	32
106 #define	ADT_login		25
107 #define	ADT_logout		1
108 #define	ADT_network_add		7
109 #define	ADT_network_delete	8
110 #define	ADT_network_modify	9
111 #define	ADT_newgrp_login	41
112 #define	ADT_passwd		27
113 #define	ADT_pool_export		46
114 #define	ADT_pool_import		45
115 #define	ADT_printer_add		10
116 #define	ADT_printer_delete	11
117 #define	ADT_printer_modify	12
118 #define	ADT_prof_cmd		24
119 #define	ADT_remove		44
120 #define	ADT_rlogin		28
121 #define	ADT_role_login		13
122 #define	ADT_role_logout		40
123 #define	ADT_scheduledjob_add	14
124 #define	ADT_scheduledjob_delete	15
125 #define	ADT_scheduledjob_modify	16
126 #define	ADT_screenlock		26
127 #define	ADT_screenunlock	31
128 #define	ADT_serialport_add	17
129 #define	ADT_serialport_delete	18
130 #define	ADT_serialport_modify	19
131 #define	ADT_ssh			2
132 #define	ADT_su			30
133 #define	ADT_su_logout		39
134 #define	ADT_telnet		29
135 #define	ADT_uauth		20
136 #define	ADT_usermgr_add		21
137 #define	ADT_usermgr_delete	22
138 #define	ADT_usermgr_modify	23
139 #define	ADT_zlogin		38
140 #define	ADT_zone_state		33
141 
142 
143 struct adt_admin_authenticate {	/* ADT_admin_authenticate */
144 	enum adt_login_text	message;	/*  optional  */
145 };
146 typedef struct adt_admin_authenticate adt_admin_authenticate_t;
147 
148 struct adt_attach {	/* ADT_attach */
149 	char 	*auth_used;	/* required */
150 	char 	*mount_point;	/* required */
151 	char 	*device;	/* required */
152 	char 	*options;	/* optional */
153 };
154 typedef struct adt_attach adt_attach_t;
155 
156 struct adt_detach {	/* ADT_detach */
157 	char 	*auth_used;	/* required */
158 	char 	*mount_point;	/* required */
159 	char 	*device;	/* required */
160 	char 	*options;	/* optional */
161 };
162 typedef struct adt_detach adt_detach_t;
163 
164 struct adt_filesystem_add {	/* ADT_filesystem_add */
165 	char 	*object_name;	/* required */
166 	char 	*domain;	/* optional */
167 	char 	*name_service;	/* required */
168 	char 	*auth_used;	/* optional */
169 	char 	*initial_values;	/* required */
170 };
171 typedef struct adt_filesystem_add adt_filesystem_add_t;
172 
173 struct adt_filesystem_delete {	/* ADT_filesystem_delete */
174 	char 	*object_name;	/* required */
175 	char 	*domain;	/* optional */
176 	char 	*name_service;	/* required */
177 	char 	*auth_used;	/* optional */
178 	char 	*delete_values;	/* required */
179 };
180 typedef struct adt_filesystem_delete adt_filesystem_delete_t;
181 
182 struct adt_filesystem_modify {	/* ADT_filesystem_modify */
183 	char 	*object_name;	/* required */
184 	char 	*domain;	/* optional */
185 	char 	*name_service;	/* required */
186 	char 	*auth_used;	/* optional */
187 	char 	*changed_values;	/* required */
188 };
189 typedef struct adt_filesystem_modify adt_filesystem_modify_t;
190 
191 struct adt_inetd_connect {	/* ADT_inetd_connect */
192 	char 	*service_name;	/* optional */
193 	uint32_t	ip_type;	/*  required  */
194 	uint16_t	ip_remote_port;	/*  required  */
195 	uint16_t	ip_local_port;	/*  required  */
196 	uint32_t	ip_adr[4];	/*  required  */
197 	char 	*cmd;	/* required */
198 	priv_set_t 	*privileges;	/* required */
199 };
200 typedef struct adt_inetd_connect adt_inetd_connect_t;
201 
202 struct adt_inetd_copylimit {	/* ADT_inetd_copylimit */
203 	char 	*service_name;	/* optional */
204 	char 	*limit;	/* required */
205 };
206 typedef struct adt_inetd_copylimit adt_inetd_copylimit_t;
207 
208 struct adt_inetd_failrate {	/* ADT_inetd_failrate */
209 	char 	*service_name;	/* optional */
210 	char 	*values;	/* required */
211 };
212 typedef struct adt_inetd_failrate adt_inetd_failrate_t;
213 
214 struct adt_inetd_ratelimit {	/* ADT_inetd_ratelimit */
215 	char 	*service_name;	/* optional */
216 	char 	*limit;	/* required */
217 };
218 typedef struct adt_inetd_ratelimit adt_inetd_ratelimit_t;
219 
220 struct adt_init_solaris {	/* ADT_init_solaris */
221 	char 	*info;	/* optional */
222 };
223 typedef struct adt_init_solaris adt_init_solaris_t;
224 
225 struct adt_login {	/* ADT_login */
226 	enum adt_login_text	message;	/*  optional  */
227 };
228 typedef struct adt_login adt_login_t;
229 
230 struct adt_logout {	/* ADT_logout */
231 	char 	*user_name;	/* optional (format: logout %s) */
232 };
233 typedef struct adt_logout adt_logout_t;
234 
235 struct adt_network_add {	/* ADT_network_add */
236 	char 	*object_name;	/* required */
237 	char 	*domain;	/* optional */
238 	char 	*name_service;	/* required */
239 	char 	*auth_used;	/* optional */
240 	char 	*initial_values;	/* required */
241 };
242 typedef struct adt_network_add adt_network_add_t;
243 
244 struct adt_network_delete {	/* ADT_network_delete */
245 	char 	*object_name;	/* required */
246 	char 	*domain;	/* optional */
247 	char 	*name_service;	/* required */
248 	char 	*auth_used;	/* optional */
249 	char 	*delete_values;	/* required */
250 };
251 typedef struct adt_network_delete adt_network_delete_t;
252 
253 struct adt_network_modify {	/* ADT_network_modify */
254 	char 	*object_name;	/* required */
255 	char 	*domain;	/* optional */
256 	char 	*name_service;	/* required */
257 	char 	*auth_used;	/* optional */
258 	char 	*changed_values;	/* required */
259 };
260 typedef struct adt_network_modify adt_network_modify_t;
261 
262 struct adt_newgrp_login {	/* ADT_newgrp_login */
263 	char 	*groupname;	/* required */
264 };
265 typedef struct adt_newgrp_login adt_newgrp_login_t;
266 
267 struct adt_passwd {	/* ADT_passwd */
268 	char 	*username;	/* optional */
269 };
270 typedef struct adt_passwd adt_passwd_t;
271 
272 struct adt_pool_export {	/* ADT_pool_export */
273 	char 	*auth_used;	/* required */
274 	char 	*pool;	/* required */
275 	char 	*device;	/* required */
276 };
277 typedef struct adt_pool_export adt_pool_export_t;
278 
279 struct adt_pool_import {	/* ADT_pool_import */
280 	char 	*auth_used;	/* required */
281 	char 	*pool;	/* required */
282 	char 	*device;	/* required */
283 };
284 typedef struct adt_pool_import adt_pool_import_t;
285 
286 struct adt_printer_add {	/* ADT_printer_add */
287 	char 	*object_name;	/* required */
288 	char 	*domain;	/* optional */
289 	char 	*name_service;	/* required */
290 	char 	*auth_used;	/* optional */
291 	char 	*initial_values;	/* required */
292 };
293 typedef struct adt_printer_add adt_printer_add_t;
294 
295 struct adt_printer_delete {	/* ADT_printer_delete */
296 	char 	*object_name;	/* required */
297 	char 	*domain;	/* optional */
298 	char 	*name_service;	/* required */
299 	char 	*auth_used;	/* optional */
300 	char 	*delete_values;	/* required */
301 };
302 typedef struct adt_printer_delete adt_printer_delete_t;
303 
304 struct adt_printer_modify {	/* ADT_printer_modify */
305 	char 	*object_name;	/* required */
306 	char 	*domain;	/* optional */
307 	char 	*name_service;	/* required */
308 	char 	*auth_used;	/* optional */
309 	char 	*changed_values;	/* required */
310 };
311 typedef struct adt_printer_modify adt_printer_modify_t;
312 
313 struct adt_prof_cmd {	/* ADT_prof_cmd */
314 	char	*cwdpath;	/* required */
315 	char	*cmdpath;	/* required */
316 	int	argc;	/*  required  */
317 	char	**argv;	/*  required  */
318 	char	**envp;	/*  required  */
319 	uid_t	proc_auid;	/*  required  */
320 	uid_t	proc_euid;	/*  required  */
321 	gid_t	proc_egid;	/*  required  */
322 	uid_t	proc_ruid;	/*  required  */
323 	gid_t	proc_rgid;	/*  required  */
324 	pid_t	proc_pid;	/*  required  */
325 	au_asid_t	proc_sid;	/*  required  */
326 	adt_termid_t	*proc_termid;	/*  required  */
327 	priv_set_t	*limit_set;	/* optional */
328 	priv_set_t	*inherit_set;	/* optional */
329 };
330 typedef struct adt_prof_cmd adt_prof_cmd_t;
331 
332 struct adt_remove {	/* ADT_remove */
333 	char 	*auth_used;	/* required */
334 	char 	*mount_point;	/* optional */
335 	char 	*device;	/* required */
336 };
337 typedef struct adt_remove adt_remove_t;
338 
339 struct adt_rlogin {	/* ADT_rlogin */
340 	enum adt_login_text	message;	/*  optional  */
341 };
342 typedef struct adt_rlogin adt_rlogin_t;
343 
344 struct adt_role_login {	/* ADT_role_login */
345 	enum adt_login_text	message;	/*  optional  */
346 };
347 typedef struct adt_role_login adt_role_login_t;
348 
349 struct adt_role_logout {	/* ADT_role_logout */
350 	int	dummy;	/* not used */
351 };
352 typedef struct adt_role_logout adt_role_logout_t;
353 
354 struct adt_scheduledjob_add {	/* ADT_scheduledjob_add */
355 	char 	*object_name;	/* required */
356 	char 	*domain;	/* optional */
357 	char 	*name_service;	/* required */
358 	char 	*auth_used;	/* optional */
359 	char 	*initial_values;	/* required */
360 };
361 typedef struct adt_scheduledjob_add adt_scheduledjob_add_t;
362 
363 struct adt_scheduledjob_delete {	/* ADT_scheduledjob_delete */
364 	char 	*object_name;	/* required */
365 	char 	*domain;	/* optional */
366 	char 	*name_service;	/* required */
367 	char 	*auth_used;	/* optional */
368 	char 	*delete_values;	/* required */
369 };
370 typedef struct adt_scheduledjob_delete adt_scheduledjob_delete_t;
371 
372 struct adt_scheduledjob_modify {	/* ADT_scheduledjob_modify */
373 	char 	*object_name;	/* required */
374 	char 	*domain;	/* optional */
375 	char 	*name_service;	/* required */
376 	char 	*auth_used;	/* optional */
377 	char 	*changed_values;	/* required */
378 };
379 typedef struct adt_scheduledjob_modify adt_scheduledjob_modify_t;
380 
381 struct adt_screenlock {	/* ADT_screenlock */
382 	int	dummy;	/* not used */
383 };
384 typedef struct adt_screenlock adt_screenlock_t;
385 
386 struct adt_screenunlock {	/* ADT_screenunlock */
387 	int	dummy;	/* not used */
388 };
389 typedef struct adt_screenunlock adt_screenunlock_t;
390 
391 struct adt_serialport_add {	/* ADT_serialport_add */
392 	char 	*object_name;	/* required */
393 	char 	*domain;	/* optional */
394 	char 	*name_service;	/* required */
395 	char 	*auth_used;	/* optional */
396 	char 	*initial_values;	/* required */
397 };
398 typedef struct adt_serialport_add adt_serialport_add_t;
399 
400 struct adt_serialport_delete {	/* ADT_serialport_delete */
401 	char 	*object_name;	/* required */
402 	char 	*domain;	/* optional */
403 	char 	*name_service;	/* required */
404 	char 	*auth_used;	/* optional */
405 	char 	*delete_values;	/* required */
406 };
407 typedef struct adt_serialport_delete adt_serialport_delete_t;
408 
409 struct adt_serialport_modify {	/* ADT_serialport_modify */
410 	char 	*object_name;	/* required */
411 	char 	*domain;	/* optional */
412 	char 	*name_service;	/* required */
413 	char 	*auth_used;	/* optional */
414 	char 	*changed_values;	/* required */
415 };
416 typedef struct adt_serialport_modify adt_serialport_modify_t;
417 
418 struct adt_ssh {	/* ADT_ssh */
419 	enum adt_login_text	message;	/*  optional  */
420 };
421 typedef struct adt_ssh adt_ssh_t;
422 
423 struct adt_su {	/* ADT_su */
424 	char 	*message;	/* optional */
425 };
426 typedef struct adt_su adt_su_t;
427 
428 struct adt_su_logout {	/* ADT_su_logout */
429 	int	dummy;	/* not used */
430 };
431 typedef struct adt_su_logout adt_su_logout_t;
432 
433 struct adt_telnet {	/* ADT_telnet */
434 	enum adt_login_text	message;	/*  optional  */
435 };
436 typedef struct adt_telnet adt_telnet_t;
437 
438 struct adt_uauth {	/* ADT_uauth */
439 	char 	*auth_used;	/* required */
440 	char 	*objectname;	/* required */
441 };
442 typedef struct adt_uauth adt_uauth_t;
443 
444 struct adt_usermgr_add {	/* ADT_usermgr_add */
445 	char 	*object_name;	/* required */
446 	char 	*domain;	/* optional */
447 	char 	*name_service;	/* required */
448 	char 	*auth_used;	/* optional */
449 	char 	*initial_values;	/* required */
450 };
451 typedef struct adt_usermgr_add adt_usermgr_add_t;
452 
453 struct adt_usermgr_delete {	/* ADT_usermgr_delete */
454 	char 	*object_name;	/* required */
455 	char 	*domain;	/* optional */
456 	char 	*name_service;	/* required */
457 	char 	*auth_used;	/* optional */
458 	char 	*delete_values;	/* required */
459 };
460 typedef struct adt_usermgr_delete adt_usermgr_delete_t;
461 
462 struct adt_usermgr_modify {	/* ADT_usermgr_modify */
463 	char 	*object_name;	/* required */
464 	char 	*domain;	/* optional */
465 	char 	*name_service;	/* required */
466 	char 	*auth_used;	/* optional */
467 	char 	*changed_values;	/* required */
468 };
469 typedef struct adt_usermgr_modify adt_usermgr_modify_t;
470 
471 struct adt_zlogin {	/* ADT_zlogin */
472 	char 	*message;	/* optional */
473 };
474 typedef struct adt_zlogin adt_zlogin_t;
475 
476 struct adt_zone_state {	/* ADT_zone_state */
477 	char 	*new_state;	/* required */
478 	char 	*zonename;	/* required */
479 };
480 typedef struct adt_zone_state adt_zone_state_t;
481 
482 union adt_event_data {
483 		adt_admin_authenticate_t	adt_admin_authenticate;
484 		adt_attach_t	adt_attach;
485 		adt_detach_t	adt_detach;
486 		adt_filesystem_add_t	adt_filesystem_add;
487 		adt_filesystem_delete_t	adt_filesystem_delete;
488 		adt_filesystem_modify_t	adt_filesystem_modify;
489 		adt_inetd_connect_t	adt_inetd_connect;
490 		adt_inetd_copylimit_t	adt_inetd_copylimit;
491 		adt_inetd_failrate_t	adt_inetd_failrate;
492 		adt_inetd_ratelimit_t	adt_inetd_ratelimit;
493 		adt_init_solaris_t	adt_init_solaris;
494 		adt_login_t	adt_login;
495 		adt_logout_t	adt_logout;
496 		adt_network_add_t	adt_network_add;
497 		adt_network_delete_t	adt_network_delete;
498 		adt_network_modify_t	adt_network_modify;
499 		adt_newgrp_login_t	adt_newgrp_login;
500 		adt_passwd_t	adt_passwd;
501 		adt_pool_export_t	adt_pool_export;
502 		adt_pool_import_t	adt_pool_import;
503 		adt_printer_add_t	adt_printer_add;
504 		adt_printer_delete_t	adt_printer_delete;
505 		adt_printer_modify_t	adt_printer_modify;
506 		adt_prof_cmd_t	adt_prof_cmd;
507 		adt_remove_t	adt_remove;
508 		adt_rlogin_t	adt_rlogin;
509 		adt_role_login_t	adt_role_login;
510 		adt_role_logout_t	adt_role_logout;
511 		adt_scheduledjob_add_t	adt_scheduledjob_add;
512 		adt_scheduledjob_delete_t	adt_scheduledjob_delete;
513 		adt_scheduledjob_modify_t	adt_scheduledjob_modify;
514 		adt_screenlock_t	adt_screenlock;
515 		adt_screenunlock_t	adt_screenunlock;
516 		adt_serialport_add_t	adt_serialport_add;
517 		adt_serialport_delete_t	adt_serialport_delete;
518 		adt_serialport_modify_t	adt_serialport_modify;
519 		adt_ssh_t	adt_ssh;
520 		adt_su_t	adt_su;
521 		adt_su_logout_t	adt_su_logout;
522 		adt_telnet_t	adt_telnet;
523 		adt_uauth_t	adt_uauth;
524 		adt_usermgr_add_t	adt_usermgr_add;
525 		adt_usermgr_delete_t	adt_usermgr_delete;
526 		adt_usermgr_modify_t	adt_usermgr_modify;
527 		adt_zlogin_t	adt_zlogin;
528 		adt_zone_state_t	adt_zone_state;
529 };
530 
531 
532 #ifndef	ADT_PRIVATE
533 #define	ADT_PRIVATE
534 
535 /*
536  * These interfaces are project private and will change without
537  * notice as needed for the BSM API project.
538  */
539 
540 extern	void	adt_get_auid(const adt_session_data_t *, au_id_t *);
541 extern	void	adt_set_auid(const adt_session_data_t *, const au_id_t);
542 
543 extern	void	adt_get_mask(const adt_session_data_t *, au_mask_t *);
544 extern	void	adt_set_mask(const adt_session_data_t *, const au_mask_t *);
545 
546 extern	void	adt_get_termid(const adt_session_data_t *, au_tid_addr_t *);
547 extern	void	adt_set_termid(const adt_session_data_t *,
548     const au_tid_addr_t *);
549 
550 extern	void	adt_get_asid(const adt_session_data_t *, au_asid_t *);
551 extern	void	adt_set_asid(const adt_session_data_t *, const au_asid_t);
552 
553 #endif
554 
555 #ifdef	__cplusplus
556 }
557 #endif
558 
559 #endif	/* _ADT_EVENT_H */
560