nd.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1990 Mentat Inc. */
#pragma ident "%Z%%M% %I% %E% SMI"
/* Free the table pointed to by 'ndp' */
void
{
}
}
int
{
int err;
char *valp;
long avail;
if (!nd_param)
return (B_FALSE);
return (B_TRUE);
}
/*
* NOTE - logic throughout nd_xxx assumes single data block for ioctl.
* However, existing code sends in some big buffers.
*/
}
return (B_FALSE);
break;
}
while (*valp++)
noop;
case ND_GET:
/*
* (temporary) hack: "*valp" is size of user buffer for
* copyout. If result of action routine is too big, free
* excess and return ioc_rval as buffer size needed. Return
* as many mblocks as will fit, free the rest. For backward
* compatibility, assume size of original ioctl buffer if
* "*valp" bad or not given.
*/
if (valp)
{
while (mp2) {
}
}
if (!err) {
int size_out;
int excess;
/* Tack on the null */
if (excess > 0) {
}
}
break;
case ND_SET:
if (valp) {
== 0)) {
}
}
break;
default:
break;
}
return (B_TRUE);
}
/* ARGSUSED */
int
{
return (EACCES);
}
/*
* This routine may be used as the get dispatch routine in nd tables
* for long variables. To use this routine instead of a module
* specific routine, call nd_load as
* nd_load(&nd_ptr, "name", nd_get_long, set_pfi, &long_variable)
* The name of the variable followed by a space and the value of the
* variable will be printed in response to a get_status call.
*/
/* ARGSUSED */
int
{
return (0);
}
/* ARGSUSED */
int
{
char *rwtag;
if (!nd)
return (ENOENT);
if (get_ok) {
if (set_ok)
rwtag = "read and write";
else
rwtag = "read only";
} else if (set_ok)
rwtag = "write only";
else
rwtag = "no read or write";
}
return (0);
}
/*
* Load 'name' into the named dispatch table pointed to by 'ndp'.
* 'ndp' should be the address of a char pointer cell. If the table
* does not exist (*ndp == 0), a new table is allocated and 'ndp'
* is stuffed. If there is not enough space in the table for a new
* entry, more space is allocated.
*/
{
if (!nd_pparam)
return (B_FALSE);
return (B_FALSE);
}
goto fill_it;
}
}
return (B_FALSE);
} else {
nd->nd_free_count--;
}
}
noop;
nd->nd_free_count--;
return (B_TRUE);
}
/*
* Unload 'name' from the named dispatch table. If the table does not
* exist, I return. I do not free up space, but I do raise the
* free count so future nd_load()s don't take as much memory.
*/
void
{
/* My apologies for the in-boolean assignment. */
return;
if (foundit)
}
if (foundit)
}
/* ARGSUSED */
int
{
return (EACCES);
}
/* ARGSUSED */
int
{
long new_value;
return (EINVAL);
return (0);
}