To facilitate the translation from XDR the following functions are provided. One each for the different types of message structures.

#include <nfsclient.h>

GETATTR3res * xdr_to_GETATTR3res(char *msg, int len);

SETATTR3res * xdr_to_SETATTR3res(char *msg, int len);

LOOKUP3res * xdr_to_LOOKUP3res(char *msg, int len);

ACCESS3res * xdr_to_ACCESS3res(char *msg, int len);

READLINK3res * xdr_to_READLINK3res(char *msg, int len);

READ3res * xdr_to_READ3res(char *msg, int len);

WRITE3res * xdr_to_WRITE3res(char *msg, int len);

CREATE3res * xdr_to_CREATE3res(char *msg, int len);

MKDIR3res * xdr_to_MKDIR3res(char *msg, int len);

SYMLINK3res * xdr_to_SYMLINK3res(char *msg, int len);

MKNOD3res * xdr_to_MKNOD3res(char *msg, int len);

REMOVE3res * xdr_to_REMOVE3res(char *msg, int len);

RMDIR3res * xdr_to_RMDIR3res(char *msg, int len);

RENAME3res * xdr_to_RENAME3res(char *msg, int len);

LINK3res * xdr_to_LINK3res(char *msg, int len);

READDIR3res * xdr_to_READDIR3res(char *msg, int len);

READDIRPLUS3res * xdr_to_READDIRPLUS3res(char *msg, int len);

FSSTAT3res * xdr_to_FSSTAT3res(char *msg, int len);

FSINFO3res * xdr_to_FSINFO3res(char *msg, int len);

PATHCONF3res * xdr_to_PATHCONF3res(char *msg, int len);

COMMIT3res * xdr_to_COMMIT3res(char *msg, int len);

mountres3 * xdr_to_mntres3(char *msg, int len);

exports * xdr_to_exports(char * msg, int len);

mountlist xdr_to_mountlist(char * msg, int len);

Each one of the functions above take:

They return a pointer to the corresponding message structure. The pointer points to a malloc()'ed memory which should be free()d when not needed anymore.

The functions above have correspoding free_* functions that allow free()'ing of memory allocated for the structure that was de-XDRed from the msg buffer.

IA64wiki: XDRInterface (last edited 2007-08-30 00:20:02 by ShehjarTikoo)

Gelato@UNSW is sponsored by
the University of New South Wales National ICT Australia The Gelato Federation Hewlett-Packard Company Australian Research Council
Please contact us with any questions or comments.