/************************************************************** * random.defs * Defines a server to return random numbers, random strings * and pages of memory filled with random junk. *************************************************************/ subsystem random 500; #include type dbl = struct [2] of int; type string25 = (MSG_TYPE_STRING,8*25); /* passed by reference */ type string80 = struct [1] of array [80] of char; /* passed by value */ type words = ^ array [ ] of int; type words256 = array [256] of int; type comp_arr = array [10] of array [256] of int; type page_ptr = ^array [4096] of MSG_TYPE_INTEGER_32; import "random_types.h"; procedure init_seed ( server_port : port_t; seed : dbl); function get_randomf( server_port : port_t) : int; routine get_random( server_port : port_t; out num : int); msgtype MSG_TYPE_ENCRYPTED; /* get secret string */ waittime 10000; /* next call may go to a server on another machine */ routine get_secret( server_port : port_t; inout password : string25); /* input waittime to next procedure in case 10 seconds is not long enough */ /* mtype can be input as MSG_TYPE_NORMAL if encryption is not wanted */ routine get_confidential(server_port : port_t; waittime wait : int; MsgType mtype : int; out data : page_ptr,dealloc); nowaittime; msgtype MSG_TYPE_NORMAL; simpleroutine use_random(server_port : port_t; info_seed : string80; info : comp_arr; info_1 : words); /* tell server you are finished using it */ simpleprocedure exit( server_port : port_t);