TABLE OF CONTENTS
- 1. libram-rpc/libram-rpc
- 1.1. libram-rpc/libram-rpcserver
- 1.2. libram-rpc/libram_hashdirection
- 1.3. libram-rpc/libramrpc
- 1.4. libram-rpc/libramrpc_close
- 1.5. libram-rpc/libramrpc_connect
- 1.6. libram-rpc/libramrpc_data
- 1.7. libram-rpc/libramrpc_disconnect
- 1.8. libram-rpc/libramrpc_exit
- 1.9. libram-rpc/libramrpc_fd
- 1.10. libram-rpc/libramrpc_free
- 1.11. libram-rpc/libramrpc_init
- 1.12. libram-rpc/libramrpc_open
- 1.13. libram-rpc/libramrpc_process
- 1.14. libram-rpc/libramrpc_readreply
- 1.15. libram-rpc/libramrpc_reconnect
- 1.16. libram-rpc/libramrpc_result
- 1.17. libram-rpc/libramrpc_wait
- 1.18. libram-rpc/libramrpcserver_addseq
- 1.19. libram-rpc/libramrpcserver_callbacks
- 1.20. libram-rpc/libramrpcserver_config
- 1.21. libram-rpc/libramrpcserver_connect
- 1.22. libram-rpc/libramrpcserver_copy_reply
- 1.23. libram-rpc/libramrpcserver_disconnect
- 1.24. libram-rpc/libramrpcserver_exit
- 1.25. libram-rpc/libramrpcserver_fdset
- 1.26. libram-rpc/libramrpcserver_free_reply
- 1.27. libram-rpc/libramrpcserver_hashid
- 1.28. libram-rpc/libramrpcserver_init
- 1.29. libram-rpc/libramrpcserver_loop
- 1.30. libram-rpc/libramrpcserver_nextseq
- 1.31. libram-rpc/libramrpcserver_process
- 1.32. libram-rpc/libramrpcserver_process_result
- 1.33. libram-rpc/libramrpcserver_reply
- 1.34. libram-rpc/libramrpcserver_replylist_add
- 1.35. libram-rpc/libramrpcserver_replylist_findbyfd
- 1.36. libram-rpc/libramrpcserver_replylist_findbyid
- 1.37. libram-rpc/libramrpcserver_replylist_free
- 1.38. libram-rpc/libramrpcserver_replynode
- 1.39. libram-rpc/libramrpcserver_rmseq
- 1.40. libram-rpc/libramrpcserver_seqnode
- 1.41. libram-rpc/libramrpcserver_stop
- 1.42. libram-rpc/ramrpc_bh
libram-rpc/libram-rpc [ Generics ]
NAME
libram-rpc - rpc backend to libram
DESCRIPTION
libram-rpc is a backend module for libram, that can be used to implement a remote analysis and modification module.
libram-rpc is the client side onc/rpc side. The server side onc/rpc is implemented in libram-rpcserver(3). The analysis component can include libram-rpcserver(3) to get the data from the libram-rpc(3) module. The connection string for the libram-rpc(3) module consists of:
- protocol: the protocol used for the onc/rpc connection. The possible value is tcp (udp is not implemented yet). The default value is tcp.
- server: the server to contact. Default value is localhost.
- port: the port on which the server listens. Default is the value documented in libram_port(3).
- version: specifiy the ip version number. Valid values are v4, v6, or v4+v6. The default value is v4+v6.
NOTES
The protocol version v4+v6 may not work on all operating systems.
SEE ALSO
libram(3), libram-rpcserver(3), libramrpc_init(3), libramrpc(3)
libram-rpc/libramrpc [ Variables ]
[ Top ] [ libram-rpc ] [ Variables ]
NAME
libramrpc - libram_module structure for libram-rpc module
DESCRIPTION
This variable define the libram_module(3) structure of the libram-rpc(3) module.
SOURCE
struct libram_module libramrpc = { "rpc", NULL, libramrpc_init, libramrpc_exit, libramrpc_open, libramrpc_data, libramrpc_close, libramrpc_fd, libramrpc_process, libramrpc_wait, libramrpc_free, };
SEE ALSO
libram(3), libram_module(3)
libram-rpc/libramrpc_close [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_close - libram_close function for libram-rpc
SYNOPSIS
struct reply *libramrpc_close(ram_bh bh, int flags, long id, conn_payloadp d)
DESCRIPTION
libramrpc_close implements the libram_close function for the libram-rpc module.
It passes the parameters to the rpcserver side component using onc/rpc.
ARGUMENTS
- bh: backend handle returned by libramrpc_init(3)
- flags: flags passed from libram_close(), see libram_flags(3)
- id: connection id
- d: connection data
RETURN
- LIBRAM_REPLY_UNAVAILABLE: flags contain LIBRAM_DISCARD_RESULT or or malloc failure or result is not yet available
- LIBRAM_REPLY_FAILURE: reply is unavailable and connection to libram-rpcserver failed
- else: result structure
SEE ALSO
libramrpc_init(3), libramrpc_exit(3), libram_flags(3), libramrpc_open(3), libramrpc_data(3), libramrpc_reconnect(3), ram_bh(3), conn_payload(3), libram(3)
libram-rpc/libramrpc_connect [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_connect - connect to libramrpc-server
SYNOPSIS
ram_bh libramrpc_connect(struct ramrpc_bh *libram_bh)
DESCRIPTION
libramrpc_connect opens the socket and connects to the libramrpc-server. It then uses this socket to create a rpc client for this connection.
ARGUMENTS
- libram_bh: backend_handle of type ramrpc_bh
RETURN
- ram_bh handle
SEE ALSO
libram-rpc(3), libram_init(3), ramrpc_bh(3), libramrpc_disconnect(3), strtok(3),
libram-rpc/libramrpc_data [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_data - libram_data function for libram-rpc
SYNOPSIS
struct reply *libramrpc_data(ram_bh bh, int flags, long id, conn_payload* d)
DESCRIPTION
libramrpc_data implements the libram_data function for the libram-rpc module.
It passes the parameters to the rpcserver side component using onc/rpc.
ARGUMENTS
- bh: backend handle returned by libramrpc_init(3)
- flags: flags passed from libram_data(), see libram_flags(3)
- id: connection id
- d: connection data
RETURN
- LIBRAM_REPLY_UNAVAILABLE: flags contain LIBRAM_DISCARD_RESULT or or malloc failure or result is not yet available
- LIBRAM_REPLY_FAILURE: reply is unavailable and connection to libram-rpcserver failed
- else: result structure
SEE ALSO
libramrpc_init(3), libramrpc_exit(3), ram_bh(3), libram_flags(3), libramrpc_open(3), libramrpc_data(3), libramrpc_close(3), libramrpc_reconnect(3), conn_payload(3), libram(3)
libram-rpc/libramrpc_disconnect [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_disconnect - disconnect from libramrpc-server
SYNOPSIS
void libramrpc_disconnect(struct ramrpc_bh *libram_bh)
DESCRIPTION
libramrpc_disconnect(3) disconnects from the libramrpc-server by destroing the client and closing the socket.
ARGUMENTS
- libram_bh: backend handle allocated by libramrpc_init(3);
RETURN
0
SEE ALSO
libramrpc_connect(3), libramrpc_disconnect(3), ramrpc_bh(3), libram-rpc(3)
libram-rpc/libramrpc_exit [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_exit - libram_exit function for libram-rpc
SYNOPSIS
int libramrpc_exit(ram_bh bh)
DESCRIPTION
libramrpc_exit implements the libram_exit function for the libram-rpc module. It closes the onc/rpc connection opened by libramrpc_connect(3) with libramrpc_disconnect(3), and frees the ramrpc_bh handle.
ARGUMENTS
- bh: backend handle returned by libramrpc_init(3);
RETURN
0
SEE ALSO
libramrpc_connect(3), libramrpc_disconnect(3), ramrpc_bh(3), libram-rpc(3)
libram-rpc/libramrpc_fd [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_fd - get filedescriptor used by libramrpc
SYNOPSIS
int libramrpc_fd(ram_bh bh)
DESCRIPTION
libramrpc_fd is used to get the file descriptor used internally in libram-rpc.
ARGUMENTS
- bh: handle to backend module
RETURN
- fd: file descriptor used.
SEE ALSO
libram-rpc(3), libramrpc_process(3), libramrpc_wait(3), libram(3)
libram-rpc/libramrpc_free [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_free - free reply strucutre from libram_process and libram_wait
SYNOPSIS
void libramrpc_free(ram_bh bh, struct reply *res)
DESCRIPTION
libramrpc_free frees the memory allocated with libramrpc_process or libramrpc_wait.
ARGUMENTS
- bh: handle to backend module
- res: pointer to reply structure
SEE ALSO
libram-rpc(3), libramrpc_process(3), libramrpc_fd(3), libramrpc_wait(3), libram(3)
libram-rpc/libramrpc_init [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_init - libram_init function for libram-rpc
SYNOPSIS
ram_bh libramrpc_init(char *conn, int *flags)
DESCRIPTION
libramrpc_init implements the libram_init function for the libram-rpc module. See libram_init(3) for a general description of the conn and flags parameter. See libram-rpc(3) for a description of the connect and flag parameters specific for the libram-rpc(3) module.
libramrpc_init parses and checks the parameters and does the necessary host and port lookups using getaddrinfo(3). When the connection parameters are determined it calls libramrpc_connect(3) to connect to the libramrcp-server.
ARGUMENTS
- conn: connect string
- flags: flags to backend module
RETURN
- NULL: error
- backend_handle of type ramrpc_bh
NOTES
connect is parsed with strtok(3). strtok(3) alters the string and adds null characters to the string.
SEE ALSO
libram-rpc(3), libram(3), libram_init(3), libram_port(3), libramrpc_connect(3), libramrpc_disconnect(3), ramrpc_bh(3), getaddrinfo(3), strtok(3)
libram-rpc/libramrpc_open [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_open - libram_open function for libram-rpc
SYNOPSIS
struct reply *libramrpc_open(ram_bh bh, int flags, long id, conn_hdr* hdr, conn_payload* d)
DESCRIPTION
libramrpc_open implements the libram_open function for the libram-rpc module.
It passes the parameters to the rpcserver side component using onc/rpc.
ARGUMENTS
- bh: backend handle returned by libramrpc_init(3)
- flags: flags passed from libram_open(), see libram_flags(3)
- id: identifier for the connection
- hdr: connection header of data
- d: connection data
RETURN
- LIBRAM_REPLY_UNAVAILABLE: flags contain LIBRAM_DISCARD_RESULT or or malloc failure or result is not yet available
- LIBRAM_REPLY_FAILURE: reply is unavailable and connection to libram-rpcserver failed
- else: result structure
SEE ALSO
libramrpc_init(3), libramrpc_exit(3), ram_bh(3), libram_flags(3), libramrpc_open(3), libramrpc_data(3), libramrpc_close(3), libramrpc_reconnect(3), conn_hdr(3), conn_payload(3), libram(3)
libram-rpc/libramrpc_process [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_process - process input on libramrpc file descriptor
SYNOPSIS
struct reply *libramrpc_process(ram_bh bh, fd_set *fds)
DESCRIPTION
libramrpc_process handles input on the libramrpc file descriptor. It reads incoming data with libramrpc_readreply(3).
ARGUMENTS
- bh: handle to backend module
- fds: pointer to fd_set structure.
RETURN
- LIBRAM_REPLY_UNAVAILABLE: data processed, but entire result is not yet available
- LIBRAM_REPLY_FAILURE: read failure or end of file
- else: pointer to reply structure
NOTES
libramrpc_process expects that data can be read from the socket. libramrpc_process may block in read if this is not the case.
SEE ALSO
libram-rpc(3), libramrpc_fd(3), libramrpc_wait(3), libram(3)
libram-rpc/libramrpc_readreply [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_readreply - read input on libramrpc file descriptor
SYNOPSIS
static struct reply *libramrpc_readreply(ram_bh bh, fd_set *fds)
DESCRIPTION
libramrpc_readreply handles input on the libramrpc file descriptor. It checks if it's file descriptor is set in the fd_set fds and decodes incoming responses from the libram-rpcserver.
ARGUMENTS
- bh: handle to backend module
- fds: pointer to fd_set structure.
RETURN
- LIBRAM_REPLY_UNAVAILABLE: data processed, but entire result is not yet available
- LIBRAM_REPLY_FAILURE: read failure or end of file
- else: pointer to reply structure
NOTES
libramrpc_process expects that data can be read from the socket. libramrpc_process may block in read if this is not the case.
SEE ALSO
libram-rpc(3), libramrpc_fd(3), libramrpc_process(3), libramrpc_wait(3), libram(3)
libram-rpc/libramrpc_reconnect [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_reconnect - reconnect to libramrpc-server
SYNOPSIS
ram_bh libramrpc_reconnect(struct ramrpc_bh *libram_bh)
DESCRIPTION
libramrpc_reconnect(3) tries to reconnect to the libramrpc-server by disconnecting and connecting again.
ARGUMENTS
- libram_bh: backend handle allocated by libramrpc_init(3);
RETURN
0
SEE ALSO
libramrpc_connect(3), libramrpc_disconnect(3), ramrpc_bh(3), libram-rpc(3)
libram-rpc/libramrpc_result [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_result - result postprecessing for libramrpc callbacks
SYNOPSIS
struct reply * libramrpc_result(ram_bh bh, int flags, struct reply *r, char *routine)
DESCRIPTION
libramrpc_result does postprocessing for libramrpc callbacks. The postprocessing includes:
- check the return value for errors. In asynchronous mode the returned result is NULL and the error is set to RPC_TIMEDOUT.
- the rpc-stub routines return pointer to static data. Non-static memory is allocated and the result is copied to this location.
ARGUMENTS
- bh: backend handle returned by libramrpc_init(3);
- flags: flags passed to libramrpc_result(), see libram_flags(3)
- r: reply structure
- routine: calling routine
RETURN
- LIBRAM_REPLY_UNAVAILABLE: reply is unavailable, operation can continue
- LIBRAM_REPLY_FAILURE: reply is unavailable and connection to libram-rpcserver failed
- else: result structure
SEE ALSO
libramrpc_init(3), libramrpc_exit(3), ram_bh(3), libram_flags(3), libramrpc_open(3), libramrpc_data(3), libramrpc_close(3), libramrpc_wait(3), libramrpc_process(3), libramrpc_free(3)
libram-rpc/libramrpc_wait [ Functions ]
[ Top ] [ libram-rpc ] [ Functions ]
NAME
libramrpc_wait - wait for answer from libramrpc call
SYNOPSIS
struct reply *libramrpc_wait(ram_bh bh, int timeout)
DESCRIPTION
libramrpc_wait waits for an answer from a libramrpc remote procedure call. It decodes the reply message and returns the result.
ARGUMENTS
- bh: handle to backend module
- timeout: timeout waiting for reply
RETURN
- NULL: decoding failed
- != NULL: address to reply structure
NOTES
The timeout is used for each select(3) call. This it gives no upper limit for the timeout in libramrpc_wait(3)
SEE ALSO
libram-rpc(3), libramrpc_process(3), libramrpc_fd(3), libram(3)