*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> ether_aton (3)              



NAME    [Toc]    [Back]

     ether_ntoa, ether_aton, ether_ntohost, ether_hostton, ether_line, - get
     ethers entry

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #include <net/if_ether.h>

     char *
     ether_ntoa(struct ether_addr *e);

     struct ether_addr *
     ether_aton(const char *s);

     ether_ntohost(char *hostname, struct ether_addr *e);

     ether_hostton(const char *hostname, struct ether_addr *e);

     ether_line(const char *line, struct ether_addr *e, char *hostname);

DESCRIPTION    [Toc]    [Back]

     Ethernet addresses are represented by the following structure:

           struct ether_addr {
                   u_char  ether_addr_octet[6];

     The ether_ntoa() function converts this structure into an ASCII string of
     the form ``xx:xx:xx:xx:xx:xx'', consisting of 6 hexadecimal numbers separated
 by colons.  It returns a pointer to a static buffer that is reused
     for each call.  The ether_aton() converts an ASCII string of the same
     form and to a structure containing the 6 octets of the address.  It
     returns a pointer to a static structure that is reused for each call.

     The ether_ntohost() and ether_hostton() functions interrogate the data
     base mapping host names to Ethernet addresses, /etc/ethers.  The
     ether_ntohost() function looks up the given Ethernet address and writes
     the associated host name into the character buffer passed.  The
     ether_hostton() function looks up the given host name and writes the
     associated Ethernet address into the structure passed.  Both functions
     return zero if they find the requested host name or address, and -1 if
     not.  Each call reads /etc/ethers from the beginning; if a + appears
     alone on a line in the file, then ether_hostton() will consult the
     ethers.byname YP map, and ether_ntohost() will consult the ethers.byaddr
     YP map.

     The ether_line() function parses a line from the /etc/ethers file and
     fills in the passed ``struct ether_addr'' and character buffer with the
     Ethernet address and host name on the line.  It returns zero if the line
     was successfully parsed and -1 if not.

     The hostname buffer for ether_line() and ether_ntohost() should be at
     least MAXHOSTNAMELEN + 1 characters long, to prevent a buffer overflow
     during parsing.

FILES    [Toc]    [Back]


SEE ALSO    [Toc]    [Back]


HISTORY    [Toc]    [Back]

     The ether_ntoa(), ether_aton(), ether_ntohost(), ether_hostton(), and
     ether_line() functions were adopted from SunOS and appeared in
     NetBSD 1.0.

BUGS    [Toc]    [Back]

     The data space used by these functions is static; if future use requires
     the data, it should be copied before any subsequent calls to these functions
 overwrite it.

BSD                            November 2, 1997                            BSD
[ Back ]
 Similar pages
Name OS Title
rpccp_add_element HP-UX Adds an element to a profile in a name service entry; if the specified entry does not exist, creates the entry
rpccp_add_member HP-UX Adds a member to a group in a name service entry; if the specified entry does not exist, creates the entry
DXmSvnFlushEntry Tru64 Displays the specified entry on the screen if it is the next logically displayed entry.
DXmSvnGetEntryNumber Tru64 Retrieves (returns) an entry number for a specified entry tag value.
acl_get_tag_type Tru64 Retrieves the entry tag type identifier for an ACL entry
csa_list_entry_attributes HP-UX list the names of the entry attributes associated with the specified entry
acl_first_entry Tru64 Resets the current ACL entry to be the first ACL entry
csa_read_entry_attributes HP-UX read and return the calendar entry attribute values for a specified calendar entry
acl_copy_entry FreeBSD copy an ACL entry to another ACL entry
DXmSvnSetEntryTag Tru64 Assigns an entry tag to a specified entry.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service