vni.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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "vni_impl.h"
#include <sys/ethernet.h>
static struct module_info minfo = {
VNIIDNUM, /* mi_idnum */
VNINAME, /* mi_idname */
VNIMINPSZ, /* mi_minpsz */
VNIMAXPSZ, /* mi_maxpsz */
VNIHIWAT, /* mi_hiwat */
VNILOWAT /* mi_lowat */
};
NULL, /* qi_putp */
NULL, /* qi_srvp */
vniopen, /* qi_qopen */
vniclose, /* qi_qclose */
NULL, /* qi_qadmin */
&minfo, /* qi_minfo */
NULL /* qi_mstat */
};
vniwput, /* qi_putp */
NULL, /* qi_srvp */
NULL, /* qi_qopen */
NULL, /* qi_qclose */
NULL, /* qi_qadmin */
&minfo, /* qi_minfo */
NULL /* qi_mstat */
};
&vnirinit, /* st_rdinit */
&vniwinit, /* st_wrinit */
NULL, /* st_muxrinit */
NULL /* st_muxwrinit */
};
"Virtual network interface %I%",
&vni_ops,
};
static struct modlinkage modlinkage = {
};
static dev_info_t *vni_dev_info;
static vni_str_t *vni_strlist_head;
/*
* DL_INFO_ACK template for VNI pseudo interface.
*/
static dl_info_ack_t dlvni_infoack = {
DL_INFO_ACK, /* dl_primitive */
0, /* dl_max_sdu */
0, /* dl_min_sdu */
0, /* dl_addr_length */
SUNW_DL_VNI, /* dl_mac_type */
0, /* dl_reserved */
0, /* dl_current_state */
0, /* dl_sap_length */
DL_CLDLS, /* dl_service_mode */
0, /* dl_qos_length */
0, /* dl_qos_offset */
0, /* dl_range_length */
0, /* dl_range_offset */
DL_STYLE2, /* dl_provider_style */
0, /* dl_addr_offset */
DL_VERSION_2, /* dl_version */
0, /* dl_brdcst_addr_length */
0, /* dl_brdcst_addr_offset */
0 /* dl_growth */
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}
int
{
}
static int
{
if (cmd != DDI_ATTACH) {
return (DDI_FAILURE);
}
DDI_FAILURE) {
return (DDI_FAILURE);
}
vni_dev_info = devi;
return (DDI_SUCCESS);
}
static int
{
if (cmd != DDI_DETACH)
return (DDI_FAILURE);
return (DDI_SUCCESS);
}
/* ARGSUSED */
static int
{
return (EINVAL);
break;
minordev++;
}
} else {
}
qprocson(q);
return (0);
}
/* ARGSUSED */
static int
{
qprocsoff(q);
/* Unlink the per-stream entry from the list and free it */
break;
}
return (0);
}
static int
{
union DL_primitives *dlp;
case M_PROTO:
case M_PCPROTO:
return (0);
}
switch (prim) {
case DL_ATTACH_REQ:
return (0);
}
0);
return (0);
}
break;
case DL_BIND_REQ:
return (0);
}
return (0);
}
break;
case DL_INFO_REQ:
return (0);
}
return (0);
}
*dlip = dlvni_infoack;
break;
case DL_PHYS_ADDR_REQ:
0);
return (0);
}
break;
case DL_UNBIND_REQ:
return (0);
}
0);
return (0);
}
/* Nothing to flush. But DLPI spec says to; so do it */
break;
case DL_DETACH_REQ:
return (0);
}
0);
return (0);
}
break;
default:
}
break;
case M_IOCTL:
/*
* No ioctl's currently supported. Need to have the NAK since
* ifconfig calls SIOCGTUNPARAM during the end of plumb
*/
break;
case M_FLUSH:
/* Really nothing to flush since no msgs enqueued */
} else {
}
break;
default:
break;
}
return (0);
}