Add xdr_len, to work out required buffer size
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 30 Jan 2010 22:28:47 +0000 (22:28 +0000)
committerDerrick Brashear <shadow|account-1000005@unknown>
Wed, 3 Feb 2010 21:24:58 +0000 (13:24 -0800)
commite501c45c4ab30bb8409d0dd1e4c7ebabed1e9669
tree880ec78d9c7c11c5353539341d9b8f8f85412a99
parentfa033c6beae5a8c912ea440385e1b7d16c1443d3
Add xdr_len, to work out required buffer size

Currently, code which uses xdr_mem needs to take a guess at the
buffer size required, allocate that guess, and error out if the
data being encoded actually exceeds the guess.

This adds a new XDR mechanism - xdr_len, which can return
(using xdr_getpos) the length of the buffer required to XDR
encode a given structure.

Change-Id: I6e04c051118a26441caebdbcb2b5768d3c4389b6
Reviewed-on: http://gerrit.openafs.org/1221
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/rx/Makefile.in
src/rx/xdr_len.c [new file with mode: 0644]
src/rx/xdr_prototypes.h