.\" by Shouichi Saito <ss236rx@ymg.urban.ne.jp>
.\" Proofed Fri Aug 20 1999 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\"
-.\"WORD: payload ³ÊǼÎΰè
-.\"WORD: lvalue º¸ÊÕÃÍ
+.\"WORD: payload 格納領域
+.\"WORD: lvalue 左辺値
.\"
.TH NETLINK 3 1999-05-14 "GNU" "Linux Programmer's Manual"
-.SH ̾Á°
+.SH 名前
.\"O netlink \- Netlink macros
-netlink \- netlink ¥Þ¥¯¥í
-.SH ½ñ¼°
+netlink \- netlink マクロ
+.SH 書式
.nf
.\" FIXME . what will glibc 2.1 use here?
.\" May 2007: glibc 2.5, things look to be unchanged -- the header file
.br
.BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len );
.fi
-.SH ÀâÌÀ
+.SH 説明
.\"O .I <linux/netlink.h>
.\"O defines several standard macros to access or create a netlink datagram.
.\"O They are similar in spirit to the macros defined in
.\"O The buffer passed to and from a netlink socket should
.\"O only be accessed using these macros.
.I <linux/netlink.h>
-¤Ç¤Ï¡¢ netlink ¥Ç¡¼¥¿¥°¥é¥à¤Ë¥¢¥¯¥»¥¹¤·¤¿¤ê¡¢¤³¤ì¤òºîÀ®¤¹¤ë¤¿¤á¤Î
-ɸ½à¥Þ¥¯¥í¤¬¤¤¤¯¤Ä¤«ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
-¤³¤ì¤é¤Ï
+では、 netlink データグラムにアクセスしたり、これを作成するための
+標準マクロがいくつか定義されている。
+これらは
.BR cmsg (3)
-¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÊä½õ¥Ç¡¼¥¿ (auxiliary data) ÍѤΥޥ¯¥í¤È¡¢
-¤½¤ÎÀº¿À¤Ë¤ª¤¤¤Æ»÷¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ë¡£
-netlink ¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤ä¤ê¤È¤ê¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¡¢
-ɬ¤º¤³¤ì¤é¤Î¥Þ¥¯¥í¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤¹¤Ù¤¤Ç¤¢¤ë¡£
+で定義されている補助データ (auxiliary data) 用のマクロと、
+その精神において似ているものである。
+netlink ソケットに対してやりとりされるバッファには、
+必ずこれらのマクロを使ってアクセスすべきである。
.TP
.B NLMSG_ALIGN
.\"O Round the length of a netlink message up to align it properly.
-netlink ¥á¥Ã¥»¡¼¥¸¤ÎŤµ¤ò´Ý¤á¤ÆÀµ¤·¤¯Â·¤¨¤ë¡£
+netlink メッセージの長さを丸めて正しく揃える。
.TP
.B NLMSG_LENGTH
.\"O Given the payload length,
.\"O .I nlmsg_len
.\"O field of the
.\"O .IR nlmsghdr .
-³ÊǼÎΰè (payload) ¤ÎŤµ
+格納領域 (payload) の長さ
.I len
-¤ò°ú¿ô¤Ë¤È¤ê¡¢
+を引数にとり、
.I nlmsghdr
-¤Î
+の
.I nlmsg_len
-¥Õ¥£¡¼¥ë¥É¤ËÂåÆþ¤Ç¤¤ë
-·¤¨¤é¤ì¤¿Ä¹¤µ (aligned length) ¤òÊÖ¤¹¡£
+フィールドに代入できる
+揃えられた長さ (aligned length) を返す。
.TP
.B NLMSG_SPACE
.\"O Return the number of bytes that a netlink message with payload of
.\"O .I len
.\"O would occupy.
-¥Ú¥¤¥í¡¼¥É¤ÎŤµ¤¬
+ペイロードの長さが
.I len
-¤Î netlink ¥á¥Ã¥»¡¼¥¸¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
+の netlink メッセージのバイト数を返す。
.TP
.B NLMSG_DATA
.\"O Return a pointer to the payload associated with the passed
.\"O .IR nlmsghdr .
-Í¿¤¨¤¿
+与えた
.I nlmsghdr
-¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿³ÊǼÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
+に関連づけられた格納領域へのポインタを返す。
.TP
.\" this is bizarre, maybe the interface should be fixed.
.B NLMSG_NEXT
.\"O argument is an lvalue containing the remaining length
.\"O of the message buffer.
.\"O This macro decrements it by the length of the message header.
-¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Ë¤ª¤¤¤Æ¡¢¼¡¤Î
+マルチパートメッセージにおいて、次の
.I nlmsghdr
-¤òÆþ¼ê¤¹¤ë¡£¤³¤ì¤ò¸Æ¤Ó½Ð¤¹¤È¤¤Ë¤Ï¡¢
-¸½ºß¤Î nlmsghdr ¤Ç NLMSG_DONE ¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò
-³Îǧ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Î´Ø¿ô¤Ï½ªÃ¼¤Ç NULL ¤òÊÖ¤µ¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£
+を入手する。これを呼び出すときには、
+現在の nlmsghdr で NLMSG_DONE がセットされていないことを
+確認しなければならない。この関数は終端で NULL を返さないからである。
.I len
-°ú¿ô¤Ï¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤Î»Ä¤êŤµ¤¬Æþ¤Ã¤¿º¸ÊÕÃͤǤ¢¤ë¡£
-¤³¤Î¥Þ¥¯¥í¤Ï¤³¤Î°ú¿ô¤«¤é¥á¥Ã¥»¡¼¥¸¥Ø¥Ã¥À¤ÎŤµÊ¬¤òº¹¤·°ú¤¯¡£
+引数はメッセージバッファの残り長さが入った左辺値である。
+このマクロはこの引数からメッセージヘッダの長さ分を差し引く。
.TP
.B NLMSG_OK
.\"O Return true if the netlink message is not truncated and
.\"O is in a form suitable for parsing.
-Netlink ¥á¥Ã¥»¡¼¥¸¤¬ÅÓÀÚ¤ì¤Æ¤ª¤é¤º¡¢¤«¤Ä²ò¼á²Äǽ¤Ê·Á¤Î¾ì¹ç¤Ç¤¢¤ì¤Ð¿¿¤òÊÖ¤¹¡£
+Netlink メッセージが途切れておらず、かつ解釈可能な形の場合であれば真を返す。
.TP
.B NLMSG_PAYLOAD
.\"O Return the length of the payload associated with the
.\"O .IR nlmsghdr .
.I nlmsghdr
-¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿³ÊǼÎΰè¤ÎŤµ¤òÊÖ¤¹¡£
+に関連づけられた格納領域の長さを返す。
.\"O .SH CONFORMING TO
-.SH ½àµò
+.SH 準拠
.\"O These macros are nonstandard Linux extensions.
-¤³¤ì¤é¤Î¥Þ¥¯¥í¤ÏÈóɸ½à¤Ç Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£
-.SH Ãí°Õ
+これらのマクロは非標準で Linux での拡張である。
+.SH 注意
.\"O It is often better to use netlink via
.\"O .I libnetlink
.\"O than via the low-level kernel interface.
-Ä̾ï¤Ï¥«¡¼¥Í¥ë¤ÎÄã¥ì¥Ù¥ë¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤è¤ê¤â¡¢
+通常はカーネルの低レベルインターフェイスよりも、
.I libnetlink
-·Ðͳ¤Ç netlink ¤òÍѤ¤¤ë¤Û¤¦¤¬Îɤ¤¡£
-.SH ´ØÏ¢¹àÌÜ
+経由で netlink を用いるほうが良い。
+.SH 関連項目
.BR netlink (7)
.br
.\"O and ftp://ftp.inr.ac.ru/ip-routing/iproute2* for libnetlink
-¤ª¤è¤Ó libnetlink ¤Ë´Ø¤·¤Æ¤Ï ftp://ftp.inr.ac.ru/ip-routing/iproute2*
+および libnetlink に関しては ftp://ftp.inr.ac.ru/ip-routing/iproute2*