1 /* 2 * Copyright (c) 1989 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)xdr_subs.h 7.3 (Berkeley) 06/28/90 11 */ 12 13 /* 14 * Macros used for conversion to/from xdr representation by nfs... 15 * These use the MACHINE DEPENDENT routines ntohl, htonl 16 * As defined by "XDR: External Data Representation Standard" RFC1014 17 */ 18 /* From xdr to machine */ 19 #define fxdr_unsigned(t, v) ((t)ntohl((long)(v))) 20 #define fxdr_time(f, t) {((struct timeval *)(t))->tv_sec=ntohl( \ 21 ((struct timeval *)(f))->tv_sec); \ 22 ((struct timeval *)(t))->tv_usec=ntohl( \ 23 ((struct timeval *)(f))->tv_usec);} 24 25 /* from machine to xdr */ 26 #define txdr_unsigned(v) (htonl((long)(v))) 27 #define txdr_time(f, t) {((struct timeval *)(t))->tv_sec=htonl( \ 28 ((struct timeval *)(f))->tv_sec); \ 29 ((struct timeval *)(t))->tv_usec=htonl( \ 30 ((struct timeval *)(f))->tv_usec);} 31 32