xref: /illumos-gate/usr/src/cmd/acctadm/aconf.h (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*074e084fSml93401  * Common Development and Distribution License (the "License").
6*074e084fSml93401  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*074e084fSml93401  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_ACONF_H
277c478bd9Sstevel@tonic-gate #define	_ACONF_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #include <sys/types.h>
307c478bd9Sstevel@tonic-gate #include <sys/param.h>
317c478bd9Sstevel@tonic-gate #include <stdio.h>
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
347c478bd9Sstevel@tonic-gate extern "C" {
357c478bd9Sstevel@tonic-gate #endif
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #define	MAXRESLEN	256
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate typedef struct acctconf {
40*074e084fSml93401 	int	state;
41*074e084fSml93401 	char	file[MAXPATHLEN];
42*074e084fSml93401 	char	tracked[MAXRESLEN];
43*074e084fSml93401 	char	untracked[MAXRESLEN];
447c478bd9Sstevel@tonic-gate } acctconf_t;
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate /*
477c478bd9Sstevel@tonic-gate  * Predefined strings
487c478bd9Sstevel@tonic-gate  */
497c478bd9Sstevel@tonic-gate #define	AC_STR_NONE		"none"
507c478bd9Sstevel@tonic-gate 
51*074e084fSml93401 /*
52*074e084fSml93401  * Configuration property group name
53*074e084fSml93401  */
54*074e084fSml93401 #define	AC_PGNAME		"config"
557c478bd9Sstevel@tonic-gate 
56*074e084fSml93401 /*
57*074e084fSml93401  * Configuration property names
58*074e084fSml93401  */
59*074e084fSml93401 #define	AC_PROP_STATE		"enabled"
60*074e084fSml93401 #define	AC_PROP_FILE		"file"
61*074e084fSml93401 #define	AC_PROP_TRACKED		"tracked"
62*074e084fSml93401 #define	AC_PROP_UNTRACKED	"untracked"
63*074e084fSml93401 
64*074e084fSml93401 extern void	aconf_init(acctconf_t *, int);
65*074e084fSml93401 extern int	aconf_setup(const char *);
66*074e084fSml93401 extern int	aconf_scf_init(const char *);
67*074e084fSml93401 extern void	aconf_scf_fini(void);
68*074e084fSml93401 extern int	aconf_set_string(const char *, const char *);
69*074e084fSml93401 extern int	aconf_set_bool(const char *, boolean_t);
70*074e084fSml93401 extern int	aconf_save(void);
71*074e084fSml93401 extern void	aconf_print(FILE *, int);
72*074e084fSml93401 extern boolean_t aconf_have_smf_auths(void);
73*074e084fSml93401 extern const char *aconf_type2fmri(int);
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
767c478bd9Sstevel@tonic-gate }
777c478bd9Sstevel@tonic-gate #endif
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate #endif	/* _ACONF_H */
80