authunix_create_defaultのヘルプ・マニュアル
日本語 英語
authunix_create_default --help
man authunix_create_default
RPC(3) Linux Programmer’s Manual RPC(3)
名前
rpc - 遠隔手続き呼び出し(RPC)のためのライブラリ・ルーティン
書式と説明
これらのルーティンは C プログラムでネットワークを通して他のマシンにアク
セスするプロシジャを作成することを可能にする。最初にクライアントはデ ー
タ パケットをサーバに送るためにプロシジャを呼び出す。サーバはパケットを
受け取ると、配分ルーチンを呼び出して要求されたサービスに実行し、返答 を
送り返す。最後にプロシジャ・コールはクライアントへと戻る。
これらのルーティンを使用するには、ヘッダファイル をインクル
ードすること。
下記のプロトタイプでは次の型を使用している。
typedef int bool_t;
typedef bool_t (*xdrproc_t) (XDR *, void *,...);
typedef bool_t (*resultproc_t) (caddr_t resp,
struct sockaddr_in *raddr);
型 AUTH, CLIENT, SVCXPRT, XDR の宣言についてはヘッダファイルを参照。
void auth_destroy(AUTH *auth);
このマクロは auth に関連付けられた認証情報を破壊する。破壊は通常
は私的なデータ構造の破棄を含んでいる。 auth_destroy() を呼び出し
た後に auth を使用することは未定義である。
AUTH *authnone_create(void);
各リモート・プロシジャ・コールで使用できない仮の認証情報として渡
される RPC 認証ハンドルを作成して返す。これは RPC で使用されるデ
フォルトの認証である。
AUTH *authunix_create(char *host, int uid, int gid,
int len, int *aup_gids);
認証情報を含んだ RPC 認証ハンドルを作成して返す。 host パラメ ー
タ ーは情報が作成されたマシンの名前である。 uid はそのユーザのユ
ーザ ID 、 gid はそのユーザの現在のグループ ID である。 len と
aup_gids はそのユーザが所属するグループの配列を参照している。他
のユーザになりすますことは簡単である。
AUTH *authunix_create_default(void);
適切なパラメーターで authunix_create() を呼び出す。
int callrpc(char *host, unsigned long prognum,
unsigned long versnum, unsigned long procnum,
xdrproc_t inproc, char *in,
xdrproc_t outproc, char *out);
マシン host 上で prognum, versnum, procnum に関連付けられたリ モ
ート・プロシジャを呼び出す。パラメーター in はプロシジャの引き数
のアドレスであり out は結果を格納するアドレスである。 inproc は
プ ロ シジャのパラメーターをエンコードするのに使用され、 outproc
は結果をデコードするのに使用される。このルーティンは成功した場合
にはゼロを返す。失敗した場合には enum clnt_stat を整数にキャスト
した値を返す。 clnt_perrno() ルーティンが失敗の状態をメッセー ジ
に変換するのに使用できる。
警 告: このルーティンでリモート・プロシジャを呼び出すと通信には
UDP/IP が使用される。この際の制限については clntudp_create() を
参照すること。このルーティンを使用して認証や時間切れの制御をする
ことはできない。
enum clnt_stat clnt_broadcast(unsigned long prognum,
unsigned long versnum, unsigned long procnum,
xdrproc_t inproc, char *in,
xdrproc_t outproc, char *out,
resultproc_t eachresult);
callrpc() と同様であるが、メッセージがローカルのブロードキャスト
・ネットワーク全体へとブロードキャストされる点が異っている。回答
を受け取る度にこのルーティンは以下の形式の eachresult() を呼び出
す。
eachresult(char *out, struct sockaddr_in *addr);
ここで out は clnt_broadcast() に渡される out と同じであるが、リ
モート・プロシジャからの出力がデコードされている点のみが異ってい
る 。 addr は 結 果を送って来たマシンのアドレスを指している。
eachresult() がゼロを返した場合、 clnt_broadcast() はさらなる 回
答を待つ。そうでなければ適切な状態で終了する。
警告: ブロードキャスト・ソケットはデータリンク層の最大転送単位に
制限されている。イーサネットの場合、最大値は 1500 バイトである。
enum clnt_stat clnt_call(CLIENT *clnt, unsigned long procnum,
xdrproc_t inproc, char *in,
xdrproc_t outproc, char *out,
struct timeval tout);
このマクロはクライアント・ハンドル clnt に関連付けられた procnum
リモート・プロシジャを呼び出す。クライア ン ト ・ ハ ン ド ル は
clnt_create() のような RPC クライアント作成ルーティンによって得
られる。パタメータ in はプロシジャの引き数のアドレスである。 out
はプロシジャの返り値を格納するアドレスである。 inproc はプロシジ
ャのパラメーターをエンコードするのに使用される。 outproc はプ ロ
シジャの返り値をデコードするのに使用される。 tout は結果が返され
るのを待つ時間である。
clnt_destroy(CLIENT *clnt);
このマクロはクライアントの RPC ハンドルを破壊する。破壊には通 常
は clnt 自 身も含めて私的なデータ構造体の破棄が含まれている。
clnt_destroy() の呼び出しの後に clnt を使用することは未定義で あ
る 。 RPC ライブラリが関連するソケットをオープンした場合には、そ
れも閉じられる。それ以外の場合にはソケットはオープンされたままで
ある。
CLIENT *clnt_create(char *host, unsigned long prog,
unsigned long vers, char *proto);
一般的なクライアントの作成ルーティンである。 host はサーバのある
リモートホストの名前を指定する。 proto どのような通信プロトコ ル
を 使用するかを指定する。現在ここに使用できる値は “udp” と “tcp”
である。デフォルトの時間切れが設定されるが、 clnt_control() を使
用して変更可能である。
警告: UDP を使用した場合には欠点がある。 UDP に基づいた RPC メッ
セージは最大でも 8 KByte のエンコードデータしか保持することが で
きないため、大きな引き数や巨大な結果を取るプロシジャには使用する
ことができない。
bool_t clnt_control(CLIENT *cl, int req, char *info);
このマクロは各種クライアントについて情報を変更したり、取得したり
す るのに使用する。 req は操作の種類を指定する。 info は情報への
ポインターである。 UDP と TCP どちらの場合も使用可能な req の 値
と、その引き数の型、およびその内容は以下の通りである:
CLSET_TIMEOUT struct timeval // 時間切れを設定する
CLGET_TIMEOUT struct timeval // 時間切れを取得する
注 意: clnt_control() を使用して時間切れを設定した場合にはそれ以
後は clnt_call() に渡される時間切れパラメーターは全て無視され る
。
CLGET_SERVER_ADDR struct sockaddr_in // サーバアドレスを取得する
以下の操作は UDP の場合にのみ有効である:
CLSET_RETRY_TIMEOUT struct timeval // 再送間隔を設定する
CLGET_RETRY_TIMEOUT struct timeval // 再送間隔を取得する
再 送間隔は次に要求を再送する前に "UDP RPC" がサーバの回答を待つ
時間である。
clnt_freeres(CLIENT * clnt, xdrproc_t outproc, char *out);
このマクロは RPC 呼び出しの結果のデコードの際に RPC/XDR システム
に よって割当てられたデータを解放する。パラメーター out は結果の
アドレスである。 outproc は結果を記述している XDR ルーティンであ
る 。このルーティンは結果の解放に成功した場合には 1 を返す。失敗
した場合にはゼロを返す。
void clnt_geterr(CLIENT *clnt, struct rpc_err *errp);
このマクロはクライアント・ハンドルのエラー構造体を errp アドレス
で指定された構造体へコピーする。
void clnt_pcreateerror(char *s);
標 準エラー出力に、なぜクライアント RPC ハンドルの作成ができなか
ったかについてのメッセージを表示する。メッセージの前に文字 列 s
と コ ロ ン(:) が 表 示される。 clnt_create(), clntraw_create(),
clnttcp_create(), clntudp_create() の呼び出しが失敗した時に使 用
すること。
void clnt_perrno(enum clnt_stat stat);
標準エラー出力に stat によって指示されるエラー状態に対応するメッ
セージを表示する。 callrpc() の後に使用すること。
clnt_perror(CLIENT *clnt, char *s);
標準エラー出力に、なぜ RPC 呼び出しが失敗したかについてのメッ セ
ージを表示する。 clnt はコールに使用したハンドルである。メッセー
ジの前に文字列 s とコロン(:)が表示される。 clnt_call() が失敗 し
た後に使用すること。
char *clnt_spcreateerror(char *s);
clnt_pcreateerror() と同様であるが、標準エラー出力へ表示するかわ
りに文字列を返す点が異っている。
バグ: 静的な領域へのポインターを返すため、呼び出しごとに上書きさ
れる。
char *clnt_sperrno(enum clnt_stat stat);
clnt_perrno() と同じ引き数を取るが、なぜ RPC 呼び出しが失敗した
かについてのメッセージを標準エラー出力に表示するかわりに、メッセ
ー ジを格納している文字列へのポインターを返す。文字列は NEWLINE(
改行) で終っている。
clnt_sperrno() はプログラムが標準エラー出力を持っていない場合(プ
ロ グラムがサーバとして走っている場合にはよくありえる)や、プログ
ラマーがメッセージを printf(3) で出力することを望まない場合や 、
メ ッセージの形式が clnt_perrno() がサポートするものとは異ってい
る場合などに clnt_perrno() のかわ り に 使 用 さ れ る 。 注 意:
clnt_sperror() や clnt_spcreaterror() とは違って clnt_sperrno()
は静的データへのポインターを返す。しかし呼び出しごとに上書きされ
ることはない。
char *clnt_sperror(CLIENT *rpch, char *s);
clnt_perror() と 同 様であるが、標準エラー出力に表示する代りに
(clnt_sperrno() のように) 文字列へのポインターを返す点が異ってい
る。
バグ: 呼び出しごとに上書きされる静的データへのポインターを返す。
CLIENT *clntraw_create(unsigned long prognum, unsigned long versnum);
このルーティンはリモート・プログラム prognum、バージョン versnum
の ための擬似 RPC クライアントを作成する。メッセージをサービスに
渡すために使用する通信は実際にはそのプロセスのアドレス空間にある
バ ッファーである。それで、対応する RPC サーバが同じアドレス空間
の中にいなければならない。 svcraw_create() を参照すること。こ れ
に より RPC のシミュレーションや、カーネル・インターフェースに影
響されずに応答時間などの RPC オーバヘッドの獲得ができる。失敗 し
た場合にはこのルーティンは NULL を返す。
CLIENT *clnttcp_create(struct sockaddr_in *addr,
unsigned long prognum, unsigned long versnum,
int *sockp, unsigned int sendsz, unsigned int recvsz);
このルーティンはリモート・プログラム prognum、バージョン versnum
のための RPC クライアントを作成する。クライアントは通信に TCP/IP
を 使 用 す る。リモート・プログラムはインターネット・アドレスの
*addr にある。 addr->sin_port がゼロならば、実際にリモート・プロ
グ ラムが listen しているポートが設定される。(この情報のためにリ
モートの portmap サービスが利用される。) パラメーター sockp はソ
ケ ットである。もしこれが RPC_ANYSOCK に設定されている場合は、こ
のルーティンが新しいソケットをオープンして sockp に設定 す る 。
TCP に基づいた RPC はバッファされた I/O を使用するため、ユーザは
パラメーター sendsz と recvsz を使用して送信バッファと受信バッフ
ァのサイズを指定することができる。ゼロを指定した場合には適切なデ
フォルトが選択される。このルーティンは失敗した場合は NULL を返す
。
CLIENT *clntudp_create(struct sockaddr_in *addr,
unsigned long prognum, unsigned long versnum,
struct timeval wait, int *sockp);
このルーティンはリモート・プログラム prognum、バージョン versnum
のための RPC クライアントを作成する。クライアントは通信に UDP/IP
を 使 用 す る。リモート・プログラムはインターネット・アドレスの
*addr にある。 addr->sin_port がゼロならば、実際にリモート・プロ
グ ラムが listen しているポートが設定される。(この情報のためにリ
モートの portmap サービスが利用される。) パラメーター sockp はソ
ケ ットである。もしこれが RPC_ANYSOCK に設定されている場合は、こ
のルーティンが新しいソケットをオープンして sockp に設定 す る 。
UDP 通信は回答があるか、時間切れが起こるまで wait 間隔で呼び出し
メッセージを再送する。時間切れが起 こ る ま で の 合 計 時 間 は
clnt_call() で指定する。
警告: UDP に基づいた RPC メッセージは最大でも 8 Kbyte までのエン
コードされたデータしか保持できないため、この通信は大きな引き数や
巨大な結果を取るプロシジャには使用できない。
CLIENT *clntudp_bufcreate(struct sockaddr_in *addr,
unsigned long prognum, unsigned long versnum,
struct timeval wait, int *sockp,
unsigned int sendsize, unsigned int recosize);
このルーティンはリモート・プログラム prognum、バージョン versnum
のための RPC クライアントを作成する。クライアントは通信に UDP/IP
を 使 用 す る。リモート・プログラムはインターネット・アドレスの
*addr にある。 addr->sin_port がゼロならば、実際にリモート・プロ
グ ラムが listen しているポートが設定される。(この情報のためにリ
モートの portmap サービスが利用される。) パラメーター sockp はソ
ケ ットである。もしこれが RPC_ANYSOCK に設定されている場合は、こ
のルーティンが新しいソケットをオープンして sockp に設定 す る 。
UDP 通信は回答があるか、時間切れが起こるまで wait 間隔で呼び出し
メッセージを再送する。時間切れが起 こ る ま で の 合 計 時 間 は
clnt_call() で指定する。
これを使用すると UDP に基づいた RPC メッセージにおいて送信パケッ
トや受信パケットの最大サイズを指定することが可能になる。
void get_myaddress(struct sockaddr_in *addr);
このマシンの IP アドレスを *addr に格納する。 /etc/hosts を扱 う
ライブラリ・ルーティンは使用しない。ポート番号は常に htons(PMAP-
PORT) に設定される。
struct pmaplist *pmap_getmaps(struct sockaddr_in *addr);
portmap サービスのためのユーザインターフェースであり、 IP アドレ
ス *addr にあるホストの現在の RPC プログラムからポート番号へのマ
ッピングの一覧を返す。このルーティンが NULL を返す場合もあ る 。
‘rpcinfo -p’ コマンドはこのルーティンを使用している。
unsigned short pmap_getport(struct sockaddr_in *addr,
unsigned long prognum, unsigned long versnum,
unsigned int protocol);
portmap サービスのためのユーザ・インターフェースで、プログラム番
号 prognum、バージョン versnum、関連付けられた通信プ ロ ト コ ル
protocol を サポートするサービスが待っているポート番号を返す。
protocol の値はほとんどの場合 IPPROTO_UDP か IPPROTO_TCP であ る
。 返り値ゼロはマッピングが存在しないか、 RPC システムがリモート
の portmap サービスの参照に失敗したことを意味する。後者の場合 は
大域変数 rpc_createerr が RPC 状態を保持している。
enum clnt_stat pmap_rmtcall(struct sockaddr_in *addr,
unsigned long prognum, unsigned long versnum,
unsigned long procnum,
xdrproc_t inproc, char *in,
xdrproc_t outproc, char *out,
struct timeval tout, unsigned long *portp);
portmap サービスのためのユーザ・インターフェースで、 IP アドレス
*addr のホストの portmap を参照して、 RPC 呼び出しを生成し、その
ホスト上のプロシジャを呼び出す。パラメーター *portp はプロシジャ
が成功した場合にはプログラムのポート番号に修正される。他のパラメ
ーターの定義については callrpc() や clnt_call() で説明してある。
このプロシジャは “ping” のみに使用すべきで あ る 。 clnt_broad-
cast() も参照すること。
bool_t pmap_set(unsigned long prognum, unsigned long versnum,
unsigned int protocol, unsigned short port);
portmap サ ー ビ ス の た め の ユ ー ザ・インターフェースで、
[prognum,versnum,protocol] の組み合わせと port との間のマッピ ン
グ を、そのマシン上の portmap サービスに登録する。 protocol はほ
とんどの場合 IPPROTO_UDP か IPPROTO_TCP のどちらかである。このル
ー ティンは成功した場合には 1 を返す。失敗した場合にはゼロを返す
。 svc_register() によって自動的に実行される。
bool_t pmap_unset(unsigned long prognum, unsigned long versnum);
portmap サービスのためのユー ザ ・ イ ン タ ー フ ェ ー ス で 、
[prognum,versnum,*] の組み合わせと ports の間のマッピングをその
マシン上の portmap サービスから削除する。このルーティンは成功 し
た場合は 1 を返す。失敗した場合には 0 を返す。
int registerrpc(unsigned long prognum, unsigned long versnum,
unsigned long procnum, char *(*procname)(char *),
xdrproc_t inproc, xdrproc_t outproc);
RPC サービスパッケージを使用して procname プロシジャを登録する。
プログラム prognum、バージョン versnum、プロシジャ procnum へ の
要求が届いた場合、 procname がパラメーターへのポインターを持って
呼び出される。 progname は静的な結果へのポインターを返す必要があ
る 。 inproc はパラメーターをデコードするために使用される。 out-
proc は結果をエンコードするために使用される。このルーティンは 登
録に成功した場合にはゼロを返す。失敗した場合には -1 を返す。
警告: この形式で登録されたリモート・プロシジャは UDP/IP 通信を使
用する。制限に関しては svcudp_create() を参照すること。
struct rpc_createerr rpc_createerr;
成功しなかった RPC クライアント生成ルーティンによって設定され る
大 域変数。 clnt_pcreateerror() ルーティンが理由を表示するために
使用する。
void svc_destroy(SVCXPRT *xprt);
このマクロは通信ハンドル xprt の RPC サービスを破壊する。破壊 に
は通常、 xprt を含めて、私的なデータ構造体の破棄が含まれている。
このルーティンを呼び出した後に xprt を使用することは未定義である
。
fd_set svc_fdset;
RPC サービス側のファイル・ディスクリプターのビットマスクを反映し
た大域変数。 select(2) システムコールのパラメーターのために利 用
で きる。これはサービスの実装者が svc_run() を呼び出さなずに、独
自の非同期イベント処理を用いる場合にのみ意味がある。この変数は読
み 込 み 専 用 で ( そ の まま select(2) へ渡してはならない!)、
svc_getreqset() 呼び出しや生成ルーティンの後に変更されているかも
しれない。
int svc_fds;
svc_fdset に似ているが、32 ディスクリプターに制限されている。こ
のインターフェースは svc_fdset によって置き換えられた。
svc_freeargs(SVCXPRT *xprt, xdrproc_t inproc, char *in);
このマクロはサービス・プロシジャが svc_getargs() を使用して引 き
数 をデコードした時に RPC/XDR システムによって割り当てられたデー
タを解放する。このルーティンは解放に成功した場合には 1 を返す 。
失敗した場合にはゼロを返す。
svc_getargs(SVCXPRT *xprt, xdrproc_t inproc, char *in);
こ のマクロは RPC サービス通信ハンドル xprt に関連付けられた RPC
要求の引き数をデコードする。パラメーター in は引き数の格納された
ア ドレスである。 inproc は引き数をデコードするための XDR ルーテ
ィンである。このルーティンはデコードに成功した場合は 1 を返す 。
失敗した場合はゼロを返す。
struct sockaddr_in *svc_getcaller(SVCXPRT *xprt);
RPC サービス通信ハンドル xprt に関連付けられたプロシジャの呼び出
し元のネットワーク・アドレスを取得するための標準的な手段。
void svc_getreqset(fd_set *rdfds);
このルーティンはサービスの実装者が svc_run() を呼び出さず、独 自
の 非 同 期 イ ベ ント処理を実装する場合にのみ意味がある。これは
select(2) システムコールが RPC ソケットに RPC 要求が到着したと返
し た場合にのみ呼び出される。 rdfds は結果の読み込みファイル・デ
ィスクリプターのビットマスクである。このルーティンは rdfds の 値
に関連付けられた全てのソケットのサービスが行なわれた時に返ってく
る。
void svc_getreq(int rdfds);
svc_getreqset() に似ているがディスクリプターの数が 32 に制限され
て いる。このインターフェースは svc_getreqset() によって置き換え
られた。
bool_t svc_register(SVCXPRT *xprt, unsigned long prognum,
unsigned long versnum,
void (*dispatch)(svc_req *, SVCXPRT *),
unsigned long protocol);
prognum と versnum をサービス配分プロシジャ dispatch で関連付 け
る 。 protocol がゼロの場合、サービスは portmap サービスには登録
されない。 protocol がゼロ以外の場合 、 [prognum,versnum,proto-
col] の 組 み合わせと xprt->xp_port とのマッピングがローカルの
portmap サービスに登録される。(一般的 に protocol は ゼ ロ 、
IPPROTO_UDP 、 IPPROTO_TCP のどれかである。) プロシジャ dispatch
は以下の形式である:
dispatch(struct svc_req *request, SVCXPRT *xprt);
svc_register() ルーティンは成功した場合は 1 を返す。失敗した場合
はゼロを返す。
void svc_run(void);
こ のルーティンは戻ってこない。これは RPC 要求の到着を待ち、どれ
かが届いた場合に svc_getreq() を使用して適切なサービス・プロシジ
ャ を呼び出す。このプロシジャは通常は select(2) システムコールか
ら返るのを待っている。
bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, char *out);
RPC サービス配分ルーティンによってリモート・プロシジャ・コールの
結果を返すために呼び出される。パラメーター xprt はその要求に関連
付けられた通信ハンドルである。 outproc は結果をエンコードする た
めに使用する XDR ルーティンである。 out は結果のアドレスである。
このルーティンは成功した場合は 1 を返す。失敗した場合はゼロを 返
す。
void svc_unregister(unsigned long prognum, unsigned long versnum);
配 分ルーティンから [prognum,versnum] および [prognum,versnum,*]
の組み合わせからポート番号へのマッピングを全て削除する。
void svcerr_auth(SVCXPRT *xprt, enum auth_stat why);
認証エラーによりリモート・プロシジャ・コールの実行を拒否された場
合にサービス配分ルーティンによって呼び出される。
void svcerr_decode(SVCXPRT *xprt);
パラメータのデコードに失敗した場合にサービス配分ルーティンによっ
て呼び出される。 svc_getargs() も参照すること。
void svcerr_noproc(SVCXPRT *xprt);
要求のあったプロシジャ番号が実装されていない場合にサービス配分ル
ーティンより呼び出される。
void svcerr_noprog(SVCXPRT *xprt);
RPC パッケージに要求されたプログラムが登録されていない場合に呼び
出される。サービスの実装には通常、このルーティンは必要ない。
void svcerr_progvers(SVCXPRT *xprt);
RPC パッケージに要求されたバージョンのプログラムが登録されていな
い場合に呼び出される。サービスの実装には通常、このルーティンは必
要ない。
void svcerr_systemerr(SVCXPRT *xprt);
特定のプロトコルによってカバーされていなシステム・エラーが検出さ
れた場合にサービス配分ルーティンによって呼び出される。例えば、サ
ービスがそれ以上、記憶装置を割り当てることができない場合にはこの
ルーティンが呼び出されるかもしれない。
void svcerr_weakauth(SVCXPRT *xprt);
認証パラメータが足りないためにリモート・プロシジャ・コールの実行
を拒否された場合にサービス配分ルーティンによって呼び出される。こ
のルーティンは svcerr_auth(xprt, AUTH_TOOWEAK) を呼び出す。
SVCXPRT *svcfd_create(int fd, unsigned int sendsize,
unsigned int recvsize);
任意のオープンされたディスクリプター上にサービスを作成する。典型
的に、ディスクリプターは TCP のようなストリーム・プロトコルで 接
続されたソケットである。 sendsize と recvsize には送信バッファと
受信バッファの大きさを指定する。もしゼロが指定された場合は適切な
デフォルトが選択される。
SVCXPRT *svcraw_create(void);
こ のルーティンは擬似 RPC サービス通信を生成して、そのポインター
を返す。通信は実際にはそのプロセスのアドレス空間にあるバッファな
の で対応する RPC クライアントは同じアドレス空間にいる必要がある
。 clntraw_create() を参照すること。このルーティンで RPC のシ ミ
ュレーションや、カーネル・インターフェースに影響されずに応答時間
などの RPC オーバヘッドを取得ができる。このルーティンは失敗し た
場合は NULL を返す。
SVCXPRT *svctcp_create(int sock, unsigned int send_buf_size,
unsigned int recv_buf_size);
こ のルーティンは TCP/IP に基づく RPC サービス通信を作成し、それ
へのポインターを返す。通信はソケット sock に結びつけ ら れ る 。
sock は RPC_ANYSOCK でも良い。この場合は新しいソケットが作成され
る。もしソケットがローカルな TCP ポートに bind されていない場 合
は 、 こ の ルーティンが適当なポートに bind する。補完された場合
、xprt->xp_sock には通信のソケット ・ デ ィ ス ク リ プ タ ー が
、xprt->xp_port には通信のポート番号が設定される。このルーティン
は失敗した場合は NULL を返す。 TCP に基づいた RPC はバッファされ
た I/O を使用するため、ユーザはバッファの大きさを指定できる。ゼ
ロを指定した場合は適切なデフォルトが選択される。
SVCXPRT *svcudp_bufcreate(int sock, unsigned int sendsize,
unsigned int recosize);
このルーティンは UDP/IP に基づいた RPC サービス通信を作成し、 そ
の ポインターを返す。通信はソケット sock に関連付けられる。 sock
は RPC_ANYSOCK でも良い。この場合は新しいソケットが作成される 。
ソ ケットがローカルの UDP ポートに bind されていない場合にはこの
ルーティンは適当なポートに bind す る 。 補 完 さ れ た 場 合
、xprt->xp_sock に 通 信 の ソ ケ ッ ト の デ ィスクリプターが
、xprt->xp_port に通信のポート番号が設定される。このルーティンは
失敗した場合には NULL を返す。
これによりユーザは UDP に基づいた RPC メッセージで使用できる送信
パケットおよび受信パケットの最大サイズを指定できる。
SVCXPRT *svcudp_create(int sock);
送信パケットと受信パケットのサイズを同じデフォルトの値 SZ に指定
した svcudp_bufcreate(sock,SZ,SZ) と等価である。
bool_t xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar);
RPC 応答メッセージをエンコードするのに使用する。このルーティンは
RPC パッケージを用いずに RPC-形式のメッセージを作成しようとす る
場合に便利である。
bool_t xdr_authunix_parms(XDR *xdrs, struct authunix_parms *aupp);
Unix 形式の証明書を記述するために使用する。このルーティンは RPC
認証パッケージを使用せずにこれらの証明書を作成しようとする場合に
便利である。
void xdr_callhdr(XDR *xdrs, struct rpc_msg *chdr);
RPC 呼び出しのヘッダー・メッセージを記述するために使用する。この
ルーティンは RPC パッケージを使用せずに RPC-形式のメッセージを作
成しようとする場合に便利である。
bool_t xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg);
RPC 呼び出しメッセージを記述するのに使用する。このルーティンは
RPC パッケージを使用せずに RPC-形式のメッセージを作成しようと す
る場合に便利である。
bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap);
PRC 認証情報メッセージを記述するために使用する。このルーティンは
RPC パッケージを使用せずに RPC-形式のメッセージを作成しようと す
る場合に便利である。
bool_t xdr_pmap(XDR *xdrs, struct pmap *regs);
各 種の portmap プロシジャへのパラメーターを外部的に記述するため
に使用する。このルーティンは pmap インターフェースを使用せずに、
これらのパラメーターを作成したい場合に便利である。
bool_t xdr_pmaplist(XDR *xdrs, struct pmaplist **rp);
ポートのマッピングのリストを外部的に記述するために使用する。この
ルーティンは pmap インターフェースを使用せずに、これらのパラメー
ターを作成したい場合に便利である。
bool_t xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr);
RPC 応答メッセージを記述するために使用する。このルーティンは RPC
パッケージを使用せずに、 RPC-形式のメッセージを作成したい場合 に
便利である。
bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg);
RPC 応答メッセージを記述するために使用する。このルーティンは RPC
パッケージを使用せずに、 RPC 形式のメッセージを作成したい場合 に
便利である。
void xprt_register(SVCXPRT *xprt);
RPC サービス通信ハンドルを生成した後に、それら自身を RPC サービ
ス・パッケージに登録する必要がある。このルーティンは 大 域 変 数
svc_fds を修正する。サービスの実装者は通常、このルーティンは必要
ない。
void xprt_unregister(SVCXPRT *xprt);
RPC サービス通信ハンドルを破壊する前に、それを RPC 通信パッケ ー
ジ か ら登録解除する必要がある。このルーティンは大域変数 svc_fds
を修正する。サービスの実装者は通常、このルーティンは必要ない。
関連項目
xdr(3)
以下のマニュアル:
Remote Procedure Calls: Protocol Specification
Remote Procedure Call Programming Guide
rpcgen Programming Guide
RPC: Remote Procedure Call Protocol Specification, RFC 1050, Sun
Microsystems, Inc., USC-ISI.
2008-07-17 RPC(3)
RPC(3) Linux Programmer’s Manual RPC(3)
NAME
rpc - library routines for remote procedure calls
SYNOPSIS AND DESCRIPTION
These routines allow C programs to make procedure calls on other
machines across the network. First, the client calls a procedure to
send a data packet to the server. Upon receipt of the packet, the
server calls a dispatch routine to perform the requested service, and
then sends back a reply. Finally, the procedure call returns to the
client.
To take use of these routines, include the header file .
The prototypes below make use of the following types:
typedef int bool_t;
typedef bool_t (*xdrproc_t) (XDR *, void *,...);
typedef bool_t (*resultproc_t) (caddr_t resp,
struct sockaddr_in *raddr);
See the header files for the declarations of the AUTH, CLIENT, SVCXPRT,
and XDR types.
void auth_destroy(AUTH *auth);
A macro that destroys the authentication information associated
with auth. Destruction usually involves deallocation of private
data structures. The use of auth is undefined after calling
auth_destroy().
AUTH *authnone_create(void);
Create and return an RPC authentication handle that passes non-
usable authentication information with each remote procedure
call. This is the default authentication used by RPC.
AUTH *authunix_create(char *host, int uid, int gid,
int len, int *aup_gids);
Create and return an RPC authentication handle that contains
authentication information. The parameter host is the name of
the machine on which the information was created; uid is the
user’s user ID; gid is the user’s current group ID; len and
aup_gids refer to a counted array of groups to which the user
belongs. It is easy to impersonate a user.
AUTH *authunix_create_default(void);
Calls authunix_create() with the appropriate parameters.
int callrpc(char *host, unsigned long prognum,
unsigned long versnum, unsigned long procnum,
xdrproc_t inproc, char *in,
xdrproc_t outproc, char *out);
Call the remote procedure associated with prognum, versnum, and
procnum on the machine, host. The parameter in is the address
of the procedure’s argument(s), and out is the address of where
to place the result(s); inproc is used to encode the procedure’s
parameters, and outproc is used to decode the procedure’s
results. This routine returns zero if it succeeds, or the value
of enum clnt_stat cast to an integer if it fails. The routine
clnt_perrno() is handy for translating failure statuses into
messages.
Warning: calling remote procedures with this routine uses UDP/IP
as a transport; see clntudp_create() for restrictions. You do
not have control of timeouts or authentication using this rou-
tine.
enum clnt_stat clnt_broadcast(unsigned long prognum,
unsigned long versnum, unsigned long procnum,
xdrproc_t inproc, char *in,
xdrproc_t outproc, char *out,
resultproc_t eachresult);
Like callrpc(), except the call message is broadcast to all
locally connected broadcast nets. Each time it receives a
response, this routine calls eachresult(), whose form is:
eachresult(char *out, struct sockaddr_in *addr);
where out is the same as out passed to clnt_broadcast(), except
that the remote procedure’s output is decoded there; addr points
to the address of the machine that sent the results. If eachre-
sult() returns zero, clnt_broadcast() waits for more replies;
otherwise it returns with appropriate status.
Warning: broadcast sockets are limited in size to the maximum
transfer unit of the data link. For ethernet, this value is
1500 bytes.
enum clnt_stat clnt_call(CLIENT *clnt, unsigned long procnum,
xdrproc_t inproc, char *in,
xdrproc_t outproc, char *out,
struct timeval tout);
A macro that calls the remote procedure procnum associated with
the client handle, clnt, which is obtained with an RPC client
creation routine such as clnt_create(). The parameter in is the
address of the procedure’s argument(s), and out is the address
of where to place the result(s); inproc is used to encode the
procedure’s parameters, and outproc is used to decode the proce-
dure’s results; tout is the time allowed for results to come
back.
clnt_destroy(CLIENT *clnt);
A macro that destroys the client’s RPC handle. Destruction usu-
ally involves deallocation of private data structures, including
clnt itself. Use of clnt is undefined after calling
clnt_destroy(). If the RPC library opened the associated
socket, it will close it also. Otherwise, the socket remains
open.
CLIENT *clnt_create(char *host, unsigned long prog,
unsigned long vers, char *proto);
Generic client creation routine. host identifies the name of
the remote host where the server is located. proto indicates
which kind of transport protocol to use. The currently sup-
ported values for this field are “udp” and “tcp”. Default time-
outs are set, but can be modified using clnt_control().
Warning: Using UDP has its shortcomings. Since UDP-based RPC
messages can only hold up to 8 Kbytes of encoded data, this
transport cannot be used for procedures that take large argu-
ments or return huge results.
bool_t clnt_control(CLIENT *cl, int req, char *info);
A macro used to change or retrieve various information about a
client object. req indicates the type of operation, and info is
a pointer to the information. For both UDP and TCP, the sup-
ported values of req and their argument types and what they do
are:
CLSET_TIMEOUT struct timeval // set total timeout
CLGET_TIMEOUT struct timeval // get total timeout
Note: if you set the timeout using clnt_control(), the timeout
parameter passed to clnt_call() will be ignored in all future
calls.
CLGET_SERVER_ADDR struct sockaddr_in // get server’s address
The following operations are valid for UDP only:
CLSET_RETRY_TIMEOUT struct timeval // set the retry timeout
CLGET_RETRY_TIMEOUT struct timeval // get the retry timeout
The retry timeout is the time that "UDP RPC" waits for the
server to reply before retransmitting the request.
clnt_freeres(CLIENT * clnt, xdrproc_t outproc, char *out);
A macro that frees any data allocated by the RPC/XDR system when
it decoded the results of an RPC call. The parameter out is the
address of the results, and outproc is the XDR routine describ-
ing the results. This routine returns one if the results were
successfully freed, and zero otherwise.
void clnt_geterr(CLIENT *clnt, struct rpc_err *errp);
A macro that copies the error structure out of the client handle
to the structure at address errp.
void clnt_pcreateerror(char *s);
Print a message to standard error indicating why a client RPC
handle could not be created. The message is prepended with
string s and a colon. Used when a clnt_create(), clntraw_cre-
ate(), clnttcp_create(), or clntudp_create() call fails.
void clnt_perrno(enum clnt_stat stat);
Print a message to standard error corresponding to the condition
indicated by stat. Used after callrpc().
clnt_perror(CLIENT *clnt, char *s);
Print a message to standard error indicating why an RPC call
failed; clnt is the handle used to do the call. The message is
prepended with string s and a colon. Used after clnt_call().
char *clnt_spcreateerror(char *s);
Like clnt_pcreateerror(), except that it returns a string
instead of printing to the standard error.
Bugs: returns pointer to static data that is overwritten on each
call.
char *clnt_sperrno(enum clnt_stat stat);
Take the same arguments as clnt_perrno(), but instead of sending
a message to the standard error indicating why an RPC call
failed, return a pointer to a string which contains the message.
The string ends with a NEWLINE.
clnt_sperrno() is used instead of clnt_perrno() if the program
does not have a standard error (as a program running as a server
quite likely does not), or if the programmer does not want the
message to be output with printf(3), or if a message format dif-
ferent than that supported by clnt_perrno() is to be used.
Note: unlike clnt_sperror() and clnt_spcreaterror(), clnt_sper-
rno() returns pointer to static data, but the result will not
get overwritten on each call.
char *clnt_sperror(CLIENT *rpch, char *s);
Like clnt_perror(), except that (like clnt_sperrno()) it returns
a string instead of printing to standard error.
Bugs: returns pointer to static data that is overwritten on each
call.
CLIENT *clntraw_create(unsigned long prognum, unsigned long versnum);
This routine creates a toy RPC client for the remote program
prognum, version versnum. The transport used to pass messages
to the service is actually a buffer within the process’s address
space, so the corresponding RPC server should live in the same
address space; see svcraw_create(). This allows simulation of
RPC and acquisition of RPC overheads, such as round trip times,
without any kernel interference. This routine returns NULL if
it fails.
CLIENT *clnttcp_create(struct sockaddr_in *addr,
unsigned long prognum, unsigned long versnum,
int *sockp, unsigned int sendsz, unsigned int recvsz);
This routine creates an RPC client for the remote program
prognum, version versnum; the client uses TCP/IP as a transport.
The remote program is located at Internet address *addr. If
addr->sin_port is zero, then it is set to the actual port that
the remote program is listening on (the remote portmap service
is consulted for this information). The parameter sockp is a
socket; if it is RPC_ANYSOCK, then this routine opens a new one
and sets sockp. Since TCP-based RPC uses buffered I/O, the user
may specify the size of the send and receive buffers with the
parameters sendsz and recvsz; values of zero choose suitable
defaults. This routine returns NULL if it fails.
CLIENT *clntudp_create(struct sockaddr_in *addr,
unsigned long prognum, unsigned long versnum,
struct timeval wait, int *sockp);
This routine creates an RPC client for the remote program
prognum, version versnum; the client uses use UDP/IP as a trans-
port. The remote program is located at Internet address addr.
If addr->sin_port is zero, then it is set to actual port that
the remote program is listening on (the remote portmap service
is consulted for this information). The parameter sockp is a
socket; if it is RPC_ANYSOCK, then this routine opens a new one
and sets sockp. The UDP transport resends the call message in
intervals of wait time until a response is received or until the
call times out. The total time for the call to time out is
specified by clnt_call().
Warning: since UDP-based RPC messages can only hold up to 8
Kbytes of encoded data, this transport cannot be used for proce-
dures that take large arguments or return huge results.
CLIENT *clntudp_bufcreate(struct sockaddr_in *addr,
unsigned long prognum, unsigned long versnum,
struct timeval wait, int *sockp,
unsigned int sendsize, unsigned int recosize);
This routine creates an RPC client for the remote program
prognum, on versnum; the client uses use UDP/IP as a transport.
The remote program is located at Internet address addr. If
addr->sin_port is zero, then it is set to actual port that the
remote program is listening on (the remote portmap service is
consulted for this information). The parameter sockp is a
socket; if it is RPC_ANYSOCK, then this routine opens a new one
and sets sockp. The UDP transport resends the call message in
intervals of wait time until a response is received or until the
call times out. The total time for the call to time out is
specified by clnt_call().
This allows the user to specify the maximum packet size for
sending and receiving UDP-based RPC messages.
void get_myaddress(struct sockaddr_in *addr);
Stuff the machine’s IP address into *addr, without consulting
the library routines that deal with /etc/hosts. The port number
is always set to htons(PMAPPORT).
struct pmaplist *pmap_getmaps(struct sockaddr_in *addr);
A user interface to the portmap service, which returns a list of
the current RPC program-to-port mappings on the host located at
IP address *addr. This routine can return NULL. The command
rpcinfo -p uses this routine.
unsigned short pmap_getport(struct sockaddr_in *addr,
unsigned long prognum, unsigned long versnum,
unsigned int protocol);
A user interface to the portmap service, which returns the port
number on which waits a service that supports program number
prognum, version versnum, and speaks the transport protocol
associated with protocol. The value of protocol is most likely
IPPROTO_UDP or IPPROTO_TCP. A return value of zero means that
the mapping does not exist or that the RPC system failed to con-
tact the remote portmap service. In the latter case, the global
variable rpc_createerr contains the RPC status.
enum clnt_stat pmap_rmtcall(struct sockaddr_in *addr,
unsigned long prognum, unsigned long versnum,
unsigned long procnum,
xdrproc_t inproc, char *in,
xdrproc_t outproc, char *out,
struct timeval tout, unsigned long *portp);
A user interface to the portmap service, which instructs portmap
on the host at IP address *addr to make an RPC call on your
behalf to a procedure on that host. The parameter *portp will
be modified to the program’s port number if the procedure suc-
ceeds. The definitions of other parameters are discussed in
callrpc() and clnt_call(). This procedure should be used for a
“ping” and nothing else. See also clnt_broadcast().
bool_t pmap_set(unsigned long prognum, unsigned long versnum,
unsigned int protocol, unsigned short port);
A user interface to the portmap service, which establishes a
mapping between the triple [prognum,versnum,protocol] and port
on the machine’s portmap service. The value of protocol is most
likely IPPROTO_UDP or IPPROTO_TCP. This routine returns one if
it succeeds, zero otherwise. Automatically done by svc_regis-
ter().
bool_t pmap_unset(unsigned long prognum, unsigned long versnum);
A user interface to the portmap service, which destroys all map-
ping between the triple [prognum,versnum,*] and ports on the
machine’s portmap service. This routine returns one if it suc-
ceeds, zero otherwise.
int registerrpc(unsigned long prognum, unsigned long versnum,
unsigned long procnum, char *(*procname)(char *),
xdrproc_t inproc, xdrproc_t outproc);
Register procedure procname with the RPC service package. If a
request arrives for program prognum, version versnum, and proce-
dure procnum, procname is called with a pointer to its parame-
ter(s); progname should return a pointer to its static
result(s); inproc is used to decode the parameters while outproc
is used to encode the results. This routine returns zero if the
registration succeeded, -1 otherwise.
Warning: remote procedures registered in this form are accessed
using the UDP/IP transport; see svcudp_create() for restric-
tions.
struct rpc_createerr rpc_createerr;
A global variable whose value is set by any RPC client creation
routine that does not succeed. Use the routine clnt_pcreateer-
ror() to print the reason why.
void svc_destroy(SVCXPRT *xprt);
A macro that destroys the RPC service transport handle, xprt.
Destruction usually involves deallocation of private data struc-
tures, including xprt itself. Use of xprt is undefined after
calling this routine.
fd_set svc_fdset;
A global variable reflecting the RPC service side’s read file
descriptor bit mask; it is suitable as a parameter to the
select(2) system call. This is only of interest if a service
implementor does not call svc_run(), but rather does his own
asynchronous event processing. This variable is read-only (do
not pass its address to select(2)!), yet it may change after
calls to svc_getreqset() or any creation routines.
int svc_fds;
Similar to svc_fdset, but limited to 32 descriptors. This
interface is obsoleted by svc_fdset.
svc_freeargs(SVCXPRT *xprt, xdrproc_t inproc, char *in);
A macro that frees any data allocated by the RPC/XDR system when
it decoded the arguments to a service procedure using
svc_getargs(). This routine returns 1 if the results were suc-
cessfully freed, and zero otherwise.
svc_getargs(SVCXPRT *xprt, xdrproc_t inproc, char *in);
A macro that decodes the arguments of an RPC request associated
with the RPC service transport handle, xprt. The parameter in
is the address where the arguments will be placed; inproc is the
XDR routine used to decode the arguments. This routine returns
one if decoding succeeds, and zero otherwise.
struct sockaddr_in *svc_getcaller(SVCXPRT *xprt);
The approved way of getting the network address of the caller of
a procedure associated with the RPC service transport handle,
xprt.
void svc_getreqset(fd_set *rdfds);
This routine is only of interest if a service implementor does
not call svc_run(), but instead implements custom asynchronous
event processing. It is called when the select(2) system call
has determined that an RPC request has arrived on some RPC
socket(s); rdfds is the resultant read file descriptor bit mask.
The routine returns when all sockets associated with the value
of rdfds have been serviced.
void svc_getreq(int rdfds);
Similar to svc_getreqset(), but limited to 32 descriptors. This
interface is obsoleted by svc_getreqset().
bool_t svc_register(SVCXPRT *xprt, unsigned long prognum,
unsigned long versnum,
void (*dispatch)(svc_req *, SVCXPRT *),
unsigned long protocol);
Associates prognum and versnum with the service dispatch proce-
dure, dispatch. If protocol is zero, the service is not regis-
tered with the portmap service. If protocol is non-zero, then a
mapping of the triple [prognum,versnum,protocol] to
xprt->xp_port is established with the local portmap service
(generally protocol is zero, IPPROTO_UDP or IPPROTO_TCP). The
procedure dispatch has the following form:
dispatch(struct svc_req *request, SVCXPRT *xprt);
The svc_register() routine returns one if it succeeds, and zero
otherwise.
void svc_run(void);
This routine never returns. It waits for RPC requests to
arrive, and calls the appropriate service procedure using
svc_getreq() when one arrives. This procedure is usually wait-
ing for a select(2) system call to return.
bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, char *out);
Called by an RPC service’s dispatch routine to send the results
of a remote procedure call. The parameter xprt is the request’s
associated transport handle; outproc is the XDR routine which is
used to encode the results; and out is the address of the
results. This routine returns one if it succeeds, zero other-
wise.
void svc_unregister(unsigned long prognum, unsigned long versnum);
Remove all mapping of the double [prognum,versnum] to dispatch
routines, and of the triple [prognum,versnum,*] to port number.
void svcerr_auth(SVCXPRT *xprt, enum auth_stat why);
Called by a service dispatch routine that refuses to perform a
remote procedure call due to an authentication error.
void svcerr_decode(SVCXPRT *xprt);
Called by a service dispatch routine that cannot successfully
decode its parameters. See also svc_getargs().
void svcerr_noproc(SVCXPRT *xprt);
Called by a service dispatch routine that does not implement the
procedure number that the caller requests.
void svcerr_noprog(SVCXPRT *xprt);
Called when the desired program is not registered with the RPC
package. Service implementors usually do not need this routine.
void svcerr_progvers(SVCXPRT *xprt);
Called when the desired version of a program is not registered
with the RPC package. Service implementors usually do not need
this routine.
void svcerr_systemerr(SVCXPRT *xprt);
Called by a service dispatch routine when it detects a system
error not covered by any particular protocol. For example, if a
service can no longer allocate storage, it may call this rou-
tine.
void svcerr_weakauth(SVCXPRT *xprt);
Called by a service dispatch routine that refuses to perform a
remote procedure call due to insufficient authentication parame-
ters. The routine calls svcerr_auth(xprt, AUTH_TOOWEAK).
SVCXPRT *svcfd_create(int fd, unsigned int sendsize,
unsigned int recvsize);
Create a service on top of any open descriptor. Typically, this
descriptor is a connected socket for a stream protocol such as
TCP. sendsize and recvsize indicate sizes for the send and
receive buffers. If they are zero, a reasonable default is cho-
sen.
SVCXPRT *svcraw_create(void);
This routine creates a toy RPC service transport, to which it
returns a pointer. The transport is really a buffer within the
process’s address space, so the corresponding RPC client should
live in the same address space; see clntraw_create(). This rou-
tine allows simulation of RPC and acquisition of RPC overheads
(such as round trip times), without any kernel interference.
This routine returns NULL if it fails.
SVCXPRT *svctcp_create(int sock, unsigned int send_buf_size,
unsigned int recv_buf_size);
This routine creates a TCP/IP-based RPC service transport, to
which it returns a pointer. The transport is associated with
the socket sock, which may be RPC_ANYSOCK, in which case a new
socket is created. If the socket is not bound to a local TCP
port, then this routine binds it to an arbitrary port. Upon
completion, xprt->xp_sock is the transport’s socket descriptor,
and xprt->xp_port is the transport’s port number. This routine
returns NULL if it fails. Since TCP-based RPC uses buffered
I/O, users may specify the size of buffers; values of zero
choose suitable defaults.
SVCXPRT *svcudp_bufcreate(int sock, unsigned int sendsize,
unsigned int recosize);
This routine creates a UDP/IP-based RPC service transport, to
which it returns a pointer. The transport is associated with
the socket sock, which may be RPC_ANYSOCK, in which case a new
socket is created. If the socket is not bound to a local UDP
port, then this routine binds it to an arbitrary port. Upon
completion, xprt->xp_sock is the transport’s socket descriptor,
and xprt->xp_port is the transport’s port number. This routine
returns NULL if it fails.
This allows the user to specify the maximum packet size for
sending and receiving UDP-based RPC messages.
SVCXPRT *svcudp_create(int sock);
This call is equivalent to svcudp_bufcreate(sock,SZ,SZ) for some
default size SZ.
bool_t xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar);
Used for encoding RPC reply messages. This routine is useful
for users who wish to generate RPC-style messages without using
the RPC package.
bool_t xdr_authunix_parms(XDR *xdrs, struct authunix_parms *aupp);
Used for describing Unix credentials. This routine is useful
for users who wish to generate these credentials without using
the RPC authentication package.
void xdr_callhdr(XDR *xdrs, struct rpc_msg *chdr);
Used for describing RPC call header messages. This routine is
useful for users who wish to generate RPC-style messages without
using the RPC package.
bool_t xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg);
Used for describing RPC call messages. This routine is useful
for users who wish to generate RPC-style messages without using
the RPC package.
bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap);
Used for describing RPC authentication information messages.
This routine is useful for users who wish to generate RPC-style
messages without using the RPC package.
bool_t xdr_pmap(XDR *xdrs, struct pmap *regs);
Used for describing parameters to various portmap procedures,
externally. This routine is useful for users who wish to gener-
ate these parameters without using the pmap interface.
bool_t xdr_pmaplist(XDR *xdrs, struct pmaplist **rp);
Used for describing a list of port mappings, externally. This
routine is useful for users who wish to generate these parame-
ters without using the pmap interface.
bool_t xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr);
Used for describing RPC reply messages. This routine is useful
for users who wish to generate RPC-style messages without using
the RPC package.
bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg);
Used for describing RPC reply messages. This routine is useful
for users who wish to generate RPC style messages without using
the RPC package.
void xprt_register(SVCXPRT *xprt);
After RPC service transport handles are created, they should
register themselves with the RPC service package. This routine
modifies the global variable svc_fds. Service implementors usu-
ally do not need this routine.
void xprt_unregister(SVCXPRT *xprt);
Before an RPC service transport handle is destroyed, it should
unregister itself with the RPC service package. This routine
modifies the global variable svc_fds. Service implementors usu-
ally do not need this routine.
SEE ALSO
xdr(3)
The following manuals:
Remote Procedure Calls: Protocol Specification
Remote Procedure Call Programming Guide
rpcgen Programming Guide
RPC: Remote Procedure Call Protocol Specification, RFC 1050, Sun
Microsystems, Inc., USC-ISI.
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2008-07-17 RPC(3)