Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

rem_msg.hh

Go to the documentation of this file.
00001 /***************************************************************
00002 * File: rem_msg.hh
00003 * Purpose: Defines the structs passed between REMOTE clients and servers
00004 *  as part of CMS.
00005 * Includes:
00006 *         1. struct REMOTE_READ_REQUEST,  REMOTE_READ_REPLY,
00007 *       REMOTE_WRITE_REPLY, REMOTE_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 REM_MSG_HH
00017 #define REM_MSG_HH
00018 
00019 #include "rcs_defs.hh"          /* RCS_EXPORT, RCS_PASCAL, RCS_FAR */
00020 
00021 
00022 class RCS_EXPORT CMS_DIAGNOSTICS_INFO;
00023 struct RCS_EXPORT CMS_HEADER;
00024 
00025 
00026 struct RCS_EXPORT REMOTE_CMS_MESSAGE
00027 {
00028 };
00029 
00030 enum REMOTE_CMS_REQUEST_TYPE
00031 {
00032   NO_REMOTE_CMS_REQUEST = 0,
00033   REMOTE_CMS_READ_REQUEST_TYPE = 1,
00034   REMOTE_CMS_WRITE_REQUEST_TYPE,
00035   REMOTE_CMS_CHECK_IF_READ_REQUEST_TYPE,
00036   REMOTE_CMS_CLEAN_REQUEST_TYPE,
00037   REMOTE_CMS_CLEAR_REQUEST_TYPE,
00038   REMOTE_CMS_CLOSE_CHANNEL_REQUEST_TYPE,
00039   REMOTE_CMS_GET_KEYS_REQUEST_TYPE,
00040   REMOTE_CMS_LOGIN_REQUEST_TYPE,
00041   REMOTE_CMS_SET_SUBSCRIPTION_REQUEST_TYPE,
00042   REMOTE_CMS_READ_COMBINED_REQUEST_TYPE,
00043   REMOTE_CMS_BLOCKING_READ_REQUEST_TYPE,
00044   REMOTE_CMS_GET_BUF_NAME_REQUEST_TYPE,
00045   REMOTE_CMS_CANCEL_SUBSCRIPTION_REQUEST_TYPE,
00046   REMOTE_CMS_SET_DIAG_INFO_REQUEST_TYPE,
00047   REMOTE_CMS_GET_DIAG_INFO_REQUEST_TYPE,
00048   REMOTE_CMS_GET_MSG_COUNT_REQUEST_TYPE
00049 };
00050 
00051 struct RCS_EXPORT REMOTE_CMS_REQUEST:public REMOTE_CMS_MESSAGE
00052 {
00053   REMOTE_CMS_REQUEST (REMOTE_CMS_REQUEST_TYPE _type)
00054   {
00055     type = (int) _type;
00056     buffer_number = 0;
00057     subdiv = 0;
00058   };
00059   long buffer_number;
00060   int type;
00061   int subdiv;
00062 };
00063 
00064 struct RCS_EXPORT REMOTE_CMS_REPLY:public REMOTE_CMS_MESSAGE
00065 {
00066   REMOTE_CMS_REPLY ()
00067   {
00068     status = 0;
00069   };
00070   int status;
00071 };
00072 
00073 /* Structure sent by client to server to initiate a read. */
00074 struct RCS_EXPORT REMOTE_BLOCKING_READ_REQUEST:public REMOTE_CMS_REQUEST
00075 {
00076   REMOTE_BLOCKING_READ_REQUEST ():REMOTE_CMS_REQUEST
00077     (REMOTE_CMS_BLOCKING_READ_REQUEST_TYPE)
00078   {
00079   };
00080   int access_type;              /* read or just peek */
00081   long last_id_read;            /* The server can compare with id from buffer */
00082   /* to determine if the buffer is new */
00083   /* to this client */
00084   long timeout_millis;          /* Milliseconds for blocking_timeout or -1
00085                                  * to wait forever */
00086   void *_nml;
00087   void *_data;
00088   void *_reply;
00089 };
00090 
00091 /* Structure sent by client to server to initiate a read. */
00092 struct RCS_EXPORT REMOTE_GET_BUF_NAME_REQUEST:public REMOTE_CMS_REQUEST
00093 {
00094   REMOTE_GET_BUF_NAME_REQUEST ():REMOTE_CMS_REQUEST
00095     (REMOTE_CMS_GET_BUF_NAME_REQUEST_TYPE)
00096   {
00097   };
00098 };
00099 
00100 struct RCS_EXPORT REMOTE_READ_REQUEST:public REMOTE_CMS_REQUEST
00101 {
00102   REMOTE_READ_REQUEST ():REMOTE_CMS_REQUEST (REMOTE_CMS_READ_REQUEST_TYPE)
00103   {
00104   };
00105   int access_type;              /* read or just peek */
00106   long last_id_read;            /* The server can compare with id from buffer */
00107   /* to determine if the buffer is new */
00108   /* to this client */
00109 };
00110 
00111 
00112 /* Structure returned by server to client after a read. */
00113 struct RCS_EXPORT REMOTE_READ_REPLY:public REMOTE_CMS_REPLY
00114 {
00115   int size;                     /* size of message stored in data. */
00116   long write_id;                /* Id from the buffer. */
00117   long was_read;                /* Was this message already read? */
00118   void RCS_FAR *data;           /* Location of stored message. */
00119 };
00120 
00121 /* Structure returned by server to client after a read. */
00122 struct RCS_EXPORT REMOTE_GET_BUF_NAME_REPLY:public REMOTE_CMS_REPLY
00123 {
00124   char name[32];                /* Location of stored buffer name (truncated to 31 characters). */
00125 };
00126 
00127 
00128 /* Structure returned by server to client after a read. */
00129 struct RCS_EXPORT REMOTE_BLOCKING_READ_REPLY:public REMOTE_READ_REPLY
00130 {
00131 };
00132 
00133 /* Structure sent by client to server to initiate a write. */
00134 struct RCS_EXPORT REMOTE_WRITE_REQUEST:public REMOTE_CMS_REQUEST
00135 {
00136   REMOTE_WRITE_REQUEST ():REMOTE_CMS_REQUEST (REMOTE_CMS_WRITE_REQUEST_TYPE)
00137   {
00138     data = NULL;
00139     size = 0;
00140   };
00141   int access_type;              /* write or write_if_read */
00142   int size;                     /* size of message in data */
00143   void RCS_FAR *data;           /* location of message to write into buffer */
00144   void *_nml;
00145 };
00146 
00147 /* Structure returned by server to client after a write. */
00148 struct RCS_EXPORT REMOTE_WRITE_REPLY:public REMOTE_CMS_REPLY
00149 {
00150   long was_read;                /* Was the message to be overwriten ever read? */
00151 };
00152 
00153 struct RCS_EXPORT REMOTE_CHECK_IF_READ_REQUEST:public REMOTE_CMS_REQUEST
00154 {
00155   REMOTE_CHECK_IF_READ_REQUEST ():REMOTE_CMS_REQUEST
00156     (REMOTE_CMS_CHECK_IF_READ_REQUEST_TYPE)
00157   {
00158   };
00159 };
00160 
00161 struct RCS_EXPORT REMOTE_CHECK_IF_READ_REPLY:public REMOTE_CMS_REPLY
00162 {
00163   int was_read;
00164 };
00165 
00166 struct RCS_EXPORT REMOTE_CLEAR_REQUEST:public REMOTE_CMS_REQUEST
00167 {
00168   REMOTE_CLEAR_REQUEST ():REMOTE_CMS_REQUEST (REMOTE_CMS_CLEAR_REQUEST_TYPE)
00169   {
00170   };
00171 };
00172 
00173 struct RCS_EXPORT REMOTE_CLEAR_REPLY:public REMOTE_CMS_REPLY
00174 {
00175 };
00176 
00177 struct RCS_EXPORT REMOTE_CLOSE_CHANNEL_REQUEST:public REMOTE_CMS_REQUEST
00178 {
00179   REMOTE_CLOSE_CHANNEL_REQUEST ():REMOTE_CMS_REQUEST
00180     (REMOTE_CMS_CLOSE_CHANNEL_REQUEST_TYPE)
00181   {
00182   };
00183 };
00184 
00185 struct RCS_EXPORT REMOTE_CLOSE_CHANNEL_REPLY:public REMOTE_CMS_REPLY
00186 {
00187 };
00188 
00189 
00190 struct RCS_EXPORT REMOTE_GET_KEYS_REQUEST:public REMOTE_CMS_REQUEST
00191 {
00192   REMOTE_GET_KEYS_REQUEST ():REMOTE_CMS_REQUEST
00193     (REMOTE_CMS_GET_KEYS_REQUEST_TYPE)
00194   {
00195   };
00196   char name[16];
00197 };
00198 
00199 struct RCS_EXPORT REMOTE_GET_KEYS_REPLY:public REMOTE_CMS_REPLY
00200 {
00201   char key1[8];
00202   char key2[8];
00203 };
00204 
00205 struct RCS_EXPORT REMOTE_LOGIN_REQUEST:public REMOTE_CMS_REQUEST
00206 {
00207   REMOTE_LOGIN_REQUEST ():REMOTE_CMS_REQUEST (REMOTE_CMS_LOGIN_REQUEST_TYPE)
00208   {
00209   };
00210   char name[16];
00211   char passwd[16];
00212 };
00213 
00214 struct RCS_EXPORT REMOTE_LOGIN_REPLY:public REMOTE_CMS_REPLY
00215 {
00216   int success;                  // 1 = logged in, 0 = not
00217 };
00218 
00219 enum CMS_REMOTE_SUBSCRIPTION_REQUEST_TYPE
00220 {
00221   CMS_POLLED_SUBSCRIPTION = 1,
00222   CMS_NO_SUBSCRIPTION,
00223   CMS_VARIABLE_SUBSCRIPTION
00224 };
00225 
00226 struct RCS_EXPORT REMOTE_SET_SUBSCRIPTION_REQUEST:public REMOTE_CMS_REQUEST
00227 {
00228   REMOTE_SET_SUBSCRIPTION_REQUEST ():REMOTE_CMS_REQUEST
00229     (REMOTE_CMS_SET_SUBSCRIPTION_REQUEST_TYPE)
00230   {
00231   };
00232   int subscription_type;
00233   int poll_interval_millis;
00234   int last_id_read;
00235 };
00236 
00237 struct RCS_EXPORT REMOTE_SET_SUBSCRIPTION_REPLY:public REMOTE_CMS_REPLY
00238 {
00239   int success;                  // 1 = logged in, 0 = not
00240   int subscription_id;          // used by UDP clients to cancel a subscription.
00241 };
00242 
00243 
00244 struct RCS_EXPORT REMOTE_CANCEL_SUBSCRIPTION_REQUEST:public REMOTE_CMS_REQUEST
00245 {
00246   REMOTE_CANCEL_SUBSCRIPTION_REQUEST ():REMOTE_CMS_REQUEST
00247     (REMOTE_CMS_CANCEL_SUBSCRIPTION_REQUEST_TYPE)
00248   {
00249   };
00250   int subscription_id;
00251 };
00252 
00253 struct RCS_EXPORT REMOTE_CANCEL_SUBSCRIPTION_REPLY:public REMOTE_CMS_REPLY
00254 {
00255   int success;                  // 1 = logged in, 0 = not
00256   int subscription_id;          // used by UDP clients to cancel a subscription.
00257 };
00258 
00259 
00260 struct RCS_EXPORT REMOTE_SET_DIAG_INFO_REQUEST:public REMOTE_CMS_REQUEST
00261 {
00262   REMOTE_SET_DIAG_INFO_REQUEST ():REMOTE_CMS_REQUEST
00263     (REMOTE_CMS_SET_DIAG_INFO_REQUEST_TYPE)
00264   {
00265   };
00266   char process_name[16];
00267   char host_sysinfo[256];
00268   int pid;
00269   int c_num;
00270   double rcslib_ver;
00271   int reverse_flag;
00272   double bytes_moved;
00273   double bytes_moved_accross_socket;
00274 };
00275 
00276 
00277 /* Structure returned by server to client after a read. */
00278 struct RCS_EXPORT REMOTE_SET_DIAG_INFO_REPLY:public REMOTE_CMS_REPLY
00279 {
00280 };
00281 
00282 
00283 struct RCS_EXPORT REMOTE_GET_DIAG_INFO_REQUEST:public REMOTE_CMS_REQUEST
00284 {
00285   REMOTE_GET_DIAG_INFO_REQUEST ():REMOTE_CMS_REQUEST
00286     (REMOTE_CMS_GET_DIAG_INFO_REQUEST_TYPE)
00287   {
00288   };
00289 };
00290 
00291 
00292 /* Structure returned by server to client after a read. */
00293 struct RCS_EXPORT REMOTE_GET_DIAG_INFO_REPLY:public REMOTE_CMS_REPLY
00294 {
00295   CMS_DIAGNOSTICS_INFO *cdi;
00296 };
00297 
00298 
00299 struct RCS_EXPORT REMOTE_GET_MSG_COUNT_REQUEST:public REMOTE_CMS_REQUEST
00300 {
00301   REMOTE_GET_MSG_COUNT_REQUEST ():REMOTE_CMS_REQUEST
00302     (REMOTE_CMS_GET_MSG_COUNT_REQUEST_TYPE)
00303   {
00304   };
00305 };
00306 
00307 
00308 /* Structure returned by server to client after a read. */
00309 struct RCS_EXPORT REMOTE_GET_MSG_COUNT_REPLY:public REMOTE_CMS_REPLY
00310 {
00311   long count;
00312 };
00313 
00314 
00315 #if 0
00316 #define MAX_BUFFERS_FOR_COMBINED_READ 32
00317 
00318 /* Structure sent by client to server to initiate a read of multiple buffers. */
00319 struct RCS_EXPORT REMOTE_READ_COMBINED_REQUEST:public REMOTE_CMS_REQUEST
00320 {
00321   REMOTE_READ_COMBINED_REQUEST ():REMOTE_CMS_REQUEST
00322     (REMOTE_CMS_READ_COMBINED_REQUEST_TYPE)
00323   {
00324   };
00325   int access_type;              /* read or just peek */
00326   int num_buffers;
00327 
00328   struct combined_read_buf_req_info_struct
00329   {
00330     long buffer_number;
00331     long last_id_read;          /* The server can compare with id from buffer */
00332     /* to determine if the buffer is new */
00333     /* to this client */
00334     int header_only;            // non-zero means send only the header
00335   }
00336   combined_read_buf_req_info[MAX_BUFFERS_FOR_COMBINED_READ];
00337 
00338 };
00339 
00340 /* Structure returned by server to client after a read. */
00341 struct RCS_EXPORT REMOTE_READ_COMBINED_REPLY:public REMOTE_CMS_REPLY
00342 {
00343   int num_buffers;
00344 
00345   struct combined_read_buf_reply_info_struct
00346   {
00347     int size;                   /* size of message stored in data. */
00348     long write_id;              /* Id from the buffer. */
00349     long was_read;              /* Was this message already read? */
00350     void RCS_FAR *data;         /* Location of stored message. */
00351   }
00352   combined_read_buf_reply_info[MAX_BUFFERS_FOR_COMBINED_READ];
00353 };
00354 #endif
00355 
00356 #endif

Generated on Sun Dec 2 15:56:52 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001