summaryrefslogtreecommitdiff
path: root/sal/osl/unx/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'sal/osl/unx/util.c')
-rw-r--r--sal/osl/unx/util.c77
1 files changed, 1 insertions, 76 deletions
diff --git a/sal/osl/unx/util.c b/sal/osl/unx/util.c
index c0b9e3c5aa09..66746fd3ff44 100644
--- a/sal/osl/unx/util.c
+++ b/sal/osl/unx/util.c
@@ -51,11 +51,10 @@
static int osl_getHWAddr(const char *ifname, char* hard_addr);
static int osl_checkAddr(const char* addr);
-static char* osl_decodeEtherAddr(const char *ptr, char* buff);
/*****************************************************************************/
-/* osl_getEtherAddr */
+/* osl_getEthernetAddress */
/*****************************************************************************/
sal_Bool SAL_CALL osl_getEthernetAddress( sal_uInt8 * pAddr )
@@ -124,68 +123,6 @@ sal_Bool SAL_CALL osl_getEthernetAddress( sal_uInt8 * pAddr )
}
-extern sal_Bool osl_getEtherAddr(sal_Char* pszAddr, sal_uInt16 BufferSize)
-{
- char buff[1024];
- char hard_addr[64];
- struct ifconf ifc;
- struct ifreq *ifr;
- int i;
- int so;
-
- (void) BufferSize; /* unused */
-
- if ( pszAddr == 0 )
- {
- return sal_False;
- }
-
-
- /*
- * All we need is ... a network file descriptor.
- * Normally, this is a very socket.
- */
-
- so = socket(AF_INET, SOCK_DGRAM, 0);
-
-
- /*
- * The first thing we have to do, get the interface configuration.
- * It is a list of attached/configured interfaces
- */
-
- ifc.ifc_len = sizeof(buff);
- ifc.ifc_buf = buff;
- if ( ioctl(so, SIOCGIFCONF, &ifc) < 0 )
- {
-/* fprintf(stderr, "SIOCGIFCONF: %s\n", strerror(errno));*/
- close(so);
- return sal_False;
- }
-
- close(so);
-
- /*
- * For each of the interfaces in the interface list,
- * try to get the hardware address
- */
-
- ifr = ifc.ifc_req;
- for ( i = ifc.ifc_len / sizeof(struct ifreq) ; --i >= 0 ; ifr++ )
- {
- int nRet=0;
- nRet = osl_getHWAddr(ifr->ifr_name,hard_addr);
- if ( nRet > 0 )
- {
- osl_decodeEtherAddr(hard_addr,pszAddr);
- return sal_True;
- }
- }
-
- return sal_False;
-}
-
-
/*****************************************************************************/
/* osl_getHWAddr */
/*****************************************************************************/
@@ -285,18 +222,6 @@ static int osl_checkAddr(const char* addr)
}
-/*****************************************************************************/
-/* osl_decodeEtherAddr */
-/*****************************************************************************/
-
-static char* osl_decodeEtherAddr(const char *ptr, char* buff)
-{
- sprintf(buff, "%02X:%02X:%02X:%02X:%02X:%02X",
- (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
- (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377));
- return(buff);
-}
-
#if defined (SPARC)
#if defined (SOLARIS) && !defined(__sparcv8plus) && !defined(__sparcv9)