00001 #include "rcs_defs.hh"
00002
00003 #ifdef VXWORKS
00004 extern "C"
00005 {
00006 #include <vxWorks.h>
00007 #include <rpc/rpctypes.h>
00008 #include <rpc/xdr.h>
00009 #if 0
00010
00011 #include <stdlib.h>
00012 #else
00013 #include <stddef.h>
00014 extern void *malloc (size_t size);
00015 #endif
00016 }
00017 #else
00018 extern "C"
00019 {
00020 #ifndef NO_DCE_RPC
00021 #include <rpc/types.h>
00022 #include <rpc/xdr.h>
00023 #endif
00024 #include <stdlib.h>
00025 }
00026 #endif
00027
00028 #ifdef NO_DCE_RPC
00029 #ifdef VXWORKS
00030 #include <rpc/xdr.h>
00031 #else
00032 #include "xdr.h"
00033 #endif
00034 #else
00035 #include "rpcintrf.h"
00036 #endif
00037
00038 #include "dbg_mem.h"
00039 #include "rem_msg.hh"
00040 #include "cms.hh"
00041
00042
00043 bool_t RCS_EXPORT
00044 xdr_REMOTE_READ_REQUEST (XDR RCS_FAR * xdrsp,
00045 REMOTE_READ_REQUEST RCS_FAR * buf)
00046 {
00047 bool_t catch_it;
00048 if ((NULL == buf) || (NULL == xdrsp))
00049 {
00050 return FALSE;
00051 }
00052 buf->type = REMOTE_CMS_READ_REQUEST_TYPE;
00053 catch_it = xdr_long (xdrsp, &buf->buffer_number);
00054 catch_it = xdr_int (xdrsp, &buf->access_type);
00055 catch_it = xdr_long (xdrsp, &buf->last_id_read);
00056 return (catch_it);
00057 }
00058
00059 bool_t RCS_EXPORT
00060 xdr_REMOTE_WRITE_REQUEST (XDR RCS_FAR * xdrsp,
00061 REMOTE_WRITE_REQUEST RCS_FAR * buf)
00062 {
00063 bool_t catch_it;
00064 if ((NULL == buf) || (NULL == xdrsp))
00065 {
00066 return FALSE;
00067 }
00068 buf->type = REMOTE_CMS_WRITE_REQUEST_TYPE;
00069 catch_it = xdr_long (xdrsp, &buf->buffer_number);
00070 catch_it = xdr_int (xdrsp, &buf->access_type);
00071 catch_it = xdr_int (xdrsp, &buf->size);
00072 if (NULL == buf->data)
00073 {
00074 buf->data = DEBUG_MALLOC (buf->size);
00075 }
00076 catch_it = xdr_opaque (xdrsp, (char *) buf->data, buf->size);
00077 return catch_it;
00078 }
00079
00080 bool_t RCS_EXPORT
00081 xdr_REMOTE_READ_REPLY (XDR RCS_FAR * xdrsp, REMOTE_READ_REPLY RCS_FAR * buf)
00082 {
00083 bool_t catch_it;
00084 if ((NULL == buf) || (NULL == xdrsp))
00085 {
00086 return FALSE;
00087 }
00088 catch_it = xdr_int (xdrsp, &buf->status);
00089 catch_it = xdr_int (xdrsp, &buf->size);
00090 catch_it = xdr_long (xdrsp, &buf->write_id);
00091 catch_it = xdr_long (xdrsp, &buf->was_read);
00092 if (0 < buf->size)
00093 {
00094 if (NULL == buf->data)
00095 {
00096 buf->data = DEBUG_MALLOC (buf->size);
00097 }
00098 catch_it = xdr_opaque (xdrsp, (char *) buf->data, buf->size);
00099 }
00100 return (catch_it);
00101 }
00102
00103 bool_t RCS_EXPORT
00104 xdr_REMOTE_WRITE_REPLY (XDR RCS_FAR * xdrsp, REMOTE_WRITE_REPLY RCS_FAR * buf)
00105 {
00106 bool_t catch_it;
00107 if ((NULL == buf) || (NULL == xdrsp))
00108 {
00109 return FALSE;
00110 }
00111 catch_it = xdr_int (xdrsp, &buf->status);
00112 catch_it = xdr_long (xdrsp, &buf->was_read);
00113 return (catch_it);
00114 }
00115
00116
00117
00118
00119 bool_t RCS_EXPORT RCS_PASCAL
00120 xdr_REMOTE_READ_REQUEST_PASCAL (XDR RCS_FAR * xdrsp,
00121 REMOTE_READ_REQUEST RCS_FAR * buf)
00122 {
00123 bool_t catch_it;
00124 if ((NULL == buf) || (NULL == xdrsp))
00125 {
00126 return FALSE;
00127 }
00128 buf->type = REMOTE_CMS_READ_REQUEST_TYPE;
00129 catch_it = xdr_long (xdrsp, &buf->buffer_number);
00130 catch_it = xdr_int (xdrsp, &buf->access_type);
00131 catch_it = xdr_long (xdrsp, &buf->last_id_read);
00132 return (catch_it);
00133 }
00134
00135 bool_t RCS_EXPORT RCS_PASCAL
00136 xdr_REMOTE_WRITE_REQUEST_PASCAL (XDR RCS_FAR * xdrsp,
00137 REMOTE_WRITE_REQUEST RCS_FAR * buf)
00138 {
00139 bool_t catch_it;
00140 if ((NULL == buf) || (NULL == xdrsp))
00141 {
00142 return FALSE;
00143 }
00144 buf->type = REMOTE_CMS_WRITE_REQUEST_TYPE;
00145 catch_it = xdr_long (xdrsp, &buf->buffer_number);
00146 catch_it = xdr_int (xdrsp, &buf->access_type);
00147 catch_it = xdr_int (xdrsp, &buf->size);
00148 if (NULL == buf->data)
00149 {
00150 buf->data = DEBUG_MALLOC (buf->size);
00151 }
00152 catch_it = xdr_opaque (xdrsp, (char *) buf->data, buf->size);
00153 return catch_it;
00154 }
00155
00156 bool_t RCS_EXPORT RCS_PASCAL
00157 xdr_REMOTE_READ_REPLY_PASCAL (XDR RCS_FAR * xdrsp,
00158 REMOTE_READ_REPLY RCS_FAR * buf)
00159 {
00160 bool_t catch_it;
00161 if ((NULL == buf) || (NULL == xdrsp))
00162 {
00163 return FALSE;
00164 }
00165 catch_it = xdr_int (xdrsp, &buf->status);
00166 catch_it = xdr_int (xdrsp, &buf->size);
00167 catch_it = xdr_long (xdrsp, &buf->write_id);
00168 catch_it = xdr_long (xdrsp, &buf->was_read);
00169 if (0 < buf->size)
00170 {
00171 if (NULL == buf->data)
00172 {
00173 buf->data = DEBUG_MALLOC (buf->size);
00174 }
00175 catch_it = xdr_opaque (xdrsp, (char *) buf->data, buf->size);
00176 }
00177 return (catch_it);
00178 }
00179
00180 bool_t RCS_EXPORT RCS_PASCAL
00181 xdr_REMOTE_WRITE_REPLY_PASCAL (XDR RCS_FAR * xdrsp,
00182 REMOTE_WRITE_REPLY RCS_FAR * buf)
00183 {
00184 bool_t catch_it;
00185 if ((NULL == buf) || (NULL == xdrsp))
00186 {
00187 return FALSE;
00188 }
00189 catch_it = xdr_int (xdrsp, &buf->status);
00190 catch_it = xdr_long (xdrsp, &buf->was_read);
00191 return (catch_it);
00192 }
00193
00194
00195 bool_t RCS_EXPORT RCS_PASCAL
00196 xdr_REMOTE_GET_KEYS_REPLY_PASCAL (XDR RCS_FAR * xdrsp,
00197 REMOTE_GET_KEYS_REPLY RCS_FAR * buf)
00198 {
00199 bool_t catch_it;
00200 if ((NULL == buf) || (NULL == xdrsp))
00201 {
00202 return FALSE;
00203 }
00204 catch_it = xdr_opaque (xdrsp, (char *) buf->key1, 8);
00205 catch_it = xdr_opaque (xdrsp, (char *) buf->key2, 8);
00206 return (catch_it);
00207 }
00208
00209
00210 bool_t RCS_EXPORT
00211 xdr_REMOTE_GET_KEYS_REPLY (XDR RCS_FAR * xdrsp,
00212 REMOTE_GET_KEYS_REPLY RCS_FAR * buf)
00213 {
00214 bool_t catch_it;
00215 if ((NULL == buf) || (NULL == xdrsp))
00216 {
00217 return FALSE;
00218 }
00219 catch_it = xdr_opaque (xdrsp, (char *) buf->key1, 8);
00220 catch_it = xdr_opaque (xdrsp, (char *) buf->key2, 8);
00221 return (catch_it);
00222 }
00223
00224 bool_t RCS_EXPORT RCS_PASCAL
00225 xdr_REMOTE_LOGIN_REPLY_PASCAL (XDR RCS_FAR * xdrsp,
00226 REMOTE_LOGIN_REPLY RCS_FAR * buf)
00227 {
00228 bool_t catch_it;
00229 if ((NULL == buf) || (NULL == xdrsp))
00230 {
00231 return FALSE;
00232 }
00233 catch_it = xdr_int (xdrsp, &buf->success);
00234 return (catch_it);
00235 }
00236
00237
00238 bool_t RCS_EXPORT
00239 xdr_REMOTE_LOGIN_REPLY (XDR RCS_FAR * xdrsp, REMOTE_LOGIN_REPLY RCS_FAR * buf)
00240 {
00241 bool_t catch_it;
00242 if ((NULL == buf) || (NULL == xdrsp))
00243 {
00244 return FALSE;
00245 }
00246 catch_it = xdr_int (xdrsp, &buf->success);
00247 return (catch_it);
00248 }
00249
00250 bool_t RCS_EXPORT RCS_PASCAL
00251 xdr_REMOTE_SET_SUBSCRIPTION_REPLY_PASCAL (XDR RCS_FAR * xdrsp,
00252 REMOTE_SET_SUBSCRIPTION_REPLY
00253 RCS_FAR * buf)
00254 {
00255 bool_t catch_it;
00256 if ((NULL == buf) || (NULL == xdrsp))
00257 {
00258 return FALSE;
00259 }
00260 catch_it = xdr_int (xdrsp, &buf->success);
00261 return (catch_it);
00262 }
00263
00264
00265 bool_t RCS_EXPORT
00266 xdr_REMOTE_SET_SUBSCRIPTION_REPLY (XDR RCS_FAR * xdrsp,
00267 REMOTE_SET_SUBSCRIPTION_REPLY RCS_FAR *
00268 buf)
00269 {
00270 bool_t catch_it;
00271 if ((NULL == buf) || (NULL == xdrsp))
00272 {
00273 return FALSE;
00274 }
00275 catch_it = xdr_int (xdrsp, &buf->success);
00276 return (catch_it);
00277 }
00278
00279 bool_t RCS_EXPORT
00280 xdr_REMOTE_GET_KEYS_REQUEST (XDR RCS_FAR * xdrsp,
00281 REMOTE_GET_KEYS_REQUEST RCS_FAR * buf)
00282 {
00283 bool_t catch_it;
00284 if ((NULL == buf) || (NULL == xdrsp))
00285 {
00286 return FALSE;
00287 }
00288 buf->type = REMOTE_CMS_GET_KEYS_REQUEST_TYPE;
00289 catch_it = xdr_opaque (xdrsp, (char *) buf->name, 16);
00290 return catch_it;
00291 }
00292
00293 bool_t RCS_EXPORT RCS_PASCAL
00294 xdr_REMOTE_GET_KEYS_REQUEST_PASCAL (XDR RCS_FAR * xdrsp,
00295 REMOTE_GET_KEYS_REQUEST RCS_FAR * buf)
00296 {
00297 bool_t catch_it;
00298 if ((NULL == buf) || (NULL == xdrsp))
00299 {
00300 return FALSE;
00301 }
00302 buf->type = REMOTE_CMS_GET_KEYS_REQUEST_TYPE;
00303 catch_it = xdr_opaque (xdrsp, (char *) buf->name, 16);
00304 return catch_it;
00305 }
00306
00307
00308 bool_t RCS_EXPORT
00309 xdr_REMOTE_LOGIN_REQUEST (XDR RCS_FAR * xdrsp,
00310 REMOTE_LOGIN_REQUEST RCS_FAR * buf)
00311 {
00312 bool_t catch_it;
00313 if ((NULL == buf) || (NULL == xdrsp))
00314 {
00315 return FALSE;
00316 }
00317 buf->type = REMOTE_CMS_LOGIN_REQUEST_TYPE;
00318 catch_it = xdr_opaque (xdrsp, (char *) buf->name, 16);
00319 catch_it = xdr_opaque (xdrsp, (char *) buf->passwd, 16);
00320 return catch_it;
00321 }
00322
00323 bool_t RCS_EXPORT RCS_PASCAL
00324 xdr_REMOTE_LOGIN_REQUEST_PASCAL (XDR RCS_FAR * xdrsp,
00325 REMOTE_LOGIN_REQUEST RCS_FAR * buf)
00326 {
00327 bool_t catch_it;
00328 if ((NULL == buf) || (NULL == xdrsp))
00329 {
00330 return FALSE;
00331 }
00332 buf->type = REMOTE_CMS_LOGIN_REQUEST_TYPE;
00333 catch_it = xdr_opaque (xdrsp, (char *) buf->name, 16);
00334 catch_it = xdr_opaque (xdrsp, (char *) buf->passwd, 16);
00335 return catch_it;
00336 }
00337
00338 bool_t RCS_EXPORT
00339 xdr_REMOTE_SET_SUBSCRIPTION_REQUEST (XDR RCS_FAR * xdrsp,
00340 REMOTE_SET_SUBSCRIPTION_REQUEST RCS_FAR *
00341 buf)
00342 {
00343 bool_t catch_it;
00344 if ((NULL == buf) || (NULL == xdrsp))
00345 {
00346 return FALSE;
00347 }
00348 buf->type = REMOTE_CMS_SET_SUBSCRIPTION_REQUEST_TYPE;
00349 catch_it = xdr_int (xdrsp, &buf->subscription_type);
00350 catch_it = xdr_int (xdrsp, &buf->poll_interval_millis);
00351 return catch_it;
00352 }
00353
00354 bool_t RCS_EXPORT RCS_PASCAL
00355 xdr_REMOTE_SET_SUBSCRIPTION_REQUEST_PASCAL (XDR RCS_FAR * xdrsp,
00356 REMOTE_SET_SUBSCRIPTION_REQUEST
00357 RCS_FAR * buf)
00358 {
00359 bool_t catch_it;
00360 if ((NULL == buf) || (NULL == xdrsp))
00361 {
00362 return FALSE;
00363 }
00364 buf->type = REMOTE_CMS_SET_SUBSCRIPTION_REQUEST_TYPE;
00365 catch_it = xdr_int (xdrsp, &buf->subscription_type);
00366 catch_it = xdr_int (xdrsp, &buf->poll_interval_millis);
00367 return catch_it;
00368 }