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>
16 #include <afs/kauth.h>
18 #define MAXBS 2048 /* try to avoid horrible allocs */
21 xdr_ka_CBS(XDR
* x
, struct ka_CBS
*abbs
)
24 if (x
->x_op
== XDR_FREE
) {
29 if (x
->x_op
== XDR_ENCODE
) {
30 xdr_afs_int32(x
, &abbs
->SeqLen
);
31 xdr_opaque(x
, abbs
->SeqBody
, abbs
->SeqLen
);
34 xdr_afs_int32(x
, &len
);
35 if (len
< 0 || len
> MAXBS
)
38 abbs
->SeqBody
= malloc(len
);
40 xdr_opaque(x
, abbs
->SeqBody
, len
);
46 xdr_ka_BBS(XDR
* x
, struct ka_BBS
*abbs
)
48 afs_int32 maxLen
, len
;
49 if (x
->x_op
== XDR_FREE
) {
54 if (x
->x_op
== XDR_ENCODE
) {
55 if (!xdr_afs_int32(x
, &abbs
->MaxSeqLen
)
56 || !xdr_afs_int32(x
, &abbs
->SeqLen
)
57 || !xdr_opaque(x
, abbs
->SeqBody
, abbs
->SeqLen
))
61 if (!xdr_afs_int32(x
, &maxLen
) || !xdr_afs_int32(x
, &len
) || (len
< 0)
62 || (len
> MAXBS
) || (len
> maxLen
))
65 abbs
->SeqBody
= malloc(maxLen
);
66 abbs
->MaxSeqLen
= maxLen
;
68 if (!xdr_opaque(x
, abbs
->SeqBody
, len
))