#rpc #sun #xdr #protocols #serialization #remote-procedure #onc

onc-rpc

Open Network Computing / Sun RPC types and fast serialisation

5 releases

0.2.3 Jun 22, 2021
0.2.2 Jan 1, 2021
0.2.1 Jun 24, 2020
0.2.0 Jun 14, 2020
0.1.0 Jun 9, 2020

#1498 in Encoding

Download history 12/week @ 2024-02-26 5/week @ 2024-03-04 2/week @ 2024-03-11 93/week @ 2024-04-01

96 downloads per month

BSD-3-Clause

93KB
1.5K SLoC

ONC RPC

This crate implements the Open Network Computing Remote Procedure Call system (originally known as the Sun RPC system) as described in RFC 1831 and RFC 5531.

  • Zero copy deserialisation
  • Support for serialisation buffer reuse and pooling
  • Only safe Rust code
  • No heap allocations
  • Simple, descriptive, one-to-one types matching the RFCs

Limitations

I had no use for the following, however PRs to extend this crate are happily accepted :)

  • No support for fragmented messages
  • No support for the deprecated and trivially broken Diffie-Hellman authentication flavor
  • No defined GSS / Kerberos auth flavor types

The auth flavors not included in this crate can still be used as the flavor discriminant and associated opaque data is available in the application layer - this crate just lacks pre-defined types to describe them.

Future development

Currently a buffer has to be passed to serialise the complete message into a continuous memory region - it would be nicer to support vectorised I/O to provide zero-copy serialisation too.

Fuzzing

Included in the fuzz/ directory is a deserialisation fuzzer that attempts to decode arbitrary inputs, and if successful serialises the resulting message and compares the result with the input.

Install cargo fuzz and invoke the fuzzer with cargo fuzz run parse_serialise -- -jobs=30 for parallised workers.

Dependencies

~0.6–1.1MB
~25K SLoC