OSDN Git Service

d9d177cba5a8908897f23995aaa66abc0a98fb0a
[linuxjm/LDP_man-pages.git] / draft / man3 / rpc.3
1 .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
2 .\"
3 .\" @(#)rpc.3n  2.4 88/08/08 4.0 RPCSRC; from 1.19 88/06/24 SMI
4 .\"
5 .\" 2007-12-30, mtk, Convert function prototypes to modern C syntax
6 .\"
7 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
8 .\"         all rights reserved.
9 .\" Translated Tue Jan  4 20:48:23 JST 2000
10 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
11 .\" Updated & Modified Sun Oct 21 01:07:09 JST 2001
12 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
13 .\"
14 .TH RPC 3 2008-07-17 "" "Linux Programmer's Manual"
15 .\"O .SH NAME
16 .SH 名前
17 .\"O rpc \- library routines for remote procedure calls
18 rpc \- 遠隔手続き呼び出し(RPC)のためのライブラリ・ルーティン
19 .\"O .SH SYNOPSIS AND DESCRIPTION
20 .SH 書式と説明
21 .\"O These routines allow C programs to make procedure
22 .\"O calls on other machines across the network.
23 .\"O First, the client calls a procedure to send a data packet to the server.
24 .\"O Upon receipt of the packet, the server calls a dispatch routine
25 .\"O to perform the requested service, and then sends back a reply.
26 .\"O Finally, the procedure call returns to the client.
27 これらのルーティンは C プログラムでネットワークを通して
28 他のマシンにアクセスするプロシジャを作成することを可能にする。
29 最初にクライアントはデータパケットをサーバに送るために
30 プロシジャを呼び出す。
31 サーバはパケットを受け取ると、配分ルーチンを呼び出して
32 要求されたサービスに実行し、返答を送り返す。
33 最後にプロシジャ・コールはクライアントへと戻る。
34 .\" .LP
35 .\"O .\" We don't have an rpc_secure.3 page at the moment -- MTK, 19 Sep 05
36 .\"O .\" Routines that are used for Secure RPC (DES authentication) are described in
37 .\"O .\" .BR rpc_secure (3).
38 .\"O .\" Secure RPC can be used only if DES encryption is available.
39 .\" 今現在は rpc_secure.3 は入っていない -- MTK, 19 Sep 05
40 .\" (DES 認証による) Secure RPC で使用されるルーティンについての説明は
41 .\" .BR rpc_secure (3)
42 .\" に存在する。 Secure RPC は DES 認証が利用可能な場合にのみ使用できる。
43 .LP
44 .\"O To take use of these routines, include the header file
45 .\"O .IR "<rpc/rpc.h>" .
46 これらのルーティンを使用するには、ヘッダファイル
47 .I "<rpc/rpc.h>"
48 をインクルードすること。
49
50 .\"O The prototypes below make use of the following types:
51 下記のプロトタイプでは次の型を使用している。
52 .in +4n
53 .nf
54
55 typedef int \fIbool_t\fP;
56
57 typedef bool_t (*\fIxdrproc_t\fP) (XDR *, void *,...);
58
59 typedef bool_t (*\fIresultproc_t\fP) (caddr_t resp,
60                                 struct sockaddr_in *raddr);
61 .fi
62 .in
63 .LP
64 .\"O See the header files for the declarations of the
65 .\"O .IR AUTH ,
66 .\"O .IR CLIENT ,
67 .\"O .IR SVCXPRT ,
68 .\"O and
69 .\"O .IR XDR
70 .\"O types.
71
72 .IR AUTH ,
73 .IR CLIENT ,
74 .IR SVCXPRT ,
75 .IR XDR
76 の宣言についてはヘッダファイルを参照。
77 .LP
78 .nf
79 .BI "void auth_destroy(AUTH *" auth );
80 .fi
81 .IP
82 .\"O A macro that destroys the authentication information associated with
83 .\"O .IR auth .
84 .\"O Destruction usually involves deallocation of private data structures.
85 .\"O The use of
86 .\"O .I auth
87 .\"O is undefined after calling
88 .\"O .BR auth_destroy ().
89 このマクロは
90 .I auth
91 に関連付けられた認証情報を破壊する。破壊は通常は私的なデータ構造の
92 破棄を含んでいる。
93 .BR auth_destroy ()
94 を呼び出した後に
95 .I auth
96 を使用することは未定義である。
97 .LP
98 .nf
99 .BI "AUTH *authnone_create(void);"
100 .fi
101 .IP
102 .\"O Create and returns an RPC
103 .\"O authentication handle that passes nonusable authentication
104 .\"O information with each remote procedure call.
105 .\"O This is the default authentication used by RPC.
106 各リモート・プロシジャ・コールで使用できない仮の認証情報として渡される
107 RPC 認証ハンドルを作成して返す。
108 これは RPC で使用されるデフォルトの認証である。
109 .LP
110 .nf
111 .BI "AUTH *authunix_create(char *" host ", int " uid ", int " gid ,
112 .BI "                      int " len ", int *" aup_gids );
113 .fi
114 .IP
115 .\"O Create and return an RPC authentication handle that contains
116 .\"O authentication information.
117 .\"O The parameter
118 .\"O .I host
119 .\"O is the name of the machine on which the information was created;
120 .\"O .I uid
121 .\"O is the user's user ID;
122 .\"O .I gid
123 .\"O is the user's current group ID;
124 .\"O .I len
125 .\"O and
126 .\"O .I aup_gids
127 .\"O refer to a counted array of groups to which the user belongs.
128 .\"O It is easy to impersonate a user.
129 認証情報を含んだ RPC 認証ハンドルを作成して返す。
130 .I host
131 パラメーターは情報が作成されたマシンの名前である。
132 .I uid
133 はそのユーザのユーザ
134 .SM ID
135
136 .I gid
137 はそのユーザの現在のグループ
138 .SM ID
139 である。
140 .I len
141
142 .I aup_gids
143 はそのユーザが所属するグループの配列を参照している。
144 他のユーザになりすますことは簡単である。
145 .LP
146 .nf
147 .BI "AUTH *authunix_create_default(void);"
148 .fi
149 .IP
150 .\"O Calls
151 .\"O .BR authunix_create ()
152 .\"O with the appropriate parameters.
153 適切なパラメーターで
154 .BR authunix_create ()
155 を呼び出す。
156 .LP
157 .nf
158 .BI "int callrpc(char *" host ", unsigned long " prognum ,
159 .BI "            unsigned long " versnum ", unsigned long " procnum ,
160 .BI "            xdrproc_t " inproc ", char *" in ,
161 .BI "            xdrproc_t " outproc ", char *" out );
162 .fi
163 .IP
164 .\"O Call the remote procedure associated with
165 .\"O .IR prognum ,
166 .\"O .IR versnum ,
167 .\"O and
168 .\"O .I procnum
169 .\"O on the machine,
170 .\"O .IR host .
171 .\"O The parameter
172 .\"O .I in
173 .\"O is the address of the procedure's argument(s), and
174 .\"O .I out
175 .\"O is the address of where to place the result(s);
176 .\"O .I inproc
177 .\"O is used to encode the procedure's parameters, and
178 .\"O .I outproc
179 .\"O is used to decode the procedure's results.
180 .\"O This routine returns zero if it succeeds, or the value of
181 .\"O .B "enum clnt_stat"
182 .\"O cast to an integer if it fails.
183 .\"O The routine
184 .\"O .BR clnt_perrno ()
185 .\"O is handy for translating failure statuses into messages.
186 マシン
187 .I host
188 上で
189 .IR prognum ,
190 .IR versnum ,
191 .I procnum
192 に関連付けられたリモート・プロシジャを呼び出す。
193 パラメーター
194 .I in
195 はプロシジャの引き数のアドレスであり
196 .I out
197 は結果を格納するアドレスである。
198 .I inproc
199 はプロシジャのパラメーターをエンコードするのに使用され、
200 .I outproc
201 は結果をデコードするのに使用される。
202 このルーティンは成功した場合にはゼロを返す。失敗した場合には
203 .B "enum clnt_stat"
204 を整数にキャストした値を返す。
205 .BR clnt_perrno ()
206 ルーティンが失敗の状態をメッセージに変換するのに使用できる。
207 .IP
208 .\"O Warning: calling remote procedures with this routine
209 .\"O uses UDP/IP as a transport; see
210 .\"O .BR clntudp_create ()
211 .\"O for restrictions.
212 .\"O You do not have control of timeouts or authentication using this routine.
213 警告: このルーティンでリモート・プロシジャを呼び出すと通信には
214 UDP/IP が使用される。この際の制限については
215 .BR clntudp_create ()
216 を参照すること。このルーティンを使用して認証や時間切れの制御を
217 することはできない。
218 .LP
219 .nf
220 .BI "enum clnt_stat clnt_broadcast(unsigned long " prognum ,
221 .BI "                     unsigned long " versnum ", unsigned long " procnum ,
222 .BI "                     xdrproc_t " inproc ", char *" in ,
223 .BI "                     xdrproc_t " outproc ", char *" out ,
224 .BI "                     resultproc_t " eachresult );
225 .fi
226 .IP
227 .\"O Like
228 .\"O .BR callrpc (),
229 .\"O except the call message is broadcast to all locally
230 .\"O connected broadcast nets.
231 .\"O Each time it receives a response, this routine calls
232 .\"O .BR eachresult (),
233 .\"O whose form is:
234 .BR callrpc ()
235 と同様であるが、メッセージがローカルのブロードキャスト・ネットワーク
236 全体へとブロードキャストされる点が異っている。回答を受け取る度に
237 このルーティンは以下の形式の
238 .BR eachresult ()
239 を呼び出す。
240 .IP
241 .in +4n
242 .nf
243 .BI "eachresult(char *" out ", struct sockaddr_in *" addr );
244 .fi
245 .in
246 .IP
247 .\"O where
248 .\"O .I out
249 .\"O is the same as
250 .\"O .I out
251 .\"O passed to
252 .\"O .BR clnt_broadcast (),
253 .\"O except that the remote procedure's output is decoded there;
254 .\"O .I addr
255 .\"O points to the address of the machine that sent the results.
256 .\"O If
257 .\"O .BR eachresult ()
258 .\"O returns zero,
259 .\"O .BR clnt_broadcast ()
260 .\"O waits for more replies; otherwise it returns with appropriate status.
261 ここで
262 .I out
263
264 .BR clnt_broadcast ()
265 に渡される
266 .I out
267 と同じであるが、リモート・プロシジャからの出力がデコードされている
268 点のみが異っている。
269 .I addr
270 は結果を送って来たマシンのアドレスを指している。
271 .BR eachresult ()
272 がゼロを返した場合、
273 .BR clnt_broadcast ()
274 はさらなる回答を待つ。そうでなければ適切な状態で終了する。
275 .IP
276 .\"O Warning: broadcast sockets are limited in size to the
277 .\"O maximum transfer unit of the data link.
278 .\"O For ethernet, this value is 1500 bytes.
279 警告: ブロードキャスト・ソケットはデータリンク層の最大転送単位に
280 制限されている。イーサネットの場合、最大値は 1500 バイトである。
281 .LP
282 .nf
283 .BI "enum clnt_stat clnt_call(CLIENT *" clnt ", unsigned long " procnum ,
284 .BI "                    xdrproc_t " inproc ", char *" in ,
285 .BI "                    xdrproc_t " outproc ", char *" out ,
286 .BI "                    struct timeval " tout );
287 .fi
288 .IP
289 .\"O A macro that calls the remote procedure
290 .\"O .I procnum
291 .\"O associated with the client handle,
292 .\"O .IR clnt ,
293 .\"O which is obtained with an RPC client creation routine such as
294 .\"O .BR clnt_create ().
295 このマクロはクライアント・ハンドル
296 .I clnt
297 に関連付けられた
298 .I procnum
299 リモート・プロシジャを呼び出す。
300 クライアント・ハンドルは
301 .BR clnt_create ()
302 のような
303 .SM RPC
304 クライアント作成ルーティンによって得られる。
305 .\"O The parameter
306 .\"O .I in
307 .\"O is the address of the procedure's argument(s), and
308 .\"O .I out
309 .\"O is the address of where to place the result(s);
310 .\"O .I inproc
311 .\"O is used to encode the procedure's parameters, and
312 .\"O .I outproc
313 .\"O is used to decode the procedure's results;
314 .\"O .I tout
315 .\"O is the time allowed for results to come back.
316 パタメータ
317 .I in
318 はプロシジャの引き数のアドレスである。
319 .I out
320 はプロシジャの返り値を格納するアドレスである。
321 .I inproc
322 はプロシジャのパラメーターをエンコードするのに使用される。
323 .I outproc
324 はプロシジャの返り値をデコードするのに使用される。
325 .I tout
326 は結果が返されるのを待つ時間である。
327 .LP
328 .nf
329 .BI "clnt_destroy(CLIENT *" clnt );
330 .fi
331 .IP
332 .\"O A macro that destroys the client's RPC handle.
333 .\"O Destruction usually involves deallocation
334 .\"O of private data structures, including
335 .\"O .I clnt
336 .\"O itself.
337 .\"O Use of
338 .\"O .I clnt
339 .\"O is undefined after calling
340 .\"O .BR clnt_destroy ().
341 .\"O If the RPC library opened the associated socket, it will close it also.
342 .\"O Otherwise, the socket remains open.
343 このマクロはクライアントの RPC ハンドルを破壊する。破壊には通常は
344 .I clnt
345 自身も含めて私的なデータ構造体の破棄が含まれている。
346 .BR clnt_destroy ()
347 の呼び出しの後に
348 .I clnt
349 を使用することは未定義である。
350 RPC ライブラリが関連するソケットをオープンした場合には、
351 それも閉じられる。それ以外の場合にはソケットはオープンされたままである。
352 .LP
353 .nf
354 .BI "CLIENT *clnt_create(char *" host ", unsigned long " prog ,
355 .BI "                    unsigned long " vers ", char *" proto );
356 .fi
357 .IP
358 .\"O Generic client creation routine.
359 .\"O .I host
360 .\"O identifies the name of the remote host where the server is located.
361 .\"O .I proto
362 .\"O indicates which kind of transport protocol to use.
363 .\"O The currently supported values for this field are \(lqudp\(rq
364 .\"O and \(lqtcp\(rq.
365 .\"O Default timeouts are set, but can be modified using
366 .\"O .BR clnt_control ().
367 一般的なクライアントの作成ルーティンである。
368 .I host
369 はサーバのあるリモートホストの名前を指定する。
370 .I proto
371 どのような通信プロトコルを使用するかを指定する。現在ここに
372 使用できる値は \(lqudp\(rq と \(lqtcp\(rq である。
373 デフォルトの時間切れが設定されるが、
374 .BR clnt_control ()
375 を使用して変更可能である。
376 .IP
377 .\"O Warning: Using UDP has its shortcomings.
378 .\"O Since UDP-based RPC messages can only hold up to 8 Kbytes of encoded data,
379 .\"O this transport cannot be used for procedures that take
380 .\"O large arguments or return huge results.
381 警告:
382 UDP を使用した場合には欠点がある。
383 UDP に基づいた RPC メッセージは
384 最大でも 8 KByte のエンコードデータしか保持する
385 ことができないため、大きな引き数や巨大な結果を取るプロシジャに
386 は使用することができない。
387 .LP
388 .nf
389 .BI "bool_t clnt_control(CLIENT *" cl ", int " req ", char *" info );
390 .fi
391 .IP
392 .\"O A macro used to change or retrieve various information
393 .\"O about a client object.
394 .\"O .I req
395 .\"O indicates the type of operation, and
396 .\"O .I info
397 .\"O is a pointer to the information.
398 .\"O For both UDP and TCP, the supported values of
399 .\"O .I req
400 .\"O and their argument types and what they do are:
401 このマクロは各種クライアントについて情報を変更したり、取得したり
402 するのに使用する。
403 .I req
404 は操作の種類を指定する。
405 .I info
406 は情報へのポインターである。
407 UDP と TCP どちらの場合も使用可能な
408 .I req
409 の値と、その引き数の型、およびその内容は以下の通りである:
410 .IP
411 .in +4n
412 .nf
413 .ta +2.0i +2.0i +2.0i
414 .\"O \fBCLSET_TIMEOUT\fP  \fIstruct timeval\fP // set total timeout
415 .\"O \fBCLGET_TIMEOUT\fP  \fIstruct timeval\fP // get total timeout
416 \fBCLSET_TIMEOUT\fP  \fIstruct timeval\fP // 時間切れを設定する
417 \fBCLGET_TIMEOUT\fP  \fIstruct timeval\fP // 時間切れを取得する
418 .fi
419 .in
420 .IP
421 .\"O Note: if you set the timeout using
422 .\"O .BR clnt_control (),
423 .\"O the timeout parameter passed to
424 .\"O .BR clnt_call ()
425 .\"O will be ignored in all future calls.
426 注意:
427 .BR clnt_control ()
428 を使用して時間切れを設定した場合にはそれ以後は
429 .BR clnt_call ()
430 に渡される時間切れパラメーターは全て無視される。
431 .IP
432 .in +4n
433 .nf
434 .\"O \fBCLGET_SERVER_ADDR\fP  \fIstruct sockaddr_in \fP // get server's address
435 \fBCLGET_SERVER_ADDR\fP  \fIstruct sockaddr_in \fP // サーバアドレスを取得する
436 .fi
437 .in
438 .IP
439 .\"O The following operations are valid for UDP only:
440 以下の操作は UDP の場合にのみ有効である:
441 .IP
442 .in +4n
443 .nf
444 .\"O \fBCLSET_RETRY_TIMEOUT\fP  \fIstruct timeval\fP // set the retry timeout
445 .\"O \fBCLGET_RETRY_TIMEOUT\fP  \fIstruct timeval\fP // get the retry timeout
446 \fBCLSET_RETRY_TIMEOUT\fP  \fIstruct timeval\fP // 再送間隔を設定する
447 \fBCLGET_RETRY_TIMEOUT\fP  \fIstruct timeval\fP // 再送間隔を取得する
448 .fi
449 .in
450 .IP
451 .\"O The retry timeout is the time that "UDP RPC"
452 .\"O waits for the server to reply before
453 .\"O retransmitting the request.
454 再送間隔は次に要求を再送する前に
455 "UDP RPC" がサーバの回答を待つ時間である。
456 .LP
457 .nf
458 .BI "clnt_freeres(CLIENT * " clnt ", xdrproc_t " outproc ", char *" out );
459 .fi
460 .IP
461 .\"O A macro that frees any data allocated by the RPC/XDR
462 .\"O system when it decoded the results of an RPC call.
463 .\"O The parameter
464 .\"O .I out
465 .\"O is the address of the results, and
466 .\"O .I outproc
467 .\"O is the XDR routine describing the results.
468 .\"O This routine returns one if the results were successfully freed,
469 .\"O and zero otherwise.
470 このマクロは RPC 呼び出しの結果のデコードの際に
471 RPC/XDR システムによって割当てられたデータを解放する。
472 パラメーター
473 .I out
474 は結果のアドレスである。
475 .I outproc
476 は結果を記述している XDR ルーティンである。
477 このルーティンは結果の解放に成功した場合には 1 を返す。
478 失敗した場合にはゼロを返す。
479 .LP
480 .nf
481 .BI "void clnt_geterr(CLIENT *" clnt ", struct rpc_err *" errp );
482 .fi
483 .IP
484 .\"O A macro that copies the error structure out of the client
485 .\"O handle to the structure at address
486 .\"O .IR errp .
487 このマクロはクライアント・ハンドルのエラー構造体を
488 .I errp
489 アドレスで指定された構造体へコピーする。
490 .LP
491 .nf
492 .BI "void clnt_pcreateerror(char *" s );
493 .fi
494 .IP
495 .\"O Print a message to standard error indicating why a client RPC
496 .\"O handle could not be created.
497 .\"O The message is prepended with string
498 .\"O .I s
499 .\"O and a colon.
500 .\"O Used when a
501 .\"O .BR clnt_create (),
502 .\"O .BR clntraw_create (),
503 .\"O .BR clnttcp_create (),
504 .\"O or
505 .\"O .BR clntudp_create ()
506 .\"O call fails.
507 標準エラー出力に、なぜクライアント RPC ハンドルの作成が
508 できなかったかについてのメッセージを表示する。
509 メッセージの前に文字列
510 .I s
511 とコロン(:)が表示される。
512 .BR clnt_create (),
513 .BR clntraw_create (),
514 .BR clnttcp_create (),
515 .BR clntudp_create ()
516 の呼び出しが失敗した時に使用すること。
517 .LP
518 .nf
519 .BI "void clnt_perrno(enum clnt_stat " stat );
520 .fi
521 .IP
522 .\"O Print a message to standard error corresponding
523 .\"O to the condition indicated by
524 .\"O .IR stat .
525 .\"O Used after
526 .\"O .BR callrpc ().
527 標準エラー出力に
528 .I stat
529 によって指示されるエラー状態に対応するメッセージを表示する。
530 .BR callrpc ()
531 の後に使用すること。
532 .LP
533 .nf
534 .BI "clnt_perror(CLIENT *" clnt ", char *" s );
535 .fi
536 .IP
537 .\"O Print a message to standard error indicating why an RPC call failed;
538 .\"O .I clnt
539 .\"O is the handle used to do the call.
540 .\"O The message is prepended with string
541 .\"O .I s
542 .\"O and a colon.
543 .\"O Used after
544 .\"O .BR clnt_call ().
545 標準エラー出力に、なぜ RPC 呼び出しが失敗したかについてのメッセージを表示する。
546 .I clnt
547 はコールに使用したハンドルである。
548 メッセージの前に文字列
549 .I s
550 とコロン(:)が表示される。
551 .BR clnt_call ()
552 が失敗した後に使用すること。
553 .LP
554 .nf
555 .BI "char *clnt_spcreateerror(char *" s );
556 .fi
557 .IP
558 .\"O Like
559 .\"O .BR clnt_pcreateerror (),
560 .\"O except that it returns a string instead of printing to the standard error.
561 .BR clnt_pcreateerror ()
562 と同様であるが、標準エラー出力へ表示するかわりに文字列を返す点が異っている。
563 .IP
564 .\"O Bugs: returns pointer to static data that is overwritten on each call.
565 バグ: 静的な領域へのポインターを返すため、呼び出しごとに上書きされる。
566 .LP
567 .nf
568 .BI "char *clnt_sperrno(enum clnt_stat " stat );
569 .fi
570 .IP
571 .\"O Take the same arguments as
572 .\"O .BR clnt_perrno (),
573 .\"O but instead of sending a message to the standard error indicating why an RPC
574 .\"O call failed, return a pointer to a string which contains the message.
575 .\"O The string ends with a NEWLINE.
576 .BR clnt_perrno ()
577 と同じ引き数を取るが、なぜ
578 RPC 呼び出しが失敗したかについてのメッセージを標準エラー出力に表示する
579 かわりに、メッセージを格納している文字列へのポインターを返す。
580 文字列は NEWLINE(改行) で終っている。
581 .IP
582 .\"O .BR clnt_sperrno ()
583 .\"O is used instead of
584 .\"O .BR clnt_perrno ()
585 .\"O if the program does not have a standard error (as a program
586 .\"O running as a server quite likely does not), or if the programmer
587 .\"O does not want the message to be output with
588 .\"O .BR printf (3),
589 .\"O or if a message format different than that supported by
590 .\"O .BR clnt_perrno ()
591 .\"O is to be used.
592 .\"O Note: unlike
593 .\"O .BR clnt_sperror ()
594 .\"O and
595 .\"O .BR clnt_spcreaterror (),
596 .\"O .BR clnt_sperrno ()
597 .\"O returns pointer to static data, but the
598 .\"O result will not get overwritten on each call.
599 .BR clnt_sperrno ()
600 はプログラムが標準エラー出力を持っていない場合(プログラムがサーバとし
601 て走っている場合にはよくありえる)や、プログラマーがメッセージを
602 .BR printf (3)
603 で出力することを望まない場合や、メッセージの形式が
604 .BR clnt_perrno ()
605 がサポートするものとは異っている場合などに
606 .BR clnt_perrno ()
607 のかわりに使用される。
608 注意:
609 .BR clnt_sperror ()
610
611 .BR clnt_spcreaterror ()
612 とは違って
613 .BR clnt_sperrno ()
614 は静的データへのポインターを返す。しかし呼び出しごとに上書きされることはない。
615 .LP
616 .nf
617 .BI "char *clnt_sperror(CLIENT *" rpch ", char *" s );
618 .fi
619 .IP
620 .\"O Like
621 .\"O .BR clnt_perror (),
622 .\"O except that (like
623 .\"O .BR clnt_sperrno ())
624 .\"O it returns a string instead of printing to standard error.
625 .BR clnt_perror ()
626 と同様であるが、標準エラー出力に表示する代りに
627 .RB ( clnt_sperrno ()
628 のように) 文字列へのポインターを返す点が異っている。
629 .IP
630 .\"O Bugs: returns pointer to static data that is overwritten on each call.
631 バグ: 呼び出しごとに上書きされる静的データへのポインターを返す。
632 .LP
633 .nf
634 .BI "CLIENT *clntraw_create(unsigned long " prognum \
635 ", unsigned long " versnum );
636 .fi
637 .IP
638 .\"O This routine creates a toy RPC client for the remote program
639 .\"O .IR prognum ,
640 .\"O version
641 .\"O .IR versnum .
642 .\"O The transport used to pass messages to the service is
643 .\"O actually a buffer within the process's address space, so the
644 .\"O corresponding RPC server should live in the same address space; see
645 .\"O .BR svcraw_create ().
646 .\"O This allows simulation of RPC and acquisition of RPC
647 .\"O overheads, such as round trip times, without any kernel interference.
648 .\"O This routine returns NULL if it fails.
649 このルーティンはリモート・プログラム
650 .IR prognum 、
651 バージョン
652 .I versnum
653 のための擬似 RPC クライアントを作成する。メッセージをサービスに渡すために使用する
654 通信は実際にはそのプロセスのアドレス空間にあるバッファーである。
655 それで、対応する RPC サーバが同じアドレス空間の中にいなければならない。
656 .BR svcraw_create ()
657 を参照すること。
658 これにより RPC のシミュレーションや、カーネル・インターフェースに影響されずに
659 応答時間などの RPC オーバヘッドの獲得ができる。
660 失敗した場合にはこのルーティンは NULL を返す。
661 .LP
662 .nf
663 .BI "CLIENT *clnttcp_create(struct sockaddr_in *" addr ,
664 .BI "                unsigned long " prognum ", unsigned long " versnum ,
665 .BI "                int *" sockp ", unsigned int " sendsz \
666 ", unsigned int " recvsz );
667 .fi
668 .IP
669 .\"O This routine creates an RPC client for the remote program
670 .\"O .IR prognum ,
671 .\"O version
672 .\"O .IR versnum ;
673 .\"O the client uses TCP/IP as a transport.
674 .\"O The remote program is located at Internet
675 .\"O address
676 .\"O .IR *addr .
677 このルーティンはリモート・プログラム
678 .IR prognum 、
679 バージョン
680 .I versnum
681 のための RPC クライアントを作成する。クライアントは通信に
682 TCP/IP を使用する。リモート・プログラムはインターネット・アドレスの
683 .I *addr
684 にある。
685 .\"O If
686 .\"The following inline font conversion is necessary for the hyphen indicator
687 .\"O \fIaddr\->sin_port\fR
688 .\"O is zero, then it is set to the actual port that the remote
689 .\"O program is listening on (the remote
690 .\"O .B portmap
691 .\"O service is consulted for this information).
692 .\"O The parameter
693 .\"O .I sockp
694 .\"O is a socket; if it is
695 .\"O .BR RPC_ANYSOCK ,
696 .\"O then this routine opens a new one and sets
697 .\"O .IR sockp .
698 \fIaddr\->sin_port\fR がゼロならば、実際にリモート・プログラムが
699 listen しているポートが設定される。(この情報のためにリモートの
700 .B portmap
701 サービスが利用される。) パラメーター
702 .I sockp
703 はソケットである。もしこれが
704 .B RPC_ANYSOCK
705 に設定されている場合は、このルーティンが新しいソケットをオープンして
706 .I sockp
707 に設定する。
708 .\"O Since TCP-based RPC uses buffered I/O,
709 .\"O the user may specify the size of the send and receive buffers
710 .\"O with the parameters
711 .\"O .I sendsz
712 .\"O and
713 .\"O .IR recvsz ;
714 .\"O values of zero choose suitable defaults.
715 .\"O This routine returns NULL if it fails.
716 TCP に基づいた RPC はバッファされた I/O
717 を使用するため、ユーザはパラメーター
718 .I sendsz
719
720 .I recvsz
721 を使用して送信バッファと受信バッファのサイズを指定することができる。
722 ゼロを指定した場合には適切なデフォルトが選択される。
723 このルーティンは失敗した場合は NULL を返す。
724 .LP
725 .nf
726 .BI "CLIENT *clntudp_create(struct sockaddr_in *" addr ,
727 .BI "                unsigned long " prognum ", unsigned long " versnum ,
728 .BI "                struct timeval " wait ", int *" sockp );
729 .fi
730 .IP
731 .\"O This routine creates an RPC client for the remote program
732 .\"O .IR prognum ,
733 .\"O version
734 .\"O .IR versnum ;
735 .\"O the client uses use UDP/IP as a transport.
736 .\"O The remote program is located at Internet address
737 .\"O .IR addr .
738 このルーティンはリモート・プログラム
739 .IR prognum 、
740 バージョン
741 .I versnum
742 のための RPC クライアントを作成する。クライアントは通信に
743 UDP/IP を使用する。リモート・プログラムはインターネット・アドレスの
744 .I *addr
745 にある。
746 .\"O If
747 .\"O \fIaddr\->sin_port\fR
748 .\"O is zero, then it is set to actual port that the remote
749 .\"O program is listening on (the remote
750 .\"O .B portmap
751 .\"O service is consulted for this information).
752 .\"O The parameter
753 .\"O .I sockp
754 .\"O is a socket; if it is
755 .\"O .BR RPC_ANYSOCK ,
756 .\"O then this routine opens a new one and sets
757 .\"O .IR sockp .
758 \fIaddr\->sin_port\fR がゼロならば、実際にリモート・プログラムが
759 listen しているポートが設定される。(この情報のためにリモートの
760 .B portmap
761 サービスが利用される。) パラメーター
762 .I sockp
763 はソケットである。もしこれが
764 .B RPC_ANYSOCK
765 に設定されている場合は、このルーティンが新しいソケットをオープンして
766 .I sockp
767 に設定する。
768 .\"O The UDP transport resends the call message in intervals of
769 .\"O .B wait
770 .\"O time until a response is received or until the call times out.
771 .\"O The total time for the call to time out is specified by
772 .\"O .BR clnt_call ().
773 UDP 通信は回答があるか、時間切れが起こるまで
774 .B wait
775 間隔で呼び出しメッセージを再送する。時間切れが起こるまでの合計時間は
776 .BR clnt_call ()
777 で指定する。
778 .IP
779 .\"O Warning: since UDP-based RPC messages can only hold up to 8 Kbytes
780 .\"O of encoded data, this transport cannot be used for procedures
781 .\"O that take large arguments or return huge results.
782 警告: UDP に基づいた
783 RPC メッセージは最大でも 8 Kbyte までのエンコードされたデータしか
784 保持できないため、この通信は大きな引き数や巨大な結果を取る
785 プロシジャには使用できない。
786 .LP
787 .nf
788 .BI "CLIENT *clntudp_bufcreate(struct sockaddr_in *" addr ,
789 .BI "            unsigned long " prognum ", unsigned long " versnum ,
790 .BI "            struct timeval " wait ", int *" sockp ,
791 .BI "            unsigned int " sendsize ", unsigned int "recosize );
792 .fi
793 .IP
794 .\"O This routine creates an RPC client for the remote program
795 .\"O .IR prognum ,
796 .\"O on
797 .\"O .IR versnum ;
798 .\"O the client uses use UDP/IP as a transport.
799 .\"O The remote program is located at Internet address
800 .\"O .IR addr .
801 このルーティンはリモート・プログラム
802 .IR prognum 、
803 バージョン
804 .I versnum
805 のための RPC クライアントを作成する。クライアントは通信に
806 UDP/IP を使用する。リモート・プログラムはインターネット・アドレスの
807 .I *addr
808 にある。
809 .\"O If
810 .\"O \fIaddr\->sin_port\fR
811 .\"O is zero, then it is set to actual port that the remote
812 .\"O program is listening on (the remote
813 .\"O .B portmap
814 .\"O service is consulted for this information).
815 .\"O The parameter
816 .\"O .I sockp
817 .\"O is a socket; if it is
818 .\"O .BR RPC_ANYSOCK ,
819 .\"O then this routine opens a new one and sets
820 .\"O .I sockp .
821 \fIaddr\->sin_port\fR がゼロならば、実際にリモート・プログラムが
822 listen しているポートが設定される。(この情報のためにリモートの
823 .B portmap
824 サービスが利用される。) パラメーター
825 .I sockp
826 はソケットである。もしこれが
827 .B RPC_ANYSOCK
828 に設定されている場合は、このルーティンが新しいソケットをオープンして
829 .I sockp
830 に設定する。
831 .\"O The UDP transport resends the call message in intervals of
832 .\"O .I wait
833 .\"O time until a response is received or until the call times out.
834 .\"O The total time for the call to time out is specified by
835 .\"O .BR clnt_call ().
836 UDP 通信は回答があるか、時間切れが起こるまで
837 .B wait
838 間隔で呼び出しメッセージを再送する。時間切れが起こるまでの合計時間は
839 .BR clnt_call ()
840 で指定する。
841 .IP
842 .\"O This allows the user to specify the maximum packet
843 .\"O size for sending and receiving UDP-based RPC messages.
844 これを使用すると UDP に基づいた RPC メッセージにおいて送信パケットや
845 受信パケットの最大サイズを指定することが可能になる。
846 .LP
847 .nf
848 .BI "void get_myaddress(struct sockaddr_in *" addr );
849 .fi
850 .IP
851 .\"O Stuff the machine's IP address into
852 .\"O .IR *addr ,
853 .\"O without consulting the library routines that deal with
854 .\"O .IR /etc/hosts .
855 .\"O The port number is always set to
856 .\"O .BR htons(PMAPPORT) .
857 このマシンの IP アドレスを
858 .I *addr
859 に格納する。
860 .I /etc/hosts
861 を扱うライブラリ・ルーティンは使用しない。ポート番号は常に
862 .B htons(PMAPPORT)
863 に設定される。
864 .LP
865 .nf
866 .BI "struct pmaplist *pmap_getmaps(struct sockaddr_in *" addr );
867 .fi
868 .IP
869 .\"O A user interface to the
870 .\"O .B portmap
871 .\"O service, which returns a list of the current RPC
872 .\"O program-to-port mappings on the host located at IP address
873 .\"O .IR *addr .
874 .\"O This routine can return NULL.
875 .\"O The command
876 .\"O .IR "rpcinfo\ \-p"
877 .\"O uses this routine.
878 .B portmap
879 サービスのためのユーザインターフェースであり、
880 IP アドレス
881 .I *addr
882 にあるホストの現在の RPC プログラムからポート番号へのマッピングの一覧を返す。
883 このルーティンが NULL を返す場合もある。
884 .RB ` "rpcinfo \-p" '
885 コマンドはこのルーティンを使用している。
886 .LP
887 .nf
888 .BI "unsigned short pmap_getport(struct sockaddr_in *" addr ,
889 .BI "                    unsigned long " prognum ", unsigned long " versnum ,
890 .BI "                    unsigned int " protocol );
891 .fi
892 .IP
893 .\"O A user interface to the
894 .\"O .B portmap
895 .\"O service, which returns the port number
896 .\"O on which waits a service that supports program number
897 .\"O .IR prognum ,
898 .\"O version
899 .\"O .IR versnum ,
900 .\"O and speaks the transport protocol associated with
901 .\"O .IR protocol .
902 .B portmap
903 サービスのためのユーザ・インターフェースで、
904 プログラム番号
905 .IR prognum 、
906 バージョン
907 .IR versnum 、
908 関連付けられた通信プロトコル
909 .I protocol
910 をサポートするサービスが待っているポート番号を返す。
911 .\"O The value of
912 .\"O .I protocol
913 .\"O is most likely
914 .\"O .B IPPROTO_UDP
915 .\"O or
916 .\"O .BR IPPROTO_TCP .
917 .\"O A return value of zero means that the mapping does not exist
918 .\"O or that the RPC system failed to contact the remote
919 .\"O .B portmap
920 .\"O service.
921 .\"O In the latter case, the global variable
922 .\"O .I rpc_createerr
923 .\"O contains the RPC status.
924 .I protocol
925 の値はほとんどの場合 IPPROTO_UDP か IPPROTO_TCP である。
926 返り値ゼロはマッピングが存在しないか、
927 RPC システムがリモートの
928 .B portmap
929 サービスの参照に失敗したことを意味する。後者の場合は大域変数
930 .I rpc_createerr
931 が RPC 状態を保持している。
932 .LP
933 .nf
934 .BI "enum clnt_stat pmap_rmtcall(struct sockaddr_in *" addr ,
935 .BI "                    unsigned long " prognum ", unsigned long " versnum ,
936 .BI "                    unsigned long " procnum ,
937 .BI "                    xdrproc_t " inproc ", char *" in ,
938 .BI "                    xdrproc_t " outproc ", char *" out ,
939 .BI "                    struct timeval " tout ", unsigned long *" portp );
940 .fi
941 .IP
942 .\"O A user interface to the
943 .\"O .B portmap
944 .\"O service, which instructs
945 .\"O .B portmap
946 .\"O on the host at IP address
947 .\"O .I *addr
948 .\"O to make an RPC call on your behalf to a procedure on that host.
949 .B portmap
950 サービスのためのユーザ・インターフェースで、
951 IP アドレス
952 .I *addr
953 のホストの
954 .B portmap
955 を参照して、
956 RPC 呼び出しを生成し、そのホスト上のプロシジャを呼び出す。
957 .\"O The parameter
958 .\"O .I *portp
959 .\"O will be modified to the program's port number if the procedure succeeds.
960 .\"O The definitions of other parameters are discussed
961 .\"O in
962 .\"O .BR callrpc ()
963 .\"O and
964 .\"O .BR clnt_call ().
965 .\"O This procedure should be used for a \(lqping\(rq and nothing else.
966 .\"O See also
967 .\"O .BR clnt_broadcast ().
968 パラメーター
969 .I *portp
970 はプロシジャが成功した場合にはプログラムのポート番号に修正される。
971 他のパラメーターの定義については
972 .BR callrpc ()
973
974 .BR clnt_call ()
975 で説明してある。
976 このプロシジャは \(lqping\(rq のみに使用すべきである。
977 .BR clnt_broadcast ()
978 も参照すること。
979 .LP
980 .nf
981 .BI "bool_t pmap_set(unsigned long " prognum ", unsigned long " versnum ,
982 .BI "                unsigned int " protocol ", unsigned short " port );
983 .fi
984 .IP
985 .\"O A user interface to the
986 .\"O .B portmap
987 .\"O service, which establishes a mapping between the triple
988 .\"O .RI [ prognum , versnum , protocol\fR]
989 .\"O and
990 .\"O .I port
991 .\"O on the machine's
992 .\"O .B portmap
993 .\"O service.
994 .\"O The value of
995 .\"O .I protocol
996 .\"O is most likely
997 .\"O .B IPPROTO_UDP
998 .\"O or
999 .\"O .BR IPPROTO_TCP .
1000 .\"O This routine returns one if it succeeds, zero otherwise.
1001 .\"O Automatically done by
1002 .\"O .BR svc_register ().
1003 .B portmap
1004 サービスのためのユーザ・インターフェースで、
1005 .RI [ prognum , versnum , protocol\fR]
1006 の組み合わせと
1007 .I port
1008 との間のマッピングを、そのマシン上の
1009 .B portmap
1010 サービスに登録する。
1011 .I protocol
1012 はほとんどの場合
1013 .B IPPROTO_UDP
1014
1015 .B IPPROTO_TCP
1016 のどちらかである。
1017 このルーティンは成功した場合には 1 を返す。失敗した場合にはゼロを返す。
1018 .BR svc_register ()
1019 によって自動的に実行される。
1020 .LP
1021 .nf
1022 .BI "bool_t pmap_unset(unsigned long " prognum ", unsigned long " versnum );
1023 .fi
1024 .IP
1025 .\"O A user interface to the
1026 .\"O .B portmap
1027 .\"O service, which destroys all mapping between the triple
1028 .\"O .RI [ prognum , versnum , *\fR]
1029 .\"O and
1030 .\"O .B ports
1031 .\"O on the machine's
1032 .\"O .B portmap
1033 .\"O service.
1034 .\"O This routine returns one if it succeeds, zero otherwise.
1035 .B portmap
1036 サービスのためのユーザ・インターフェースで、
1037 .RI [ prognum , versnum , *\fR]
1038 の組み合わせと
1039 .B ports
1040 の間のマッピングをそのマシン上の
1041 .B portmap
1042 サービスから削除する。このルーティンは成功した場合は 1 を返す。
1043 失敗した場合には 0 を返す。
1044 .LP
1045 .nf
1046 .BI "int registerrpc(unsigned long " prognum ", unsigned long " versnum ,
1047 .BI "                unsigned long " procnum ", char *(*" procname ")(char *),"
1048 .BI "                xdrproc_t " inproc ", xdrproc_t " outproc );
1049 .fi
1050 .IP
1051 .\"O Register procedure
1052 .\"O .I procname
1053 .\"O with the RPC service package.
1054 .\"O If a request arrives for program
1055 .\"O .IR prognum ,
1056 .\"O version
1057 .\"O .IR versnum ,
1058 .\"O and procedure
1059 .\"O .IR procnum ,
1060 .\"O .I procname
1061 .\"O is called with a pointer to its parameter(s);
1062 .\"O .I progname
1063 .\"O should return a pointer to its static result(s);
1064 .\"O .I inproc
1065 .\"O is used to decode the parameters while
1066 .\"O .I outproc
1067 .\"O is used to encode the results.
1068 .\"O This routine returns zero if the registration succeeded, \-1 otherwise.
1069 RPC サービスパッケージを使用して
1070 .I procname
1071 プロシジャを登録する。プログラム
1072 .IR prognum 、
1073 バージョン
1074 .IR versnum 、
1075 プロシジャ
1076 .I procnum
1077 への要求が届いた場合、
1078 .I procname
1079 がパラメーターへのポインターを持って呼び出される。
1080 .I progname
1081 は静的な結果へのポインターを返す必要がある。
1082 .I inproc
1083 はパラメーターをデコードするために使用される。
1084 .I outproc
1085 は結果をエンコードするために使用される。
1086 このルーティンは登録に成功した場合にはゼロを返す。
1087 失敗した場合には \-1 を返す。
1088 .IP
1089 .\"O Warning: remote procedures registered in this form
1090 .\"O are accessed using the UDP/IP transport; see
1091 .\"O .BR svcudp_create ()
1092 .\"O for restrictions.
1093 警告: この形式で登録されたリモート・プロシジャは
1094 UDP/IP 通信を使用する。制限に関しては
1095 .BR svcudp_create ()
1096 を参照すること。
1097 .LP
1098 .nf
1099 .BI "struct rpc_createerr " rpc_createerr ;
1100 .fi
1101 .IP
1102 .\"O A global variable whose value is set by any RPC client creation routine
1103 .\"O that does not succeed.
1104 .\"O Use the routine
1105 .\"O .BR clnt_pcreateerror ()
1106 .\"O to print the reason why.
1107 成功しなかった RPC クライアント生成ルーティンによって設定される大域変数。
1108 .BR clnt_pcreateerror ()
1109 ルーティンが理由を表示するために使用する。
1110 .LP
1111 .nf
1112 .BI "void svc_destroy(SVCXPRT *" xprt );
1113 .fi
1114 .IP
1115 .\"O A macro that destroys the RPC service transport handle,
1116 .\"O .IR xprt .
1117 .\"O Destruction usually involves deallocation
1118 .\"O of private data structures, including
1119 .\"O .I xprt
1120 .\"O itself.
1121 .\"O Use of
1122 .\"O .I xprt
1123 .\"O is undefined after calling this routine.
1124 このマクロは通信ハンドル
1125 .I xprt
1126 の RPC サービスを破壊する。破壊には通常、
1127 .I xprt
1128 を含めて、私的なデータ構造体の破棄が含まれている。
1129 このルーティンを呼び出した後に
1130 .I xprt
1131 を使用することは未定義である。
1132 .LP
1133 .nf
1134 .BI "fd_set " svc_fdset ;
1135 .fi
1136 .IP
1137 .\"O A global variable reflecting the RPC service side's
1138 .\"O read file descriptor bit mask; it is suitable as a parameter to the
1139 .\"O .BR select (2)
1140 .\"O system call.
1141 .\"O This is only of interest if a service implementor does not call
1142 .\"O .BR svc_run (),
1143 .\"O but rather does his own asynchronous event processing.
1144 .\"O This variable is read-only (do not pass its address to
1145 .\"O .BR select (2)!),
1146 .\"O yet it may change after calls to
1147 .\"O .BR svc_getreqset ()
1148 .\"O or any creation routines.
1149 RPC サービス側のファイル・ディスクリプターのビットマスクを反映した大域変数。
1150 .BR select (2)
1151 システムコールのパラメーターのために利用できる。これは
1152 サービスの実装者が
1153 .BR svc_run ()
1154 を呼び出さなずに、独自の非同期イベント処理を用いる場合にのみ意味がある。
1155 この変数は読み込み専用で (そのまま
1156 .BR select (2)
1157 へ渡してはならない!)、
1158 .BR svc_getreqset ()
1159 呼び出しや生成ルーティンの後に変更されているかもしれない。
1160 .LP
1161 .nf
1162 .BI "int " svc_fds ;
1163 .fi
1164 .IP
1165 .\"O Similar to
1166 .\"O .BR svc_fdset ,
1167 .\"O but limited to 32 descriptors.
1168 .\"O This interface is obsoleted by
1169 .\"O .BR svc_fdset .
1170 .B svc_fdset
1171 に似ているが、32 ディスクリプターに制限されている。
1172 このインターフェースは
1173 .B svc_fdset
1174 によって置き換えられた。
1175 .LP
1176 .nf
1177 .BI "svc_freeargs(SVCXPRT *" xprt ", xdrproc_t " inproc ", char *" in );
1178 .fi
1179 .IP
1180 .\"O A macro that frees any data allocated by the RPC/XDR
1181 .\"O system when it decoded the arguments to a service procedure using
1182 .\"O .BR svc_getargs ().
1183 .\"O This routine returns 1 if the results were successfully
1184 .\"O freed,
1185 .\"O and zero otherwise.
1186 このマクロはサービス・プロシジャが
1187 .BR svc_getargs ()
1188 を使用して引き数をデコードした時に
1189 RPC/XDR システムによって割り当てられたデータを解放する。
1190 このルーティンは解放に成功した場合には 1 を返す。
1191 失敗した場合にはゼロを返す。
1192 .LP
1193 .nf
1194 .BI "svc_getargs(SVCXPRT *" xprt ", xdrproc_t " inproc ", char *" in );
1195 .fi
1196 .IP
1197 .\"O A macro that decodes the arguments of an RPC request
1198 .\"O associated with the RPC service transport handle,
1199 .\"O .IR xprt .
1200 .\"O The parameter
1201 .\"O .I in
1202 .\"O is the address where the arguments will be placed;
1203 .\"O .I inproc
1204 .\"O is the XDR routine used to decode the arguments.
1205 .\"O This routine returns one if decoding succeeds, and zero otherwise.
1206 このマクロは RPC サービス通信ハンドル
1207 .I xprt
1208 に関連付けられた RPC 要求の引き数をデコードする。パラメーター
1209 .I in
1210 は引き数の格納されたアドレスである。
1211 .I inproc
1212 は引き数をデコードするための XDR ルーティンである。
1213 このルーティンはデコードに成功した場合は 1 を返す。
1214 失敗した場合はゼロを返す。
1215 .LP
1216 .nf
1217 .BI "struct sockaddr_in *svc_getcaller(SVCXPRT *" xprt );
1218 .fi
1219 .IP
1220 .\"O The approved way of getting the network address of the caller
1221 .\"O of a procedure associated with the RPC service transport handle,
1222 .\"O .IR xprt .
1223 RPC サービス通信ハンドル
1224 .I xprt
1225 に関連付けられたプロシジャの呼び出し元のネットワーク・アドレスを
1226 取得するための標準的な手段。
1227 .LP
1228 .nf
1229 .BI "void svc_getreqset(fd_set *" rdfds );
1230 .fi
1231 .IP
1232 .\"O This routine is only of interest if a service implementor does not call
1233 .\"O .BR svc_run (),
1234 .\"O but instead implements custom asynchronous event processing.
1235 .\"O It is called when the
1236 .\"O .BR select (2)
1237 .\"O system call has determined that an RPC request has arrived on some
1238 .\"O RPC socket(s);
1239 .\"O .I rdfds
1240 .\"O is the resultant read file descriptor bit mask.
1241 .\"O The routine returns when all sockets associated with the value of
1242 .\"O .I rdfds
1243 .\"O have been serviced.
1244 このルーティンはサービスの実装者が
1245 .BR svc_run ()
1246 を呼び出さず、独自の非同期イベント処理を実装する場合にのみ意味がある。
1247 これは
1248 .BR select (2)
1249 システムコールが RPC ソケットに
1250 RPC 要求が到着したと返した場合にのみ呼び出される。
1251 .I rdfds
1252 は結果の読み込みファイル・ディスクリプターのビットマスクである。
1253 このルーティンは
1254 .I rdfds
1255 の値に関連付けられた全てのソケットのサービスが行なわれた時に
1256 返ってくる。
1257 .LP
1258 .nf
1259 .BI "void svc_getreq(int " rdfds );
1260 .fi
1261 .IP
1262 .\"O Similar to
1263 .\"O .BR svc_getreqset (),
1264 .\"O but limited to 32 descriptors.
1265 .\"O This interface is obsoleted by
1266 .\"O .BR svc_getreqset ().
1267 .BR svc_getreqset ()
1268 に似ているがディスクリプターの数が 32 に制限されている。
1269 このインターフェースは
1270 .BR svc_getreqset ()
1271 によって置き換えられた。
1272 .LP
1273 .nf
1274 .BI "bool_t svc_register(SVCXPRT *" xprt ", unsigned long " prognum ,
1275 .BI "                    unsigned long " versnum ,
1276 .BI "                    void (*" dispatch ")(svc_req *, SVCXPRT *),"
1277 .BI "                    unsigned long " protocol );
1278 .fi
1279 .IP
1280 .\"O Associates
1281 .\"O .I prognum
1282 .\"O and
1283 .\"O .I versnum
1284 .\"O with the service dispatch procedure,
1285 .\"O .IR dispatch .
1286 .I prognum
1287
1288 .I versnum
1289 をサービス配分プロシジャ
1290 .I dispatch
1291 で関連付ける。
1292 .\"O If
1293 .\"O .I protocol
1294 .\"O is zero, the service is not registered with the
1295 .\"O .B portmap
1296 .\"O service.
1297 .\"O If
1298 .\"O .I protocol
1299 .\"O is nonzero, then a mapping of the triple
1300 .\"O .RI [ prognum , versnum , protocol\fR]
1301 .\"O to
1302 .\"O \fIxprt\->xp_port\fR
1303 .\"O is established with the local
1304 .\"O .B portmap
1305 .\"O service (generally
1306 .\"O .I protocol
1307 .\"O is zero,
1308 .\"O .B IPPROTO_UDP
1309 .\"O or
1310 .\"O .BR IPPROTO_TCP ).
1311 .I protocol
1312 がゼロの場合、サービスは
1313 .B portmap
1314 サービスには登録されない。
1315 .I protocol
1316 がゼロ以外の場合、
1317 .RI [ prognum , versnum , protocol\fR]
1318 の組み合わせと \fIxprt\->xp_port\fR とのマッピングがローカルの
1319 .B portmap
1320 サービスに登録される。(一般的に
1321 .I protocol
1322 はゼロ、
1323 .BR IPPROTO_UDP 、
1324 .B IPPROTO_TCP
1325 のどれかである。)
1326 .\"O The procedure
1327 .\"O .I dispatch
1328 .\"O has the following form:
1329 プロシジャ
1330 .I dispatch
1331 は以下の形式である:
1332 .in +4n
1333 .nf
1334
1335 dispatch(struct svc_req *request, SVCXPRT *xprt);
1336 .fi
1337 .in
1338 .IP
1339 .\"O The
1340 .\"O .BR svc_register ()
1341 .\"O routine returns one if it succeeds, and zero otherwise.
1342 .BR svc_register ()
1343 ルーティンは成功した場合は 1 を返す。失敗した場合はゼロを返す。
1344 .LP
1345 .nf
1346 .B "void svc_run(void);"
1347 .fi
1348 .IP
1349 .\"O This routine never returns.
1350 .\"O It waits for RPC requests to arrive, and calls the appropriate service
1351 .\"O procedure using
1352 .\"O .BR svc_getreq ()
1353 .\"O when one arrives.
1354 .\"O This procedure is usually waiting for a
1355 .\"O .BR select (2)
1356 .\"O system call to return.
1357 このルーティンは戻ってこない。これは
1358 .SM RPC
1359 要求の到着を待ち、どれかが届いた場合に
1360 .BR svc_getreq ()
1361 を使用して適切なサービス・プロシジャを呼び出す。
1362 このプロシジャは通常は
1363 .BR select (2)
1364 システムコールから返るのを待っている。
1365 .LP
1366 .nf
1367 .BI "bool_t svc_sendreply(SVCXPRT *" xprt ", xdrproc_t " outproc \
1368 ", char *" out );
1369 .fi
1370 .IP
1371 .\"O Called by an RPC service's dispatch routine to send the results of a
1372 .\"O remote procedure call.
1373 .\"O The parameter
1374 .\"O .I xprt
1375 .\"O is the request's associated transport handle;
1376 .\"O .I outproc
1377 .\"O is the XDR routine which is used to encode the results; and
1378 .\"O .I out
1379 .\"O is the address of the results.
1380 .\"O This routine returns one if it succeeds, zero otherwise.
1381 RPC サービス配分ルーティンによってリモート・プロシジャ・コールの結果を
1382 返すために呼び出される。
1383 パラメーター
1384 .I xprt
1385 はその要求に関連付けられた通信ハンドルである。
1386 .I outproc
1387 は結果をエンコードするために使用する XDR ルーティンである。
1388 .I out
1389 は結果のアドレスである。このルーティンは成功した場合は 1 を返す。
1390 失敗した場合はゼロを返す。
1391 .LP
1392 .nf
1393 .BI "void svc_unregister(unsigned long " prognum ", unsigned long " versnum );
1394 .fi
1395 .IP
1396 .\"O Remove all mapping of the double
1397 .\"O .RI [ prognum , versnum ]
1398 .\"O to dispatch routines, and of the triple
1399 .\"O .RI [ prognum , versnum , *\fR]
1400 .\"O to port number.
1401 配分ルーティンから
1402 .RI [ prognum , versnum ]
1403 および
1404 .RI [ prognum , versnum , *\fR]
1405 の組み合わせからポート番号へのマッピングを全て削除する。
1406 .LP
1407 .nf
1408 .BI "void svcerr_auth(SVCXPRT *" xprt ", enum auth_stat " why );
1409 .fi
1410 .IP
1411 .\"O Called by a service dispatch routine that refuses to perform
1412 .\"O a remote procedure call due to an authentication error.
1413 認証エラーによりリモート・プロシジャ・コールの実行を拒否された
1414 場合にサービス配分ルーティンによって呼び出される。
1415 .LP
1416 .nf
1417 .BI "void svcerr_decode(SVCXPRT *" xprt );
1418 .fi
1419 .IP
1420 .\"O Called by a service dispatch routine that cannot successfully
1421 .\"O decode its parameters.
1422 .\"O See also
1423 .\"O .BR svc_getargs ().
1424 パラメータのデコードに失敗した場合に
1425 サービス配分ルーティンによって呼び出される。
1426 .BR svc_getargs ()
1427 も参照すること。
1428 .LP
1429 .nf
1430 .BI "void svcerr_noproc(SVCXPRT *" xprt );
1431 .fi
1432 .IP
1433 .\"O Called by a service dispatch routine that does not implement
1434 .\"O the procedure number that the caller requests.
1435 要求のあったプロシジャ番号が実装されていない場合に
1436 サービス配分ルーティンより呼び出される。
1437 .LP
1438 .nf
1439 .BI "void svcerr_noprog(SVCXPRT *" xprt );
1440 .fi
1441 .IP
1442 .\"O Called when the desired program is not registered with the RPC package.
1443 .\"O Service implementors usually do not need this routine.
1444 RPC パッケージに要求されたプログラムが登録されていない場合に呼び出される。
1445 サービスの実装には通常、このルーティンは必要ない。
1446 .LP
1447 .nf
1448 .BI "void svcerr_progvers(SVCXPRT *" xprt );
1449 .fi
1450 .IP
1451 .\"O Called when the desired version of a program is not registered
1452 .\"O with the RPC package.
1453 .\"O Service implementors usually do not need this routine.
1454 RPC パッケージに要求されたバージョンのプログラムが登録されていない場合に
1455 呼び出される。サービスの実装には通常、このルーティンは必要ない。
1456 .LP
1457 .nf
1458 .BI "void svcerr_systemerr(SVCXPRT *" xprt );
1459 .fi
1460 .IP
1461 .\"O Called by a service dispatch routine when it detects a system
1462 .\"O error not covered by any particular protocol.
1463 .\"O For example, if a service can no longer allocate storage,
1464 .\"O it may call this routine.
1465 特定のプロトコルによってカバーされていなシステム・エラーが
1466 検出された場合にサービス配分ルーティンによって呼び出される。
1467 例えば、サービスがそれ以上、記憶装置を割り当てることができない場合には
1468 このルーティンが呼び出されるかもしれない。
1469 .LP
1470 .nf
1471 .BI "void svcerr_weakauth(SVCXPRT *" xprt );
1472 .fi
1473 .IP
1474 .\"O Called by a service dispatch routine that refuses to perform
1475 .\"O a remote procedure call due to insufficient authentication parameters.
1476 .\"O The routine calls
1477 .\"O .BR "svcerr_auth(xprt, AUTH_TOOWEAK)" .
1478 認証パラメータが足りないためにリモート・プロシジャ・コールの実行を
1479 拒否された場合にサービス配分ルーティンによって呼び出される。
1480 このルーティンは
1481 .B "svcerr_auth(xprt, AUTH_TOOWEAK)"
1482 を呼び出す。
1483 .LP
1484 .nf
1485 .BI "SVCXPRT *svcfd_create(int " fd ", unsigned int " sendsize ,
1486 .BI "                      unsigned int " recvsize );
1487 .fi
1488 .IP
1489 .\"O Create a service on top of any open descriptor.
1490 .\"O Typically, this descriptor is a connected socket for a stream protocol such
1491 .\"O as TCP.
1492 .\"O .I sendsize
1493 .\"O and
1494 .\"O .I recvsize
1495 .\"O indicate sizes for the send and receive buffers.
1496 .\"O If they are zero, a reasonable default is chosen.
1497 任意のオープンされたディスクリプター上にサービスを作成する。
1498 典型的に、ディスクリプターは
1499 TCP のようなストリーム・プロトコルで接続されたソケットである。
1500 .I sendsize
1501
1502 .I recvsize
1503 には送信バッファと受信バッファの大きさを指定する。もしゼロが指定された
1504 場合は適切なデフォルトが選択される。
1505 .LP
1506 .nf
1507 .BI "SVCXPRT *svcraw_create(void);"
1508 .fi
1509 .IP
1510 .\"O This routine creates a toy RPC
1511 .\"O service transport, to which it returns a pointer.
1512 .\"O The transport is really a buffer within the process's address space,
1513 .\"O so the corresponding RPC client should live in the same address space; see
1514 .\"O .BR clntraw_create ().
1515 このルーティンは擬似 RPC サービス通信を生成して、そのポインターを返す。
1516 通信は実際にはそのプロセスのアドレス空間にあるバッファなので
1517 対応する RPC クライアントは同じアドレス空間にいる必要がある。
1518 .BR clntraw_create ()
1519 を参照すること。
1520 .\"O This routine allows simulation of RPC and acquisition of RPC
1521 .\"O overheads (such as round trip times), without any kernel interference.
1522 .\"O This routine returns NULL if it fails.
1523 このルーティンで
1524 RPC のシミュレーションや、カーネル・インターフェースに影響されずに応答時間などの
1525 RPC オーバヘッドを取得ができる。このルーティンは失敗した場合は NULL を返す。
1526 .LP
1527 .nf
1528 .BI "SVCXPRT *svctcp_create(int " sock ", unsigned int " send_buf_size ,
1529 .BI "                       unsigned int " recv_buf_size );
1530 .fi
1531 .IP
1532 .\"O This routine creates a TCP/IP-based RPC
1533 .\"O service transport, to which it returns a pointer.
1534 .\"O The transport is associated with the socket
1535 .\"O .IR sock ,
1536 .\"O which may be
1537 .\"O .BR RPC_ANYSOCK ,
1538 .\"O in which case a new socket is created.
1539 このルーティンは TCP/IP に基づく
1540 RPC サービス通信を作成し、それへのポインターを返す。
1541 通信はソケット
1542 .I sock
1543 に結びつけられる。
1544 .I sock
1545
1546 .B RPC_ANYSOCK
1547 でも良い。この場合は新しいソケットが作成される。
1548 .\"O If the socket is not bound to a local TCP
1549 .\"O port, then this routine binds it to an arbitrary port.
1550 .\"O Upon completion,
1551 .\"O \fIxprt\->xp_sock\fR
1552 .\"O is the transport's socket descriptor, and
1553 .\"O \fIxprt\->xp_port\fR
1554 .\"O is the transport's port number.
1555 もしソケットがローカルな TCP ポートに bind されていない場合は、
1556 このルーティンが適当なポートに bind する。
1557 補完された場合、\fIxprt\->xp_sock\fR には通信のソケット・
1558 ディスクリプターが、\fIxprt\->xp_port\fR には通信のポート番号が
1559 設定される。
1560 .\"O This routine returns NULL if it fails.
1561 .\"O Since TCP-based RPC uses buffered I/O,
1562 .\"O users may specify the size of buffers; values of zero
1563 .\"O choose suitable defaults.
1564 このルーティンは失敗した場合は NULL を返す。
1565 TCP に基づいた RPC はバッファされた I/O を使用するため、
1566 ユーザはバッファの大きさを指定できる。
1567 ゼロを指定した場合は適切なデフォルトが選択される。
1568 .LP
1569 .nf
1570 .BI "SVCXPRT *svcudp_bufcreate(int " sock ", unsigned int " sendsize ,
1571 .BI "                          unsigned int " recosize );
1572 .fi
1573 .IP
1574 .\"O This routine creates a UDP/IP-based RPC
1575 .\"O service transport, to which it returns a pointer.
1576 .\"O The transport is associated with the socket
1577 .\"O .IR sock ,
1578 .\"O which may be
1579 .\"O .BR RPC_ANYSOCK ,
1580 .\"O in which case a new socket is created.
1581 .\"O If the socket is not bound to a local UDP
1582 .\"O port, then this routine binds it to an arbitrary port.
1583 .\"O Upon completion,
1584 .\"O \fIxprt\->xp_sock\fR
1585 .\"O is the transport's socket descriptor, and
1586 .\"O \fIxprt\->xp_port\fR
1587 .\"O is the transport's port number.
1588 .\"O This routine returns NULL if it fails.
1589 このルーティンは UDP/IP に基づいた RPC サービス通信を作成し、
1590 そのポインターを返す。通信はソケット
1591 .I sock
1592 に関連付けられる。
1593 .I sock
1594
1595 .B RPC_ANYSOCK
1596 でも良い。この場合は新しいソケットが作成される。
1597 ソケットがローカルの UDP ポートに bind されていない場合には
1598 このルーティンは適当なポートに bind する。
1599 補完された場合、\fIxprt\->xp_sock\fR に通信のソケットの
1600 ディスクリプターが、\fIxprt\->xp_port\fR に通信のポート番号が
1601 設定される。このルーティンは失敗した場合には NULL を返す。
1602 .IP
1603 .\"O This allows the user to specify the maximum packet size for sending and
1604 .\"O receiving UDP-based RPC messages.
1605 これによりユーザは UDP に基づいた RPC メッセージで
1606 使用できる送信パケットおよび受信パケットの最大サイズを指定できる。
1607 .LP
1608 .nf
1609 .BI "SVCXPRT *svcudp_create(int " sock );
1610 .fi
1611 .IP
1612 .\"O This call is equivalent to
1613 .\"O \fIsvcudp_bufcreate(sock,SZ,SZ)\fP
1614 .\"O for some default size \fISZ\fP.
1615 送信パケットと受信パケットのサイズを同じデフォルトの値 \fISZ\fP に指定した
1616 \fIsvcudp_bufcreate(sock,SZ,SZ)\fP と等価である。
1617 .LP
1618 .nf
1619 .BI "bool_t xdr_accepted_reply(XDR *" xdrs ", struct accepted_reply *" ar );
1620 .fi
1621 .IP
1622 .\"O Used for encoding RPC reply messages.
1623 .\"O This routine is useful for users who wish to generate
1624 .\"O RPC-style messages without using the RPC package.
1625 RPC 応答メッセージをエンコードするのに使用する。このルーティンは
1626 RPC パッケージを用いずに
1627 RPC-形式のメッセージを作成しようとする場合に便利である。
1628 .LP
1629 .nf
1630 .BI "bool_t xdr_authunix_parms(XDR *" xdrs ", struct authunix_parms *" aupp );
1631 .fi
1632 .IP
1633 .\"O Used for describing UNIX credentials.
1634 .\"O This routine is useful for users
1635 .\"O who wish to generate these credentials without using the RPC
1636 .\"O authentication package.
1637 UNIX 形式の証明書を記述するために使用する。このルーティンは
1638 RPC 認証パッケージを使用せずにこれらの証明書を作成しようとする場合に便利である。
1639 .LP
1640 .nf
1641 .BI "void xdr_callhdr(XDR *" xdrs ", struct rpc_msg *" chdr );
1642 .fi
1643 .IP
1644 .\"O Used for describing RPC call header messages.
1645 .\"O This routine is useful for users who wish to generate
1646 .\"O RPC-style messages without using the RPC package.
1647 RPC 呼び出しのヘッダー・メッセージを記述するために使用する。
1648 このルーティンは RPC パッケージを使用せずに
1649 RPC-形式のメッセージを作成しようとする場合に便利である。
1650 .LP
1651 .nf
1652 .BI "bool_t xdr_callmsg(XDR *" xdrs ", struct rpc_msg *" cmsg );
1653 .fi
1654 .IP
1655 .\"O Used for describing RPC call messages.
1656 .\"O This routine is useful for users who wish to generate RPC-style
1657 .\"O messages without using the RPC package.
1658 RPC 呼び出しメッセージを記述するのに使用する。
1659 このルーティンは RPC パッケージを使用せずに
1660 RPC-形式のメッセージを作成しようとする場合に便利である。
1661 .LP
1662 .nf
1663 .BI "bool_t xdr_opaque_auth(XDR *" xdrs ", struct opaque_auth *" ap );
1664 .fi
1665 .IP
1666 .\"O Used for describing RPC authentication information messages.
1667 .\"O This routine is useful for users who wish to generate
1668 .\"O RPC-style messages without using the RPC package.
1669 PRC 認証情報メッセージを記述するために使用する。
1670 このルーティンは RPC パッケージを使用せずに
1671 RPC-形式のメッセージを作成しようとする場合に便利である。
1672 .LP
1673 .nf
1674 .BI "bool_t xdr_pmap(XDR *" xdrs ", struct pmap *" regs );
1675 .fi
1676 .IP
1677 .\"O Used for describing parameters to various
1678 .\"O .B portmap
1679 .\"O procedures, externally.
1680 .\"O This routine is useful for users who wish to generate
1681 .\"O these parameters without using the
1682 .\"O .B pmap
1683 .\"O interface.
1684 各種の
1685 .B portmap
1686 プロシジャへのパラメーターを外部的に記述するために使用する。
1687 このルーティンは
1688 .B pmap
1689 インターフェースを使用せずに、これらのパラメーターを
1690 作成したい場合に便利である。
1691 .LP
1692 .nf
1693 .BI "bool_t xdr_pmaplist(XDR *" xdrs ", struct pmaplist **" rp );
1694 .fi
1695 .IP
1696 .\"O Used for describing a list of port mappings, externally.
1697 .\"O This routine is useful for users who wish to generate
1698 .\"O these parameters without using the
1699 .\"O .B pmap
1700 .\"O interface.
1701 ポートのマッピングのリストを外部的に記述するために使用する。
1702 このルーティンは
1703 .B pmap
1704 インターフェースを使用せずに、これらのパラメーターを
1705 作成したい場合に便利である。
1706 .LP
1707 .nf
1708 .BI "bool_t xdr_rejected_reply(XDR *" xdrs ", struct rejected_reply *" rr );
1709 .fi
1710 .IP
1711 .\"O Used for describing RPC reply messages.
1712 .\"O This routine is useful for users who wish to generate
1713 .\"O RPC-style messages without using the RPC package.
1714 RPC 応答メッセージを記述するために使用する。このルーティンは
1715 RPC パッケージを使用せずに、
1716 RPC-形式のメッセージを作成したい場合に便利である。
1717 .LP
1718 .nf
1719 .BI "bool_t xdr_replymsg(XDR *" xdrs ", struct rpc_msg *" rmsg );
1720 .fi
1721 .IP
1722 .\"O Used for describing RPC reply messages.
1723 .\"O This routine is useful for users who wish to generate
1724 .\"O RPC style messages without using the RPC package.
1725 RPC 応答メッセージを記述するために使用する。
1726 このルーティンは RPC パッケージを使用せずに、
1727 RPC 形式のメッセージを作成したい場合に便利である。
1728 .LP
1729 .nf
1730 .BI "void xprt_register(SVCXPRT *" xprt );
1731 .fi
1732 .IP
1733 .\"O After RPC service transport handles are created,
1734 .\"O they should register themselves with the RPC service package.
1735 .\"O This routine modifies the global variable
1736 .\"O .IR svc_fds .
1737 .\"O Service implementors usually do not need this routine.
1738 RPC サービス通信ハンドルを生成した後に、それら自身を
1739 RPC サービス・パッケージに登録する必要がある。
1740 このルーティンは大域変数
1741 .I svc_fds
1742 を修正する。サービスの実装者は通常、このルーティンは必要ない。
1743 .LP
1744 .nf
1745 .BI "void xprt_unregister(SVCXPRT *" xprt );
1746 .fi
1747 .IP
1748 .\"O Before an RPC service transport handle is destroyed,
1749 .\"O it should unregister itself with the RPC service package.
1750 .\"O This routine modifies the global variable
1751 .\"O .IR svc_fds .
1752 .\"O Service implementors usually do not need this routine.
1753 RPC サービス通信ハンドルを破壊する前に、それを
1754 RPC 通信パッケージから登録解除する必要がある。
1755 このルーティンは大域変数
1756 .I svc_fds
1757 を修正する。サービスの実装者は通常、このルーティンは必要ない。
1758 .\"O .SH "SEE ALSO"
1759 .SH 関連項目
1760 .\"O .\" We don't have an rpc_secure.3 page in the set at the moment -- MTK, 19 Sep 05
1761 .\"O .\" .BR rpc_secure (3),
1762 .\" 今現在は、この配布物 (LDP_man-pages) には rpc_secure.3 は入っていない
1763 .\" -- MTK, 19 Sep 05
1764 .\" .BR rpc_secure (3),
1765 .BR xdr (3)
1766 .br
1767 .\"O The following manuals:
1768 以下のマニュアル:
1769 .RS
1770 Remote Procedure Calls: Protocol Specification
1771 .br
1772 Remote Procedure Call Programming Guide
1773 .br
1774 rpcgen Programming Guide
1775 .br
1776 .RE
1777 .IR "RPC: Remote Procedure Call Protocol Specification" ,
1778 RFC\ 1050, Sun Microsystems, Inc.,
1779 USC-ISI.