xref: /titanic_44/usr/src/cmd/acctadm/aconf.h (revision 2654012f83cec5dc15b61dfe3e4a4915f186e7a6)
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  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_ACONF_H
27 #define	_ACONF_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <sys/types.h>
32 #include <sys/param.h>
33 #include <stdio.h>
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 #define	MAXRESLEN	256
40 
41 typedef struct acctconf {
42 	int	state;
43 	char	file[MAXPATHLEN];
44 	char	tracked[MAXRESLEN];
45 	char	untracked[MAXRESLEN];
46 } acctconf_t;
47 
48 /*
49  * Predefined strings
50  */
51 #define	AC_STR_NONE		"none"
52 
53 /*
54  * Configuration property group name
55  */
56 #define	AC_PGNAME		"config"
57 
58 /*
59  * Configuration property names
60  */
61 #define	AC_PROP_STATE		"enabled"
62 #define	AC_PROP_FILE		"file"
63 #define	AC_PROP_TRACKED		"tracked"
64 #define	AC_PROP_UNTRACKED	"untracked"
65 
66 extern void	aconf_init(acctconf_t *, int);
67 extern int	aconf_setup(const char *);
68 extern int	aconf_scf_init(const char *);
69 extern void	aconf_scf_fini(void);
70 extern int	aconf_set_string(const char *, const char *);
71 extern int	aconf_set_bool(const char *, boolean_t);
72 extern int	aconf_save(void);
73 extern void	aconf_print(FILE *, int);
74 extern boolean_t aconf_have_smf_auths(void);
75 extern const char *aconf_type2fmri(int);
76 
77 #ifdef	__cplusplus
78 }
79 #endif
80 
81 #endif	/* _ACONF_H */
82