1 /* Sample XDR specification from RFC 1832 Sect 2 3 const MAXUSERNAME = 32; /* max length of a 4 const MAXFILELEN = 65535; /* max length of a 5 const MAXNAMELEN = 255; /* max length of a 6 7 /* 8 * Types of files: 9 */ 10 enum filekind { 11 TEXT = 0, /* ascii data */ 12 DATA = 1, /* raw data */ 13 EXEC = 2 /* executable */ 14 }; 15 16 /* 17 * File information, per kind of file: 18 */ 19 union filetype switch (filekind kind) { 20 case TEXT: 21 void; /* no extra 22 case DATA: 23 string creator<MAXNAMELEN>; /* data cre 24 case EXEC: 25 string interpretor<MAXNAMELEN>; /* program 26 }; 27 28 /* 29 * A complete file: 30 */ 31 struct file { 32 string filename<MAXNAMELEN>; /* name of fil 33 filetype type; /* info about 34 string owner<MAXUSERNAME>; /* owner of fi 35 opaque data<MAXFILELEN>; /* file data 36 };
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.