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

#include "volumeserver.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 VOLSER_AFSVolCreateVolume(
struct rx_connection *connection
, const int32_t partition
, const char *name
, const int32_t type
, const int32_t parent
, int32_t *volid
, int32_t *trans
)
{
struct rx_call *call;
unsigned op = 100;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (partition);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*name));
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (type);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (parent);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl ((*volid));
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*volid) = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*trans) = ntohl (u);
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolTransCreate(
struct rx_connection *connection
, const int32_t volume
, const int32_t partition
, const int32_t flags
, int32_t *trans
)
{
struct rx_call *call;
unsigned op = 108;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (volume);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (partition);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (flags);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*trans) = ntohl (u);
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolEndTrans(
struct rx_connection *connection
, const int32_t trans
, int32_t *rcode
)
{
struct rx_call *call;
unsigned op = 104;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (trans);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*rcode) = ntohl (u);
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolGetFlags(
struct rx_connection *connection
, const int32_t trans
, int32_t *flags
)
{
struct rx_call *call;
unsigned op = 107;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (trans);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*flags) = ntohl (u);
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolSetFlags(
struct rx_connection *connection
, const int32_t trans
, const int32_t flags
)
{
struct rx_call *call;
unsigned op = 106;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (trans);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (flags);
rx_Write(call, &u, sizeof(u));
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolGetName(
struct rx_connection *connection
, const int32_t tid
, char *tname
)
{
struct rx_call *call;
unsigned op = 112;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (tid);
rx_Write(call, &u, sizeof(u));
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolSetDate(
struct rx_connection *connection
, const int32_t tid
, const int32_t newDate
)
{
struct rx_call *call;
unsigned op = 123;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (tid);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (newDate);
rx_Write(call, &u, sizeof(u));
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolListPartitions(
struct rx_connection *connection
, struct pIDs *partIDs
)
{
struct rx_call *call;
unsigned op = 115;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{
int i0;
for(i0 = 0; i0 < 26;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*partIDs).partIds[i0] = ntohl (u);
}
}
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolPartitionInfo(
struct rx_connection *connection
, const char *name
, struct diskPartition *partition
)
{
struct rx_call *call;
unsigned op = 119;

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(name);
{ u_int32_t u;
u = htonl (len);
rx_Write(call, &u, sizeof(u));
}
rx_Write(call, name, len);
rx_Write(call, zero, (4 - (len % 4)) % 4);
}
{
int i0;
for(i0 = 0; i0 < 32;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*partition).name[i0] = ntohl (u);
}
}
}
{
int i0;
for(i0 = 0; i0 < 32;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*partition).devName[i0] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*partition).lock_fd = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*partition).totalUsable = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*partition).free = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*partition).minFree = ntohl (u);
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolListVolumes(
struct rx_connection *connection
, const int32_t partID
, const int32_t flags
, volEntries *resultEntries
)
{
struct rx_call *call;
unsigned op = 116;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (partID);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (flags);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).len = ntohl (u);
}
(*resultEntries).val = (struct volintInfo *)malloc(sizeof(struct volintInfo ) * (*resultEntries).len);
{
int i0;
for(i0 = 0; i0 < (*resultEntries).len;++i0){
{
int i1;
for(i1 = 0; i1 < 32;++i1){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].name[i1] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].volid = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].type = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].backupID = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].parentID = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].cloneID = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].status = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].copyDate = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].inUse = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].needsSalvaged = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].destroyMe = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].creationDate = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].accessDate = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].updateDate = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].backupDate = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].dayUse = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].filecount = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].maxquota = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].size = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].flags = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].spare0 = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].spare1 = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].spare2 = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].spare3 = ntohl (u);
}
}
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolListOneVolume(
struct rx_connection *connection
, const int32_t partID
, const int32_t volid
, volEntries *resultEntries
)
{
struct rx_call *call;
unsigned op = 121;

call = rx_NewCall (connection);
{ u_int32_t u;
u = htonl (op);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (partID);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
u = htonl (volid);
rx_Write(call, &u, sizeof(u));
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).len = ntohl (u);
}
(*resultEntries).val = (struct volintInfo *)malloc(sizeof(struct volintInfo ) * (*resultEntries).len);
{
int i0;
for(i0 = 0; i0 < (*resultEntries).len;++i0){
{
int i1;
for(i1 = 0; i1 < 32;++i1){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].name[i1] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].volid = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].type = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].backupID = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].parentID = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].cloneID = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].status = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].copyDate = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].inUse = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].needsSalvaged = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].destroyMe = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].creationDate = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].accessDate = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].updateDate = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].backupDate = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].dayUse = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].filecount = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].maxquota = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].size = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].flags = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].spare0 = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].spare1 = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].spare2 = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*resultEntries).val[i0].spare3 = ntohl (u);
}
}
}
return rx_EndCall (call,0);
}
int VOLSER_AFSVolVolMonitor(
struct rx_connection *connection
, transDebugEntries *result
)
{
struct rx_call *call;
unsigned op = 118;

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));
(*result).len = ntohl (u);
}
(*result).val = (struct transDebugInfo *)malloc(sizeof(struct transDebugInfo ) * (*result).len);
{
int i0;
for(i0 = 0; i0 < (*result).len;++i0){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].tid = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].time = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].creationTime = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].returnCode = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].volid = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].partition = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].iflags = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].vflags = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].tflags = ntohl (u);
}
{
int i1;
for(i1 = 0; i1 < 30;++i1){
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].lastProcName[i1] = ntohl (u);
}
}
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].callValid = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].readNext = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].transmitNext = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].lastSendTime = ntohl (u);
}
{ u_int32_t u;
rx_Read(call, &u, sizeof(u));
(*result).val[i0].lastReceiveTime = ntohl (u);
}
}
}
return rx_EndCall (call,0);
}
