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 5ea8dc4b6Seschrock * Common Development and Distribution License (the "License"). 6ea8dc4b6Seschrock * 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*b1b8ab34Slling * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate /* 277c478bd9Sstevel@tonic-gate * sysconf.h - include file for sysconf utility and the kernel. 287c478bd9Sstevel@tonic-gate */ 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #ifndef _SYS_SYSCONF_H 317c478bd9Sstevel@tonic-gate #define _SYS_SYSCONF_H 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate #ifdef __cplusplus 367c478bd9Sstevel@tonic-gate extern "C" { 377c478bd9Sstevel@tonic-gate #endif 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate /* 407c478bd9Sstevel@tonic-gate * For each entry in /etc/system a sysparam record is created. 417c478bd9Sstevel@tonic-gate */ 427c478bd9Sstevel@tonic-gate struct sysparam { 437c478bd9Sstevel@tonic-gate struct sysparam *sys_next; /* pointer to next */ 447c478bd9Sstevel@tonic-gate int sys_type; /* type of record */ 457c478bd9Sstevel@tonic-gate int sys_op; /* operation */ 467c478bd9Sstevel@tonic-gate char *sys_modnam; /* module name (null if param in kernel) */ 477c478bd9Sstevel@tonic-gate char *sys_ptr; /* string pointer to device, etc. */ 487c478bd9Sstevel@tonic-gate u_longlong_t sys_info; /* additional information */ 497c478bd9Sstevel@tonic-gate char *sys_config; /* configuration data */ 507c478bd9Sstevel@tonic-gate int sys_len; /* len of config data */ 517c478bd9Sstevel@tonic-gate ulong_t *addrp; /* pointer to valloced config addresses */ 527c478bd9Sstevel@tonic-gate int sys_flags; /* flags to check duplicate entries */ 537c478bd9Sstevel@tonic-gate }; 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate #define MAXLINESIZE 80 /* max size of a line in /etc/system */ 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate struct modcmd { 587c478bd9Sstevel@tonic-gate char *mc_cmdname; 597c478bd9Sstevel@tonic-gate int mc_type; 607c478bd9Sstevel@tonic-gate }; 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate #define MOD_EXCLUDE 0 /* we'll never load this one */ 637c478bd9Sstevel@tonic-gate #define MOD_INCLUDE 1 /* load on demand */ 647c478bd9Sstevel@tonic-gate #define MOD_FORCELOAD 2 /* load during initialization */ 657c478bd9Sstevel@tonic-gate #define MOD_ROOTDEV 3 /* root device */ 667c478bd9Sstevel@tonic-gate #define MOD_ROOTFS 4 /* root fs type */ 677c478bd9Sstevel@tonic-gate #define MOD_SWAPDEV 5 /* swap device */ 687c478bd9Sstevel@tonic-gate #define MOD_SWAPFS 6 /* swap fs type */ 697c478bd9Sstevel@tonic-gate #define MOD_MODDIR 7 /* default directory for modules */ 707c478bd9Sstevel@tonic-gate #define MOD_SET 8 /* set int to specified value */ 717c478bd9Sstevel@tonic-gate #define MOD_UNKNOWN 9 /* unknown command */ 727c478bd9Sstevel@tonic-gate #define MOD_SET32 10 /* like MOD_SET but -only- on 32-bit kernel */ 737c478bd9Sstevel@tonic-gate #define MOD_SET64 11 /* like MOD_SET but -only- on 64-bit kernel */ 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate /* 767c478bd9Sstevel@tonic-gate * Commands for mod_sysctl() 777c478bd9Sstevel@tonic-gate */ 787c478bd9Sstevel@tonic-gate #define SYS_FORCELOAD 0 /* forceload modules */ 797c478bd9Sstevel@tonic-gate #define SYS_SET_KVAR 1 /* set kernel variables */ 807c478bd9Sstevel@tonic-gate #define SYS_SET_MVAR 2 /* set module variables */ 817c478bd9Sstevel@tonic-gate #define SYS_CHECK_EXCLUDE 3 /* check if a module is excluded */ 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gate /* 847c478bd9Sstevel@tonic-gate * Legal operations for MOD_SET. 857c478bd9Sstevel@tonic-gate */ 867c478bd9Sstevel@tonic-gate #define SETOP_NONE 0 /* no op - for types other than MOD_SET */ 877c478bd9Sstevel@tonic-gate #define SETOP_ASSIGN 1 /* '=' - simple assignment */ 887c478bd9Sstevel@tonic-gate #define SETOP_AND 2 /* '&' - bitwise AND */ 897c478bd9Sstevel@tonic-gate #define SETOP_OR 3 /* '|' - bitwise OR */ 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gate /* 927c478bd9Sstevel@tonic-gate * Defines for sys_flags. 937c478bd9Sstevel@tonic-gate */ 947c478bd9Sstevel@tonic-gate #define SYSPARAM_STR_TOKEN 0x0001 /* a string token is set */ 957c478bd9Sstevel@tonic-gate #define SYSPARAM_HEX_TOKEN 0x0002 /* a hexadecimal number is set */ 967c478bd9Sstevel@tonic-gate #define SYSPARAM_DEC_TOKEN 0x0004 /* a decimal number is set */ 977c478bd9Sstevel@tonic-gate #define SYSPARAM_DUP 0x0010 /* this entry is duplicated */ 987c478bd9Sstevel@tonic-gate #define SYSPARAM_TERM 0x0020 /* this entry is the last entry */ 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1017c478bd9Sstevel@tonic-gate } 1027c478bd9Sstevel@tonic-gate #endif 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate #endif /* _SYS_SYSCONF_H */ 105