systeminfo.c revision fa9e4066f08beec538e775443c5be79dd423fcab
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All rights reserved. */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <sys/tuneable.h>
#include <sys/systeminfo.h>
#include <sys/bootconf.h>
static void get_netif_name(char *, char *);
long
{
int error = 0;
char *kstr;
/*
* Deal with the common "get a string" case first.
*/
switch (command) {
case SI_SYSNAME:
break;
case SI_HOSTNAME:
kstr = uts_nodename();
break;
case SI_RELEASE:
break;
case SI_VERSION:
break;
case SI_MACHINE:
break;
#ifdef _LP64
case SI_ARCHITECTURE_64:
case SI_ARCHITECTURE_K:
kstr = architecture;
break;
case SI_ARCHITECTURE_32:
case SI_ARCHITECTURE:
break;
case SI_ARCHITECTURE_NATIVE:
break;
#else
case SI_ARCHITECTURE_K:
case SI_ARCHITECTURE_32:
case SI_ARCHITECTURE:
case SI_ARCHITECTURE_NATIVE:
kstr = architecture;
break;
#endif
case SI_HW_SERIAL:
break;
case SI_HW_PROVIDER:
kstr = hw_provider;
break;
case SI_SRPC_DOMAIN:
break;
case SI_PLATFORM:
break;
case SI_ISALIST:
break;
default:
break;
}
} else
return (strcnt + 1);
}
switch (command) {
case SI_DHCP_CACHE:
{
char *tmp;
tmp = "";
strcnt = 0;
} else {
/*
* If the interface name has not yet been resolved
* (first IFNAMSIZ bytes of dhcack[]) and a valid
* netdev_path[] was stashed by loadrootmodules in
* swapgeneric.c, resolve the interface name now.
*/
if (dhcack[0] == '\0' &&
}
}
break;
}
break;
}
return (strcnt + 1);
}
case SI_SET_HOSTNAME:
{
char *name_to_use;
break;
name_to_use = uts_nodename();
break;
/*
* Must be non-NULL string and string
* must be less than SYS_NMLN chars.
*/
break;
}
/*
* Copy the name into the relevant zone's nodename.
*/
/*
* Notify other interested parties that the nodename was set
*/
nodename_set();
return (len);
}
case SI_SET_SRPC_DOMAIN:
{
break;
break;
/*
* If string passed in is longer than length
* allowed for domain name, fail.
*/
break;
}
return (len);
}
default:
break;
}
}
/*
* i_path_find_node: Internal routine used by path_to_devinfo
* to locate a given nodeid in the device tree.
*/
struct i_path_findnode {
};
static int
{
return (DDI_WALK_TERMINATE);
}
return (DDI_WALK_CONTINUE);
}
/*
* Return the devinfo node to a boot device
*/
static dev_info_t *
path_to_devinfo(char *path)
{
struct i_path_findnode fn;
extern dev_info_t *top_devinfo;
/*
* Get the nodeid of the given pathname, if such a mapping exists.
*/
/*
* Find the nodeid in our copy of the device tree and return
* whatever name we used to bind this node to a driver.
*/
}
}
/*
* Determine the network interface name from the device path argument.
*/
static void
{
char *name;
int unit;
"can't bind driver for '%s'\n", devname);
return;
}
if (ndev == -1) {
"no driver bound to '%s'\n", devname);
return;
}
"no name for major number %d\n", ndev);
return;
}
if (unit < 0) {
"illegal unit number %d\n", unit);
return;
}
}