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>
18 #include "afs/kauth.h"
19 #else /* defined(UKERNEL) */
22 #endif /* defined(UKERNEL) */
24 #define MAXBS 2048 /* try to avoid horrible allocs */
27 xdr_ka_CBS(XDR * x, struct ka_CBS *abbs)
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);
40 xdr_afs_int32(x, &len);
41 if (len < 0 || len > MAXBS)
44 abbs->SeqBody = (char *)malloc(len);
46 xdr_opaque(x, abbs->SeqBody, len);
52 xdr_ka_BBS(XDR * x, struct ka_BBS *abbs)
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))
67 if (!xdr_afs_int32(x, &maxLen) || !xdr_afs_int32(x, &len) || (len < 0)
68 || (len > MAXBS) || (len > maxLen))
71 abbs->SeqBody = (char *)malloc(maxLen);
72 abbs->MaxSeqLen = maxLen;
74 if (!xdr_opaque(x, abbs->SeqBody, len))