@hackage ONC-RPC0.2

ONC RPC (aka Sun RPC) and XDR library

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.