/* Machine generated file -- Do NOT edit */

#include <afsconfig.h>
#include <afs/param.h>
#include <roken.h>
#ifdef AFS_NT40_ENV
#define AFS_RXGEN_EXPORT __declspec(dllexport)
#endif /* AFS_NT40_ENV */
#include "kauth.h"

#define KAF_SETTABLE_FLAGS (KAFADMIN | KAFNOTGS | KAFNOSEAL | KAFNOCPW | KAFNEWASSOC)


bool_t
xdr_EncryptionKey(XDR *xdrs, EncryptionKey *objp)
{
	if (!xdr_vector(xdrs, (char *) objp->key, 8, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	return (TRUE);
}


#ifndef NEVERDATE
#define NEVERDATE 037777777777 /* a date that will never come */
#endif
#ifndef Date
#define Date afs_uint32
#endif
#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX_ENV)
#define AUTH_DBM_LOG
#endif


bool_t
xdr_kaname(XDR *xdrs, kaname *objp)
{
	if (!xdr_string(xdrs, objp, 64)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_kaident(XDR *xdrs, kaident *objp)
{
	if (!xdr_vector(xdrs, (char *) objp->name, 64, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->instance, 64, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_kaentryinfo(XDR *xdrs, kaentryinfo *objp)
{
	if (!xdr_afs_int32(xdrs, &objp->minor_version)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->flags)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->user_expiration)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->modification_time)) {
		return (FALSE);
	}
	if (!xdr_kaident(xdrs, &objp->modification_user)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->change_password_time)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->max_ticket_lifetime)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->key_version)) {
		return (FALSE);
	}
	if (!xdr_EncryptionKey(xdrs, &objp->key)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->keyCheckSum)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->misc_auth_bytes)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved3)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved4)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_kasstats(XDR *xdrs, kasstats *objp)
{
	if (!xdr_afs_int32(xdrs, &objp->minor_version)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->allocs)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->frees)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->cpws)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved1)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved2)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved3)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved4)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_katimeval(XDR *xdrs, katimeval *objp)
{
	if (!xdr_afs_int32(xdrs, &objp->tv_sec)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->tv_usec)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_karpcstats(XDR *xdrs, karpcstats *objp)
{
	if (!xdr_int(xdrs, &objp->requests)) {
		return (FALSE);
	}
	if (!xdr_int(xdrs, &objp->aborts)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_kadstats(XDR *xdrs, kadstats *objp)
{
	if (!xdr_afs_int32(xdrs, &objp->minor_version)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->host)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->start_time)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->hashTableUtilization)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->Authenticate)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->ChangePassword)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->GetTicket)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->CreateUser)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->SetPassword)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->SetFields)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->DeleteUser)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->GetEntry)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->ListEntry)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->GetStats)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->GetPassword)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->GetRandomKey)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->Debug)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->UAuthenticate)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->UGetTicket)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->Unlock)) {
		return (FALSE);
	}
	if (!xdr_karpcstats(xdrs, &objp->LockStatus)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->string_checks)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved1)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved2)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved3)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved4)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_ka_kcInfo(XDR *xdrs, ka_kcInfo *objp)
{
	if (!xdr_afs_uint32(xdrs, &objp->used)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->kvno)) {
		return (FALSE);
	}
	if (!xdr_char(xdrs, &objp->primary)) {
		return (FALSE);
	}
	if (!xdr_char(xdrs, &objp->keycksum)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->principal, 64, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_ka_debugInfo(XDR *xdrs, ka_debugInfo *objp)
{
	if (!xdr_afs_int32(xdrs, &objp->minorVersion)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->host)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->startTime)) {
		return (FALSE);
	}
	if (!xdr_int(xdrs, &objp->noAuth)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->lastTrans)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->lastOperation, 16, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->lastAuth, 256, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->lastUAuth, 256, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->lastTGS, 256, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->lastUTGS, 256, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->lastAdmin, 256, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->lastTGSServer, 256, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->lastUTGSServer, 256, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->nextAutoCPW)) {
		return (FALSE);
	}
	if (!xdr_int(xdrs, &objp->updatesRemaining)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->dbHeaderRead)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->dbVersion)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->dbFreePtr)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->dbEofPtr)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->dbKvnoPtr)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->dbSpecialKeysVersion)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->cheader_lock)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->keycache_lock)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->kcVersion)) {
		return (FALSE);
	}
	if (!xdr_int(xdrs, &objp->kcSize)) {
		return (FALSE);
	}
	if (!xdr_int(xdrs, &objp->kcUsed)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->kcInfo, KADEBUGKCINFOSIZE, sizeof(ka_kcInfo), (xdrproc_t) xdr_ka_kcInfo)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved1)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved2)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved3)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->reserved4)) {
		return (FALSE);
	}
	return (TRUE);
}


AFS_RXGEN_EXPORT
const char *KAA_function_names[] = {
	"KAA_Authenticate_old",
	"KAA_Authenticate",
	"KAA_AuthenticateV2",
	"KAA_ChangePassword"
};
AFS_RXGEN_EXPORT
const char *KAT_function_names[] = {
	"KAT_GetTicket_old",
	"KAT_GetTicket"
};
AFS_RXGEN_EXPORT
const char *KAM_function_names[] = {
	"KAM_SetPassword",
	"KAM_SetFields",
	"KAM_CreateUser",
	"KAM_DeleteUser",
	"KAM_GetEntry",
	"KAM_ListEntry",
	"KAM_GetStats",
	"KAM_Debug",
	"KAM_GetPassword",
	"KAM_GetRandomKey",
	"KAM_Unlock",
	"KAM_LockStatus"
};
char *KAA_TranslateOpCode(int op)
{
	switch (op) {
		case 1:	return "KAA_Authenticate_old";
		case 21:	return "KAA_Authenticate";
		case 22:	return "KAA_AuthenticateV2";
		case 2:	return "KAA_ChangePassword";
		default:
			return NULL;
	}
}
int KAA_OpCodeIndex(int op)
{
	switch (op) {
		case 1:	return 0;
		case 21:	return 1;
		case 22:	return 2;
		case 2:	return 3;
		default:
			return -1;
	}
}
char *KAT_TranslateOpCode(int op)
{
	switch (op) {
		case 3:	return "KAT_GetTicket_old";
		case 23:	return "KAT_GetTicket";
		default:
			return NULL;
	}
}
int KAT_OpCodeIndex(int op)
{
	switch (op) {
		case 3:	return 0;
		case 23:	return 1;
		default:
			return -1;
	}
}

static char *opnames2[] = {"KAM_SetPassword", "KAM_SetFields", "KAM_CreateUser", "KAM_DeleteUser", "KAM_GetEntry", "KAM_ListEntry", "KAM_GetStats", "KAM_Debug", "KAM_GetPassword", "KAM_GetRandomKey", "KAM_Unlock", "KAM_LockStatus"};

char *KAM_TranslateOpCode(int op)
{
	if (op < KAM_LOWEST_OPCODE || op > KAM_HIGHEST_OPCODE)
		return NULL;
	return opnames2[op - KAM_LOWEST_OPCODE];
}
struct KAM_stats *KAM_OpCodeStats(int op)
{
	if (op < KAM_LOWEST_OPCODE || op > KAM_HIGHEST_OPCODE)
		return NULL;
	return NULL;/*2 KAM_*/
}
