2 .\" Don't remove the line above, 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 .\" Based on the original comments from Alexey Kuznetsov, written with
9 .\" help from Matthew Wilcox.
10 .\" $Id: rtnetlink.7,v 1.10 2001/04/04 08:02:19 ysato Exp $
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>
15 .\"WORD queueing dicipline キューイング(の)ルール
16 .\"WORD permanent 永続的な
19 .TH RTNETLINK 7 2008-08-08 "Linux" "Linux Programmer's Manual"
21 .\"O rtnetlink, NETLINK_ROUTE \- Linux IPv4 routing socket
23 rtnetlink, NETLINK_ROUTE \- Linux IPv4 ルーティングソケット
26 .B #include <asm/types.h>
28 .B #include <linux/netlink.h>
30 .B #include <linux/rtnetlink.h>
32 .B #include <sys/socket.h>
34 .BI "rtnetlink_socket = socket(AF_NETLINK, int " socket_type ", NETLINK_ROUTE);"
37 .\"O Rtnetlink allows the kernel's routing tables to be read and altered.
38 .\"O It is used within the kernel to communicate between
39 .\"O various subsystems, though this usage is not documented here, and for
40 .\"O communication with user-space programs.
41 .\"O Network routes, IP addresses, link parameters, neighbor setups, queueing
42 .\"O disciplines, traffic classes and packet classifiers may all be controlled
46 .\"O It is based on netlink messages; see
48 .\"O for more information.
50 はカーネルのルーティングテーブルを読んだり変更したり
51 するためのものである。これはカーネルが内部のサブシステムと
52 通信するためにも用いられているが、それはここでは記述しない。
53 この man ページではユーザー空間のプログラムとの通信に関してのみ述べる。
54 ネットワーク経路・IP アドレス・リンクパラメータ・
55 近傍設定 (neighbor setup)・キューイングルール (queueing dicipline)・
56 トラフィッククラス・パケットのクラス分類などが、すべて
60 は netlink メッセージをベースにしている。詳細は
63 .\" FIXME ? all these macros could be moved to rtnetlink(3)
64 .\"O .SS "Routing Attributes"
66 .\"O Some rtnetlink messages have optional attributes after the initial header:
67 rtnetlink メッセージには、初期ヘッダの後に付加的な属性を
73 unsigned short rta_len; /* Length of option */
74 unsigned short rta_type; /* Type of option */
80 .\"O These attributes should be only manipulated using the RTA_* macros
81 .\"O or libnetlink, see
82 .\"O .BR rtnetlink (3).
83 これらの属性の操作は、 RTA_* マクロか libnetlink を通してのみ
89 .\"O Rtnetlink consists of these message types
90 .\"O (in addition to standard netlink messages):
91 rtnetlink は (標準的な netlink メッセージに加えて)
94 .BR RTM_NEWLINK ", " RTM_DELLINK ", " RTM_GETLINK
95 .\"O Create, remove or get information about a specific network interface.
96 .\"O These messages contain an
98 .\"O structure followed by a series of
101 指定したネットワークインターフェースの情報を、生成・削除・取得する。
110 unsigned char ifi_family; /* AF_UNSPEC */
111 unsigned short ifi_type; /* Device type */
112 int ifi_index; /* Interface index */
113 unsigned int ifi_flags; /* Device flags */
114 unsigned int ifi_change; /* change mask */
120 .\"O contains the device flags, see
121 .\"O .BR netdevice (7);
123 .\"O is the unique interface index,
125 .\"O is reserved for future use and should be always set to 0xFFFFFFFF.
131 は他と重ならないインターフェースの index である。
134 0xFFFFFFFF にセットすべきである。
139 .\"O Routing attributes
140 .\"O rta_type:value type:description
142 .\"O IFLA_UNSPEC:-:unspecified.
143 .\"O IFLA_ADDRESS:hardware address:interface L2 address
144 .\"O IFLA_BROADCAST:hardware address:L2 broadcast address.
145 .\"O IFLA_IFNAME:asciiz string:Device name.
146 .\"O IFLA_MTU:unsigned int:MTU of the device.
147 .\"O IFLA_LINK:int:Link type.
148 .\"O IFLA_QDISC:asciiz string:Queueing discipline.
151 .\"O T}:Interface Statistics.
155 IFLA_UNSPEC:-:指定されていない。
156 IFLA_ADDRESS:hardware address:T{
159 IFLA_BROADCAST:hardware address:T{
162 IFLA_IFNAME:asciiz string:デバイス名
163 IFLA_MTU:unsigned int:デバイスの MTU
165 IFLA_QDISC:asciiz string:キューイングのルール
171 .\"O The value type for IFLA_STATS is \fIstruct net_device_stats\fP.
172 IFLA_STATS の値の型は \fIstruct net_device_stats\fP である。
174 .BR RTM_NEWADDR ", " RTM_DELADDR ", " RTM_GETADDR
175 .\"O Add, remove or receive information about an IP address associated with
177 .\"O In Linux 2.2, an interface can carry multiple IP addresses,
178 .\"O this replaces the alias device concept in 2.0.
179 .\"O In Linux 2.2, these messages
180 .\"O support IPv4 and IPv6 addresses.
183 .\"O structure, optionally followed by
185 .\"O routing attributes.
186 インターフェースの IP アドレスの情報を追加・削除・取得する。
187 Linux 2.2 では、一つのインターフェースに複数の IP アドレスを
188 保持させることができ、これは 2.0 の別名デバイスの概念を置き換える。
189 Linux 2.2 では、これらのメッセージは
190 IPv4 と IPv6 の両方のアドレスをサポートしている。
199 unsigned char ifa_family; /* Address type */
200 unsigned char ifa_prefixlen; /* Prefixlength of address */
201 unsigned char ifa_flags; /* Address flags */
202 unsigned char ifa_scope; /* Address scope */
203 int ifa_index; /* Interface index */
208 .\"O is the address family type (currently
212 .\"O .I ifa_prefixlen
213 .\"O is the length of the address mask of the address if defined for the
214 .\"O family (like for IPv4),
216 .\"O is the address scope,
218 .\"O is the interface index of the interface the address is associated with.
220 .\"O is a flag word of
221 .\"O .B IFA_F_SECONDARY
222 .\"O for secondary address (old alias interface),
223 .\"O .B IFA_F_PERMANENT
224 .\"O for a permanent address set by the user and other undocumented flags.
226 はアドレスファミリーのタイプである (現在は
231 はアドレスのアドレスマスクの長さである (IPv4 のように、
236 はアドレスが関連づけられているインターフェースの index である。
239 二つめのアドレス (古い別名インターフェース) の場合は
243 に適用される。ユーザーによってセットされるフラグと、
244 undocumented なフラグがある。
250 .\"O rta_type:value type:description
252 .\"O IFA_UNSPEC:-:unspecified.
253 .\"O IFA_ADDRESS:raw protocol address:interface address
254 .\"O IFA_LOCAL:raw protocol address:local address
255 .\"O IFA_LABEL:asciiz string:name of the interface
256 .\"O IFA_BROADCAST:raw protocol address:broadcast address.
257 .\"O IFA_ANYCAST:raw protocol address:anycast address
258 .\"O IFA_CACHEINFO:struct ifa_cacheinfo:Address information.
262 IFA_UNSPEC:-:指定されていない
263 IFA_ADDRESS:raw protocol address:インターフェースアドレス
264 IFA_LOCAL:raw protocol address:ローカルアドレス
265 IFA_LABEL:asciiz string:インターフェースの名前
266 IFA_BROADCAST:raw protocol address:ブロードキャストアドレス
267 IFA_ANYCAST:raw protocol address:anycast アドレス
268 IFA_CACHEINFO:struct ifa_cacheinfo:アドレス情報
270 .\" FIXME struct ifa_cacheinfo
272 .BR RTM_NEWROUTE ", " RTM_DELROUTE ", " RTM_GETROUTE
273 .\"O Create, remove or receive information about a network route.
274 .\"O These messages contain an
276 .\"O structure with an optional sequence of
278 .\"O structures following.
280 .\"O .BR RTM_GETROUTE ,
285 .\"O to 0 means you get all entries for the specified routing table.
286 ネットワーク経路の情報を生成・削除・取得する。
298 指定されたルーティングテーブルの全てのエントリを所得する。
299 .\"O For the other fields, except
302 .\"O .IR rtm_protocol ,
303 .\"O 0 is the wildcard.
307 以外の他のフィールドに 0 を入れると、ワイルドカードを意味する。
311 unsigned char rtm_family; /* Address family of route */
312 unsigned char rtm_dst_len; /* Length of destination */
313 unsigned char rtm_src_len; /* Length of source */
314 unsigned char rtm_tos; /* TOS filter */
316 unsigned char rtm_table; /* Routing table ID */
317 unsigned char rtm_protocol; /* Routing protocol; see below */
318 unsigned char rtm_scope; /* See below */
319 unsigned char rtm_type; /* See below */
321 unsigned int rtm_flags;
327 .\"O rtm_type:Route type
329 .\"O RTN_UNSPEC:unknown route
330 .\"O RTN_UNICAST:a gateway or direct route
331 .\"O RTN_LOCAL:a local interface route
332 .\"O RTN_BROADCAST:T{
333 .\"O a local broadcast route (sent as a broadcast)
336 .\"O a local broadcast route (sent as a unicast)
338 .\"O RTN_MULTICAST:a multicast route
339 .\"O RTN_BLACKHOLE:a packet dropping route
340 .\"O RTN_UNREACHABLE:an unreachable destination
341 .\"O RTN_PROHIBIT:a packet rejection route
342 .\"O RTN_THROW:continue routing lookup in another table
343 .\"O RTN_NAT:a network address translation rule
345 .\"O refer to an external resolver (not implemented)
350 RTN_UNICAST:ゲートウェイまたはダイレクトな経路
351 RTN_LOCAL:ローカルインターフェースの経路
360 RTN_MULTICAST:マルチキャスト経路
361 RTN_BLACKHOLE:パケットを捨てる経路
362 RTN_UNREACHABLE:到達できない行き先
363 RTN_PROHIBIT:パケットを拒否する経路
364 RTN_THROW:経路探索を別のテーブルで継続
365 RTN_NAT:ネットワークアドレスの変換ルール
373 .\"O rtm_protocol:Route origin.
375 .\"O RTPROT_UNSPEC:unknown
376 .\"O RTPROT_REDIRECT:T{
377 .\"O by an ICMP redirect (currently unused)
379 .\"O RTPROT_KERNEL:by the kernel
380 .\"O RTPROT_BOOT:during boot
381 .\"O RTPROT_STATIC:by the administrator
386 ICMP リダイレクトによる (現在は用いられない)
388 RTPROT_KERNEL:カーネルによる
393 .\"O Values larger than
394 .\"O .B RTPROT_STATIC
395 .\"O are not interpreted by the kernel, they are just for user information.
396 .\"O They may be used to tag the source of a routing information or to
397 .\"O distingush between multiple routing daemons.
399 .\"O .I <linux/rtnetlink.h>
400 .\"O for the routing daemon identifiers which are already assigned.
402 よりも大きな値はカーネルによって解釈されない。これは
403 単なるユーザーへの情報である。これらは経路情報の情報源を
404 タグ付けしたり、複数のルーティングデーモンからの情報を
406 既に割り当てられているルーティングデーモンの識別子については
407 .I <linux/rtnetlink.h>
411 .\"O is the distance to the destination:
418 .\"O RT_SCOPE_UNIVERSE:global route
419 .\"O RT_SCOPE_SITE:T{
420 .\"O interior route in the local autonomous system
422 .\"O RT_SCOPE_LINK:route on this link
423 .\"O RT_SCOPE_HOST:route on the local host
424 .\"O RT_SCOPE_NOWHERE:destination doesn't exist
425 RT_SCOPE_UNIVERSE:グローバルな経路
429 RT_SCOPE_LINK:このリンク上の経路
430 RT_SCOPE_HOST:ローカルホスト上の経路
431 RT_SCOPE_NOWHERE:行き先が存在しない
434 .\"O The values between
435 .\"O .B RT_SCOPE_UNIVERSE
437 .\"O .B RT_SCOPE_SITE
438 .\"O are available to the user.
447 .\"O have the following meanings:
454 .\"O if the route changes, notify the user via rtnetlink
456 .\"O RTM_F_CLONED:route is cloned from another route
457 .\"O RTM_F_EQUALIZE:a multipath equalizer (not yet implemented)
459 経路が変更されると、 rtnetlink を通してユーザーに通知が行く。
461 RTM_F_CLONED:経路は他の経路によって複製された。
462 RTM_F_EQUALIZE:マルチパスイコライザ (まだ実装されていない)
466 .\"O specifies the routing table
472 .\"O RT_TABLE_UNSPEC:an unspecified routing table
473 .\"O RT_TABLE_DEFAULT:the default table
474 .\"O RT_TABLE_MAIN:the main table
475 .\"O RT_TABLE_LOCAL:the local table
476 RT_TABLE_UNSPEC:指定されていないルーティングテーブル
477 RT_TABLE_DEFAULT:デフォルトのテーブル
478 RT_TABLE_MAIN:メインのテーブル
479 RT_TABLE_LOCAL:ローカルテーブル
482 .\"O The user may assign arbitrary values between
483 .\"O .B RT_TABLE_UNSPEC
485 .\"O .BR RT_TABLE_DEFAULT .
489 .BR RT_TABLE_DEFAULT .
496 .\"O rta_type:value type:description
498 .\"O RTA_UNSPEC:-:ignored.
499 .\"O RTA_DST:protocol address:Route destination address.
500 .\"O RTA_SRC:protocol address:Route source address.
501 .\"O RTA_IIF:int:Input interface index.
502 .\"O RTA_OIF:int:Output interface index.
503 .\"O RTA_GATEWAY:protocol address:The gateway of the route
504 .\"O RTA_PRIORITY:int:Priority of route.
506 .\"O RTA_METRICS:int:Route metric
515 RTA_DST:protocol address:経路の行き先アドレス
516 RTA_SRC:protocol address:経路の発信元アドレス
517 RTA_IIF:int:入力インターフェースの index
518 RTA_OIF:int:出力インターフェースの index
519 RTA_GATEWAY:protocol address:経路のゲートウェイ
520 RTA_PRIORITY:int:経路の優先度
522 RTA_METRICS:int:経路のメトリック
529 .\"O .B Fill these values in!
532 .BR RTM_NEWNEIGH ", " RTM_DELNEIGH ", " RTM_GETNEIGH
533 .\"O Add, remove or receive information about a neighbor table
534 .\"O entry (e.g., an ARP entry).
535 .\"O The message contains an
538 近傍テーブル (neighbor table) のエントリ
539 (例えば ARP エントリ) の情報を追加・削除・取得する。
546 unsigned char ndm_family;
547 int ndm_ifindex; /* Interface index */
548 __u16 ndm_state; /* State */
549 __u8 ndm_flags; /* Flags */
553 struct nda_cacheinfo {
562 .\"O is a bit mask of the following states:
568 .\"O NUD_INCOMPLETE:a currently resolving cache entry
569 .\"O NUD_REACHABLE:a confirmed working cache entry
570 .\"O NUD_STALE:an expired cache entry
571 .\"O NUD_DELAY:an entry waiting for a timer
572 .\"O NUD_PROBE:a cache entry that is currently reprobed
573 .\"O NUD_FAILED:an invalid cache entry
574 .\"O NUD_NOARP:a device with no destination cache
575 .\"O NUD_PERMANENT:a static entry
576 NUD_INCOMPLETE:現在レゾルブ中のキャッシュエントリ
577 NUD_REACHABLE:動作確認済みのキャッシュエントリ
578 NUD_STALE:期限切れのキャッシュエントリ
579 NUD_DELAY:タイマ待ちのキャッシュエントリ
580 NUD_PROBE:再確認中のキャッシュエントリ
581 NUD_FAILED:不正なキャッシュエントリ
582 NUD_NOARP:行き先キャッシュのないデバイス
583 NUD_PERMANENT:静的なエントリ
595 .\"O NTF_PROXY:a proxy arp entry
596 .\"O NTF_ROUTER:an IPv6 router
597 NTF_PROXY:プロクシ arp エントリ
602 .\" document the members of the struct better
605 .\"O struct has the following meanings for the
611 フィールドに応じてそれぞれ以下の意味を持つ:
615 .\"O NDA_UNSPEC:unknown type
616 .\"O NDA_DST:a neighbor cache n/w layer destination address
617 .\"O NDA_LLADDR:a neighbor cache link layer address
618 .\"O NDA_CACHEINFO:cache statistics.
620 NDA_DST:近傍キャッシュネットワーク層の行き先アドレス
621 NDA_LLADDR:近傍キャッシュリンク層のアドレス
622 NDA_CACHEINFO:キャッシュの統計
628 .\"O .B NDA_CACHEINFO
630 .\"O .I struct nda_cacheinfo
636 .I struct nda_cacheinfo
639 .BR RTM_NEWRULE ", " RTM_DELRULE ", " RTM_GETRULE
640 .\"O Add, delete or retrieve a routing rule.
643 ルーティングルールを追加・削除・取得する。
648 .BR RTM_NEWQDISC ", " RTM_DELQDISC ", " RTM_GETQDISC
649 .\"O Add, remove or get a queueing discipline.
650 .\"O The message contains a
652 .\"O and may be followed by a series of
654 キューイングルールを追加・削除・取得する。
657 を伴い、またそのあとに属性がいくつか続くこともある。
661 unsigned char tcm_family;
662 int tcm_ifindex; /* interface index */
663 __u32 tcm_handle; /* Qdisc handle */
664 __u32 tcm_parent; /* Parent qdisc */
673 .\"O rta_type:value type:Description
675 .\"O TCA_UNSPEC:-:unspecified
676 .\"O TCA_KIND:asciiz string:Name of queueing discipline
677 .\"O TCA_OPTIONS:byte sequence:Qdisc-specific options follow
678 .\"O TCA_STATS:struct tc_stats:Qdisc statistics.
679 .\"O TCA_XSTATS:qdisc specific:Module-specific statistics.
680 .\"O TCA_RATE:struct tc_estimator:Rate limit.
684 TCA_UNSPEC:-:指定されていない
685 TCA_KIND:asciiz string:キューイングルールの名前
686 TCA_OPTIONS:byte sequence:Qdisc 特有のオプションが続く
687 TCA_STATS:struct tc_stats:Qdisc の統計
688 TCA_XSTATS:qdisc specific:モジュール特有の統計
689 TCA_RATE:struct tc_estimator:レート制限
692 .\"O In addition various other qdisc module specific attributes are allowed.
693 .\"O For more information see the appropriate include files.
694 さらに、 qdisc モジュール特有の様々な属性を指定できる。
695 詳細な情報は適切なインクルードファイルを見よ。
697 .BR RTM_NEWTCLASS ", " RTM_DELTCLASS ", " RTM_GETTCLASS
698 .\"O Add, remove or get a traffic class.
699 .\"O These messages contain a
701 .\"O as described above.
702 トラフィッククラスを追加・削除・取得する。
707 .BR RTM_NEWTFILTER ", " RTM_DELTFILTER ", " RTM_GETTFILTER
708 .\"O Add, remove or receive information about a traffic filter.
709 .\"O These messages contain a
711 .\"O as described above.
712 トラフィックフィルターの情報を追加・削除・取得する。
719 .\"O is a new feature of Linux 2.2.
724 .\"O This manual page is incomplete.