xref: /onnv-gate/usr/src/cmd/rcap/common/rcapd_conf.h (revision 4119:293019c5ea1f)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
52517Stn143363  * Common Development and Distribution License (the "License").
62517Stn143363  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*4119Stn143363  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_RCAPD_CONF_H
270Sstevel@tonic-gate #define	_RCAPD_CONF_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #include <sys/param.h>
320Sstevel@tonic-gate #include <stdio.h>
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #ifdef	__cplusplus
350Sstevel@tonic-gate extern "C" {
360Sstevel@tonic-gate #endif
370Sstevel@tonic-gate 
382517Stn143363 #define	CFG_TEMPLATE_SUFFIX	".XXXXXX"	/* suffix of mkstemp() arg */
392517Stn143363 
400Sstevel@tonic-gate /*
410Sstevel@tonic-gate  * Operating modes
420Sstevel@tonic-gate  */
430Sstevel@tonic-gate typedef enum {
440Sstevel@tonic-gate 	rctype_project = 1	/* projects are the only collection type */
450Sstevel@tonic-gate } rctype_t;
460Sstevel@tonic-gate 
470Sstevel@tonic-gate /*
480Sstevel@tonic-gate  * Configuration
490Sstevel@tonic-gate  */
500Sstevel@tonic-gate typedef struct {
510Sstevel@tonic-gate 	char		rcfg_filename[MAXPATHLEN];	/* cfg filename */
520Sstevel@tonic-gate 	int		rcfg_fd;			/* reserved cfg fd */
530Sstevel@tonic-gate 	time_t		rcfg_last_modification;		/* last mod time */
540Sstevel@tonic-gate 	rctype_t	rcfg_mode;		/* mode (collection type) */
550Sstevel@tonic-gate 	char		*rcfg_mode_name;  	/* mode name ("project" only) */
560Sstevel@tonic-gate 	uint32_t	rcfg_proc_walk_interval;	/* /proc readdir() */
570Sstevel@tonic-gate 							/* interval (s), */
580Sstevel@tonic-gate 							/* undocumented */
590Sstevel@tonic-gate 	uint32_t	rcfg_reconfiguration_interval;	/* lnode or project */
600Sstevel@tonic-gate 							/* cap reconfig. */
610Sstevel@tonic-gate 							/* interval (s) */
620Sstevel@tonic-gate 	uint32_t	rcfg_report_interval;	/* report interval (s) */
630Sstevel@tonic-gate 	int		rcfg_memory_cap_enforcement_pressure;  /* pressure */
640Sstevel@tonic-gate 				/* above which memory caps are enforced */
650Sstevel@tonic-gate 	char		rcfg_stat_file[MAXPATHLEN];	/* statistics file */
660Sstevel@tonic-gate 	uint32_t	rcfg_rss_sample_interval; /* RSS sampling interval */
670Sstevel@tonic-gate } rcfg_t;
680Sstevel@tonic-gate 
690Sstevel@tonic-gate typedef enum {
700Sstevel@tonic-gate 	RCT_MODE_VAR = 257,
710Sstevel@tonic-gate 	RCT_PROC_WALK_INTERVAL_VAR,
720Sstevel@tonic-gate 	RCT_RECONFIGURATION_INTERVAL_VAR,
730Sstevel@tonic-gate 	RCT_REPORT_INTERVAL_VAR,
740Sstevel@tonic-gate 	RCT_RSS_SAMPLE_INTERVAL_VAR,
750Sstevel@tonic-gate 	RCT_MEMORY_CAP_ENFORCEMENT_PRESSURE_VAR,
760Sstevel@tonic-gate 	RCT_STAT_FILE_VAR,
770Sstevel@tonic-gate 	RCT_EQUALS,
780Sstevel@tonic-gate 	RCT_NUMBER,
790Sstevel@tonic-gate 	RCT_PROJECT,
800Sstevel@tonic-gate 	RCT_LNODE,
810Sstevel@tonic-gate 	RCT_ON,
820Sstevel@tonic-gate 	RCT_OFF,
830Sstevel@tonic-gate 	RCT_FILENAME,
840Sstevel@tonic-gate 	RCT_STATE,
850Sstevel@tonic-gate 	RCT_INVALID
860Sstevel@tonic-gate } rctoken_t;
870Sstevel@tonic-gate 
88*4119Stn143363 extern int rcfg_read(rcfg_t *, int(*)(void));
890Sstevel@tonic-gate extern void rcfg_init(rcfg_t *);
90*4119Stn143363 extern int modify_config(rcfg_t *);
910Sstevel@tonic-gate 
920Sstevel@tonic-gate #ifdef	__cplusplus
930Sstevel@tonic-gate }
940Sstevel@tonic-gate #endif
950Sstevel@tonic-gate 
960Sstevel@tonic-gate #endif	/* _RCAPD_CONF_H */
97