xdr_buf_subsegment — set subbuf to a portion of buf


int xdr_buf_subsegment (struct xdr_buf * buf,
 struct xdr_buf * subbuf,
 unsigned int base,
 unsigned int len);


struct xdr_buf * buf

an xdr buffer

struct xdr_buf * subbuf

the result buffer

unsigned int base

beginning of range in bytes

unsigned int len

length of range in bytes


sets subbuf to an xdr buffer representing the portion of buf of length len starting at offset base.

buf and subbuf may be pointers to the same struct xdr_buf.

Returns -1 if base of length are out of bounds.