forked from Imagelibrary/rtems
Install working version of ether_sprintf().
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2004-10-25 Eric Norum <norume@aps.anl.gov>
|
||||
|
||||
* libchip/network/i82586.c: ether_sprintf() is part of networking library.
|
||||
|
||||
2004-10-22 Ralf Corsepius <ralf_corsepius@rtems.org>
|
||||
|
||||
* alocal/check-custom-bsp.m4: Reflect new location of bspkit*cfg.
|
||||
|
||||
@@ -263,22 +263,6 @@ char *bitmask_snprintf(unsigned long value, const char *format, char *buf, int b
|
||||
return buf;
|
||||
}
|
||||
|
||||
char *ether_sprintf(unsigned char *addr)
|
||||
{
|
||||
static char buf[32];
|
||||
char *b = buf;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ETHER_ADDR_LEN; i++)
|
||||
{
|
||||
sprintf(b, "%02x:", *addr++);
|
||||
b += 3;
|
||||
}
|
||||
b--;
|
||||
b = "\0";
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
* Front-ends call this function to attach to the MI driver.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2004-10-25 Eric Norum <norume@aps.anl.gov>
|
||||
|
||||
* libnetworking/net/if_ethersubr.c: Working version of ether_sprintf().
|
||||
|
||||
2004-10-22 Ralf Corsepius <ralf_corsepius@rtems.org>
|
||||
|
||||
* libnetworking/Makefile.am: Reflect changes below.
|
||||
|
||||
@@ -512,18 +512,20 @@ ether_input(ifp, eh, m)
|
||||
|
||||
/*
|
||||
* Convert Ethernet address to printable (loggable) representation.
|
||||
* This routine is for compatibility; it's better to just use
|
||||
*
|
||||
* printf("%6D", <pointer to address>, ":");
|
||||
*
|
||||
* since there's no static buffer involved.
|
||||
* The static buffer isn't a really huge problem since this code
|
||||
* is protected by the RTEMS network mutex.
|
||||
*/
|
||||
char *
|
||||
ether_sprintf(const u_char *ap)
|
||||
ether_sprintf(const u_int8_t *addr)
|
||||
{
|
||||
static char etherbuf[18];
|
||||
snprintf(etherbuf, sizeof (etherbuf), "%6D", ap, ":");
|
||||
return (etherbuf);
|
||||
static char buf[32];
|
||||
char *b = buf;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ETHER_ADDR_LEN; i++, b+=3)
|
||||
sprintf(b, "%02x:", *addr++);
|
||||
*--b = '\0';
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user