pull-prototypes-to-head-20020821
[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 "afs/param.h"
15 #include <afsconfig.h>
16
17 RCSID("$Header$");
18
19 #if defined(KERNEL) && !defined(UKERNEL)
20 #ifdef AFS_LINUX20_ENV
21 #include "../h/string.h"
22 #if 0
23 #define bzero(A, C) memset((A), 0, (C))
24 #endif
25 #else
26 #include <sys/param.h>
27 #include <sys/systm.h>
28 #endif
29 #else
30 #include <stdio.h>
31 #endif
32 #include "xdr.h"
33 #if defined(KERNEL) && !defined(UKERNEL)
34 #ifdef        AFS_DEC_ENV
35 #include <afs/longc_procs.h>
36 #endif
37 #endif
38
39 int xdr_afsUUID(XDR *xdrs, afsUUID *objp)
40 {
41         if (!xdr_afs_uint32(xdrs, &objp->time_low)) {
42                 return (FALSE);
43         }
44         if (!xdr_u_short(xdrs, &objp->time_mid)) {
45                 return (FALSE);
46         }
47         if (!xdr_u_short(xdrs, &objp->time_hi_and_version)) {
48                 return (FALSE);
49         }
50         if (!xdr_char(xdrs, &objp->clock_seq_hi_and_reserved)) {
51                 return (FALSE);
52         }
53         if (!xdr_char(xdrs, &objp->clock_seq_low)) {
54                 return (FALSE);
55         }
56         if (!xdr_vector(xdrs, (char *)objp->node, 6, sizeof(char), xdr_char)) {
57                 return (FALSE);
58         }
59         return (TRUE);
60 }