vnic_cl.c revision 843e19887f64dde75055cf8842fc4db2171eff45
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/vnic_impl.h>
/*
* Virtual Network Interface Card (VNIC) classification.
*
* The VNIC implements a software classifier which is used to steer
* traffic (locally and externally generated) to the appropriate VNIC
* based on MAC addresses.
*/
static kmem_cache_t *vnic_flow_cache;
static kmem_cache_t *vnic_flow_tab_cache;
/* ARGSUSED */
static int
{
return (0);
}
/* ARGSUSED */
static void
{
}
/* ARGSUSED */
static int
{
return (0);
}
/* ARGSUSED */
static void
{
}
void
vnic_classifier_init(void)
{
sizeof (vnic_flow_t), 0, vnic_classifier_flow_ctor,
sizeof (vnic_flow_tab_t), 0, vnic_classifier_flow_tab_ctor,
}
void
vnic_classifier_fini(void)
{
}
int
int km_flag)
{
return (ENOMEM);
vnic_mac);
return (0);
}
void
{
}
{
return (NULL);
return (flow);
}
void
{
}
void
{
/* initialize the flow structure */
/* add to the flow table */
;
}
void
{
/* unlink from list */
;
/* wait for all references to the flow to go away */
}
void
{
}
void
{
}
{
return (NULL);
flow_tab->vt_addr_len) == 0) {
break;
}
}
return (flow);
}
void *
{
}
{
return (&flow->vf_fn_info);
}
{
return (flow->vf_is_active);
}
/*
* Receive function registered with the MAC layer. Classifies
* the packets, i.e. finds the flows matching the packets passed
* as argument, and invokes the callback functions associated with
* these flows.
*/
/*ARGSUSED*/
static void
{
const vnic_flow_fn_info_t *fn_info;
} else {
if (flow->vf_is_active) {
/*
* Inbound packets are delivered to the
* active MAC through mac_rx() of the
* the NIC.
*/
} else {
/*
* If the vnic to which we would
* deliver this packet is in
* promiscuous mode then it already
* received the packet via
* vnic_promisc_rx().
*
* XXX assumes that ff_arg2 is a
* vnic_t pointer if it is non-NULL
* (currently always true).
*/
} else {
}
}
}
}
}