/* Sample XDR specification from RFC 1832 Section 5.5 */ const MAXUSERNAME = 32; /* max length of a user name */ const MAXFILELEN = 65535; /* max length of a file */ const MAXNAMELEN = 255; /* max length of a file name */ /* * Types of files: */ enum filekind { TEXT = 0, /* ascii data */ DATA = 1, /* raw data */ EXEC = 2 /* executable */ }; /* * File information, per kind of file: */ union filetype switch (filekind kind) { case TEXT: void; /* no extra information */ case DATA: string creator; /* data creator */ case EXEC: string interpretor; /* program interpretor */ }; /* * A complete file: */ struct file { string filename; /* name of file */ filetype type; /* info about file */ string owner; /* owner of file */ opaque data; /* file data */ };