|
NAMEethers , ether_line ,
ether_aton , ether_aton_r ,
ether_ntoa , ether_ntoa_r ,
ether_ntohost , ether_hostton
—
Ethernet address conversion and lookup routines
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <sys/types.h>
#include <sys/socket.h>
#include <net/ethernet.h>
int
struct ether_addr *
struct ether_addr *
char *
char *
int
int
DESCRIPTIONThese functions operate on ethernet addresses using an ether_addr structure, which is defined in the header file<net/ethernet.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 The The RETURN VALUESTheether_line () function returns zero on success and
non-zero if it was unable to parse any part of the supplied line
l. It returns the extracted ethernet address in the
supplied ether_addr structure e
and the hostname in the supplied string h.
On success, Likewise, The NOTESThe user must ensure that the hostname strings passed to theether_line (), ether_ntohost ()
and ether_hostton () functions are large enough to
contain the returned hostnames.
NIS INTERACTIONIf the /etc/ethers contains a line with a single + in it, theether_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 ALSOethers(5), yp(8)HISTORYThis particular implementation of theethers library
functions were written for and first appeared in FreeBSD
2.1. Thread-safe function variants first appeared in
FreeBSD 7.0.
BUGSTheether_aton () and
ether_ntoa () functions returns values that are stored
in static memory areas which may be overwritten the next time they are called.
Visit the GSP FreeBSD Man Page Interface. |