MyNixOS website logo
Description

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.

Metadata

Version

0.2

License

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows