1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. 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 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)xdr_subs.h 8.1 (Berkeley) 6/10/93 |
37 * $Id: xdr_subs.h,v 1.2 1994/08/02 07:52:30 davidg Exp $ |
38 */ 39 |
40#ifndef _NFS_XDR_SUBS_H_ 41#define _NFS_XDR_SUBS_H_ 42 |
43/* 44 * Macros used for conversion to/from xdr representation by nfs... 45 * These use the MACHINE DEPENDENT routines ntohl, htonl 46 * As defined by "XDR: External Data Representation Standard" RFC1014 47 * 48 * To simplify the implementation, we use ntohl/htonl even on big-endian 49 * machines, and count on them being `#define'd away. Some of these 50 * might be slightly more efficient as quad_t copies on a big-endian, --- 24 unchanged lines hidden (view full) --- 75#define fxdr_hyper(f, t) { \ 76 ((long *)(t))[_QUAD_HIGHWORD] = ntohl(((long *)(f))[0]); \ 77 ((long *)(t))[_QUAD_LOWWORD] = ntohl(((long *)(f))[1]); \ 78} 79#define txdr_hyper(f, t) { \ 80 ((long *)(t))[0] = htonl(((long *)(f))[_QUAD_HIGHWORD]); \ 81 ((long *)(t))[1] = htonl(((long *)(f))[_QUAD_LOWWORD]); \ 82} |
83 84#endif |