2 .\" Don't change the first line, it tells man that tbl is needed.
3 .\" This man page is Copyright (C) 1999 Andi Kleen <ak@muc.de>.
4 .\" Permission is granted to distribute possibly modified copies
5 .\" of this page provided the header is included verbatim,
6 .\" and in case of nontrivial modification author and date
7 .\" of the modification is added to the header.
8 .\" $Id: netdevice.7,v 1.10 2001/08/15 18:01:06 hanataka Exp $
10 .\" Modified, 2004-11-25, mtk, formatting and a few wording fixes
12 .\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved.
13 .\" Translated Mon 6 Dec 1999 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
14 .\" Updated Wed 14 Feb 2001 by Kentaro Shirakata <argrath@ub32.org>
15 .\" Updated 2009-02-12 by Kentaro Shirakata <argrath@ub32.org>
17 .\"WORD load balancing bundle 負荷分散グループ
18 .\"WORD file descriptor ファイルディスクリプタ
21 .TH NETDEVICE 7 2009-01-14 "Linux" "Linux Programmer's Manual"
23 .\"O netdevice \- Low level access to Linux network devices
25 netdevice \- Linux ネットワークデバイスへの低レベルアクセス
28 .B "#include <sys/ioctl.h>"
30 .B "#include <net/if.h>"
33 .\"O This man page describes the sockets interface which is used to configure
35 この man ページでは、ネットワークデバイスを設定するために
36 用いるソケットインターフェースについて解説する。
38 .\"O Linux supports some standard ioctls to configure network devices.
39 .\"O They can be used on any socket's file descriptor regardless of the
44 Linux はネットワークデバイスを設定するための標準的な ioctl を
45 いくつか備えている。これらはどんなソケットのファイルディスクリプタにも
46 用いることができる。ファミリーやタイプは何でもよい。
54 char ifr_name[IFNAMSIZ]; /* Interface name */
56 struct sockaddr ifr_addr;
57 struct sockaddr ifr_dstaddr;
58 struct sockaddr ifr_broadaddr;
59 struct sockaddr ifr_netmask;
60 struct sockaddr ifr_hwaddr;
66 char ifr_slave[IFNAMSIZ];
67 char ifr_newname[IFNAMSIZ];
73 int ifc_len; /* size of buffer */
75 char *ifc_buf; /* buffer address */
76 struct ifreq *ifc_req; /* array of structures */
82 .\"O Normally, the user specifies which device to affect by setting
84 .\"O to the name of the interface.
85 .\"O All other members of the structure may
87 通常、ユーザーによる設定対象デバイスの指定は、
89 にインターフェースの名前をセットすることによって行う。
90 他の構造体の全てのメンバは、メモリを共有する。
93 .\"O If an ioctl is marked as privileged then using it requires an effective
94 .\"O user ID of 0 or the
97 .\"O If this is not the case
99 .\"O will be returned.
100 「特権が必要」と記述されている ioctl を実行するには、
103 権限が必要である。これが満たされていない場合は
109 .\"O .IR ifr_ifindex ,
110 .\"O return the name of the interface in
112 .\"O This is the only ioctl which returns its result in
122 .\"O Retrieve the interface index of the interface into
123 .\"O .IR ifr_ifindex .
124 インターフェースの interface index を取得し、
128 .BR SIOCGIFFLAGS ", " SIOCSIFFLAGS
129 .\"O Get or set the active flag word of the device.
131 .\"O contains a bit mask of the following values:
132 デバイスの active フラグワードを取得または設定する。
140 .\"O IFF_UP:Interface is running.
141 .\"O IFF_BROADCAST:Valid broadcast address set.
142 .\"O IFF_DEBUG:Internal debugging flag.
143 .\"O IFF_LOOPBACK:Interface is a loopback interface.
144 .\"O IFF_POINTOPOINT:Interface is a point-to-point link.
145 .\"O IFF_RUNNING:Resources allocated.
146 .\"O IFF_NOARP:No arp protocol
147 .\"O IFF_PROMISC:Interface is in promiscuous mode.
148 .\"O IFF_NOTRAILERS:Avoid use of trailers.
149 .\"O IFF_ALLMULTI:Receive all multicast packets.
150 .\"O IFF_MASTER:Master of a load balancing bundle.
151 .\"O IFF_SLAVE:Slave of a load balancing bundle.
152 .\"O IFF_MULTICAST:Supports multicast
153 .\"O IFF_PORTSEL:Is able to select media type via ifmap.
154 .\"O IFF_AUTOMEDIA:Auto media selection active.
156 .\"O The addresses are lost when the interface goes down.
158 .\"O IFF_LOWER_UP:Driver signals L1 up (since Linux 2.6.17)
159 .\"O IFF_DORMANT:Driver signals dormant (since Linux 2.6.17)
160 .\"O IFF_ECHO:Echo sent packets (since Linux 2.6.25)
164 有効なブロードキャストアドレスがセットされている。
166 IFF_DEBUG:内部のデバッグフラグ。
167 IFF_LOOPBACK:インターフェースはループバックである。
169 インターフェースは point-to-point リンクである。
171 IFF_RUNNING:リソースが割り当て済み。
172 IFF_NOARP:arp プロトコルがない。
173 IFF_PROMISC:インターフェースは promiscuous モードである。
174 IFF_NOTRAILERS:trailer の利用を避ける。
175 IFF_ALLMULTI:全てのマルチキャストパケットを受信する。
176 IFF_MASTER:負荷分散グループのマスターである。
177 IFF_SLAVE:負荷分散グループのスレーブである。
178 IFF_MULTICAST:マルチキャストをサポートしている。
179 IFF_PORTSEL:ifmap によってメディアタイプを選択できる。
180 IFF_AUTOMEDIA:自動メディア選択が有効になっている。
182 このインターフェースが閉じると、アドレスは失われる。
184 IFF_LOWER_UP:ドライバからの L1 アップの通知 (Linux 2.6.17 以降)
185 IFF_DORMANT:ドライバからの休止状態の通知 (Linux 2.6.17 以降)
186 IFF_ECHO:送られたパケットをエコーする (Linux 2.6.25 以降)
190 .\"O Setting the active flag word is a privileged operation, but any
191 .\"O process may read it.
192 active フラグワードの設定は特権が必要な操作である。
193 しかし読み出しはどんなプロセスからも可能である。
195 .BR SIOCGIFMETRIC ", " SIOCSIFMETRIC
196 .\"O Get or set the metric of the device using
197 .\"O .IR ifr_metric .
198 .\"O This is currently not implemented; it sets
200 .\"O to 0 if you attempt to read it and returns
202 .\"O if you attempt to set it.
206 これはまだ実装されていない。読み出そうとすると
208 に 0 をセットして返り、設定しようとすると
212 .BR SIOCGIFMTU ", " SIOCSIFMTU
213 .\"O Get or set the MTU (Maximum Transfer Unit) of a device using
215 .\"O Setting the MTU is a privileged operation.
216 .\"O Setting the MTU to
217 .\"O too small values may cause kernel crashes.
218 デバイスの MTU (Maximum Transfer Unit) を
220 を用いて取得・設定する。 MTU の設定は特権が必要な操作である。
221 MTU の値を小さくしすぎるとカーネルがクラッシュするかもしれない。
223 .BR SIOCGIFHWADDR ", " SIOCSIFHWADDR
224 .\"O Get or set the hardware address of a device using
225 .\"O .IR ifr_hwaddr .
229 .\"O The hardware address is specified in a struct
235 .\"O contains the ARPHRD_* device type,
237 .\"O the L2 hardware address starting from byte 0.
239 には ARPHRD_* デバイスタイプが入り、
241 にはバイト 0 から始まる L2 ハードウェアアドレスが入る。
242 .\"O Setting the hardware address is a privileged operation.
243 ハードウェアアドレスの設定は特権が必要な操作である。
245 .B SIOCSIFHWBROADCAST
246 .\"O Set the hardware broadcast address of a device from
247 .\"O .IR ifr_hwaddr .
248 .\"O This is a privileged operation.
249 デバイスのハードウェアブロードキャストアドレスを
251 の値に設定する。この操作には特権が必要である。
253 .BR SIOCGIFMAP ", " SIOCSIFMAP
254 .\"O Get or set the interface's hardware parameters using
256 .\"O Setting the parameters is a privileged operation.
257 インターフェースのハードウェアのパラメータを
260 パラメータの設定は特権が必要な操作である。
265 unsigned long mem_start;
266 unsigned long mem_end;
267 unsigned short base_addr;
275 .\"O The interpretation of the ifmap structure depends on the device driver
276 .\"O and the architecture.
277 ifmap 構造体の解釈はデバイスドライバとアーキテクチャに依存する。
279 .BR SIOCADDMULTI ", " SIOCDELMULTI
280 .\"O Add an address to or delete an address from the device's link layer
281 .\"O multicast filters using
282 .\"O .IR ifr_hwaddr .
283 .\"O These are privileged operations.
286 .\"O for an alternative.
287 デバイスのリンク層のマルチキャストフィルターから、
289 のアドレスを追加・削除する。これらの操作には特権が必要である。
294 .BR SIOCGIFTXQLEN ", " SIOCSIFTXQLEN
295 .\"O Get or set the transmit queue length of a device using
297 .\"O Setting the transmit queue length is a privileged operation.
300 に取得・設定する。送信キューの長さの設定には特権が必要である。
303 .\"O Changes the name of the interface specified in
306 .\"O .IR ifr_newname .
307 .\"O This is a privileged operation.
308 .\"O It is only allowed when the interface
313 に変更する。この操作には特権が必要である。インターフェースが up していない
317 .\"O Return a list of interface (transport layer) addresses.
319 .\"O means only addresses of the
321 .\"O (IPv4) family for compatibility.
322 インターフェース(トランスポート層)アドレスのリストを返す。
325 (IPv4) ファミリーのアドレスのみである。
326 .\"O The user passes a
328 .\"O structure as argument to the ioctl.
329 .\"O It contains a pointer to an array of
333 .\"O and its length in bytes in
346 .\"O The kernel fills the ifreqs with all current L3 interface addresses that
349 .\"O contains the interface name (eth0:1 etc.),
352 カーネルは ifreqs を現在動作している全ての L3 インターフェースアドレスで埋める。
354 にはインターフェース名 (eth0:1 など) が入り、
357 .\"O The kernel returns with the actual length in
364 .\"O is equal to the original length the buffer probably has overflowed
365 .\"O and you should retry with a bigger buffer to get all addresses.
368 オーバーフローを起こしている可能性があるので、
369 全てのアドレスを取得するためにより大きなバッファで再試行するべきである。
370 .\"O When no error occurs the ioctl returns 0;
372 .\"O Overflow is no an error.
373 エラーがなかった場合は ioctl は 0 を返す。
376 .\" Slaving isn't supported in 2.2
379 .\" .BR SIOCGIFSLAVE ", " SIOCSIFSLAVE
380 .\" Get or set the slave device using
382 .\" Setting the slave device is a privileged operation.
384 .\" FIXME add amateur radio stuff.
386 .\"O Most protocols support their own ioctls to configure protocol-specific
387 .\"O interface options.
388 .\"O See the protocol man pages for a description.
389 ほとんどのプロトコルには、専用のインターフェースオプションを
390 設定するための独自の ioctl が存在する。
391 説明は各プロトコルの man ページを見よ。
393 .\"O In addition some devices support private ioctls.
394 .\"O These are not described here.
395 さらに、デバイスによってはプライベートな ioctl がある。
399 .\"O Strictly speaking,
401 .\"O is IP specific and belongs in
409 .\"O The names of interfaces with no addresses or that don't have the
411 .\"O flag set can be found via
412 .\"O .IR /proc/net/dev .
415 フラグがセットされていないインターフェースの名前は
419 .\"O Local IPv6 IP addresses can be found via
422 .\"O .BR rtnetlink (7).
430 .\"O glibc 2.1 is missing the
433 .\"O .IR <net/if.h> .
434 .\"O Add the following to your program as a workaround:
440 とりあえずの対応策として、以下のコードを追加しておくこと。
445 #define ifr_newname ifr_ifru.ifru_slave
453 .BR capabilities (7),