Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

eui64_hostton(3) [freebsd man page]

EUI64(3)						   BSD Library Functions Manual 						  EUI64(3)

NAME
eui64, eui64_aton, eui64_ntoa, eui64_ntohost, eui64_hostton -- IEEE EUI-64 conversion and lookup routines LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #include <sys/eui64.h> int eui64_aton(const char *a, struct eui64 *e); int eui64_ntoa(const struct eui64 *id, char *a, size_t len); int eui64_ntohost(char *hostname, size_t len, const struct eui64 *id); int eui64_hostton(const char *hostname, struct eui64 *id); DESCRIPTION
These functions operate on IEEE EUI-64s using an eui64 structure, which is defined in the header file <sys/eui64.h>: /* * The number of bytes in an EUI-64. */ #define EUI64_LEN 8 /* * Structure of an IEEE EUI-64. */ struct eui64 { u_char octet[EUI64_LEN]; }; The eui64_aton() function converts an ASCII representation of an EUI-64 into an eui64 structure. Likewise, eui64_ntoa() converts an EUI-64 specified as an eui64 structure into an ASCII string. The eui64_ntohost() and eui64_hostton() functions map EUI-64s to their corresponding hostnames as specified in the /etc/eui64 database. The eui64_ntohost() function converts from EUI-64 to hostname, and eui64_hostton() converts from hostname to EUI-64. RETURN VALUES
On success, eui64_ntoa() returns a pointer to a string containing an ASCII representation of an EUI-64. If it is unable to convert the sup- plied eui64 structure, it returns a NULL pointer. Likewise, eui64_aton() returns a pointer to an eui64 structure on success and a NULL pointer on failure. The eui64_ntohost() and eui64_hostton() functions both return zero on success or non-zero if they were unable to find a match in the /etc/eui64 database. NOTES
The user must ensure that the hostname strings passed to the eui64_ntohost() and eui64_hostton() functions are large enough to contain the returned hostnames. NIS INTERACTION
If the /etc/eui64 contains a line with a single '+' in it, the eui64_ntohost() and eui64_hostton() functions will attempt to consult the NIS eui64.byname and eui64.byid maps in addition to the data in the /etc/eui64 file. SEE ALSO
firewire(4), eui64(5), yp(8) HISTORY
These functions first appears in FreeBSD 5.3. They are derived from the ethers(3) family of functions. BSD
March 4, 2004 BSD

Check Out this Related Man Page

ETHERS(3)						   BSD Library Functions Manual 						 ETHERS(3)

NAME
ethers, ether_line, ether_aton, ether_ntoa, ether_ntohost, ether_hostton -- Ethernet address conversion and lookup routines LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #include <sys/socket.h> #include <net/ethernet.h> int ether_line(const char *l, struct ether_addr *e, char *hostname); struct ether_addr * ether_aton(const char *a); char * ether_ntoa(const struct ether_addr *n); int ether_ntohost(char *hostname, const struct ether_addr *e); int ether_hostton(const char *hostname, struct ether_addr *e); DESCRIPTION
These functions operate on ethernet addresses using an ether_addr structure, which is defined in the header file <netinet/if_ether.h>: /* * The number of bytes in an ethernet (MAC) address. */ #define ETHER_ADDR_LEN 6 /* * Structure of a 48-bit Ethernet address. */ struct ether_addr { u_char octet[ETHER_ADDR_LEN]; }; The function ether_line() scans l, an ASCII string in ethers(5) format and sets e to the ethernet address specified in the string and h to the hostname. This function is used to parse lines from /etc/ethers into their component parts. The ether_aton() function converts an ASCII representation of an ethernet address into an ether_addr structure. Likewise, ether_ntoa() con- verts an ethernet address specified as an ether_addr structure into an ASCII string. The ether_ntohost() and ether_hostton() functions map ethernet addresses to their corresponding hostnames as specified in the /etc/ethers database. ether_ntohost() converts from ethernet address to hostname, and ether_hostton() converts from hostname to ethernet address. RETURN VALUES
ether_line() returns zero on success and non-zero if it was unable to parse any part of the supplied line l. It returns the extracted ether- net address in the supplied ether_addr structure e and the hostname in the supplied string h. On success, ether_ntoa() returns a pointer to a string containing an ASCII representation of an ethernet address. If it is unable to convert the supplied ether_addr structure, it returns a NULL pointer. Likewise, ether_aton() returns a pointer to an ether_addr structure on success and a NULL pointer on failure. The ether_ntohost() and ether_hostton() functions both return zero on success or non-zero if they were unable to find a match in the /etc/ethers database. NOTES
The user must insure that the hostname strings passed to the ether_line(), ether_ntohost() and ether_hostton() functions are large enough to contain the returned hostnames. NIS INTERACTION
If the /etc/ethers contains a line with a single + in it, the ether_ntohost() and ether_hostton() functions will attempt to consult the NIS ethers.byname and ethers.byaddr maps in addition to the data in the /etc/ethers file. SEE ALSO
yp(8), ethers(5) BUGS
The ether_aton() and ether_ntoa() functions returns values that are stored in static memory areas which may be overwritten the next time they are called. HISTORY
This particular implementation of the ethers library functions were written for and first appeared in FreeBSD 2.1. BSD
April 12, 1995 BSD
Man Page