OSDN Git Service

2aa8859f50cd58992ac7268b8540c3a69216fd86
[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 .TH NETLINK 3 2012\-08\-05 GNU "Linux Programmer's Manual"
16 .SH 名前
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 \fB#include <asm/types.h>\fP
24 .br
25 \fB#include <linux/netlink.h>\fP
26 .sp
27 \fBint NLMSG_ALIGN(size_t \fP\fIlen\fP\fB);\fP
28 .br
29 \fBint NLMSG_LENGTH(size_t \fP\fIlen\fP\fB);\fP
30 .br
31 \fBint NLMSG_SPACE(size_t \fP\fIlen\fP\fB);\fP
32 .br
33 \fBvoid *NLMSG_DATA(struct nlmsghdr *\fP\fInlh\fP\fB);\fP
34 .br
35 \fBstruct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
36 .br
37 \fBint NLMSG_OK(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
38 .br
39 \fBint NLMSG_PAYLOAD(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
40 .fi
41 .SH 説明
42 \fI<linux/netlink.h>\fP では、 netlink データグラムにアクセスしたり、これを作成するための
43 標準マクロがいくつか定義されている。 これらは \fBcmsg\fP(3)  で定義されている補助データ (auxiliary data) 用のマクロと、
44 その精神において似ているものである。 netlink ソケットに対してやりとりされるバッファには、 必ずこれらのマクロだけを使ってアクセスすべきである。
45 .TP 
46 \fBNLMSG_ALIGN\fP
47 netlink メッセージの長さを丸めて正しく揃える。
48 .TP 
49 \fBNLMSG_LENGTH\fP
50 格納領域 (payload) の長さ \fIlen\fP を引数にとり、 \fInlmsghdr\fP の \fInlmsg_len\fP フィールドに代入できる
51 揃えられた長さ (aligned length) を返す。
52 .TP 
53 \fBNLMSG_SPACE\fP
54 ペイロードの長さが \fIlen\fP の netlink メッセージのバイト数を返す。
55 .TP 
56 \fBNLMSG_DATA\fP
57 与えた \fInlmsghdr\fP に関連づけられた格納領域へのポインタを返す。
58 .TP 
59 .\" this is bizarre, maybe the interface should be fixed.
60 \fBNLMSG_NEXT\fP
61 マルチパートメッセージにおいて、次の \fInlmsghdr\fP を入手する。これを呼び出すときには、 現在の nlmsghdr で NLMSG_DONE
62 がセットされていないことを 確認しなければならない。この関数は終端で NULL を返さないからである。 \fIlen\fP
63 引数はメッセージバッファの残り長さが入った左辺値である。 このマクロはこの引数からメッセージヘッダの長さ分を差し引く。
64 .TP 
65 \fBNLMSG_OK\fP
66 Netlink メッセージが途切れておらず、かつ解釈可能な形の場合であれば真を返す。
67 .TP 
68 \fBNLMSG_PAYLOAD\fP
69 \fInlmsghdr\fP に関連づけられた格納領域の長さを返す。
70 .SH 準拠
71 これらのマクロは非標準で、Linux での拡張である。
72 .SH 注意
73 通常はカーネルの低レベルインターフェイスよりも、 \fIlibnetlink\fP 経由で netlink を用いるほうが良い。
74 .SH 関連項目
75 \fBnetlink\fP(7)
76
77 libnetlink に関しては
78 .UR ftp://ftp.inr.ac.ru\:/ip\-routing\:/iproute2*
79 .UE
80 .SH この文書について
81 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
82 である。プロジェクトの説明とバグ報告に関する情報は
83 http://www.kernel.org/doc/man\-pages/ に書かれている。