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

ARP(3)							     Library Functions Manual							    ARP(3)

NAME
arp - Internet Address Resolution Protocol SYNOPSIS
bind -a #a /net/arp /net/arp/ctl /net/arp/data /net/arp/stats DESCRIPTION
The arp device provides the means by which the kernel resolves IP addresses into Ethernet addresses. A cache is maintained by the arp device to speed the process. The ctl file controls the ARP cache maintained by the kernel. The flush control message invalidates all entries in the cache. The delete ipaddr control message invalidates a single cache entry. All IP addresses passed to the system are in the canonical textual form described in ip(2). The perm ipaddr control message makes an existing cache entry permanent. When the kernel boots, ipconfig sets up the IP stream and arpd opens #a/arp/data (see ipconfig(8)). This establishes the ARP cache and enables arpd to receive all ARP packets from the network, which it uses to maintain the cache by writing the results of address resolution requests back into the cache. The IP stream module uses the cache to translate IP addresses. Subsequent opens of the data file allow the contents of the cache to be examined. Each cache entry consists of an IP address, an Ethernet address, and the status of the entry. Entries may be invalid, permanent, or temporary. Permanent entries will never be aged from the cache. Temporary entries may be replaced by new addresses entered by the ARP server. The file stats reports the cache performance. SEE ALSO
ip(3), ipconfig(8) SOURCE
/sys/src/9/port/devarp.c ARP(3)
Man Page