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>
11 .\"WORD: payload ³ÊǼÎΰè
12 .\"WORD: lvalue º¸ÊÕÃÍ
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 ¥Ç¡¼¥¿¥°¥é¥à¤Ë¥¢¥¯¥»¥¹¤·¤¿¤ê¡¢¤³¤ì¤òºîÀ®¤¹¤ë¤¿¤á¤Î
51 ɸ½à¥Þ¥¯¥í¤¬¤¤¤¯¤Ä¤«ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
54 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÊä½õ¥Ç¡¼¥¿ (auxiliary data) ÍѤΥޥ¯¥í¤È¡¢
55 ¤½¤ÎÀº¿À¤Ë¤ª¤¤¤Æ»÷¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ë¡£
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
70 ³ÊǼÎΰè (payload) ¤ÎŤµ
76 ¥Õ¥£¡¼¥ë¥É¤ËÂåÆþ¤Ç¤¤ë
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.
106 ¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Ë¤ª¤¤¤Æ¡¢¼¡¤Î
108 ¤òÆþ¼ê¤¹¤ë¡£¤³¤ì¤ò¸Æ¤Ó½Ð¤¹¤È¤¤Ë¤Ï¡¢
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
124 ¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿³ÊǼÎΰè¤ÎŤµ¤òÊÖ¤¹¡£
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*