3 * linkntoa.c - link level address printing
5 * Copyright © 1994 AmiTCP/IP Group,
6 * Network Solutions Development Inc.
9 * Copyright © 1991 Regents of the University of California.
12 #include <sys/types.h>
13 #include <sys/socket.h>
15 #include <net/if_dl.h>
18 static char hexlist
[] = "0123456789abcdef";
22 register const struct sockaddr_dl
*sdl
;
25 register char *out
= obuf
;
27 register u_char
*in
= (u_char
*)LLADDR(sdl
);
28 u_char
*inlim
= in
+ sdl
->sdl_alen
;
32 bcopy(sdl
->sdl_data
, obuf
, sdl
->sdl_nlen
);
37 if (firsttime
) firsttime
= 0; else *out
++ = '.';
40 out
[1] = hexlist
[i
& 0xf];