Barrelfish
Macros | Enumerations | Functions
rpc.c File Reference

RPC implementation. More...

Macros

#define RPC_TIMER_PERIOD   (1000 * 1000)
 Time between RPC timer firings (us)
 
#define RPC_RETRANSMIT_AFTER   8
 Number of timer firings before a retransmit.
 
#define RPC_MAX_RETRANSMIT   60
 Max number of retransmissions before giving up.
 
#define RPC_CALL_HEADER_LEN   (10 * BYTES_PER_XDR_UNIT + AUTH_SIZE)
 bytes needed for full RPC call header
 

Enumerations

Functions

err_t rpc_init (struct rpc_client *client, struct ip_addr server)
 Initialise a new RPC client instance. More...
 
err_t rpc_call (struct rpc_client *client, uint16_t port, uint32_t prog, uint32_t vers, uint32_t proc, xdrproc_t args_xdrproc, void *args, size_t args_size, rpc_callback_t callback, void *cbarg1, void *cbarg2)
 Initiate an RPC Call. More...
 
void rpc_destroy (struct rpc_client *client)
 Destroy the given client, freeing any associated memory.
 

Detailed Description

RPC implementation.

Function Documentation

err_t rpc_call ( struct rpc_client client,
uint16_t  port,
uint32_t  prog,
uint32_t  vers,
uint32_t  proc,
xdrproc_t  args_xdrproc,
void *  args,
size_t  args_size,
rpc_callback_t  callback,
void *  cbarg1,
void *  cbarg2 
)

Initiate an RPC Call.

Parameters
clientRPC client, previously initialised by a call to rpc_init()
portUDP port on server to call
progRPC program number
versRPC program version
procRPC procedure number
args_xdrprocXDR serialisation function for arguments to call
argsArgument data to be passed to #args_xdrproc
args_sizeUpper bound on size of serialised argument data
callbackCallback function to be invoked when call either completes or fails
cbarg1,cbarg2Opaque arguments to be passed to callback function
Returns
Error code (ERR_OK on success)
err_t rpc_init ( struct rpc_client client,
struct ip_addr  server 
)

Initialise a new RPC client instance.

Parameters
clientPointer to memory for RPC client data, to be initialised
serverIP address of server to be called
Returns
Error code (ERR_OK on success)