2 * Copyright 2000, International Business Machines Corporation and others.
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
10 #include <afsconfig.h>
11 #include <afs/param.h>
17 #include "afs/kauth.h"
18 #else /* defined(UKERNEL) */
21 #endif /* defined(UKERNEL) */
23 #define MAXBS 2048 /* try to avoid horrible allocs */
30 if (x->x_op == XDR_FREE) {
35 if (x->x_op == XDR_ENCODE) {
36 xdr_afs_int32(x, &abbs->SeqLen);
37 xdr_opaque(x, abbs->SeqBody, abbs->SeqLen);
41 xdr_afs_int32(x, &len);
42 if (len < 0 || len > MAXBS) return FALSE;
43 if (!abbs->SeqBody) abbs->SeqBody = (char *) malloc(len);
45 xdr_opaque(x, abbs->SeqBody, len);
54 afs_int32 maxLen, len;
55 if (x->x_op == XDR_FREE) {
60 if (x->x_op == XDR_ENCODE) {
61 if (!xdr_afs_int32(x, &abbs->MaxSeqLen) ||
62 !xdr_afs_int32(x, &abbs->SeqLen) ||
63 !xdr_opaque(x, abbs->SeqBody, abbs->SeqLen))
68 if (!xdr_afs_int32(x, &maxLen) ||
69 !xdr_afs_int32(x, &len) ||
70 (len < 0) || (len > MAXBS) || (len > maxLen))
72 if (!abbs->SeqBody) abbs->SeqBody = (char *) malloc(maxLen);
73 abbs->MaxSeqLen = maxLen;
75 if (!xdr_opaque(x, abbs->SeqBody, len)) return FALSE;