Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ip(2) [plan9 man page]

IP(2)								System Calls Manual							     IP(2)

NAME
eipconv, parseip, parseether, myipaddr, myetheraddr, maskip, equivip - Internet protocol SYNOPSIS
#include <u.h> #include <libc.h> #include <ip.h> int eipconv(void *o, int f1, int f2, int f3, int chr) int parseip(uchar *ipaddr, char *str) int parseether(uchar *eaddr, char *str) int myipaddr(uchar *ipaddr, char *net) int myetheraddr(uchar *eaddr, char *net) void maskip(uchar *from, uchar *mask, uchar *to) int equivip(uchar *ipaddr1, uchar *ipaddr2) DESCRIPTION
These routines are used by Internet Protocol (IP) programs to manipulate IP and Ethernet addresses. IP addresses are stored as a string of 4 unsigned chars, Ethernet addresses as 6 unsigned chars. The string representation of IP addresses is (up to) 4 decimal integers from 0 to 255 separated by periods. The string representation of Ethernet addresses is exactly 12 hexadecimal digits. Eipconv is a print(2) formatter for Ethernet (verb E) and Internet protocol (verb I) addresses. Parseip converts a string pointed to by str to a 4-byte IP address starting at ipaddr. Myipaddr reads the IP address string from file /net/1/local and parses it into ipaddr. Both routines return a negative number on errors. Parseether converts a string pointed to by str to a 6 byte Ethernet address starting at eaddr. Myetheraddr reads the Ethernet address string from file net/1/stats and parses it into eaddr. Both routines return a negative number on errors. Maskip places the bit-wise AND of the IP addresses pointed to by its first two arguments into the buffer pointed to by the third. Equivip returns non-zero if the IP addresses pointed to by its two arguments are equal. SOURCE
/sys/src/libip SEE ALSO
print(2) IP(2)

Check Out this Related Man Page

ethers(5)							File Formats Manual							 ethers(5)

Name
       ethers - database that maps Ethernet addresses to hostnames

Description
       The  file  is used in conjunction with the reverse address resolution protocol daemon, to map Ethernet addresses to hostnames.  It contains
       information about the known (48-bit) Ethernet addresses of hosts on the Internet.

       For each host on an Ethernet, a single line should be present in the file with the following information:

       Ethernet-address        official-host-name

       Items are separated by one or more spaces or tabs.  A number sign (#) indicates the beginning of a comment that extends to the end of line.

       The standard form for Ethernet addresses is:

       x:x:x:x:x:x

       The x is a hexadecimal number between 0 and ff, representing 1 byte.  The address bytes are always in network order.

       Hostnames can contain any printable character other than a space, tab, newline, or number sign (#).

       Hostnames in the file should correspond to the hostnames in the file or to those provided by the name service.

Examples
       The following is a sample file: 08:00:20:01:e5:1c       host1	    # Comments go here 08:00:20:01:d0:4c       host2	    # Comments	go
       here 08:00:20:01:e0:1d	    host3	 # Comments go here 08:00:20:00:c2:4e	    host4	 # Comments go here

See Also
       ethers(3n), hosts(5), rarpd(8c)
       Introduction to Networking and Distributed System Services

																	 ethers(5)
Man Page