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 .\"*******************************************************************
6 .\" This file was generated with po4a. Translate the source file.
8 .\"*******************************************************************
9 .TH NETLINK 3 1999\-05\-14 GNU "Linux Programmer's Manual"
11 netlink \- netlink マクロ
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
19 \fB#include <linux/netlink.h>\fP
21 \fBint NLMSG_ALIGN(size_t \fP\fIlen\fP\fB);\fP
23 \fBint NLMSG_LENGTH(size_t \fP\fIlen\fP\fB);\fP
25 \fBint NLMSG_SPACE(size_t \fP\fIlen\fP\fB);\fP
27 \fBvoid *NLMSG_DATA(struct nlmsghdr *\fP\fInlh\fP\fB);\fP
29 \fBstruct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
31 \fBint NLMSG_OK(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
33 \fBint NLMSG_PAYLOAD(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP
36 \fI<linux/netlink.h>\fP では、 netlink データグラムにアクセスしたり、これを作成するための
37 標準マクロがいくつか定義されている。 これらは \fBcmsg\fP(3) で定義されている補助データ (auxiliary data) 用のマクロと、
38 その精神において似ているものである。 netlink ソケットに対してやりとりされるバッファには、 必ずこれらのマクロを使ってアクセスすべきである。
41 netlink メッセージの長さを丸めて正しく揃える。
44 格納領域 (payload) の長さ \fIlen\fP を引数にとり、 \fInlmsghdr\fP の \fInlmsg_len\fP フィールドに代入できる
45 揃えられた長さ (aligned length) を返す。
48 ペイロードの長さが \fIlen\fP の netlink メッセージのバイト数を返す。
51 与えた \fInlmsghdr\fP に関連づけられた格納領域へのポインタを返す。
53 .\" this is bizarre, maybe the interface should be fixed.
55 マルチパートメッセージにおいて、次の \fInlmsghdr\fP を入手する。これを呼び出すときには、 現在の nlmsghdr で NLMSG_DONE
56 がセットされていないことを 確認しなければならない。この関数は終端で NULL を返さないからである。 \fIlen\fP
57 引数はメッセージバッファの残り長さが入った左辺値である。 このマクロはこの引数からメッセージヘッダの長さ分を差し引く。
60 Netlink メッセージが途切れておらず、かつ解釈可能な形の場合であれば真を返す。
63 \fInlmsghdr\fP に関連づけられた格納領域の長さを返す。
65 これらのマクロは非標準で、Linux での拡張である。
67 通常はカーネルの低レベルインターフェイスよりも、 \fIlibnetlink\fP 経由で netlink を用いるほうが良い。
71 および libnetlink に関しては ftp://ftp.inr.ac.ru/ip\-routing/iproute2*