death to trailing whitespace
[openafs.git] / src / rx / xdr_afsuuid.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /*
11  * xdr_afsuuid.c, XDR routine for built in afsUUID data type.
12  */
13
14 #include <afsconfig.h>
15 #include "afs/param.h"
16
17
18 #if defined(KERNEL) && !defined(UKERNEL)
19 #ifdef AFS_LINUX20_ENV
20 #include "h/string.h"
21 #if 0
22 #define bzero(A, C) memset((A), 0, (C))
23 #endif
24 #else
25 #include <sys/param.h>
26 #include <sys/systm.h>
27 #endif
28 #else
29 #include <stdio.h>
30 #endif
31 #include "xdr.h"
32
33 int
34 xdr_afsUUID(XDR * xdrs, afsUUID * objp)
35 {
36     if (!xdr_afs_uint32(xdrs, &objp->time_low)) {
37         return (FALSE);
38     }
39     if (!xdr_u_short(xdrs, &objp->time_mid)) {
40         return (FALSE);
41     }
42     if (!xdr_u_short(xdrs, &objp->time_hi_and_version)) {
43         return (FALSE);
44     }
45     if (!xdr_char(xdrs, &objp->clock_seq_hi_and_reserved)) {
46         return (FALSE);
47     }
48     if (!xdr_char(xdrs, &objp->clock_seq_low)) {
49         return (FALSE);
50     }
51     /* Cast needed here because xdrproc_t officially takes 3 args :-( */
52     if (!xdr_vector(xdrs, (char *)objp->node, 6, sizeof(char), (xdrproc_t)xdr_char)) {
53         return (FALSE);
54     }
55     return (TRUE);
56 }