diff options
| author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-12-10 15:10:57 +0000 |
|---|---|---|
| committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-12-10 15:10:57 +0000 |
| commit | 7fe677c6d31a6fd854eaf64609d72b8613ca36ea (patch) | |
| tree | 4c65df7c08e0730d0686b169545be93177080810 /libc/inet/ether_addr.c | |
| parent | eb853014235c86b33318f16e205ff2f818e5a67c (diff) | |
| download | uClibc-alpine-7fe677c6d31a6fd854eaf64609d72b8613ca36ea.tar.bz2 uClibc-alpine-7fe677c6d31a6fd854eaf64609d72b8613ca36ea.tar.xz | |
Merge from trunk.
Diffstat (limited to 'libc/inet/ether_addr.c')
| -rw-r--r-- | libc/inet/ether_addr.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/libc/inet/ether_addr.c b/libc/inet/ether_addr.c index fb58e148d..0a1e2aede 100644 --- a/libc/inet/ether_addr.c +++ b/libc/inet/ether_addr.c @@ -32,14 +32,7 @@ #include <netinet/ether.h> #include <netinet/if_ether.h> -struct ether_addr *ether_aton(const char *asc) -{ - static struct ether_addr result; - - return ether_aton_r(asc, &result); -} - -struct ether_addr *ether_aton_r(const char *asc, struct ether_addr *addr) +struct ether_addr attribute_hidden *__ether_aton_r(const char *asc, struct ether_addr *addr) { size_t cnt; @@ -75,19 +68,28 @@ struct ether_addr *ether_aton_r(const char *asc, struct ether_addr *addr) return addr; } +strong_alias(__ether_aton_r,ether_aton_r) -char *ether_ntoa(const struct ether_addr *addr) +struct ether_addr *ether_aton(const char *asc) { - static char asc[18]; + static struct ether_addr result; - return ether_ntoa_r(addr, asc); + return __ether_aton_r(asc, &result); } -char *ether_ntoa_r(const struct ether_addr *addr, char *buf) +char attribute_hidden *__ether_ntoa_r(const struct ether_addr *addr, char *buf) { - sprintf(buf, "%x:%x:%x:%x:%x:%x", + __sprintf(buf, "%x:%x:%x:%x:%x:%x", addr->ether_addr_octet[0], addr->ether_addr_octet[1], addr->ether_addr_octet[2], addr->ether_addr_octet[3], addr->ether_addr_octet[4], addr->ether_addr_octet[5]); return buf; } +strong_alias(__ether_ntoa_r,ether_ntoa_r) + +char *ether_ntoa(const struct ether_addr *addr) +{ + static char asc[18]; + + return __ether_ntoa_r(addr, asc); +} |
