dls_vlan.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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Data-Link Services Module
*/
#include <sys/sysmacros.h>
#include <sys/dls_impl.h>
static kmem_cache_t *i_dls_vlan_cachep;
static ght_t i_dls_vlan_hash;
/*
* Private functions.
*/
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
static void
{
}
/*
* Module initialization functions.
*/
void
dls_vlan_init(void)
{
int err;
/*
* Create a kmem_cache of dls_vlan_t structures.
*/
sizeof (dls_vlan_t), 0, i_dls_vlan_constructor,
/*
* Create a hash table, keyed by name, of dls_vlan_t.
*/
}
int
dls_vlan_fini(void)
{
int err;
/*
* If the hash table is not empty then this call will return EBUSY.
*/
return (err);
/*
* Destroy the kmem_cache.
*/
return (0);
}
/*
* Exported functions.
*/
int
{
int err;
/*
* Check to see the name is legal. It must be less than IFNAMSIZ
* characters in length and must terminate with a digit (before the
* NUL, of course).
*/
return (EINVAL);
return (EINVAL);
/*
* Get a reference to a dls_link_t representing the MAC. This call
* will create one if necessary.
*/
return (err);
/*
* If we're creating a tagged VLAN, grab a reference to the MAC.
* Strictly speaking, this is only needed for aggregations (so that
* they can't be deleted when there are configured VLAN's), but it
* doesn't hurt for other MAC's either.
*/
return (err);
}
/*
* Allocate a new dls_vlan_t.
*/
/*
* Allocate a new hash table entry.
*/
/*
* Insert the entry into the table.
*/
if (vid != 0)
goto done;
}
/*
* Create kstats.
*/
done:
return (err);
}
int
dls_vlan_destroy(const char *name)
{
int err;
/*
* Find the dls_vlan_t in the global hash table.
*/
goto done;
/*
* Check to see if it is referenced by any dls_t.
*/
goto done;
}
/*
* Destroy kstats before releasing dls_link_t and before destroying
* the dls_vlan_t to ensure ks_update is safe.
*/
/*
* Remove and destroy the hash table entry.
*/
/*
* If we're destroying a tagged VLAN, release the hold we acquired
* in dls_vlan_create().
*/
/*
* Free the dls_vlan_t back to the cache.
*/
/*
* Release the dls_link_t. This will destroy the dls_link_t and
* release the MAC if there are no more dls_vlan_t.
*/
done:
return (err);
}
int
{
int err;
goto done;
goto done;
goto done;
}
done:
return (err);
}
void
{
}