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*5679c89fSjv227347 * Common Development and Distribution License (the "License"). 6*5679c89fSjv227347 * 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*5679c89fSjv227347 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 277c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #ifndef _SYS_SYSTEMINFO_H 317c478bd9Sstevel@tonic-gate #define _SYS_SYSTEMINFO_H 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #ifdef __cplusplus 347c478bd9Sstevel@tonic-gate extern "C" { 357c478bd9Sstevel@tonic-gate #endif 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate #ifdef _KERNEL 387c478bd9Sstevel@tonic-gate extern char architecture[]; 397c478bd9Sstevel@tonic-gate extern char architecture_32[]; 40*5679c89fSjv227347 extern char hw_serial[]; /* machine's 32-bit hostid; a decimal string */ 417c478bd9Sstevel@tonic-gate extern char hw_provider[]; 427c478bd9Sstevel@tonic-gate extern char srpc_domain[]; 437c478bd9Sstevel@tonic-gate extern char platform[]; 447c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate /* 477c478bd9Sstevel@tonic-gate * Commands to sysinfo(2) 487c478bd9Sstevel@tonic-gate * 497c478bd9Sstevel@tonic-gate * Values for sysinfo(2) commands are to be assigned by the following 507c478bd9Sstevel@tonic-gate * algorithm: 517c478bd9Sstevel@tonic-gate * 527c478bd9Sstevel@tonic-gate * 1 - 256 Unix International assigned numbers for `get' style commands. 537c478bd9Sstevel@tonic-gate * 257 - 512 Unix International assigned numbers for `set' style commands 547c478bd9Sstevel@tonic-gate * where the value is selected to be the value for the 557c478bd9Sstevel@tonic-gate * corresponding `get' command plus 256. 567c478bd9Sstevel@tonic-gate * 513 - 768 Solaris specific `get' style commands. 577c478bd9Sstevel@tonic-gate * 769 - 1024 Solaris specific `set' style commands where the value is 587c478bd9Sstevel@tonic-gate * selected to be the value for the corresponding `get' command 597c478bd9Sstevel@tonic-gate * plus 256. 607c478bd9Sstevel@tonic-gate * 617c478bd9Sstevel@tonic-gate * These values have be registered 627c478bd9Sstevel@tonic-gate * with Unix International can't be corrected now. The status of a command 637c478bd9Sstevel@tonic-gate * as published or unpublished does not alter the algorithm. 647c478bd9Sstevel@tonic-gate */ 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gate /* UI defined `get' commands (1-256) */ 677c478bd9Sstevel@tonic-gate #define SI_SYSNAME 1 /* return name of operating system */ 687c478bd9Sstevel@tonic-gate #define SI_HOSTNAME 2 /* return name of node */ 697c478bd9Sstevel@tonic-gate #define SI_RELEASE 3 /* return release of operating system */ 707c478bd9Sstevel@tonic-gate #define SI_VERSION 4 /* return version field of utsname */ 717c478bd9Sstevel@tonic-gate #define SI_MACHINE 5 /* return kind of machine */ 727c478bd9Sstevel@tonic-gate #define SI_ARCHITECTURE 6 /* return instruction set arch */ 737c478bd9Sstevel@tonic-gate #define SI_HW_SERIAL 7 /* return hardware serial number */ 747c478bd9Sstevel@tonic-gate #define SI_HW_PROVIDER 8 /* return hardware manufacturer */ 757c478bd9Sstevel@tonic-gate #define SI_SRPC_DOMAIN 9 /* return secure RPC domain */ 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gate /* UI defined `set' commands (257-512) */ 787c478bd9Sstevel@tonic-gate #define SI_SET_HOSTNAME 258 /* set name of node */ 797c478bd9Sstevel@tonic-gate #define SI_SET_SRPC_DOMAIN 265 /* set secure RPC domain */ 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate /* Solaris defined `get' commands (513-768) */ 827c478bd9Sstevel@tonic-gate #define SI_PLATFORM 513 /* return platform identifier */ 837c478bd9Sstevel@tonic-gate #define SI_ISALIST 514 /* return supported isa list */ 847c478bd9Sstevel@tonic-gate #define SI_DHCP_CACHE 515 /* return kernel-cached DHCPACK */ 857c478bd9Sstevel@tonic-gate #define SI_ARCHITECTURE_32 516 /* basic 32-bit SI_ARCHITECTURE */ 867c478bd9Sstevel@tonic-gate #define SI_ARCHITECTURE_64 517 /* basic 64-bit SI_ARCHITECTURE */ 877c478bd9Sstevel@tonic-gate #define SI_ARCHITECTURE_K 518 /* kernel SI_ARCHITECTURE equivalent */ 887c478bd9Sstevel@tonic-gate #define SI_ARCHITECTURE_NATIVE 519 /* SI_ARCHITECTURE of the caller */ 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate /* Solaris defined `set' commands (769-1024) (none currently assigned) */ 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate 93*5679c89fSjv227347 #define HW_INVALID_HOSTID 0xFFFFFFFF /* an invalid hostid */ 94*5679c89fSjv227347 #define HW_HOSTID_LEN 11 /* minimum buffer size needed */ 95*5679c89fSjv227347 /* to hold a decimal or hex */ 96*5679c89fSjv227347 /* hostid string */ 97*5679c89fSjv227347 #define DOM_NM_LN 64 /* maximum length of domain */ 98*5679c89fSjv227347 /* name */ 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate #if !defined(_KERNEL) 1017c478bd9Sstevel@tonic-gate #if defined(__STDC__) 1027c478bd9Sstevel@tonic-gate int sysinfo(int, char *, long); 1037c478bd9Sstevel@tonic-gate #else 1047c478bd9Sstevel@tonic-gate int sysinfo(); 1057c478bd9Sstevel@tonic-gate #endif 1067c478bd9Sstevel@tonic-gate #endif 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1097c478bd9Sstevel@tonic-gate } 1107c478bd9Sstevel@tonic-gate #endif 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gate #endif /* _SYS_SYSTEMINFO_H */ 113