vna.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"
/*
* This utility constitutes a private interface - it will be removed
* in a future release of Solaris. Neither users nor other software
* components can depend on the actions or existence of the utility.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/ethernet.h>
#include <libdlvnic.h>
/*ARGSUSED*/
static dladm_status_t
{
return (DLADM_STATUS_OK);
return (DLADM_STATUS_OK);
}
static int
v_list(void)
{
if (status != DLADM_STATUS_OK)
return (-1);
return (0);
}
static dladm_status_t
{
return (DLADM_STATUS_OK);
return (DLADM_STATUS_OK);
attr->va_mac_len) != 0)
return (DLADM_STATUS_OK);
return (DLADM_STATUS_EXIST);
}
static int
{
struct ether_addr *ea;
addr);
return (-1);
}
/*
* If a VNIC already exists over the specified device
* with this MAC address, use it.
*/
/*
* None found, so create.
*/
if (status != DLADM_STATUS_OK) {
char buf[DLADM_STRSIZE];
return (-1);
}
} else {
}
return (0);
}
static int
{
if (status != DLADM_STATUS_OK) {
char buf[DLADM_STRSIZE];
return (-1);
}
return (0);
}
int
{
switch (argc) {
case 1:
/* List operation. */
return (v_list());
/* NOTREACHED */
case 2:
/* Remove operation. */
/* NOTREACHED */
case 3:
/* Add operation. */
/* NOTREACHED */
default:
"must have 0, 1 or 2.\n");
return (-1);
/* NOTREACHED */
}
/* NOTREACHED */
}