Source-Changes-HG archive

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

[src/trunk]: src add ip6(4) and icmp6(4).



details:   https://anonhg.NetBSD.org/src/rev/3fe02f34c797
branches:  trunk
changeset: 479722:3fe02f34c797
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Dec 20 05:50:47 1999 +0000

description:
add ip6(4) and icmp6(4).

diffstat:

 distrib/sets/lists/man/mi |    4 +-
 share/man/man4/Makefile   |    4 +-
 share/man/man4/icmp6.4    |  262 ++++++++++++++++++
 share/man/man4/ip6.4      |  647 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 914 insertions(+), 3 deletions(-)

diffs (truncated from 960 to 300 lines):

diff -r 7f65c98d09ad -r 3fe02f34c797 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Mon Dec 20 05:46:33 1999 +0000
+++ b/distrib/sets/lists/man/mi Mon Dec 20 05:50:47 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.184 1999/12/16 07:08:10 lukem Exp $
+# $NetBSD: mi,v 1.185 1999/12/20 05:50:47 itojun Exp $
 ./usr/share/info/am-utils.info
 ./usr/share/info/awk.info
 ./usr/share/info/bfd.info
@@ -400,6 +400,7 @@
 ./usr/share/man/cat4/gus.0
 ./usr/share/man/cat4/guspnp.0
 ./usr/share/man/cat4/icmp.0
+./usr/share/man/cat4/icmp6.0
 ./usr/share/man/cat4/icsphy.0
 ./usr/share/man/cat4/idp.0
 ./usr/share/man/cat4/ifmedia.0
@@ -408,6 +409,7 @@
 ./usr/share/man/cat4/inphy.0
 ./usr/share/man/cat4/iophy.0
 ./usr/share/man/cat4/ip.0
+./usr/share/man/cat4/ip6.0
 ./usr/share/man/cat4/ipf.0
 ./usr/share/man/cat4/ipfilter.0
 ./usr/share/man/cat4/ipip.0
diff -r 7f65c98d09ad -r 3fe02f34c797 share/man/man4/Makefile
--- a/share/man/man4/Makefile   Mon Dec 20 05:46:33 1999 +0000
+++ b/share/man/man4/Makefile   Mon Dec 20 05:50:47 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.118 1999/12/11 23:10:15 augustss Exp $
+#      $NetBSD: Makefile,v 1.119 1999/12/20 05:50:48 itojun Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 MAN=   ahb.4 ahc.4 aria.4 atalk.4 audio.4 awi.4 bha.4 bpf.4 cardbus.4 ccd.4 \
@@ -35,7 +35,7 @@
 MAN+=  si.4
 
 # IPv6/IPsec
-MAN+=  faith.4 gif.4 ipsec.4 inet6.4
+MAN+=  faith.4 gif.4 inet6.4 icmp6.4 ip6.4 ipsec.4
 
 MLINKS+=bha.4 bt.4
 MLINKS+=cardbus.4 cbb.4
diff -r 7f65c98d09ad -r 3fe02f34c797 share/man/man4/icmp6.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/icmp6.4    Mon Dec 20 05:50:47 1999 +0000
@@ -0,0 +1,262 @@
+.\"    $NetBSD: icmp6.4,v 1.1 1999/12/20 05:50:49 itojun Exp $
+.\"
+.\" Copyright (C) 1999 WIDE Project.
+.\" All rights reserved.
+.\" 
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the project nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\" 
+.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" Copyright (c) 1986, 1991, 1993
+.\"    The Regents of the University of California.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"    KAME Id: icmp6.4,v 1.1 1999/12/17 09:47:01 itojun Exp
+.\"
+.Dd December 17, 1999
+.Dt ICMP6 4
+.Os
+."
+.Sh NAME
+.Nm icmp6
+.Nd Internet Control Message Protocol for IPv6
+."
+.Sh SYNOPSIS
+.Fd #include <sys/socket.h>
+.Fd #include <netinet/in.h>
+.Fd #include <netinet/icmp6.h>
+.Ft int
+.Fn socket AF_INET6 SOCK_RAW proto
+."
+.Sh DESCRIPTION
+.Tn ICMPv6
+is the error and control message protocol used
+by
+.Tn IPv6
+and the Internet protocol family.
+It may be accessed through a
+.Dq raw socket
+for network monitoring and diagnostic functions.
+The
+.Fa proto
+parameter to the socket call to create an
+.Tn ICMPv6
+socket is obtained from
+.Xr getprotobyname 3 ,
+or you can use
+.Dv IPPROTO_ICMPV6 .
+.Tn ICMPv6
+sockets are connectionless, and are normally used with the
+.Xr sendto 2
+and
+.Xr recvfrom 2
+calls, though the
+.Xr connect 2
+call may also be used to fix the destination for future packets
+(in which case the
+.Xr read 2
+or
+.Xr recv 2
+and
+.Xr write 2
+or
+.Xr send 2
+system calls may be used).
+.Pp
+Outgoing packets automatically have an
+.Tn IPv6
+header prepended to them
+.Pq based on the destination address .
+.Tn ICMPv6
+pseudo header checksum field
+.Pq Li icmp6_cksum
+will be filled automatically by the kernel.
+Incoming packets are received without the
+.Tn IPv6
+header nor IPv6 extension headers.
+Notice that this behavior is opposite from
+.Tn IPv4
+raw sockets and.
+.Tn ICMPv4
+sockets.
+.Pp
+.Ss ICMPv6 type/code filter
+Each
+.Tn ICMPv6
+raw socket has an associated filter whose datatype is defined as
+.Li struct icmp6_filter ;
+.Pp
+This structure, along with the macros and constants defined later in
+this section, are defined as a result of including the
+.Aq Li netinet/icmp6.h
+header.
+.Pp
+The current filter is fetched and stored using
+.Xr getsockopt 2
+and
+.Xr setsockopt 2
+with a level of
+.Dv IPPROTO_ICMPV6
+and an option name of
+.Dv ICMP6_FILTER .
+.Pp
+Six macros operate on an icmp6_filter structure:
+.\" is "Fn" legal for macros?
+.Bl -item -compact -offset indent
+.It Ft void
+.Fn ICMP6_FILTER_SETPASSALL "struct icmp6_filter *"
+.It Ft void
+.Fn ICMP6_FILTER_SETBLOCKALL "struct icmp6_filter *"
+.It Ft void
+.Fn ICMP6_FILTER_SETPASS "int" "struct icmp6_filter *"
+.It Ft void
+.Fn ICMP6_FILTER_SETBLOCK "int" "struct icmp6_filter *"
+.It Ft int
+.Fn ICMP6_FILTER_WILLPASS "int" "const struct icmp6_filter *"
+.It Ft int
+.Fn ICMP6_FILTER_WILLBLOCK "int" "const struct icmp6_filter *"
+.El
+.Pp
+The first argument to the last four macros
+.Pq an integer
+is an
+.Tn ICMPv6
+message type, between 0 and 255.
+The pointer argument to all six
+macros is a pointer to a filter that is modified by the first four
+macros examined by the last two macros.
+.Pp
+The first two macros,
+.Dv SETPASSALL
+and
+.Dv SETBLOCKALL ,
+let us specify that
+all
+.Tn ICMPv6 messages are passed to the application or that all
+.Tn ICMPv6
+messages are blocked from being passed to the application.
+.Pp
+The next two macros,
+.Dv SETPASS
+and
+.Dv SETBLOCK ,
+let us specify that
+messages of a given
+.Tn ICMPv6
+type should be passed to the application
+or not passed to the application
+.Pq blocked .
+.Pp
+The final two macros,
+.Dv WILLPASS
+and
+.Dv WILLBLOCK ,
+return true or false
+depending whether the specified message type is passed to the
+application or blocked from being passed to the application by the
+filter pointed to by the second argument.
+.Pp
+When an
+.Tn ICMPv6
+raw socket is created, it will by default pass all
+.Tn ICMPv6
+message types to the application.
+.Pp
+For further discussions see RFC2292.
+.\"
+.Sh DIAGNOSTICS
+A socket operation may fail with one of the following errors returned:
+.Bl -tag -width [EADDRNOTAVAIL]
+.It Bq Er EISCONN
+when trying to establish a connection on a socket which
+already has one, or when trying to send a datagram with the destination
+address specified and the socket is already connected;
+.It Bq Er ENOTCONN
+when trying to send a datagram, but
+no destination address is specified, and the socket hasn't been
+connected;
+.It Bq Er ENOBUFS
+when the system runs out of memory for
+an internal data structure;
+.It Bq Er EADDRNOTAVAIL
+when an attempt is made to create a
+socket with a network address for which no network interface exists.
+.El
+."
+.Sh SEE ALSO
+.Xr send 2 ,
+.Xr recv 2 ,
+.Xr intro 4 ,
+.Xr inet6 4 ,
+.Xr ip6 4
+.Rs
+.%A W. Stevens
+.%A M. Thomas
+.%R RFC
+.%N 2292
+.%D February 1998
+.%T "Advanced Sockets API for IPv6"
+.Re
+.Rs
+.%A A. Conta
+.%A S. Deering
+.%R RFC
+.%N 2463
+.%D December 1998
+.%T "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification"



Home | Main Index | Thread Index | Old Index