OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man3 / netlink.3
1 .\" This manpage copyright 1998 by Andi Kleen.
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Subject to the GPL.
5 .\" %%%LICENSE_END
6 .\"
7 .\" Based on the original comments from Alexey Kuznetsov
8 .\" $Id: netlink.3,v 1.1 1999/05/14 17:17:24 freitag Exp $
9 .\"
10 .\"*******************************************************************
11 .\"
12 .\" This file was generated with po4a. Translate the source file.
13 .\"
14 .\"*******************************************************************
15 .\"
16 .\" Japanese Version Copyright (c) 1999 Shouichi Saito
17 .\"     all rights reserved.
18 .\" Translated Mon Jul 26 12:18:39 JST 1999
19 .\"     by Shouichi Saito <ss236rx@ymg.urban.ne.jp>
20 .\" Proofed Fri Aug 20 1999 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
21 .\"
22 .TH NETLINK 3 2012\-08\-05 GNU "Linux Programmer's Manual"
23 .SH 名前
24 netlink \- netlink マクロ
25 .SH 書式
26 .nf
27 .\" FIXME . what will glibc 2.1 use here?
28 .\" May 2007: glibc 2.5, things look to be unchanged -- the header file
29 .\" is still linux/netlink.h -- mtk
30 \fB#include <asm/types.h>\fP
31 .br
32 \fB#include <linux/netlink.h>\fP
33 .sp
34 \fBint NLMSG_ALIGN(size_t \fP\fIlen\fP\fB);\fP
35 .br
36 \fBint NLMSG_LENGTH(size_t \fP\fIlen\fP\fB);\fP
37 .br
38 \fBint NLMSG_SPACE(size_t \fP\fIlen\fP\fB);\fP
39 .br
40 \fBvoid *NLMSG_DATA(struct nlmsghdr *\fP\fInlh\fP\fB);\fP
41 .br
42 \fBstruct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
43 .br
44 \fBint NLMSG_OK(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
45 .br
46 \fBint NLMSG_PAYLOAD(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
47 .fi
48 .SH 説明
49 \fI<linux/netlink.h>\fP では、 netlink データグラムにアクセスしたり、これを作成するための
50 標準マクロがいくつか定義されている。 これらは \fBcmsg\fP(3)  で定義されている補助データ (auxiliary data) 用のマクロと、
51 その精神において似ているものである。 netlink ソケットに対してやりとりされるバッファには、 必ずこれらのマクロだけを使ってアクセスすべきである。
52 .TP 
53 \fBNLMSG_ALIGN\fP
54 netlink メッセージの長さを丸めて正しく揃える。
55 .TP 
56 \fBNLMSG_LENGTH\fP
57 格納領域 (payload) の長さ \fIlen\fP を引数にとり、 \fInlmsghdr\fP の \fInlmsg_len\fP フィールドに代入できる
58 揃えられた長さ (aligned length) を返す。
59 .TP 
60 \fBNLMSG_SPACE\fP
61 ペイロードの長さが \fIlen\fP の netlink メッセージのバイト数を返す。
62 .TP 
63 \fBNLMSG_DATA\fP
64 与えた \fInlmsghdr\fP に関連づけられた格納領域へのポインタを返す。
65 .TP 
66 .\" this is bizarre, maybe the interface should be fixed.
67 \fBNLMSG_NEXT\fP
68 マルチパートメッセージにおいて、次の \fInlmsghdr\fP を入手する。これを呼び出すときには、 現在の nlmsghdr で NLMSG_DONE
69 がセットされていないことを 確認しなければならない。この関数は終端で NULL を返さないからである。 \fIlen\fP
70 引数はメッセージバッファの残り長さが入った左辺値である。 このマクロはこの引数からメッセージヘッダの長さ分を差し引く。
71 .TP 
72 \fBNLMSG_OK\fP
73 Netlink メッセージが途切れておらず、かつ解釈可能な形の場合であれば真を返す。
74 .TP 
75 \fBNLMSG_PAYLOAD\fP
76 \fInlmsghdr\fP に関連づけられた格納領域の長さを返す。
77 .SH 準拠
78 これらのマクロは非標準で、Linux での拡張である。
79 .SH 注意
80 通常はカーネルの低レベルインターフェイスよりも、 \fIlibnetlink\fP 経由で netlink を用いるほうが良い。
81 .SH 関連項目
82 \fBnetlink\fP(7)
83
84 libnetlink に関しては
85 .UR ftp://ftp.inr.ac.ru\:/ip\-routing\:/iproute2*
86 .UE
87 .SH この文書について
88 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
89 である。プロジェクトの説明とバグ報告に関する情報は
90 http://www.kernel.org/doc/man\-pages/ に書かれている。