KETHER_NTOA(9)

NAME
kether_ntoa, kether_aton - ethernet address conversion routines

SYNOPSIS
#include <net/if_var.h>
char *
kether_ntoa(const u_char *addr, char *buf);
u_char *
kether_aton(const char *macstr, u_char *addr);

DESCRIPTION
The kether_ntoa() function converts the ethernet address specified in addr to its corresponding hexadecimal ASCII representation. Likewise, the kether_aton() function converts an ASCII string specified in macstr to an ethernet address.

kether_ntoa() serves a similar purpose as the former, non-standard D conversion of kprintf(9) (as in, “%6D”) which some BSDs still have.

Notational conventions for hexadecimal ASCII representation of a MAC address are specified in IEEE 802.

RETURN VALUES
The kether_ntoa() function returns a pointer to the string containing the hexadecimal ASCII representation of the ethernet address passed in addr, or NULL in the case of failure.

The kether_aton() function returns a pointer to a block of bytes containing the conversion of the specified ASCII string in macstr, or NULL in the case of failure.

SEE ALSO
ascii(7), hexdump(9), hexncpy(9)

HISTORY
The kether_ntoa() and kether_aton() functions first appeared in DragonFly 3.3.