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 $
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>
14 .TH NETLINK 3 1999-05-14 "GNU" "Linux Programmer's Manual"
16 .\"O netlink \- Netlink macros
17 netlink \- netlink マクロ
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>
25 .B #include <linux/netlink.h>
27 .BI "int NLMSG_ALIGN(size_t " len );
29 .BI "int NLMSG_LENGTH(size_t " len );
31 .BI "int NLMSG_SPACE(size_t " len );
33 .BI "void *NLMSG_DATA(struct nlmsghdr *" nlh );
35 .BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len );
37 .BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len );
39 .BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len );
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
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.
50 では、 netlink データグラムにアクセスしたり、これを作成するための
54 で定義されている補助データ (auxiliary data) 用のマクロと、
56 netlink ソケットに対してやりとりされるバッファには、
57 必ずこれらのマクロを使ってアクセスすべきである。
60 .\"O Round the length of a netlink message up to align it properly.
61 netlink メッセージの長さを丸めて正しく揃える。
64 .\"O Given the payload length,
66 .\"O this macro returns the aligned length to store in the
77 揃えられた長さ (aligned length) を返す。
80 .\"O Return the number of bytes that a netlink message with payload of
85 の netlink メッセージのバイト数を返す。
88 .\"O Return a pointer to the payload associated with the passed
92 に関連づけられた格納領域へのポインタを返す。
94 .\" this is bizarre, maybe the interface should be fixed.
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.
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.
109 現在の nlmsghdr で NLMSG_DONE がセットされていないことを
110 確認しなければならない。この関数は終端で NULL を返さないからである。
112 引数はメッセージバッファの残り長さが入った左辺値である。
113 このマクロはこの引数からメッセージヘッダの長さ分を差し引く。
116 .\"O Return true if the netlink message is not truncated and
117 .\"O is in a form suitable for parsing.
118 Netlink メッセージが途切れておらず、かつ解釈可能な形の場合であれば真を返す。
121 .\"O Return the length of the payload associated with the
125 .\"O .SH CONFORMING TO
127 .\"O These macros are nonstandard Linux extensions.
128 これらのマクロは非標準で Linux での拡張である。
130 .\"O It is often better to use netlink via
132 .\"O than via the low-level kernel interface.
133 通常はカーネルの低レベルインターフェイスよりも、
135 経由で netlink を用いるほうが良い。
139 .\"O and ftp://ftp.inr.ac.ru/ip-routing/iproute2* for libnetlink
140 および libnetlink に関しては ftp://ftp.inr.ac.ru/ip-routing/iproute2*