OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / netlink.3
1 .\" This manpage copyright 1998 by Andi Kleen. Subject to the GPL.
2 .\" Based on the original comments from Alexey Kuznetsov
3 .\" $Id: netlink.3,v 1.4 2000/09/07 07:21:43 hanataka Exp $
4 .\"
5 .\" Japanese Version Copyright (c) 1999 Shouichi Saito
6 .\"     all rights reserved.
7 .\" Translated Mon Jul 26 12:18:39 JST 1999
8 .\"     by Shouichi Saito <ss236rx@ymg.urban.ne.jp>
9 .\" Proofed Fri Aug 20 1999 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
10 .\"
11 .\"WORD:        payload         格納領域
12 .\"WORD:        lvalue          左辺値
13 .\"
14 .TH NETLINK 3 1999-05-14 "GNU" "Linux Programmer's Manual"
15 .SH 名前
16 .\"O netlink \- Netlink macros
17 netlink \- netlink マクロ
18 .SH 書式
19 .nf
20 .\" FIXME . what will glibc 2.1 use here?
21 .\" May 2007: glibc 2.5, things look to be unchanged -- the header file
22 .\" is still linux/netlink.h -- mtk
23 .B #include <asm/types.h>
24 .br
25 .B #include <linux/netlink.h>
26 .sp
27 .BI "int NLMSG_ALIGN(size_t " len );
28 .br
29 .BI "int NLMSG_LENGTH(size_t " len );
30 .br
31 .BI "int NLMSG_SPACE(size_t " len );
32 .br
33 .BI "void *NLMSG_DATA(struct nlmsghdr *" nlh );
34 .br
35 .BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len );
36 .br
37 .BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len );
38 .br
39 .BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len );
40 .fi
41 .SH 説明
42 .\"O .I <linux/netlink.h>
43 .\"O defines several standard macros to access or create a netlink datagram.
44 .\"O They are similar in spirit to the macros defined in
45 .\"O .BR cmsg (3)
46 .\"O for auxiliary data.
47 .\"O The buffer passed to and from a netlink socket should
48 .\"O only be accessed using these macros.
49 .I <linux/netlink.h>
50 では、 netlink データグラムにアクセスしたり、これを作成するための
51 標準マクロがいくつか定義されている。
52 これらは
53 .BR cmsg (3)
54 で定義されている補助データ (auxiliary data) 用のマクロと、
55 その精神において似ているものである。
56 netlink ソケットに対してやりとりされるバッファには、
57 必ずこれらのマクロを使ってアクセスすべきである。
58 .TP
59 .B NLMSG_ALIGN
60 .\"O Round the length of a netlink message up to align it properly.
61 netlink メッセージの長さを丸めて正しく揃える。
62 .TP
63 .B NLMSG_LENGTH
64 .\"O Given the payload length,
65 .\"O .IR len ,
66 .\"O this macro returns the aligned length to store in the
67 .\"O .I nlmsg_len
68 .\"O field of the
69 .\"O .IR nlmsghdr .
70 格納領域 (payload) の長さ
71 .I len
72 を引数にとり、
73 .I nlmsghdr
74
75 .I nlmsg_len
76 フィールドに代入できる
77 揃えられた長さ (aligned length) を返す。
78 .TP
79 .B NLMSG_SPACE
80 .\"O Return the number of bytes that a netlink message with payload of
81 .\"O .I len
82 .\"O would occupy.
83 ペイロードの長さが
84 .I len
85 の netlink メッセージのバイト数を返す。
86 .TP
87 .B NLMSG_DATA
88 .\"O Return a pointer to the payload associated with the passed
89 .\"O .IR nlmsghdr .
90 与えた
91 .I nlmsghdr
92 に関連づけられた格納領域へのポインタを返す。
93 .TP
94 .\" this is bizarre, maybe the interface should be fixed.
95 .B NLMSG_NEXT
96 .\"O Get the next
97 .\"O .I nlmsghdr
98 .\"O in a multipart message.
99 .\"O The caller must check if the current nlmsghdr didn't have the NLMSG_DONE
100 .\"O set\(emthis function doesn't return NULL on end.
101 .\"O The
102 .\"O .I len
103 .\"O argument is an lvalue containing the remaining length
104 .\"O of the message buffer.
105 .\"O This macro decrements it by the length of the message header.
106 マルチパートメッセージにおいて、次の
107 .I nlmsghdr
108 を入手する。これを呼び出すときには、
109 現在の nlmsghdr で NLMSG_DONE がセットされていないことを
110 確認しなければならない。この関数は終端で NULL を返さないからである。
111 .I len
112 引数はメッセージバッファの残り長さが入った左辺値である。
113 このマクロはこの引数からメッセージヘッダの長さ分を差し引く。
114 .TP
115 .B NLMSG_OK
116 .\"O Return true if the netlink message is not truncated and
117 .\"O is in a form suitable for parsing.
118 Netlink メッセージが途切れておらず、かつ解釈可能な形の場合であれば真を返す。
119 .TP
120 .B NLMSG_PAYLOAD
121 .\"O Return the length of the payload associated with the
122 .\"O .IR nlmsghdr .
123 .I nlmsghdr
124 に関連づけられた格納領域の長さを返す。
125 .\"O .SH CONFORMING TO
126 .SH 準拠
127 .\"O These macros are nonstandard Linux extensions.
128 これらのマクロは非標準で Linux での拡張である。
129 .SH 注意
130 .\"O It is often better to use netlink via
131 .\"O .I libnetlink
132 .\"O than via the low-level kernel interface.
133 通常はカーネルの低レベルインターフェイスよりも、
134 .I libnetlink
135 経由で netlink を用いるほうが良い。
136 .SH 関連項目
137 .BR netlink (7)
138 .br
139 .\"O and ftp://ftp.inr.ac.ru/ip-routing/iproute2* for libnetlink
140 および libnetlink に関しては ftp://ftp.inr.ac.ru/ip-routing/iproute2*