ETHER_ATON



ETHER_ATON

NAME
SYNOPSIS
DESCRIPTION
ATTRIBUTES
CONFORMING TO
BUGS
SEE ALSO
COLOPHON

NAME

ether_aton, ether_ntoa, ether_ntohost, ether_hostton, ether_line, ether_ntoa_r, ether_aton_r − Ethernet address manipulation routines

SYNOPSIS

#include <netinet/ether.h>

char *ether_ntoa(const struct ether_addr *addr);

struct ether_addr *ether_aton(const char *asc);

int ether_ntohost(char *hostname, const struct ether_addr *addr);

int ether_hostton(const char *hostname, struct ether_addr *addr);

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

/* GNU extensions */
char *ether_ntoa_r(const struct ether_addr *
addr, char *buf);

struct ether_addr *ether_aton_r(const char *asc,
struct ether_addr *
addr);

DESCRIPTION

ether_aton() converts the 48-bit Ethernet host address asc from the standard hex-digits-and-colons notation into binary data in network byte order and returns a pointer to it in a statically allocated buffer, which subsequent calls will overwrite. ether_aton() returns NULL if the address is invalid.

The ether_ntoa() function converts the Ethernet host address addr given in network byte order to a string in standard hex-digits-and-colons notation, omitting leading zeros. The string is returned in a statically allocated buffer, which subsequent calls will overwrite.

The ether_ntohost() function maps an Ethernet address to the corresponding hostname in /etc/ethers and returns nonzero if it cannot be found.

The ether_hostton() function maps a hostname to the corresponding Ethernet address in /etc/ethers and returns nonzero if it cannot be found.

The ether_line() function parses a line in /etc/ethers format (ethernet address followed by whitespace followed by hostname; '#' introduces a comment) and returns an address and hostname pair, or nonzero if it cannot be parsed. The buffer pointed to by hostname must be sufficiently long, for example, have the same length as line.

The functions ether_ntoa_r() and ether_aton_r() are reentrant thread-safe versions of ether_ntoa() and ether_aton() respectively, and do not use static buffers.

The structure ether_addr is defined in <net/ethernet.h> as:

struct ether_addr {
uint8_t ether_addr_octet[6];
}

ATTRIBUTES

Multithreading (see pthreads(7))
The ether_aton() and ether_ntoa() functions are not thread-safe.

The ether_ntohost(), ether_hostton(), ether_line(), ether_ntoa_r() and ether_aton_r() functions are thread-safe.

CONFORMING TO

4.3BSD, SunOS.

BUGS

The glibc 2.2.5 implementation of ether_line() is broken.

SEE ALSO

ethers(5)

COLOPHON

This page is part of release 3.69 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at http://www.kernel.org/doc/man−pages/.




More Linux Commands

manpages/gvfs.7.html
gvfs(7) GIO virtual file system (Misc - Linux man page).....
GIO provides a VFS API to GLib applications. It includes a local implementation using POSIX. gvfs provides implementations that go beyond that and allow to acce

manpages/Tcl_DStringSetLength.3.html
Tcl_DStringSetLength(3) - manipulate dynamic strings........
Dynamic strings provide a mechanism for building up arbitrarily long strings by gradually appending information. If the dynamic string is short then there will

manpages/ldap_abandon.3.html
ldap_abandon(3) - Abandon an LDAP operation in progress.....
The ldap_abandon_ext() routine is used to send a LDAP Abandon request for an operation in progress. The msgid passed should be the message id of an outstanding

manpages/Tcl_FSCreateDirectory.3.html
Tcl_FSCreateDirectory(3) - procedures to interact with any f
There are several reasons for calling the Tcl_FS API functions (e.g. Tcl_FSAccess and Tcl_FSStat) rather than calling system level functions like access and sta

manpages/ldap_control_find.3.html
ldap_control_find(3) - LDAP control manipulation routines...
These routines are used to manipulate structures used for LDAP controls. ldap_control_create() creates a control with the specified OID using the contents of th

manpages/ungetch.3ncurses.html
getch(3ncurses) - get (or push back) characters from curses
The getch, wgetch, mvgetch and mvwgetch, routines read a character from the window. In no-delay mode, if no input is waiting, the value ERR is returned. In dela

manpages/source.n.html
source(n) - Evaluate a file or resource as a Tcl script.....
This command takes the contents of the specified file or resource and passes it to the Tcl interpreter as a text script. The return value from source is the ret

manpages/SDL_UpdateRect.3.html
SDL_UpdateRect(3) - Makes sure the given area is updated on
Makes sure the given area is updated on the given screen. The rectangle must be confined within the screen boundaries (no clipping is done). If x, y, w and h ar

manpages/wmemset.3.html
wmemset(3) - fill an array of wide-characters with a constan
The wmemset() function is the wide-character equivalent of the memset(3) function. It fills the array of n wide-characters starting at wcs with n copies of the

manpages/mmount.1.html
mmount(1) - mount an MSDOS disk (Commands - Linux man page)
The mmount command is used to mount an MS-DOS disk. It is only available on Linux, as it is only useful if the OS kernel allows to configure the disk geometry.

manpages/Tcl_ExprLongObj.3.html
Tcl_ExprLongObj(3) - evaluate an expression - Linux man page
These four procedures all evaluate an expression, returning the result in one of four different forms. The expression is given by the objPtr argument, and it ca

manpages/pthread_setschedprio.3.html
pthread_setschedprio(3) - set scheduling priority of a threa
The pthread_setschedprio() function sets the scheduling priority of the thread thread to the value specified in prio. (By contrast pthread_setschedparam(3) chan





We can't live, work or learn in freedom unless the software we use is free.