libdllink.c revision f595a68a3b8953a12aa778c2abd7642df8da8c3a
/*
* 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 <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <strings.h>
#include <libdlpi.h>
#include <libdevinfo.h>
#include <libdllink.h>
#include <libdladm_impl.h>
typedef struct dladm_dev {
} dladm_dev_t;
typedef struct dladm_walk {
} dladm_walk_t;
/*
* Return the attributes of the specified datalink from the DLD driver.
*/
static int
{
return (-1);
}
return (-1);
return (0);
}
/*
* Adds a datalink to the array corresponding to arg.
*/
static void
{
while (ddp) {
/*
* Skip duplicates.
*/
return;
}
return;
}
/*
* Walker callback invoked for each DDI_NT_NET node.
*/
static int
{
char linkname[DLPI_LINKNAME_MAX];
return (DI_WALK_CONTINUE);
dlpi_close(dh);
}
return (DI_WALK_CONTINUE);
}
/*
* Hold a data-link.
*/
static int
{
int fd;
return (-1);
}
return (-1);
return (-1);
}
return (0);
}
/*
* Release a data-link.
*/
static int
{
int fd;
return (-1);
}
return (-1);
return (-1);
}
return (0);
}
/*
* Invoke the specified callback function for each active DDI_NT_NET
* node.
*/
int
{
return (-1);
}
while (ddp) {
}
return (0);
}
/*
* MAC Administration Library.
*
* This library is used by administration tools such as dladm(1M) to
* iterate through the list of MAC interfaces
*
*/
typedef struct dladm_mac_dev {
char dm_name[MAXNAMELEN];
struct dladm_mac_dev *dm_next;
typedef struct macadm_walk {
/*
* Local callback invoked for each DDI_NT_NET node.
*/
/* ARGSUSED */
static int
{
char mac[MAXNAMELEN];
/*
* Skip aggregations.
*/
return (DI_WALK_CONTINUE);
while (dmdp) {
/*
* Skip duplicates.
*/
return (DI_WALK_CONTINUE);
}
return (DI_WALK_CONTINUE);
return (DI_WALK_CONTINUE);
}
/*
* Invoke the specified callback for each DDI_NT_MAC node.
*/
int
{
return (-1);
}
return (0);
}
/*
* Returns the current attributes of the specified datalink.
*/
int
{
int fd;
return (-1);
goto failed;
return (0);
return (-1);
}
const char *
{
const char *s;
switch (state) {
case LINK_STATE_UP:
s = "up";
break;
case LINK_STATE_DOWN:
s = "down";
break;
default:
s = "unknown";
break;
}
return (buf);
}
const char *
{
const char *s;
switch (duplex) {
case LINK_DUPLEX_FULL:
s = "full";
break;
case LINK_DUPLEX_HALF:
s = "half";
break;
default:
s = "unknown";
break;
}
return (buf);
}
/*
* Do a "hold" operation to a link.
*/
int
{
}
/*
* Do a "release" operation to a link.
*/
int
{
}