Skip to content

gavrie/oncrpc

Repository files navigation

oncrpc: An ONC RPC v2 implementation for Go

The oncrpc package generates Go code that implements the data types, encoders, and decoders, for protocols described in the XDR data description language. The language is defined by RFC 5531, which turn is an extension of RFC 4506).

This is accomplished by using an XDR parser that has been generated with ANTLR, and can be easily re-generated if the grammar needs to be updated or extended. The parser generates a Go implementation that is tailored to encoding and decoding data described by the used-provided XDR language file.

For example, to create a complete Go encoder and decoder for the NFSv3 protocol, we can feed the parser with the following inputs, which are distilled from the relevant RFCs:

The implementation leverages the Go type system to create code that is statically typed. This makes the code efficient (no reflection is used). More importantly, it allows writing typesafe code that detects errors at compile time rather than at run time.

Planned Tasks

  1. Implement decoding (partially complete)
  2. Add tests
  3. Replace go-xdr with native functions based on encoding/binary
  4. Implement an NFSv3 client

References

About

ONC RPC implementation in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published