OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / 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.1 1999/05/14 17:17:24 freitag Exp $
4 .\"*******************************************************************
5 .\"
6 .\" This file was generated with po4a. Translate the source file.
7 .\"
8 .\"*******************************************************************
9 .TH NETLINK 3 1999\-05\-14 GNU "Linux Programmer's Manual"
10 .SH 名前
11 netlink \- netlink マクロ
12 .SH 書式
13 .nf
14 .\" FIXME . what will glibc 2.1 use here?
15 .\" May 2007: glibc 2.5, things look to be unchanged -- the header file
16 .\" is still linux/netlink.h -- mtk
17 \fB#include <asm/types.h>\fP
18 .br
19 \fB#include <linux/netlink.h>\fP
20 .sp
21 \fBint NLMSG_ALIGN(size_t \fP\fIlen\fP\fB);\fP
22 .br
23 \fBint NLMSG_LENGTH(size_t \fP\fIlen\fP\fB);\fP
24 .br
25 \fBint NLMSG_SPACE(size_t \fP\fIlen\fP\fB);\fP
26 .br
27 \fBvoid *NLMSG_DATA(struct nlmsghdr *\fP\fInlh\fP\fB);\fP
28 .br
29 \fBstruct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
30 .br
31 \fBint NLMSG_OK(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
32 .br
33 \fBint NLMSG_PAYLOAD(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
34 .fi
35 .SH 説明
36 \fI<linux/netlink.h>\fP では、 netlink データグラムにアクセスしたり、これを作成するための
37 標準マクロがいくつか定義されている。 これらは \fBcmsg\fP(3)  で定義されている補助データ (auxiliary data) 用のマクロと、
38 その精神において似ているものである。 netlink ソケットに対してやりとりされるバッファには、 必ずこれらのマクロを使ってアクセスすべきである。
39 .TP 
40 \fBNLMSG_ALIGN\fP
41 netlink メッセージの長さを丸めて正しく揃える。
42 .TP 
43 \fBNLMSG_LENGTH\fP
44 格納領域 (payload) の長さ \fIlen\fP を引数にとり、 \fInlmsghdr\fP の \fInlmsg_len\fP フィールドに代入できる
45 揃えられた長さ (aligned length) を返す。
46 .TP 
47 \fBNLMSG_SPACE\fP
48 ペイロードの長さが \fIlen\fP の netlink メッセージのバイト数を返す。
49 .TP 
50 \fBNLMSG_DATA\fP
51 与えた \fInlmsghdr\fP に関連づけられた格納領域へのポインタを返す。
52 .TP 
53 .\" this is bizarre, maybe the interface should be fixed.
54 \fBNLMSG_NEXT\fP
55 マルチパートメッセージにおいて、次の \fInlmsghdr\fP を入手する。これを呼び出すときには、 現在の nlmsghdr で NLMSG_DONE
56 がセットされていないことを 確認しなければならない。この関数は終端で NULL を返さないからである。 \fIlen\fP
57 引数はメッセージバッファの残り長さが入った左辺値である。 このマクロはこの引数からメッセージヘッダの長さ分を差し引く。
58 .TP 
59 \fBNLMSG_OK\fP
60 Netlink メッセージが途切れておらず、かつ解釈可能な形の場合であれば真を返す。
61 .TP 
62 \fBNLMSG_PAYLOAD\fP
63 \fInlmsghdr\fP に関連づけられた格納領域の長さを返す。
64 .SH 準拠
65 これらのマクロは非標準で、Linux での拡張である。
66 .SH 注意
67 通常はカーネルの低レベルインターフェイスよりも、 \fIlibnetlink\fP 経由で netlink を用いるほうが良い。
68 .SH 関連項目
69 \fBnetlink\fP(7)
70 .br
71 および libnetlink に関しては ftp://ftp.inr.ac.ru/ip\-routing/iproute2*