etheraddr.c revision d62bc4badc1c1f1549c961cfb8b420e650e1272b
/*
* 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 <stdlib.h>
#include <stdio.h>
#include <strings.h>
#include <stropts.h>
#include <unistd.h>
#include <libdlpi.h>
#include <netdb.h>
#include "etheraddr.h"
/*
* get an individual arp entry
*/
int
{
struct sockaddr_in *sin;
int s;
return (-1);
}
/* LINTED pointer */
return (-1);
}
}
if (s < 0) {
return (-1);
}
(void) close(s);
return (-1);
}
(void) close(s);
} else
return (-1);
return (0);
}
/*
* Name: get_ethernet_address
*
* Description: Obtains the system ethernet address.
*
* Returns: 0 on success, non-zero otherwise. The system ethernet
* address is copied into the passed-in variable.
*/
int
{
return (0);
/*
* Try to get physical (ethernet) address from network interfaces.
*/
if (state.wa_addrvalid)
}
/*
* Get the physical address via DLPI and update the flag to true upon success.
*/
static boolean_t
{
int retval;
return (B_FALSE);
dlpi_close(dh);
if (retval == DLPI_SUCCESS) {
return (B_TRUE);
}
return (B_FALSE);
}