00001 /*************************************************************** 00002 * File: rpc_msg.hh 00003 * Purpose: Defines the structs passed between RPC clients and servers 00004 * as part of CMS. 00005 * Includes: 00006 * 1. struct RPC_READ_REQUEST, RPC_READ_REPLY, RPC_WRITE_REPLY, 00007 * RPC_WRITE_REQUEST. 00008 * 2. Function prototypes for functions that XDR encode and decode these 00009 * structs. 00010 * NOTES: 00011 * In windows, these XDR functions need to use the Pascal calling convention 00012 * so that the PC-NFS Toolkit DLL can call them. 00013 *****************************************************************/ 00014 00015 00016 #ifndef RPC_MSG_HH 00017 #define RPC_MSG_HH 00018 00019 #include "rcs_defs.hh" /* RCS_EXPORT, RCS_PASCAL, RCS_FAR */ 00020 00021 #ifdef VXWORKS 00022 extern "C" 00023 { 00024 #include <rpc/rpctypes.h> /* needed by xdr.h */ 00025 #include <rpc/xdr.h> /* XDR */ 00026 } 00027 #else 00028 extern "C" 00029 { 00030 #include <rpc/types.h> /* needed by xdr.h */ 00031 #include <rpc/xdr.h> /* XDR */ 00032 } 00033 #endif 00034 00035 struct RCS_EXPORT CMS_HEADER; 00036 00037 /* Structure sent by client to server to initiate a read. */ 00038 struct RCS_EXPORT RPC_READ_REQUEST 00039 { 00040 long buffer_number; /* which buffer should server read */ 00041 int access_type; /* read or just peek */ 00042 long last_id_read; /* The server can compare with id from buffer */ 00043 /* to determine if the buffer is new */ 00044 /* to this client */ 00045 }; 00046 00047 /* Structure returned by server to client after a read. */ 00048 struct RCS_EXPORT RPC_READ_REPLY 00049 { 00050 int status; /* Value of CMS::status after attempted read */ 00051 int size; /* size of message stored in data. */ 00052 long write_id; /* Id from the buffer. */ 00053 long was_read; /* Was this message already read? */ 00054 void RCS_FAR *data; /* Location of stored message. */ 00055 }; 00056 00057 /* Structure sent by client to server to initiate a write. */ 00058 struct RCS_EXPORT RPC_WRITE_REQUEST 00059 { 00060 long buffer_number; /* Which buffer should server write to? */ 00061 int access_type; /* write or write_if_read */ 00062 int size; /* size of message in data */ 00063 void RCS_FAR *data; /* location of message to write into buffer */ 00064 }; 00065 00066 /* Structure returned by server to client after a write. */ 00067 struct RCS_EXPORT RPC_WRITE_REPLY 00068 { 00069 int status; /* Value of CMS::status after write */ 00070 long was_read; /* Was the message to be overwriten ever read? */ 00071 }; 00072 00073 /* Structure sent by client to server to get the key associated with a user name. */ 00074 struct RCS_EXPORT RPC_GET_KEYS_REQUEST 00075 { 00076 char name[16]; 00077 }; 00078 00079 /* Structure returned by server to client after a get key. */ 00080 struct RCS_EXPORT RPC_GET_KEYS_REPLY 00081 { 00082 int status; /* Value of CMS::status after get key */ 00083 char key1[8]; 00084 char key2[8]; 00085 }; 00086 00087 /* Structure sent by client to server to set the access priveledges for this user. */ 00088 struct RCS_EXPORT RPC_LOGIN_REQUEST 00089 { 00090 char name[16]; 00091 char passwd[16]; 00092 }; 00093 00094 /* Structure returned by server to client after a get key. */ 00095 struct RCS_EXPORT RPC_LOGIN_REPLY 00096 { 00097 int status; /* Value of CMS::status after get key */ 00098 }; 00099 00100 00101 00102 extern "C" 00103 { 00104 extern bool_t RCS_EXPORT RCS_PASCAL 00105 xdr_RPC_READ_REQUEST (XDR RCS_FAR * xdrsp, 00106 RPC_READ_REQUEST RCS_FAR * buffer); 00107 extern bool_t RCS_EXPORT RCS_PASCAL 00108 xdr_RPC_READ_REPLY (XDR RCS_FAR * xdrsp, RPC_READ_REPLY RCS_FAR * buffer); 00109 extern bool_t RCS_EXPORT RCS_PASCAL 00110 xdr_RPC_WRITE_REQUEST (XDR RCS_FAR * xdrsp, 00111 RPC_WRITE_REQUEST RCS_FAR * buffer); 00112 extern bool_t RCS_EXPORT RCS_PASCAL 00113 xdr_RPC_WRITE_REPLY (XDR RCS_FAR * xdrsp, 00114 RPC_WRITE_REPLY RCS_FAR * buffer); 00115 extern bool_t RCS_EXPORT RCS_PASCAL 00116 xdr_RPC_GET_KEYS_REQUEST (XDR RCS_FAR * xdrsp, 00117 RPC_GET_KEYS_REQUEST RCS_FAR * buffer); 00118 extern bool_t RCS_EXPORT RCS_PASCAL 00119 xdr_RPC_GET_KEYS_REPLY (XDR RCS_FAR * xdrsp, 00120 RPC_GET_KEYS_REPLY RCS_FAR * buffer); 00121 extern bool_t RCS_EXPORT RCS_PASCAL 00122 xdr_RPC_LOGIN_REQUEST (XDR RCS_FAR * xdrsp, 00123 RPC_LOGIN_REQUEST RCS_FAR * buffer); 00124 extern bool_t RCS_EXPORT RCS_PASCAL 00125 xdr_RPC_LOGIN_REPLY (XDR RCS_FAR * xdrsp, 00126 RPC_LOGIN_REPLY RCS_FAR * buffer); 00127 00128 } 00129 00130 #endif