OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[linuxjm/LDP_man-pages.git] / draft / 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.4 2000/09/07 07:21:43 hanataka Exp $
4 .\"
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>
10 .\"
11 .\"WORD:        payload         ³ÊǼÎΰè
12 .\"WORD:        lvalue          º¸ÊÕÃÍ
13 .\"
14 .TH NETLINK 3 1999-05-14 "GNU" "Linux Programmer's Manual"
15 .SH Ì¾Á°
16 .\"O netlink \- Netlink macros
17 netlink \- netlink ¥Þ¥¯¥í
18 .SH ½ñ¼°
19 .nf
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>
24 .br
25 .B #include <linux/netlink.h>
26 .sp
27 .BI "int NLMSG_ALIGN(size_t " len );
28 .br
29 .BI "int NLMSG_LENGTH(size_t " len );
30 .br
31 .BI "int NLMSG_SPACE(size_t " len );
32 .br
33 .BI "void *NLMSG_DATA(struct nlmsghdr *" nlh );
34 .br
35 .BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len );
36 .br
37 .BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len );
38 .br
39 .BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len );
40 .fi
41 .SH ÀâÌÀ
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
45 .\"O .BR cmsg (3)
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.
49 .I <linux/netlink.h>
50 ¤Ç¤Ï¡¢ netlink ¥Ç¡¼¥¿¥°¥é¥à¤Ë¥¢¥¯¥»¥¹¤·¤¿¤ê¡¢¤³¤ì¤òºîÀ®¤¹¤ë¤¿¤á¤Î
51 ɸ½à¥Þ¥¯¥í¤¬¤¤¤¯¤Ä¤«ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
52 ¤³¤ì¤é¤Ï
53 .BR cmsg (3)
54 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÊä½õ¥Ç¡¼¥¿ (auxiliary data) ÍѤΥޥ¯¥í¤È¡¢
55 ¤½¤ÎÀº¿À¤Ë¤ª¤¤¤Æ»÷¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ë¡£
56 netlink ¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤ä¤ê¤È¤ê¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¡¢
57 ɬ¤º¤³¤ì¤é¤Î¥Þ¥¯¥í¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤¢¤ë¡£
58 .TP
59 .B NLMSG_ALIGN
60 .\"O Round the length of a netlink message up to align it properly.
61 netlink ¥á¥Ã¥»¡¼¥¸¤ÎŤµ¤ò´Ý¤á¤ÆÀµ¤·¤¯Â·¤¨¤ë¡£
62 .TP
63 .B NLMSG_LENGTH
64 .\"O Given the payload length,
65 .\"O .IR len ,
66 .\"O this macro returns the aligned length to store in the
67 .\"O .I nlmsg_len
68 .\"O field of the
69 .\"O .IR nlmsghdr .
70 ³ÊǼÎΰè (payload) ¤ÎŤµ
71 .I len
72 ¤ò°ú¿ô¤Ë¤È¤ê¡¢
73 .I nlmsghdr
74 ¤Î
75 .I nlmsg_len
76 ¥Õ¥£¡¼¥ë¥É¤ËÂåÆþ¤Ç¤­¤ë
77 ·¤¨¤é¤ì¤¿Ä¹¤µ (aligned length) ¤òÊÖ¤¹¡£
78 .TP
79 .B NLMSG_SPACE
80 .\"O Return the number of bytes that a netlink message with payload of
81 .\"O .I len
82 .\"O would occupy.
83 ¥Ú¥¤¥í¡¼¥É¤ÎŤµ¤¬
84 .I len
85 ¤Î netlink ¥á¥Ã¥»¡¼¥¸¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
86 .TP
87 .B NLMSG_DATA
88 .\"O Return a pointer to the payload associated with the passed
89 .\"O .IR nlmsghdr .
90 Í¿¤¨¤¿
91 .I nlmsghdr
92 ¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿³ÊǼÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
93 .TP
94 .\" this is bizarre, maybe the interface should be fixed.
95 .B NLMSG_NEXT
96 .\"O Get the next
97 .\"O .I nlmsghdr
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.
101 .\"O The
102 .\"O .I len
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 ¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Ë¤ª¤¤¤Æ¡¢¼¡¤Î
107 .I nlmsghdr
108 ¤òÆþ¼ê¤¹¤ë¡£¤³¤ì¤ò¸Æ¤Ó½Ð¤¹¤È¤­¤Ë¤Ï¡¢
109 ¸½ºß¤Î nlmsghdr ¤Ç NLMSG_DONE ¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò
110 ³Îǧ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Î´Ø¿ô¤Ï½ªÃ¼¤Ç NULL ¤òÊÖ¤µ¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£
111 .I len
112 °ú¿ô¤Ï¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤Î»Ä¤êŤµ¤¬Æþ¤Ã¤¿º¸ÊÕÃͤǤ¢¤ë¡£
113 ¤³¤Î¥Þ¥¯¥í¤Ï¤³¤Î°ú¿ô¤«¤é¥á¥Ã¥»¡¼¥¸¥Ø¥Ã¥À¤ÎŤµÊ¬¤òº¹¤·°ú¤¯¡£
114 .TP
115 .B NLMSG_OK
116 .\"O Return true if the netlink message is not truncated and
117 .\"O is in a form suitable for parsing.
118 Netlink ¥á¥Ã¥»¡¼¥¸¤¬ÅÓÀÚ¤ì¤Æ¤ª¤é¤º¡¢¤«¤Ä²ò¼á²Äǽ¤Ê·Á¤Î¾ì¹ç¤Ç¤¢¤ì¤Ð¿¿¤òÊÖ¤¹¡£
119 .TP
120 .B NLMSG_PAYLOAD
121 .\"O Return the length of the payload associated with the
122 .\"O .IR nlmsghdr .
123 .I nlmsghdr
124 ¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿³ÊǼÎΰè¤ÎŤµ¤òÊÖ¤¹¡£
125 .\"O .SH CONFORMING TO
126 .SH ½àµò
127 .\"O These macros are nonstandard Linux extensions.
128 ¤³¤ì¤é¤Î¥Þ¥¯¥í¤ÏÈóɸ½à¤Ç Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£
129 .SH Ãí°Õ
130 .\"O It is often better to use netlink via
131 .\"O .I libnetlink
132 .\"O than via the low-level kernel interface.
133 Ä̾ï¤Ï¥«¡¼¥Í¥ë¤ÎÄã¥ì¥Ù¥ë¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤è¤ê¤â¡¢
134 .I libnetlink
135 ·Ðͳ¤Ç netlink ¤òÍѤ¤¤ë¤Û¤¦¤¬Îɤ¤¡£
136 .SH ´ØÏ¢¹àÌÜ
137 .BR netlink (7)
138 .br
139 .\"O and ftp://ftp.inr.ac.ru/ip-routing/iproute2* for libnetlink
140 ¤ª¤è¤Ó libnetlink ¤Ë´Ø¤·¤Æ¤Ï ftp://ftp.inr.ac.ru/ip-routing/iproute2*