xref: /illumos-gate/usr/src/cmd/acctadm/aconf.h (revision 2a8bcb4e)
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 #include <sys/types.h>
30 #include <sys/param.h>
31 #include <stdio.h>
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 #define	MAXRESLEN	256
38 
39 typedef struct acctconf {
40 	int	state;
41 	char	file[MAXPATHLEN];
42 	char	tracked[MAXRESLEN];
43 	char	untracked[MAXRESLEN];
44 } acctconf_t;
45 
46 /*
47  * Predefined strings
48  */
49 #define	AC_STR_NONE		"none"
50 
51 /*
52  * Configuration property group name
53  */
54 #define	AC_PGNAME		"config"
55 
56 /*
57  * Configuration property names
58  */
59 #define	AC_PROP_STATE		"enabled"
60 #define	AC_PROP_FILE		"file"
61 #define	AC_PROP_TRACKED		"tracked"
62 #define	AC_PROP_UNTRACKED	"untracked"
63 
64 extern void	aconf_init(acctconf_t *, int);
65 extern int	aconf_setup(const char *);
66 extern int	aconf_scf_init(const char *);
67 extern void	aconf_scf_fini(void);
68 extern int	aconf_set_string(const char *, const char *);
69 extern int	aconf_set_bool(const char *, boolean_t);
70 extern int	aconf_save(void);
71 extern void	aconf_print(FILE *, int);
72 extern boolean_t aconf_have_smf_auths(void);
73 extern const char *aconf_type2fmri(int);
74 
75 #ifdef	__cplusplus
76 }
77 #endif
78 
79 #endif	/* _ACONF_H */
80