/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <sys/ethernet.h>
/*
* Store and retrieve local individual ethernet address.
* This is typically initialized (called with 'hint' nonnull)
* by the boot code.
*/
int
{
static int found = 0;
if (!found) {
return (0);
}
found = 1;
ether_sprintf(&addr));
}
return (1);
}
/*
* Convert Ethernet address to printable (loggable) representation.
*
* XXX This is not MT-safe, but its only race is for the "etherbuf".
*/
char *
{
return (etherbuf);
}
static int
{
return (dig - '0');
} else {
return (-1);
}
}
/*
* Convert Ethernet address from ascii to binary form.
* Return number of bytes written.
*/
int
{
int i = 0;
while (*cp != 0 && i < 6) {
if (*cp == ':') {
val = 0;
cp++;
continue;
}
}
return (i + 1);
}