aboutsummaryrefslogtreecommitdiff
path: root/ja_JP.eucJP/man/man4/icmp.4
blob: e44bec952df6f041257831cd44c8694bebac2028 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
.\" 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.
.\"
.\"     @(#)icmp.4	8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"	%Id: icmp.4,v 1.6 1997/03/19 19:47:30 bde Exp %
.\"
.\" WORD: Internet Control Message Protocol    インターネットコントロールメッセージプロトコル
.Dd June 5, 1993
.Dt ICMP 4
.Os BSD 4.3
.Sh 名称
.Nm icmp
.Nd インターネットコントロールメッセージプロトコル
.Sh 書式
.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Fd #include <netinet/in.h>
.Ft int
.Fn socket AF_INET SOCK_RAW proto
.Sh 解説
.Tn ICMP
は、
.Tn IP
及びインターネットプロトコルファミリにおける、
エラー及び制御通知のためのプロトコルです。
本プロトコルの機能であるネットワークのモニタリング及び診断機能は、
.Dq raw socket
を介したアクセスにより利用することができます。
.Tn ICMP
ソケットを作成するための socket コールへの引数
.Fa proto
は
.Xr getprotobyname 3
から得られます。
.Tn ICMP
ソケットはコネクションレス型であり、普通
.Xr sendto 2
及び
.Xr recvfrom 2
コールと共に使用されます。
ただし、後で送られるパケットの宛先を固定する場合は
.Xr connect 2
コールも使用できます (その場合には普通
.Xr read 2
または
.Xr recv 2
、及び
.Xr write 2
または
.Xr send 2
システムコールと共に使用されます)。
.Pp
送信パケットには (宛先アドレスに基づいて) 作成された
.Tn IP
ヘッダが自動的に付与されます。
受信パケットは、
.Tn IP
ヘッダ及びオプションが全く損なわれずに受信されます。
.Sh 診断
ソケット操作の失敗の際には次のエラーのうちの一つが返されます:
.Bl -tag -width [EADDRNOTAVAIL]
.It Bq Er EISCONN
既にコネクションが確立されているソケットに対し
さらにコネクションを確立させようとした時、
あるいは既にソケットのコネクションが確立されているのに、
宛先アドレスを指定してデータグラムを送信しようとした時
.It Bq Er ENOTCONN
ソケットのコネクションが確立されていない場合に、
宛先アドレスの指定をせずデータグラムの送信を行おうとした時
.It Bq Er ENOBUFS
内部的なデータ構造のためのメモリが不足した時
.It Bq Er EADDRNOTAVAIL
対応したネットワークインタフェースが存在しない
ネットワークアドレスを指定し、ソケットを作成しようとした時
.El
.Sh 関連項目
.Xr recv 2 ,
.Xr send 2 ,
.Xr inet 4 ,
.Xr intro 4 ,
.Xr ip 4
.Sh 歴史
.Nm
プロトコルは
.Bx 4.3
から登場しました。