From owner-svn-src-head@FreeBSD.ORG Thu Jan 26 10:42:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 472031065672; Thu, 26 Jan 2012 10:42:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1887E8FC12; Thu, 26 Jan 2012 10:42:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QAgP90077093; Thu, 26 Jan 2012 10:42:25 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QAgPsI077091; Thu, 26 Jan 2012 10:42:25 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201261042.q0QAgPsI077091@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 26 Jan 2012 10:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230576 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 10:42:26 -0000 Author: glebius Date: Thu Jan 26 10:42:25 2012 New Revision: 230576 URL: http://svn.freebsd.org/changeset/base/230576 Log: Update information on setting and retreiving inet4 addresses. Modified: head/share/man/man4/inet.4 Modified: head/share/man/man4/inet.4 ============================================================================== --- head/share/man/man4/inet.4 Thu Jan 26 10:33:19 2012 (r230575) +++ head/share/man/man4/inet.4 Thu Jan 26 10:42:25 2012 (r230576) @@ -32,7 +32,7 @@ .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd April 9, 2005 +.Dd January 26, 2012 .Dt INET 4 .Os .Sh NAME @@ -130,25 +130,37 @@ The .Tn ICMP message protocol is accessible from a raw socket. .Pp -The 32-bit Internet address contains both network and host parts. -However, direct examination of addresses is discouraged. -For those -programs which absolutely need to break addresses into their component -parts, the following +The +.Nm +address on an interface consist of the address itself, the +netmask, either broadcast address in case of a broadcast +interface or peers address in case of point-to-point interface. +The following .Xr ioctl 2 -commands are provided for a datagram socket in the Internet domain; -they have the same form as the -.Dv SIOCIFADDR -command (see -.Xr intro 4 ) . -.Bl -tag -width SIOCSIFNETMASK -.It Dv SIOCSIFNETMASK -Set interface network mask. -The network mask defines the network part of the address; -if it contains more of the address than the address type would indicate, -then subnets are in use. +commands are provided for a datagram socket in the Internet domain: +.Pp +.Bl -tag -width ".Dv SIOCGIFBRDADDR" -offset indent -compact +.It Dv SIOCAIFADDR +Add address to an interface. +The command requires +.Ft struct in_aliasreq +as argument. +.It Dv SIOCDIFADDR +Delete address from an interface. +The command requires +.Ft struct ifreq +as argument. +.It Dv SIOCGIFADDR +.It Dv SIOCGIFBRDADDR +.It Dv SIOCGIFDSTADDR .It Dv SIOCGIFNETMASK -Get interface network mask. +Return address information from interface. The returned value +is in +.Ft struct ifreq . +This way of address information retrieval is obsoleted, a +preferred way is to use +.Xr getifaddrs 3 +API. .El .Ss MIB Variables A number of variables are implemented in the net.inet branch of the @@ -260,6 +272,7 @@ in the reassembling queue for a packet. .Sh SEE ALSO .Xr ioctl 2 , .Xr socket 2 , +.Xr getifaddrs 3 , .Xr sysctl 3 , .Xr icmp 4 , .Xr intro 4 ,