OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/iptables.git] / draft / man3 / libipq.3
1 .\"O .TH LIBIPQ 3 "16 October 2001" "Linux iptables 1.2" "Linux Programmer's Manual" 
2 .TH LIBIPQ 3 "16 October 2001" "Linux iptables 1.2" "Linux Programmer's Manual" 
3 .\"
4 .\" $Id: libipq.3,v 1.4 2001/10/16 16:58:25 jamesm Exp $
5 .\"
6 .\"     Copyright (c) 2000-2001 Netfilter Core Team
7 .\"
8 .\"     This program is free software; you can redistribute it and/or modify
9 .\"     it under the terms of the GNU General Public License as published by
10 .\"     the Free Software Foundation; either version 2 of the License, or
11 .\"     (at your option) any later version.
12 .\"
13 .\"     This program is distributed in the hope that it will be useful,
14 .\"     but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\"     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\"     GNU General Public License for more details.
17 .\"
18 .\"     You should have received a copy of the GNU General Public License
19 .\"     along with this program; if not, write to the Free Software
20 .\"     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 .\"
22 .\" Japanese Version Copyright (c) 2003 Susumu ISHIZUKA
23 .\"         all rights reserved.
24 .\" Translated Tue Jun  6 19:25:23 JST 2003
25 .\"         by Susumu ISHIZUKA <szuka@isp.co.jp>
26 .\"
27 .\"WORD:        userspace       ¥æ¡¼¥¶¶õ´Ö
28 .\"WORD:        verdict         È½ÃÇ
29 .\"O .SH NAME
30 .SH Ì¾Á°
31 libipq \- iptables userspace packet queuing library.
32 .\"O .SH SYNOPSIS
33 .SH ½ñ¼°
34 .B #include <linux/netfilter.h>
35 .br
36 .B #include <libipq.h>
37 .\"O .SH DESCRIPTION
38 .SH ÀâÌÀ
39 .\"O libipq is a development library for iptables userspace packet queuing.
40 libipq ¤Ï iptables ¤ò »È¤Ã¤Æ ¥æ¡¼¥¶¶õ´Ö¤Ç¥Ñ¥±¥Ã¥ÈÁàºî¤ò
41 ¤¹¤ë¤¿¤á¤Î¥é¥¤¥Ö¥é¥ê¤Ç¤¢¤ë¡£
42 .SS Userspace Packet Queuing
43 .\"O Netfilter provides a mechanism for passing packets out of the stack for
44 .\"O queueing to userspace, then receiving these packets back into the kernel
45 .\"O with a verdict specifying what to do with the packets (such as ACCEPT
46 .\"O or DROP).  These packets may also be modified in userspace prior to
47 .\"O reinjection back into the kernel.
48 Netfilter ¤Ï¡¢¥æ¡¼¥¶¶õ´Ö¤Ç¥Ñ¥±¥Ã¥ÈÁàºî¤ò¤¹¤ë¤¿¤á¤Îµ¡¹½¤ò 
49 Ä󶡤·¤Æ¤¤¤ë¡£ ¤³¤Îµ¡¹½¤Ï¥×¥í¥È¥³¥ë¥¹¥¿¥Ã¥¯¤«¤é¥Ñ¥±¥Ã¥È¤ò 
50 ¥æ¡¼¥¶¶õ´Ö¤ËÅϤ·¤Æ¥­¥å¡¼¥¤¥ó¥°(queuing) ¤·¡¢¥æ¡¼¥¶¶õ´Ö¤Ç 
51 (ACCEPT ¤ä DROP ¤È¤¤¤Ã¤¿) ¥Ñ¥±¥Ã¥È½èÍý¤ÎȽÃǤò¹Ô¤Ã¤¿¸å¤Ë
52 ¥Ñ¥±¥Ã¥È¤ò¥«¡¼¥Í¥ë¤ËÌᤷ¤Æ¤¤¤ë¡£ ¤³¤ì¤é¤Î¥Ñ¥±¥Ã¥È¤Ï¡¢ 
53 ¥æ¡¼¥¶¶õ´Ö¤ÇÊѹ¹¤ò²Ã¤¨¤é¤ì¤Æ¡¢¥«¡¼¥Í¥ë¤ËÊÖ¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ 
54 .PP
55 .\"O For each supported protocol, a kernel module called a
56 .\"O .I queue handler
57 .\"O may register with Netfilter to perform the mechanics of passing
58 .\"O packets to and from userspace.
59 ¥æ¡¼¥¶¶õ´Ö¤È¤Î¥Ñ¥±¥Ã¥È¤Î¤ä¤ê¼è¤ê¤Î¤¿¤á¤Ë
60 .I ¥­¥å¡¼¥Ï¥ó¥É¥é¡¼ (queue handler)
61 ¤È¸Æ¤Ð¤ì¤ë¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤¬ 
62 Netfilter ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¡£ 
63 ¥­¥å¡¼¥Ï¥ó¥É¥é¡¼¤Ï¡¢³Æ¥×¥í¥È¥³¥ë¤´¤È¤Ë ÍÑ°Õ¤µ¤ì¤ë¡£
64 .PP
65 .\"O The standard queue handler for IPv4 is ip_queue.  It is provided as an
66 .\"O experimental module with 2.4 kernels, and uses a Netlink socket for
67 .\"O kernel/userspace communication.
68 IPv4 ¤Ç¤Î É¸½à¤Î¥­¥å¡¼¥Ï¥ó¥É¥é¡¼¤Ï ip_queue ¤Ç¤¢¤ë¡£ 
69 2.4¥«¡¼¥Í¥ë¤Ç¤Ï experimental ¥â¥¸¥å¡¼¥ë¤È¤·¤ÆÄ󶡤µ¤ì¡¢
70 Netlink ¥½¥±¥Ã¥È¤ò»È¤Ã¤Æ¡¢¥«¡¼¥Í¥ë¤È¥æ¡¼¥¶¶õ´Ö¤È¤ÎÄÌ¿®¤ò
71 ¹Ô¤Ã¤Æ¤¤¤ë¡£ 
72 .PP
73 .\"O Once ip_queue is loaded, IP packets may be selected with iptables
74 .\"O and queued for userspace processing via the QUEUE target.  For example,
75 .\"O running the following commands:
76 ip_queue ¤¬¡¢¥á¥â¥ê¾å¤Ë¥í¡¼¥É¤µ¤ì¤ë¤È IP ¥Ñ¥±¥Ã¥È¤Ï iptables ¤Ç
77 ¥Õ¥£¥ë¥¿¥ê¥ó¥°¤µ¤ì QUEUE ¥¿¡¼¥²¥Ã¥È¤Ë¤è¤Ã¤Æ ¥æ¡¼¥¶¶õ´Ö¤Î ½èÍý¤Î¤¿¤á¤Ë
78 ¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤ë¡£ Îã¤È¤·¤Æ ¼¡¤Î°ìÏ¢¤Î ¥³¥Þ¥ó¥É¤¬È¯¹Ô¤µ¤ì¤ë¤È¡¢
79 .PP
80         # modprobe iptable_filter
81 .br     
82         # modprobe ip_queue
83 .br     
84         # iptables -A OUTPUT -p icmp -j QUEUE
85 .PP
86 .\"O will cause any locally generated ICMP packets (e.g. ping output) to
87 .\"O be sent to the ip_queue module, which will then attempt to deliver the
88 .\"O packets to a userspace application.  If no userspace application is waiting,
89 .\"O the packets will be dropped
90 ¥í¡¼¥«¥ë¥Û¥¹¥È¤«¤éÁ÷¿®¤µ¤ì¤¿ICMP¥Ñ¥±¥Ã¥È¡Êping¤ÎÁ÷¿®¤Ê¤É¡Ë¤¬
91 ip_queue¥â¥¸¥å¡¼¥ë¤ËÁ÷¤é¤ì¡¢¤½¤³¤«¤é¥Ñ¥±¥Ã¥È¤ò¥æ¡¼¥¶¶õ´Ö¤Î
92 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÅϤ½¤¦¤È¤¹¤ë¡£ ¥Ñ¥±¥Ã¥È¤ò¼õ¤±¼è¤ë
93 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ñ¥±¥Ã¥È¤ÏÇË´þ¡Êdrop¡Ë¤µ¤ì¤ë¡£ 
94 .PP
95 .\"O An application may receive and process these packets via libipq.
96 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢libipq ¤ò»È¤¦¤³¤È¤Ç¥Ñ¥±¥Ã¥È¤ò¼õ¿®¡¦
97 Êѹ¹¤Ç¤­¤ë¡£ 
98 .PP
99 .PP
100 .SS Libipq Overview
101 .\"O Libipq provides an API for communicating with ip_queue.  The following is
102 .\"O an overview of API usage, refer to individual man pages for more details
103 .\"O on each function.
104 libipq ¤Ï¡¢ip_queue ¤ÈÄÌ¿®¤¹¤ë¤¿¤á¤Î API ¤òÄ󶡤¹¤ë¡£ 
105 °Ê²¼¤Ï¡¢API ¤Î´Êñ¤ÊÀâÌÀ¤Ç¤¢¤ë¡£ ´Ø¿ô¤Î¾ÜºÙ¤Ï³Æ manpage ¤ò
106 »²¾È¤¹¤ë¤³¤È¡£ 
107 .\P
108 .\"O .B Initialisation
109 .B ½é´ü²½
110 .br
111 .\"O To initialise the library, call
112 .\"O .BR ipq_create_handle (3).
113 .\"O This will attempt to bind to the Netlink socket used by ip_queue and
114 .\"O return an opaque context handle for subsequent library calls.
115 ½é´ü²½¤ò¹Ô¤¦¤Ë¤Ï¡¢
116 .BR ipq_create_handle (3)
117 ¤ò»ÈÍѤ¹¤ë¡£ 
118 ¤³¤Î´Ø¿ô¤Ï ip_queue ¤¬»ÈÍѤ·¤Æ¤¤¤ë Netlink ¥½¥±¥Ã¥È¤ò bind
119 ¤·¡¢¤³¤Î¸å¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤¬»ÈÍѤ¹¤ë¥³¥ó¥Æ¥­¥¹¥È¥Ï¥ó¥É¥ë¤ò
120 ÊÖ¤¹¡£ 
121 .PP
122 .\"O .B Setting the Queue Mode
123 .B ¥­¥å¡¼¥â¡¼¥É¡Êqueue mode¡Ë¤ÎÀßÄê
124 .br
125 .\"O .BR ipq_set_mode (3)
126 .\"O allows the application to specify whether packet metadata, or packet
127 .\"O payloads as well as metadata are copied to userspace.  It is also used to
128 .\"O initially notify ip_queue that an application is ready to receive queue
129 .\"O messages.
130 .BR ipq_set_mode (3)
131 ¤Ï¡¢¥æ¡¼¥¶¶õ´Ö¤Ë¥Ñ¥±¥Ã¥È¤Î¥á¥¿¥Ç¡¼¥¿¤À¤±¤ò
132 ¥³¥Ô¡¼¤¹¤ë¤Î¤«¡¢¥Ñ¥±¥Ã¥È¤Î¥á¥¿¥Ç¡¼¥¿¤È¥Ú¥¤¥í¡¼¥É¤ÎξÊý¤ò
133 ¥³¥Ô¡¼¤¹¤ë¤Î¤«»ØÄꤹ¤ë¡£¤³¤Î´Ø¿ô¤Ï¤Þ¤¿ ip_queue ¤Ë
134 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥­¥å¡¼¥á¥Ã¥»¡¼¥¸ (queue message)¤ò¼õ¤±
135 ¼è¤ë½àÈ÷¤¬¤Ç¤­¤¿¤³¤È¤òÄÌÃΤ¹¤ë¡£ 
136 .PP
137 .\"O .B Receiving Packets from the Queue
138 .B ¥­¥å¡¼¤«¤é¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤¹¤ë
139 .br
140 .\"O .BR ipq_read (3)
141 .\"O waits for queue messages to arrive from ip_queue and copies
142 .\"O them into a supplied buffer.
143 .\"O Queue messages may be
144 .\"O .I packet messages
145 .\"O or
146 .\"O .I error messages.
147 .BR ipq_read (3)
148 ´Ø¿ô¤Ï ip_queue ¤«¤é¤Î¥­¥å¡¼¥á¥Ã¥»¡¼¥¸¤ò
149 ÂԤäơ¢¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤¹¤ë¡£ ¥­¥å¡¼¥á¥Ã¥»¡¼¥¸¤Ï
150 .I ¥Ñ¥±¥Ã¥È ¥á¥Ã¥»¡¼¥¸
151 ¤Þ¤¿¤Ï
152 .I ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
153 ¤Î¤É¤Á¤é¤« ¤Ç¤¢¤ë¡£
154 .PP
155 .\"O The type of packet may be determined with
156 .\"O .BR ipq_message_type (3).
157 ¥Ñ¥±¥Ã¥È¤Î¥¿¥¤¥×¤Ï
158 .BR ipq_message_type (3)
159 ¤Ç¼èÆÀ¤¹¤ë¡£
160 .PP
161 .\"O If it's a packet message, the metadata and optional payload may be retrieved with
162 .\"O .BR ipq_get_packet (3).
163 ¥Ñ¥±¥Ã¥È¥á¥Ã¥»¡¼¥¸¤Î¾ì¹ç¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¤È¥Ú¥¤¥í¡¼¥É¤ò
164 .BR ipq_get_packet (3)
165 ´Ø¿ô¤Ç¼èÆÀ¤Ç¤­¤ë¡£ 
166 .PP
167 .\"O To retrieve the value of an error message, use
168 .\"O .BR ipq_get_msgerr (3).
169 ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ÎÃͤò¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢
170 .BR ipq_get_msgerr (3)
171 ¤ò »ÈÍѤ¹¤ë¡£
172 .PP
173 .\"O .B Issuing Verdicts on Packets
174 .B ¥Ñ¥±¥Ã¥È¤Î½èÍýÆâÍƤÎȯ¹Ô
175 .br
176 .\"O To issue a verdict on a packet, and optionally return a modified version
177 .\"O of the packet to the kernel, call
178 .\"O .BR ipq_set_verdict (3).
179 ¥Ñ¥±¥Ã¥È¤Î½èÍý¤ò·èÄꤷ¡¢É¬Íפʤé¥Ñ¥±¥Ã¥È¤ËÊѹ¹¤ò²Ã¤¨¤Æ
180 ¥«¡¼¥Í¥ë¤ËÊÖ¤¹»þ¤Ë¤Ï¡¢
181 .BR ipq_set_verdict (3)
182 ¤ò»ÈÍѤ¹¤ë¡£
183 .PP
184 .\"O .B Error Handling
185 .B ¥¨¥é¡¼½èÍý
186 .br
187 .\"O An error string corresponding to the current value of the internal error
188 .\"O variable
189 .\"O .B ipq_errno
190 .\"O may be obtained with
191 .\"O .BR ipq_errstr (3).
192 ¸½ºß¤Î¥¨¥é¡¼¾õÂÖ¤ò³ÊǼ¤·¤Æ¤¤¤ëÊÑ¿ô
193 .B ipq_errno
194 ¤ËÂбþ¤¹¤ë
195 ¥¨¥é¡¼Ê¸»úÎó¤Ï
196 .BR ipq_errstr (3).
197 ¤Ç¼èÆÀ¤Ç¤­¤ë¡£
198 .PP
199 .\"O For simple applications, calling
200 .\"O .BR ipq_perror (3)
201 .\"O will print the same message as
202 .\"O .BR ipq_errstr (3),
203 .\"O as well as the string corresponding to the global
204 .\"O .B errno
205 .\"O value (if set) to stderr.
206 ñ½ã¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë»È¤¨¤ë´Ø¿ô¤È¤·¤Æ¡¢
207 .BR ipq_perror (3)
208 ¤Ï¡¢
209 .BR ipq_errstr (3),
210 ¤ÇÊÖ¤µ¤ì¤ë¤Î¤ÈƱ¤¸Ê¸»úÎó¤òɸ½à½ÐÎÏ (stderr) ¤Ë
211 ½ÐÎϤ¹¤ë¡£ ¤Þ¤¿¡¢
212 .B errno
213 ¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð
214 ¤½¤ì¤ËÂбþ¤¹¤ë¥¨¥é¡¼Ê¸»úÎó¤â½ÐÎϤ¹¤ë¡£ 
215 .PP
216 .\"O .B Cleaning Up
217 .B ¸å»ÏËö
218 .br
219 .\"O To free up the Netlink socket and destroy resources associated with
220 .\"O the context handle, call
221 .\"O .BR ipq_destroy_handle (3).
222 Netlink ¥½¥±¥Ã¥È¤ò²òÊü¤·¡¢¥³¥ó¥Æ¥­¥¹¥È¥Ï¥ó¥É¥ë¤Ë´ØÏ¢ÉÕ¤±
223 ¤é¤ì¤¿¥ê¥½¡¼¥¹¤òºï½ü¤¹¤ë¤Ë¤Ï¡¢
224 .BR ipq_destroy_handle (3)
225 ´Ø¿ô¤ò»ÈÍѤ¹¤ë¡£ 
226 .\"O .SH SUMMARY
227 .SH ¤Þ¤È¤á
228 .TP 4
229 .BR ipq_create_handle (3)
230 .\"O Initialise library, return context handle.
231 ¤Ï¡¢¥é¥¤¥Ö¥é¥ê¤ò½é´ü²½¤·¡¢¥³¥ó¥Æ¥­¥¹¥È¥Ï¥ó¥É¥ë¤òÊÖ¤¹¡£
232 .TP
233 .BR ipq_set_mode (3)
234 .\"O Set the queue mode, to copy either packet metadata, or payloads
235 .\"O as well as metadata to userspace.
236 ¤Ï¡¢¥Ñ¥±¥Ã¥È¤Î¥á¥¿¥Ç¡¼¥¿¤À¤±¤ò¥³¥Ô¡¼¤¹¤ë¤«¡¢¥Ú¥¤¥í¡¼¥É¤â
237 ¥³¥Ô¡¼¤¹¤ë¤«¤ÎÆ°ºî¥â¡¼¥É¤ò¥»¥Ã¥È¤¹¤ë¡£
238 .TP
239 .BR ipq_read (3)
240 .\"O Wait for a queue message to arrive from ip_queue and read it into
241 .\"O a buffer.
242 ip_queue ¤«¤é¤Î¥á¥Ã¥»¡¼¥¸¤òÂÔ¤Á¡¢¼õ¿®¤¹¤ë¤È¥Ð¥Ã¥Õ¥¡¤Ë
243 Æɤ߹þ¤à¡£
244 .TP
245 .BR ipq_message_type (3)
246 .\"O Determine message type in the buffer.
247 ¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤Î¥¿¥¤¥×¤òÊÖ¤¹¡£
248 .TP
249 .BR ipq_get_packet (3)
250 .\"O Retrieve a packet message from the buffer.
251 ¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤«¤é¥á¥Ã¥»¡¼¥¸¤òÆɤࡣ
252 .TP
253 .BR ipq_get_msgerr (3)
254 .\"O Retrieve an error message from the buffer.
255 ¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤«¤é¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò¼èÆÀ¤¹¤ë¡£
256 .TP
257 .BR ipq_set_verdict (3)
258 .\"O Set a verdict on a packet, optionally replacing its contents.
259 ¤Ï¡¢¥Ñ¥±¥Ã¥È¤ÎȽÃǤò²¼¤¹¡£ÆâÍƤò½ñ¤­´¹¤¨¤ë¤³¤È¤â¤Ç¤­¤ë¡£
260 .TP
261 .BR ipq_errstr (3)
262 .\"O Return an error message corresponding to the internal ipq_errno variable.
263 ¤Ï¡¢ÆâÉôÊÑ¿ô ipq_errno ¤ÎÃͤ˱þ¤¸¤¿¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò
264 ÊÖ¤¹¡£
265 .TP
266 .BR ipq_perror (3)
267 .\"O Helper function to print error messages to stderr.
268 ¤Ï¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɸ½à½ÐÎÏ¡Êstderr¡Ë¤Ëɽ¼¨¤¹¤ë
269 ¥Ø¥ë¥Ñ¡¼´Ø¿ô¤Ç¤¢¤ë¡£
270 .TP
271 .BR ipq_destroy_handle (3)
272 .\"O Destroy context handle and associated resources.
273 ¤Ï¡¢¥³¥ó¥Æ¥­¥¹¥È¥Ï¥ó¥É¥ë¤òÇË´þ¤·¡¢¥ê¥½¡¼¥¹¤ò²òÊü¤¹¤ë¡£
274 .\"O .SH EXAMPLE
275 .SH Îã
276 .\"O The following is an example of a simple application which receives
277 .\"O packets and issues NF_ACCEPT verdicts on each packet.
278 ¼¡¤Î¥³¡¼¥É¤Ï¡¢¥Ñ¥±¥Ã¥È¤ò¼õ¤±¼è¤Ã¤Æ NF_ACCEPT ¤ÎȽÃǤòÊÖ¤¹Ã±½ã¤Ê
279 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÎã¤Ç¤¢¤ë¡£ 
280 .RS
281 .nf
282 /*
283  * This code is GPL.
284  */
285 #include <linux/netfilter.h>
286 #include <libipq.h>
287 #include <stdio.h>
288
289 #define BUFSIZE 2048 
290
291 static void die(struct ipq_handle *h)
292 {
293         ipq_perror("passer");
294         ipq_destroy_handle(h);
295         exit(1);
296 }
297
298 int main(int argc, char **argv)
299 {
300         int status;
301         unsigned char buf[BUFSIZE];
302         struct ipq_handle *h;
303         
304         h = ipq_create_handle(0);
305         if (!h)
306                 die(h);
307                 
308         status = ipq_set_mode(h, IPQ_COPY_PACKET, BUFSIZE);
309         if (status < 0)
310                 die(h);
311                 
312         do{
313                 status = ipq_read(h, buf, BUFSIZE, 0);
314                 if (status < 0)
315                         die(h);
316                         
317                 switch (ipq_message_type(buf)) {
318                         case NLMSG_ERROR:
319                                 fprintf(stderr, "Received error message %d\\n",
320                                         ipq_get_msgerr(buf));
321                                 break;
322                                 
323                         case IPQM_PACKET: {
324                                 ipq_packet_msg_t *m = ipq_get_packet(buf);
325                                 
326                                 status = ipq_set_verdict(h, m->packet_id,
327                                                          NF_ACCEPT, 0, NULL);
328                                 if (status < 0)
329                                         die(h);
330                                 break;
331                         }
332                         
333                         default:
334                                 fprintf(stderr, "Unknown message type!\\n");
335                                 break;
336                 }
337         } while (1);
338         
339         ipq_destroy_handle(h);
340         return 0;
341 }
342 .RE
343 .fi
344 .PP
345 .\"O Pointers to more libipq application examples may be found in The
346 .\"O Netfilter FAQ.
347 libipq ¤ò»È¤Ã¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÎã¤Ï
348 Netfilter FAQ ¤Ë¤â¤¢¤ë¡£ 
349 .\"O .SH DIAGNOSTICS
350 .SH DIAGNOSTICS
351 .\"O For information about monitoring and tuning ip_queue, refer to the
352 .\"O Linux 2.4 Packet Filtering HOWTO.
353 ip_queue ¤Î´Æ»ë¤È¥Á¥å¡¼¥Ë¥ó¥°¤Ë´Ø¤·¤Æ¤Ï Linux 2.4 Packet
354 Filtering HOWTO ¤ò»²¾È¤¹¤ë¤³¤È¡£ 
355 .PP
356 .\"O If an application modifies a packet, it needs to also update any
357 .\"O checksums for the packet.  Typically, the kernel will silently discard
358 .\"O modified packets with invalid checksums. 
359 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥Ñ¥±¥Ã¥È¤ËÊѹ¹¤ò²Ã¤¨¤¿»þ¤Ë¤Ï¡¢´ØÏ¢¤¹¤ë
360 ¥Á¥§¥Ã¥¯¥µ¥à¤âÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ë¡£ Êѹ¹¤µ¤ì¤¿¥Ñ¥±¥Ã¥È¤Î
361 ¥Á¥§¥Ã¥¯¥µ¥à¤¬°Û¾ï¤Ê¤È¤­¤Ë¤Ï¥«¡¼¥Í¥ë¤ÏÌۤäÆÇË´þ (silently discard) ¤¹¤ë¡£ 
362 .\"O .SH SECURITY
363 .SH ¥»¥­¥å¥ê¥Æ¥£¡¼
364 .\"O Processes require CAP_NET_ADMIN capabilty to access the kernel ip_queue
365 .\"O module.  Such processes can potentially access and modify any IP packets
366 .\"O received, generated or forwarded by the kernel.
367 ip_queue ¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥×¥í¥»¥¹¤Ï
368 CAP_NET_ADMIN ¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£ ¤½¤Î¤è¤¦¤Ê¥×¥í¥»¥¹¤Ï¡¢
369 ÀøºßŪ¤Ë¥«¡¼¥Í¥ë¤¬¼õ¿® (Á÷¿®¡¢Å¾Á÷) ¤¹¤ëÁ´¤Æ¤Î IP ¥Ñ¥±¥Ã¥È¤ò
370 ¼èÆÀ¤·Êѹ¹¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ 
371 .\"O .SH TODO
372 .SH TODO
373 .\"O Per-handle
374 .\"O .B ipq_errno
375 .\"O values.
376 .B ipq_errno
377 ¤ò¥Ï¥ó¥É¥ë¤´¤È¤ËÍÑ°Õ¤¹¤ë¡£ 
378 .\"O .SH BUGS
379 .SH ¥Ð¥°
380 .\"O Probably.
381 ¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ 
382 .\"O .SH AUTHOR
383 .SH Ãø¼Ô
384 James Morris <jmorris@intercode.com.au>
385 .\"O .SH COPYRIGHT
386 .SH Ãøºî¸¢
387 Copyright (c) 2000-2001 Netfilter Core Team.
388 .PP
389 Distributed under the GNU General Public License.
390 .SH CREDITS
391 .\"O Joost Remijn implemented the
392 .\"O .B ipq_read
393 .\"O timeout feature, which appeared in the 1.2.4 release of iptables.
394 Joost Remijn ¤Ï
395 .B ipq_read
396 ¤Î¥¿¥¤¥à¥¢¥¦¥È¤ò¼ÂÁõ¤·¤¿¡£ ¤³¤Îµ¡Ç½¤Ï iptables ¤Î 1.2.4 ¤«¤é»ÈÍѤǤ­¤ë¡£ 
397 .\"O .SH SEE ALSO
398 .SH ´ØÏ¢¹àÌÜ
399 .BR iptables (8),
400 .BR ipq_create_handle (3),
401 .BR ipq_destroy_handle (3),
402 .BR ipq_errstr (3),
403 .BR ipq_get_msgerr (3),
404 .BR ipq_get_packet (3),
405 .BR ipq_message_type (3),
406 .BR ipq_perror (3),
407 .BR ipq_read (3),
408 .BR ipq_set_mode (3),
409 .BR ipq_set_verdict (3).
410 .PP
411 .\"O The Netfilter home page at http://netfilter.samba.org/
412 .\"O which has links to The Networking Concepts HOWTO, The Linux 2.4 Packet
413 .\"O Filtering HOWTO, The Linux 2.4 NAT HOWTO, The Netfilter Hacking HOWTO,
414 .\"O The Netfilter FAQ and many other useful resources.
415 Netfilter ¤Î¥Û¡¼¥à¥Ú¡¼¥¸¤Ï http://netfilter.samba.org/ ¤Ë¤¢¤ë¡£
416 The Networking Concepts HOWTO, The Linux 2.4 Packet
417 Filtering HOWTO, The Linux 2.4 NAT HOWTO, The Netfilter Hacking HOWTO,
418 The Netfilter FAQ ¤Ê¤É¤ÎÍ­±×¤Ê ¾ðÊ󤬤¢¤ë¡£