inetddi.c revision 193974072f41a843678abf5f61979c748687e66b
/*
* 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.
*/
#include <sys/priv_names.h>
/*
* This file contains generic goo needed to hook the STREAMS modules and
* files for examples of this in action.
*
* The symbols that all modules and drivers must define are:
*
*
* The symbols that all modules must define are:
*
* INET_MODSTRTAB The name of the `streamtab' structure for this module.
* INET_MODDESC The one-line description for this module.
* INET_MODMTFLAGS The mt-streams(9F) flags for the module.
*
* The symbols that all drivers must define are:
*
* INET_DEVSTRTAB The name of the `streamtab' structure for this driver.
* INET_DEVDESC The one-line description for this driver.
* INET_DEVMTFLAGS The mt-streams(9F) flags for the driver.
* INET_DEVMINOR The minor number of the driver (usually 0).
*
* Drivers that need to masquerade as IP should set INET_DEVMTFLAGS to
* IP_DEVMTFLAGS and set INET_DEVSTRTAB to ipinfo.
*/
#if !defined(INET_NAME)
#endif
#ifdef INET_DEVDESC
extern struct streamtab INET_DEVSTRTAB;
/*
* Drivers that actually want to be IP would set INET_DEVSTRTAB to ipinfo.
*/
static dev_info_t *inet_dev_info;
#define INET_DEFAULT_PRIV_MODE 0666
static struct dev_priv {
char *driver;
int privonly;
const char *read_priv;
const char *write_priv;
} netdev_privs[] = {
};
static int
{
int i, ndevs;
if (cmd != DDI_ATTACH)
return (DDI_FAILURE);
for (i = 0; i < ndevs; i++) {
break;
}
}
static int
{
if (cmd != DDI_DETACH)
return (DDI_FAILURE);
return (DDI_SUCCESS);
}
/* ARGSUSED */
static int
{
int error = DDI_FAILURE;
switch (cmd) {
case DDI_INFO_DEVT2DEVINFO:
if (inet_dev_info != NULL) {
*result = (void *)inet_dev_info;
error = DDI_SUCCESS;
}
break;
case DDI_INFO_DEVT2INSTANCE:
error = DDI_SUCCESS;
break;
default:
break;
}
return (error);
}
};
#endif /* INET_DEVDESC */
#ifdef INET_MODDESC
extern struct streamtab INET_MODSTRTAB;
};
static struct modlstrmod modlstrmod = {
&fsw
};
#endif /* INET_MODDESC */
static struct modlinkage modlinkage = {
#ifdef INET_DEVDESC
&modldrv,
#endif
#ifdef INET_MODDESC
#endif
};