ethers ether_line ether_aton ether_aton_r ether_ntoa ether_ntoa_r ether_ntohost ether_hostton - Ethernet address conversion and lookup routines
Lb libc
/* * 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
Fa l ,
an
ASCII
string in
ethers(5)
format and sets
Fa e
to the ethernet address specified in the string and
Fa h
to the hostname.
This function is used to parse lines from
/etc/ethers
into their component parts.
The
ether_aton ();
and
ether_aton_r ();
functions convert
ASCII
representation of ethernet addresses into
Vt ether_addr
structures.
Likewise, the
ether_ntoa ();
and
ether_ntoa_r ();
functions
convert ethernet addresses specified as
Vt ether_addr
structures into
ASCII
strings.
The
ether_ntohost ();
and
ether_hostton ();
functions map ethernet addresses to their corresponding hostnames
as specified in the
/etc/ethers
database.
The
ether_ntohost ();
function
converts from ethernet address to hostname, and
ether_hostton ();
converts from hostname to ethernet address.
On success,
ether_ntoa ();
and
ether_ntoa_r ();
functions return a pointer to a string containing an
ASCII
representation of an ethernet address.
If it is unable to convert
the supplied
Vt ether_addr
structure, it returns a
NULL
pointer.
ether_ntoa ();
stores the result in a static buffer;
ether_ntoa_r ();
stores the result in a user-passed buffer.
Likewise,
ether_aton ();
and
ether_aton_r ();
return a pointer to an
Vt ether_addr
structure on success and a
NULL
pointer on failure.
ether_aton ();
stores the result in a static buffer;
ether_aton_r ();
stores the result in a user-passed buffer.
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.
ether_ntoa_r ();
accepts a character buffer pointer, but not a buffer length.
The caller must ensure adequate space is available in the buffer in order to
avoid a buffer overflow.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |