/* Generated from fs.xg */
#ifndef _FS_
#define _FS_

#include <atypes.h>

#include <config.h>
#include <roken.h>
#include <fs_errors.h>
#ifndef _COMMON_
#define _COMMON_
#define LockRead 0

#define LockWrite 1

#define LockExtend 2

#define LockRelease 3

#define AFSNAMEMAX 256

struct AFSFid {
     u_int32_t Volume;
     u_int32_t Vnode;
     u_int32_t Unique;
};
typedef struct AFSFid AFSFid;

#define AFSFID_SIZE 12
char *ydr_encode_AFSFid(AFSFid *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSFid(AFSFid *o, char *ptr, size_t *total_len);
void ydr_print_AFSFid(AFSFid *o);
struct VenusFid {
     int32_t Cell;
     struct AFSFid fid;
};
typedef struct VenusFid VenusFid;

#define VENUSFID_SIZE 16
char *ydr_encode_VenusFid(VenusFid *o, char *ptr, size_t *total_len);
char *ydr_decode_VenusFid(VenusFid *o, char *ptr, size_t *total_len);
void ydr_print_VenusFid(VenusFid *o);
struct AFSCallBack {
     u_int32_t CallBackVersion;
     u_int32_t ExpirationTime;
     u_int32_t CallBackType;
};
typedef struct AFSCallBack AFSCallBack;

#define AFSCALLBACK_SIZE 12
char *ydr_encode_AFSCallBack(AFSCallBack *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSCallBack(AFSCallBack *o, char *ptr, size_t *total_len);
void ydr_print_AFSCallBack(AFSCallBack *o);
enum CallBackType {
     CBEXCLUSIVE = 1,
     CBSHARED = 2,
     CBDROPPED = 3
};
typedef enum CallBackType CallBackType;

#define CALLBACKTYPE_SIZE 4
char *ydr_encode_CallBackType(CallBackType *o, char *ptr, size_t *total_len);
char *ydr_decode_CallBackType(CallBackType *o, char *ptr, size_t *total_len);
void ydr_print_CallBackType(CallBackType *o);
struct AFSVolSync {
     u_int32_t spare1;
     u_int32_t spare2;
     u_int32_t spare3;
     u_int32_t spare4;
     u_int32_t spare5;
     u_int32_t spare6;
};
typedef struct AFSVolSync AFSVolSync;

#define AFSVOLSYNC_SIZE 24
char *ydr_encode_AFSVolSync(AFSVolSync *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSVolSync(AFSVolSync *o, char *ptr, size_t *total_len);
void ydr_print_AFSVolSync(AFSVolSync *o);
#define TYPE_FILE 1

#define TYPE_DIR 2

#define TYPE_LINK 3

struct AFSFetchStatus {
     u_int32_t InterfaceVersion;
     u_int32_t FileType;
     u_int32_t LinkCount;
     u_int32_t Length;
     u_int32_t DataVersion;
     u_int32_t Author;
     u_int32_t Owner;
     u_int32_t CallerAccess;
     u_int32_t AnonymousAccess;
     u_int32_t UnixModeBits;
     u_int32_t ParentVnode;
     u_int32_t ParentUnique;
     u_int32_t SegSize;
     u_int32_t ClientModTime;
     u_int32_t ServerModTime;
     u_int32_t Group;
     u_int32_t SyncCount;
     u_int32_t spare1;
     u_int32_t spare2;
     u_int32_t spare3;
     u_int32_t spare4;
};
typedef struct AFSFetchStatus AFSFetchStatus;

#define AFSFETCHSTATUS_SIZE 84
char *ydr_encode_AFSFetchStatus(AFSFetchStatus *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSFetchStatus(AFSFetchStatus *o, char *ptr, size_t *total_len);
void ydr_print_AFSFetchStatus(AFSFetchStatus *o);
#define SS_MODTIME 1

#define SS_OWNER 2

#define SS_GROUP 4

#define SS_MODEBITS 8

#define SS_SEGSIZE 16

#define SS_FSYNC 1024

struct AFSStoreStatus {
     u_int32_t Mask;
     u_int32_t ClientModTime;
     u_int32_t Owner;
     u_int32_t Group;
     u_int32_t UnixModeBits;
     u_int32_t SegSize;
};
typedef struct AFSStoreStatus AFSStoreStatus;

#define AFSSTORESTATUS_SIZE 24
char *ydr_encode_AFSStoreStatus(AFSStoreStatus *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSStoreStatus(AFSStoreStatus *o, char *ptr, size_t *total_len);
void ydr_print_AFSStoreStatus(AFSStoreStatus *o);
struct AFSFetchVolumeStatus {
     int32_t Vid;
     int32_t ParentId;
     char Online;
     char InService;
     char Blessed;
     char NeedsSalvage;
     int32_t Type;
     int32_t MinQuota;
     int32_t MaxQuota;
     int32_t BlocksInUse;
     int32_t PartBlocksAvail;
     int32_t PartMaxBlocks;
};
typedef struct AFSFetchVolumeStatus AFSFetchVolumeStatus;

#define AFSFETCHVOLUMESTATUS_SIZE 48
char *ydr_encode_AFSFetchVolumeStatus(AFSFetchVolumeStatus *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSFetchVolumeStatus(AFSFetchVolumeStatus *o, char *ptr, size_t *total_len);
void ydr_print_AFSFetchVolumeStatus(AFSFetchVolumeStatus *o);
struct AFSStoreVolumeStatus {
     int32_t Mask;
     int32_t MinQuota;
     int32_t MaxQuota;
};
typedef struct AFSStoreVolumeStatus AFSStoreVolumeStatus;

#define AFSSTOREVOLUMESTATUS_SIZE 12
char *ydr_encode_AFSStoreVolumeStatus(AFSStoreVolumeStatus *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSStoreVolumeStatus(AFSStoreVolumeStatus *o, char *ptr, size_t *total_len);
void ydr_print_AFSStoreVolumeStatus(AFSStoreVolumeStatus *o);
#define AFSOPAQUEMAX 1024

typedef struct {
unsigned len;
char *val;
} AFSOpaque;

char *ydr_encode_AFSOpaque(AFSOpaque *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSOpaque(AFSOpaque *o, char *ptr, size_t *total_len);
void ydr_print_AFSOpaque(AFSOpaque *o);
typedef int32_t ViceLockType;

#define VICELOCKTYPE_SIZE 4
char *ydr_encode_ViceLockType(ViceLockType *o, char *ptr, size_t *total_len);
char *ydr_decode_ViceLockType(ViceLockType *o, char *ptr, size_t *total_len);
void ydr_print_ViceLockType(ViceLockType *o);
#define AFSCBMAX 50

typedef struct {
unsigned len;
struct AFSCallBack *val;
} AFSCBs;

char *ydr_encode_AFSCBs(AFSCBs *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSCBs(AFSCBs *o, char *ptr, size_t *total_len);
void ydr_print_AFSCBs(AFSCBs *o);
typedef struct {
unsigned len;
struct AFSFetchStatus *val;
} AFSBulkStats;

char *ydr_encode_AFSBulkStats(AFSBulkStats *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSBulkStats(AFSBulkStats *o, char *ptr, size_t *total_len);
void ydr_print_AFSBulkStats(AFSBulkStats *o);
typedef struct {
unsigned len;
struct AFSFid *val;
} AFSCBFids;

char *ydr_encode_AFSCBFids(AFSCBFids *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSCBFids(AFSCBFids *o, char *ptr, size_t *total_len);
void ydr_print_AFSCBFids(AFSCBFids *o);
#define PRSFS_READ 1

#define PRSFS_WRITE 2

#define PRSFS_INSERT 4

#define PRSFS_LOOKUP 8

#define PRSFS_DELETE 16

#define PRSFS_LOCK 32

#define PRSFS_ADMINISTER 64

struct AFSVolumeInfo {
     u_int32_t Vid;
     int32_t Type;
     u_int32_t Type0;
     u_int32_t Type1;
     u_int32_t Type2;
     u_int32_t Type3;
     u_int32_t Type4;
     u_int32_t ServerCount;
     u_int32_t Server0;
     u_int32_t Server1;
     u_int32_t Server2;
     u_int32_t Server3;
     u_int32_t Server4;
     u_int32_t Server5;
     u_int32_t Server6;
     u_int32_t Server7;
     u_int16_t Port0;
     u_int16_t Port1;
     u_int16_t Port2;
     u_int16_t Port3;
     u_int16_t Port4;
     u_int16_t Port5;
     u_int16_t Port6;
     u_int16_t Port7;
};
typedef struct AFSVolumeInfo AFSVolumeInfo;

#define AFSVOLUMEINFO_SIZE 96
char *ydr_encode_AFSVolumeInfo(AFSVolumeInfo *o, char *ptr, size_t *total_len);
char *ydr_decode_AFSVolumeInfo(AFSVolumeInfo *o, char *ptr, size_t *total_len);
void ydr_print_AFSVolumeInfo(AFSVolumeInfo *o);
struct afsUUID {
     u_int32_t time_low;
     u_int16_t time_mid;
     u_int16_t time_hi_and_version;
     char clock_seq_hi_and_reserved;
     char clock_seq_low;
     char node[ 6 ];
};
typedef struct afsUUID afsUUID;

#define AFSUUID_SIZE 44
char *ydr_encode_afsUUID(afsUUID *o, char *ptr, size_t *total_len);
char *ydr_decode_afsUUID(afsUUID *o, char *ptr, size_t *total_len);
void ydr_print_afsUUID(afsUUID *o);
#endif  

#endif /* FS */
