Programming Mechanisms to Support rPC(cont) D XDR library routines that format the complex data aggregates(e.g, arrays and structures) used to define rPc messages ORPC run-time library routines that allow a program to call a remote procedure, register a service with the port mapper or dispatch an incoming call to the correct remote procedure inside a remote program a program generator tool that produces many of the c source files needed to build a distributed program that uses rPc
6 Programming Mechanisms to Support RPC (cont.) XDR library routines that format the complex data aggregates (e.g., arrays and structures) used to define RPC messages RPC run-time library routines that allow a program to call a remote procedure, register a service with the port mapper, or dispatch an incoming call to the correct remote procedure inside a remote program A program generator tool that produces many of the C source files needed to build a distributed program that uses RPC
Programming Mechanisms to Support rPC(cont) )The RPC run-time library has procedures that supply most of the functionality needed for rpc ) For example, procedure callrpc sends an RPC message to a server Dcallrpc(host, prog, prover procnum, inproc, in, outproc, out
7 Programming Mechanisms to Support RPC (cont.) The RPC run-time library has procedures that supply most of the functionality needed for RPC For example, procedure callrpc sends an RPC message to a server callrpc(host, prog, progver, procnum, inproc, in , outproc, out);
Programming Mechanisms to Support rPC(cont) Da client calls function cInt create to create an integer identifier(called a handle that can be used to send rPC message Handle=cInt create(host, prog, vers, proto) ) Several RPC library pi rocedures take a handle as one of their argument
8 Programming Mechanisms to Support RPC (cont.) A client calls function clnt_create to create an integer identifier (called a handle) that can be used to send RPC message: handle = clnt_create(host, prog, vers, proto) Several RPC library procedures take a handle as one of their argument
Programming Mechanisms to Support rPC(cont) D The library library also contains routines that create store, and manipulate authentication information PFor example, procedure authunix creates an authentication handle for a given use on a given host computer Dauthunix create(host, uid gid, len, aup gids D Most programmers rely on the program generator tool to generate a code that contains calls to the library procedures
9 Programming Mechanisms to Support RPC (cont.) The library library also contains routines that create, store, and manipulate authentication information For example, procedure authunix creates an authentication handle for a given use on a given host computer authunix_create(host, uid, gid, len, aup_gids) Most programmers rely on the program generator tool to generate a code that contains calls to the library procedures