/* 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 "vldbint.h"

#include <afs/vl_opcodes.h> /* directly to other places */
#ifdef KERNEL
#define afs_xdr_array(a,b,c,d,e,f) afs_xdr_arrayN(a,b,c,d,e,f)
#endif
#define VldbVersion "4"


bool_t
xdr_VldbUpdateEntry(XDR *xdrs, VldbUpdateEntry *objp)
{
	if (!xdr_afs_uint32(xdrs, &objp->Mask)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->name, VL_MAXNAMELEN, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares3)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->flags)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->ReadOnlyId)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->BackupId)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->cloneId)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->nModifiedRepsites)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->RepsitesMask, OMAXNSERVERS, sizeof(afs_uint32), (xdrproc_t) xdr_afs_uint32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->RepsitesTargetServer, OMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->RepsitesTargetPart, OMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->RepsitesNewServer, OMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->RepsitesNewPart, OMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->RepsitesNewFlags, OMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_bulk(XDR *xdrs, bulk *objp)
{
	{
		u_int __len = (u_int) *(&objp->bulk_len);
		if (!xdr_bytes(xdrs, (char **)&objp->bulk_val, &__len, DEFAULTBULK)) {
			return (FALSE);
		}
		*(&objp->bulk_len) = __len;
	}
	return (TRUE);
}




bool_t
xdr_VldbListByAttributes(XDR *xdrs, VldbListByAttributes *objp)
{
	if (!xdr_afs_uint32(xdrs, &objp->Mask)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->server)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->partition)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares3)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->volumeid)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->flag)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_vldbentry(XDR *xdrs, vldbentry *objp)
{
	if (!xdr_vector(xdrs, (char *) objp->name, VL_MAXNAMELEN, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares3)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->nServers)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->serverNumber, OMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->serverPartition, OMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->serverFlags, OMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->volumeId, MAXTYPES, sizeof(afs_uint32), (xdrproc_t) xdr_afs_uint32)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->cloneId)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->flags)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_nvldbentry(XDR *xdrs, nvldbentry *objp)
{
	if (!xdr_vector(xdrs, (char *) objp->name, VL_MAXNAMELEN, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->nServers)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->serverNumber, NMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->serverPartition, NMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->serverFlags, NMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->volumeId, MAXTYPES, sizeof(afs_uint32), (xdrproc_t) xdr_afs_uint32)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->cloneId)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->flags)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->matchindex)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares2)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares3)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares4)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares5)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares6)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares7)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares8)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares9)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_ListAddrByAttributes(XDR *xdrs, ListAddrByAttributes *objp)
{
	if (!xdr_afs_int32(xdrs, &objp->Mask)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->ipaddr)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->index)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spare1)) {
		return (FALSE);
	}
	if (!xdr_afsUUID(xdrs, &objp->uuid)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_uvldbentry(XDR *xdrs, uvldbentry *objp)
{
	if (!xdr_vector(xdrs, (char *) objp->name, VL_MAXNAMELEN, sizeof(char), (xdrproc_t) xdr_char)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->nServers)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->serverNumber, NMAXNSERVERS, sizeof(afsUUID), (xdrproc_t) xdr_afsUUID)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->serverUnique, NMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->serverPartition, NMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->serverFlags, NMAXNSERVERS, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->volumeId, MAXTYPES, sizeof(afs_uint32), (xdrproc_t) xdr_afs_uint32)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->cloneId)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->flags)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->matchindex)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares2)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares3)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares4)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares5)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares6)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares7)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares8)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->spares9)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_vital_vlheader(XDR *xdrs, vital_vlheader *objp)
{
	if (!xdr_afs_int32(xdrs, &objp->vldbversion)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->headersize)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->freePtr)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->eofPtr)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->allocs)) {
		return (FALSE);
	}
	if (!xdr_afs_int32(xdrs, &objp->frees)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->MaxVolumeId)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->totalEntries, MAXTYPES, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_vldstats(XDR *xdrs, vldstats *objp)
{
	if (!xdr_afs_uint32(xdrs, &objp->start_time)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->requests, MAX_NUMBER_OPCODES, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->aborts, MAX_NUMBER_OPCODES, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	if (!xdr_vector(xdrs, (char *) objp->reserved, 5, sizeof(afs_int32), (xdrproc_t) xdr_afs_int32)) {
		return (FALSE);
	}
	return (TRUE);
}


#define VLOP_ADDSITE VLOP_DELETE
#define VLOP_RESTORE VLOP_DUMP
#define VLOP_ALLOPERS ( VLOP_MOVE | VLOP_RELEASE | VLOP_BACKUP | VLOP_DELETE | VLOP_DUMP)
#define VLF_RWEXISTS 0x1000 /* flags for whole vldb entry */
#define VLF_ROEXISTS 0x2000
#define VLF_BACKEXISTS 0x4000
#define VLF_DFSFILESET 0x8000 /* Volume is really DFS fileset */
#define VLSF_NEWREPSITE 0x01 /* flags for indiv. server entry */
#define VLSF_ROVOL 0x02
#define VLSF_RWVOL 0x04
#define VLSF_BACKVOL 0x08
#define VLSF_UUID 0x10
#define VLSF_DONTUSE 0x20
#define VLSF_RWREPLICA 0x40 /* Volume is a RW replica */


bool_t
xdr_bulkentries(XDR *xdrs, bulkentries *objp)
{
	if (!xdr_array(xdrs, (caddr_t *)&objp->bulkentries_val, &objp->bulkentries_len, ~0u, sizeof(vldbentry), (xdrproc_t) xdr_vldbentry)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_nbulkentries(XDR *xdrs, nbulkentries *objp)
{
	if (!xdr_array(xdrs, (caddr_t *)&objp->nbulkentries_val, &objp->nbulkentries_len, ~0u, sizeof(nvldbentry), (xdrproc_t) xdr_nvldbentry)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_ubulkentries(XDR *xdrs, ubulkentries *objp)
{
	if (!xdr_array(xdrs, (caddr_t *)&objp->ubulkentries_val, &objp->ubulkentries_len, ~0u, sizeof(uvldbentry), (xdrproc_t) xdr_uvldbentry)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_bulkaddrs(XDR *xdrs, bulkaddrs *objp)
{
	if (!xdr_array(xdrs, (caddr_t *)&objp->bulkaddrs_val, &objp->bulkaddrs_len, 500, sizeof(afs_uint32), (xdrproc_t) xdr_afs_uint32)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_VLCallBack(XDR *xdrs, VLCallBack *objp)
{
	if (!xdr_afs_uint32(xdrs, &objp->CallBackVersion)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->ExpirationTime)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->CallBackType)) {
		return (FALSE);
	}
	if (!xdr_afs_uint32(xdrs, &objp->Handle)) {
		return (FALSE);
	}
	return (TRUE);
}


#if !defined(KERNEL)


bool_t
xdr_vldblist(XDR *xdrs, vldblist *objp)
{
	if (!xdr_pointer(xdrs, (char * *) objp, sizeof(struct single_vldbentry), (xdrproc_t) xdr_single_vldbentry)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_single_vldbentry(XDR *xdrs, single_vldbentry *objp)
{
	if (!xdr_vldbentry(xdrs, &objp->VldbEntry)) {
		return (FALSE);
	}
	if (!xdr_vldblist(xdrs, &objp->next_vldb)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_vldb_list(XDR *xdrs, vldb_list *objp)
{
	if (!xdr_vldblist(xdrs, &objp->node)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_nvldblist(XDR *xdrs, nvldblist *objp)
{
	if (!xdr_pointer(xdrs, (char * *) objp, sizeof(struct single_nvldbentry), (xdrproc_t) xdr_single_nvldbentry)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_single_nvldbentry(XDR *xdrs, single_nvldbentry *objp)
{
	if (!xdr_nvldbentry(xdrs, &objp->VldbEntry)) {
		return (FALSE);
	}
	if (!xdr_nvldblist(xdrs, &objp->next_vldb)) {
		return (FALSE);
	}
	return (TRUE);
}




bool_t
xdr_nvldb_list(XDR *xdrs, nvldb_list *objp)
{
	if (!xdr_nvldblist(xdrs, &objp->node)) {
		return (FALSE);
	}
	return (TRUE);
}


#endif /* !defined(KERNEL) */
AFS_RXGEN_EXPORT
const char *VL_function_names[] = {
	"VL_ProbeServer",
	"VL_GetEntryByNameO",
	"VL_GetEntryByNameN",
	"VL_GetEntryByNameU",
	"VL_GetAddrsU",
	"VL_CreateEntry",
	"VL_DeleteEntry",
	"VL_GetEntryByID",
	"VL_GetNewVolumeId",
	"VL_ReplaceEntry",
	"VL_UpdateEntry",
	"VL_SetLock",
	"VL_ReleaseLock",
	"VL_ListEntry",
	"VL_ListAttributes",
	"VL_LinkedList",
	"VL_GetStats",
	"VL_GetAddrs",
	"VL_ChangeAddr",
	"VL_CreateEntryN",
	"VL_GetEntryByIDN",
	"VL_ReplaceEntryN",
	"VL_ListEntryN",
	"VL_ListAttributesN",
	"VL_LinkedListN",
	"VL_UpdateEntryByName",
	"VL_RegisterAddrs",
	"VL_ListAttributesN2"
};
char *VL_TranslateOpCode(int op)
{
	switch (op) {
		case 514:	return "VL_ProbeServer";
		case 504:	return "VL_GetEntryByNameO";
		case 519:	return "VL_GetEntryByNameN";
		case 527:	return "VL_GetEntryByNameU";
		case 533:	return "VL_GetAddrsU";
		case 501:	return "VL_CreateEntry";
		case 502:	return "VL_DeleteEntry";
		case 503:	return "VL_GetEntryByID";
		case 505:	return "VL_GetNewVolumeId";
		case 506:	return "VL_ReplaceEntry";
		case 507:	return "VL_UpdateEntry";
		case 508:	return "VL_SetLock";
		case 509:	return "VL_ReleaseLock";
		case 510:	return "VL_ListEntry";
		case 511:	return "VL_ListAttributes";
		case 512:	return "VL_LinkedList";
		case 513:	return "VL_GetStats";
		case 515:	return "VL_GetAddrs";
		case 516:	return "VL_ChangeAddr";
		case 517:	return "VL_CreateEntryN";
		case 518:	return "VL_GetEntryByIDN";
		case 520:	return "VL_ReplaceEntryN";
		case 521:	return "VL_ListEntryN";
		case 522:	return "VL_ListAttributesN";
		case 523:	return "VL_LinkedListN";
		case 524:	return "VL_UpdateEntryByName";
		case 532:	return "VL_RegisterAddrs";
		case 534:	return "VL_ListAttributesN2";
		default:
			return NULL;
	}
}
int VL_OpCodeIndex(int op)
{
	switch (op) {
		case 514:	return 0;
		case 504:	return 1;
		case 519:	return 2;
		case 527:	return 3;
		case 533:	return 4;
		case 501:	return 5;
		case 502:	return 6;
		case 503:	return 7;
		case 505:	return 8;
		case 506:	return 9;
		case 507:	return 10;
		case 508:	return 11;
		case 509:	return 12;
		case 510:	return 13;
		case 511:	return 14;
		case 512:	return 15;
		case 513:	return 16;
		case 515:	return 17;
		case 516:	return 18;
		case 517:	return 19;
		case 518:	return 20;
		case 520:	return 21;
		case 521:	return 22;
		case 522:	return 23;
		case 523:	return 24;
		case 524:	return 25;
		case 532:	return 26;
		case 534:	return 27;
		default:
			return -1;
	}
}
