Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/man/man4 add pktinfo stuff



details:   https://anonhg.NetBSD.org/src/rev/f71b3868b91b
branches:  trunk
changeset: 787654:f71b3868b91b
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 27 20:14:25 2013 +0000

description:
add pktinfo stuff

diffstat:

 share/man/man4/ip.4 |  30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diffs (58 lines):

diff -r 69517569a224 -r f71b3868b91b share/man/man4/ip.4
--- a/share/man/man4/ip.4       Thu Jun 27 20:03:36 2013 +0000
+++ b/share/man/man4/ip.4       Thu Jun 27 20:14:25 2013 +0000
@@ -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 @@
 .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_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



Home | Main Index | Thread Index | Old Index