/* Generated from vldb.xg */
#include "vldb.h"

#include "vldb.cs.h"

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <netinet/in.h>
#ifndef HAVE_BCOPY
#define bcopy(a,b,c) memcpy((b),(a),(c))
#endif /* !HAVE_BCOPY */

int VL_CreateEntry(
struct rx_connection *connection
, const struct vldbentry *newentry
)
{
struct rx_call *call;
unsigned op = 501;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{
int i0;
for(i0 = 0; i0 < 65;++i0){
{ u_int32_t u;
u = htonl ((*newentry).name[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{ u_int32_t u;
u = htonl ((*newentry).volumeType);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*newentry).nServers);
rx_Write(call, &u, sizeof(u));
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*newentry).serverNumber[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*newentry).serverPartition[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*newentry).serverFlags[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 3;++i0){
{ u_int32_t u;
u = htonl ((*newentry).volumeId[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{ u_int32_t u;
u = htonl ((*newentry).cloneId);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*newentry).flags);
rx_Write(call, &u, sizeof(u));
}
return rx_EndCall (call,0);
}
int VL_DeleteEntry(
struct rx_connection *connection
, const int32_t Volid
, const int32_t voltype
)
{
struct rx_call *call;
unsigned op = 502;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (Volid);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (voltype);
rx_Write(call, &u, sizeof(u));
}
return rx_EndCall (call,0);
}
int VL_GetEntryByID(
struct rx_connection *connection
, const int32_t Volid
, const int32_t voltype
, struct vldbentry *entry
)
{
struct rx_call *call;
unsigned op = 503;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (Volid);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (voltype);
rx_Write(call, &u, sizeof(u));
}
{
int i0;
for(i0 = 0; i0 < 65;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).name[i0] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).volumeType = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).nServers = ntohl (u);
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).serverNumber[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).serverPartition[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).serverFlags[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 3;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).volumeId[i0] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).cloneId = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).flags = ntohl (u);
}
return rx_EndCall (call,0);
}
int VL_GetEntryByName(
struct rx_connection *connection
, const char *volumename
, struct vldbentry *entry
)
{
struct rx_call *call;
unsigned op = 504;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ unsigned len;
char zero[4] = {0, 0, 0, 0};
len = strlen(volumename);
{ u_int32_t u;
u = htonl (len);
rx_Write(call, &u, sizeof(u));
}
rx_Write(call, volumename, len);
rx_Write(call, zero, (4 - (len % 4)) % 4);
}
{
int i0;
for(i0 = 0; i0 < 65;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).name[i0] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).volumeType = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).nServers = ntohl (u);
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).serverNumber[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).serverPartition[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).serverFlags[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 3;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).volumeId[i0] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).cloneId = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).flags = ntohl (u);
}
return rx_EndCall (call,0);
}
int VL_GetNewVolumeId(
struct rx_connection *connection
, const int32_t bumpcount
, int32_t *newvolumid
)
{
struct rx_call *call;
unsigned op = 505;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (bumpcount);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*newvolumid) = ntohl (u);
}
return rx_EndCall (call,0);
}
int VL_ReplaceEntry(
struct rx_connection *connection
, const int32_t Volid
, const int32_t voltype
, const struct vldbentry *newentry
, const int32_t ReleaseType
)
{
struct rx_call *call;
unsigned op = 506;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (Volid);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (voltype);
rx_Write(call, &u, sizeof(u));
}
{
int i0;
for(i0 = 0; i0 < 65;++i0){
{ u_int32_t u;
u = htonl ((*newentry).name[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{ u_int32_t u;
u = htonl ((*newentry).volumeType);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*newentry).nServers);
rx_Write(call, &u, sizeof(u));
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*newentry).serverNumber[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*newentry).serverPartition[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*newentry).serverFlags[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 3;++i0){
{ u_int32_t u;
u = htonl ((*newentry).volumeId[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{ u_int32_t u;
u = htonl ((*newentry).cloneId);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*newentry).flags);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (ReleaseType);
rx_Write(call, &u, sizeof(u));
}
return rx_EndCall (call,0);
}
int VL_UpdateEntry(
struct rx_connection *connection
, const int32_t Volid
, const int32_t voltype
, const struct VldbUpdateEntry *UpdateEntry
, const int32_t ReleaseType
)
{
struct rx_call *call;
unsigned op = 507;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (Volid);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (voltype);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*UpdateEntry).Mask);
rx_Write(call, &u, sizeof(u));
}
{
int i0;
for(i0 = 0; i0 < 65;++i0){
{ u_int32_t u;
u = htonl ((*UpdateEntry).name[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{ u_int32_t u;
u = htonl ((*UpdateEntry).volumeType);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*UpdateEntry).flags);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*UpdateEntry).ReadOnlyId);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*UpdateEntry).BackupId);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*UpdateEntry).cloneid);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*UpdateEntry).nModifiedRepsites);
rx_Write(call, &u, sizeof(u));
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*UpdateEntry).RepsitesMask[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*UpdateEntry).RepsitesTargetServer[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*UpdateEntry).RepsitesTargetPart[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*UpdateEntry).RepsitesNewServer[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*UpdateEntry).RepsitesNewPart[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
u = htonl ((*UpdateEntry).RepsitesNewFlags[i0]);
rx_Write(call, &u, sizeof(u));
}
}
}
{ u_int32_t u;
u = htonl (ReleaseType);
rx_Write(call, &u, sizeof(u));
}
return rx_EndCall (call,0);
}
int VL_SetLock(
struct rx_connection *connection
, const int32_t Volid
, const int32_t voltype
, const int32_t voloper
)
{
struct rx_call *call;
unsigned op = 508;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (Volid);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (voltype);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (voloper);
rx_Write(call, &u, sizeof(u));
}
return rx_EndCall (call,0);
}
int VL_ReleaseLock(
struct rx_connection *connection
, const int32_t volid
, const int32_t voltype
, const int32_t ReleaseType
)
{
struct rx_call *call;
unsigned op = 509;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (volid);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (voltype);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (ReleaseType);
rx_Write(call, &u, sizeof(u));
}
return rx_EndCall (call,0);
}
int VL_ListEntry(
struct rx_connection *connection
, const int32_t previous_index
, int32_t *count
, int32_t *next_index
, struct vldbentry *entry
)
{
struct rx_call *call;
unsigned op = 510;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (previous_index);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*count) = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*next_index) = ntohl (u);
}
{
int i0;
for(i0 = 0; i0 < 65;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).name[i0] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).volumeType = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).nServers = ntohl (u);
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).serverNumber[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).serverPartition[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 8;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).serverFlags[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 3;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).volumeId[i0] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).cloneId = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*entry).flags = ntohl (u);
}
return rx_EndCall (call,0);
}
int VL_ListAttributes(
struct rx_connection *connection
, const struct VldbListByAttributes *attributes
, int32_t *nentries
, bulkentries *blkentries
)
{
struct rx_call *call;
unsigned op = 511;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*attributes).Mask);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*attributes).server);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*attributes).partition);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*attributes).volumetype);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*attributes).volumeid);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*attributes).flag);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*nentries) = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*blkentries).len = ntohl (u);
}
(*blkentries).val = (struct vldbentry *)malloc(sizeof(struct vldbentry ) * (*blkentries).len);
{
int i0;
for(i0 = 0; i0 < (*blkentries).len;++i0){
{
int i1;
for(i1 = 0; i1 < 65;++i1){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*blkentries).val[i0].name[i1] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*blkentries).val[i0].volumeType = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*blkentries).val[i0].nServers = ntohl (u);
}
{
int i1;
for(i1 = 0; i1 < 8;++i1){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*blkentries).val[i0].serverNumber[i1] = ntohl (u);
}
}
}
{
int i1;
for(i1 = 0; i1 < 8;++i1){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*blkentries).val[i0].serverPartition[i1] = ntohl (u);
}
}
}
{
int i1;
for(i1 = 0; i1 < 8;++i1){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*blkentries).val[i0].serverFlags[i1] = ntohl (u);
}
}
}
{
int i1;
for(i1 = 0; i1 < 3;++i1){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*blkentries).val[i0].volumeId[i1] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*blkentries).val[i0].cloneId = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*blkentries).val[i0].flags = ntohl (u);
}
}
}
return rx_EndCall (call,0);
}
int VL_GetStats(
struct rx_connection *connection
, struct vldstats *stats
, struct vital_vlheader *vital_header
)
{
struct rx_call *call;
unsigned op = 513;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*stats).start_time = ntohl (u);
}
{
int i0;
for(i0 = 0; i0 < 30;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*stats).requests[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 30;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*stats).aborts[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 5;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*stats).reserved[i0] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*vital_header).vldbversion = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*vital_header).headersize = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*vital_header).feePtr = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*vital_header).eofPtr = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*vital_header).allocs = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*vital_header).frees = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*vital_header).MaxVolumeId = ntohl (u);
}
{
int i0;
for(i0 = 0; i0 < 3;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*vital_header).totalEntries[i0] = ntohl (u);
}
}
}
return rx_EndCall (call,0);
}
int VL_Probe(
struct rx_connection *connection
)
{
struct rx_call *call;
unsigned op = 514;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
return rx_EndCall (call,0);
}
