Module Name:    src
Committed By:   christos
Date:           Thu Jun 27 20:14:25 UTC 2013

Modified Files:
        src/share/man/man4: ip.4

Log Message:
add pktinfo stuff


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/share/man/man4/ip.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/ip.4
diff -u src/share/man/man4/ip.4:1.33 src/share/man/man4/ip.4:1.34
--- src/share/man/man4/ip.4:1.33	Mon Jun 25 10:47:55 2012
+++ src/share/man/man4/ip.4	Thu Jun 27 16:14:25 2013
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ip.4,v 1.33 2012/06/25 14:47:55 christos Exp $
+.\"	$NetBSD: ip.4,v 1.34 2013/06/27 20:14:25 christos Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"     @(#)ip.4	8.2 (Berkeley) 11/30/93
 .\"
-.Dd June 25, 2012
+.Dd June 27, 2013
 .Dt IP 4
 .Os
 .Sh NAME
@@ -111,6 +111,25 @@ setsockopt(s, IPPROTO_IP, IP_IPSEC_POLIC
 .Ed
 .Pp
 The
+.Dv IP_PKTINFO
+option can be used to turn on receiving of information about the source
+address of the packet, and the interface index. The information is passed
+in an
+.Tp struct in_pktinfo
+structure, which contains
+.Bd -literal
+	struct in_addr ipi_addr;	/* the source or destination address */
+	unsigned int ipi_ifindex;	/* the interface index */
+.Ed
+and added to the control portion of the message:
+The cmsghdr fields have the following values:
+.Bd -literal
+cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo))
+cmsg_level = IPPROTO_IP
+cmsg_type = IP_PKTINFO
+.Ed
+.Pp
+The
 .Dv IP_PORTALGO
 can be used to randomize the port selection.
 Valid algorithms are described in
@@ -189,6 +208,13 @@ cmsg_level = IPPROTO_IP
 cmsg_type = IP_RECVIF
 .Ed
 .Pp
+The
+.Dv IP_RECVPKTINFO
+option is similar to the
+.Dv IP_PKTINFO
+one, only in this case the inbound information is returned.
+i
+.Pp
 If the
 .Dv IP_RECVTTL
 option is enabled on a

Reply via email to