/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* The lookup is based on the ipnetif nodes held
* in the ipnet module. We also override readdir
* in order to delete ipnet nodes no longer in use.
*/
#include <sys/sysmacros.h>
static void
{
*vap = sdev_vattr_chr;
gethrestime(&now);
}
/*
* Check if an ipnet sdev_node is still valid.
*/
int
{
return (SDEV_VTOR_INVALID);
return (SDEV_VTOR_STALE);
return (SDEV_VTOR_VALID);
}
/*
* This callback is invoked from devname_lookup_func() to create
* an ipnet entry when the node is not found in the cache.
*/
/*ARGSUSED*/
static int
{
int err = 0;
else
return (err);
}
/*
* If the entry does not exist, the devipnet_create_rvp() callback
* is invoked to create it. Nodes do not persist across reboot.
*/
/*ARGSUSED3*/
static int
{
int error;
if (error == 0) {
case VCHR:
break;
case VDIR:
break;
default:
break;
}
}
return (error);
}
static void
{
kcred, SDEV_READY) != 0)
return;
}
}
static void
{
/*
* We've been made a zombie while we weren't looking. We'll bail
* if that's the case.
*/
return;
}
}
/* validate and prune only ready nodes */
continue;
switch (devipnet_validate(dv)) {
case SDEV_VTOR_VALID:
case SDEV_VTOR_SKIP:
continue;
case SDEV_VTOR_INVALID:
case SDEV_VTOR_STALE:
sdcmn_err12(("devipnet_filldir: destroy invalid "
break;
}
continue;
/* remove the cache node */
}
}
/*
* Display all instantiated ipnet device nodes.
*/
/* ARGSUSED */
static int
{
if (uiop->uio_offset == 0)
}
/*
* We override lookup and readdir to build entries based on the
* in kernel ipnet table.
*/
};