ONC RPC (aka Sun RPC) and XDR library.
Tools and library for writing ONC (Sun) RPC clients and servers. Provides equivalent functionality to rpcgen and librpcsvc, except in pure Haskell. The hsrpcgen tool (and Cabal preprocessor library) allows .x XDR files to generate Haskell protocol descriptors. The library provides a client interface to use these descriptions to make RPC calls.
Haskell ONC (Sun) RPC and XDR tools and library
Haskell tools and library for interacting with ONC RPC (aka Sun RPC) protocols. The goal is a working NFS4 client, so TCP clients and efficient large data handling will be prioritized over servers, UDP, and portmaping. It includes the following complete components.
Primary Components
hsrpcgen
A code-generator for .x (XDR) files which you can call directly or use as a pre-processor from cabal (see Setup.hs for an example). The module Network.ONCRPC.Prot in this package is itself generated from the XDR description of the RPC protocol. While many .x files will work as-is, some depend on C-specific functionality that will require some minor tweaking.
Network.ONCRPC.Client
A client library which allows you to use the generated module to make RPC calls to servers.
Example
hsrpcgen -P nfs.x -o NFS.hs
import qualified Network.ONCRPC as RPC
import qualified NFS
client <- RPC.openClient $ RPC.ClientServerPort "nfs.server.example.com" "nfs"
reply <- RPC.rpcCall client $ RPC.Call (NFS.nFSPROC_NULL (NFS.nFS_VERSION NFS.nFS_PROGRAM)) RPC.AuthNone RPC.AuthNone ()
RPC.closeClient client
References
This package implements RFC5531 and RFC4506 as closely as possible.
xdrgen is a rpcgen replacement for other languages, written in Haskell. By contrast, this project targets full RPC support in Haskell.