/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/ethernet.h>
#include <sys/vnet_common.h>
#include <sys/byteorder.h>
/* convert mac address from string to uint64_t */
{
int i;
for (i = 0; i < ETHERADDRL; i++) {
val <<= 8;
}
return (val);
}
/* convert mac address from uint64_t to string */
void
{
int i;
for (i = ETHERADDRL - 1; i >= 0; i--) {
value >>= 8;
}
}
mblk_t *
{
size_t n;
/* mblk has space to insert tag */
/*
* move src and dst mac addrs in the header back by VLAN_TAGSZ.
*/
/* now insert tpid and tci */
} else { /* no space in the mblk for tag */
/*
* allocate a mblk to create a new frame hdr with the tag
*/
BPRI_MED);
return (NULL);
}
/*
* copy the src and dst mac addrs in the header to the new mblk
*/
n = 2 * ETHERADDRL;
/* initialize the vlan tag in the new mblk */
/* copy ethertype to new mblk */
sizeof (evhp->ether_type));
/* skip over the header in the original mblk */
/* fix the end of frame header in the new mblk */
/*
* now link the new mblk which contains just the frame
* header with the original mblk which contains rest of
* the frame.
*/
}
return (mp);
}
mblk_t *
{
size_t n;
/* move src & dst addrs in the header forward by VLAN_TAGSZ */
} else {
/* allocate a new header */
return (NULL);
}
/*
* copy the src and dst mac addrs in the header to the new mblk
*/
n = 2 * ETHERADDRL;
/* skip over vlan tag and copy ethertype to new mblk */
sizeof (uint16_t));
/* skip over the header in the original mblk */
/* fix the end of frame header in the new mblk */
/*
* now link the new mblk which contains the frame header
* without vlan tag and the original mblk which contains rest
* of the frame.
*/
}
return (mp);
}
int
{
int rv;
return (rv);
return (rv);
}
int
{
int rv;
if (rv)
return (rv);
return (rv);
}