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