diff options
Diffstat (limited to 'addrtoname.c')
-rw-r--r-- | addrtoname.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/addrtoname.c b/addrtoname.c index 29826dfbc7e2..d77f27b0ac4f 100644 --- a/addrtoname.c +++ b/addrtoname.c @@ -508,6 +508,34 @@ etheraddr_string(register const u_char *ep) } const char * +le64addr_string(const u_char *ep) +{ + const unsigned int len = 8; + register u_int i; + register char *cp; + register struct enamemem *tp; + char buf[BUFSIZE]; + + tp = lookup_bytestring(ep, len); + if (tp->e_name) + return (tp->e_name); + + cp = buf; + for (i = len; i > 0 ; --i) { + *cp++ = hex[*(ep + i - 1) >> 4]; + *cp++ = hex[*(ep + i - 1) & 0xf]; + *cp++ = ':'; + } + cp --; + + *cp = '\0'; + + tp->e_name = strdup(buf); + + return (tp->e_name); +} + +const char * linkaddr_string(const u_char *ep, const unsigned int type, const unsigned int len) { register u_int i; |