ETHERS(3N-BSD) RISC/os Reference Manual ETHERS(3N-BSD)
NAME
ethers: ether_ntoa, ether_aton, ether_ntohost,
ether_hostton, ether_line - Ethernet address mapping
operations
SYNOPSIS
Headers
For -systype svr3:
#include <sys/types.h>
#include <bsd/sys/socket.h>
#include <bsd/net/if.h>
#include <bsd/netinet/in.h>
#include <bsd/netinet/if_ether.h>
For -systype bsd43:
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
Declarations
char *
ether_ntoa(e)
struct ether_addr *e;
struct ether_addr *
ether_aton(s)
char *s;
ether_ntohost(hostname, e)
char *hostname;
struct ether_addr *e;
ether_hostton(hostname, e)
char *hostname;
struct ether_addr *e;
ether_line(l, e, hostname)
char *l;
struct ether_addr *e;
char *hostname;
DESCRIPTION
These routines are useful for mapping 48 bit Ethernet
numbers to their ASCII representations or their correspond-
ing host names, and vice versa.
The function ether_ntoa converts a 48 bit Ethernet number
pointed to by e to its standard ASCII representation; it
returns a pointer to the ASCII string. The representation
is of the form: ``x:x:x:x:x:x'' where x is a hexadecimal
number between 0 and ff. The function ether_aton converts
Printed 11/19/92 Page 1
ETHERS(3N-BSD) RISC/os Reference Manual ETHERS(3N-BSD)
an ASCII string in the standard representation back to a 48
bit Ethernet number; the function returns NULL if the
string cannot be scanned successfully.
The function ether_ntohost maps an Ethernet number (pointed
to by e) to its associated hostname. The string pointed to
by hostname must be long enough to hold the hostname and a
null character. The function returns zero upon success and
non-zero upon failure. Inversely, the function
ether_hostton maps a hostname string to its corresponding
Ethernet number; the function modifies the Ethernet number
pointed to by e. The function also returns zero upon suc-
cess and non-zero upon failure.
The function ether_line scans a line (pointed to by l) and
sets the hostname and the Ethernet number (pointed to by e).
The string pointed to by hostname must be long enough to
hold the hostname and a null character. The function
returns zero upon success and non-zero upon failure. The
format of the scanned line is described by ethers(4).
FILES
/etc/ethers (or the Network Information Service maps
ethers.byaddr and ethers.byname)
SEE ALSO
ethers(4).
NOTE
When these routines are used in a program which is compiled
in -systype svr3, they are not resolved by libc.a. See
intro(3) for more information.
Page 2 Printed 11/19/92